1. 41
    1. 9

      I went a similar route: wanted learn Nix so I set up Neovim, Fish, & few other CLI tools in home-manager before rolling with NixOS and sway (back on xmonad because Wayland doesn’t support color management). My plan was port one tool every Monday while I preordered my next laptop and by the time it arrived, my necessary tools would be ready–which was pretty much the case. Seems a bit wild reading the user trying to use Fish universal variables over setting the sessions variables in home-manager–but then I just kept getting wilder as I read. It’s a very tall recommendation & a leap of faith, but if one reads about and is interested in the philosophy of Nix (or Guix!) a lot of things become easier hopping distros where everything becomes first-class instead of trying to bolt another OS’s system inside the host.

    2. 6

      Now to figure out what a “flake” is…

      SOMEBODY STOP THAT MAN! He doesn’t know what he’s in for!

    3. 5

      Here I am in a freshly booted NixOS system trying to figure out how to make Home Manager and Flakes work with the basic configuration.nix I cobbled together. It’s painful in ways, but I’m loving declaratively configuring my entire system and knowing that any mistakes can be trivially fixed by rebooting into the previous generation.

      Absolutely recommend giving Nix a shot on whatever distro/OS you happen to be on, and if you happen to need to reinstall an OS for whatever reason, NixOS is pretty great.

      1. 3

        trying to figure out how to make Home Manager and Flakes work with the basic configuration.nix I cobbled together.

        grab minimal from https://github.com/Misterio77/nix-starter-configs/

        1. 3

          That’s a good start.

          If you want to re-use the home-manager configuration in NixOS, you also have to:

          1. Load the home-manager module in the NixOS config: https://github.com/zimbatm/home/blob/ca850465502cfad7a5a84fc757a59c3546c50784/nixosModules/common.nix#L6C1-L7C1

          2. If you use the inputs in the home-manager config, make sure to forward those: https://github.com/zimbatm/home/blob/ca850465502cfad7a5a84fc757a59c3546c50784/nixosModules/common.nix#L39-L42

          3. Finally, associate the home-manager config with the nixos user: https://github.com/zimbatm/home/blob/ca850465502cfad7a5a84fc757a59c3546c50784/nixosConfigurations/no1/default.nix#L71-L74

          That’s it.

      2. 1

        knowing that any mistakes can be trivially fixed by rebooting into the previous generation.

        That is something that also saved me a few times on openSUSE, but it’s using BtrFS snapshots and snapper with GRUB integration for that.

      3. 1

        This was the first thing I wanted to do with NixOS, replace my configuration.nix with a flake. It took a lot of hacking but I made it happen. Now my home-manager config is inside my system’s flake.

          outputs = inputs@{ self, nixpkgs, home-manager, ... }: {
            nixosConfigurations.<hostname> = nixpkgs.lib.nixosSystem {
              system = "x86_64-linux"; # or whatever
              modules = [
                home-manager.nixosModules.home-manager
                ({ config, pkgs, lib, modulesPath, ... }:
                  let
                    ... #whatever... 
                  in rec {
                      ... # your system here!
                   }
               }
          }
        
    4. 2

      I like Nix but opt out hard of both NixOS and Home Manager. This article very much confirms my beliefs here.

    5. 2

      I love the idea behind nixos but hate the implementation.