Skip to content

NixOS/NixOS-WSL/nix-darwin configuration using Nix Flakes and flake-parts

License

Notifications You must be signed in to change notification settings

moni-dz/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NixOS configuration

assets/nixos-official-logo.png

https://img.shields.io/badge/NixOS-24.05-informational?style=flat.svg

https://github.com/fortuneteller2k/nix-config/actions/workflows/check.yml/badge.svg https://github.com/fortuneteller2k/nix-config/actions/workflows/statix.yml/badge.svg https://github.com/fortuneteller2k/nix-config/actions/workflows/format.yml/badge.svg

Installation

(I highly recommend making your own configuration and copy snippets from mine, but anyway…)

Get the latest NixOS 24.05 image here, do your partitions (root must be mounted at /mnt), then run the following commands:

# move the output file of this to hosts/*/hardware-configuration.nix
nixos-generate-config

nix-shell -p git nixUnstable
git clone https://github.com/fortuneteller2k/nix-config ~
cd ~/nix-config
sudo nixos-install --flake .#starcruiser

# After rebooting
home-manager switch --flake .#moni@starcruiser

For WSL, follow the quickstart guide, then run the following commands:

nix shell nixpkgs#git
git clone https://github.com/fortuneteller2k/nix-config ~
cd ~/nix-config
sudo nixos-rebuild switch --flake .#turncoat
home-manager switch --flake .#zero@turncoat

Caveats

  • You probably should replace hosts/starcruiser/hardware-configuration.nix with your own with nixos-generate-config.
  • You might want to change all instances of my username to yours.
  • Comment out every __contentAddressed = true; you find.
  • You might want to disable agenix, for my secret cannot be decrypted without my private key. See hosts/default.nix.

Description

NixOS/nix-darwin/home-manager configuration that I use daily.

See also:

Resources and configurations I used to base on:

Why flakes?

jonringer gave a brief explanation as to why one might want to use Nix flakes.

Why flake-parts?

flake-parts allow reusable configuration powered by the module system everyone knows and loves.

See modules/parts, and it’s implementation in my system configurations and my home configurations.

Appearance

assets/starcruiser.png assets/turncoat.png