-
Follow nixos install guide section 2 up to running
nixos-install
. -
Edit the generated
configuration.nix
- Switch user
jane
withwill
and addinitialPassword
option - Add packages
neovim
andgit
(others are optional, I usually only install these) - Add this to enable flakes
nix = { packages = pkgs.nixUnstable; extraOptions = '' experimental-features = nix-command flakes ''; };
- Switch user
-
Run
nixos-install
and setroot
password when prompted.- If not prompted an error occured.
- Good luck
-
Reboot and remove boot drive.
-
Check internet connection.
-
Create new ssh-key with
ssh-keygen -t ed25519 -C "[email protected]"
and add key to github. -
eval `ssh-agent`
,ssh-add KEYNAME
. -
In home directory run,
mkdir dotfiles
,cd /dotfiles
,git clone [email protected]:SheetKey/nixos-dotfiles.git
-
Create new host file
HOSTNAME.nix
in/hosts
-
Add to new
HOSTNAME.nix
{ config, lib, pkgs, modulesPath, ... }: { networking.howName = "HOSTNAME"; environment.systemPackages = with pkgs; [ # Add any host specific packages here ]; # COPY "system.stateVersion" HERE FROM THE GENERATED "configuration.nix" HERE # COPY BOOT OPTIONS FROM THE GENERATED "configuration.nix" HERE # COPY MOST OF FILE FROM THE GENERATED "hardware-configuration.nix" HERE }
-
Edit flake.nix to create new "nixosConfiguration"
NEWHOSTNAME = lib.nixosSystem { inherit system; modules = [ ./configuration.nix ./hosts/NEWHOST.nix ({ pkgs, ... }: { nixpkgs.overlays = [ neovim-nightly-overlay.overlay ]: }) home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.user.will = import ./users/will/home.nix; nixpkgs.overlays = [ nur.overlay emacs-overlay.overlay ]; } ]; };
-
Run
nix flake lock
-
Build a certain nixosConfiguration.
nixos-rebuild switch --flake .#NEWHOSTNAME