aboutsummaryrefslogtreecommitdiff
path: root/examples/simple
diff options
context:
space:
mode:
authornotgne22020-09-28 16:17:31 -0700
committernotgne22020-09-28 16:17:31 -0700
commitedaed825650eea32878441d3b8c7eb40e8877882 (patch)
treeba0e313a5cd2711de11e9fe9d973073171519ee5 /examples/simple
parent239d0f8999b47e9e76589ee1fa2d9f3459c47335 (diff)
Add examples
Diffstat (limited to 'examples/simple')
-rw-r--r--examples/simple/flake.lock25
-rw-r--r--examples/simple/flake.nix23
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;
+ };
+}