refactor: add default in device modules and put home state ver in common
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-09-05 08:17:23 -04:00
parent 18d1178d85
commit e61ada3cd2
17 changed files with 72 additions and 64 deletions

View file

@ -107,17 +107,15 @@
]; ];
home-manager = let home-manager = let
inherit (lib) mapAttrs' nameValuePair; inherit (lib) mapAttrs' mkIf mkOption nameValuePair types;
inherit (config.vars) mainUser; inherit (config.vars) mainUser;
mainUserConf = config.home-manager.users.${mainUser};
default = { default = {
imports = [ imports = [
# Make the vars be the same on Nix and HM # Make the vars be the same on Nix and HM
{ {
options.vars = lib.mkOption { options.vars = mkOption {
type = lib.types.attrs; type = types.attrs;
readOnly = true; readOnly = true;
default = config.vars; default = config.vars;
}; };
@ -139,21 +137,13 @@
source = v; source = v;
}) })
self.devShells.${pkgs.system}; self.devShells.${pkgs.system};
home.stateVersion = config.system.stateVersion;
}; };
in { in {
users = { users = {
root = root = default;
default greeter = mkIf (config.services.greetd.enable) default;
// {
home.stateVersion = mainUserConf.home.stateVersion;
};
greeter =
lib.mkIf (config.services.greetd.enable)
(default
// {
home.stateVersion = mainUserConf.home.stateVersion;
});
${mainUser} = default; ${mainUser} = default;
}; };
}; };

View file

@ -11,7 +11,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/desktop ./modules
self.nixosModules.kmscon self.nixosModules.kmscon
self.nixosModules.plymouth self.nixosModules.plymouth
@ -20,7 +20,6 @@ in {
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "24.11"; system.stateVersion = "24.11";
home-manager.users.${mainUser}.home.stateVersion = "24.11";
# ------------------------------------------------ # ------------------------------------------------
# User Settings # User Settings

View file

@ -0,0 +1,5 @@
{...}: {
imports = [
./desktop
];
}

View file

@ -11,8 +11,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/gpu-replay.nix ./modules
./modules/nix-gaming.nix
self.nixosModules.adb self.nixosModules.adb
self.nixosModules.desktop self.nixosModules.desktop
@ -20,14 +19,10 @@ in {
self.nixosModules.server self.nixosModules.server
]; ];
home-manager.users.${mainUser} = { home-manager.users.${mainUser}.imports = [
imports = [ self.homeManagerModules.firefox
self.homeManagerModules.firefox ];
];
# State Version: DO NOT CHANGE
home.stateVersion = "23.11";
};
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "23.11"; system.stateVersion = "23.11";

View file

@ -0,0 +1,6 @@
{...}: {
imports = [
./gpu-replay.nix
./nix-gaming.nix
];
}

View file

@ -13,7 +13,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/pcsd.nix ./modules
self.nixosModules.kmscon self.nixosModules.kmscon
self.nixosModules.server self.nixosModules.server
@ -21,7 +21,6 @@ in {
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "24.05"; system.stateVersion = "24.05";
home-manager.users.${mainUser}.home.stateVersion = "24.05";
# ------------------------------------------------ # ------------------------------------------------
# User Settings # User Settings

View file

@ -0,0 +1,10 @@
{...}: {
imports = [
./blocky.nix
./caddy.nix
./headscale
./nfs-client.nix
./pcsd.nix
./unbound.nix
];
}

View file

@ -5,15 +5,7 @@
}: let }: let
inherit (config.sops) secrets; inherit (config.sops) secrets;
in { in {
imports = [ imports = [pcsd.nixosModules.default];
pcsd.nixosModules.default
./blocky.nix
./caddy.nix
./headscale
./nfs-client.nix
./unbound.nix
];
services.pcsd = { services.pcsd = {
enable = true; enable = true;

View file

@ -11,7 +11,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/home-assistant.nix ./modules
self.nixosModules.kmscon self.nixosModules.kmscon
self.nixosModules.server self.nixosModules.server
@ -19,7 +19,6 @@ in {
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "24.11"; system.stateVersion = "24.11";
home-manager.users.${mainUser}.home.stateVersion = "24.11";
# ------------------------------------------------ # ------------------------------------------------
# User Settings # User Settings

View file

@ -0,0 +1,5 @@
{...}: {
imports = [
./home-assistant.nix
];
}

View file

@ -11,13 +11,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/docker ./modules
./modules/jellyfin
./modules/llm.nix
./modules/mergerfs.nix
./modules/qbittorrent
./modules/snapraid.nix
./modules/subtitles
self.nixosModules.kmscon self.nixosModules.kmscon
self.nixosModules.server self.nixosModules.server
@ -25,7 +19,6 @@ in {
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "24.05"; system.stateVersion = "24.05";
home-manager.users.${mainUser}.home.stateVersion = "24.05";
# ------------------------------------------------ # ------------------------------------------------
# User Settings # User Settings

View file

@ -0,0 +1,11 @@
{...}: {
imports = [
./docker
./jellyfin
./qbittorrent
./subtitles
./llm.nix
./mergerfs.nix
./snapraid.nix
];
}

View file

@ -11,11 +11,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/7-days-to-die.nix ./modules
./modules/binary-cache.nix
./modules/minecraft.nix
./modules/nfs.nix
./modules/pr-tracker.nix
self.nixosModules.docker self.nixosModules.docker
self.nixosModules.kmscon self.nixosModules.kmscon
@ -24,7 +20,6 @@ in {
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "24.05"; system.stateVersion = "24.05";
home-manager.users.${mainUser}.home.stateVersion = "24.05";
# ------------------------------------------------ # ------------------------------------------------
# User Settings # User Settings

View file

@ -0,0 +1,9 @@
{...}: {
imports = [
./7-days-to-die.nix
./binary-cache.nix
./minecraft.nix
./nfs.nix
./pr-tracker.nix
];
}

View file

@ -12,7 +12,7 @@ in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/security.nix ./modules
self.nixosModules.adb self.nixosModules.adb
self.nixosModules.desktop self.nixosModules.desktop
@ -21,14 +21,10 @@ in {
self.nixosModules.server self.nixosModules.server
]; ];
home-manager.users.${mainUser} = { home-manager.users.${mainUser}.imports = [
imports = [ self.homeManagerModules.firefox
self.homeManagerModules.firefox ];
];
# State Version: DO NOT CHANGE
home.stateVersion = "23.05";
};
# State Version: DO NOT CHANGE # State Version: DO NOT CHANGE
system.stateVersion = "23.05"; system.stateVersion = "23.05";

View file

@ -0,0 +1,5 @@
{...}: {
imports = [
./security.nix
];
}

View file

@ -117,7 +117,6 @@
live-image = mkNixOS { live-image = mkNixOS {
extraModules = [ extraModules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
{home-manager.users.nixos.home.stateVersion = "24.05";}
{ {
vars = { vars = {
mainUser = "nixos"; mainUser = "nixos";