{ config, lib, pkgs, ... }: with lib; let cfg = config.sydnix.impermanence; in { options = { sydnix.impermanence = { enable = mkOption { description = "Enable Impermanence"; type = types.bool; default = false; }; directories = mkOption { # type = with types; # listOf (coercedTo str (d: { directory = d; }) userDir); default = []; }; files = mkOption { # type = with types; # listOf (coercedTo str (f: { file = f; }) userFile); default = []; }; }; }; config = mkIf cfg.enable { home.persistence."/persist/home/${config.home.username}" = { allowOther = true; directories = cfg.directories; files = cfg.files; }; }; }