3 ms·
> I am still confused by how to use flakes as a "package consumer" A Flake is a git repository or another Flake compatible URL. If you want to run a flake, it'
by grumbel 4y ago
> I am still confused by how to use flakes as a "package consumer"
A Flake is a git repository or another Flake compatible URL. If you want to run a flake, it's simply:
nix run github:juser/hello
or:
nix shell github:juser/hello
If you want to install it as a user:
nix profile install github:juser/hello
If you do:
nix profile update '.*'
It will go through the packages in your profile and check for updates to the Git repositories and update the packages. If you have the Flake URL pointing to a specific revision, it will stay with that and never update:
nix run github:juser/hello?rev=53cd89289e44b269e28d2340f022e5f63525bcd3
As far as I understand it, the 'nix profile' command is imperative, not declarative. Only the packages installed system wide in /etc/nixos/ are declarative. If you want to use flakes there, create a /etc/nixos/flake.nix and declare your flakes as input.
nix-channel is no longer necessary when you go fully with Flakes.
For declarative management of your $HOME directory you need home-manager, which is still a separate community project, not part of the core NixOS.