fix: forEach implementation in zitadel module
This commit is contained in:
parent
9f1a6e85ee
commit
b739cd4190
2 changed files with 19 additions and 13 deletions
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
[doc('List machines')]
|
[doc('List machines')]
|
||||||
@list:
|
@list:
|
||||||
ls -1 ../systems/x86_64-linux/
|
ls -1 ../systems/x86_64-linux/
|
||||||
|
|
||||||
[no-exit-message]
|
|
||||||
[doc('Update the target machine')]
|
[doc('Update the target machine')]
|
||||||
|
[no-exit-message]
|
||||||
@update machine:
|
@update machine:
|
||||||
just assert '-d "../systems/x86_64-linux/{{ machine }}"' "Machine {{ machine }} does not exist, must be one of: $(ls ../systems/x86_64-linux/ | tr '\n' ' ')"
|
just assert '-d "../systems/x86_64-linux/{{ machine }}"' "Machine {{ machine }} does not exist, must be one of: $(ls ../systems/x86_64-linux/ | sed ':a;N;$!ba;s/\n/, /g')"
|
||||||
nixos-rebuild switch --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }}
|
nixos-rebuild switch --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }}
|
||||||
|
|
|
||||||
|
|
@ -335,14 +335,6 @@ in
|
||||||
;
|
;
|
||||||
|
|
||||||
append = attrList: set: set // (listToAttrs attrList);
|
append = attrList: set: set // (listToAttrs attrList);
|
||||||
forEach = src: key: set:
|
|
||||||
let
|
|
||||||
_key = concatMapStringsSep "_" (k: "\${item.${k}}") key;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
forEach = "{ for item in ${src} : \"${_key}\" => item }";
|
|
||||||
}
|
|
||||||
// set;
|
|
||||||
|
|
||||||
config' = config;
|
config' = config;
|
||||||
|
|
||||||
|
|
@ -352,7 +344,21 @@ in
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
({ config, lib, ... }: {
|
({ config, lib, ... }: {
|
||||||
config = {
|
config =
|
||||||
|
let
|
||||||
|
forEach = src: key: set:
|
||||||
|
let
|
||||||
|
_key = concatMapStringsSep "_" (k: "\${item.${k}}") key;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
forEach = lib.tfRef ''{
|
||||||
|
for item in ${src} :
|
||||||
|
"''${item.org}_''${item.name}" => item
|
||||||
|
}'';
|
||||||
|
}
|
||||||
|
// set;
|
||||||
|
in
|
||||||
|
{
|
||||||
terraform.required_providers.zitadel = {
|
terraform.required_providers.zitadel = {
|
||||||
source = "zitadel/zitadel";
|
source = "zitadel/zitadel";
|
||||||
version = "2.2.0";
|
version = "2.2.0";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue