- Nix 82.8%
- Shell 17.2%
| config | ||
| disko | ||
| hosts | ||
| lib | ||
| modules | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| ACP-Flake.md | ||
| AGENTS.md | ||
| flake.lock | ||
| flake.nix | ||
| IDEAS.md | ||
| New-hosts.md | ||
| README.md | ||
| wallpaper.png | ||
ftmahringer/nixos-config
This is my nixos-config, i have been building for some time now.
The biggest inspiration, was from: librephoenix and his nixos-config.
The main layout i took from him, as well as the idea with a custom wrapper script, which i have never seen someone else do before, i extended it and made that sciript a core part of my config.
Modular NixOS and Home Manager configuration for multiple hosts, built around:
flake-parts- Phoenix-style host folders
- shared
modules/system,modules/user, andmodules/themes - a custom wrapper command:
ftnix
Overview
This repo separates concerns like this:
hosts/<name>/configuration.nix: host and system-facing settingshosts/<name>/home.nix: user and workflow-facing settingsmodules/system: shared NixOS modulesmodules/user: shared Home Manager modulesmodules/themes: theme definitions onlyconfig/variables.nix: bootstrap settings shared across all hostsconfig/ssh-hosts.nix: fixed extra SSH hosts that should always be present in~/.ssh/configdisko/: optional Disko layouts for fresh installs
Current hosts:
nixosminipc
Host Layout
Each host follows this layout:
hosts/<name>/
├── default.nix
├── configuration.nix
├── home.nix
└── hardware-configuration.nix
default.nixwires the host into NixOS + Home Managerconfiguration.nixdefines host settings and system-specific confighome.nixdefines user-facing settingshardware-configuration.nixstays machine-specific
Settings Style
The repo prefers nested feature blocks with .enable flags when a feature is optional.
Examples:
stylix = {
theme = "dracula";
icons = "papirus";
};
desktop = {
compositor = "hyprland";
type = "wayland";
greeter = {
name = "tuigreet";
};
};
browser = {
default = "librewolf";
extra = [ "brave" ];
};
Single-choice tools usually stay simple:
launcher = "fuzzel";
bar = "waybar";
notifications = "mako";
fileManager = "yazi";
Some values are intentionally kept flat because they are always needed:
systemhostIdhostnameusernamefullNameemailhomeDirectorytimezonelocale
Themes
Themes live only in modules/themes/<name>/.
Each theme is expected to be self-contained and may include:
- a palette
- wallpaper/background info
- optional built-in asset selections for icons, fonts, and cursor family
If a theme has a local background file, that wins. Otherwise the theme can fall back to a URL + hash, and finally to the repo root wallpaper.png.
Useful theme commands:
ftnix stylix themes
ftnix stylix icons
ftnix stylix fonts
ftnix stylix cursors
Wrapper
The main entrypoint is ftnix, installed from modules/system/ftnix/.
It is the preferred way to work with this repo instead of calling nixos-rebuild directly.
Common commands:
ftnix hosts
ftnix switch
ftnix switch --host minipc
ftnix remote-switch minipc
ftnix home switch
ftnix update
ftnix fmt
ftnix check
ftnix gc
Local switching
ftnix switch
This now auto-detects the current machine and uses the matching host by default.
You can still override it explicitly:
ftnix switch --host nixos
Remote switching
ftnix remote-switch minipc
This is intentionally separate from local switching.
switchis localremote-switch <hostname|ip>is remote
remote-switch resolves the given SSH target back to a known host entry and refuses mismatches, so you cannot accidentally activate one host's config on a different machine.
Container Registries
For Docker or Podman hosts, you can define shared container registry settings directly in the host's virtualisation block:
virtualisation = {
containerRuntime = "podman";
registries = {
search = [ "nexus.example.com" ];
insecure = [ "nexus.example.com" ];
block = [ ];
};
};
This maps to the shared NixOS container registry settings, so the same host config shape works for both Podman and Docker.
SSH Config Generation
Home Manager owns ~/.ssh/config.
The SSH config is built from two sources:
- generated host entries from the repo's host definitions
- fixed extra hosts from
config/ssh-hosts.nix
On ftnix switch, the wrapper updates the current host's ssh.hostName to the current detected IPv4 and writes a generated repo-side SSH file. Then Home Manager regenerates the real ~/.ssh/config during activation.
That means:
ftnixdoes not write directly to~/.ssh/config- custom manual entries should go into
~/.ssh/config.local - fixed repo-managed custom entries should go into
config/ssh-hosts.nix
Example config/ssh-hosts.nix:
{
forgejo = {
hostname = "forgejo.ftmahringer.com";
user = "git";
port = 2222;
identityFile = [ "~/.ssh/id_ed25519" ];
identitiesOnly = true;
};
}
Current Shared Features
Notable shared pieces already wired into the repo:
- Stylix theming
- Hyprland desktop setup
- greetd + tuigreet
- firewall module
- SSH service
- ZRAM/sysctl tuning support
- Disko support
- generated SSH config via Home Manager
nix-output-monitorintegration inftnix
Disko
Disko is available, but optional.
Hosts can either use a real layout:
disko = {
enable = true;
layout = "single-disk-ext4";
device = "/dev/sda";
};
or an intentionally empty disabled shape:
disko = { };
Development Notes
Formatting and checks:
ftnix fmt
ftnix check
The repo also includes pre-commit hook wiring in the flake, so once the lockfile/input state is up to date you can use normal pre-commit formatting as well.
Preferred Workflow
For normal use:
ftnix switch
For another local host config:
ftnix switch --host minipc
For a remote activation:
ftnix remote-switch minipc
If the wrapper is ever the thing being fixed and you need a bootstrap rebuild, use direct nixos-rebuild once:
sudo nixos-rebuild switch --flake .#minipc
After that, go back to ftnix.