aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index d3d1817..9cfaa49 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,12 +14,35 @@
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
- in {
+ 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 ./.;
defaultApp = {
type = "app";
program = "${self.defaultPackage."${system}"}/bin/deploy";
};
+
+ lib = {
+ inherit setActivate;
+
+ 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";
+ };
});
}