From 323dfcbc82c64ec65c180a82c617efb558604d6c Mon Sep 17 00:00:00 2001 From: cnst Date: Sat, 19 Jul 2025 12:25:07 +0200 Subject: [PATCH] options to settings --- hosts/bunk/default.nix | 2 +- hosts/bunk/options.nix | 41 ------------------ hosts/bunk/settings.nix | 43 +++++++++++++++++++ hosts/default.nix | 8 ++-- hosts/kima/default.nix | 2 +- hosts/kima/options.nix | 41 ------------------ hosts/kima/settings.nix | 43 +++++++++++++++++++ hosts/sobotka/default.nix | 2 +- hosts/sobotka/options.nix | 7 --- hosts/sobotka/settings.nix | 9 ++++ hosts/toothpc/default.nix | 2 +- hosts/toothpc/options.nix | 22 ---------- hosts/toothpc/settings.nix | 24 +++++++++++ modules/default.nix | 8 ++-- modules/home/programs/git/default.nix | 6 +-- modules/home/programs/hyprlock/default.nix | 2 +- modules/home/services/hyprpaper/default.nix | 8 ++-- modules/nixos/programs/hyprland/layout.nix | 4 +- .../accounts/default.nix | 4 +- .../monitors/default.nix | 8 +--- .../{options => settings}/theme/default.nix | 8 +--- 21 files changed, 147 insertions(+), 147 deletions(-) delete mode 100644 hosts/bunk/options.nix create mode 100644 hosts/bunk/settings.nix delete mode 100644 hosts/kima/options.nix create mode 100644 hosts/kima/settings.nix delete mode 100644 hosts/sobotka/options.nix create mode 100644 hosts/sobotka/settings.nix delete mode 100644 hosts/toothpc/options.nix create mode 100644 hosts/toothpc/settings.nix rename modules/{options => settings}/accounts/default.nix (94%) rename modules/{options => settings}/monitors/default.nix (95%) rename modules/{options => settings}/theme/default.nix (91%) diff --git a/hosts/bunk/default.nix b/hosts/bunk/default.nix index 62cff33d..c9ef7162 100644 --- a/hosts/bunk/default.nix +++ b/hosts/bunk/default.nix @@ -33,7 +33,7 @@ in { imports = [ ./hardware-configuration.nix ./modules.nix - ./options.nix + ./settings.nix ]; networking.hostName = "bunk"; diff --git a/hosts/bunk/options.nix b/hosts/bunk/options.nix deleted file mode 100644 index ec263507..00000000 --- a/hosts/bunk/options.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - accounts = { - username = "cnst"; - mail = "adam@cnst.dev"; - sshUser = "bunk"; - }; - monitors = [ - { - name = "DP-3"; - width = 2560; - height = 1440; - refreshRate = 240; - position = "0x0"; - transform = 0; - bitDepth = 10; - workspace = "1"; - } - { - name = "HDMI-A-1"; - width = 1920; - height = 1080; - refreshRate = 60; - position = "2560x0"; - # transform = 3; - workspace = "5"; - } - { - name = "eDP-1"; - width = 1920; - height = 1200; - refreshRate = 60; - workspace = "1"; - } - ]; - theme = { - background = { - lockscreen = "wallpaper_2"; - desktop = "wallpaper_1"; - }; - }; -} diff --git a/hosts/bunk/settings.nix b/hosts/bunk/settings.nix new file mode 100644 index 00000000..5712b2d4 --- /dev/null +++ b/hosts/bunk/settings.nix @@ -0,0 +1,43 @@ +{ + settings = { + accounts = { + username = "cnst"; + mail = "adam@cnst.dev"; + sshUser = "bunk"; + }; + monitors = [ + { + name = "DP-3"; + width = 2560; + height = 1440; + refreshRate = 240; + position = "0x0"; + transform = 0; + bitDepth = 10; + workspace = "1"; + } + { + name = "HDMI-A-1"; + width = 1920; + height = 1080; + refreshRate = 60; + position = "2560x0"; + # transform = 3; + workspace = "5"; + } + { + name = "eDP-1"; + width = 1920; + height = 1200; + refreshRate = 60; + workspace = "1"; + } + ]; + theme = { + background = { + lockscreen = "wallpaper_2"; + desktop = "wallpaper_1"; + }; + }; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix index d1fc95a1..3a9013b7 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -35,7 +35,7 @@ }; } self.nixosModules.nixos - self.nixosModules.options + self.nixosModules.settings inputs.chaotic.nixosModules.default inputs.agenix.nixosModules.default ]; @@ -52,7 +52,7 @@ }; } self.nixosModules.nixos - self.nixosModules.options + self.nixosModules.settings inputs.chaotic.nixosModules.default inputs.agenix.nixosModules.default ]; @@ -69,7 +69,7 @@ }; } self.nixosModules.nixos - self.nixosModules.options + self.nixosModules.settings self.nixosModules.server inputs.agenix.nixosModules.default ]; @@ -86,7 +86,7 @@ }; } self.nixosModules.nixos - self.nixosModules.options + self.nixosModules.settings inputs.chaotic.nixosModules.default inputs.agenix.nixosModules.default ]; diff --git a/hosts/kima/default.nix b/hosts/kima/default.nix index 639be5b4..765a5e11 100644 --- a/hosts/kima/default.nix +++ b/hosts/kima/default.nix @@ -33,7 +33,7 @@ in { imports = [ ./hardware-configuration.nix ./modules.nix - ./options.nix + ./settings.nix ]; time.hardwareClockInLocalTime = true; diff --git a/hosts/kima/options.nix b/hosts/kima/options.nix deleted file mode 100644 index 82a835c7..00000000 --- a/hosts/kima/options.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - accounts = { - username = "cnst"; - mail = "adam@cnst.dev"; - sshUser = "kima"; - }; - monitors = [ - { - name = "DP-3"; - width = 2560; - height = 1440; - refreshRate = 240; - position = "0x0"; - transform = 0; - bitDepth = 10; - workspace = "1"; - } - { - name = "HDMI-A-1"; - width = 1920; - height = 1080; - refreshRate = 60; - position = "2560x0"; - # transform = 3; - workspace = "5"; - } - { - name = "eDP-1"; - width = 1920; - height = 1200; - refreshRate = 60; - workspace = "1"; - } - ]; - theme = { - background = { - lockscreen = "wallpaper_2"; - desktop = "wallpaper_1"; - }; - }; -} diff --git a/hosts/kima/settings.nix b/hosts/kima/settings.nix new file mode 100644 index 00000000..4f817a36 --- /dev/null +++ b/hosts/kima/settings.nix @@ -0,0 +1,43 @@ +{ + settings = { + accounts = { + username = "cnst"; + mail = "adam@cnst.dev"; + sshUser = "kima"; + }; + monitors = [ + { + name = "DP-3"; + width = 2560; + height = 1440; + refreshRate = 240; + position = "0x0"; + transform = 0; + bitDepth = 10; + workspace = "1"; + } + { + name = "HDMI-A-1"; + width = 1920; + height = 1080; + refreshRate = 60; + position = "2560x0"; + # transform = 3; + workspace = "5"; + } + { + name = "eDP-1"; + width = 1920; + height = 1200; + refreshRate = 60; + workspace = "1"; + } + ]; + theme = { + background = { + lockscreen = "wallpaper_2"; + desktop = "wallpaper_1"; + }; + }; + }; +} diff --git a/hosts/sobotka/default.nix b/hosts/sobotka/default.nix index 864bcdda..b75cd535 100644 --- a/hosts/sobotka/default.nix +++ b/hosts/sobotka/default.nix @@ -35,7 +35,7 @@ in { imports = [ ./hardware-configuration.nix ./modules.nix - ./options.nix + ./settings.nix ./server.nix ]; diff --git a/hosts/sobotka/options.nix b/hosts/sobotka/options.nix deleted file mode 100644 index 8926b95c..00000000 --- a/hosts/sobotka/options.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - accounts = { - username = "cnst"; - mail = "adam@cnst.dev"; - sshUser = "sobotka"; - }; -} diff --git a/hosts/sobotka/settings.nix b/hosts/sobotka/settings.nix new file mode 100644 index 00000000..3c42b75d --- /dev/null +++ b/hosts/sobotka/settings.nix @@ -0,0 +1,9 @@ +{ + settings = { + accounts = { + username = "cnst"; + mail = "adam@cnst.dev"; + sshUser = "sobotka"; + }; + }; +} diff --git a/hosts/toothpc/default.nix b/hosts/toothpc/default.nix index 54b6a42d..9ae5a548 100644 --- a/hosts/toothpc/default.nix +++ b/hosts/toothpc/default.nix @@ -33,7 +33,7 @@ in { imports = [ ./hardware-configuration.nix ./modules.nix - ./options.nix + ./settings.nix ]; networking.hostName = "toothpc"; diff --git a/hosts/toothpc/options.nix b/hosts/toothpc/options.nix deleted file mode 100644 index 8e9ab9a1..00000000 --- a/hosts/toothpc/options.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - accounts = { - username = "toothpick"; - mail = "place@holder"; - sshUser = "toothpc"; - }; - monitors = [ - { - name = "DVI-D-1"; - width = 1920; - height = 1080; - refreshRate = 144; - workspace = "1"; - } - ]; - theme = { - background = { - lockscreen = "wallpaper_2"; - desktop = "wallpaper_1"; - }; - }; -} diff --git a/hosts/toothpc/settings.nix b/hosts/toothpc/settings.nix new file mode 100644 index 00000000..3ee99687 --- /dev/null +++ b/hosts/toothpc/settings.nix @@ -0,0 +1,24 @@ +{ + settings = { + accounts = { + username = "toothpick"; + mail = "place@holder"; + sshUser = "toothpc"; + }; + monitors = [ + { + name = "DVI-D-1"; + width = 1920; + height = 1080; + refreshRate = 144; + workspace = "1"; + } + ]; + theme = { + background = { + lockscreen = "wallpaper_2"; + desktop = "wallpaper_1"; + }; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 01883150..f3e10667 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -126,11 +126,11 @@ ./server/vaultwarden ]; }; - options = { + settings = { imports = [ - ./options/accounts - ./options/monitors - ./options/theme + ./settings/accounts + ./settings/monitors + ./settings/theme ]; }; }; diff --git a/modules/home/programs/git/default.nix b/modules/home/programs/git/default.nix index 4fd5935d..9e5a4fc6 100644 --- a/modules/home/programs/git/default.nix +++ b/modules/home/programs/git/default.nix @@ -15,8 +15,8 @@ in { home.packages = [pkgs.gh]; programs.git = { enable = true; - userName = osConfig.accounts.username; - userEmail = osConfig.accounts.mail; + userName = osConfig.settings.accounts.username; + userEmail = osConfig.settings.accounts.mail; delta = { enable = true; options.dark = true; @@ -54,7 +54,7 @@ in { ]; }; xdg.configFile."git/allowed_signers".text = '' - ${osConfig.accounts.mail} namespaces="git" ${osConfig.accounts.sshKey} + ${osConfig.settings.accounts.mail} namespaces="git" ${osConfig.settings.accounts.sshKey} ''; }; } diff --git a/modules/home/programs/hyprlock/default.nix b/modules/home/programs/hyprlock/default.nix index b374c536..81559351 100644 --- a/modules/home/programs/hyprlock/default.nix +++ b/modules/home/programs/hyprlock/default.nix @@ -31,7 +31,7 @@ in { background = [ { monitor = ""; - path = osConfig.theme.background.lockscreen; + path = osConfig.settings.theme.background.lockscreen; } ]; input-field = [ diff --git a/modules/home/services/hyprpaper/default.nix b/modules/home/services/hyprpaper/default.nix index 8380e96c..72d0274f 100644 --- a/modules/home/services/hyprpaper/default.nix +++ b/modules/home/services/hyprpaper/default.nix @@ -43,12 +43,12 @@ in { wallpaper = [ # kima - "DP-3,${osConfig.theme.background.desktop}" - "HDMI-A-1,${osConfig.theme.background.lockscreen}" + "DP-3,${osConfig.settings.theme.background.desktop}" + "HDMI-A-1,${osConfig.settings.theme.background.lockscreen}" # bunk - "eDP-1,${osConfig.theme.background.desktop}" + "eDP-1,${osConfig.settings.theme.background.desktop}" # toothpc - "DVI-D-1,${osConfig.theme.background.desktop}" + "DVI-D-1,${osConfig.settings.theme.background.desktop}" ]; }; }; diff --git a/modules/nixos/programs/hyprland/layout.nix b/modules/nixos/programs/hyprland/layout.nix index a76ca259..bf42a4b0 100644 --- a/modules/nixos/programs/hyprland/layout.nix +++ b/modules/nixos/programs/hyprland/layout.nix @@ -39,11 +39,11 @@ in { else "disable" }" ) - config.monitors; + config.settings.monitors; workspace = map ( m: "${m.workspace},monitor:${m.name}" - ) (lib.filter (m: m.enabled && m.workspace != null) config.monitors); + ) (lib.filter (m: m.enabled && m.workspace != null) config.settings.monitors); windowrule = [ "size 843 650, initialTitle:^(floatcal)$" diff --git a/modules/options/accounts/default.nix b/modules/settings/accounts/default.nix similarity index 94% rename from modules/options/accounts/default.nix rename to modules/settings/accounts/default.nix index 83617895..fbd59e9d 100644 --- a/modules/options/accounts/default.nix +++ b/modules/settings/accounts/default.nix @@ -12,7 +12,7 @@ toothpc = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGu5vZbb5ExampleKeyHereGfDF9c5 toothpick@toothpc"; }; - keyName = config.accounts.sshUser or null; + keyName = config.settings.accounts.sshUser or null; selectedKey = if keyName != null @@ -23,7 +23,7 @@ sshKeys else builtins.abort "No accounts.sshUser provided, cannot select SSH key."; in { - options.accounts = { + options.settings.accounts = { username = mkOption { type = types.str; default = "cnst"; diff --git a/modules/options/monitors/default.nix b/modules/settings/monitors/default.nix similarity index 95% rename from modules/options/monitors/default.nix rename to modules/settings/monitors/default.nix index 0a111128..a64889b7 100644 --- a/modules/options/monitors/default.nix +++ b/modules/settings/monitors/default.nix @@ -1,12 +1,8 @@ # Yanked from Misterio77 -{ - lib, - config, - ... -}: let +{lib, ...}: let inherit (lib) mkOption types; in { - options.monitors = mkOption { + options.settings.monitors = mkOption { type = types.listOf ( types.submodule { options = { diff --git a/modules/options/theme/default.nix b/modules/settings/theme/default.nix similarity index 91% rename from modules/options/theme/default.nix rename to modules/settings/theme/default.nix index f9af5f45..d76a79bc 100644 --- a/modules/options/theme/default.nix +++ b/modules/settings/theme/default.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{lib, ...}: let inherit (lib) mkOption types; bgs = { wallpaper_1 = "~/media/images/bg_1.jpg"; @@ -11,7 +7,7 @@ }; bgList = builtins.attrNames bgs; in { - options.theme = { + options.settings.theme = { background = { lockscreen = mkOption { type = types.enum bgList;