From 6d8673ea1e01beed2cd478e3cbebcae1d627ad79 Mon Sep 17 00:00:00 2001 From: Grey Jones Date: Wed, 2 Sep 2026 15:50:37 +0100 Subject: [PATCH] misc improvements to modularity --- .../takamaki/equibop/equicord-settings.json | 16 +++--- dotfiles/takamaki/equibop/quickCss.css | 50 +++++++------------ dotfiles/takamaki/equibop/settings.json | 4 +- dotfiles/takamaki/niri.kdl | 7 ++- flake.lock | 8 +-- modules/components/shells/noctalia.nix | 2 +- modules/components/window-managers/niri.nix | 2 +- .../applications/cli/color-converter.nix | 22 ++++---- .../features/applications/cli/fastfetch.nix | 2 +- modules/features/applications/cli/nh.nix | 2 +- modules/features/applications/gui/equibop.nix | 12 +---- modules/features/applications/gui/floorp.nix | 2 +- modules/features/applications/gui/fluxer.nix | 4 +- modules/features/applications/gui/kitty.nix | 2 +- .../features/applications/gui/nautilus.nix | 2 +- modules/features/applications/gui/remmina.nix | 2 +- modules/features/applications/gui/spotify.nix | 10 ++-- modules/features/applications/gui/vscode.nix | 2 +- .../features/hardware/steam-controller.nix | 2 +- modules/features/nixos/home-manager.nix | 2 +- modules/features/nixos/stylix.nix | 2 +- modules/features/shells.nix | 2 +- modules/features/shells/zsh.nix | 2 +- modules/global/nixos.nix | 13 +++-- modules/hosts/kitagawa/home/fastfetch.nix | 2 +- modules/hosts/kitagawa/home/kitty.nix | 2 +- modules/hosts/kitagawa/home/zsh.nix | 2 +- modules/hosts/kitagawa/kitagawa.nix | 2 +- modules/options/global.nix | 37 ++++++++++---- 29 files changed, 111 insertions(+), 108 deletions(-) diff --git a/dotfiles/takamaki/equibop/equicord-settings.json b/dotfiles/takamaki/equibop/equicord-settings.json index aff3b5e..0e91dd2 100755 --- a/dotfiles/takamaki/equibop/equicord-settings.json +++ b/dotfiles/takamaki/equibop/equicord-settings.json @@ -4,10 +4,12 @@ "authenticated": false, "settingsSync": false, "url": "https://cloud.equicord.org/", - "settingsSyncVersion": 1788234114000 + "settingsSyncVersion": 1788360340476 }, "enableOnlineThemes": true, - "enabledThemeLinks": [], + "enabledThemeLinks": [ + "https://refact0r.github.io/midnight-discord/build/midnight.css" + ], "plugins": { "AltKrispSwitch": { "enabled": false @@ -1218,13 +1220,13 @@ }, "useQuickCss": true, "autoUpdateNotification": true, - "themeLinks": [], - "eagerPatches": false, - "enabledThemes": [ - "noctalia.theme.css" + "themeLinks": [ + "https://refact0r.github.io/midnight-discord/build/midnight.css" ], + "eagerPatches": false, + "enabledThemes": [], "pinnedThemes": [ - "noctalia.theme.css" + "https://refact0r.github.io/midnight-discord/build/midnight.css" ], "themeNames": {}, "themeActivationModes": {}, diff --git a/dotfiles/takamaki/equibop/quickCss.css b/dotfiles/takamaki/equibop/quickCss.css index 4c1821b..8b2f854 100755 --- a/dotfiles/takamaki/equibop/quickCss.css +++ b/dotfiles/takamaki/equibop/quickCss.css @@ -1,42 +1,26 @@ body { + /* font, change to '' for default discord font */ + --font: 'figtree'; + --code-font: ''; + /* sizes */ --gap: 10px; /* spacing between panels */ --divider-thickness: 4px; /* thickness of unread messages divider and highlighted message borders */ - --border-thickness: 0px; /* thickness of borders around main panels. DOES NOT AFFECT OTHER BORDERS */ + --border-thickness: 1px; /* thickness of borders around main panels. DOES NOT AFFECT OTHER BORDERS */ + --custom-guild-list-width: calc(var(--guildbar-avatar-size) + var(--custom-guild-list-padding) * 2 + var(--border-thickness) * 2); - /* animation/transition options */ - --animations: on; /* off: disable animations/transitions, on: enable animations/transitions */ - --list-item-transition: 0.2s ease; /* transition for list items */ - --dms-icon-svg-transition: 0.35s ease; /* transition for the dms icon */ - --border-hover-transition: 1s ease; /* transition for borders when hovered */ + --border-hover-transition: 0.2s ease; + --elevation-low: none; + --elevation-medium: none; + --elevation-high: none; } -/* color options */ :root { - --colors: on; /* off: discord default colors, on: midnight custom colors */ - /* text colors */ - --text-0: hsl(220, 16%, 95%); /* text on colored elements */ - --text-2: hsl(217.5, 20%, 90%); /* headings and important text */ - --text-3: hsl(219, 30%, 90%); /* normal text */ - --text-4: hsl(220.5, 14%, 85%); /* icon buttons and channels */ - --text-5: hsl(221, 13.5%, 80%); /* muted channels/chats and timestamps */ - - /* background and dark colors */ - --bg-1: #303643; /* dark buttons when clicked */ - --bg-2: #343b49; /* dark buttons */ - --bg-3: #3b4252; /* spacing, secondary elements */ - --bg-4: #2e3440; /* main background color */ - --hover: #eceff415; /* channels and buttons when hovered */ - --active: hsl(222, 18%, 35%); /* channels and buttons when clicked or selected */ - --active-2: #2e3440; /* extra state for transparent buttons */ - --message-hover: #3b425240; /* messages when hovered */ - - /* accent colors */ - --accent-1: #8fbcbb; /* links and other accent text */ - --accent-2: hsl(179, 30%, 45%); /* small accent elements */ - --accent-3: hsl(193, 25%, 45%); /* accent buttons */ - --accent-4: hsl(193, 25%, 55%); /* accent buttons when hovered */ - --accent-5: hsl(193, 25%, 60%); /* accent buttons when clicked */ - --accent-new: #bf616a; /* stuff that's normally red like mute/deafen buttons */ -}; + --text-0: var(--bg-4); /* text on colored elements */ + --text-1: hsl(220, 45%, 95%); /* other normally white text */ + --text-2: hsl(220, 25%, 85%); /* headings and important text */ + --text-3: hsl(220, 20%, 70%); /* normal text */ + --text-4: hsl(220, 15%, 60%); /* icon buttons and channels */ + --text-5: hsl(220, 15%, 55%); /* muted channels/chats and timestamps */ +} \ No newline at end of file diff --git a/dotfiles/takamaki/equibop/settings.json b/dotfiles/takamaki/equibop/settings.json index bd3490e..c6f9559 100755 --- a/dotfiles/takamaki/equibop/settings.json +++ b/dotfiles/takamaki/equibop/settings.json @@ -9,8 +9,8 @@ "hardwareAcceleration": true, "minimizeToTray": true, "tray": true, - "splashColor": "rgb(222, 227, 237)", - "splashBackground": "rgb(46, 52, 64)", + "splashColor": "rgb(163, 173, 194)", + "splashBackground": "rgb(22, 24, 29)", "hardwareVideoAcceleration": true, "clickTrayToShowHide": true, "arRPCDisabled": false, diff --git a/dotfiles/takamaki/niri.kdl b/dotfiles/takamaki/niri.kdl index 31b94c4..c9bcf59 100644 --- a/dotfiles/takamaki/niri.kdl +++ b/dotfiles/takamaki/niri.kdl @@ -134,7 +134,6 @@ window-rule { clip-to-geometry true } window-rule { // Maximized on vertical monitor - match at-startup=true app-id="^steam$" title="^Steam$" match at-startup=true app-id="^equibop$" open-maximized-to-edges true open-on-output "HDMI-A-1" @@ -149,6 +148,12 @@ window-rule { // Steam windows float (excluding main window) window-rule { match app-id="steam" title=r#"^notificationtoasts_\d+_desktop$"# default-floating-position x=10 y=10 relative-to="bottom-right" + open-focused false +} +window-rule { // Maximized on main monitor + match at-startup=true app-id="^steam$" title="^Steam$" + open-maximized-to-edges true + open-on-output "HDMI-A-1" } window-rule { // Fullscreen on main monitor match app-id="^steam_app_\\d+$" diff --git a/flake.lock b/flake.lock index 24ec274..2143d3f 100644 --- a/flake.lock +++ b/flake.lock @@ -187,11 +187,11 @@ ] }, "locked": { - "lastModified": 1788303756, - "narHash": "sha256-KwDkCX7JBWVjDCoP1CqF3HCMpM8Uy1anD0pKzAZ2Aaw=", + "lastModified": 1788319420, + "narHash": "sha256-y4hOpWzUp8ZWzoIsQINIxFifoWOV1tQPVqHVtX24luc=", "ref": "refs/heads/main", - "rev": "fef3a464ef4db019bd654446b15eca1f9b31fd44", - "revCount": 48, + "rev": "1cfc810e699659bab9a9c8f071a5770fc3d8b886", + "revCount": 52, "type": "git", "url": "https://git.greyweather.dev/greyweather/nix-helper-flake" }, diff --git a/modules/components/shells/noctalia.nix b/modules/components/shells/noctalia.nix index e90674f..f0b37e7 100644 --- a/modules/components/shells/noctalia.nix +++ b/modules/components/shells/noctalia.nix @@ -7,7 +7,7 @@ programs.noctalia.enable = true; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { components.shells = [ "noctalia" ]; }; }; diff --git a/modules/components/window-managers/niri.nix b/modules/components/window-managers/niri.nix index bd2c10f..171170e 100644 --- a/modules/components/window-managers/niri.nix +++ b/modules/components/window-managers/niri.nix @@ -35,7 +35,7 @@ })); }; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { components.windowManagers = [ "niri" ]; }; }; diff --git a/modules/features/applications/cli/color-converter.nix b/modules/features/applications/cli/color-converter.nix index 5a4bad9..aa0ff54 100644 --- a/modules/features/applications/cli/color-converter.nix +++ b/modules/features/applications/cli/color-converter.nix @@ -1,4 +1,10 @@ -{ inputs, self, ... }: let +{ inputs, self, lib, ... }: let + featureOptionName = "features.applications.cli.color-converter.enable"; + moduleArgs = config: { + inherit config; + optionName = featureOptionName; + }; + color-converter-package = { lib, pkgs }: pkgs.python3Packages.buildPythonApplication rec { pname = "color-converter"; version = "1.0.0"; @@ -29,21 +35,17 @@ }; }; in { - imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "globalOptions" ({ lib, ... }: { - options.features.applications.cli.color-converter.enable = lib.mkEnableOption "`color-converter`"; - })) ]; + imports = [ (inputs.helpers.mkStandardFeature.flakeModule "global" featureOptionName (lib.mkEnableOption "`color-converter`")) ]; flake.nixosModules.global = { pkgs, lib, config, ... }: { - config = lib.mkIf (config.features.applications.cli.color-converter.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.cli.color-converter.enable = lib.mkDefault true; - } { + imports = [ (inputs.helpers.mkStandardFeature.nixosModule (moduleArgs config) { environment.systemPackages = [ (pkgs.callPackage color-converter-package {}) ]; - }); + }) ]; }; flake.homeModules.global = { pkgs, config, lib, ... }: { - config = lib.mkIf (config.features.applications.cli.color-converter.enable) { + imports = [ (inputs.helpers.mkStandardFeature.homeModule (moduleArgs config) { home.packages = [ (pkgs.callPackage color-converter-package {}) ]; - }; + }) ]; }; } \ No newline at end of file diff --git a/modules/features/applications/cli/fastfetch.nix b/modules/features/applications/cli/fastfetch.nix index 5ba3015..684a9f0 100644 --- a/modules/features/applications/cli/fastfetch.nix +++ b/modules/features/applications/cli/fastfetch.nix @@ -5,7 +5,7 @@ flake.nixosModules.global = { pkgs, lib, config, ... }: { config = lib.mkIf (config.features.applications.cli.fastfetch.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.cli.fastfetch.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.cli.fastfetch.enable = lib.mkDefault true; } { environment.systemPackages = [ pkgs.fastfetch ]; }); diff --git a/modules/features/applications/cli/nh.nix b/modules/features/applications/cli/nh.nix index 9567430..5edccd4 100644 --- a/modules/features/applications/cli/nh.nix +++ b/modules/features/applications/cli/nh.nix @@ -29,7 +29,7 @@ in { config = lib.mkIf (config.features.applications.cli.nh.enable) { programs.nh = mkNhAttrs config; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { features.applications.cli.nh = lib.mkDefault config.features.applications.cli.nh; }; }; diff --git a/modules/features/applications/gui/equibop.nix b/modules/features/applications/gui/equibop.nix index d562b39..fbf4f9c 100644 --- a/modules/features/applications/gui/equibop.nix +++ b/modules/features/applications/gui/equibop.nix @@ -10,20 +10,12 @@ in { })) ]; flake.nixosModules.graphicsOption = { lib, ... }: { - options.features.applications.gui.equibop.autostart = let - attrs = autostartOptionAttrs { inherit lib; }; - in lib.mkOption { - inherit (attrs) type default; - description = '' - ${attrs.description} - ${inputs.helpers.mkRedundantOptionDescription "features.nixos.home-manager.enable" "true"} - ''; - }; + options.features.applications.gui.equibop.autostart = inputs.helpers.mkRedundantOption "features.nixos.home-manager.enable" "true" (autostartOptionAttrs { inherit lib; }); }; flake.nixosModules.graphics = { pkgs, lib, config, ...}: { config = inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.equibop = lib.mkDefault config.features.applications.gui.equibop; + home-manager.users.${config.info.userName}.features.applications.gui.equibop = lib.mkDefault config.features.applications.gui.equibop; } { environment.systemPackages = [ pkgs.equibop ]; }; diff --git a/modules/features/applications/gui/floorp.nix b/modules/features/applications/gui/floorp.nix index 246487c..bfdccf8 100644 --- a/modules/features/applications/gui/floorp.nix +++ b/modules/features/applications/gui/floorp.nix @@ -5,7 +5,7 @@ flake.nixosModules.graphics = { pkgs, lib, config, ... }: { config = lib.mkIf (config.features.applications.gui.floorp.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.floorp.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.gui.floorp.enable = lib.mkDefault true; } { environment.systemPackages = [ pkgs.floorp-bin ]; }); diff --git a/modules/features/applications/gui/fluxer.nix b/modules/features/applications/gui/fluxer.nix index 8ff6c0e..9248bed 100644 --- a/modules/features/applications/gui/fluxer.nix +++ b/modules/features/applications/gui/fluxer.nix @@ -73,13 +73,13 @@ in { flake.nixosModules.graphics = { pkgs, config, lib, ... }: { config = lib.mkIf (config.features.applications.gui.fluxer.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.fluxer.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.gui.fluxer.enable = lib.mkDefault true; } { environment.systemPackages = [ (pkgs.callPackage (fluxer-package) {}) ]; }) // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.fluxer-canary.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.gui.fluxer-canary.enable = lib.mkDefault true; } { environment.systemPackages = [ (pkgs.callPackage (fluxer-canary-package) {}) diff --git a/modules/features/applications/gui/kitty.nix b/modules/features/applications/gui/kitty.nix index 4503ace..4d31c6a 100644 --- a/modules/features/applications/gui/kitty.nix +++ b/modules/features/applications/gui/kitty.nix @@ -6,7 +6,7 @@ flake.nixosModules.graphics = { pkgs, config, lib, ... }: { config = let in lib.mkIf (config.features.applications.gui.kitty.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.kitty.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.gui.kitty.enable = lib.mkDefault true; } { environment.systemPackages = [ pkgs.kitty ]; }); diff --git a/modules/features/applications/gui/nautilus.nix b/modules/features/applications/gui/nautilus.nix index 8fd2c82..df7bae3 100644 --- a/modules/features/applications/gui/nautilus.nix +++ b/modules/features/applications/gui/nautilus.nix @@ -19,7 +19,7 @@ terminal = "kitty"; }; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { features.applications.gui.nautilus.enable = true; }; }; diff --git a/modules/features/applications/gui/remmina.nix b/modules/features/applications/gui/remmina.nix index 8c266de..3e0b9de 100644 --- a/modules/features/applications/gui/remmina.nix +++ b/modules/features/applications/gui/remmina.nix @@ -5,7 +5,7 @@ flake.nixosModules.graphics = { pkgs, config, lib, ... }: { config = lib.mkIf (config.features.applications.gui.remmina.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.remmina.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.gui.remmina.enable = lib.mkDefault true; } { environment.systemPackages = with pkgs; [ remmina diff --git a/modules/features/applications/gui/spotify.nix b/modules/features/applications/gui/spotify.nix index 59f99ec..74a511d 100644 --- a/modules/features/applications/gui/spotify.nix +++ b/modules/features/applications/gui/spotify.nix @@ -1,4 +1,4 @@ -{ inputs, self, ... }: let +{ inputs, self, lib, ... }: let spicetifyEnableOptionAttrs = { lib }: { type = lib.types.bool; description = "Whether to enable Spicetify, a modified version of Spotify that supports plugins and themes."; @@ -6,7 +6,7 @@ }; spicetifyThemeOptionAttrs = { pkgs, lib }: { - type = inputs.nixpkgs.lib.types.nullOr (inputs.nixpkgs.lib.types.enum (builtins.attrNames inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}.themes)); + type = lib.types.nullOr (lib.types.enum (builtins.attrNames inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}.themes)); description = "This option is used to select a theme for Spicetify to use, from the list of available packages themes."; default = null; }; @@ -15,7 +15,7 @@ in { options.features.applications.gui.spotify.enable = lib.mkEnableOption "Spotify"; })) ]; - flake.nixosModules.graphicsOptions = { lib, pkgs, ... }: { + flake.nixosModules.graphicsOptions = { pkgs, lib, ... }: { options.features.applications.gui.spotify.spicetify = { enable = inputs.helpers.mkRedundantOption "features.nixos.home-manager.enable" "true" (spicetifyEnableOptionAttrs { inherit lib; }); theme = inputs.helpers.mkRedundantOption "features.nixos.home-manager.enable" "true" (spicetifyThemeOptionAttrs { inherit pkgs lib; }); @@ -26,7 +26,7 @@ in { spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}; in { config = lib.mkIf (config.features.applications.gui.spotify.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.spotify = { + home-manager.users.${config.info.userName}.features.applications.gui.spotify = { enable = lib.mkDefault true; spicetify = lib.mkDefault config.features.applications.gui.spotify.spicetify; }; @@ -35,7 +35,7 @@ in { }); }; - flake.homeModules.graphicsOptions = { lib, pkgs, ... }: { + flake.homeModules.graphicsOptions = { pkgs, lib, ... }: { options.features.applications.gui.spotify.spicetify = { enable = lib.mkOption (spicetifyEnableOptionAttrs { inherit lib; }); theme = lib.mkOption (spicetifyThemeOptionAttrs { inherit pkgs lib; }); diff --git a/modules/features/applications/gui/vscode.nix b/modules/features/applications/gui/vscode.nix index 969a827..b896b72 100644 --- a/modules/features/applications/gui/vscode.nix +++ b/modules/features/applications/gui/vscode.nix @@ -5,7 +5,7 @@ flake.nixosModules.graphics = { config, pkgs, lib, ... }: { config = lib.mkIf (config.features.applications.gui.vscode.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { - home-manager.users.grey.features.applications.gui.vscode.enable = lib.mkDefault true; + home-manager.users.${config.info.userName}.features.applications.gui.vscode.enable = lib.mkDefault true; } { environment.systemPackages = [ pkgs.vscode ]; }); diff --git a/modules/features/hardware/steam-controller.nix b/modules/features/hardware/steam-controller.nix index b085fcc..ad4059b 100644 --- a/modules/features/hardware/steam-controller.nix +++ b/modules/features/hardware/steam-controller.nix @@ -5,7 +5,7 @@ flake.nixosModules.gaming = { pkgs, config, lib, ... }: { config = lib.mkIf (config.features.hardware.steam-controller.enable) { - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { features.hardware.steam-controller.enable = lib.mkDefault true; }; }; diff --git a/modules/features/nixos/home-manager.nix b/modules/features/nixos/home-manager.nix index ab78c26..77c41ef 100644 --- a/modules/features/nixos/home-manager.nix +++ b/modules/features/nixos/home-manager.nix @@ -20,7 +20,7 @@ inherit inputs; }; - users.grey = self.homeModules.${config.info.hostName}; + users.${config.info.userName} = self.homeModules."${config.info.userName}@${config.info.hostName}"; }; }; } \ No newline at end of file diff --git a/modules/features/nixos/stylix.nix b/modules/features/nixos/stylix.nix index c5b9cef..a92bc78 100644 --- a/modules/features/nixos/stylix.nix +++ b/modules/features/nixos/stylix.nix @@ -13,7 +13,7 @@ stylix.image = builtins.path { path = "${self}/modules/hosts/${config.info.hostName}/wallpaper.jpg"; }; stylix.polarity = "dark"; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { features.nixos.stylix.enable = lib.mkDefault config.features.nixos.stylix.enable; }; }; diff --git a/modules/features/shells.nix b/modules/features/shells.nix index a5b835f..ea1c6f4 100644 --- a/modules/features/shells.nix +++ b/modules/features/shells.nix @@ -11,6 +11,6 @@ programs.${config.features.shells.defaultShell}.enable = true; users.defaultUserShell = pkgs.${config.features.shells.defaultShell}; - users.users."grey".shell = pkgs.${config.features.shells.defaultShell}; + users.users."${config.info.userName}".shell = pkgs.${config.features.shells.defaultShell}; }; } \ No newline at end of file diff --git a/modules/features/shells/zsh.nix b/modules/features/shells/zsh.nix index 0265da4..3fa5d91 100644 --- a/modules/features/shells/zsh.nix +++ b/modules/features/shells/zsh.nix @@ -10,7 +10,7 @@ config = lib.mkIf (config.features.shells.zsh.enable || config.features.shells.defaultShell == "zsh") { programs.zsh.enable = true; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { features.shells.zsh.enable = lib.mkDefault true; features.shells.zsh.antidote.enable = lib.mkDefault config.features.shells.zsh.antidote.enable; }; diff --git a/modules/global/nixos.nix b/modules/global/nixos.nix index d16984c..a596361 100644 --- a/modules/global/nixos.nix +++ b/modules/global/nixos.nix @@ -53,8 +53,6 @@ extraGroups = [ "networkmanager" "wheel" ]; }; - nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ git fzf @@ -84,12 +82,13 @@ powerOnBoot = false; }; - home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) { + nixpkgs.config.allowUnfree = true; + + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { info = { - rootPath = lib.mkDefault config.info.rootPath; - hostName = lib.mkDefault config.info.hostName; - stateVersion = lib.mkDefault config.info.stateVersion; - isStandalone = lib.mkDefault false; + inherit (config.info) rootPath userName hostName stateVersion; + hostPlatform = config.nixpkgs.hostPlatform.system; + isStandalone = false; }; }; diff --git a/modules/hosts/kitagawa/home/fastfetch.nix b/modules/hosts/kitagawa/home/fastfetch.nix index a062ac8..fadc8e7 100644 --- a/modules/hosts/kitagawa/home/fastfetch.nix +++ b/modules/hosts/kitagawa/home/fastfetch.nix @@ -1,5 +1,5 @@ { inputs, self, ... }: { - flake.homeModules.kitagawa = { pkgs, lib, config, ... }: { + flake.homeModules."grey@kitagawa" = { pkgs, lib, config, ... }: { config = lib.mkIf (config.features.applications.cli.fastfetch.enable) ({ programs.fastfetch = { settings = { diff --git a/modules/hosts/kitagawa/home/kitty.nix b/modules/hosts/kitagawa/home/kitty.nix index e01e131..c2611eb 100644 --- a/modules/hosts/kitagawa/home/kitty.nix +++ b/modules/hosts/kitagawa/home/kitty.nix @@ -1,5 +1,5 @@ { inputs, self, ... }: { - flake.homeModules.kitagawa = { pkgs, config, lib, ... }: { + flake.homeModules."grey@kitagawa" = { pkgs, config, lib, ... }: { programs.kitty = { font = lib.mkForce { name = "Iosevka Comfy"; diff --git a/modules/hosts/kitagawa/home/zsh.nix b/modules/hosts/kitagawa/home/zsh.nix index 7bfc202..c455349 100644 --- a/modules/hosts/kitagawa/home/zsh.nix +++ b/modules/hosts/kitagawa/home/zsh.nix @@ -1,5 +1,5 @@ { inputs, self, ... }: { - flake.homeModules.kitagawa = { config, pkgs, ... }: let + flake.homeModules."grey@kitagawa" = { config, pkgs, ... }: let mkConfigCommand = args: "zsh -c 'cd ${config.info.rootPath}; git add .; nh os switch ${args}'"; in { programs.zsh.shellAliases = { diff --git a/modules/hosts/kitagawa/kitagawa.nix b/modules/hosts/kitagawa/kitagawa.nix index be91e1f..fbe7de2 100644 --- a/modules/hosts/kitagawa/kitagawa.nix +++ b/modules/hosts/kitagawa/kitagawa.nix @@ -86,7 +86,7 @@ }; }; - flake.homeModules.kitagawa = { config, pkgs, inputs, lib, ... }: { + flake.homeModules."grey@kitagawa" = { config, pkgs, inputs, lib, ... }: { imports = with self.homeModules; [ global audio diff --git a/modules/options/global.nix b/modules/options/global.nix index 2a78c1d..0229f48 100644 --- a/modules/options/global.nix +++ b/modules/options/global.nix @@ -5,20 +5,19 @@ in { options.info = { rootPath = lib.mkOption { type = lib.types.str; - description = "This option is used to tell the config the global path to the flake's root directory, in order to perform impure actions (in a Nix sense, not morally impure, I promise)."; + description = "Used to tell the config the global path to the flake's root directory, in order to perform direct symlinking (not in `/nix/store`)."; default = "/home/grey/nixos"; }; + userName = lib.mkOption { + type = lib.types.str; + description = "Used to tell the config the name of the primary user (the user that this flake should focus on for things like Home Manager configurations, etc)."; + default = "grey"; + }; + hostName = lib.mkOption { type = lib.types.str; - description = "This option is used to tell the config the hostname of the current machine, mostly for symlinking the right dotfiles."; - default = ""; - }; - - stateVersion = lib.mkOption { - type = lib.types.str; - description = "This option is used to set the stateVersion value."; - example = "26.11"; + description = "Used to tell the config the hostname of the current machine, mostly for symlinking the right dotfiles."; default = ""; }; }; @@ -26,6 +25,13 @@ in { flake.nixosModules.globalOptions = { lib, ... }: { options = { + info.stateVersion = lib.mkOption { + type = lib.types.str; + description = "Used to set the `system.stateVersion` value."; + example = "26.11"; + default = ""; + }; + components = { bootLoader = { selection = lib.mkOption { @@ -59,6 +65,19 @@ in { flake.homeModules.globalOptions = { lib, ... }: { options = { info = { + /* hostPlatform = lib.mkOption { + type = lib.types.str; + description = "Tells the config the platform string that should be used to generate `pkgs`, since `nixpkgs.hostPlatform` does not exist in a standalone Home Manager setup."; + default = "x86_64-linux"; + }; */ + + stateVersion = lib.mkOption { + type = lib.types.str; + description = "Used to set the `home.stateVersion` value."; + example = "26.11"; + default = ""; + }; + isStandalone = lib.mkOption { type = lib.types.bool; description = "This option tells the config whether this home-manager config is part of a larger NixOS config or not, and is read-only.";