From 134aaffb30c0e2d352e74c3585f88ec567714ad9 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Thu, 5 Mar 2026 18:02:41 -0800 Subject: make push hook actually work by abstracting user --- flake.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index dcd9843..de232f7 100644 --- a/flake.nix +++ b/flake.nix @@ -23,18 +23,20 @@ emacsPackages = import "${nixmacs}/modules/home/emacs-packages.nix"; ci-emacs = pkgs.emacs-nox.pkgs.withPackages emacsPackages; + specialArgs = { monorepoSelf = self; }; installer = nixmacs.nixosConfigurations.installer.extendModules { - specialArgs = { monorepoSelf = self; }; + inherit specialArgs; }; - installer-iso = installer.config.system.build.isoImage; - spontaneity = nixmacs.nixosConfigurations.spontaneity.extendModules { - specialArgs = { monorepoSelf = self; }; + inherit specialArgs; }; + installer-iso = installer.config.system.build.isoImage; + spontaneityHost = spontaneity.config.monorepo.vars.orgHost; + spontaneityUser = spontaneity.config.monorepo.vars.userName; pre-commit-check = git-hooks.lib.${system}.run { src = ./.; @@ -96,7 +98,7 @@ if [ "$BRANCH" != "main" ]; then exit 0 fi echo "Pushing to main detected. Deploying to ${spontaneityHost}..." -nixos-rebuild switch --flake .#spontaneity --target-host root@${spontaneityHost} --build-host localhost +nixos-rebuild switch --flake .#spontaneity --target-host ${spontaneityUser}@${spontaneityHost} if [ $? -eq 0 ]; then echo "Deployment successful!" else -- cgit v1.3