diff options
author | notgne2 | 2020-10-05 19:46:28 -0700 |
---|---|---|
committer | notgne2 | 2020-10-05 19:46:28 -0700 |
commit | 7c00fd2761e6efffe763ece5d08d9a6d3fb95092 (patch) | |
tree | 9d4030bd4788bec3eb4783adc38130536d8fa696 /examples/simple | |
parent | 5674670a59168fb05f26e5b4fb41dd2662810e94 (diff) |
Add interface with json schema, fix flake-less issues, put setActivate and jsonSchema check in flake lib
Diffstat (limited to 'examples/simple')
-rw-r--r-- | examples/simple/flake.lock | 85 | ||||
-rw-r--r-- | examples/simple/flake.nix | 16 |
2 files changed, 90 insertions, 11 deletions
diff --git a/examples/simple/flake.lock b/examples/simple/flake.lock index a57ff9d..7791c84 100644 --- a/examples/simple/flake.lock +++ b/examples/simple/flake.lock @@ -1,7 +1,74 @@ { "nodes": { + "deploy-rs": { + "inputs": { + "naersk": "naersk", + "nixpkgs": "nixpkgs_2", + "utils": "utils" + }, + "locked": { + "lastModified": 1601668691, + "narHash": "sha256-1mWf71DPRNgTIUKJ4Dy+CjoyZo4JkPdrwjYJy2UzqZE=", + "type": "git", + "url": "file:///home/notgne2/Dev/Serokell/deploy-rs" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1597138680, + "narHash": "sha256-3pDN/W17wjVDbrkgo60xQSb24+QAPQ7ulsUq5atNni0=", + "owner": "nmattia", + "repo": "naersk", + "rev": "529e910a3f423a8211f8739290014b754b2555b6", + "type": "github" + }, + "original": { + "owner": "nmattia", + "ref": "master", + "repo": "naersk", + "type": "github" + } + }, "nixpkgs": { "locked": { + "lastModified": 1601091160, + "narHash": "sha256-26UI9LGjRO8Sv253zJZkoapP260QkJPQ2+vRyC1i+kI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2768436826543af2b1540e4fe6b5afa15850e155", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1600387253, + "narHash": "sha256-WtdpHuiunPF9QMlcXrWJkESuIjSSjP9WMOKvYQS/D7M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "72b9660dc18ba347f7cd41a9504fc181a6d87dc3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { "lastModified": 1592491430, "narHash": "sha256-7WNpr16iUyjG4caad137nCqxXNTdct202jy05lslZXA=", "owner": "NixOS", @@ -16,7 +83,23 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "deploy-rs": "deploy-rs", + "nixpkgs": "nixpkgs_3" + } + }, + "utils": { + "locked": { + "lastModified": 1600209923, + "narHash": "sha256-zoOWauTliFEjI++esk6Jzk7QO5EKpddWXQm9yQK24iM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cd06d3c1df6879c9e41cb2c33113df10566c760", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } } }, diff --git a/examples/simple/flake.nix b/examples/simple/flake.nix index f53352b..d44b888 100644 --- a/examples/simple/flake.nix +++ b/examples/simple/flake.nix @@ -5,7 +5,9 @@ { description = "Deploy GNU hello to localhost"; - outputs = { self, nixpkgs }: + inputs.deploy-rs.url = "github:serokell/deploy-rs"; + + outputs = { self, nixpkgs, deploy-rs }: let setActivate = base: activate: nixpkgs.legacyPackages.x86_64-linux.symlinkJoin { name = ("activatable-" + base.name); @@ -29,16 +31,10 @@ hostname = "localhost"; profiles.hello = { user = "balsoft"; - path = setActivate nixpkgs.legacyPackages.x86_64-linux.hello "./bin/hello"; + path = deploy-rs.lib.x86_64-linux.setActivate nixpkgs.legacyPackages.x86_64-linux.hello "./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; + + checks = { "x86_64-linux" = { jsonSchema = deploy-rs.lib.x86_64-linux.checkSchema self.deploy; }; }; }; } |