aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authornotgne22020-10-30 19:11:16 -0700
committernotgne22020-10-30 19:11:16 -0700
commit8e82b2a7c9fe1ff08459ee4b7d9da5a25293fef3 (patch)
tree60e4954c4c6644601dcde8dc052a29db6c8bb2f6 /flake.nix
parent88b40b129cc17af674d28d02fa480b59fd364c42 (diff)
Show name of profiles missing activation
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index 3ce94e3..597092c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -62,10 +62,16 @@
activate = deploy:
let
- allPaths = pkgs.lib.flatten (pkgs.lib.mapAttrsToList (nodeName: node: pkgs.lib.mapAttrsToList (profileName: profile: profile.path) node.profiles) deploy.nodes);
+ profiles = builtins.concatLists (pkgs.lib.mapAttrsToList (nodeName: node: pkgs.lib.mapAttrsToList (profileName: profile: [ (toString profile.path) nodeName profileName ]) node.profiles) deploy.nodes);
in
pkgs.runCommandNoCC "deploy-rs-check-activate" { } ''
- for i in ${builtins.concatStringsSep " " allPaths}; do test -f "$i/deploy-rs-activate" || (echo "A profile path is missing an activation script" && exit 1); done
+ for x in ${builtins.concatStringsSep " " (map (p: builtins.concatStringsSep ":" p) profiles)}; do
+ profile_path=$(echo $x | cut -f1 -d:)
+ node_name=$(echo $x | cut -f2 -d:)
+ profile_name=$(echo $x | cut -f3 -d:)
+
+ test -f "$profile_path/deploy-rs-activate" || (echo "#$node_name.$profile_name is missing an activation script" && exit 1);
+ done
touch $out
'';