suites: add users to suites
This commit is contained in:
parent
0837303bb5
commit
57c60bcdcd
6 changed files with 16 additions and 5 deletions
3
DOC.md
3
DOC.md
|
@ -41,6 +41,9 @@ directly imported from any host like so:
|
|||
}
|
||||
```
|
||||
|
||||
You can declare any combination of users and profiles that you wish, providing
|
||||
a nice abstraction, free from the idiosyncratic concerns of specific hardware.
|
||||
|
||||
## Users
|
||||
User declarations belong in the `users` directory.
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ suites, ... }:
|
||||
{
|
||||
### root password is empty by default ###
|
||||
imports = [ ../users/nixos ../users/root ] ++ suites.graphics;
|
||||
imports = suites.graphics;
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ suites, ... }:
|
||||
{
|
||||
imports = [ ../users/nixos ../users/root ] ++ suites.all;
|
||||
imports = with suites; allProfiles ++ allUsers;
|
||||
|
||||
security.mitigations.acceptRisk = true;
|
||||
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
{ lib, profiles }:
|
||||
let
|
||||
inherit (builtins) mapAttrs isFunction;
|
||||
all =
|
||||
|
||||
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 {
|
||||
work = [ develop virt ];
|
||||
work = [ develop virt users.nixos users.root ];
|
||||
|
||||
graphics = work ++ [ graphical ];
|
||||
|
||||
|
@ -24,5 +30,5 @@ mapAttrs (_: v: lib.flk.profileMap v)
|
|||
|
||||
goPlay = play ++ [ laptop ];
|
||||
} // {
|
||||
inherit all;
|
||||
inherit allProfiles allUsers;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
home-manager.users.nixos = {
|
||||
imports = [ ../profiles/git ../profiles/direnv ];
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{ ... }:
|
||||
# recommend using `hashedPassword`
|
||||
{
|
||||
users.users.root.password = "";
|
||||
|
|
Loading…
Reference in a new issue