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

nixos/nextdns: add package override option #107005

Closed
wants to merge 1 commit into from

Conversation

pnelson
Copy link
Contributor

@pnelson pnelson commented Dec 16, 2020

Motivation for this change

Allow the service to run other package versions more easily.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

package = mkOption {
default = pkgs.nextdns;
defaultText = "pkgs.nextdns";
example = "pkgs.nextdns";
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a good example - it is the default. Please provide an example that's different than the default.

Copy link
Member

Choose a reason for hiding this comment

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

This new example makes me think what you're really looking for is overlays, not a package option 🤔

Allow the service to run other package versions more easily.
@pnelson
Copy link
Contributor Author

pnelson commented Dec 16, 2020

For those that stumble across this because their NextDNS version is out of date, please follow this minimal example adapted from https://gist.github.com/LnL7/e645b9075933417e7fd8f93207787581.

{ config, pkgs, ... }:

let
  # sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
  # sudo nix-channel --update nixpkgs-unstable
  unstable = import <nixpkgs-unstable> {};
in {
  nixpkgs.overlays = [ (self: super: {
    nextdns = unstable.nextdns;
  }) ];
}

Maybe something like this would be useful to add to the wiki. This seems like a common use case that isn't covered.

@pnelson pnelson closed this Dec 16, 2020
@aanderse
Copy link
Member

@pnelson adding a package option is fine. I just try to point out that overlays achieve the same thing. In my opinion the package option adds more value when there are multiple variants or versions.

@pnelson
Copy link
Contributor Author

pnelson commented Dec 17, 2020

Thanks! That's not the case here. We can revisit this if multiple variants arise. Overlays are probably the better option.

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.

None yet

2 participants