forked from pub-solar/os
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 = [
|
userModules = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# passed to all home-manager modules
|
||||||
|
userSpecialArgs = {
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ let
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
|
|
||||||
|
extraSpecialArgs = extern.userSpecialArgs // { suites = suites.user; };
|
||||||
sharedModules = extern.userModules ++ (builtins.attrValues self.homeModules);
|
sharedModules = extern.userModules ++ (builtins.attrValues self.homeModules);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ let
|
||||||
flakeModules = { imports = builtins.attrValues self.nixosModules ++ extern.modules; };
|
flakeModules = { imports = builtins.attrValues self.nixosModules ++ extern.modules; };
|
||||||
};
|
};
|
||||||
|
|
||||||
specialArgs = extern.specialArgs // { inherit suites; };
|
specialArgs = extern.specialArgs // { suites = suites.system; };
|
||||||
|
|
||||||
mkHostConfig = hostName:
|
mkHostConfig = hostName:
|
||||||
let
|
let
|
||||||
|
|
|
@ -3,6 +3,7 @@ let
|
||||||
inherit (lib) dev;
|
inherit (lib) dev;
|
||||||
|
|
||||||
profiles = dev.os.mkProfileAttrs (toString ../profiles);
|
profiles = dev.os.mkProfileAttrs (toString ../profiles);
|
||||||
|
userProfiles = dev.os.mkProfileAttrs (toString ../users/profiles);
|
||||||
users = dev.os.mkProfileAttrs (toString ../users);
|
users = dev.os.mkProfileAttrs (toString ../users);
|
||||||
|
|
||||||
allProfiles =
|
allProfiles =
|
||||||
|
@ -17,7 +18,18 @@ let
|
||||||
suites = with profiles; rec {
|
suites = with profiles; rec {
|
||||||
base = [ users.nixos users.root ];
|
base = [ users.nixos users.root ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# available as 'suites' within the home-manager configuration
|
||||||
|
userSuites = with userProfiles; rec {
|
||||||
|
base = [ direnv git ];
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
|
{
|
||||||
|
system = lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
|
||||||
inherit allProfiles allUsers;
|
inherit allProfiles allUsers;
|
||||||
|
};
|
||||||
|
user = lib.mapAttrs (_: v: dev.os.profileMap v) userSuites // {
|
||||||
|
allProfiles = userProfiles;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
home-manager.users.nixos = {
|
home-manager.users.nixos = { suites, ... }: {
|
||||||
imports = [ ../profiles/git ../profiles/direnv ];
|
imports = suites.base;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.nixos = {
|
users.users.nixos = {
|
||||||
|
|
Loading…
Reference in a new issue