From 06e62c54d497eb03d8f10171964446f42dbfbf65 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 22 Nov 2024 13:33:05 -0500 Subject: [PATCH] refactor: clean up hm module code in devices --- common/default.nix | 11 ++++++++++- devices/binto/default.nix | 29 ++++++++++++----------------- devices/cluster/default.nix | 26 ++++++++++---------------- devices/homie/default.nix | 26 ++++++++++---------------- devices/nos/default.nix | 26 ++++++++++---------------- devices/servivi/default.nix | 26 ++++++++++---------------- devices/wim/default.nix | 29 ++++++++++++----------------- 7 files changed, 74 insertions(+), 99 deletions(-) diff --git a/common/default.nix b/common/default.nix index e0743ff5..4261c87d 100644 --- a/common/default.nix +++ b/common/default.nix @@ -112,6 +112,7 @@ in { home-manager.users = let inherit (config.vars) mainUser; + mainHmCfg = config.home-manager.users.${mainUser}; default = { imports = [ @@ -136,12 +137,20 @@ in { ./home ./home/trash-d + + self.homeManagerModules.neovim ]; home.stateVersion = config.system.stateVersion; }; in { - root = default; + root = + default + // { + programs.neovim = { + inherit (mainHmCfg.programs.neovim) enable enableIde user; + }; + }; greeter = mkIf (config.services.greetd.enable) default; ${mainUser} = default; }; diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 94f3f682..7717b97b 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -19,23 +19,6 @@ in { self.nixosModules.server ]; - home-manager.users = rec { - root = { - imports = [ - self.homeManagerModules.firefox - self.homeManagerModules.neovim - ]; - - programs.neovim = { - enable = true; - enableIde = true; - user = mainUser; - }; - }; - - ${mainUser} = root; - }; - # State Version: DO NOT CHANGE system.stateVersion = "23.11"; @@ -92,4 +75,16 @@ in { }; services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = [ + self.homeManagerModules.firefox + ]; + + programs.neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; } diff --git a/devices/cluster/default.nix b/devices/cluster/default.nix index f7f82b8f..351982c6 100644 --- a/devices/cluster/default.nix +++ b/devices/cluster/default.nix @@ -19,22 +19,6 @@ in { self.nixosModules.server ]; - home-manager.users = rec { - root = { - imports = [ - self.homeManagerModules.neovim - ]; - - programs.neovim = { - enable = true; - enableIde = true; - user = mainUser; - }; - }; - - ${mainUser} = root; - }; - # State Version: DO NOT CHANGE system.stateVersion = "24.05"; @@ -85,4 +69,14 @@ in { }; services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = []; + + programs.neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; } diff --git a/devices/homie/default.nix b/devices/homie/default.nix index 41aa8503..5ca73ff1 100644 --- a/devices/homie/default.nix +++ b/devices/homie/default.nix @@ -18,22 +18,6 @@ in { self.nixosModules.server ]; - home-manager.users = rec { - root = { - imports = [ - self.homeManagerModules.neovim - ]; - - programs.neovim = { - enable = true; - enableIde = true; - user = mainUser; - }; - }; - - ${mainUser} = root; - }; - # State Version: DO NOT CHANGE system.stateVersion = "24.11"; @@ -72,4 +56,14 @@ in { khepri.enable = true; services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = []; + + programs.neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; } diff --git a/devices/nos/default.nix b/devices/nos/default.nix index 60cfadb1..84e0ea84 100644 --- a/devices/nos/default.nix +++ b/devices/nos/default.nix @@ -18,22 +18,6 @@ in { self.nixosModules.server ]; - home-manager.users = rec { - root = { - imports = [ - self.homeManagerModules.neovim - ]; - - programs.neovim = { - enable = true; - enableIde = true; - user = mainUser; - }; - }; - - ${mainUser} = root; - }; - # State Version: DO NOT CHANGE system.stateVersion = "24.05"; @@ -72,4 +56,14 @@ in { }; services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = []; + + programs.neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; } diff --git a/devices/servivi/default.nix b/devices/servivi/default.nix index 2c6aa777..fd0467f7 100644 --- a/devices/servivi/default.nix +++ b/devices/servivi/default.nix @@ -18,22 +18,6 @@ in { self.nixosModules.server ]; - home-manager.users = rec { - root = { - imports = [ - self.homeManagerModules.neovim - ]; - - programs.neovim = { - enable = true; - enableIde = true; - user = mainUser; - }; - }; - - ${mainUser} = root; - }; - # State Version: DO NOT CHANGE system.stateVersion = "24.05"; @@ -86,4 +70,14 @@ in { khepri.enable = true; services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = []; + + programs.neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; } diff --git a/devices/wim/default.nix b/devices/wim/default.nix index 90730437..13d3afd7 100644 --- a/devices/wim/default.nix +++ b/devices/wim/default.nix @@ -22,23 +22,6 @@ in { self.nixosModules.server ]; - home-manager.users = rec { - root = { - imports = [ - self.homeManagerModules.firefox - self.homeManagerModules.neovim - ]; - - programs.neovim = { - enable = true; - enableIde = true; - user = mainUser; - }; - }; - - ${mainUser} = root; - }; - # State Version: DO NOT CHANGE system.stateVersion = "23.05"; @@ -111,4 +94,16 @@ in { khepri.enable = true; services.kmscon.enable = true; + + home-manager.users.${mainUser} = { + imports = [ + self.homeManagerModules.firefox + ]; + + programs.neovim = { + enable = true; + enableIde = true; + user = mainUser; + }; + }; }