aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authornotgne22020-10-08 20:01:01 -0700
committernotgne22020-10-08 20:01:01 -0700
commit219d55e99e792a093c12dbc045bed88a4bfe1916 (patch)
tree79b0552cc3d85ac0a97fb6649bcfab1f18520142 /flake.nix
parent518f7f5b4f1db83cab61941ab8887b0df76ce8d8 (diff)
Minor flake and documentation fixes
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix50
1 files changed, 30 insertions, 20 deletions
diff --git a/flake.nix b/flake.nix
index 9cfaa49..81603e4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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";