My nix system configuration
- Add the following to
/etc/nixos/configuration.nix
to enablenix-command
andflakes
features:
nix.extraOptions = "experimental-features = nix-command flakes";
- Update you system to reflect the changes:
sudo nixos-rebuild test
sudo nixos-rebuild switch
- Create a new directory for your
flake.nix
configuration:
mkdir -p ~/kickstart.nix
cd ~/kickstart.nix
- Using
nix flake init
generate thekickstart.nix
template of your choice locally:
nix flake init -t github:ALT-F4-LLC/kickstart.nix#nixos-desktop
nix flake init -t github:ALT-F4-LLC/kickstart.nix#nixos-minimal
- Update the following value(s) in
flake.nix
configuration:
- For
desktop
flake template:
Important
Both username
and password
must be updated with your user username. Once updated, remove throw
before each value to remove errors while switching. If you'd rather use a hashed password replace password
with hashedPassword
with your password hash.
let
nixos-system = import ./system/nixos.nix {
inherit inputs;
username = throw "<username>"; # REQUIRED: replace with user name and remove throw
password = throw "<password>"; # REQUIRED: replace with password and remove throw
desktop = "gnome"; # optional: "gnome" by default, or "plasma5" for KDE Plasma
};
in
- For
minimal
flake template:
let
nixos-system = import ./system/nixos.nix {
inherit inputs;
username = throw "<username>"; # REQUIRED: replace with user name and remove throw
password = throw "<password>"; # REQUIRED: replace with password and remove throw
};
in
- Switch to
kickstart.nix
environment for your system with flake configuration:
Important
We use --impure
due to how /etc/nixos/hardware-configuration.nix
is generated and stored on the system after installation. To avoid using this flag, copy hardware-configuration.nix
file locally and replace import in the template see example.
- For
aarch64
platforms:
sudo nixos-rebuild test --flake ".#aarch64" --impure # M Series Chipsets
sudo nixos-rebuild switch --flake ".#aarch64" --impure # M Series Chipsets
- For
x86_64
platforms:
sudo nixos-rebuild test --flake ".#x86_64" --impure # Intel Chipsets
sudo nixos-rebuild switch --flake ".#x86_64" --impure # Intel Chipsets
Congrats! You've setup NixOS with Home Manager!
Be sure to explore the files below to get started customizing:
module/configuration.nix
for moreNixOS
system related settingsmodule/home-manager.nix
forHome Manager
related settingssystem/nixos.nix
forNixOS
system related settingsflake.nix
for flake related settings