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"
prefer-no-csd
overview { zoom 0.666; }
overview { zoom 0.5; }
layout {
gaps 12
struts {
@@ -158,4 +158,8 @@ animations {
window-resize {
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
[backdrop]
blur_intensity = 0.099999997764825821
tint_intensity = 0.14999999664723873
blur_intensity = 0.74999998323619366
enabled = true
tint_intensity = 0.19999999552965164
[bar.default]
background_opacity = 0.79999998211860657
+77 -53
View File
@@ -1,36 +1,34 @@
{ inputs, self, ... }: {
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
options = {
components = {
displayManager = lib.mkOption {
# enum that dynamically populates itself with the contents of the display-managers directory
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/display-managers")
));
default = "lightdm";
};
options.components = {
displayManager = lib.mkOption {
# enum that dynamically populates itself with the contents of the display-managers directory
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/display-managers")
));
default = "lightdm";
};
windowManagers = lib.mkOption {
type = lib.types.either (lib.types.listOf (
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) (
windowManagers = lib.mkOption {
type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
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 {
type = lib.types.either (lib.types.listOf (
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 = [];
};
shells = lib.mkOption {
type = lib.types.either (lib.types.listOf (
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 = [];
};
};
@@ -48,37 +46,63 @@
};
};
flake.homeModules.graphics = { config, pkgs, ... }: {
home.packages = with pkgs; [
bibata-cursors
x264
gparted
vlc
iosevka-comfy.comfy
nerd-fonts.jetbrains-mono
];
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
options.components = {
windowManagers = lib.mkOption {
type = lib.types.either (lib.types.listOf (
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")
)));
default = [];
};
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
shells = lib.mkOption {
type = lib.types.either (lib.types.listOf (
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 = {
enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 22;
gtk.enable = true;
x11.enable = true;
};
config = {
home.packages = with pkgs; [
bibata-cursors
x264
gparted
vlc
iosevka-comfy.comfy
nerd-fonts.jetbrains-mono
];
gtk = {
enable = true;
colorScheme = "dark";
dconf.settings = {
"org/gnome/desktop/interface" = {
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
gtk2.force = true;
home.pointerCursor = {
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, ... }: {
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) {
environment.systemPackages = with pkgs; [
inputs.noctalia.packages.${system}.default
environment.systemPackages = [
inputs.noctalia.packages.${pkgs.system}.default
];
programs.noctalia.enable = true;
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) ({ lib, config, ... }: {
home.activation = {
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
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 {
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";
});
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";
isDir = true;
});
};
};
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/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins";
};
};
}
+14 -6
View File
@@ -1,5 +1,5 @@
{ 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)) {
environment.systemPackages = with pkgs; [
xdg-desktop-portal-gnome
@@ -37,11 +37,19 @@
));
};
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) ({ lib, config, ... }: {
home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.users.grey.homeDir}/.config/niri/config.kdl";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl";
});
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
components.windowManagers = [ "niri" ];
};
};
};
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;
useUserPackages = true;
backupFileExtension = "bak";
extraSpecialArgs = {
inherit inputs;
};
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.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) {
features.nixos.stylix.enable = lib.mkDefault config.features.nixos.stylix.enable;
};
};
};
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
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; [
takamaki
];
extraSpecialArgs = { inherit inputs; };
};
flake.homeModules.takamaki = { pkgs, config, lib, ... }: {