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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/navidrome: fix settings type #312757

Merged
merged 2 commits into from
May 20, 2024
Merged

Conversation

eclairevoyant
Copy link
Member

@eclairevoyant eclairevoyant commented May 18, 2024

Description of changes

Fixes #312749. This fixes merging user-set values with default values.

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

Copy link
Member

@nu-nu-ko nu-nu-ko left a comment

Choose a reason for hiding this comment

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

seems a better fix than what I had suggested I was going to do.
thank you! 鉂わ笍
(assuming you've tested this of course) sorry I'm unable to atm.

@eclairevoyant
Copy link
Member Author

eclairevoyant commented May 18, 2024

I tested this on a config which has the following:

  services.navidrome = {
    enable = true;
    openFirewall = true;

    settings = {
      Address = "0.0.0.0";
      MusicFolder = "/run/navidrome/media/music";
    };
  };

and verified that the default port is in fact preserved, while the user-set settings are merged in:

$ nix eval .#nixosConfigurations.$(hostname).config.services.navidrome.settings
{ Address = "0.0.0.0"; MusicFolder = "/run/navidrome/media/music"; Port = 4533; }

Copy link
Contributor

@gepbird gepbird left a comment

Choose a reason for hiding this comment

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

Thank you both for your quick response, ideas and work! I have also tested it and the code LGTM.

A tiny nit: 18e089b contains a formatting change that should be in a74fd69.

@drupol drupol merged commit 04636fe into NixOS:master May 20, 2024
26 checks passed
@eclairevoyant eclairevoyant deleted the navidrome-fix branch May 20, 2024 21:10
@mweinelt
Copy link
Member

This breaks the nixos test, because settings is now required but unset by default.

mweinelt added a commit to r-ryantm/nixpkgs that referenced this pull request May 21, 2024
This will not affect the options, but allows to not configure settings at
all, if you don't need to. Unbreaks the NixOS test, which relies on this
behavior.

Fixes: NixOS#312757
dbalan pushed a commit to dbalan/nixpkgs that referenced this pull request May 21, 2024
This will not affect the options, but allows to not configure settings at
all, if you don't need to. Unbreaks the NixOS test, which relies on this
behavior.

Fixes: NixOS#312757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nixos/navidrome: error: attribute 'Port' missing
5 participants