1
1
mirror of https://github.com/divnix/digga.git synced 2024-11-27 09:29:27 +03:00
digga/suites/default.nix

25 lines
574 B
Nix
Raw Normal View History

2021-02-06 11:31:48 +03:00
{ lib }:
let
inherit (builtins) mapAttrs isFunction;
inherit (lib.flk) mkProfileAttrs profileMap;
2021-02-06 11:31:48 +03:00
profiles = mkProfileAttrs (toString ../profiles);
users = mkProfileAttrs (toString ../users);
2021-02-06 11:31:48 +03:00
allProfiles =
let defaults = lib.collect (x: x ? default) profiles;
in map (x: x.default) defaults;
2021-02-06 11:31:48 +03:00
allUsers =
let defaults = lib.collect (x: x ? default) users;
in map (x: x.default) defaults;
2021-02-06 11:31:48 +03:00
suites = with profiles; rec {
base = [ users.nixos users.root ];
2021-02-06 11:31:48 +03:00
};
in
mapAttrs (_: v: profileMap v) suites // {
2021-02-06 11:31:48 +03:00
inherit allProfiles allUsers;
}