I’m aware of how to easily get a package from unstable channel:
let
unstable = import <nixos-unstable> { };
in {
service.xyz.package = unstable.xyz;
}
As suggested by this post:
Hi there. I manage some NixOS machines, which are pinned to a particular stable branch from 2019, and I’m fine with this.
However, the version of certbot that this branch offers is 0.31.0, while unstable has 1.0.0. I’d like to upgrade, and do so via the usual environment.systemPackages list. However, I don’t want to update the whole channel (thus bumping everything else on the system), just certbot.
Is this possible? Please and thank you.
But how do I do the same thing for a service definition?
For example, I’ve submitted a PR for syncthing
service:
NixOS:master
← jakubgs:more-syncthing-options
opened 09:38AM - 29 Aug 21 UTC
###### Motivation for this change
The addition of `autoAcceptFolders` avoids … the prompts for each folder when adding a devices.
The `extraFlags` option is useful for situations in which you might want to reset certain things using `--reset-database` or `--reset-deltas` or debug certain things using any of the debug options like `--debug-perf-stats`.
###### Things done
- Built on platform(s)
- [x] x86_64-linux
- [x] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- [ ] For non-Linux: Is `sandbox = true` set in `nix.conf`? (See [Nix manual](https://nixos.org/manual/nix/stable/#sec-conf-file))
- [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside [nixos/tests](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))
- [ ] Tested compilation of all packages 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/`)
- [21.11 Release Notes (or backporting 21.05 Release notes)](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#generating-2111-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
- [x] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
But how can I now use that one service configuration while still using nixos-21.05
channel for everything else?
3 Likes
For future searchers:
On my system currently based on release-23.05
, in which I pass inputs.nixpkgs-unstable
to my configuration via specialArgs = {inherit inputs;};
and have an overlay that provides pkgs.unstable
, I was unable to import an unstable service as hoped with:
{pkgs, ...}: {
imports = [
"${pkgs.unstable.path}/path/to/module.nix"
];
}
due to an infinite recursion error. Thankfully the following worked fine:
{pkgs, ...} @ args: {
imports = [
"${args.inputs.nixpkgs-unstable}/path/to/module.nix"
];
}
4 Likes