Skip to content

Fix flake not accepting keyFile option#47

Merged
ClusterM merged 2 commits into
ClusterM:masterfrom
ismay-tue:fix-flake-keyfile
Apr 2, 2026
Merged

Fix flake not accepting keyFile option#47
ClusterM merged 2 commits into
ClusterM:masterfrom
ismay-tue:fix-flake-keyfile

Conversation

@ismay-tue
Copy link
Copy Markdown
Contributor

@ismay-tue ismay-tue commented Mar 18, 2026

Closes #46

Had to fix a couple of minor things. Note that this does not allow using a keyFile under ~, because the systemd unit that runs the generated script has protectHome enabled. But it works well for keyfiles that are under /run/secrets, etc.

@ismay-tue
Copy link
Copy Markdown
Contributor Author

ismay-tue commented Mar 18, 2026

@yyasha Let me know what you think. Nix is not my specialty, so feedback is welcome.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the NixOS module in flake.nix so services.wg-obfuscator.instances.<name>.keyFile can be used without having to set key, addressing issue #46 where module evaluation/build still required key.

Changes:

  • Make the per-instance key option nullable with a null default, enabling configs that rely solely on keyFile.
  • Update the module assertion to accept key = null when keyFile is provided.
  • Fix config generation to pass the enabled-instances attrset (not a list) to mapAttrsToList.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread flake.nix Outdated
Comment thread flake.nix Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ismay-tue
Copy link
Copy Markdown
Contributor Author

I have been using this without issue for a while btw.

@ClusterM ClusterM merged commit d33be62 into ClusterM:master Apr 2, 2026
36 checks passed
@ClusterM
Copy link
Copy Markdown
Owner

ClusterM commented Apr 2, 2026

Merged, thank you!

@ismay-tue
Copy link
Copy Markdown
Contributor Author

Sure thing, thanks for the merge 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nixos config does not accept a keyFile

3 participants