1
0
Fork 0
No description
  • Shell 49.3%
  • Nix 36.1%
  • Lua 12.8%
  • Vim Script 1.8%
Find a file
2026-01-05 15:15:02 +01:00
.dotter disable snap 2025-03-12 11:31:25 +01:00
ansible add more aliases 2024-10-05 12:29:02 +02:00
astronvim add grug-far nvim plugin 2024-09-03 09:12:05 +00:00
bat/themes add kucetl and charm.sh debian repos 2024-02-13 10:56:58 +01:00
fish/conf.d add multiple envs for packages 2026-01-05 15:15:02 +01:00
halig feat(fish): add rsync->scp alias 2023-05-09 09:08:52 +02:00
kitty add node packages for arch installs 2024-05-02 18:06:48 +02:00
nix add multiple envs for packages 2026-01-05 15:15:02 +01:00
utils disable snap 2025-03-12 11:31:25 +01:00
.gitignore feat: add ssh git signing config 2024-02-13 16:47:46 +01:00
7tv_settings_TWITCH-3_6_2025.json disable snap 2025-03-12 11:31:25 +01:00
allowed_signers add caelid signing 2024-09-03 08:58:08 +02:00
atuin.toml add atuin config 2024-09-13 13:06:19 +02:00
freetds.conf cleanup useless files 2024-08-27 18:36:07 +02:00
gamemode.ini cleanup useless files 2024-08-27 18:36:07 +02:00
gitconfig feat: add ssh allowed_signers 2024-02-20 13:25:20 +01:00
greenclip.toml feat: revamp 2023-04-24 12:47:11 +02:00
ideavim add kucetl and charm.sh debian repos 2024-02-13 10:56:58 +01:00
k9smocha.yaml cleanup useless files 2024-08-27 18:36:07 +02:00
mangohud.conf cleanup useless files 2024-08-27 18:36:07 +02:00
README.md add multiple envs for packages 2026-01-05 15:15:02 +01:00
resticprofile.schema.json add resticprofile 2024-12-19 17:24:30 +01:00
resticprofile.toml add flake 2024-12-29 15:02:11 +01:00
sshconfig update flake 2025-06-26 12:57:36 +02:00
timewarrior.cfg feat: add timewarrior and tmux configs 2024-09-05 07:55:25 +02:00
tmux.conf feat: add timewarrior and tmux configs 2024-09-05 07:55:25 +02:00
topgrade.toml update flake 2025-01-31 10:37:03 +01:00
vimrc update arch and debian package list 2024-09-16 09:01:56 +02:00

dots

This repository contains my dotfiles and a Nix flake that supports multiple hosts (machines) with a shared base and per-host configuration.

  • On NixOS: hosts are built via nixosConfigurations.
  • On non-NixOS (e.g., Ubuntu): hosts are applied via Home Manager using homeConfigurations.

Bootstrap

pip install pipx ansible
ansible-playbook --ask-become-pass ansible/main.yml
# Then apply dotfiles with dotter
dotter

NixOS: multi-host layout

  • nix/base/packages.nix — packages installed on all hosts
  • nix/hosts//
    • configuration.nix — host-specific NixOS configuration
    • hardware-configuration.nix — generated per-machine
    • packages.nix — extra packages for this host
  • nix/flake.nix — exposes each host under nixosConfigurations

Current hosts:

  • limgrave — my main system
  • carpates — scaffolded/minimal, ready to extend

Naming rule (important)

Your machine hostname must match the Nix flake host name. For example:

  • networking.hostName = "limgrave" in the host configuration
  • The flake exports nixosConfigurations.limgrave
  • The system hostname (output of hostname -s) is limgrave

This allows the upgrade function to pick the right configuration automatically.

Build or switch

From repo root:

# Limgrave (current system)
sudo nixos-rebuild switch --flake ./nix#limgrave

# carpates (on target machine)
sudo nixos-rebuild switch --flake ./nix#carpates
# Or during install:
# nixos-install --flake <repo-path>/nix#carpates

