Secrets Config 判断需要加上 webserver 和 storage #50

Closed
opened 2025-12-28 23:19:02 +01:00 by adam · 1 comment
Owner

Originally created by @LokiSharp on GitHub (Nov 16, 2024).

https://github.com/ryan4yin/nix-config/blob/main/secrets/nixos.nix

  config =
    mkIf (
      cfg.desktop.enable
      || cfg.server.application.enable
      || cfg.server.network.enable
      || cfg.server.operation.enable
      || cfg.server.kubernetes.enable
+++      || cfg.server.webserver.enable
+++      || cfg.server.storage.enable
    ) (mkMerge [
      {
        environment.systemPackages = [
          agenix.packages."${pkgs.system}".default
        ];

        # if you changed this key, you need to regenerate all encrypt files from the decrypt contents!
        age.identityPaths =
          if cfg.impermanence.enable
          then [
            # To decrypt secrets on boot, this key should exists when the system is booting,
            # so we should use the real key file path(prefixed by `/persistent/`) here, instead of the path mounted by impermanence.
            "/persistent/etc/ssh/ssh_host_ed25519_key" # Linux
          ]
          else [
            "/etc/ssh/ssh_host_ed25519_key"
          ];
Originally created by @LokiSharp on GitHub (Nov 16, 2024). https://github.com/ryan4yin/nix-config/blob/main/secrets/nixos.nix ```nix config = mkIf ( cfg.desktop.enable || cfg.server.application.enable || cfg.server.network.enable || cfg.server.operation.enable || cfg.server.kubernetes.enable +++ || cfg.server.webserver.enable +++ || cfg.server.storage.enable ) (mkMerge [ { environment.systemPackages = [ agenix.packages."${pkgs.system}".default ]; # if you changed this key, you need to regenerate all encrypt files from the decrypt contents! age.identityPaths = if cfg.impermanence.enable then [ # To decrypt secrets on boot, this key should exists when the system is booting, # so we should use the real key file path(prefixed by `/persistent/`) here, instead of the path mounted by impermanence. "/persistent/etc/ssh/ssh_host_ed25519_key" # Linux ] else [ "/etc/ssh/ssh_host_ed25519_key" ]; ```
adam closed this issue 2025-12-28 23:19:02 +01:00
Author
Owner

@ryan4yin commented on GitHub (Nov 17, 2024):

确实有点问题,不过我这这些东西现在都跑在一台机器上所以没报过错,已修复。

@ryan4yin commented on GitHub (Nov 17, 2024): 确实有点问题,不过我这这些东西现在都跑在一台机器上所以没报过错,已修复。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/nix-config#50