feat: allow defining impermanence dirs from home manager configs

This commit is contained in:
oddlama 2023-09-04 21:23:40 +02:00
parent 0eb6ac95e4
commit 9f2a34d83b
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 173 additions and 64 deletions

View file

@ -1,14 +1,9 @@
{
config,
lib,
pkgs,
...
}: let
myuser = config.repo.secrets.global.myuser.name;
mkUserDirs = map (directory: {
inherit directory;
mode = "700";
});
in {
users.groups.${myuser}.gid = config.users.users.${myuser}.uid;
users.users.${myuser} = {
@ -25,40 +20,12 @@ in {
# Needed for gtk
programs.dconf.enable = true;
# TODO age.secrets = mapAttrs user.hmConfig.cfg.age.secrets users
age.secrets.my-gpg-pubkey-yubikey = {
rekeyFile = ./yubikey.gpg.age;
group = myuser;
mode = "640";
};
# TODO numlock default on in sway and kernel console
# TODO make dataset for safe/persist/ and automount it
# TODO modularized based on hmConfig
environment.persistence."/state".users.${myuser}.directories = mkUserDirs [
".cache/fontconfig"
".cache/mozilla"
".cache/nix" # nix eval cache
".cache/nix-index"
".cache/nvidia" # GLCache
".cache/nvim"
".local/share/nvim"
".local/state/direnv"
".local/state/nix"
".local/state/nvim"
".local/state/wireplumber"
"Downloads"
];
environment.persistence."/persist".users.${myuser}.directories = mkUserDirs [
".mozilla"
".config/discord" # Bad Discord! BAD! Saves state in ,config tststs
".config/Signal" # L take, electron.
".local/share/atuin"
".local/share/nix" # Repl history
"projects"
];
home-manager.users.${myuser} = {
imports = [
../common

View file

@ -4,21 +4,33 @@
./sway.nix
];
home.packages = with pkgs; [
discord
firefox
thunderbird
signal-desktop
chromium
zathura
feh
];
home = {
packages = with pkgs; [
discord
firefox
thunderbird
signal-desktop
chromium
zathura
feh
];
# TODO VP9 hardware video decoding blocklisted
# TODO gpg switch to sk
# TODO VP9 hardware video decoding blocklisted
# TODO gpg switch to sk
home.shellAliases = {
p = "cd ~/projects";
zf = "zathura --fork";
shellAliases = {
p = "cd ~/projects";
zf = "zathura --fork";
};
persistence."/persist".directories = [
".config/discord" # Bad Discord! BAD! Saves its state in .config tststs
".config/Signal" # L take, electron.
"projects"
];
persistence."/state".directories = [
"Downloads"
];
};
}