Upgrades: nix_upgrade

A convenience Fish function is provided in fish/conf.d/functions.fish: nix_upgrade. It updates flake inputs and rebuilds the system using a host name that matches the machine hostname.

Usage:

# Automatic: uses (hostname -s) → must match a host in nix/flake.nix
nix_upgrade

# Override the host explicitly (useful for recovery or chroots)
nix_upgrade limgrave

What it does:

  1. sudo nix flake update --flake /home/catalin/.dotfiles/nix
  2. sudo nixos-rebuild switch --flake /home/catalin/.dotfiles/nix# --upgrade

Safety checks:

  • Verifies nix/flake.nix exists
  • Verifies the host is declared in nix/flake.nix
  • Prints clear error if the hostname doesnt map to a known host

Tip: ensure your system hostname matches one of the directories in nix/hosts/ and the entry under nixosConfigurations in nix/flake.nix.

Adding a new host

  1. Create a directory: nix/hosts//
  2. Add configuration files (start by copying limgrave and trimming, or use the minimal example from carpates)
  3. Generate hardware config on the new machine:
sudo nixos-generate-config
# Move merge the generated hardware-configuration.nix into nix/hosts/<newhost>/
  1. Add the host to nix/flake.nix under nixosConfigurations
  2. Make sure networking.hostName = "" in the host configuration
  3. Build or install:
sudo nixos-rebuild switch --flake ./nix#<newhost>
# or during install:
nixos-install --flake <repo-path>/nix#<newhost>

Notes

  • Old single-host files nix/configuration.nix and nix/packages.nix are kept for reference but are not used by the flake. You can remove them once comfortable with the new layout.
  • limgrave includes nix-snapd and Home Manager; carpates currently includes Home Manager only.

Nix on non-NixOS (Ubuntu, etc.)

You can also use this flake on non-NixOS systems (e.g., Ubuntu) via Home Manager. For that path, hosts are defined under homeConfigurations in nix/flake.nix and typically live next to their NixOS counterparts. In this repo, carpates is prepared for non-NixOS via Home Manager.

  • Naming rule: your machine's hostname (output of hostname -s) should match the homeConfigurations.<host> entry. Example: carpates.
  • Packages: non-NixOS hosts usually install user-scoped packages via Home Manager, using the shared base set from nix/base/packages.nix.

Prerequisites

  • Install Nix (multi-user is recommended):
    sh <(curl -L https://nixos.org/nix/install) --daemon
    
  • Enable flakes (if not already). On non-NixOS, set in /etc/nix/nix.conf or $XDG_CONFIG_HOME/nix/nix.conf:
    experimental-features = nix-command flakes
    
  • Install Home Manager (no separate channel needed when using flakes; we can run it via nix run or install it on PATH):
    # Optional, to have `home-manager` on PATH:
    nix profile install github:nix-community/home-manager
    

Apply the configuration (non-NixOS)

From repo root:

# Use the prepared Home Manager host (example: carpates)
home-manager switch --flake ./nix#carpates
# If `home-manager` is not installed, you can run it via nix:
nix run github:nix-community/home-manager -- switch --flake ./nix#carpates

Upgrades (non-NixOS)

nix_upgrade also works on non-NixOS:

# Auto-detects host from (hostname -s) and runs Home Manager switch
nix_upgrade

# Or override explicitly
nix_upgrade carpates

What it does on non-NixOS:

  • nix flake update --flake /home/catalin/.dotfiles/nix
  • home-manager switch --flake /home/catalin/.dotfiles/nix#<host> (or nix run ... -- switch if HM is not on PATH)

NixOS vs. non-NixOS summary

  • NixOS hosts are declared under nixosConfigurations and are applied with nixos-rebuild.
  • non-NixOS hosts are declared under homeConfigurations and are applied with home-manager switch.
  • The nix_upgrade function detects the OS and selects the correct path automatically based on the hostname.