67 lines
1.6 KiB
Nix
67 lines
1.6 KiB
Nix
{ pkgs, inputs, config, lib, ... }:
|
|
let
|
|
pubKeys = lib.filesystem.listFilesRecursive (../keys);
|
|
hostname = config.networking.hostName;
|
|
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/media".path;
|
|
secretsDirectory = builtins.toString inputs.nix-secrets;
|
|
secretsFile = "${secretsDirectory}/secrets.yaml";
|
|
in
|
|
{
|
|
users.users.media = {
|
|
isNormalUser = true;
|
|
shell = pkgs.zsh; # default shell
|
|
hashedPasswordFile = sopsHashedPasswordFile;
|
|
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
|
|
|
|
extraGroups =
|
|
[ "qemu-libvirtd" "libvirtd"
|
|
"wheel" "video" "audio" "disk" "networkmanager"
|
|
];
|
|
|
|
};
|
|
|
|
environment.persistence."/persist" = {
|
|
hideMounts = true;
|
|
users.media= {
|
|
directories = [
|
|
"sync"
|
|
"keep"
|
|
".ssh"
|
|
".config/dconf"
|
|
".config/cinnamon"
|
|
".config/nemo"
|
|
".mozilla"
|
|
".local"
|
|
];
|
|
files = [
|
|
];
|
|
};
|
|
};
|
|
|
|
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";
|
|
};
|
|
|
|
programs.zsh.enable = true;
|
|
programs.fuse.userAllowOther = true;
|
|
|
|
home-manager = {
|
|
extraSpecialArgs = { inherit inputs; };
|
|
users = {
|
|
media = import ../../../../home/${hostname}.nix;
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = [
|
|
];
|
|
}
|