suites: mv to dir
This commit is contained in:
parent
c6d25002ed
commit
1d5b489bb2
2
DOC.md
2
DOC.md
@ -32,7 +32,7 @@ explicitly loaded via `imports`.
|
|||||||
|
|
||||||
## Suites
|
## Suites
|
||||||
|
|
||||||
[Suites](./profiles/suites.nix) are simple collections of profiles that can be
|
[Suites](./suites/default.nix) are simple collections of profiles that can be
|
||||||
directly imported from any host like so:
|
directly imported from any host like so:
|
||||||
```
|
```
|
||||||
{ suites, ... }:
|
{ suites, ... }:
|
||||||
|
@ -12,8 +12,7 @@ let
|
|||||||
inherit (lib.flk) recImport nixosSystemExtended defaultImports;
|
inherit (lib.flk) recImport nixosSystemExtended defaultImports;
|
||||||
inherit (builtins) attrValues removeAttrs;
|
inherit (builtins) attrValues removeAttrs;
|
||||||
|
|
||||||
profiles = defaultImports (toString ../profiles);
|
suites = import ../suites { inherit lib profiles; };
|
||||||
suites = import ../profiles/suites.nix { inherit lib profiles; };
|
|
||||||
|
|
||||||
config = hostName:
|
config = hostName:
|
||||||
nixosSystemExtended {
|
nixosSystemExtended {
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
{ lib, profiles }:
|
|
||||||
let
|
|
||||||
inherit (builtins) mapAttrs isFunction;
|
|
||||||
|
|
||||||
allProfiles =
|
|
||||||
let
|
|
||||||
filtered = lib.filterAttrs (n: _: n != "core") profiles;
|
|
||||||
in
|
|
||||||
lib.collect isFunction filtered;
|
|
||||||
|
|
||||||
allUsers = lib.collect isFunction users;
|
|
||||||
|
|
||||||
users = lib.flk.defaultImports (toString ../users);
|
|
||||||
in
|
|
||||||
with profiles;
|
|
||||||
mapAttrs (_: v: lib.flk.profileMap v)
|
|
||||||
# define your own suites below
|
|
||||||
rec {
|
|
||||||
core = [ users.nixos users.root ];
|
|
||||||
} // {
|
|
||||||
inherit allProfiles allUsers;
|
|
||||||
}
|
|
24
suites/default.nix
Normal file
24
suites/default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ lib }:
|
||||||
|
let
|
||||||
|
inherit (builtins) mapAttrs isFunction;
|
||||||
|
inherit (lib.flk) importDefaults;
|
||||||
|
|
||||||
|
profiles = importDefaults (toString ../profiles);
|
||||||
|
users = importDefaults (toString ../users);
|
||||||
|
|
||||||
|
allProfiles =
|
||||||
|
let
|
||||||
|
sansCore = lib.filterAttrs (n: _: n != "core") profiles;
|
||||||
|
in
|
||||||
|
lib.collect isFunction sansCore;
|
||||||
|
|
||||||
|
allUsers = lib.collect isFunction users;
|
||||||
|
|
||||||
|
|
||||||
|
suites = with profiles; rec {
|
||||||
|
core = [ users.nixos users.root ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mapAttrs (_: v: lib.flk.profileMap v) suites // {
|
||||||
|
inherit allProfiles allUsers;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user