diff options
| author | Seth Flynn <[email protected]> | 2025-03-04 13:16:24 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-03-04 13:41:56 -0500 |
| commit | f1241cdcd8a7fb6a24ac349570bfecc3caf1b727 (patch) | |
| tree | 5e005362e648943cf6a78495ac8c8b5752c52595 /modules | |
| parent | 3d9f4f27d3fc5f41ed53263ba5d758aedeadbce5 (diff) | |
home/arkenfox: use `onFilesChanged` hook for prefsCleaner.sh
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/home/arkenfox/default.nix | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/modules/home/arkenfox/default.nix b/modules/home/arkenfox/default.nix index 58f2501..c92d1cb 100644 --- a/modules/home/arkenfox/default.nix +++ b/modules/home/arkenfox/default.nix @@ -30,8 +30,6 @@ let } ) (lib.importJSON ./arkenfox-hashes.json); - arkenfoxProfiles = lib.filterAttrs (lib.const (profile: profile.arkenfox.enable)) cfg.profiles; - arkenfoxSubmodule = { config, ... }: { @@ -70,25 +68,6 @@ in config = { home = { - # TODO: Find a better way to do this - activation.arkenfoxPrefsCleaner = lib.mkIf (arkenfoxProfiles != [ ]) ( - lib.hm.dag.entryAfter [ "writeBoundary" "linkGeneration" ] ( - lib.concatLines ( - lib.mapAttrsToList (lib.const ( - profile: - - let - prefsCleanerPath = "${config.home.homeDirectory}/${profilesPath}/${profile.path}/prefsCleaner.sh"; - in - - "run --quiet cp ${ - profile.arkenfox.source + "/prefsCleaner.sh" - } ${prefsCleanerPath} && run --quiet ${prefsCleanerPath}" - )) arkenfoxProfiles - ) - ) - ); - file = lib.mkMerge ( lib.mapAttrsToList (lib.const ( profile: @@ -102,6 +81,7 @@ in || profile.arkenfox.enable; userJsPath = "${profilesPath}/${profile.path}/user.js"; + prefsCleanerPath = dirOf userJsPath + "/prefsCleaner.sh"; homeManagerUserJs = pkgs.writeText "home-manager-firefox-profile-${profile.name}-home-manager-userjs" @@ -117,6 +97,13 @@ in echo >> $out cat ${homeManagerUserJs} >> $out ''; + + onChange = "${config.home.homeDirectory}/${prefsCleanerPath} -d -s"; + }; + + ${prefsCleanerPath} = lib.mkIf profile.arkenfox.enable { + source = profile.arkenfox.source + "/prefsCleaner.sh"; + executable = true; }; } )) cfg.profiles |
