NixOS & Home Manager Configurations
This repository contains a Nix Flake for configuring my computers and/or home environment. It is not intended to be a drop in configuration for your computer, but you are welcome to use it as a reference or starting point for your own configuration. If you are looking for a more generic NixOS configuration, I recommend nix-starter-configs. 👍️ These computers are managed by this Nix flake ❄️
| Hostname | Board | CPU | RAM | Primary GPU | Role | OS | State |
|---|---|---|---|---|---|---|---|
woody |
ROG-STRIX-B650E-WIFI | AMD Ryzen 9 7900X | 64GB | AMD Radeon RX 7800 XT | 🖥️ | ❄️ | ✅ |
frametop |
Framework-13in-12thGen | Intel i7-1260P | 64GB | Intel Iris XE Graphics | 💻️ | ❄️ | ✅ |
steamdeck |
SteamDeck-OLED | Zen 2 4c/8t | 16GB | 8 RDNA 2 CUs | 🎮️ | 🐧 | ✅ |
mini |
[Mac mini] | [Apple M4] | 16GB | [Apple Integrated GPU] | 🖥️ | 🍎 | ✅ |
Key
- 🎭️ : Dual boot
- 🖥️ : Desktop
- 💻️ : Laptop
- 🎮️ : Games Machine
- 🐄 : Virtual Machine
- ☁️ : Server
- .github: GitHub CI/CD workflows Nix ❄️ supercharged ⚡️ by Determinate Systems
home: My Home-manager configuration, acessible viahome-manager --flakefeatures:global:$HOST_NAME.nix: Each hm configuration can toggle. Sane defaults for shell and desktop
hosts: NixOS Configurations, accessible vianixos-rebuild --flake.common: Shared configurations consumed by the machine-specific ones.global: Configurations that are globally applied to all my machines.optional: Opt-in configurations my machines can use.
$HOST_NAME: Includes discrete hardware configurations that leverage the NixOS Hardware modules.
modules: A few modulesoverlay: Patches and version overrides for some packages. Accessible viapkgs: My custom packages. Also accessible vianix build. You can compose these into your own configuration by using my flake's overlay, or consume them through NUR.templates: A couple project templates for different languages. Accessible vianix init.- flake.nix: Entrypoint for hosts and home configurations. Also exposes a devshell for boostrapping (
nix developornix-shell). - [Makefile]: Commands for managing nix
- Boot off a .iso image created by this flake using
build-iso-desktoporbuild-iso-console(see below) - Put the .iso image on a USB drive
- Boot the target computer from the USB drive
- Two installation options are available:
1 Use the graphical Calamares installer to install an ad-hoc system
2 Run
install-system <hostname> <username>from a terminal- The install script uses Disko or
disks.shto automatically partition and format the disks, then uses my flake vianixos-installto complete a full-system installation - This flake is copied to the target user's home directory as
~/Zero/nix-config - The
nixos-entercommand is used to automatically chroot into the new system and apply the Home Manager configuration.
- The install script uses Disko or
- Reboot 🥾
All you need is nix (any version). Run:
nix-shell
If you already have nix 2.4+, git, and have already enabled flakes and
nix-command, you can also use the non-legacy command:
nix develop
nixos-rebuild --flake . To build system configurations
home-manager --flake . To build user configurations
nix build (or shell or run) To build and use packages
sops To manage secrets
I clone this repo to ~/nix-config. NixOS and Home Manager changes are applied separately because I have some non-NixOS hosts.
gh repo clone ryanwclark1/nix-config ~/nix-config- ❄️ NixOS: A
build-hostandswitch-hostaliases are provided that build the NixOS configuration and switch to it respectively. - 🏠️ Home Manager: A
build-homeandswitch-homealiases are provided that build the Home Manager configuration and switch to it respectively. - 🌍️ All: There are also
build-allandswitch-allaliases that build and switch to both the NixOS and Home Manager configurations.
The build-iso script is included that creates .iso images from this flake. The following modes are available:
build-iso console(terminal environment): Includesinstall-systemfor automated installation.build-iso desktop(desktop environment): Includesinstall-systemand Calamares installation.
Live images will be left in ~/$HOME/nix-config/result/iso/ and are also injected into ~/Quickemu/nixos-console and ~/Quickemu/nixos-desktop respectively.
The console .iso image is also periodically built and published via [GitHub Actions and are available in this project's Releases](https://github.com/ryanwclark1/nix-config/releases).
Nix is configured with flake support and the unified CLI enabled.
Here is the directory structure I'm using.
.
├── home
│ ├── features
│ │ ├── alacritty
│ │ ├── cli
│ │ ├── compression
│ │ ├── desktop
│ │ │ ├── common
│ │ │ ├── gnome
│ │ │ ├── hyprland
│ │ │ │ ├── config
│ │ │ │ │ ├── hyprland
│ │ │ │ │ ├── fastfetch
│ │ │ │ │ ├── pipewire
│ │ │ │ │ ├── rofi
│ │ │ │ │ └── swaync
│ │ │ │ ├── fonts
│ │ │ │ ├── media
│ │ │ │ │ └── wallpapers
│ │ │ │ └── scripts
│ │ │ └── plasma
│ │ ├── development
│ │ ├── eza
│ │ ├── filesearch
│ │ ├── fzf
│ │ ├── games
│ │ ├── git
│ │ ├── gpu
│ │ ├── helix
│ │ ├── insomnia
│ │ ├── kitty
│ │ ├── kubernetes
│ │ ├── lazygit
│ │ ├── lf
│ │ ├── media
│ │ ├── networking-utils
│ │ ├── nvim
│ │ │ └── plugin
│ │ ├── osint
│ │ ├── pistol
│ │ ├── productivity
│ │ ├── qutebrowser
│ │ ├── shell
│ │ ├── starship
│ │ ├── sys-stats
│ │ ├── vscode
│ │ ├── wezterm
│ │ ├── zellij
│ │ └── zoxide
│ └── global
├── hosts
│ ├── common
│ │ ├── global
│ │ ├── optional
│ │ │ ├── displaymanager
│ │ │ ├── gnome
│ │ │ ├── hyprland
│ │ │ ├── pantheon
│ │ │ └── plasma
│ │ ├── users
│ │ │ └── administrator
│ │ └── wallpaper
│ ├── frametop
│ │ └── services
│ └── woody
│ └── services
├── lib
├── modules
│ ├── home-manager
│ └── nixos
├── overlays
├── pkgs
│ ├── aichat
│ ├── gitkraken
│ ├── multiviewer
│ ├── nix-inspect
│ ├── shellcolord
│ └── wallpapers
└── templates
│ ├── c
│ │ └── src
│ ├── haskell
│ │ ├── app
│ │ └── src
│ ├── node
│ │ └── src
│ └── rust
│ └── src
├── secrets.yaml
└── flake.nix
The NixOS and Home Manager configurations are in the hosts and home directories respectively
The pkgs directory contains my custom packages with package overlays in the overlays directory.
The secrets.yaml contains secrets managed by sops-nix.
The default.nix files in the root of each directory are the entry points.
The font configuration is common with both desktops using Work Sans and Fira Code. The usual creature comforts you'd expect to find in a Linux Desktop are integrated such as Pipewire, Bluetooth, Avahi, CUPS, SANE and NetworkManager.
| Desktop | System | Configuration | Theme |
|---|
Things I currently need to do manually after installation.
- Provision
~/.config/sops/age/keys.txt. Optionally handled byinstall-system. - Add
ssh-to-age -i /etc/ssh/ssh_host_ed25519_key.pubto.sops.yaml. - Run
sops updatekeys secrets/secrets.yaml - Run
gpg-restore - LastPass - authenticate
- Authy - activate
- 1Password - authenticate
Reboot and systemd-boot should now offer the option to boot NixOS and Windows.
Things I should do or improve:
- Migrate Borg Backups to borgmatic via NixOS modules and Home Manager
- Integrate notify
- Integrate homepage
-
fzf -
tmateortmux -
git-graphand/orgit-igittintegration
The Disko implementation and automated installation are chasing the ideas outlined in these blog posts: