12 ms·
Nice hack, but I still believe that home-manager [0] should be the way to go. It's the gateway drug to the Nix ecosystem and cleanly solves the composability pr
by watusername 4y ago
Nice hack, but I still believe that home-manager [0] should be the way to go. It's the gateway drug to the Nix ecosystem and cleanly solves the composability problem which this "one-size-fits-all repo checked out to root" approach will have some trouble with.
[0] https://github.com/nix-community/home-manager https://github.com/nix-community/home-manager
- __MatrixMan__ 4y agoIt's definitely a gateway drug worth taking since Nix solves all kinds of other problems too. Just don't expect to become an expert overnight, it takes a while to sink in (or it did for me).
- unshavedyak 4y agoIt's sad though - there's almost nothing in Nix (in my experience) that has to be that difficult if you know any programming. It's a perfect storm of bad documentation, bad tooling and unintuitive UX. I've been half tempted to try and bridge Nix with some simplified UX. Something resembling blasphemy but nonetheless focused on user experience above all else. At least doing that would be a natural project to learn Nix better, too heh. (disclaimer: I use Nix[OS] on two machines and my macbook. I know it decently.. but far from where i'd expect given it's my primary OS and package manager)
- woile 4y agoI've just (literally a few hours ago) started a tool trying to follow those principles. https://github.com/woile/npt https://github.com/woile/npt I still don't know if it's worth, I have to experiment a bit more with it. I have to say I'm still struggling with the flake:/
- colordrops 4y agohttps://snowflakeos.org/ https://snowflakeos.org/
- deleted 4y ago[deleted]
- unshavedyak 4y agoThat looks really cool, though for me it's the language and API that makes it awkward. A really good LSP could do wonders for user experience.
- zeorin 4y agoFor me the killer feature of home-manager versus other dotfiles managers is that it also installs any software your dotfiles depend on or assume to be present on the machine.
- kaba0 4y agoTo me it is marking what is “garbage” vs what isn’t in the .config folder. I like to experiment on linux a lot, like switching to plasma and back to Gnome and it always leaves like 20 mostly-empty folders trashed. I can then just remove the folder and go on my way with home-manager.
- nocoolnametom 4y agoIf you're running NixOS there's an impermanence plugin that allows you to specify specific directories and files you need to persist outside of what NixOs/HM builds for you and then use a tmpfs in-memory partition for root and/or home. Then at boot you're loading up the NixOS/HM config and then the persistent files are symlinked or mounted to where they need to be, but otherwise you have a fresh system on each reboot. It's a bit painful and manual to figure out exactly what to keep (unless you just want to keep the entire .config, for instance, which I don't) but it's amazing to know that you can mess up your home directory as much as you want and then it'll automatically clean itself with a reboot.
- wkdneidbwf 4y agothe read has “words of warning” almost immediately at the top about being familiar with nix first. it’s the gateway drug to nix? bad docs and difficult to grok error messages seem to be a consistent theme that comes up learning nix.
- zamalek 4y agoYou're only likely to screw things up once you start digging deeper into the Nix language/stdlib. I was put off by the warning at first as well, but it's honestly awesome having functional dotfiles that work reasonably consistently across NixOS (personal)/Ubuntu (work)/MacOS (work). > bad docs Yeah, pretty damned awful. > error messages That too. I honestly think that inventing a language was a huge mistake. Guix took a much more sensible approach, but a libre kernel is unusable for 99.9999% of people.
- kaba0 4y agoHonestly, it really is not the language that’s the problem. While there are a few cases where it can trip you up at first, you wouldn’t be singing package descriptors even if it were Python — it simply has a business domain which is non-trivial. This non-triviality and organic growth show on the standard library of nix packages, but I fail to see how a lisp language or whatever be immune to it, besides having learned from some early abstractions mistakes.
- zamalek 4y agoNix is building a package manager AND a programming language. Guix is building a package manager only. It's a resourcing thing.
- kaba0 4y agoAnd one might even argue the opposite, a DSL made for creating packages may well be better. Especially that plenty of package descriptions are basically reads like JSON.
- tjoff 4y agoNix is a huge dependency though, in a lot of sense (have to learn a new programming language rather than invest in your git skills etc.). Even if you are mostly running nixos.
- colordrops 4y agoIt's a one time investment though, and the payback is huge.
- k2enemy 4y agoI'd like to agree, but my experience has been different. Basically... 1. invest a lot of time in learning nix (nixos in my case) 2. set up a system that works great 3. a year or two go by 4. need to make a change, modification, or set up another system 5. relearn everything from step 1 That said, I really do like the system. Just wish it were more user friendly and better documented.
- kaba0 4y agoWell, step 3 just shows how great it is. But ideally no year will go by without using it, because you do install it to another system, tweak your home config, etc. The same way one doesn’t forget most of git, even though that one has some arcane UX.
- colordrops 4y agoIf you are only changing your system once ever year or two, then perhaps it's not for you. I'm running nix-build daily...
- tjoff 4y agoThe payback isn't much compared to a regular git repo. I love nixos but home-manager is just too much to force into all my other machines.
- unicornmama 4y agoNix is like sailing from Oakland to San Francisco on an aircraft carrier for your daily commute. Most stuff I care about factors out into .config which I turn into a git repo, push to GitHub and slap on a CI checks for secrets. Most engineers don’t need to forge a demonic pact with the Nix gods who demand I upend and replace everything from my operating system to my wife.
- __MatrixMan__ 4y ago95% of the time if I'm making nix a dependency it's just to install the correct version of python and poetry, then I let poetry handle the other dependencies. So it's totally possible to just use nix a little. My coworkers haven't even noticed the flake.nix in our repo, they just install those things by hand. But then there's that 5% case where you do have to forge a demonic pact with the nix gods, and it's handy to have your summoning circle all warmed up and ready to go.
- heinrichhartman 4y agoI had problems installing python dependencies with compiled library dependencies this way, eg pandas. Does that generally work for you?
- __MatrixMan__ 4y agoPandas is one of those for which poetry alone doesn't do the job. So I have nix install pandas alongside poetry so that when poetry tries to install pandas, the non-python dependencies are all lined up. Here's a (too verbose, sorry) example: https://stackoverflow.com/a/74944857/1054322 https://stackoverflow.com/a/74944857/1054322 It works well on all of my linux boxes. On my mac it takes forever because it wants to rebuild the linux universe. Given that the system architecture is a parameter, I think there should be a way to rewrite my flake (or update the nixpkgs numpy) to just rely on bsd tools in those cases, but I haven't found it yet. That's what's holding me up from recommending it to my team. I'm happy to just use linux everywhere, but they aren't.
- 4y ago
- TheFreim 4y agoMy current dotfile management makes heavy, near complete, usage of home-manager. If I want to do a redeployment I can simply install home-manager on a fresh installation, checkout my repository, and perform `nixos-rebuild switch`.
- l0b0 4y agoAny home-manager users on NixOS here? Are there any killer features in home-manager for you? I tried home-manager for a bit, but just went back to plain NixOS after I couldn't find anything it did better than what I was already using ([1], [2]). [1] https://gitlab.com/engmark/tilde https://gitlab.com/engmark/tilde [2] https://gitlab.com/engmark/root https://gitlab.com/engmark/root
- senorsmile 4y agoI use NixOS and do not use home-manager. I have synchthing managed by NixOS and it syncs all of my config and files between all my machines. Btw, am I the only person annoyed at calling configuration files dotfiles? Not all hidden files/folders are configuration, and not all configuration files are hidden.
- amarshall 4y agoEasy integration between the two. I pass config from the system config to home config for some things and it’s quite seamless. Also one command to apply config for system and home is nice.