nixos/hosts/common/users/sam/default.nix

38 lines
859 B
Nix

{ pkgs, inputs, config, lib, ... }:
let
hostname = config.networking.hostName;
pubKeys = lib.filesystem.listFilesRecursive (../keys);
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/sam".path;
in
{
users.users.sam = {
mutableUsers = true;
isNormalUser = true;
shell = pkgs.zsh; # default shell
initialPassword = "nixos";
hashedPasswordFile = sopsHashedPasswordFile;
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
extraGroups = [
"wheel"
"docker"
"git"
"networkmanager"
];
};
programs.zsh.enable = true;
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = {
sam = import ../../../../home/${hostname}.nix;
};
};
environment.systemPackages = [
];
}