diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-07-07 16:03:51 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-07-07 16:03:51 -0700 |
| commit | c214a560f0500e4be077086e557c3e6d336c7c27 (patch) | |
| tree | 760d484ecdf1c242075394fbcd97927f95f1048c /nix/scripts/darwin.nix | |
| parent | add a few tags to org-mode (diff) | |
| download | infra-c214a560f0500e4be077086e557c3e6d336c7c27.tar.gz | |
move scripts managed by nix out of the flake
In order to keep the flake readable, the various scripts managed by nix
are now moved to their own files under `nix/scripts`.
Diffstat (limited to 'nix/scripts/darwin.nix')
| -rw-r--r-- | nix/scripts/darwin.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/nix/scripts/darwin.nix b/nix/scripts/darwin.nix new file mode 100644 index 0000000..c1bbbde --- /dev/null +++ b/nix/scripts/darwin.nix @@ -0,0 +1,38 @@ +{ + pkgs, + system, + inputs, +}: +[ + (pkgs.writeScriptBin "nbuild" '' + set -e + echo "> Running darwin-rebuild build..." + ${inputs.darwin.packages.${system}.darwin-rebuild}/bin/darwin-rebuild build --flake . + echo "> darwin-rebuild build was successful ✅" + echo "> macOS config was successfully applied 🚀" + '') + + (pkgs.writeScriptBin "nswitch" '' + set -e + echo "> Running darwin-rebuild switch..." + ${inputs.darwin.packages.${system}.darwin-rebuild}/bin/darwin-rebuild switch --flake . + echo "> darwin-rebuild build was successful ✅" + echo "> macOS config was successfully applied 🚀" + '') + + (pkgs.writeScriptBin "switch-vm-synology" '' + set -e + echo "> Running nixos-rebuild switch ..." + ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --keep-going --flake .#vm-synology --target-host vm-synology --build-host vm-synology --fast --use-remote-sudo --use-substitutes + echo "> nixos-rebuild switch was successful ✅" + '') + + (pkgs.writeScriptBin "sync-agenix-key" '' + set -e + echo "> Copying agenix SSH key from 1password ..." + mkdir -p ~/.ssh + ${pkgs._1password-cli}/bin/op --account my.1password.com read "op://Private/agenix/private key?ssh-format=openssh" > ~/.ssh/agenix + ${pkgs._1password-cli}/bin/op --account my.1password.com read "op://Private/agenix/public key" > ~/.ssh/agenix.pub + echo "> agenix SSH key copied successfully 🔐" + '') +] |
