- Perform intiial install from USB, creating my user
- reboot
Is this necessary if I'm going to use flakes?
sudo -i
nix-channel --add https://nixos.org/channels/nixos-unstable nixos
nix-channel --update
nixos-rebuild switch --upgrade
- Install
git
in anix shell
nix --extra-experimental-features 'nix-command flakes' shell nixpkgs#git
- Clone this repo
git clone https://github.com/mthornba/nixos.git ~/.nixos
- Load system config with a flake
sudo nixos-rebuild switch --flake .#
optionally, including the hostname:
sudo nixos-rebuild switch --flake .#neon
In some cases, such as the initial install, need to specify the hostname.
By default, NixOS uses Wayland:
❯ echo $XDG_SESSION_TYPE
wayland
Add to configuration.nix
to allow choosing between X11 and Wayland at login:
services.xserver.displayManager.defaultSession = "gnome-xorg";
Add the master branch since we're following NixOS Unstable
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
sudo nix-channel --update
Install Standalone
nix-shell '<home-manager>' -A install
Move Home Manager config into this repo
mv ~/.config/home-manager/home.nix users/matt
Apply Home Manager Config
home-manager switch -f ./users/matt/home.nix
From github.com/Misterio77/nix-starter-configs:
Add to home.nix
:
nixpkgs = {
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
Install home-manager as a flake
nix run home-manager/master -- init
mv ~/.config/home-manager/* ./users/matt
home-manager switch --flake ./users/matt/flake.nix
If you don't need the initial config created:
nix run home-manager/master -- switch --flake ./users/matt
This will also install home-manager
if home.nix
includes:
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home-manager switch --flake ./users/matt --recreate-lock-file