users: wire up all user profiles to userSuites and pass to home-manager
This commit is contained in:
parent
416a52fcd3
commit
cc52cd9fa2
3
extern/default.nix
vendored
3
extern/default.nix
vendored
@ -24,4 +24,7 @@
|
||||
userModules = [
|
||||
];
|
||||
|
||||
# passed to all home-manager modules
|
||||
userSpecialArgs = {
|
||||
};
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ let
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = extern.userSpecialArgs // { suites = suites.user; };
|
||||
sharedModules = extern.userModules ++ (builtins.attrValues self.homeModules);
|
||||
};
|
||||
|
||||
@ -71,7 +72,7 @@ let
|
||||
flakeModules = { imports = builtins.attrValues self.nixosModules ++ extern.modules; };
|
||||
};
|
||||
|
||||
specialArgs = extern.specialArgs // { inherit suites; };
|
||||
specialArgs = extern.specialArgs // { suites = suites.system; };
|
||||
|
||||
mkHostConfig = hostName:
|
||||
let
|
||||
|
@ -3,6 +3,7 @@ let
|
||||
inherit (lib) dev;
|
||||
|
||||
profiles = dev.os.mkProfileAttrs (toString ../profiles);
|
||||
userProfiles = dev.os.mkProfileAttrs (toString ../users/profiles);
|
||||
users = dev.os.mkProfileAttrs (toString ../users);
|
||||
|
||||
allProfiles =
|
||||
@ -17,7 +18,18 @@ let
|
||||
suites = with profiles; rec {
|
||||
base = [ users.nixos users.root ];
|
||||
};
|
||||
|
||||
# available as 'suites' within the home-manager configuration
|
||||
userSuites = with userProfiles; rec {
|
||||
base = [ direnv git ];
|
||||
};
|
||||
|
||||
in
|
||||
lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
|
||||
inherit allProfiles allUsers;
|
||||
{
|
||||
system = lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
|
||||
inherit allProfiles allUsers;
|
||||
};
|
||||
user = lib.mapAttrs (_: v: dev.os.profileMap v) userSuites // {
|
||||
allProfiles = userProfiles;
|
||||
};
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
home-manager.users.nixos = {
|
||||
imports = [ ../profiles/git ../profiles/direnv ];
|
||||
home-manager.users.nixos = { suites, ... }: {
|
||||
imports = suites.base;
|
||||
};
|
||||
|
||||
users.users.nixos = {
|
||||
|
Loading…
Reference in New Issue
Block a user