From 3e208d20934bedd8cd7769f23f35cfae9d8e7d0d Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Fri, 14 Feb 2025 01:18:47 -0500 Subject: seth: simplify module structure Moving to mixins generally reduces the boilerplate in all configurations, and less custom "stuff" These are then enabled by the regular options in programs.nix for example Many of the other options (like desktops) also had little use in being abstracted as there's no situation where I'd *not* want them to be applied when said desktop is in use --- modules/shared/users/seth.nix | 48 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'modules/shared/users') diff --git a/modules/shared/users/seth.nix b/modules/shared/users/seth.nix index 89203c1..796171d 100644 --- a/modules/shared/users/seth.nix +++ b/modules/shared/users/seth.nix @@ -17,32 +17,30 @@ in enable = lib.mkEnableOption "Seth's user & home configurations"; }; - config = lib.mkMerge [ - (lib.mkIf cfg.enable { - users.users.seth.shell = pkgs.fish; + config = lib.mkIf cfg.enable ( + lib.mkMerge [ + { + users.users.seth.shell = pkgs.fish; - programs.fish.enable = true; + programs.fish.enable = true; - home-manager.users.seth = { - imports = [ (inputs.self + "/users/seth") ]; - seth = { - enable = true; - programs.fish.enable = true; + home-manager.users.seth = { + imports = [ (inputs.self + "/users/seth") ]; }; - }; - }) - - (lib.mkIf (cfg.enable && isDarwin) { - users.users.seth = { - home = lib.mkDefault "/Users/seth"; - }; - }) - - (lib.mkIf (cfg.enable && isLinux) { - users.users.seth = { - extraGroups = [ "wheel" ]; - isNormalUser = true; - }; - }) - ]; + } + + (lib.mkIf isDarwin { + users.users.seth = { + home = lib.mkDefault "/Users/seth"; + }; + }) + + (lib.mkIf isLinux { + users.users.seth = { + extraGroups = [ "wheel" ]; + isNormalUser = true; + }; + }) + ] + ); } -- cgit v1.2.3