Skip to content

Commit d44eac6

Browse files
committed
feat: toggle module on/off with .enable
1 parent 341ede9 commit d44eac6

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

flake.nix

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,21 @@
5353
};
5454
};
5555
};
56-
darwinModules.default = { pkgs, ... }: {
57-
system.activationScripts.postActivation.text = let
58-
mac-app-util = self.packages.${pkgs.stdenv.system}.default;
59-
in ''
60-
${mac-app-util}/bin/mac-app-util sync-trampolines "/Applications/Nix Apps" "/Applications/Nix Trampolines"
61-
'';
56+
darwinModules.default = { config, pkgs, lib, ... }: {
57+
options = {
58+
hly.mac-app-util.enable = lib.mkOption {
59+
type = lib.types.bool;
60+
default = true;
61+
example = false;
62+
};
63+
};
64+
config = lib.mkIf config.hly.mac-app-util.enable {
65+
system.activationScripts.postActivation.text = let
66+
mac-app-util = self.packages.${pkgs.stdenv.system}.default;
67+
in ''
68+
${mac-app-util}/bin/mac-app-util sync-trampolines "/Applications/Nix Apps" "/Applications/Nix Trampolines"
69+
'';
70+
};
6271
};
6372
}
6473
//

0 commit comments

Comments
 (0)