From ae478562e6d1be2f83e03e1748e77b0db3d467eb Mon Sep 17 00:00:00 2001 From: Serenity-F Date: Tue, 9 Apr 2024 00:41:40 +1000 Subject: [PATCH] changed: oh nvm, last commit + this one = setting up hybrid unified/multi-user home-manager configs --- core/configuration.nix | 2 +- home/users/{coffee.nix => -coffee.nix} | 0 home/users/{serenity.nix => -serenity.nix} | 0 home/users/-template.nix | 25 +++++++++++++++++ home/users/default.nix | 17 ++++++++++++ {core => home/users}/users.nix | 31 +++++++++++++++------- 6 files changed, 64 insertions(+), 11 deletions(-) rename home/users/{coffee.nix => -coffee.nix} (100%) rename home/users/{serenity.nix => -serenity.nix} (100%) create mode 100644 home/users/-template.nix create mode 100644 home/users/default.nix rename {core => home/users}/users.nix (66%) diff --git a/core/configuration.nix b/core/configuration.nix index 53f4655..1295acd 100644 --- a/core/configuration.nix +++ b/core/configuration.nix @@ -14,7 +14,7 @@ inputs.home-manager.nixosModules.home-manager # also split up configuration.nix and import pieces: - ./users.nix + ../home/users/default.nix ./packages.nix ]; diff --git a/home/users/coffee.nix b/home/users/-coffee.nix similarity index 100% rename from home/users/coffee.nix rename to home/users/-coffee.nix diff --git a/home/users/serenity.nix b/home/users/-serenity.nix similarity index 100% rename from home/users/serenity.nix rename to home/users/-serenity.nix diff --git a/home/users/-template.nix b/home/users/-template.nix new file mode 100644 index 0000000..430c898 --- /dev/null +++ b/home/users/-template.nix @@ -0,0 +1,25 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + + imports = [ + ../home.nix + ]; + + home = { + + packages = with pkgs; [ + + ]; + + stateVersion = "23.11"; + }; + +} diff --git a/home/users/default.nix b/home/users/default.nix new file mode 100644 index 0000000..2541a8c --- /dev/null +++ b/home/users/default.nix @@ -0,0 +1,17 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + + imports = [ + inputs.home-manager.nixosModules.default + ./users.nix + ]; + +} diff --git a/core/users.nix b/home/users/users.nix similarity index 66% rename from core/users.nix rename to home/users/users.nix index 7394725..d60cdb0 100644 --- a/core/users.nix +++ b/home/users/users.nix @@ -13,11 +13,10 @@ inputs.home-manager.nixosModules.default ]; - # To add a user, copy the template and adjust it to match, - # then the same with the home-manager block below, then - # add new $user.nix file in home/users/ by copyoing the - # existing template - # + # To add a user, copy the template in the users.users + # block and adjust it to match,then the same with the + # home-manager block below, then add new username.nix + # file in home/users by copying the existing template # # A suite of programs and applications has been provided # via a shared home.nix file, as well as a common config @@ -29,6 +28,7 @@ # TEMPLATE = { # description = "TEMPLATE"; # isNormalUser = true; + # # be sure to change this with 'passwd' # initialPassword = "password"; # shell = pkgs.fish; # extraGroups = [ @@ -40,6 +40,7 @@ coffee = { description = "Coffee Beans"; isNormalUser = true; + # be sure to change this with 'passwd' initialPassword = "password"; shell = pkgs.fish; extraGroups = [ @@ -51,6 +52,7 @@ serenity = { description = "Serenity Amalgam"; isNormalUser = true; + # be sure to change this with 'passwd' initialPassword = "password"; shell = pkgs.fish; extraGroups = [ @@ -67,17 +69,26 @@ useUserPackages = true; users = { - # coffee = { - # imports = [ ../home/users/coffee.nix ]; + # TEMPLATE = { + # imports = [ ./-template.nix ]; # home = { - # username = "coffee"; - # homeDirectory = "/home/coffee"; + # username = "TEMPLATE"; + # homeDirectory = "/home/TEMPLATE"; # stateVersion = "23.11"; # }; # }; + coffee = { + imports = [ ./-coffee.nix ]; + home = { + username = "coffee"; + homeDirectory = "/home/coffee"; + stateVersion = "23.11"; + }; + }; + serenity = { - imports = [ ../home/home.nix ]; + imports = [ ./-serenity.nix ]; home = { username = "serenity"; homeDirectory = "/home/serenity";