4 ms·
> Setting up Home-Manager without flakes requires adding a channel (or requires using a NixOS module, which only works on NixOS). From the home manager documen
by chriswarbo 4y ago
> Setting up Home-Manager without flakes requires adding a channel (or requires using a NixOS module, which only works on NixOS).
From the home manager documentation ( https://nix-community.github.io/home-manager/index.html#sec-install-standalone https://nix-community.github.io/home-manager/index.html#sec-... ):
> If instead of using channels you want to run Home Manager from a Git checkout of the repository then you can use the programs.home-manager.path option to specify the absolute path to the repository.
- rgoulter 4y agoNeat, though I hope I helped your curiosity regarding why people find flakes useful. With home-manager, you can declare a flake configuration where home-manager is an input; and then applying the configuration is pretty hands-off since Nix will fetch the appropriate revisions of the inputs. I think that using flakes is more convenient than the alternatives. (Having to add a channel; or, as you point out, cloning the repository in a consistent path on each system you use & then running that).
- pxc 4y agoI'd say the real alternatives are probably the json-based, pre-flakes pinning tools like Niv, nix-wrangle, and nix-thunk. They're still less convenient for me than flakes because they don't have great integration with Nix's profile managers (nix-env, nixos-rebuild, home-manager). But they do have fewer quirks in some ways, since they don't try to enforce pure evaluation like the flakes implementation does. They don't worry about whether the pinning happens inside a git repo or whatever. (I think some orgs that use Nix in production are still using Niv, and haven't touched flakes. Niv is certainly still maintained.)
- chriswarbo 4y agoI used to use Niv, but these days I find it more convenient to just call `builtins.fetchGit` where it's needed, rather than faffing with external files/tools (although https://hackage.haskell.org/package/update-nix-fetchgit https://hackage.haskell.org/package/update-nix-fetchgit can be useful). It's certainly much nicer than the "olden days" of `nixpkgs.fetchgit`, which required an "impure" copy of Nixpkgs (like <nixpkgs>) in order to fetch a pinned copy! I tend to have a single git repo with my system config, which uses import-from-derivation to grab a bunch of other stuff; and defines a single "package" that's a big `buildEnv` of all the programs I want. That seems to work fine across NixOS (on an old i686 Thinkpad), an old Ubuntu desktop, macOS (a couple of work laptops; old one used nix-darwin, new one just uses nix-env), and I'm currently trying it on nixos-mobile (on my Pinephone).