mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
refactor: cleaned up nixos and home dirs
This commit is contained in:
parent
824a91d405
commit
e596e1c1b3
582 changed files with 2 additions and 22 deletions
44
modules/nixos/core/ssh/default.nix
Executable file
44
modules/nixos/core/ssh/default.nix
Executable file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.people)
|
||||
user0
|
||||
user1
|
||||
user2
|
||||
;
|
||||
inherit (flake.config.people.users.${userLogic})
|
||||
sshKeys
|
||||
;
|
||||
inherit (flake.config.machines)
|
||||
devices
|
||||
;
|
||||
hostname = config.networking.hostName;
|
||||
desktop = devices.desktop.name;
|
||||
server = devices.server.name;
|
||||
fallaryn = devices.fallaryn.name;
|
||||
bartholomew = devices.bartholomew.name;
|
||||
|
||||
userLogic =
|
||||
if hostname == desktop then
|
||||
user0
|
||||
else if hostname == server then
|
||||
user0
|
||||
else if hostname == fallaryn then
|
||||
user2
|
||||
else
|
||||
"";
|
||||
in
|
||||
{
|
||||
users.users =
|
||||
if hostname == bartholomew then
|
||||
{ }
|
||||
else
|
||||
{
|
||||
${userLogic} = {
|
||||
openssh.authorizedKeys.keys = sshKeys;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue