-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
nix profile
pins nixpkgs per package
#7964
Comments
After keeping this in the back of my mind for some time I now think there are no advantages to pinning invidiual packages. What if we represent a profile as a flake with inputs (the repositories) and a single output (the profile). When installing using This way whenever you're upgrading your packages, they'll all be on the same repository with minimal extra disk space usage. If you want to upgrade/downgrade a package, you just use:
It'll keep tracking that version of the repository. If you want to pin a package, you can do so using:
There is no need to deviate from flakes for profiles. I think This also makes Nix profiles more reproducible, as we can handle flakes quite easily. The only thing missing is a flag to specify which flake to alter when using What about introducing a {
inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { nixpkgs-unstable, ... }: {
profiles.default = (system: [
nixpkgs-unstable.packages.${system}.hello
]);
};
}
|
To add to this... I'd prefer if the chosen flake was fixed until I explicitly asked to fetch a new one (maybe using a mechanism like nix-channel, though I never liked nix-channel). |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/flakes-as-a-unified-format-for-profiles/29476/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/flakes-as-a-unified-format-for-profiles/29476/2 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/flakes-as-a-unified-format-for-profiles/29476/6 |
Installing packages from different sources results in huge downloads. I think it's not what most new users would anticipate, as it deviates from how other package managers deal with this. To make this worse, it's hard to avoid.
For example:
Now 2 different versions of nixpkgs are pinned. This behavior has a number of downsides:
apt update
,pacman -y
, etc).lib/gtk-3.0
,lib/qt4/plugins
) are used across multiple packages from differently pinned nixpkgs. These libraries are linked against different versions of glibc, which can result in runtime problems. It's fine if the user explicitly wants to do this, but currently it's the default withnix profile
.There are some advantages to having a nixpkgs-pin per package, but currently it is the default and shouldn't be something new users need to be aware of.
nix profile
are kept as-is, thus stable.The text was updated successfully, but these errors were encountered: