Files
sydnix/modules/home/impermanence.nix
Madeleine Sydney Ślaga 0ea963c879 chore: Fix tree-wide permissions
No idea why everything was executable, lol.
2025-09-08 06:08:20 -06:00

56 lines
1.4 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.sydnix.impermanence;
in {
options = {
sydnix.impermanence = {
enable = mkEnableOption "Impermanence";
directories = mkOption {
default = [];
type = types.listOf types.anything;
};
files = mkOption {
default = [];
type = types.listOf types.anything;
};
cache = {
directories = mkOption {
description = ''
While functionally identical to `directories` (at the moment),
`cache.directories` carries additional semantics: these directories
/can/ be erased, but typically /shouldn't/ be.
'';
default = [];
type = types.listOf types.anything;
};
files = mkOption {
description = ''
While functionally identical to `files` (at the moment),
`cache.files` carries additional semantics: these files /can/ be
erased, but typically /shouldn't/ be.
'';
default = [];
type = types.listOf types.anything;
};
};
};
};
config = mkIf cfg.enable {
home.persistence = {
"/persist/home/${config.home.username}" = {
allowOther = true;
directories = cfg.directories ++ cfg.cache.directories;
files = cfg.files ++ cfg.cache.files;
};
};
};
}