1
0
Fork 0
nixos/config/users.nix

28 lines
842 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = with lib; import ("/etc/nixos/machines/" + (replaceStrings ["\n"] [""] (readFile /etc/hostname)) + "/configuration.nix");
in {
users = {
mutableUsers = false;
users.derped = {
isNormalUser = true;
home = "/home/derped";
createHome = true;
description = "";
group = "derped";
extraGroups = [ "audio" "wheel" "network" ] ++ (if cfg.conf.networking.hostName != "Ophanim" then ["input" "cups" "lp"] else []);
uid = 1337;
shell = "/run/current-system/sw/bin/zsh";
passwordFile = "/secret/derped";
openssh.authorizedKeys.keyFiles = (if cfg.conf.networking.hostName != "Ophanim" then [] else [ "/secret/derped.pub" ]);
};
groups.derped = {
name = "derped";
gid = 1337;
members = [ "derped" ];
};
};
}