From ef53906075343fdf9f3c81d4c72ff83281410695 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sun, 15 Nov 2020 22:30:45 +0300 Subject: Scope activation commands, deprecate setActivate --- flake.nix | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 9c912e9..a836b3c 100644 --- a/flake.nix +++ b/flake.nix @@ -40,25 +40,32 @@ }; lib = rec { - setActivate = base: activate: pkgs.buildEnv { - name = ("activatable-" + base.name); - paths = [ - base - (pkgs.writeTextFile { - name = base.name + "-activate-path"; - text = '' - #!${pkgs.runtimeShell} - ${activate} - ''; - executable = true; - destination = "/deploy-rs-activate"; - }) - ]; - }; - nixosActivate = base: setActivate base "$PROFILE/bin/switch-to-configuration switch"; + setActivate = builtins.trace + "deploy-rs#lib.setActivate is deprecated, use activate.noop, activate.nixos or activate.custom instead" + activate.custom; + + activate = rec { + custom = base: activate: pkgs.buildEnv { + name = ("activatable-" + base.name); + paths = [ + base + (pkgs.writeTextFile { + name = base.name + "-activate-path"; + text = '' + #!${pkgs.runtimeShell} + ${activate} + ''; + executable = true; + destination = "/deploy-rs-activate"; + }) + ]; + }; - noopActivate = base: setActivate base ":"; + nixos = base: custom base "$PROFILE/bin/switch-to-configuration switch"; + + noop = base: custom base ":"; + }; deployChecks = deploy: builtins.mapAttrs (_: check: check deploy) { schema = deploy: pkgs.runCommandNoCC "jsonschema-deploy-system" { } '' -- cgit v1.2.3