Skip to content
vic

kclejeune/system

Declarative system configurations using nixOS, nix-darwin, and home-manager

kclejeune/system.json
{
"createdAt": "2020-07-02T06:19:11Z",
"defaultBranch": "master",
"description": "Declarative system configurations using nixOS, nix-darwin, and home-manager",
"fullName": "kclejeune/system",
"homepage": "",
"language": "Nix",
"name": "system",
"pushedAt": "2025-11-26T21:21:36Z",
"stargazersCount": 506,
"topics": [
"darwin",
"dotfiles",
"flake",
"home-manager",
"nix",
"nixos",
"vim"
],
"updatedAt": "2025-11-26T19:05:07Z",
"url": "https://github.com/kclejeune/system"
}

Build Status

This repository manages system configurations for all of my macOS, nixOS, and linux machines.

This repository is a flake. All system configurations are defined in [flake.nix]!(./flake.nix). Platform specific configurations are found defined in the flake outputs darwinConfigurations, nixosConfigurations for macOS and NixOS respectively.

Nix-Darwin and NixOS configurations share as much overlap as possible in the common module, [./modules/common.nix]!(./modules/common.nix). Platform specific modules add onto the common module in [./modules/darwin/default.nix]!(./modules/darwin/default.nix) and [./modules/nixos/default.nix]!(./modules/nixos/default.nix) for macOS and NixOS respectively.

My home-manager configuration is entirely decoupled from NixOS and nix-darwin configurations. This means that all of its modules are found in [./modules/home-manager]!(./modules/home-manager). These modules are imported into all other configurations in the common module similarly to this:

{ config, pkgs, ... }: {
home-manager.users.kclejeune = import ./home-manager/home.nix;
}

This means that [home.nix]!(./modules/home-manager/home.nix) is fully compatible as a standalone configuration, managed with the home-manager CLI. This allows close replication of any user config for any linux system running nix. These configurations are defined in the homeConfigurations output.

User “profiles” are specified in [./profiles]!(./profiles); these modules configure contextual, identity-specific settings such as SSL certificates or work vs. personal email addresses. When possible, home-manager functionality is extracted into [./profiles/home-manager]!(./profiles/home-manager), as mentioned previously

Non-NixOS Prerequisite: Install Nix Package Manager

Section titled “Non-NixOS Prerequisite: Install Nix Package Manager”

Run the installer script to perform a multi-user installation on darwin or linux:

Terminal window
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate

Note that this step is naturally skipped on NixOS since nix is the package manager by default.

Follow the installation instructions, then run

Terminal window
sudo nixos-install --flake "github:kclejeune/system#kclejeune@x86_64-linux"

Clone this repository into ~/.nixpkgs with

Terminal window
git clone https://github.com/kclejeune/system ~/.nixpkgs

You can bootstrap a new system with the bootstrap command:

Terminal window
nix run .#sysdo bootstrap

This will attempt to detect the host system and install nix-darwin or home-manager, but this behavior can be overridden using the --darwin or --home-manager flags.

The sysdo utility is a python script that wraps nix, darwin-rebuild, nixos-rebuild, and home-manager commands to provide a consistent interface across multiple platforms. It has some dependencies which are defined in the devShell flake output. Source for this tool is found in [pkgs/sysdo/sysdo.py]!(./pkgs/sysdo/sysdo.py).