mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
feat: init
This commit is contained in:
commit
96c6f790fc
804 changed files with 33411 additions and 0 deletions
57
modules/nixos/core/doas/default.nix
Executable file
57
modules/nixos/core/doas/default.nix
Executable file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.people)
|
||||
user0
|
||||
user1
|
||||
user2
|
||||
user3
|
||||
;
|
||||
inherit (flake.config.machines)
|
||||
devices
|
||||
;
|
||||
hostname = config.networking.hostName;
|
||||
mars = devices.mars.name;
|
||||
ceres = devices.ceres.name;
|
||||
venus = devices.venus.name;
|
||||
charon = devices.charon.name;
|
||||
deimos = devices.deimos.name;
|
||||
|
||||
userLogic =
|
||||
if
|
||||
builtins.elem hostname [
|
||||
mars
|
||||
deimos
|
||||
ceres
|
||||
]
|
||||
then
|
||||
[
|
||||
user0
|
||||
user1
|
||||
user3
|
||||
]
|
||||
else if hostname == charon then
|
||||
[ user1 ]
|
||||
else if hostname == venus then
|
||||
[ user2 ]
|
||||
else
|
||||
[ ];
|
||||
in
|
||||
{
|
||||
security = {
|
||||
doas = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
keepEnv = true;
|
||||
noPass = true;
|
||||
users = userLogic;
|
||||
}
|
||||
];
|
||||
};
|
||||
# sudo.enable = false;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue