Nix Home Manager Has Forever Changed My Dotfiles

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 75

  • @devopstoolbox
    @devopstoolbox  2 місяці тому

    Join 2000+ subscribers getting one dev/sec/ops tip every Friday: signup.omerxx.com

  • @nokomoko8832
    @nokomoko8832 2 місяці тому +51

    If only the nix documentation wasn't so trash

    • @Anonymous-vh9tc
      @Anonymous-vh9tc 2 місяці тому +9

      Wait there is documentation?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +19

      Totally. If it was only trash I'd be fine, it has like 3-4 different sources each with its own agenda 🤦

    • @itsrobelschwarz7248
      @itsrobelschwarz7248 2 місяці тому

      @@devopstoolboxI’m setting up my config right now, and this has been genuinely one of the most frustrating experiences ever

    • @devopstoolbox
      @devopstoolbox  Місяць тому

      @kernelpanic_init1 😅

    • @ss50523
      @ss50523 Місяць тому +3

      True, but it is open source. You can contribute documentation and example configs.

  • @TheSast
    @TheSast 2 місяці тому +6

    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.

  • @matthias2447
    @matthias2447 2 місяці тому +16

    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 :)

    • @vaisakh_km
      @vaisakh_km 2 місяці тому

      now i spend 3 days trying to make a working devshell instead of 2 second to boostrap a project language's package manager....

  • @adjbutler
    @adjbutler 2 місяці тому +7

    NixOS !!! LETS GO!!!!

  • @Julien-rc1bi
    @Julien-rc1bi 2 місяці тому +1

    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).

  • @arunoruto
    @arunoruto 2 місяці тому +4

    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!

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +1

      I can already feel the vortex sucking me in 😅

    • @viniciusmelquiades
      @viniciusmelquiades Місяць тому +1

      I've tried that, and I'm considering moving away from it. It feels too limited and the options change a lot.

    • @nipunlakshank
      @nipunlakshank Місяць тому +1

      The fact that I have to write lua in nix file as strings is a deal breaker for me 😕

    • @arunoruto
      @arunoruto Місяць тому

      @@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

  • @hn3m3s1s
    @hn3m3s1s 23 дні тому +1

    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.

    • @devopstoolbox
      @devopstoolbox  23 дні тому

      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

  • @Flackon
    @Flackon 2 місяці тому +3

    can you use just home manager in a flake for non-darwin, non-nixos systems? (e.g. WSL)

    • @dieduch
      @dieduch 2 місяці тому +2

      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

    • @TheGeorey
      @TheGeorey 2 місяці тому +5

      I'm using all that in WSL

  • @pratyushpurohit
    @pratyushpurohit 2 місяці тому

    How do I get such terminal?

  • @hafizdkurniawan815
    @hafizdkurniawan815 2 місяці тому +2

    Which terminal emulator are you using, and is the dotfiles available as well?

  • @botondkalocsai5322
    @botondkalocsai5322 2 місяці тому +1

    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_
      @caedis_ 2 місяці тому +2

      You can push the binaries from a beefier machine with the `--target-host` option

    • @botondkalocsai5322
      @botondkalocsai5322 2 місяці тому +1

      @@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).

    • @arunoruto
      @arunoruto 2 місяці тому

      @@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 :)

    • @TheSast
      @TheSast 2 місяці тому +2

      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.

  • @peterhorton9063
    @peterhorton9063 2 місяці тому +2

    I followed what you did for home.file, i had to use the --impure flag

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Yep same.

    • @maulanaakmal8261
      @maulanaakmal8261 Місяць тому +2

      It should be mentioned in the video

    • @droydi
      @droydi 22 дні тому

      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.

  • @kenichishibata2411
    @kenichishibata2411 2 місяці тому

    what do you use to record your terminal and video overlay?

  • @ingijonsson3466
    @ingijonsson3466 2 місяці тому

    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.

  • @oussaber
    @oussaber 2 місяці тому +10

    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

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +4

      I'm sorry for that, will take this feedback into consideration. Thanks for watching and sharing!

    • @jeslinmx22
      @jeslinmx22 2 місяці тому +3

      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.

  • @alexstone691
    @alexstone691 Місяць тому

    Is there a way to make nix call bash script

    • @viniciusmelquiades
      @viniciusmelquiades Місяць тому

      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

  • @StefanGenov-en7ti
    @StefanGenov-en7ti 2 місяці тому +8

    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

    • @TheSast
      @TheSast 2 місяці тому +4

      wdym? having a single flake to configure both systems is relatively common. And I have no idea what you mean by the second part.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +1

      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

  • @benszabo
    @benszabo Місяць тому +1

    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.

  • @CZiNTrPT
    @CZiNTrPT 2 місяці тому

    How is this better than just using a bare gitrepo?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      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.

  • @underflowexception
    @underflowexception 2 місяці тому +3

    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

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +3

      At end of the day, if it works it works. There's no right or wrong here :)
      My goal here is to show options

    • @74Bagas
      @74Bagas 2 місяці тому

      that's the point.

  • @comosaycomosah
    @comosaycomosah 2 місяці тому +2

    but i like my rusty bike jk i hate it i want suron setup lol

  • @linbynd
    @linbynd 2 місяці тому +1

    Are you using home manager and Nix Darwin together... ?

    • @Danielo515
      @Danielo515 2 місяці тому +1

      I bet he does

    • @dieduch
      @dieduch 2 місяці тому +1

      I do

    • @PauloFassina
      @PauloFassina 2 місяці тому +1

      Why not? NixOS would be a better option, but he needs an audience.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Yep. Started with one, progressed to the second but effectively I do have both

  • @Thundechile
    @Thundechile 2 місяці тому +3

    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.

    • @liamwoodleigh
      @liamwoodleigh 2 місяці тому

      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.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +1

      You're right. It depends on whether the ability to rollback is appealing to you. That's the main benefit IMO.

    • @liamwoodleigh
      @liamwoodleigh 2 місяці тому

      @@devopstoolbox I’d argue rolling back with git is easier than home-manager. Would you disagree?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      @@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.

  • @Exowz
    @Exowz 14 днів тому

    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?