suites: add users to suites

This commit is contained in:
Timothy DeHerrera 2021-02-01 20:57:14 -07:00
parent c67b846929
commit 9234577e7e
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
6 changed files with 16 additions and 5 deletions

3
DOC.md
View File

@ -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.

View File

@ -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;

View File

@ -1,6 +1,6 @@
{ suites, ... }:
{
imports = [ ../users/nixos ../users/root ] ++ suites.all;
imports = with suites; allProfiles ++ allUsers;
security.mitigations.acceptRisk = true;

View File

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

View File

@ -1,3 +1,4 @@
{ ... }:
{
home-manager.users.nixos = {
imports = [ ../profiles/git ../profiles/direnv ];

View File

@ -1,3 +1,4 @@
{ ... }:
# recommend using `hashedPassword`
{
users.users.root.password = "";