Skip to content

Latest commit

 

History

History
111 lines (88 loc) · 2.3 KB

README.md

File metadata and controls

111 lines (88 loc) · 2.3 KB

NixOS Configs

  • Perform intiial install from USB, creating my user
  • reboot

Upgrade to unstable channel

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

Flakes

  1. Install git in a nix shell
nix --extra-experimental-features 'nix-command flakes' shell nixpkgs#git
  1. Clone this repo
git clone https://github.com/mthornba/nixos.git ~/.nixos
  1. 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.

X11 vs Wayland

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";

Home Manager

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

Allow Unfree

From github.com/Misterio77/nix-starter-configs: Add to home.nix:

  nixpkgs = {
    config = {
      allowUnfree = true;
      allowUnfreePredicate = _: true;
    };
  };

Flakes

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;

Upgrading Packages

home-manager switch --flake ./users/matt --recreate-lock-file