aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAlexander Bantyev2020-11-15 22:30:45 +0300
committernotgne22020-11-16 12:54:05 -0700
commitef53906075343fdf9f3c81d4c72ff83281410695 (patch)
tree15592040a850d5db9facaad601a2a7854c4bb85b /flake.nix
parent54b6b551a1416e5fd88a91e31c5bfd25bfa9fe4c (diff)
Scope activation commands, deprecate setActivate
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix41
1 files 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" { } ''