diff options
author | Alexander Bantyev | 2020-11-15 22:30:45 +0300 |
---|---|---|
committer | notgne2 | 2020-11-16 12:54:05 -0700 |
commit | ef53906075343fdf9f3c81d4c72ff83281410695 (patch) | |
tree | 15592040a850d5db9facaad601a2a7854c4bb85b | |
parent | 54b6b551a1416e5fd88a91e31c5bfd25bfa9fe4c (diff) |
Scope activation commands, deprecate setActivate
-rw-r--r-- | flake.nix | 41 |
1 files changed, 24 insertions, 17 deletions
@@ -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" { } '' |