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

50 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2024-05-16 20:19:01 +01:00
{ pkgs, inputs, config, lib, ... }:
let
pubKeys = lib.filesystem.listFilesRecursive (../keys);
2024-05-17 01:07:42 +01:00
hostname = config.networking.hostName;
2024-05-22 17:23:17 +01:00
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/media".path;
2024-05-23 10:48:00 +01:00
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
2024-05-16 20:19:01 +01:00
in
{
users.users.media = {
isNormalUser = true;
shell = pkgs.zsh; # default shell
2024-05-22 17:44:08 +01:00
#hashedPasswordFile = sopsHashedPasswordFile;
password = "nixos";
2024-05-16 20:19:01 +01:00
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
extraGroups =
[ "qemu-libvirtd" "libvirtd"
"wheel" "video" "audio" "disk" "networkmanager"
];
};
2024-05-23 10:48:00 +01:00
sops.secrets."passwords/media" = {
sopsFile = "${secretsFile}";
neededForUsers = true;
};
sops.secrets."ssh_keys/media/id_ed25519" = {
path = "/home/media/.ssh/id_ed25519";
};
sops.secrets."ssh_keys/media/id_ed25519.pub" = {
path = "/home/media/.ssh/id_ed25519.pub";
};
2024-05-16 20:19:01 +01:00
programs.zsh.enable = true;
2024-05-17 01:07:42 +01:00
programs.fuse.userAllowOther = true;
2024-05-17 10:54:53 +01:00
2024-05-17 01:07:42 +01:00
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = {
media = import ../../../../home/${hostname}.nix;
};
};
2024-05-16 20:19:01 +01:00
environment.systemPackages = [
];
}