Files
sydnix/modules/home/impermanence.nix
2025-01-02 01:15:03 -07:00

34 lines
614 B
Nix
Executable File

{ 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;
};
};
};
config = mkIf cfg.enable {
home.persistence = {
"/persist/home/${config.home.username}" = {
allowOther = true;
directories = cfg.directories;
files = cfg.files;
};
};
};
}