My Nix{OS} configuration files
- nix configuration for my laptops, desktops and more
- nix flake-powered
- guaranteed to be reproducible
This config is not based on any previous available Flake-based Nix{OS} config, instead I choose to develop my own from the available examples and documentation. Some of the repositories that helped me to build this config:
- https://github.com/bqv/nixrc
- https://github.com/colemickens/nixcfg
- https://github.com/hlissner/dotfiles
- https://github.com/Mic92/dotfiles
- https://github.com/nrdxp/nixflk
Also, some extra resources and documentation about Flakes:
Remember: Flakes is experimental, so you shouldn't try this approach until you have some experience in Nix.
This repository also includes my
home-manager configuration.
It is used to configure home in NixOS systems (using home-manager as a NixOS
module) but it should also work in standalone mode.
After following the instructions in manual to prepare the system and partition the disk, run the following process to install:
sudo git clone https://github.com/thiagokokada/nix-configs/ /mnt/etc/nixos
sudo chown -R 1000:100 /mnt/etc/nixos # optional if you want to edit your config without root
nix flake new --template '.#new-host' # if this is a new hardware
sudo nixos-install --flake /mnt/etc/nixos#hostnameAfter installing it successfully and rebooting, you can uncomment everything and trigger a rebuild.
You can also do remote installations by using --target-host flag in
nixos-rebuild (from any machine that already has NixOS installed):
nixos-rebuild switch --flake '.#hostname' --target-host root@hostname --use-substitutesOr if you don't have root access via SSH (keep in kind that the user needs to
have sudo permissions instead):
nixos-rebuild switch --flake '.#hostname' --target-host user@hostname --use-substitutes --use-remote-sudoAnother option for a few hosts is to use nixos-anywhere. This need to be a host with disko configured. In this case, you can just run:
nix run github:numtide/nixos-anywhere -- --flake '.#hostname' root@hostnameStart by installing Nix:
# Using experimental installer since it handles macOS updates better
curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \
sh -s -- installTo build the Home Manager standalone and activate its configuration, run:
nix run '.#darwinActivations/<hostname>'Start by installing Nix:
sh <(curl -L https://nixos.org/nix/install) --daemonTo build the Home Manager standalone and activate its configuration, run:
nix run '.#homeActivations/<hostname>'This repository also exports its modified nixpkgs, so it can be used to run
my custom packages. For example, to use my customized neovim without
installing:
nix run '.#neovim-standalone'
You can explore all outputs from this configuration by using:
nix flake show