Find a file
2022-07-09 01:44:35 -03:00
home-manager update to new home-manager flake format 2022-07-09 01:44:35 -03:00
nixos update to new home-manager flake format 2022-07-09 01:44:35 -03:00
.gitignore some more docs, and a minimal working system config 2021-12-17 11:32:24 -03:00
flake.lock update to new home-manager flake format 2022-07-09 01:44:35 -03:00
flake.nix update to new home-manager flake format 2022-07-09 01:44:35 -03:00
README.md fix typo 2022-05-22 19:34:55 -03:00

Nix Starter Config (Minimal version)

This is a simple nix flake for getting started with NixOS + home-manager.

Looking for the full version?

What this provides

  • NixOS configuration on nixos/configuration.nix, accessible via nixos-rebuild --flake .
  • Home-manager configuration on home-manager/home.nix, accessible via home-manager --flake .

Getting started

Assuming you have a basic NixOS booted up (either live or installed, anything works). Here's a link to the latest NixOS downloads, just for you.

The repo

  • Install git

  • Hit "Use this template" on this repo (or clone this down and push to any another git remote)

  • Add stuff you currently have on /etc/nixos/ to nixos (usually configuration.nix and hardware-configuration.nix, when you're starting out).

    • The included file has some options you might want, specially if you don't have a configuration ready. Make sure you have generated your own hardware-configuration.nix; if not, just mount your partitions to /mnt and run: nixos-generate-config --root /mnt.
  • If you're already using home-manager, add your stuff from ~/.config/nixpkgs to home-manager (probably home.nix).

    • I also include one with some simple options if you need. Feel free to ignore this step if you don't want to use home-manager just yet.
  • Take a look at flake.nix, making sure to fill out anything marked with FIXME (required) or TODO (usually tips or optional stuff you might want)

  • Push your changes! Or at least copy them somewhere if you're on a live medium.

Bootstrapping

To get everything up and running, you need flake-enabled nix and/or home-manager.

For simplicity, this minimal version does not include a bootstrap shell.

Check the NixOS wiki for information on how to enable flakes.

Usage

  • Run sudo nixos-rebuild switch --flake .#hostname to apply your system configuration.
    • If you're still on a live installation medium, run nixos-install --flake .#hostname instead, and reboot.
  • Run home-manager switch --flake .#username@hostname to apply your home configuration.

What next?

Full version

Once you're confortable with this flake, take a look at the full version, it includes boilerplate for overlays, custom packages, and more.