dotfiles/.config/nix
2024-10-18 13:22:22 +07:00
..
lib feat(nix): Functional system-manager 2024-10-18 13:22:22 +07:00
systems feat(nix): Functional system-manager 2024-10-18 13:22:22 +07:00
users refactor(nix): Seperate home manager stuff from nix-darwin 2024-10-16 14:43:06 +07:00
.gitignore fix: Fix gitignore 2024-07-11 05:52:16 +07:00
flake.lock refactor(nix): Preparing setup for other n*x systems 2024-10-16 07:54:18 +07:00
flake.nix feat(nix): Functional system-manager 2024-10-18 13:22:22 +07:00
nix.conf chore: Initial nix-darwin darwin-configuration -> flake migration 2024-07-11 04:12:01 +07:00
README.md feat(nix): Functional system-manager 2024-10-18 13:22:22 +07:00

null2264's Nix Setup

You need to install Nix before following this guide: sh <(curl -L https://nixos.org/nix/install) and symlink this dir to ~/.config/nix

Setup

macOS

Nix in macOS is handled by nix-darwin.

Initial

This is done because nix-darwin commands is not yet added to PATH, should be a one-time thing

nix-env -iA nixpkgs.git
# Run `sudo chown $USER /nix/var/nix/profiles/per-user/$USER` if that returns error

nix build .#darwinConfigurations.<host>.system

./result/sw/bin/darwin-rebuild switch --flake .#<host>
# or
nix run nix-darwin -- switch --flake .#<host>

Rebuild

After initial setup, you should now be able to use the command directly:

darwin-rebuild build --flake .  # or you can specify the hostname with `--flake . #<hostname>`

# or if you're feeling lucky

darwin-rebuild switch --flake .

Other

Nix in non-NixOS Linux is handled by system-manager.

Rebuild

Unfortunately, root access is required in order to use system-manager.

sudo -i nix run 'github:numtide/system-manager' --extra-experimental-features "nix-command flakes" -- switch --flake $PWD

Home

This is for per-user setup. Instead of managing the entire system, you're managing one user at a time. This is handled by home-manager

Rebuild

home-manager build --flake .  # or you can specify the user with `--flake . #<username>@<hostname>`

# or if you're feeling lucky

home-manager switch --flake .