Skip to content

Commit

Permalink
suites: simplify code
Browse files Browse the repository at this point in the history
If this code had been written this way, I wouldn't have opened #200 in
the first place. (perspective of a begginer nix-langer)

closes: #200
  • Loading branch information
David Arnold committed Mar 18, 2021
1 parent 2961c1e commit e227b94
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions suites/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ let
profiles = dev.os.mkProfileAttrs (toString ../profiles);
users = dev.os.mkProfileAttrs (toString ../users);

allProfiles =
let defaults = lib.collect (x: x ? default) profiles;
in map (x: x.default) defaults;
allProfiles = dev.os.profileMap profiles;

allUsers =
let defaults = lib.collect (x: x ? default) users;
in map (x: x.default) defaults;
allUsers = dev.os.profileMap users;


suites = with profiles; rec {
base = [ users.nixos users.root ];
base = dev.os.profileMap [ users.nixos users.root ];
};
in
lib.mapAttrs (_: v: dev.os.profileMap v) suites // {
suites // {
inherit allProfiles allUsers;
}

0 comments on commit e227b94

Please sign in to comment.