From 920c9d2ed4034e2200c948868c7bd510e58b1371 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Fri, 16 Apr 2021 10:28:01 +0300 Subject: Apply notgne2 suggestions. --- flake.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 424718c..d718e83 100644 --- a/flake.nix +++ b/flake.nix @@ -61,14 +61,11 @@ activate = rec { custom = { - __toString = customSelf: "TODO: dryActivate"; __functor = customSelf: base: activate: pkgs.buildEnv { name = ("activatable-" + base.name); paths = - let - hasDryActivate = builtins.hasAttr "dryActivate" customSelf; - in [ + [ base (pkgs.writeTextFile { name = base.name + "-activate-path"; @@ -78,12 +75,11 @@ if [[ $DRY_ACTIVATE == "1" ]] then - if ${pkgs.lib.boolToString hasDryActivate} - then - ${if hasDryActivate then customSelf.dryActivate else ":"} - else - echo ${pkgs.writeScript "activate" activate} - fi + ${if builtins.hasAttr "dryActivate" customSelf + then + customSelf.dryActivate + else + "echo ${pkgs.writeScript "activate" activate}"} else ${activate} fi -- cgit v1.2.3