Skip to content

Latest commit

 

History

403 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mst-mkt/dotfiles

Declarative NixOS, nix-darwin, and Nix-on-Droid configurations with Home Manager, structured with Denix.

Host Machine System Type Usage Status
dirtmouth ASUS Zenbook 14 (UX3405MA) x86_64-linux laptop personal active
crossroads GMKtec NucBox G3 Plus x86_64-linux server personal active
greenpath MacBook Pro (M2 Pro) aarch64-darwin laptop work active
fogcanyon Nothing Phone (3) aarch64-linux mobile personal active

Usage

nh os switch ~/dotfiles
nh darwin switch ~/dotfiles
nix-on-droid switch --flake ~/dotfiles#<host>

Structure

  • denix/ denix extensions (host submodules, features)
  • rices/ appearance presets selected per host
  • hosts/ host definitions
    • nixos/ NixOS hosts
    • darwin/ nix-darwin hosts
    • droid/ Nix-on-Droid hosts
  • modules/ configuration modules
    • core/ base system (nix, boot, users, ...)
    • desktop/ desktop environments
      • linux/ (niri, fcitx5, gtk, ...)
      • macos/ (azookey)
    • programs/ applications (ghostty, neovim, git, ...)
    • services/ system services (pipewire, openssh, ...)
  • secrets/ age-encrypted secrets

Setup

NixOS

Boot the NixOS installer on the target machine and clone this repository.

nix-shell -p git
git clone https://github.com/mst-mkt/dotfiles ~/dotfiles

Define the host in hosts/nixos/<host>/ (default.nix, disko.nix, hardware.nix), following the existing hosts, and stage it.

nixos-generate-config --no-filesystems --show-hardware-config > ~/dotfiles/hosts/nixos/<host>/hardware.nix
git -C ~/dotfiles add hosts/nixos/<host>

Partition the disk with disko and install.

sudo nix run --extra-experimental-features "nix-command flakes" github:nix-community/disko/latest -- --mode destroy,format,mount --flake ~/dotfiles#<host>
sudo nixos-install --flake ~/dotfiles#<host>

Copy the repository into the new system.

cp -r ~/dotfiles /mnt/home/mst-mkt/dotfiles
sudo nixos-enter --root /mnt -- chown -R mst-mkt:users /home/mst-mkt/dotfiles

macOS

Install Nix with the official installer and clone this repository.

curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install | sh
nix-shell -p git
git clone https://github.com/mst-mkt/dotfiles ~/dotfiles

Define the host in hosts/darwin/<host>/ (default.nix), following the existing hosts, and stage it.

git -C ~/dotfiles add hosts/darwin/<host>

Activate the system with nix-darwin.

sudo nix run --extra-experimental-features "nix-command flakes" nix-darwin/master#darwin-rebuild -- switch --flake ~/dotfiles#<host>

Android (Nix-on-Droid)

Install the Nix-on-Droid app, complete the initial bootstrap with flakes, and clone this repository.

nix run nixpkgs#git -- clone https://github.com/mst-mkt/dotfiles ~/dotfiles

Define the host in hosts/droid/<host>/ (default.nix), following the existing hosts, and stage it.

git -C ~/dotfiles add hosts/droid/<host>

Activate the environment with nix-on-droid.

nix-on-droid switch --flake ~/dotfiles#<host>

About

NixOS, nix-darwin, and Nix-on-Droid Configurations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages