diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-09-06 16:08:07 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-09-06 16:08:07 -0700 |
| commit | e2addeab1a11e6589f56bacec4b045d17f322c19 (patch) | |
| tree | 53647f18d77d882d4898bddff85af21f851278a4 /flake/scripts/darwin.nix | |
| parent | run my personal website on the droplet (diff) | |
| download | infra-e2addeab1a11e6589f56bacec4b045d17f322c19.tar.gz | |
move things around
Diffstat (limited to '')
| -rw-r--r-- | flake/scripts/darwin.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/flake/scripts/darwin.nix b/flake/scripts/darwin.nix new file mode 100644 index 0000000..abf6eac --- /dev/null +++ b/flake/scripts/darwin.nix @@ -0,0 +1,29 @@ +{ + 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 ✅" + '') + + (pkgs.writeScriptBin "nswitch" '' + set -e + echo "> Running darwin-rebuild switch..." + ${inputs.darwin.packages.${system}.darwin-rebuild}/bin/darwin-rebuild switch --flake . + echo "> macOS config was successfully applied 🚀" + '') + + (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 🔐" + '') +] |
