fix problems rebuilding, make niri and noctalia more HM friendly

added `inputs` to `extraSpecialArgs`, giving homeModules access to helper functions
cleaned up the logic for the stylix file, removing the final `sharedModules` in the process in favour of `home-manager.users.grey`
This commit is contained in:
greyweather committed 2026-08-30 00:31:13 +01:00
1 parent 49985ce9a3
commit 06e958ae71
8 files changed
+133 -79

No files matched your search

+5 -1
View File
@@ -27,7 +27,7 @@ input {
} }
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
prefer-no-csd prefer-no-csd
overview { zoom 0.666; } overview { zoom 0.5; }
layout { layout {
gaps 12 gaps 12
struts { struts {
@@ -158,4 +158,8 @@ animations {
window-resize { window-resize {
spring damping-ratio=0.8 stiffness=650 epsilon=0.0001 spring damping-ratio=0.8 stiffness=650 epsilon=0.0001
} }
}
layer-rule {
match namespace="^noctalia-backdrop"
place-within-backdrop true
} }
+3 -2
View File
@@ -4,8 +4,9 @@ config_version = 13
enable_sounds = true enable_sounds = true
[backdrop] [backdrop]
blur_intensity = 0.099999997764825821 blur_intensity = 0.74999998323619366
tint_intensity = 0.14999999664723873 enabled = true
tint_intensity = 0.19999999552965164
[bar.default] [bar.default]
background_opacity = 0.79999998211860657 background_opacity = 0.79999998211860657
+77 -53
View File
@@ -1,36 +1,34 @@
{ inputs, self, ... }: { { inputs, self, ... }: {
flake.nixosModules.graphics = { config, pkgs, lib, ... }: { flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
options = { options.components = {
components = { displayManager = lib.mkOption {
displayManager = lib.mkOption { # enum that dynamically populates itself with the contents of the display-managers directory
# enum that dynamically populates itself with the contents of the display-managers directory type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) ( builtins.attrNames (builtins.readDir "${self}/modules/components/display-managers")
builtins.attrNames (builtins.readDir "${self}/modules/components/display-managers") ));
)); default = "lightdm";
default = "lightdm"; };
};
windowManagers = lib.mkOption { windowManagers = lib.mkOption {
type = lib.types.either (lib.types.listOf ( type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) ( lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers") builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
))); ))
default = []; )) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
}; builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
)));
default = [];
};
shells = lib.mkOption { shells = lib.mkOption {
type = lib.types.either (lib.types.listOf ( type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) ( lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells") builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
)) ))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) ( )) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells") builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
))); )));
default = []; default = [];
};
}; };
}; };
@@ -48,37 +46,63 @@
}; };
}; };
flake.homeModules.graphics = { config, pkgs, ... }: { flake.homeModules.graphics = { config, pkgs, lib, ... }: {
home.packages = with pkgs; [ options.components = {
bibata-cursors windowManagers = lib.mkOption {
x264 type = lib.types.either (lib.types.listOf (
gparted lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
vlc builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
iosevka-comfy.comfy ))
nerd-fonts.jetbrains-mono )) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
]; builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
)));
default = [];
};
dconf.settings = { shells = lib.mkOption {
"org/gnome/desktop/interface" = { type = lib.types.either (lib.types.listOf (
color-scheme = "prefer-dark"; lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
)));
default = [];
}; };
}; };
home.pointerCursor = { config = {
enable = true; home.packages = with pkgs; [
package = pkgs.bibata-cursors; bibata-cursors
name = "Bibata-Modern-Ice"; x264
size = 22; gparted
gtk.enable = true; vlc
x11.enable = true; iosevka-comfy.comfy
}; nerd-fonts.jetbrains-mono
];
gtk = { dconf.settings = {
enable = true; "org/gnome/desktop/interface" = {
colorScheme = "dark"; color-scheme = "prefer-dark";
};
};
gtk2.configLocation = "${config.home.homeDirectory}/.config/.gtkrc-2.0"; # prevents file conflicts between this and other parts of the nix config home.pointerCursor = {
gtk2.force = true; enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 22;
gtk.enable = true;
x11.enable = true;
};
gtk = {
enable = true;
colorScheme = "dark";
gtk2.configLocation = "${config.home.homeDirectory}/.config/.gtkrc-2.0"; # prevents file conflicts between this and other parts of the nix config
gtk2.force = true;
};
}; };
}; };
} }
+19 -9
View File
@@ -1,29 +1,39 @@
{ inputs, self, ... }: { { inputs, self, ... }: {
flake.nixosModules.graphics = { pkgs, config, lib, ... }: { flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) { config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) {
environment.systemPackages = with pkgs; [ environment.systemPackages = [
inputs.noctalia.packages.${system}.default inputs.noctalia.packages.${pkgs.system}.default
]; ];
programs.noctalia.enable = true; programs.noctalia.enable = true;
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) ({ lib, config, ... }: { home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
home.activation = { components.shells = [ "noctalia" ];
};
};
};
flake.homeModules.graphics = { pkgs, config, lib, inputs, ... }: {
config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) {
home = {
packages = lib.mkIf (config.info.isStandalone) [ inputs.noctalia.packages.${pkgs.system}.default ];
activation = {
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript { symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.users.grey.homeDir}/.local/state/noctalia/settings.toml"; target = "${config.home.homeDirectory}/.local/state/noctalia/settings.toml";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/noctalia/settings.toml"; source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
}); });
symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript { symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.users.grey.homeDir}/.local/state/noctalia/plugins"; target = "${config.home.homeDirectory}/.local/state/noctalia/plugins";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/noctalia/plugins"; source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/noctalia/plugins";
isDir = true; isDir = true;
}); });
}; };
};
xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml"; xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins"; xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins";
});
}; };
}; };
} }
+14 -6
View File
@@ -1,5 +1,5 @@
{ inputs, self, ... }: { { inputs, self, ... }: {
flake.nixosModules.graphics = { config, pkgs, inputs, lib, ... }: { flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
config = lib.mkIf ((config.components.windowManagers == "niri")||(builtins.elem "niri" config.components.windowManagers)) { config = lib.mkIf ((config.components.windowManagers == "niri")||(builtins.elem "niri" config.components.windowManagers)) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
xdg-desktop-portal-gnome xdg-desktop-portal-gnome
@@ -37,11 +37,19 @@
)); ));
}; };
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) ({ lib, config, ... }: { home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript { components.windowManagers = [ "niri" ];
target = "${config.users.grey.homeDir}/.config/niri/config.kdl"; };
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl"; };
}); };
flake.homeModules.graphics = { config, pkgs, lib, inputs, ... }: {
home = lib.mkIf ((config.components.windowManagers == "niri")||(builtins.elem "niri" config.components.windowManagers)) {
packages = lib.mkIf (config.info.isStandalone) [ pkgs.niri ];
activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/niri/config.kdl";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl";
}); });
}; };
}; };
+4 -8
View File
@@ -14,15 +14,11 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
backupFileExtension = "bak"; backupFileExtension = "bak";
extraSpecialArgs = {
inherit inputs;
};
users.grey = self.homeModules.${config.info.hostName}; users.grey = self.homeModules.${config.info.hostName};
sharedModules = [
{ features.nixos.stylix.enable = lib.mkDefault config.features.nixos.stylix.enable; }
( lib.mkIf (config.features.nixos.stylix.enable)
( if (config.features.applications.gui.floorp.enable) then {
stylix.targets.floorp.profileNames = [ "default" ];
} else {})
)
];
}; };
}; };
} }
+10
View File
@@ -10,10 +10,20 @@
stylix.enable = true; stylix.enable = true;
stylix.image = builtins.path { path = "${self}/modules/hosts/${config.info.hostName}/wallpaper.jpg"; }; stylix.image = builtins.path { path = "${self}/modules/hosts/${config.info.hostName}/wallpaper.jpg"; };
stylix.polarity = "dark"; stylix.polarity = "dark";
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
features.nixos.stylix.enable = lib.mkDefault config.features.nixos.stylix.enable;
};
}; };
}; };
flake.homeModules.graphics = { pkgs, lib, config, ... }: { flake.homeModules.graphics = { pkgs, lib, config, ... }: {
options.features.nixos.stylix.enable = lib.mkEnableOption "stylix"; options.features.nixos.stylix.enable = lib.mkEnableOption "stylix";
config = lib.mkIf (config.features.nixos.stylix.enable) {
stylix.targets = lib.mkIf (config.features.applications.gui.floorp.enable) {
floorp.profileNames = [ "default" ];
};
};
}; };
} }
+1
View File
@@ -4,6 +4,7 @@
modules = with self.homeModules; [ modules = with self.homeModules; [
takamaki takamaki
]; ];
extraSpecialArgs = { inherit inputs; };
}; };
flake.homeModules.takamaki = { pkgs, config, lib, ... }: { flake.homeModules.takamaki = { pkgs, config, lib, ... }: {