From 1635b0c8450aeae86bd817fe2b7971111d8d957c Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 31 Jan 2025 01:49:36 -0600 Subject: [PATCH] feat: added other user themes --- config/default.nix | 2 +- config/devices/config/bartholomew.nix | 19 ++++ config/themes/default.nix | 11 ++- flake.lock | 60 ++++++------ flake.nix | 18 +++- home/default.nix | 25 +++++ .../cli/shell/starship/config/settings.nix | 22 ++++- home/modules/cli/shell/starship/default.nix | 8 +- .../cli/utilities/bottom/config/settings.nix | 24 ++++- home/modules/cli/utilities/bottom/default.nix | 12 +-- .../userSettings/config/theme/default.nix | 27 ++++-- .../code/zed/config/userSettings/default.nix | 3 +- home/modules/gui/apps/code/zed/default.nix | 10 +- .../apps/emulators/ghostty/config/themes.nix | 27 ++++-- .../gui/apps/emulators/ghostty/default.nix | 14 +-- .../gui/desktop/dunst/config/settings.nix | 24 ++++- home/modules/gui/desktop/dunst/default.nix | 12 +-- .../gui/desktop/hyprland/config/general.nix | 27 ++++-- home/modules/gui/desktop/hyprland/default.nix | 2 +- .../gui/desktop/swaylock/config/settings.nix | 24 ++++- home/modules/gui/desktop/swaylock/default.nix | 12 +-- .../gui/desktop/tofi/config/settings.nix | 28 ++++-- home/modules/gui/desktop/tofi/default.nix | 4 +- .../gui/desktop/waybar/config/style.nix | 28 ++++-- home/modules/gui/desktop/waybar/default.nix | 7 +- nixos/default.nix | 24 ++++- nixos/modules/doas.nix | 4 + nixos/modules/gnome.nix | 20 ++-- nixos/modules/sops.nix | 41 +++++---- nixos/modules/ssh.nix | 14 ++- profiles/user0/default.nix | 1 + profiles/user1/default.nix | 1 + profiles/user2/default.nix | 1 + systems/bartholomew/config/boot.nix | 44 +++++++++ systems/bartholomew/config/filesystem.nix | 30 ++++++ systems/bartholomew/config/graphics.nix | 12 +++ systems/bartholomew/config/hardware.nix | 17 ++++ systems/bartholomew/config/networking.nix | 35 +++++++ systems/bartholomew/default.nix | 17 ++++ systems/desktop/config/filesystem.nix | 92 +++++++++---------- 40 files changed, 593 insertions(+), 210 deletions(-) create mode 100755 config/devices/config/bartholomew.nix create mode 100755 systems/bartholomew/config/boot.nix create mode 100755 systems/bartholomew/config/filesystem.nix create mode 100755 systems/bartholomew/config/graphics.nix create mode 100755 systems/bartholomew/config/hardware.nix create mode 100755 systems/bartholomew/config/networking.nix create mode 100755 systems/bartholomew/default.nix diff --git a/config/default.nix b/config/default.nix index 119284b..817ae89 100755 --- a/config/default.nix +++ b/config/default.nix @@ -93,7 +93,7 @@ let themesSubmodule = lib.types.submodule { options = { - currentThemes = genOptions stringType "theme"; + currentTheme = genOptions stringType "theme"; fonts = { names = genOptions stringType "name"; sizes = { diff --git a/config/devices/config/bartholomew.nix b/config/devices/config/bartholomew.nix new file mode 100755 index 0000000..38f487d --- /dev/null +++ b/config/devices/config/bartholomew.nix @@ -0,0 +1,19 @@ +{ devicesFunctions }: +let + inherit (devicesFunctions) + ownerExclusiveReadWriteMask + ; +in +{ + label = "Bartholomew"; + name = "bartholomew"; + sync = { + address0 = ""; + }; + ip = { + address0 = "192.168.50.42"; + }; + boot = { + options = ownerExclusiveReadWriteMask; + }; +} diff --git a/config/themes/default.nix b/config/themes/default.nix index 9cce4f0..6de7eee 100755 --- a/config/themes/default.nix +++ b/config/themes/default.nix @@ -1,6 +1,7 @@ let - currentTheme0 = catppuccin-mocha; - currentTheme1 = catppuccin-macchiato; + currentTheme0 = catppuccin-mocha; # User0 Theme + currentTheme1 = catppuccin-mocha; # User1 Theme + currentTheme2 = catppuccin-mocha; # User2 Theme brogrammer = "brogrammer"; catppuccin-frappe = "catppuccin-frappe"; @@ -23,8 +24,10 @@ let in { themes = { - currentThemes = { - theme0 = currentTheme0; + currentTheme = { + theme0 = currentTheme0; # User0 Theme + theme1 = currentTheme1; # User1 Theme + theme2 = currentTheme2; # User2 Theme }; cursor = { name = ""; diff --git a/flake.lock b/flake.lock index bb4bfe5..ed5b908 100755 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1737636397, - "narHash": "sha256-F5MbBj3QVorycVSFE9qjuOTLtIQBqt2VWbXa0uwzm98=", + "lastModified": 1738183445, + "narHash": "sha256-C1He3N1SA8D2u+TSlldbA9wiYwDvXI4GxX3zKaeD7qU=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "7fe006981fae53e931f513026fc754e322f13145", + "rev": "48a000cf35dd10bfeb231152735aebbe875f4b74", "type": "github" }, "original": { @@ -410,11 +410,11 @@ "zig": "zig" }, "locked": { - "lastModified": 1738076396, - "narHash": "sha256-EHGwh2do2JEcYHxaXBq1H7z/S2FkbHEpnNWhvgAmpJ8=", + "lastModified": 1738275804, + "narHash": "sha256-n9cSCLlWjc8Bc5QyZYLo5+c6MfTZjgDpUGx/FGxBiY8=", "owner": "ghostty-org", "repo": "ghostty", - "rev": "603639ad44e82afbcd8cdb01d7050abf7c538e9b", + "rev": "c5508e7d1922842ecd3160ea73b97da1282168b3", "type": "github" }, "original": { @@ -520,11 +520,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1738073973, - "narHash": "sha256-+Bjgq2LuCrFQ8RA/25dWSAguFLH53TxoQZWuX7fb4gc=", + "lastModified": 1738284694, + "narHash": "sha256-vLDweuBMu8fOyo9YMiV/1p9gxH5/OVm8zKRkGpbcuUA=", "owner": "helix-editor", "repo": "helix", - "rev": "6049f2035be3e218da327b51d8e4bfd36242dd43", + "rev": "025719c1d82fd32a82d8d8a4a138842ed92480c1", "type": "github" }, "original": { @@ -567,11 +567,11 @@ ] }, "locked": { - "lastModified": 1737968762, - "narHash": "sha256-xiPARGKwocaMtv+U/rgi+h2g56CZZEmrcl7ldRaslq8=", + "lastModified": 1738275749, + "narHash": "sha256-PM+cGduJ05EZ+YXulqAwUFjvfKpPmW080mcuN6R1POw=", "owner": "nix-community", "repo": "home-manager", - "rev": "e1ae908bcc30af792b0bb0a52e53b03d2577255e", + "rev": "a8159195bfaef3c64df75d3b1e6a68d49d392be9", "type": "github" }, "original": { @@ -596,11 +596,11 @@ ] }, "locked": { - "lastModified": 1737634937, - "narHash": "sha256-Ffw4ujFpi++6pPHe+gCBOfDgAoNlzVPZN6MReC1beu8=", + "lastModified": 1738178255, + "narHash": "sha256-+D6Nu2ewXbMTFzx/Q4jDOo+LAOUPr0cxQJg5k33daIE=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "9c5dd1f7c825ee47f72727ad0a4e16ca46a2688e", + "rev": "dcadd3398abe146d60c67e0d9ee6e27b301cae82", "type": "github" }, "original": { @@ -625,11 +625,11 @@ ] }, "locked": { - "lastModified": 1737985436, - "narHash": "sha256-zx8FdI4zr2GhNyD1YGAqa2ymodAObTSAdwuWwVucewo=", + "lastModified": 1738018829, + "narHash": "sha256-5Ol5iahMlELx3lWuChyZsqqLk6sP6aqaJCJFw92OZGo=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "23783b96036f5506fdaf8b2250a1ef849d57f0d3", + "rev": "12cd7034e441a5ebfdef1a090c0788413b4a635b", "type": "github" }, "original": { @@ -681,11 +681,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1738107811, - "narHash": "sha256-+57jB0fv53OmAQ8QpK3eiRXfypBfKJtfdepRusNX+DM=", + "lastModified": 1738273002, + "narHash": "sha256-R1CWBSEHZhykHo3/H3M4U7zLv1QaS87JCTHas38TNiU=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "3d1dd6b5c7b90e513e86c1ad27c6c01a5c69e4f8", + "rev": "ef03f6911694413b1b06aba727ad9ab089a511f7", "type": "github" }, "original": { @@ -1096,11 +1096,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "lastModified": 1738142207, + "narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "rev": "9d3ae807ebd2981d593cddd0080856873139aa40", "type": "github" }, "original": { @@ -1135,11 +1135,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1738121352, - "narHash": "sha256-/zTcxOuUlorG5xuVqZM74AEqyoUuvAGFgf7ZRsY0fB0=", + "lastModified": 1738282823, + "narHash": "sha256-F9Npwxwy6xoTLKYcWFeTsk7MTVKxK9IeT1lsSSCjExg=", "owner": "nix-community", "repo": "NUR", - "rev": "1c718529e3d4d262ad378d25faa009019d9f4a1a", + "rev": "6afe9691509edbfdcd9b2f4a703c6ed5c588255e", "type": "github" }, "original": { @@ -1704,11 +1704,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1738010151, - "narHash": "sha256-9kcGpfbl98SUrQT9Dj0TSj334LXSviGP1SI4P76QFYo=", + "lastModified": 1738174915, + "narHash": "sha256-oN18XGFcTwk58F8REqx3DTeCD+z3LAanWVznZ0P3ESc=", "owner": "sxyazi", "repo": "yazi", - "rev": "c061397a09bb08e293317f5b93dc870d453af9ef", + "rev": "b6cb1fa8d3fb3fafea7a190f23acaeb44333cfe9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index fde5281..23044ee 100755 --- a/flake.nix +++ b/flake.nix @@ -79,10 +79,11 @@ ./systems/desktop ./profiles/user0 ./profiles/user1 - config.nixosModules.personal config.nixosModules.desktop config.nixosModules.hyprland + config.nixosModules.personal config.nixosModules.shared + config.nixosModules.sops inputs.home-manager.nixosModules.home-manager inputs.lix-module.nixosModules.default inputs.nur.modules.nixos.default @@ -91,9 +92,11 @@ fallaryn = inputs.self.lib.mkLinuxSystem [ ./systems/fallaryn ./profiles/user2 - config.nixosModules.personal config.nixosModules.fallaryn + config.nixosModules.personal + config.nixosModules.plasma config.nixosModules.shared + config.nixosModules.sops inputs.home-manager.nixosModules.home-manager inputs.lix-module.nixosModules.default inputs.sops-nix.nixosModules.sops @@ -104,16 +107,27 @@ ./profiles/user1 config.nixosModules.personal config.nixosModules.shared + config.nixosModules.sops inputs.home-manager.nixosModules.home-manager inputs.lix-module.nixosModules.default inputs.nur.modules.nixos.default inputs.sops-nix.nixosModules.sops ]; + bartholomew = inputs.self.lib.mkLinuxSystem [ + ./systems/bartholomew + ./profiles/user1 + config.nixosModules.gnome + config.nixosModules.personal + config.nixosModules.shared + inputs.home-manager.nixosModules.home-manager + inputs.lix-module.nixosModules.default + ]; server = inputs.self.lib.mkLinuxSystem [ ./systems/server ./profiles/user0 config.nixosModules.server config.nixosModules.shared + config.nixosModules.sops inputs.home-manager.nixosModules.home-manager inputs.lix-module.nixosModules.default inputs.ngipkgs.nixosModules."services.peertube" diff --git a/home/default.nix b/home/default.nix index a2291f5..eee8197 100755 --- a/home/default.nix +++ b/home/default.nix @@ -27,6 +27,7 @@ in flake.homeModules = let inherit (config.machines.devices) + bartholomew desktop fallaryn laptop @@ -142,6 +143,30 @@ in ; }; }; + "${bartholomew.name}-${user1}" = { + imports = builtins.attrValues { + inherit (modules) + cli + catppuccin + gtk + brave + ghostty + zed + gaming + spotify + docs + mpv + jellyfin + kolourPaint + discord + signal + scrcpy + bitwarden + emote + desktop + ; + }; + }; "${server.name}-${user0}" = { imports = builtins.attrValues { inherit (modules) diff --git a/home/modules/cli/shell/starship/config/settings.nix b/home/modules/cli/shell/starship/config/settings.nix index 65f373b..634e39f 100755 --- a/home/modules/cli/shell/starship/config/settings.nix +++ b/home/modules/cli/shell/starship/config/settings.nix @@ -1,15 +1,27 @@ { flake, + config, lib, ... }: let - inherit (flake.config.aesthetics.themes) - currentThemes - palettes - ; + inherit (flake.config.aesthetics.themes) currentTheme palettes; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; makeColor = c: "#" + c; makeStyle = bg: fg: "bg:" + bg + " fg:" + fg + " bold"; diff --git a/home/modules/cli/shell/starship/default.nix b/home/modules/cli/shell/starship/default.nix index 3e6e54f..44bcb8d 100755 --- a/home/modules/cli/shell/starship/default.nix +++ b/home/modules/cli/shell/starship/default.nix @@ -1,16 +1,12 @@ { flake, + config, lib, ... }: let configPath = ./config; - settingsPath = import (configPath + /settings.nix) { - inherit - flake - lib - ; - }; + settingsPath = import (configPath + /settings.nix) { inherit config flake lib; }; in { programs.starship = { diff --git a/home/modules/cli/utilities/bottom/config/settings.nix b/home/modules/cli/utilities/bottom/config/settings.nix index c6ee06e..0aa5968 100755 --- a/home/modules/cli/utilities/bottom/config/settings.nix +++ b/home/modules/cli/utilities/bottom/config/settings.nix @@ -1,11 +1,29 @@ -{ flake, ... }: +{ + flake, + config, + ... +}: let inherit (flake.config.aesthetics.themes) - currentThemes + currentTheme palettes ; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; in { colors = { diff --git a/home/modules/cli/utilities/bottom/default.nix b/home/modules/cli/utilities/bottom/default.nix index 026cedb..7dfbba0 100755 --- a/home/modules/cli/utilities/bottom/default.nix +++ b/home/modules/cli/utilities/bottom/default.nix @@ -1,13 +1,13 @@ -{ flake, ... }: +{ + flake, + config, + ... +}: { programs.bottom = let configPath = ./config; - settingsPath = import (configPath + /settings.nix) { - inherit - flake - ; - }; + settingsPath = import (configPath + /settings.nix) { inherit config flake; }; in { enable = true; diff --git a/home/modules/gui/apps/code/zed/config/userSettings/config/theme/default.nix b/home/modules/gui/apps/code/zed/config/userSettings/config/theme/default.nix index 6eb11ac..5146900 100755 --- a/home/modules/gui/apps/code/zed/config/userSettings/config/theme/default.nix +++ b/home/modules/gui/apps/code/zed/config/userSettings/config/theme/default.nix @@ -1,11 +1,26 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let - inherit (flake.config.aesthetics.themes) - currentThemes - palettes - ; + inherit (flake.config.aesthetics.themes) currentTheme palettes; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; in { accents = [ diff --git a/home/modules/gui/apps/code/zed/config/userSettings/default.nix b/home/modules/gui/apps/code/zed/config/userSettings/default.nix index 347fd70..185ff12 100755 --- a/home/modules/gui/apps/code/zed/config/userSettings/default.nix +++ b/home/modules/gui/apps/code/zed/config/userSettings/default.nix @@ -1,5 +1,6 @@ { flake, + config, lib, pkgs, ... @@ -11,7 +12,7 @@ let languagesPath = import (configPath + /languages); lspPath = import (configPath + /lsp); terminalPath = import (configPath + /terminal) { inherit flake; }; - experimentalPath = import (configPath + /theme) { inherit flake; }; + experimentalPath = import (configPath + /theme) { inherit config flake; }; gitPath = import (configPath + /git); miscPath = import (configPath + /misc) { inherit lib pkgs; }; in diff --git a/home/modules/gui/apps/code/zed/default.nix b/home/modules/gui/apps/code/zed/default.nix index a42aad6..2eca104 100755 --- a/home/modules/gui/apps/code/zed/default.nix +++ b/home/modules/gui/apps/code/zed/default.nix @@ -1,4 +1,5 @@ { + config, flake, lib, pkgs, @@ -8,7 +9,14 @@ let configPath = ./config; extensionsPath = import (configPath + /extensions); userKeymapsPath = import (configPath + /userKeymaps); - userSettingsPath = import (configPath + /userSettings) { inherit flake lib pkgs; }; + userSettingsPath = import (configPath + /userSettings) { + inherit + config + flake + lib + pkgs + ; + }; extraPackagesPath = import (configPath + /extraPackages) { inherit pkgs; }; in { diff --git a/home/modules/gui/apps/emulators/ghostty/config/themes.nix b/home/modules/gui/apps/emulators/ghostty/config/themes.nix index 75332a3..7ca8f5d 100755 --- a/home/modules/gui/apps/emulators/ghostty/config/themes.nix +++ b/home/modules/gui/apps/emulators/ghostty/config/themes.nix @@ -1,11 +1,26 @@ -{ flake, ... }: +{ + flake, + config, + ... +}: let - inherit (flake.config.aesthetics.themes) - currentThemes - palettes - ; + inherit (flake.config.aesthetics.themes) currentTheme palettes; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; in { theme = { diff --git a/home/modules/gui/apps/emulators/ghostty/default.nix b/home/modules/gui/apps/emulators/ghostty/default.nix index f6f7fed..42d27b5 100755 --- a/home/modules/gui/apps/emulators/ghostty/default.nix +++ b/home/modules/gui/apps/emulators/ghostty/default.nix @@ -1,21 +1,13 @@ { + config, flake, pkgs, ... }: let configPath = ./config; - settingsPath = import (configPath + /settings.nix) { - inherit - flake - pkgs - ; - }; - themesPath = import (configPath + /themes.nix) { - inherit - flake - ; - }; + settingsPath = import (configPath + /settings.nix) { inherit flake pkgs; }; + themesPath = import (configPath + /themes.nix) { inherit config flake; }; in { programs.ghostty = { diff --git a/home/modules/gui/desktop/dunst/config/settings.nix b/home/modules/gui/desktop/dunst/config/settings.nix index c44092a..709372d 100755 --- a/home/modules/gui/desktop/dunst/config/settings.nix +++ b/home/modules/gui/desktop/dunst/config/settings.nix @@ -1,13 +1,31 @@ -{ flake, ... }: +{ + flake, + config, + ... +}: let inherit (flake.config.aesthetics.themes) - currentThemes + currentTheme palettes fonts ; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; makeColor = c: "#" + c; in diff --git a/home/modules/gui/desktop/dunst/default.nix b/home/modules/gui/desktop/dunst/default.nix index 90a525e..286dda9 100755 --- a/home/modules/gui/desktop/dunst/default.nix +++ b/home/modules/gui/desktop/dunst/default.nix @@ -1,11 +1,11 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let configPath = ./config; - settingsPath = import (configPath + /settings.nix) { - inherit - flake - ; - }; + settingsPath = import (configPath + /settings.nix) { inherit config flake; }; in { services.dunst = { diff --git a/home/modules/gui/desktop/hyprland/config/general.nix b/home/modules/gui/desktop/hyprland/config/general.nix index b38a8c4..95ca3f0 100755 --- a/home/modules/gui/desktop/hyprland/config/general.nix +++ b/home/modules/gui/desktop/hyprland/config/general.nix @@ -1,12 +1,27 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let - inherit (flake.config.aesthetics.themes) - currentThemes - palettes - ; + inherit (flake.config.aesthetics.themes) currentTheme palettes; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; in { gaps_in = 5; diff --git a/home/modules/gui/desktop/hyprland/default.nix b/home/modules/gui/desktop/hyprland/default.nix index 50fd1b2..e202ce5 100755 --- a/home/modules/gui/desktop/hyprland/default.nix +++ b/home/modules/gui/desktop/hyprland/default.nix @@ -20,7 +20,7 @@ let decoration = import (configPath + /decoration.nix); dwindle = import (configPath + /dwindle.nix); exec-once = import (configPath + /exec-once.nix) { inherit flake; }; - general = import (configPath + /general.nix) { inherit flake; }; + general = import (configPath + /general.nix) { inherit config flake; }; input = import (configPath + /input.nix); misc = import (configPath + /misc.nix); windowrulev2 = import (configPath + /windowrulev2.nix); diff --git a/home/modules/gui/desktop/swaylock/config/settings.nix b/home/modules/gui/desktop/swaylock/config/settings.nix index cb17baf..639a8c0 100755 --- a/home/modules/gui/desktop/swaylock/config/settings.nix +++ b/home/modules/gui/desktop/swaylock/config/settings.nix @@ -1,12 +1,30 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let inherit (flake.config.aesthetics.themes) - currentThemes + currentTheme palettes fonts ; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; in { font = fonts.names.name0; diff --git a/home/modules/gui/desktop/swaylock/default.nix b/home/modules/gui/desktop/swaylock/default.nix index 6514422..c6586c9 100755 --- a/home/modules/gui/desktop/swaylock/default.nix +++ b/home/modules/gui/desktop/swaylock/default.nix @@ -1,11 +1,11 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let configPath = ./config; - settingsPath = import (configPath + /settings.nix) { - inherit - flake - ; - }; + settingsPath = import (configPath + /settings.nix) { inherit config flake; }; in { programs.swaylock = { diff --git a/home/modules/gui/desktop/tofi/config/settings.nix b/home/modules/gui/desktop/tofi/config/settings.nix index 5807dd8..bbe1def 100755 --- a/home/modules/gui/desktop/tofi/config/settings.nix +++ b/home/modules/gui/desktop/tofi/config/settings.nix @@ -1,12 +1,26 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let - inherit (flake.config.aesthetics.themes) - currentThemes - palettes - fonts - ; + inherit (flake.config.aesthetics.themes) currentTheme palettes fonts; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; in { font-size = fonts.sizes.desktop.size0; diff --git a/home/modules/gui/desktop/tofi/default.nix b/home/modules/gui/desktop/tofi/default.nix index 2a3a94f..19d9285 100755 --- a/home/modules/gui/desktop/tofi/default.nix +++ b/home/modules/gui/desktop/tofi/default.nix @@ -1,12 +1,12 @@ { - pkgs, + config, flake, ... }: let configPath = ./config; - settingsPath = import (configPath + /settings.nix) { inherit flake; }; + settingsPath = import (configPath + /settings.nix) { inherit config flake; }; in { programs.tofi = { diff --git a/home/modules/gui/desktop/waybar/config/style.nix b/home/modules/gui/desktop/waybar/config/style.nix index 2b0f359..60d8169 100755 --- a/home/modules/gui/desktop/waybar/config/style.nix +++ b/home/modules/gui/desktop/waybar/config/style.nix @@ -1,13 +1,27 @@ -{ flake, ... }: +{ + config, + flake, + ... +}: let - inherit (flake.config.aesthetics.themes) - currentThemes - palettes - fonts - ; + inherit (flake.config.aesthetics.themes) currentTheme palettes fonts; - el = palettes.${currentThemes.theme0}.colours; + inherit (flake.config.people) user0 user1 user2; + + user = config.home.username; + + themeLogic = + if user == user0 then + currentTheme.theme0 + else if user == user1 then + currentTheme.theme1 + else if user == user2 then + currentTheme.theme2 + else + currentTheme.theme0; + + el = palettes.${themeLogic}.colours; custom = { font = fonts.names.name0; diff --git a/home/modules/gui/desktop/waybar/default.nix b/home/modules/gui/desktop/waybar/default.nix index a8e2ad3..9d275e8 100755 --- a/home/modules/gui/desktop/waybar/default.nix +++ b/home/modules/gui/desktop/waybar/default.nix @@ -1,4 +1,5 @@ { + config, flake, pkgs, ... @@ -6,11 +7,7 @@ let configPath = ./config; settingsPath = import (configPath + /settings.nix) { inherit flake; }; - stylePath = import (configPath + /style.nix) { - inherit - flake - ; - }; + stylePath = import (configPath + /style.nix) { inherit config flake; }; in { programs.waybar = { diff --git a/nixos/default.nix b/nixos/default.nix index b872802..50cb6a7 100755 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -68,12 +68,27 @@ in imports = builtins.attrValues { inherit (modules) tablet + ; + }; + }; + + plasma = { + imports = builtins.attrValues { + inherit (modules) plasma sddm ; }; }; + gnome = { + imports = builtins.attrValues { + inherit (modules) + gnome + ; + }; + }; + hyprland = { imports = builtins.attrValues { inherit (modules) @@ -90,6 +105,14 @@ in }; }; + sops = { + imports = builtins.attrValues { + inherit (modules) + sops + ; + }; + }; + shared = { imports = builtins.attrValues { inherit (modules) @@ -102,7 +125,6 @@ in nh nix rsyncd - sops ssh system xserver diff --git a/nixos/modules/doas.nix b/nixos/modules/doas.nix index 26bc1ac..980b2ac 100755 --- a/nixos/modules/doas.nix +++ b/nixos/modules/doas.nix @@ -2,6 +2,7 @@ let inherit (flake.config.people) user0 + user1 user2 ; inherit (flake.config.machines) @@ -11,6 +12,7 @@ let desktop = devices.desktop.name; server = devices.server.name; fallaryn = devices.fallaryn.name; + bartholomew = devices.bartholomew.name; in { security = { @@ -26,6 +28,8 @@ in user0 else if hostname == server then user0 + else if hostname == bartholomew then + user1 else if hostname == fallaryn then user2 else diff --git a/nixos/modules/gnome.nix b/nixos/modules/gnome.nix index 0598a95..bece9b8 100755 --- a/nixos/modules/gnome.nix +++ b/nixos/modules/gnome.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ services = { xserver = { enable = true; @@ -15,8 +16,7 @@ gnome-online-accounts.enable = true; }; udev.packages = builtins.attrValues { - inherit - (pkgs.gnome) + inherit (pkgs) gnome-settings-daemon ; }; @@ -27,8 +27,7 @@ # WEBKIT_DISABLE_COMPOSITING_MODE = "1"; }; gnome.excludePackages = builtins.attrValues { - inherit - (pkgs) + inherit (pkgs) gnome-photos gnome-tour epiphany # web browser @@ -38,19 +37,16 @@ totem # video player yelp # help viewer gnome-calendar - ; - inherit - (pkgs.gnome) - gnome-music - tali # poker game - iagno # go game - hitori # sudoku game atomix # puzzle game gnome-clocks gnome-weather gnome-maps gnome-contacts gnome-characters + gnome-music + tali # poker game + iagno # go game + hitori # sudoku game ; }; }; diff --git a/nixos/modules/sops.nix b/nixos/modules/sops.nix index 6c1bc24..04e1d1d 100755 --- a/nixos/modules/sops.nix +++ b/nixos/modules/sops.nix @@ -11,6 +11,7 @@ let desktop = devices.desktop.name; server = devices.server.name; fallaryn = devices.fallaryn.name; + bartholomew = devices.bartholomew.name; userLogic = if hostname == desktop then @@ -30,23 +31,27 @@ in keyFile = "/var/lib/sops-nix/key.txt"; generateKey = false; }; - secrets = { - "ssh/private" = { - path = "/home/${userLogic}/.ssh/id_ed25519"; - owner = userLogic; - }; - "ssh/public" = { - path = "/home/${userLogic}/.ssh/id_ed25519.pub"; - owner = userLogic; - }; - "ssh/hosts" = { - path = "/home/${userLogic}/.ssh/known_hosts"; - owner = userLogic; - }; - # "claude-api-key" = { - # path = "/home/${user0}/.config/zed/claude-api-key"; - # owner = user0; - # }; - }; + secrets = + if hostname == bartholomew then + { } + else + { + "ssh/private" = { + path = "/home/${userLogic}/.ssh/id_ed25519"; + owner = userLogic; + }; + "ssh/public" = { + path = "/home/${userLogic}/.ssh/id_ed25519.pub"; + owner = userLogic; + }; + "ssh/hosts" = { + path = "/home/${userLogic}/.ssh/known_hosts"; + owner = userLogic; + }; + # "claude-api-key" = { + # path = "/home/${user0}/.config/zed/claude-api-key"; + # owner = user0; + # }; + }; }; } diff --git a/nixos/modules/ssh.nix b/nixos/modules/ssh.nix index 09bcb74..3cd5d16 100755 --- a/nixos/modules/ssh.nix +++ b/nixos/modules/ssh.nix @@ -6,6 +6,7 @@ let inherit (flake.config.people) user0 + user1 user2 ; inherit (flake.config.people.users.${userLogic}) @@ -18,6 +19,7 @@ let desktop = devices.desktop.name; server = devices.server.name; fallaryn = devices.fallaryn.name; + bartholomew = devices.bartholomew.name; userLogic = if hostname == desktop then @@ -30,7 +32,13 @@ let ""; in { - users.users.${userLogic} = { - openssh.authorizedKeys.keys = sshKeys; - }; + users.users = + if hostname == bartholomew then + { } + else + { + ${userLogic} = { + openssh.authorizedKeys.keys = sshKeys; + }; + }; } diff --git a/profiles/user0/default.nix b/profiles/user0/default.nix index 3cb299b..cf65463 100755 --- a/profiles/user0/default.nix +++ b/profiles/user0/default.nix @@ -16,6 +16,7 @@ in users = { users.${user0} = { description = name; + name = user0; isNormalUser = true; shell = pkgs.nushell; extraGroups = [ diff --git a/profiles/user1/default.nix b/profiles/user1/default.nix index a74f2c9..2e7afcd 100755 --- a/profiles/user1/default.nix +++ b/profiles/user1/default.nix @@ -15,6 +15,7 @@ in users = { users.${user1} = { description = name; + name = user1; isNormalUser = true; shell = pkgs.nushell; extraGroups = [ diff --git a/profiles/user2/default.nix b/profiles/user2/default.nix index e451654..4603663 100755 --- a/profiles/user2/default.nix +++ b/profiles/user2/default.nix @@ -16,6 +16,7 @@ in users = { users.${user2} = { description = name; + name = user2; isNormalUser = true; shell = pkgs.nushell; extraGroups = [ diff --git a/systems/bartholomew/config/boot.nix b/systems/bartholomew/config/boot.nix new file mode 100755 index 0000000..cc3f996 --- /dev/null +++ b/systems/bartholomew/config/boot.nix @@ -0,0 +1,44 @@ +{ + pkgs, + config, + ... +}: +{ + boot = { + extraModulePackages = [ + config.boot.kernelPackages.v4l2loopback.out + ]; + supportedFilesystems = [ + "ntfs" + ]; + initrd = { + network.openvpn.enable = true; + availableKernelModules = [ + "nvme" + "ahci" + "xhci_pci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + kernelModules = [ + ]; + }; + + kernelModules = [ + "kvm-amd" + "vfio-pci" + "v4l2loopback" + ]; + + kernelPackages = pkgs.linuxPackages_latest; + + loader = { + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + systemd-boot.enable = true; + }; + }; +} diff --git a/systems/bartholomew/config/filesystem.nix b/systems/bartholomew/config/filesystem.nix new file mode 100755 index 0000000..5d84fb7 --- /dev/null +++ b/systems/bartholomew/config/filesystem.nix @@ -0,0 +1,30 @@ +{ + flake, + config, + ... +}: +let + inherit (flake.config.people) user1; + inherit (flake.config.machines.devices) bartholomew; +in +{ + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0457d426-f166-4f35-b77b-93321dca2581"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/1703-D452"; + fsType = "vfat"; + options = bartholomew.boot.options; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/bedf4922-fa86-403a-846c-7d900dfb9086"; } + ]; + + systemd.tmpfiles.rules = [ + "Z ${config.home-manager.users.${user1}.home.homeDirectory} 0755 ${user1} users -" + ]; +} diff --git a/systems/bartholomew/config/graphics.nix b/systems/bartholomew/config/graphics.nix new file mode 100755 index 0000000..c2bfd98 --- /dev/null +++ b/systems/bartholomew/config/graphics.nix @@ -0,0 +1,12 @@ +{ + hardware = { + graphics = { + enable = true; + extraPackages = [ ]; + extraPackages32 = [ ]; + }; + }; + boot.initrd.kernelModules = [ + ]; + services.xserver.videoDrivers = [ "modesetting" ]; +} diff --git a/systems/bartholomew/config/hardware.nix b/systems/bartholomew/config/hardware.nix new file mode 100755 index 0000000..448923f --- /dev/null +++ b/systems/bartholomew/config/hardware.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + hardware = { + firmware = builtins.attrValues { + inherit (pkgs) + rtl8761b-firmware + ; + }; + enableAllFirmware = true; + cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/systems/bartholomew/config/networking.nix b/systems/bartholomew/config/networking.nix new file mode 100755 index 0000000..8852dcd --- /dev/null +++ b/systems/bartholomew/config/networking.nix @@ -0,0 +1,35 @@ +{ + lib, + flake, + ... +}: +let + inherit (flake.config.machines.devices) + bartholomew + ; +in +{ + networking = { + hostName = bartholomew.name; + networkmanager.enable = true; + nftables.enable = true; + useDHCP = lib.mkDefault true; + firewall = { + enable = true; + allowedTCPPorts = [ + ]; + }; + }; + services = { + avahi = { + enable = true; + openFirewall = true; + nssmdns4 = true; + }; + sshd.enable = true; + openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + }; +} diff --git a/systems/bartholomew/default.nix b/systems/bartholomew/default.nix new file mode 100755 index 0000000..3882556 --- /dev/null +++ b/systems/bartholomew/default.nix @@ -0,0 +1,17 @@ +{ lib, ... }: +let + configPath = ./config; + + desktopImports = + let + files = builtins.attrNames (builtins.readDir configPath); + in + map (name: configPath + "/${name}") ( + builtins.filter (name: builtins.match ".*\\.nix$" name != null) files + ); +in +{ + imports = desktopImports; + nixpkgs.hostPlatform = lib.mkForce "x86_64-linux"; + system.stateVersion = lib.mkForce "24.05"; +} diff --git a/systems/desktop/config/filesystem.nix b/systems/desktop/config/filesystem.nix index a66f89f..28b46d1 100755 --- a/systems/desktop/config/filesystem.nix +++ b/systems/desktop/config/filesystem.nix @@ -2,77 +2,73 @@ flake, config, ... -}: let - inherit - (flake.config.people) +}: +let + inherit (flake.config.people) user0 user1 ; - inherit - (flake.config.machines.devices) + inherit (flake.config.machines.devices) desktop server synology ; - inherit - (flake.config.services.instances) + inherit (flake.config.services.instances) samba ; synologySecrets = config.sops.secrets."network/synology".path; serverSecrets = config.sops.secrets."network/server".path; -in { - fileSystems = let - synologyDrives = [ - "folder0" - "folder1" - "folder2" - ]; +in +{ + fileSystems = + let + synologyDrives = [ + "folder0" + "folder1" + "folder2" + ]; - storageDrives = [ - "storage0" - "storage1" - ]; + storageDrives = [ + "storage0" + "storage1" + ]; - sambaDrives = [ - "samba0" - ]; + sambaDrives = [ + "samba0" + ]; - synologyMounts = synologyDrive: { - name = "${synology.${synologyDrive}.mount}"; - value = { - device = synology.${synologyDrive}.device; - fsType = "cifs"; - options = - synology.${synologyDrive}.options - ++ [ + synologyMounts = synologyDrive: { + name = "${synology.${synologyDrive}.mount}"; + value = { + device = synology.${synologyDrive}.device; + fsType = "cifs"; + options = synology.${synologyDrive}.options ++ [ "credentials=${synologySecrets}" ]; + }; }; - }; - storageMounts = storageDrive: { - name = "${desktop.${storageDrive}.mount}"; - value = { - device = desktop.${storageDrive}.device; - fsType = "ext4"; - options = desktop.${storageDrive}.options; + storageMounts = storageDrive: { + name = "${desktop.${storageDrive}.mount}"; + value = { + device = desktop.${storageDrive}.device; + fsType = "ext4"; + options = desktop.${storageDrive}.options; + }; }; - }; - sambaMounts = sambaDrive: { - name = "${server.${sambaDrive}.mount}/${samba.paths.path1}"; - value = { - device = "${server.${sambaDrive}.device}/${samba.paths.path1}"; - fsType = "cifs"; - options = - server.${sambaDrive}.options - ++ [ + sambaMounts = sambaDrive: { + name = "${server.${sambaDrive}.mount}/${samba.paths.path1}"; + value = { + device = "${server.${sambaDrive}.device}/${samba.paths.path1}"; + fsType = "cifs"; + options = server.${sambaDrive}.options ++ [ "credentials=${serverSecrets}" ]; + }; }; - }; - in + in { "/" = { device = "/dev/disk/by-uuid/f63ce470-874a-4d2f-9494-31a15ca39f7f"; @@ -89,7 +85,7 @@ in { // (builtins.listToAttrs (map sambaMounts sambaDrives)); swapDevices = [ - {device = "/dev/disk/by-uuid/e3724d5e-9aba-4a32-9d89-c2117b1ed044";} + { device = "/dev/disk/by-uuid/e3724d5e-9aba-4a32-9d89-c2117b1ed044"; } ]; systemd.tmpfiles.rules = [