···3434| ----------------------- | -------- | ------------------------------------------------------------------ |
3535| `MINIFLUX_URL` | n/a | required, base URL of your Miniflux instance |
3636| `MINIFLUX_TOKEN` | n/a | required (or `MINIFLUX_TOKEN_FILE`), Miniflux API key |
3737-| `MINIFLUX_TOKEN_FILE` | n/a | path to file containing the token (systemd credential) |
3737+| `MINIFLUX_TOKEN_FILE` | n/a | path to file containing just the token value |
3838| `NIGHTSHADE_PUBLIC_URL` | n/a | unset for loopback OAuth; set to `https://host.tld` for production |
3939| `NIGHTSHADE_PORT` | `8787` | HTTP port |
4040| `NIGHTSHADE_DATA_DIR` | `./data` | directory for OAuth state/session files and sync snapshot |
+5-6
module.nix
···4545 description = "Base URL of the Miniflux instance.";
4646 };
47474848- minifluxTokenFile = lib.mkOption {
4848+ environmentFile = lib.mkOption {
4949 type = lib.types.path;
5050 description = ''
5151- Path to a file containing the Miniflux API token. Must be readable by
5252- root at boot. Loaded via systemd credentials so it never enters the
5353- Nix store or the unit environment.
5151+ Path to a systemd EnvironmentFile containing secrets (at minimum
5252+ MINIFLUX_TOKEN=...). Must be readable by root at boot; typically
5353+ produced by sops-nix or agenix. Not placed in the Nix store.
5454 '';
5555 };
5656···112112 WorkingDirectory = cfg.dataDir;
113113 Restart = "on-failure";
114114 RestartSec = 5;
115115- LoadCredential = [ "miniflux_token:${cfg.minifluxTokenFile}" ];
116116- Environment = [ "MINIFLUX_TOKEN_FILE=%d/miniflux_token" ];
115115+ EnvironmentFile = cfg.environmentFile;
117116118117 NoNewPrivileges = true;
119118 PrivateTmp = true;