diff --git a/README.md b/README.md index 4e5c7ee..96b4021 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ > Changes so far: > - Merged a helpful PR for ssh config hostnames https://git.vlt81.de/tristan/nixinate/pulls/49 > - Fixed nix run on non-posix compliant shells like fish by explicitly adding a bash shim to the script -> - Solved https://git.vlt81.de/tristan/nixinate/issues/12 by renaming apps from `nixinate.{$machine_name}` to `nixinate-${machine_name]}` > > PR's welcome :) @@ -76,12 +75,12 @@ git+file:///etc/nixos โ””โ”€โ”€โ”€myMachine: NixOS configuration ``` -To finally execute the deployment script, use `nix run .#apps.nixinate-myMachine` +To finally execute the deployment script, use `nix run .#apps.nixinate.myMachine` #### Example Run ``` -[root@myMachine:/etc/nixos]# nix run .#apps.nixinate-myMachine +[root@myMachine:/etc/nixos]# nix run .#apps.nixinate.myMachine ๐Ÿš€ Deploying nixosConfigurations.myMachine from /nix/store/279p8aaclmng8kc3mdmrmi6q3n76r1i7-source ๐Ÿ‘ค SSH User: matthew ๐ŸŒ SSH Host: itchy.scratchy.com diff --git a/flake.nix b/flake.nix index bbd4d90..4d6a4e9 100644 --- a/flake.nix +++ b/flake.nix @@ -118,30 +118,32 @@ in final.writeScript "deploy-${machine}.sh" script; in - ( - nixpkgs.lib.genAttrs - (map (a: "nixinate-" + a) validMachines) - ( - x: { - type = "app"; - program = toString (mkDeployScript { - machine = nixpkgs.lib.removePrefix "nixinate-" x; - dryRun = false; - }); - } - ) - // nixpkgs.lib.genAttrs - (map (a: "nixinate-" + a + "-dry-run") validMachines) - ( - x: { - type = "app"; - program = toString (mkDeployScript { - machine = nixpkgs.lib.removeSuffix "-dry-run" (nixpkgs.lib.removePrefix "nixinate-" x); - dryRun = true; - }); - } - ) - ); + { + nixinate = ( + nixpkgs.lib.genAttrs + validMachines + ( + x: { + type = "app"; + program = toString (mkDeployScript { + machine = x; + dryRun = false; + }); + } + ) + // nixpkgs.lib.genAttrs + (map (a: a + "-dry-run") validMachines) + ( + x: { + type = "app"; + program = toString (mkDeployScript { + machine = nixpkgs.lib.removeSuffix "-dry-run" x; + dryRun = true; + }); + } + ) + ); + }; }; nixinate = forAllSystems (system: pkgs: nixpkgsFor.${system}.generateApps); checks = forAllSystems ( diff --git a/tests/vmTest/default.nix b/tests/vmTest/default.nix index 73aca38..f93ef12 100644 --- a/tests/vmTest/default.nix +++ b/tests/vmTest/default.nix @@ -106,7 +106,7 @@ let nixinator.wait_for_unit("multi-user.target") nixinator.succeed("mkdir ~/.ssh/") nixinator.succeed("ssh-keyscan -H nixinatee >> ~/.ssh/known_hosts") - nixinator.succeed("exec ${deployScript.nixinate-nixinatee.program} >&2") + nixinator.succeed("exec ${deployScript.nixinate.nixinatee.program} >&2") nixinatee.wait_for_unit("nginx.service") nixinatee.wait_for_open_port("80") with subtest("Check that Nginx webserver can be reached by deployer after deployment"):