From 26e21a4edd0f7bbd1265c9a401c7b330e9511638 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 14 Jul 2025 01:17:25 +0800 Subject: [PATCH] feat(persist): conditionally persist home on linux only --- nix/modules/system/persist.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nix/modules/system/persist.nix b/nix/modules/system/persist.nix index 4e298c0..bda2d15 100644 --- a/nix/modules/system/persist.nix +++ b/nix/modules/system/persist.nix @@ -5,6 +5,7 @@ ... }: let + inherit (lib.modules) mkIf; inherit (lib.options) mkOption; inherit (config.flake.lib.options) mkStrOption; inherit (lib.types) @@ -49,15 +50,17 @@ in }; }; flake.modules.homeManager.default = - { config, ... }: + { config, osConfig, ... }: { 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; + config = mkIf (osConfig.nixpkgs.hostPlatform == "x86_64-linux") { + home.persistence."/persist${config.home.homeDirectory}" = { + allowOther = true; + directories = config.persistDirs; + files = config.persistFiles; + }; }; }; }