From 1fe332c30221702127a784afe4f89d8a34c18f49 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 7 Jul 2025 18:25:43 +0800 Subject: [PATCH] feat(nix/persist): add impermanence to home-manager --- nix/modules/options/persist.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nix/modules/options/persist.nix b/nix/modules/options/persist.nix index 2ce1993..4e298c0 100644 --- a/nix/modules/options/persist.nix +++ b/nix/modules/options/persist.nix @@ -48,4 +48,16 @@ in }; }; }; + flake.modules.homeManager.default = + { config, ... }: + { + imports = [ inputs.impermanence.homeManagerModules.impermanence ]; + options.persistDirs = mkOpts "directory" { }; + options.persistFiles = mkOpts "file" { }; + config.home.persistence."/persist${config.home.homeDirectory}" = { + allowOther = true; + directories = config.persistDirs; + files = config.persistFiles; + }; + }; }