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:
parent
0837303bb5
commit
57c60bcdcd
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
|
## Users
|
||||||
User declarations belong in the `users` directory.
|
User declarations belong in the `users` directory.
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
{
|
{
|
||||||
home-manager.users.nixos = {
|
home-manager.users.nixos = {
|
||||||
imports = [ ../profiles/git ../profiles/direnv ];
|
imports = [ ../profiles/git ../profiles/direnv ];
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
# recommend using `hashedPassword`
|
# recommend using `hashedPassword`
|
||||||
{
|
{
|
||||||
users.users.root.password = "";
|
users.users.root.password = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user