See my dotfiles configuration for my entire system configuration.
Note that required hardward configuration has to be done before building any host under hosts/
(formatting drives, setting up the bootloader, etc.).
-
Clone this repository
-
Create the
hostname
file with the name of the host to build. The host should exist underhosts/${HOST}.nix
otherwise a compilation error will be reported.Example:
$ echo "thixxos" >> hostname
-
Add the necessary channels (TODO: automate)
$ sudo nix-channel --add https://nixos.org/channels/nixos-unstable $ sudo nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager $ sudo nix-channel --add https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz nixpkgs-mozilla $ sudo nix-channel --add https://github.com/colemickens/nixpkgs-wayland/archive/master.tar.gz nixpkgs-wayland $ sudo nix-channel --list home-manager https://github.com/rycee/home-manager/archive/master.tar.gz nixos https://nixos.org/channels/nixos-unstable nixpkgs-mozilla https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz nixpkgs-wayland https://github.com/colemickens/nixpkgs-wayland/archive/master.tar.gz $ sudo nix-channel --update
-
Build the system
$ sudo nixos-rebuild boot -I nixos-config=./configuration.nix these derivations will be built: /nix/store/6dvwa00nx2sx5idq8gg5pq5ym6s7ih0j-nixos-rebuild.drv building '/nix/store/6dvwa00nx2sx5idq8gg5pq5ym6s7ih0j-nixos-rebuild.drv'... building Nix... building the system configuration...
-
Reboot in the new system configuration
$ shutdown -r now
Rebuild with the --upgrade
switch:
$ sudo nixos-rebuild --upgrade -I nixos-config=./configuration.nix
The path to the configuration.nix
can either be relative or absolute.