Uses undefined option in NixOS 23.11 #5

Closed
opened 2024-01-02 12:59:21 +01:00 by tropf · 2 comments
Member

When using c3d2.audioStreaming = true, the build fails on NixOS 23.11 with:

$ sudo nixos-rebuild switch
[...]
       error: The option `services.avahi.nssmdns4' does not exist. Definition values:
       - In `/nix/store/qcnkc5wpi219yljbv20hncbxm4lr6gm5-source/modules/audio.nix':
           {
             _type = "if";
             condition = true;
             content = true;
           }

I suspect this is caused by this line in audio.nix.
According to search.nixos.org, services.avahi.nssmdns4 only exists for NixOS unstable, but not for 23.11.

Can we detect the existance of an option and enable the correct one for the release? (And potentially throw an error if neither option can be found?)
If you give me a pointer towards how I can check for the current release/the existance of an option I can prepare a PR.

Best, tropf

When using `c3d2.audioStreaming = true`, the build fails on NixOS 23.11 with: ``` $ sudo nixos-rebuild switch [...] error: The option `services.avahi.nssmdns4' does not exist. Definition values: - In `/nix/store/qcnkc5wpi219yljbv20hncbxm4lr6gm5-source/modules/audio.nix': { _type = "if"; condition = true; content = true; } ``` I suspect this is caused by [this line in `audio.nix`](https://gitea.c3d2.de/c3d2/nix-user-module/src/branch/master/modules/audio.nix#L64). According to [search.nixos.org](https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=services.avahi.nssmdns4), `services.avahi.nssmdns4` only exists for NixOS unstable, but not for 23.11. Can we detect the existance of an option and enable the correct one for the release? (And potentially throw an error if neither option can be found?) If you give me a pointer towards how I can check for the current release/the existance of an option I can prepare a PR. Best, tropf
Owner

We probably can do something like this 38c5ee92ba/modules/portunus.nix (L144) but since we are assigning an option we can't use a simple or.

I've pushed a commit that tries to fix that. For me on unstable it works :)

We probably can do something like this https://github.com/SuperSandro2000/nixos-modules/blob/38c5ee92ba80129c31055d903438e2697e41322c/modules/portunus.nix#L144 but since we are assigning an option we can't use a simple or. I've pushed a commit that tries to fix that. For me on unstable it works :)
Author
Member

works, thx

works, thx
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: c3d2/nix-user-module#5
No description provided.