1
1
mirror of https://github.com/divnix/digga.git synced 2024-11-23 20:22:04 +03:00
digga/suites/default.nix
Timothy DeHerrera 1651913910
profiles: simplify profiles to suites
* 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.
2021-02-25 14:47:19 -07:00

25 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;
}