3 ms·
I'm a big fan of Nix, but I really with there was a declarative way to define a user's environment similar to what NixOS has with /etc/nixos/configuration.nix.
by k2enemy 9y ago
I'm a big fan of Nix, but I really with there was a declarative way to define a user's environment similar to what NixOS has with /etc/nixos/configuration.nix.
It seems a little strange to me to have a functional package manager, but an imperative package install process. I think there are a few projects like NixUP and home-manager that are looking to address this, but I'm hoping Nix will provide an official way to do it.
- johnramsden 9y agoIt's coming: https://github.com/NixOS/nixpkgs/pull/9250 https://github.com/NixOS/nixpkgs/pull/9250
- clhodapp 9y agoThat's a bit too strong a statement to make based on a two-year-old still-open PR with an uncertain future. It seems like it might be coming at some point in the future.
- johnramsden 9y agoNo, there's actually a fair bit of activity around it, if you read through the comments in the pull request it has a fair bit of activity. They recently got a fair bit of interest on the mailing list https://goo.gl/kvNwC1 https://goo.gl/kvNwC1 and raised some money for it as well https://github.com/NixOS/nixpkgs/pull/9250#issuecomment-320860635 https://github.com/NixOS/nixpkgs/pull/9250#issuecomment-3208.... I'm pretty sure I read somewhere that it's planned to go in the next release.
- asymmetric 9y agoI do this without needing any extra tool[0]. I basically define a custom meta-package with all the packages I want as dependencies and install it with `nix-env -iA`. [0]: https://github.com/asymmetric/dotfiles/blob/master/config.nix https://github.com/asymmetric/dotfiles/blob/master/config.ni...
- k2enemy 9y agoThanks for linking to this! Do you know of a way to get a list of installed packages then? "nix-env -q" lists the meta-package but not the packages installed within. Also, when you update packages, does the update propagate to the sub-packages?
- asymmetric 9y agoYes, `nix-env -iA` always installs the latest of all the actual packages I have listed there. And as you can see you can also override their config. I don't know how to list installed packages, as I almost never feel like I need to know that (but if you find out how, I'd be happy to know!)
- ben0x539 9y agoI'd expect you list installed packages by pointing your text editor at the file where you defined which packages you want your meta-package to pull in, no?
- boothead 9y agoThere's https://github.com/rycee/home-manager https://github.com/rycee/home-manager I haven't used it yet, but intent to try soon.