pub-solar-os/suites/default.nix

36 lines
861 B
Nix
Raw Normal View History

2021-02-06 08:31:48 +00:00
{ lib }:
let
inherit (lib) dev;
2021-02-06 08:31:48 +00:00
profiles = dev.os.mkProfileAttrs (toString ../profiles);
userProfiles = dev.os.mkProfileAttrs (toString ../users/profiles);
users = dev.os.mkProfileAttrs (toString ../users);
2021-02-06 08:31:48 +00:00
allProfiles =
let defaults = lib.collect (x: x ? default) profiles;
in map (x: x.default) defaults;
2021-02-06 08:31:48 +00:00
allUsers =
let defaults = lib.collect (x: x ? default) users;
in map (x: x.default) defaults;
2021-02-06 08:31:48 +00:00
suites = with profiles; rec {
base = [ users.nixos users.root ];
2021-02-06 08:31:48 +00:00
};
# available as 'suites' within the home-manager configuration
userSuites = with userProfiles; rec {
base = [ direnv git ];
};
2021-02-06 08:31:48 +00:00
in
{
system = lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
inherit allProfiles allUsers;
};
user = lib.mapAttrs (_: v: dev.os.profileMap v) userSuites // {
allProfiles = userProfiles;
};
2021-02-06 08:31:48 +00:00
}