diff options
Diffstat (limited to 'examples/simple')
-rw-r--r-- | examples/simple/flake.lock | 25 | ||||
-rw-r--r-- | examples/simple/flake.nix | 23 |
2 files changed, 48 insertions, 0 deletions
diff --git a/examples/simple/flake.lock b/examples/simple/flake.lock new file mode 100644 index 0000000..a57ff9d --- /dev/null +++ b/examples/simple/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1592491430, + "narHash": "sha256-7WNpr16iUyjG4caad137nCqxXNTdct202jy05lslZXA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "07299ff81e58e16b282fe602ce5e629854dfd544", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/examples/simple/flake.nix b/examples/simple/flake.nix new file mode 100644 index 0000000..6e516d3 --- /dev/null +++ b/examples/simple/flake.nix @@ -0,0 +1,23 @@ +{ + description = "Deploy GNU hello to localhost"; + + outputs = { self, nixpkgs }: { + deploy.nodes.example = { + hostname = "localhost"; + profiles.hello = { + user = "test_deploy"; + path = nixpkgs.legacyPackages.x86_64-linux.hello; + # Just to test that it's working + activate = "$PROFILE/bin/hello"; + }; + }; + checks = builtins.mapAttrs + (_: pkgs: { + jsonschema = pkgs.runCommandNoCC "jsonschema-deploy-simple" { } + "${pkgs.python3.pkgs.jsonschema}/bin/jsonschema -i ${ + pkgs.writeText "deploy.json" (builtins.toJSON self.deploy) + } ${../../interface/deploy.json} && touch $out"; + }) + nixpkgs.legacyPackages; + }; +} |