diff options
Diffstat (limited to 'config/users.nix')
| -rw-r--r-- | config/users.nix | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/config/users.nix b/config/users.nix new file mode 100644 index 0000000..248d987 --- /dev/null +++ b/config/users.nix @@ -0,0 +1,32 @@ +{ lib, pkgs, ... }: + +let + remoteBuildingUsers = { + kerberos = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgohiYF2Dsaq6ImGaslnKJMwpiVtwAaM9cm1tpSRr7t root@kerberos"; + }; +in +{ + personal.user.enable = true; + users.users = builtins.mapAttrs (_: key: { + isNormalUser = true; + shell = pkgs.busybox-sandbox-shell; + openssh.authorizedKeys.keys = [ key ]; + homeMode = "700"; + }) remoteBuildingUsers; + + services.openssh.extraConfig = lib.concatLines ( + lib.mapAttrsToList (name: _: '' + Match user ${name} + PermitTTY yes + '') remoteBuildingUsers + ); + + # broken (not running) + system.userActivationScripts.remoteBuildingSetup = '' + if [[ $(whoami) = @(${builtins.concatStringsSep "|" (builtins.attrNames remoteBuildingUsers)}) ]] + then + mkdir --parents --mode=700 nixos-configuration + git init --bare nixos-configuration + fi + ''; +} |
