From edaed825650eea32878441d3b8c7eb40e8877882 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Mon, 28 Sep 2020 16:17:31 -0700 Subject: Add examples --- examples/simple/flake.lock | 25 +++++++++++++++++++++++++ examples/simple/flake.nix | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 examples/simple/flake.lock create mode 100644 examples/simple/flake.nix (limited to 'examples/simple') 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; + }; +} -- cgit v1.2.3