This repository 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.site. You can follow along with my NixOS Desktop Series
Pictures
Note: These may be outdated
Hyprland |
GNOME Desktop |
Pantheon Desktop |
Theming
-
Starship Prompt Theme: Minimal, blazing-fast, and infinitely customizable prompt for any shell
-
Bibata Cursor: Compact and material designed cursor set
-
Papirus Icon Theme: Pixel perfect icon theme for Linux
-
Catppuccin Theme: A community-driven Pastel Theme consisting of 4 soothing warm Flavors with 26 eye-candy Colors each
-
Adwaita GTK3: Theme from
libadwaita
ported to GTK3 -
KvLibadwaita Kvantum Theme: Integrates QT Apps with GNOME Desktop
-
Firefox GNOME Theme: GNOME Theme for the Mozilla Firefox Browser, used for better desktop integration
-
VS Code Adwaita Theme: Integrates Visual Studio Code with GNOME Desktop
-
Discord GNOME Theme: A GNOME theme for Discord, following the Adwaita style & GNOME HIG
-
Firefox Elementary Theme: Elementary OS Theme for the Mozilla Firefox Browser, used for better desktop integration
-
VS Code Elementary Theme: Integrates Visual Studio Code with Pantheon Desktop
-
Logseq Bonofix Theme: A clean Logseq theme with focus on long-time writing experience
- Device-Agnostic
- Convenient and Automated
- Hermetically Reproducible
- Declarative and Derivational
- Atomic, Generational and Immutable
- Supports multiple users and devices
- Configuration for multiple Desktop Environments
- Incorporates PipeWire, Wayland, ...!
- Automatically builds and deploys my Website
- Credentials management using the
sops-nix
module andgnupg
keys - Comprehensive User Configuration using the
home-manager
module, with support for setting global conditionals and shared/user-specific configuration - Ephemeral, Opt-In filesystem state using the
impermanence
module and ZFS - Support for Secure Boot using
lanzaboote
- Support for multiple development
shells
integrated withdirenv
andlorri
- Automatic
packages
updates usingupdate.sh
- Syntax formatting using
treefmt
- Support for
source
filters withnix-filter
- Support for Base16 color theming using
stylix
- Support for declaratively installing Flatpak applications using
nix-flatpak
- Wrapped
wine
Applications using Emmanuel's Wrapper - Support for Android Virtualisation using Waydroid
- Support for VFIO PCI Device Passthrough along with Looking Glass for high-performance VMs
Type | Programs |
---|---|
Editors | nano , micro , VS Code |
Shells | bash , zsh |
Terminal | Ghostty, Kitty |
Browser | Firefox |
Desktops | GNOME, Hyprland, Pantheon |
Overview of File Hierarchy
Outputs
$ nix flake show
github:maydayv7/dotfiles
├───apps
│ └───x86_64-linux
│ ├───hyprutils: app
│ ├───install: app
│ └───nixos: app
├───checks
│ └───x86_64-linux
│ ├───Device-iso: derivation 'nixos-rebuild'
│ └───treefmt: derivation 'treefmt-check'
├───devShells
│ └───x86_64-linux
│ ├───cc: development environment 'C'
│ ├───default: development environment 'devShell'
│ ├───format: development environment 'nix-shell'
│ ├───java: development environment 'Java'
│ ├───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'
├───legacyPackages
│ └───x86_64-linux (Default package channel)
├───lib: utility library functions
├───nixosConfigurations
│ ├───futura: 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
├───systems: supported architectures
└───templates
└───default: template: My NixOS Configuration
┌── flake.nix
├── flake.lock
├── files
├── site
├── devices
│ └── vm
├── users
│ └── passwords
├── secrets
├── shells
├── checks
├── lib
│ ├── build.nix
│ ├── map.nix
│ └── pack.nix
├── scripts
│ ├── install.nix
│ └── nixos.nix
├── packages
│ └── overlays
└── modules
├── configuration.nix
├── apps
├── base
├── gui
├── hardware
├── nix
├── shell
└── user
-
flake.nix
: toplevel configuration file and repository version control
flake-parts
is used for modularization -
files
:dotfiles
and program configuration -
devices
: system configuration for various devices -
vm
: declarative configuration to build multiple virtual machines -
users
: individual user-specific configuration -
secrets
: authentication credentials management usingsops-nix
-
shells
: sand-boxed shells for development purposes -
checks
: configuration checks and continuous integration -
lib
: custom functions designed for conveniently defining configuration -
scripts
: useful system management scripts -
packages
: locally built custom packages -
overlays
: overrides for pre-built packages -
modules
: custom configuration modules for additional functionality -
configuration.nix
: builds system configuration
Already Installed
In case you want to use my configuration as-is for a fresh NixOS install, you can try the following steps:
Note: You can run nix develop
in the repository to install all required dependencies
-
Prepare
/etc/nixos
:sudo mkdir /etc/nixos sudo chown $USER /etc/nixos && sudo chmod ugo+rw /etc/nixos cd /etc/nixos
-
Clone this repository (and preferably initialize it using
git
):nix flake init -t github:maydayv7/dotfiles git init
-
Install
gnupg
and generate a GPG Key for yourself (if you don't already have one), and include it in thesecrets.yaml
file (usinggpg --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 COMMENTSave the keysgpg --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
public.gpg
andprivate.gpg
in a secure location -
Import all required GPG Keys into a convenient location (like
/etc/gpg
) usinggpg --homedir DIR import
and specify it atconfig.sops.gnupg.home
(Required for decryption ofsecrets
on boot, can also be on an external drive) -
Make new
secrets
andpasswords
in the desired directories by appending the paths tosecrets.yaml
and then using the following command (Thenixos
script can be used to simplify the process):
Replace PATH with the path to thesecret
sops --config /path/to/secrets.yaml -i PATH
-
Add device-specific configuration by creating a new file in
8000 devices
(bear in mind that the name of the file must be same as theHOSTNAME
of your device), and if required, hardware configuration using thehardware.modules
option. Do keep in mind that the filesystems must be appropriately created and labeled as defined here. -
Finally, run
nixos-rebuild switch --flake /etc/nixos#HOSTNAME
(asroot
) to switch to the configuration!
Minimal Configuration
The lib.build.device
function can be used to generate the full configuration minimally
Read this for definition information
Example flake.nix
:
{
description = "Minimal NixOS Configuration";
## System Repositories ##
inputs = {
## Package Repositories ##
# NixOS Package Repository
nixpkgs.follows = "dotfiles/nixpkgs";
## Configuration Modules ##
# My PC Dotfiles
dotfiles.url = "github:maydayv7/dotfiles";
};
## System Configuration ##
outputs = inputs: let
lib = with inputs; nixpkgs.lib // dotfiles.lib;
in {
nixosConfigurations.host = lib.build.device {
name = "HOST_NAME";
system = "x86_64-linux";
imports = [
# Generate using 'nixos-generate-config'
./hardware-configuration.nix
# Passwords
{
users.extraUsers = {
root.hashedPassword = "HASHED_PASSWORD";
recovery.initialHashedPassword = "HASHED_PASSWORD";
};
}
];
timezone = "Continent/City";
locale = "US";
kernel = "lts";
kernelModules = ["nvme"];
gui = {};
hardware = {
boot = "efi";
cores = 4;
filesystem = "simple";
modules = [ /* Imported from 'nixos-hardware' */];
};
# Default User
user = {
name = "nixos";
description = "Default User";
minimal = true;
password = "HASHED_PASSWORD"; # Generate using 'mkpasswd -m sha-512'
};
};
};
}
From Scratch
[!IMPORTANT] These instructions are mainly intended for personal use
To download the Install Media, click on the latest successsful run listed here and download the image artifact. Burn it to a USB using a flashing utility such as 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 media
Build
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
If you want to create an .iso
image of the entire system, run the following command:
Replace DEVICE with the name of Device to build
nix build github:maydayv7/dotfiles#nixosConfigurations.DEVICE.config.system.build.images.iso
Note that the install
script automatically creates and labels all the required partitions, so it is recommended that only the partition table on the disk be created and have enough free space
Name | Label | Format | Size (minimum) |
---|---|---|---|
BOOT Partition | ESP | vfat | 500M |
ROOT Partition | System | ZFS | 25G |
SWAP Area | swap | swap | 4G |
DATA Partition | Files | ZFS | 10G |
[!NOTE] For the
advanced
filesystem scheme only
To install the OS, just boot the Live USB and run sudo os-install
If the image doesn't boot, try disabling the secure boot
and RAID
options from BIOS
After the reboot, run nixos setup
to finish the install
In case you are using the advanced
filesystem scheme, you may need to set the boot flag zfs_force=1
on first boot
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. You can check out the list of links below to resourceful Nix documentation/tutorials/projects that may be helpful in your endeavour
Welcome to the Nix Community! ;)
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
May change according to available hardware
This configuration works well with an Intel CPU + iGPU, and is currently being improved to support 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
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
This repository makes use of GitHub Actions
in order to automatically check the configuration syntax on every commit and format it (using treefmt-nix
), update the inputs
and build the Install Media .iso
every month, and upload the build cache to Cachix (You can also find GitLab CI/CD
configuration in .gitlab
). A git
hook is used to check the commit message to adhere to the Conventional Commits
specification
ACCESS_TOKEN
: Personal Access Token (To create one - GitHub, GitLab)CACHIX_TOKEN
: Cachix Authentication Token
The home-manager
module is used in tandem with the system configuration in order to define user-specific configuration. The config.user.homeConfig
option, from which the final user configuration is built, has been declared in modules/user/default.nix
in order to effortlessly configure shared configuration for all users of the system. The system config
can be accessed using the sys
parameter in home-manager
modules
See: A Curated List of the Best Resources in the Nix Community
Also: This website for beginners starting out with NixOS and Flakes
- Official Documentation
- NixOS Manual
- Nix Pills
- NixOS Discourse
- NixOS Package Search
nixpkgs
Package Repository- NUR Nix User Repository
- NixOS Hardware Modules
- Home Manager Options
- Tweag Article introducing Flakes
- Serokell's Blog on Flakes
- Jordan Isaac's Blog for porting configuration to Flakes
- Jon Ringer's Videos on General NixOS Tooling and Hackery
- Justin's Notes on using Nix
- Lan Tian's Series of Blog Posts on NixOS
- Christine's Blog Posts addressing NixOS Security
- Graham's and Elis' Blog Posts on Ephemeral Partition Schemes
Here are some repositories that I may have shamelessly rummaged through for building my dotfiles
:
Thanks a lot! ;)
- Example Configuration
- User Configurations -
Known Limitations
- Home Configuration isn't decoupled from System
- Online accounts have to be manually signed into
- Wine Applications have to be manually updated
- Logseq Plugins have to be manually installed
- Cannot automatically hibernate on NVIDIA due to upstream issue
- VFIO Support via GPU Hotplug instead of restart
Last Updated: June 2025
If you like this project, consider leaving a star