It should be mentioned you can make specific configs be symlinked instead of being pinned, this can be used together with a custom user option to switch rapid dotfile iteration on for a bit and then off again.
Now its your time to configure (neo)vim using nix using nixvim ;) P.S. soon there will be lazy loading integrated into nixvim, so we have something similar to lazy!
@@nipunlakshank you kinda don't have to actually You can configure the main things using nix, but for raw config file, you can keep a lua file and read that file into your config! I moved completely to nixvim (and then left it got helix, but that's another story 😂), haven't missed lua much tbh
Hey! Any recommendation to create a macOS playground to quickly try your setup (kind of like VMs) to try out without ruining my current workspace? Can be also be great to test the config I would create.
Hmm interesting concept, never thought of that.. you could potentially just clone my dotfiles and give them a go although it's not exactly the same, that's the idea
My only concern with nix is its resource requirements. Is it suitable for ancient machines, like xbps (on void linux)? Building and rebuilding immutable environment seems to have substantial resource requirements even with lightweight software on old machines. Is there nix expert who tried to use it on old machines (with 1GB - 2GB ram, for example), and testify its viability?
@@caedis_ Is it suitable for daily driver on an old machine in such a way that only the old machine's resources are used for environment building? Probably it should be able to deal with a suckless desktop environment, but I'm not convinced about viability on more complex desktop environments, that can still run on that machine (like a Lubuntu-like user space).
@@botondkalocsai5322 If you are running the stable version, most of the packages are already built and will be loaded from a cache, so no compilation is needed on your part. Folks are also using nixos on raspberry pis, so I do not think, that performance will be a limiting factor. If you are unsure, you can also run just the package manager and test home-manager. If you are not satisfied, just uninstall it :)
I daily drive it with less than 5 GB RAM without major issues, my bottleneck is always my connection (mobile). I don't know how close this is to a 3GB system experience.
This is actually killing me, tearing my hair out, and I have been on NixOS as my daily driver for a year now... Finally decided to adopt nix-darwin on the work laptop, and to temporarily addopt your dotfiles, but been stuck on this issue for hours now.
I found the video really hard to follow because it jumped around a lot and mixed different technologies together. It would be great if you could break it down into clearer sections or focus on one technology at a time to make it easier to understand
The whole nix stack is fairly complex (even convoluted) - you have Nix the language, Nix the package manager, Nixpkgs, NixOS, Home Manager, nix-darwin, not to mention technologies/concepts like flakes, modules, derivations, and all of these things are thrown around by people experienced in them like they’re the most obvious things in the world either because they had a hand in developing them or spent so long reading the documentation to understand them that we no longer can relate to ordinary humans.
I guess it depends on what you want to do. Is it some command to generate a file to be symlinked, then yes. If it is a command to run when activating the generation, then probably, but you'd need to check the documentation
The biggest problems with nix are 2 IMHO. 1. Linux and Mac unified setup... It's really hard to have one setup that works with both systems. 2. The way graphic applications are setup outside of nixos... They just don't work
See the reply here, you can have a flake that holds both configurations. Kind of like a docker that serves multiple architectures if you're familiar. Not sure what you mean about GUIs, but I have both nix running brew installations, as well as GUIs from nix packages and both work fine
Bit of a curve-ball, in the video, it is stated that a `home.nix` file will be created - except if nix-darwin is used. > Unlike the channel-based setup, home.nix will be evaluated when the flake is built, so it must be present before bootstrap of Home Manager from the flake.
Not sure how a bare repo helps here (I'm assuming you don't mean a literal --bare) - and I've mentioned this in the video and other comments - Nix takes snapshots for you. Assuming you don't commit every single change you make locally, you can lost work quite easily.
I tried nix but I found it over complicated and not worth learning, I ended up just creating 1 bash script that installs all my packages and configs.. Even stow is kind of overkill tbh.. I just do the symlinks manually in my config
Honestly I'm not all the way convinced that Nix is better than Stow. When you run dotfiles with Stow it requires 1 command, is version controlled and requires practically no configuration files at all. Maybe there's some complicated scenarios which require Nix, but haven't run to those yet.
You may very well be right. I see part of the value that home-manager delivers is that it is an accessible way to get your feet wet with Nix. It provides a nice training ground that results in something useful (even though stow might be better) whilst getting familiar with Nix.
@@liamwoodleigh Well, in theory you're right. In practice, I find myself change A LOT of stuff when testing / tweaking my config. I'll only push when I'm certain, making all the work in between a vortex of configuration changes. With home manager every change is snapshotted for you by design.
After I put everything you said to put in my flake.nix, I run Darwin-rebuild and I get the following error : building the system configuration... error: … while evaluating the attribute 'value' at /nix/store/gg86rfp39vc7chqsszk32q7995hz4943-source/lib/modules.nix:816:9: 815| in warnDeprecation opt // 816| { value = addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 817| inherit (res.defsFinal') highestPrio; … while evaluating the option `system.build': … while evaluating the attribute 'mergedValue' at /nix/store/gg86rfp39vc7chqsszk32q7995hz4943-source/lib/modules.nix:851:5: 850| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 851| mergedValue = | ^ 852| if isDefined then … while evaluating definitions from `/nix/store/5dax872b4gf9fm6v9nhbarfja0f45xaq-source/modules/environment': … while evaluating the option `environment.systemPath': … while evaluating definitions from `/nix/store/5dax872b4gf9fm6v9nhbarfja0f45xaq-source/modules/environment': … while evaluating the option `environment.profiles': … while evaluating definitions from `/nix/store/5dax872b4gf9fm6v9nhbarfja0f45xaq-source/modules/users': … while evaluating the option `users.users': … while evaluating definitions from `/nix/store/rffzp7ya96cg0ylw4q4lb65pxa8sydkk-source/nixos/common.nix': … while evaluating the option `home-manager.users': … while evaluating definitions from `': (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: path '/nix/store/7xd8bakhn5bvcgr054av1hzmndclrqgg-source/home.nix' does not exist So I can't proceed with your tutorial when we go in home.nix... What should I do?
Join 2000+ subscribers getting one dev/sec/ops tip every Friday: signup.omerxx.com
If only the nix documentation wasn't so trash
Wait there is documentation?
Totally. If it was only trash I'd be fine, it has like 3-4 different sources each with its own agenda 🤦
@@devopstoolboxI’m setting up my config right now, and this has been genuinely one of the most frustrating experiences ever
@kernelpanic_init1 😅
True, but it is open source. You can contribute documentation and example configs.
It should be mentioned you can make specific configs be symlinked instead of being pinned, this can be used together with a custom user option to switch rapid dotfile iteration on for a bit and then off again.
Wow, how do you do that?
Ah, you are getting there one step at a time.
Welcome to the dark side. Once you go Nix, everything else feels not good enough anymore :)
now i spend 3 days trying to make a working devshell instead of 2 second to boostrap a project language's package manager....
NixOS !!! LETS GO!!!!
Uhm ACKSHUALLY it's just nix.
Slowly but surely you are going to be on nixos 😊 Maybe in 10 videos. (It's great btw from a developer who was once on Mac as well).
😅
Now its your time to configure (neo)vim using nix using nixvim ;)
P.S. soon there will be lazy loading integrated into nixvim, so we have something similar to lazy!
I can already feel the vortex sucking me in 😅
I've tried that, and I'm considering moving away from it. It feels too limited and the options change a lot.
The fact that I have to write lua in nix file as strings is a deal breaker for me 😕
@@nipunlakshank you kinda don't have to actually
You can configure the main things using nix, but for raw config file, you can keep a lua file and read that file into your config!
I moved completely to nixvim (and then left it got helix, but that's another story 😂), haven't missed lua much tbh
Hey! Any recommendation to create a macOS playground to quickly try your setup (kind of like VMs) to try out without ruining my current workspace? Can be also be great to test the config I would create.
Hmm interesting concept, never thought of that.. you could potentially just clone my dotfiles and give them a go although it's not exactly the same, that's the idea
can you use just home manager in a flake for non-darwin, non-nixos systems? (e.g. WSL)
That is how I use it for osx, home-manager in a flake. Should be possible in any linux distro too, both arm and x64
I'm using all that in WSL
How do I get such terminal?
Which terminal emulator are you using, and is the dotfiles available as well?
Read the description
My only concern with nix is its resource requirements. Is it suitable for ancient machines, like xbps (on void linux)? Building and rebuilding immutable environment seems to have substantial resource requirements even with lightweight software on old machines.
Is there nix expert who tried to use it on old machines (with 1GB - 2GB ram, for example), and testify its viability?
You can push the binaries from a beefier machine with the `--target-host` option
@@caedis_ Is it suitable for daily driver on an old machine in such a way that only the old machine's resources are used for environment building?
Probably it should be able to deal with a suckless desktop environment, but I'm not convinced about viability on more complex desktop environments, that can still run on that machine (like a Lubuntu-like user space).
@@botondkalocsai5322 If you are running the stable version, most of the packages are already built and will be loaded from a cache, so no compilation is needed on your part. Folks are also using nixos on raspberry pis, so I do not think, that performance will be a limiting factor. If you are unsure, you can also run just the package manager and test home-manager. If you are not satisfied, just uninstall it :)
I daily drive it with less than 5 GB RAM without major issues, my bottleneck is always my connection (mobile).
I don't know how close this is to a 3GB system experience.
I followed what you did for home.file, i had to use the --impure flag
Yep same.
It should be mentioned in the video
This is actually killing me, tearing my hair out, and I have been on NixOS as my daily driver for a year now... Finally decided to adopt nix-darwin on the work laptop, and to temporarily addopt your dotfiles, but been stuck on this issue for hours now.
what do you use to record your terminal and video overlay?
A camera and a screen capture :)
I gave up on flakes and home manager after starting an update and having to go watch a tv show while I waited for it to finish.
I found the video really hard to follow because it jumped around a lot and mixed different technologies together. It would be great if you could break it down into clearer sections or focus on one technology at a time to make it easier to understand
I'm sorry for that, will take this feedback into consideration. Thanks for watching and sharing!
The whole nix stack is fairly complex (even convoluted) - you have Nix the language, Nix the package manager, Nixpkgs, NixOS, Home Manager, nix-darwin, not to mention technologies/concepts like flakes, modules, derivations, and all of these things are thrown around by people experienced in them like they’re the most obvious things in the world either because they had a hand in developing them or spent so long reading the documentation to understand them that we no longer can relate to ordinary humans.
Is there a way to make nix call bash script
I guess it depends on what you want to do. Is it some command to generate a file to be symlinked, then yes. If it is a command to run when activating the generation, then probably, but you'd need to check the documentation
The biggest problems with nix are 2 IMHO.
1. Linux and Mac unified setup... It's really hard to have one setup that works with both systems.
2. The way graphic applications are setup outside of nixos... They just don't work
wdym? having a single flake to configure both systems is relatively common. And I have no idea what you mean by the second part.
See the reply here, you can have a flake that holds both configurations. Kind of like a docker that serves multiple architectures if you're familiar.
Not sure what you mean about GUIs, but I have both nix running brew installations, as well as GUIs from nix packages and both work fine
Bit of a curve-ball, in the video, it is stated that a `home.nix` file will be created - except if nix-darwin is used.
> Unlike the channel-based setup, home.nix will be evaluated when the flake is built, so it must be present before bootstrap of Home Manager from the flake.
How is this better than just using a bare gitrepo?
Not sure how a bare repo helps here (I'm assuming you don't mean a literal --bare) - and I've mentioned this in the video and other comments - Nix takes snapshots for you. Assuming you don't commit every single change you make locally, you can lost work quite easily.
I tried nix but I found it over complicated and not worth learning, I ended up just creating 1 bash script that installs all my packages and configs.. Even stow is kind of overkill tbh.. I just do the symlinks manually in my config
At end of the day, if it works it works. There's no right or wrong here :)
My goal here is to show options
that's the point.
but i like my rusty bike jk i hate it i want suron setup lol
Can't argue with that! 😉
Are you using home manager and Nix Darwin together... ?
I bet he does
I do
Why not? NixOS would be a better option, but he needs an audience.
Yep. Started with one, progressed to the second but effectively I do have both
Honestly I'm not all the way convinced that Nix is better than Stow. When you run dotfiles with Stow it requires 1 command, is version controlled and requires practically no configuration files at all. Maybe there's some complicated scenarios which require Nix, but haven't run to those yet.
You may very well be right. I see part of the value that home-manager delivers is that it is an accessible way to get your feet wet with Nix. It provides a nice training ground that results in something useful (even though stow might be better) whilst getting familiar with Nix.
You're right. It depends on whether the ability to rollback is appealing to you. That's the main benefit IMO.
@@devopstoolbox I’d argue rolling back with git is easier than home-manager. Would you disagree?
@@liamwoodleigh Well, in theory you're right. In practice, I find myself change A LOT of stuff when testing / tweaking my config. I'll only push when I'm certain, making all the work in between a vortex of configuration changes. With home manager every change is snapshotted for you by design.
After I put everything you said to put in my flake.nix, I run Darwin-rebuild and I get the following error :
building the system configuration...
error:
… while evaluating the attribute 'value'
at /nix/store/gg86rfp39vc7chqsszk32q7995hz4943-source/lib/modules.nix:816:9:
815| in warnDeprecation opt //
816| { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
817| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build':
… while evaluating the attribute 'mergedValue'
at /nix/store/gg86rfp39vc7chqsszk32q7995hz4943-source/lib/modules.nix:851:5:
850| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
851| mergedValue =
| ^
852| if isDefined then
… while evaluating definitions from `/nix/store/5dax872b4gf9fm6v9nhbarfja0f45xaq-source/modules/environment':
… while evaluating the option `environment.systemPath':
… while evaluating definitions from `/nix/store/5dax872b4gf9fm6v9nhbarfja0f45xaq-source/modules/environment':
… while evaluating the option `environment.profiles':
… while evaluating definitions from `/nix/store/5dax872b4gf9fm6v9nhbarfja0f45xaq-source/modules/users':
… while evaluating the option `users.users':
… while evaluating definitions from `/nix/store/rffzp7ya96cg0ylw4q4lb65pxa8sydkk-source/nixos/common.nix':
… while evaluating the option `home-manager.users':
… while evaluating definitions from `':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: path '/nix/store/7xd8bakhn5bvcgr054av1hzmndclrqgg-source/home.nix' does not exist
So I can't proceed with your tutorial when we go in home.nix... What should I do?