1
1
mirror of https://github.com/divnix/digga.git synced 2024-11-23 20:22:04 +03:00

suites: add users to suites

This commit is contained in:
Timothy DeHerrera 2021-02-01 20:57:14 -07:00
parent 0837303bb5
commit 57c60bcdcd
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 ## Users
User declarations belong in the `users` directory. User declarations belong in the `users` directory.

View File

@ -1,7 +1,7 @@
{ suites, ... }: { suites, ... }:
{ {
### root password is empty by default ### ### root password is empty by default ###
imports = [ ../users/nixos ../users/root ] ++ suites.graphics; imports = suites.graphics;
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View File

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

View File

@ -1,16 +1,22 @@
{ lib, profiles }: { lib, profiles }:
let let
inherit (builtins) mapAttrs isFunction; inherit (builtins) mapAttrs isFunction;
all =
allProfiles =
let let
filtered = lib.filterAttrs (n: _: n != "core") profiles; filtered = lib.filterAttrs (n: _: n != "core") profiles;
in in
lib.collect isFunction filtered; lib.collect isFunction filtered;
allUsers = lib.collect isFunction users;
users = lib.flk.defaultImports (toString ../users);
in in
with profiles; with profiles;
mapAttrs (_: v: lib.flk.profileMap v) mapAttrs (_: v: lib.flk.profileMap v)
# define your own suites below
rec { rec {
work = [ develop virt ]; work = [ develop virt users.nixos users.root ];
graphics = work ++ [ graphical ]; graphics = work ++ [ graphical ];
@ -24,5 +30,5 @@ mapAttrs (_: v: lib.flk.profileMap v)
goPlay = play ++ [ laptop ]; goPlay = play ++ [ laptop ];
} // { } // {
inherit all; inherit allProfiles allUsers;
} }

View File

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

View File

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