1651913910
* Leave importing to nixpkgs module implentation. Provide a path instead; resolves #136. * Allow profiles which are not lambdas but simple attribute sets, relaxing the constraints a bit. * Update profile README.md * defaultImports -> mkProfileAttrs: allow importing subprofiles even if parent directory does not contain a default.nix.
24 lines
574 B
Nix
24 lines
574 B
Nix
{ lib }:
|
|
let
|
|
inherit (builtins) mapAttrs isFunction;
|
|
inherit (lib.flk) mkProfileAttrs profileMap;
|
|
|
|
profiles = mkProfileAttrs (toString ../profiles);
|
|
users = mkProfileAttrs (toString ../users);
|
|
|
|
allProfiles =
|
|
let defaults = lib.collect (x: x ? default) profiles;
|
|
in map (x: x.default) defaults;
|
|
|
|
allUsers =
|
|
let defaults = lib.collect (x: x ? default) users;
|
|
in map (x: x.default) defaults;
|
|
|
|
|
|
suites = with profiles; rec {
|
|
base = [ users.nixos users.root ];
|
|
};
|
|
in
|
|
mapAttrs (_: v: profileMap v) suites // {
|
|
inherit allProfiles allUsers;
|
|
}
|