Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vencloud: init at 0.0.1 #374132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

vencloud: init at 0.0.1 #374132

wants to merge 2 commits into from

Conversation

Eveeifyeve
Copy link
Contributor

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 15, 2025
@Eveeifyeve
Copy link
Contributor Author

I will fix the build failure when I wake up I am going to head to bed as I have been up all night, I thought I would push this anyways.

nixos/modules/services/web-servers/vencloud.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-servers/vencloud.nix Outdated Show resolved Hide resolved
options = {
DISCORD_CLIENT_ID = mkOption {
type = types.nullOr types.int;
default = null;
Copy link
Member

Choose a reason for hiding this comment

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

Can the server still function without any of these set?

If not, it would probably be a good idea to make sure these can't be nullable and require the user to set them -- else you end up with errors at runtime after only setting services.vencloud.enable = true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will have to verify this because I am not to sure if this would endup with runtime errors of it not being set, but the problem I run into is having a proper discord application to use for the test.

nixos/modules/services/web-servers/vencloud.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-servers/vencloud.md Outdated Show resolved Hide resolved
nixos/modules/services/web-servers/vencloud.md Outdated Show resolved Hide resolved
nixos/modules/services/web-servers/vencloud.md Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Aside from the suggestions here, I'm not sure if this should be included in general. Documentation is nice, but this doesn't really do more than link to the upstream docs -- which is already done in the option descriptions

Ideally this would look more like Garage's docs for example; otherwise I think it'd be fine to omit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well in the nixos modules checklist it says to add the docs which i did.

Copy link
Member

Choose a reason for hiding this comment

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

That isn't a hard requirement. If you want to keep it though, it will definitely need to be expanded, as in it's current form it's not super helpful IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well I will keep it incase things get deprecated or something drastically changes.

nixos/doc/manual/release-notes/rl-2505.section.md Outdated Show resolved Hide resolved
description = "The client id that should be used for discord OAuth";
};

DISCORD_CLIENT_SECRET = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

Secrets should be always read from a file.
You could add a clientSecretFile option and use LoadCredential to load it into the systemd service with systemd-creds.

Copy link
Contributor Author

@Eveeifyeve Eveeifyeve Jan 16, 2025

Choose a reason for hiding this comment

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

So read it from builtins.readFile? Can you please evaluate more or provide an example because this is not making sense to me?

Copy link
Member

Choose a reason for hiding this comment

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

Sure! Sorry, we should really document this pattern somewhere.
Here's an example in nixpkgs:

LoadCredential = lib.optional (

Something in this direction:

serviceConfig = {
  # ...
  LoadCredential = "discord-client-secret:${cfg.discordClientSecretFile}"
};
script = ''
  export DISCORD_CLIENT_SECRET="$(${lib.getExe' config.systemd.package "systemd-creds"} cat discord-client-secret)"
  exec ${lib.getExe cfg.package}
'';

nixos/vencloud: init

nixos/vencloud: use lib instead of pkgs for maintainers

nixos/vencloud: fix tests; nixos/vencloud: fix module

nixos/vencloud: reformat meta

vencloud: fix tests passthru

nixos/vencloud: add release notes

nixos/vencloud: applied suggestions from code review

Co-authored-by: seth <getchoo@tuta.io>

vencloud: applied suggestions from code review

Co-authored-by: seth <getchoo@tuta.io>

nixos/vencloud: fix trailing space

nixos/vencloud: fix formatting
@Eveeifyeve
Copy link
Contributor Author

Eveeifyeve commented Jan 16, 2025

Idk what the issue with NixOS manual build can anyone tell me? As I can't use my x86_linux machine because of the power supply sparking (which is causing a fire hazard, I have ordered a new one dw).

@Eveeifyeve Eveeifyeve changed the title Vencloud init at 0.0.1 vencloud init at 0.0.1 Jan 16, 2025
@Eveeifyeve Eveeifyeve changed the title vencloud init at 0.0.1 vencloud: init at 0.0.1 Jan 16, 2025
@getchoo
Copy link
Member

getchoo commented Jan 16, 2025

Idk what the issue with NixOS manual build can anyone tell me?

You'll need to update nixos/doc/manual/redirects.json with something like the following

{
  "module-services-vencloud": [
    "index.html#module-services-vencloud"
  ],
  "module-services-vencloud-basic-usage": [
    "index.html#module-services-vencloud-basic-usage"
  ]
}

@h7x4 h7x4 added 8.has: module (new) This PR adds a module in `nixos/` 8.has: tests This PR has tests labels Jan 17, 2025
Co-authored-by: Seth Flynn <getchoo@tuta.io>
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: tests This PR has tests 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants