diff --git a/flake.nix b/flake.nix index d5d5281..bd48d0b 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + mac-app-util = { + url = "github:hraban/mac-app-util"; + }; + # Home Manager home-manager = { url = "github:nix-community/home-manager/master"; @@ -104,6 +108,7 @@ , nixpkgs , nix-on-droid , nix-darwin + , mac-app-util , home-manager , disko , deploy-rs diff --git a/modules/home-manager/darwin-trampolines/default.nix b/modules/home-manager/darwin-trampolines/default.nix new file mode 100644 index 0000000..2a02019 --- /dev/null +++ b/modules/home-manager/darwin-trampolines/default.nix @@ -0,0 +1,20 @@ +{ inputs, outputs, ... }: +{ lib, pkgs, config, ... }: + +{ + imports = [ ]; + + options = { }; + + config = { + home.activation = lib.mkIf pkgs.stdenv.isDarwin { + trampolineApps = let + mac-app-util = inputs.mac-app-util.packages.${pkgs.stdenv.system}.default; + in lib.hm.dag.entryAfter [ "writeBoundary" ] '' + fromDir="$HOME/Applications/Home Manager Apps" + toDir="$HOME/Applications/Home Manager Trampolines" + ${mac-app-util}/bin/mac-app-util sync-trampolines "$fromDir" "$toDir" + ''; + }; + }; +} diff --git a/modules/nix-darwin/system/default.nix b/modules/nix-darwin/system/default.nix index 4ae0491..ace0e40 100644 --- a/modules/nix-darwin/system/default.nix +++ b/modules/nix-darwin/system/default.nix @@ -1,3 +1,4 @@ +{ inputs, outputs, ... }: { lib, pkgs, config, ... }: with lib; @@ -181,6 +182,8 @@ in # echo "Set hostname" # sudo scutil --set HostName $hostname + + ${inputs.mac-app-util.packages.${pkgs.stdenv.system}.default}/bin/mac-app-util sync-trampolines "/Applications/Nix Apps" "/Applications/Nix Trampolines" ''; # User-level settings