diff options
author | notgne2 | 2020-10-10 10:31:58 -0700 |
---|---|---|
committer | notgne2 | 2020-10-10 10:31:58 -0700 |
commit | 4a2b677e892845b121d353864d54aec92a411e48 (patch) | |
tree | 39de25748b17ee9d2236a74e297b9bd7c33f6e28 /flake.nix | |
parent | db8301a45796cd919cbfa085f85ac6288e73a8db (diff) | |
parent | 219d55e99e792a093c12dbc045bed88a4bfe1916 (diff) |
Merge branch 'master' of github.com:notgne2/deploy-rs into master
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 50 |
1 files changed, 30 insertions, 20 deletions
@@ -3,43 +3,53 @@ # SPDX-License-Identifier: MPL-2.0 { + description = "A Simple multi-profile Nix-flake deploy tool."; + inputs = { - naersk.url = "github:nmattia/naersk/master"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + naersk = { + url = "github:nmattia/naersk/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; utils.url = "github:numtide/flake-utils"; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; }; - outputs = { self, nixpkgs, utils, naersk }: + outputs = { self, nixpkgs, utils, naersk, ... }: utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; naersk-lib = pkgs.callPackage naersk { }; - setActivate = base: activate: pkgs.symlinkJoin { - name = ("activatable-" + base.name); - paths = [ - base - (pkgs.writeTextFile { - name = base.name + "-activate-path"; - text = '' - #!${pkgs.runtimeShell} - ${activate} - ''; - executable = true; - destination = "/activate"; - }) - ]; - }; in { - defaultPackage = naersk-lib.buildPackage ./.; + defaultPackage = self.packages."${system}".deploy-rs; + packages.deploy-rs = naersk-lib.buildPackage ./.; - defaultApp = { + defaultApp = self.apps."${system}".deploy-rs; + apps.deploy-rs = { type = "app"; program = "${self.defaultPackage."${system}"}/bin/deploy"; }; lib = { - inherit setActivate; + setActivate = base: activate: pkgs.symlinkJoin { + name = ("activatable-" + base.name); + paths = [ + base + (pkgs.writeTextFile { + name = base.name + "-activate-path"; + text = '' + #!${pkgs.runtimeShell} + ${activate} + ''; + executable = true; + destination = "/activate"; + }) + ]; + }; checkSchema = deploy: pkgs.runCommandNoCC "jsonschema-deploy-system" { } "${pkgs.python3.pkgs.jsonschema}/bin/jsonschema -i ${pkgs.writeText "deploy.json" (builtins.toJSON deploy)} ${./interface/deploy.json} && touch $out"; |