From fdece909d555911a1271c29f7f822377e8cf1bc9 Mon Sep 17 00:00:00 2001 From: serenity-F Date: Thu, 24 Sep 2026 06:31:36 +1000 Subject: [PATCH] feat: added preliminary theme options --- modules/features/desktop/default.nix | 4 +- modules/themes/default.nix | 106 +++++++++++++++++++++++++++ modules/themes/theme.nix | 34 +++++++++ 3 files changed, 142 insertions(+), 2 deletions(-) create mode 100755 modules/themes/default.nix create mode 100644 modules/themes/theme.nix diff --git a/modules/features/desktop/default.nix b/modules/features/desktop/default.nix index faf2be9..faceb73 100644 --- a/modules/features/desktop/default.nix +++ b/modules/features/desktop/default.nix @@ -12,8 +12,8 @@ # modules to include imports = [ - # session management - #self.nixosModules.${greeter} + # theme module + self.nixosModules.theme1 # window manager self.nixosModules.niri diff --git a/modules/themes/default.nix b/modules/themes/default.nix new file mode 100755 index 0000000..b7ef86b --- /dev/null +++ b/modules/themes/default.nix @@ -0,0 +1,106 @@ +{ + inputs, + outputs, + config, + pkgs, + lib, + label, + flakePath, + user, + userDescription, + homeDirectory, + wallpapersPath, + wallpaper, + avatarsPath, + avatar, + ... +}: + +let + hostname = "${config.networking.hostName}"; + +in +{ + + imports = [ ]; + + # Primary user configuration - + # to create additional users, copy all options + # below to a new file akin to `u-username.nix`, + # or `u-username/default.nix` with more modules, + # making sure to replace all instances of + # `${primaryUser}` with the new username. + + # Needed for sops-nix to handle loginPassword + #sops.secrets.loginPassword.neededForUsers = true; + #users.mutableUsers = false; + + # System-level user declarations + users.users = { + ${user} = { + description = "${userDescription}"; + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + ]; + #hashedPasswordFile = config.sops.secrets.loginPassword.path; + shell = pkgs.fish; # catgirls favourite shell + }; + }; + + # home-manager configuration + home-manager = { + verbose = true; # enables verbose output on activation + extraSpecialArgs = { + # passes in specialArgs from flake.nix + inherit inputs outputs; + inherit hostname; + inherit label flakePath; + inherit user userDescription; + inherit homeDirectory; + inherit wallpapersPath wallpaper; + inherit avatarsPath avatar; + }; + users = { + ${user} = { + imports = [ + # Home configuration - + # currently all users share the same home + # configuration, though each has separate + # home directories. Additional modules + # can be declared alongside `u-username/default.nix` + # and then imported in this section. + #./resources/theme + ./desktop + ./terminal + ./multimedia + ]; + home = { + stateVersion = "24.11"; # IMPORTANT + #programs.home-manager.enable = true; + #systemd.user.startServices = "sd-switch"; + username = "${user}"; # passes username from `flake.nix` + homeDirectory = "${homeDirectory}"; # passes homedir from `flake.nix` + file."avatars" = { + source = ./resources/avatars; + target = "${avatarsPath}"; + recursive = true; + }; + file."wallpapers" = { + # copies wallpapers + source = ./resources/wallpapers; # from flake directory + target = "${wallpapersPath}"; # to home directory + recursive = true; # think this is important, icr + }; + }; + nix.gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 1d"; + }; + }; + }; + }; + +} diff --git a/modules/themes/theme.nix b/modules/themes/theme.nix new file mode 100644 index 0000000..50a6f81 --- /dev/null +++ b/modules/themes/theme.nix @@ -0,0 +1,34 @@ +{ self, inputs, ... }: + +{ + + flake.nixosModules.theme1 = + { config, lib, pkgs, ...}: + + { + # for home manager functionality + imports = [ inputs.home-manager.nixosModules.home-manager ]; + + home-manager.users.serenity = { + + home = { + + # copies avatar from flake into home + file."avatars" = { + source = ./resources/avatars; + target = "/home/serenity/Pictures/Avatars"; + recursive = true; + }; + + # copies wallpapers from flake into home + file."wallpapers" = { + source = ./resources/wallpapers; + target = "/home/serenity/Pictures/Wallpapers"; + recursive = true; + }; + + }; + + }; + } +}