This directory contains the configuration and dotfiles for my continuously evolving multi-PC setup (using Nix).
All the devices I own, controlled by code.
It also builds and deploys my website to maydayv7.dev.
Pictures
**_Note:_** These may be outdated |  | | :----------------------------------------------: | | _Hyprland_ | |  | | :------------------------------------------------: | | _GNOME Desktop_ | | Windows | | :--------------------------------------------: | |  | | |Theming
- [Starship](https://starship.rs/) Prompt Theme: Minimal, blazing-fast, and infinitely customizable prompt for any shell - [Bibata Cursor](https://github.com/ful1e5/Bibata_Cursor): Compact and material designed cursor set - [Papirus Icon Theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme): Pixel perfect icon theme for Linux - [Catppuccin](https://github.com/catppuccin) Theme: A community-driven Pastel Theme consisting of 4 soothing warm Flavors with 26 eye-candy Colors each - [Adwaita GTK3](https://github.com/lassekongo83/adw-gtk3): Theme from `libadwaita` ported to GTK3 - [KvLibadwaita](https://github.com/GabePoel/KvLibadwaita) Kvantum Theme: Integrates QT Apps with GNOME Desktop - Firefox [GNOME Theme](https://github.com/rafaelmardojai/firefox-gnome-theme): GNOME Theme for the Mozilla Firefox Browser - VS Code [Adwaita Theme](https://github.com/piousdeer/vscode-adwaita): Integrates Visual Studio Code with GNOME Desktop - Discord [GNOME Theme](https://github.com/ricewind012/discord-gnome-theme): A GNOME theme for Discord, following the Adwaita style & GNOME HIG - Obsidian [Adwaita Theme](https://github.com/birneee/obsidian-adwaita-theme): A GNOME Adwaita theme for ObsidianOlder...
|  | | :------------------------------------------------------: | | _Pantheon Desktop_ | | [](https://www.reddit.com/r/unixporn/comments/19efxry/xfce_functional_and_beautiful/) | | :-----------------------------------------------------------------------------------------------------------------------------------: | | _XFCE Desktop_ | |  | | :--------------------------------------------------: | | _GNOME 45_ | |  | | :--------------------------------------------------: | | _GNOME 44_ | | [](https://www.reddit.com/r/unixporn/comments/ssb7mf/gnome_my_dream/) | | :-----------------------------------------------------------------------------------------------------------------------: | | _GNOME 41_ |Features
- Device-Agnostic
- Convenient and Automated
- Hermetically Reproducible
- Declarative and Derivational
- Atomic, Generational and Immutable
Notable Features
- Supports multiple users and devices
- Configuration for multiple DEs and Compositors
- Incorporates PipeWire, Wayland, ...!
- Automatically builds and deploys my Website
- Credentials management using the
sops-nixmodule andgnupgkeys - Comprehensive User Configuration using the
home-managermodule - Ephemeral, opt-in filesystem state using the
impermanencemodule and ZFS - Declarative disk partitioning and installation using
disko - Support for Secure Boot using
lanzaboote - Multiple development
shellsintegrated withdirenvandlorri - Automatic
packagesupdates usingupdate.sh - Syntax formatting using
treefmt - Support for
sourcefilters withnix-filter - Support for Base16 color theming using
stylix - Support for declaratively installing Flatpak applications using
nix-flatpak - Support for Android Virtualisation using Waydroid
- Support for VFIO PCI Device Passthrough with a declarative, performant Windows VM using NixVirt and Looking Glass (see my blog post)
Programs
| Type | Programs |
|---|---|
| Editors | nano, micro, VS Code |
| Shells | bash, zsh |
| Terminal | Ghostty, Kitty |
| Browser | Firefox |
| Desktops | GNOME, Hyprland, Niri |
Structure
Overview of File Hierarchy
Outputs
$ nix flake show
github:maydayv7/dotfiles
├───apps
│ └───x86_64-linux
│ ├───sysutils: app
│ ├───hyprutils: app
│ ├───install: app
│ ├───nixos: app
│ └───default: app
├───checks
│ └───x86_64-linux
│ ├───configurations:nixos:futura: derivation
│ ├───configurations:nixos:valkyrie: derivation
│ ├───configurations:nixos:vortex: derivation
│ └───treefmt: derivation 'treefmt-check'
├───devShells
│ └───x86_64-linux
│ ├───cc: development environment 'C'
│ ├───android: development environment 'Android'
│ ├───default: development environment 'devShell'
│ ├───format: development environment 'nix-shell'
│ ├───java: development environment 'Java'
│ ├───js: development environment 'JavaScript'
│ ├───lua: development environment 'Lua'
│ ├───python: development environment 'Python'
│ ├───rust: development environment 'Rust'
│ ├───sql: development environment 'SQL'
│ ├───video: development environment 'Video'
│ └───website: development environment 'Website'
├───files: 'dotfiles' and program configuration
├───formatter
│ └───x86_64-linux: package 'treefmt'
├───homeConfigurations
│ ├───navya@futura: Home Manager configuration
│ ├───v7@valkyrie: Home Manager configuration
│ └───v7@vortex: Home Manager configuration
├───legacyPackages
│ └───x86_64-linux (Default package channel)
├───modules: dendritic configuration modules
├───nixosConfigurations
│ ├───futura: NixOS configuration
│ ├───install: NixOS configuration
│ ├───valkyrie: NixOS configuration
│ └───vortex: NixOS configuration
├───overlays
├───packages
│ └───x86_64-linux
│ ├───install: package 'os-install'
│ ├───nixos: package 'nixos'
│ └───website: package 'website-stable'
├───patchedPkgs: patched package source
└───templates
└───default: template: My NixOS Configuration
┌── flake.nix
├── flake.lock
├── files
├── site
├── secrets
│ └── passwords
├── shells
├── lib
│ ├── build.nix
│ └── map.nix
├── scripts
│ ├── install.nix
│ └── os.nix
├── packages
│ ├── overlays
│ └── patches
└── modules
├── core
├── hosts
├── apps
├── desktop
├── games
├── gui
├── hardware
├── shell
├── system
├── users
└── virt
-
flake.nix: toplevel configuration file and repository version control
flake-partsis used for modularization, following the dendritic pattern -
files:dotfilesand program configuration site: personal website generated usingzolasecrets: authentication credentials and user passwords managed usingsops-nixshells: sand-boxed shells for development purposeslib: custom functions designed for conveniently defining configurationscripts: useful system management scriptspackages: locally built custom packagesoverlays: overrides for pre-built packagesmodules: custom configuration modules for additional functionality
Installation
Already Installed
To use my configuration as-is for a fresh NixOS installation, you can try the following steps: **_Note:_** Run `nix develop` in the repository to install all required dependencies 1. Prepare `/etc/nixos`:sudo mkdir /etc/nixos
sudo chown $USER /etc/nixos && sudo chmod ugo+rw /etc/nixos
cd /etc/nixos
2. Clone this repository (and preferably initialize it using `git`):
nix flake init -t github:maydayv7/dotfiles
git init
3. Install `gnupg` and generate a GPG Key for yourself (if you don't already have one), and include it in the [`secrets.yaml`](./secrets/secrets.yaml) file (using `gpg --list-keys`). You can use the following commands to generate the GPG key (Ultimate trust and w/o passphrase is preferred):
_Replace_ **_USER_** _,_ **_EMAIL_** _and_ **_COMMENT_**
gpg --full-generate-key
1
4096
0
y
USER
EMAIL
COMMENT
O
gpg --output public.pgp --armor --export USER@EMAIL
gpg --output private.pgp --armor --export-secret-key USER@EMAIL
_Save the keys `public.gpg` and `private.gpg` in a secure location_
4. Import all required GPG Keys into a convenient location (like `/etc/gpg`) using gpg --homedir DIR import and specify it at `config.sops.gnupg.home` (Required for decryption of `secrets` on boot, can also be on an external drive)
5. Make new `secrets` and `passwords` in the desired directories by appending the paths to `secrets.yaml` and then using the following command (The [`os`](./scripts/README.md) script can be used to simplify the process):
_Replace_ **_PATH_** _with the path to the `secret`_
sops --config /path/to/secrets.yaml -i PATH
6. Add device-specific configuration by creating a new file in [`modules/hosts`](./modules/hosts), setting its `system.fs` options. The disk layout is then handled by [`disko`](./modules/system/filesystem.nix), which expects the partitions to carry the `ESP`, `System` and `swap` labels.
7. Finally, run `nixos-rebuild switch --flake /etc/nixos#HOSTNAME` (as `root`) to switch to the configuration!
From Scratch
> [!IMPORTANT] > These instructions are mainly intended for personal use To download the Install Media, click on the latest successsful run listed [here](../../actions/workflows/install.yml) and download the image artifact. Burn it to a USB using a flashing utility such as [Etcher](https://www.balena.io/etcher/) > [!TIP] > In order to directly use the configuration, you must first create a clone of this repository and follow steps 2 to 6 from the first section, and preferably create your own install mediaBuild
If Nix is already installed on your system, you may run the following command to build the Install Media image:nix build github:maydayv7/dotfiles#nixosConfigurations.install.config.system.build.images.iso
To build and run the `install` script, use the following commands:
nix build github:maydayv7/dotfiles#install
sudo ./result/bin/os-install
nix build github:maydayv7/dotfiles#nixosConfigurations.DEVICE.config.system.build.images.iso
Build It Yourself
If you really want to get dirty with Nix and decide to invest oodles of your time into building your own configuration, this repository can be used as inspiration. Follow along with my [NixOS Desktop](https://maydayv7.dev/series/nixos-desktop/) Series **Welcome** to the Nix Community! ;)Notes
Caution
This repository contains my personal configuration, and may cause undesirable effects on other systems. It may also be subject to rapid undocumented changes, and uses Nix Flakes, an experimental feature.
Note
Required Nix Version >= 2.19
It is not recommended to use NixOS if you are a beginner just starting out, without acquaintance with either the command-line or functional programming languages, since the learning curve is steep, debugging issues is difficult, documentation is shallow, and the effort required/time spent isn't worth the hassle for a novice/casual user.
Platform
May change according to available hardware
This configuration works well with an Intel CPU + iGPU, and is currently being improved to support an AMD APU + Nvidia GPU. Any other setup is untested.
The hardware.modules option can be used to load relevant configuration from nixos-hardware.
See this for additional information
Cache
The system build cache is publicly hosted using Cachix at maydayv7-dotfiles, and can be used while building the system to prevent rebuilding from scratch
Continuous Integration
This repository makes use of GitHub Actions in order to automatically check the configuration syntax & format on every commit, update the inputs and build the Install Media .iso every month, and upload the build cache to Cachix.
A git hook is used to check the commit message to adhere to the Conventional Commits specification
Variables
ACCESS_TOKEN: Personal Access Token (To create one, see this)CACHIX_TOKEN: Cachix Authentication Token
If you like this project, consider leaving a star