Skip to content

FjellOverflow/nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix

My personal NixOS configuration

Overview | Structure | Machines | Setup | Usage

Overview

My personal NixOS configuration as a Nix flake, with Home Manager for dotfiles and software. Includes a common base config and opt-in modules, consumed via machine profiles.

Flake input Description
nixpkgs 26.05 NixOS packages
home-manager 26.05 User environment & dotfiles
nix-flatpak Declarative Flatpak installs
nix-vscode-extensions VSCodium extensions

Structure

nix/
├── flake.nix                           # Flake definition and inputs
├── common.nix                          # Base config, shared by all machines
├── machines/
│   └── <hostname>/                     # Machine-specific settings
│       ├── default.nix
│       └── hardware-configuration.nix
├── modules/                            # Opt-in features
├── profiles/
│   └── workstation.nix                 # Full desktop
└── assets/

Machines

All machines include fish shell, starship prompt, direnv + nix-direnv, git, docker, nh, and a curated set of CLI tools via the shared common.nix config.

Hostname Profile Type
vm workstation Virtual machine
thinkpad workstation Laptop
brick workstation Desktop
gigabyte workstation Desktop

Setup

Note

Requires an fresh/existing NixOS installation.

nix-shell -p git
git clone https://github.com/FjellOverflow/nix.git ~/nix && cd ~/nix

# Create a machine config
mkdir machines/<hostname>
sudo cp /etc/nixos/configuration.nix machines/<hostname>/default.nix
sudo cp /etc/nixos/hardware-configuration.nix machines/<hostname>/hardware-configuration.nix
sudo chown $(whoami): machines/<hostname>/*

# Adapt machines/<hostname>/default.nix (see existing machines/ for reference)

# Replace /etc/nixos with this repo
sudo rm -rf /etc/nixos
sudo ln -s ~/nix /etc/nixos

# Build and switch
sudo nixos-rebuild switch --flake /etc/nixos#<hostname>

Usage

Apply the latest config

git pull && nh os switch

Clean up old generations

nh clean all

About

Personal NixOS configuration as a Nix flake with opt-in modules and machine profiles.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages