Skip to content

sharpchen/nix-config

Repository files navigation

Nix Config

Prerequisites

Non-NixOS Prerequisites

  1. install nix

  2. enable flakes

sudo sh -c 'echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf'

Common Prerequisites

  1. add home-manager channel
nix-channel --add https://nixos.org/channels/nixos-unstable nixpkgs
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
  1. install home-manager as standalone
nix-shell '<home-manager>' -A install
  1. clone repo
nix-shell -p git
mkdir -p ~/.config/home-manager/ && cd ~/.config/home-manager/ && git clone https://github.com/sharpchen/nix-config.git .

Installation

NixOS-WSL

sudo nixos-rebuild switch --flake ~/.config/home-manager#nixos-wsl

Non-NixOS

home-manager switch --flake ~/.config/home-manager#sharpchen

Restore on Windows

Whole machine

pwsh -noprofile -f ./install.ps1

Dotfiles only

pwsh -noprofile -f ./dotfiles.ps1