Skip to content

Commit 10939b4

Browse files
committed
fix: run agenix after bootstrap
1 parent adf561d commit 10939b4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

nix/modules/clawdinator.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,12 @@ in
583583
after =
584584
[ "network.target" ]
585585
++ lib.optional cfg.bootstrap.enable "clawdinator-bootstrap.service"
586+
++ lib.optional cfg.bootstrap.enable "clawdinator-agenix.service"
586587
++ lib.optional cfg.githubApp.enable "clawdinator-github-app-token.service"
587588
++ lib.optional (cfg.repoSeedSnapshotDir != null) "clawdinator-repo-seed.service";
588589
wants =
589590
lib.optional cfg.bootstrap.enable "clawdinator-bootstrap.service"
591+
++ lib.optional cfg.bootstrap.enable "clawdinator-agenix.service"
590592
++ lib.optional cfg.githubApp.enable "clawdinator-github-app-token.service"
591593
++ lib.optional (cfg.repoSeedSnapshotDir != null) "clawdinator-repo-seed.service";
592594

@@ -658,6 +660,18 @@ in
658660
script = "${pkgs.bash}/bin/bash ${../../scripts/bootstrap-runtime.sh} ${cfg.bootstrap.s3Bucket} ${cfg.bootstrap.s3Prefix} ${cfg.bootstrap.secretsDir} ${cfg.bootstrap.repoSeedsDir} ${cfg.bootstrap.ageKeyPath} ${cfg.bootstrap.secretsArchive} ${cfg.bootstrap.repoSeedsArchive}";
659661
};
660662

663+
systemd.services.clawdinator-agenix = lib.mkIf cfg.bootstrap.enable {
664+
description = "CLAWDINATOR agenix (post-bootstrap activation)";
665+
wantedBy = [ "multi-user.target" ];
666+
after = [ "clawdinator-bootstrap.service" ];
667+
wants = [ "clawdinator-bootstrap.service" ];
668+
serviceConfig = {
669+
Type = "oneshot";
670+
ConditionPathExists = "!/run/agenix";
671+
ExecStart = "${config.system.build.toplevel}/bin/switch-to-configuration switch";
672+
};
673+
};
674+
661675
systemd.services.agenix = lib.mkIf cfg.bootstrap.enable {
662676
requires = [ "clawdinator-bootstrap.service" ];
663677
after = [ "clawdinator-bootstrap.service" ];

0 commit comments

Comments
 (0)