aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-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";