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 |
XFCE Desktop |
Pantheon Desktop |
Theming
- Hyfetch: Snazzy CLI System Information Tool
- Powerlevel10K Theme: ZSH Theme for the fancy-looking prompt with immense customization capabilities
- Arc Theme: Flat GTK theme with transparent elements for various desktop shells, window managers and applications
- Bibata Cursor: Compact and material designed cursor set
- DNOME Discord Theme: Discord Theme inspired by Adwaita, designed to integrate Discord with GNOME
- Nordic Discord Theme: Discord Theme using the Nord color palette
- Firefox GNOME Theme: GNOME Theme for the Mozilla Firefox Browser, used for better desktop integration
- Firefox Elementary Theme: Elementary OS Theme for the Mozilla Firefox Browser, used for better desktop integration
- VS Code Adwaita Theme: Integrates Visual Studio Code with GNOME Desktop
- VS Code Arc Theme: Port of the Arc Dark GTK Theme for Visual Studio Code
- VS Code Elementary Theme: Integrates Visual Studio Code with Pantheon Desktop
- KvLibadwaita Kvantum Theme: Integrates QT Apps with GNOME Desktop
- Arc KDE Theme: Port of the Arc GTK Theme for Plasma Desktop
- ULauncher Adwaita Theme: ULauncher Theme based on GNOME Desktop's Adwaita Dark Theme
- ULauncher Arc Theme: An Arc Dark Theme for ULauncher
- ULauncher Elementary Theme: ULauncher Themes for Elementary OS
- Catppuccin Theme: A community-driven Pastel Theme consisting of 4 soothing warm Flavors with 26 eye-candy Colors each
- Logseq [Bonofix Theme][https://github.com/Sansui233/logseq-bonofix-theme]: A clean Logseq theme with focus on long-time writing experience
- Logseg Nord Theme: Logseq in an arctic, north-bluish color palette
- 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
- Authentication Credentials Management using the
sops
Module andgnupg
Keys - Comprehensive User Configuration using the tightly integrated
home-manager
module, with support for configuring shared user configuration, global conditionals and user-specific configuration - Ephemeral, Opt-In File System State using the
impermanence
module and ZFS - Support for Secure Boot using
lanzaboote
- Support for Multiple Programming Language Development
shells
integrated withdirenv
andlorri
- Automatic
packages
Updates usingupdate.sh
- Install Media and Device Images using
nixos-generators
image generation modules - Syntax Formatting using
treefmt
andtreefmt-nix
- 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 , VS Code |
Shells | bash , zsh |
Terminal | Ghostty, xfce4 Terminal, Kitty |
Browser | Firefox |
Desktop Environments | GNOME, XFCE, Pantheon |
Compositors | Hyprland, Picom |
Overview of File Hierarchy
Outputs
$ nix flake show
github:maydayv7/dotfiles
├───apps
│ └───x86_64-linux
│ ├───default: app
│ ├───install: app
│ └───nixos: app
├───channels
│ └───x86_64-linux
│ ├───stable: package channel
│ └───unstable: package channel
├───checks
│ └───x86_64-linux
│ ├───Device-gnome: derivation 'nixos-rebuild'
│ ├───Device-xfce: derivation 'nixos-rebuild'
│ └───treefmt: derivation 'treefmt-check'
├───devShells
│ └───x86_64-linux
│ ├───cc: development environment 'C'
│ ├───default: development environment 'devShell'
│ ├───format: development environment 'Formatter'
│ ├───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'
├───installMedia: device install media
├───legacyPackages
│ └───x86_64-linux (References 'stable' channel)
├───lib: utility library functions
├───nixosConfigurations
│ ├───futura: NixOS configuration
│ ├───valkyrie: NixOS configuration
│ └───vortex: NixOS configuration
├───overlays
├───packages
│ └───x86_64-linux
│ ├───install: package 'install'
│ └───nixos: package 'nixos'
└───templates
└───default: template: My NixOS Configuration
┌── flake.nix
├── flake.lock
├── files
├── site
├── devices
│ ├── systems.nix
│ └── 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 -
systems.nix
: list of supported system architectures -
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
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
Download the latest install media image from the Releases page and burn it to a USB using a flashing utility such as Etcher
[!IMPORTANT] These instructions are mainly intended for personal use
[!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
Additional Install Media
If Nix is already installed on your system, you may run the following command to build the Install Media:
Replace VARIANT with the name of Install Media to create
nix build github:maydayv7/dotfiles#installMedia.VARIANT.config.system.build.isoImage
You can also download the NixOS .iso
from here and run the install
script using the following command:
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.formats.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
While rebuilding system with Flakes, make sure that any file with unstaged changes will not be included. Use git add .
in cases where the git
tree is dirty
There are two branches, stable
and develop
(when required). The stable
branch consists of configuration that builds without failure, and the develop
branch is a bleeding-edge testbed
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 (using and statix
) and format it (using treefmt
), update the inputs
every week, build the configuration and upload the build cache to Cachix as well as publish the Install Media .iso
to a draft Release upon creation of a tag (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 has been declared in modules/user/default.nix
independent of the original module, from which the final configuration is built, in order to prevent infinite recursion while configuring multiple users per 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 -
You can navigate to the README
s present in the various directories to know more about them
Changelog
- Upgrade to NixOS v24.11 (Vicuna)!
- Add Logseq Configuration
- Use Vesktop instead of Discord
- Hyprland Improvements
- Transition to UWSM
- Use
nixpkgs
version - Use
nemo
File Manager - Add KDE Connect Support
- GNOME Changes
- Drop PaperWM for Tiling Shell
- Drop Blackbox for Ghostty
- Update Wine Packages
- GNOME Improvements
- Add Looking Glass to VFIO Configuration
- Remove needless
wfvm
Configuration - Refine Specialisations
- Hyprland Improvements
- Add device
valkyrie
and fix NVIDIA issues - Improve GNOME Configuration
- Use
tiling-shell
instead offorge
- Support NVIDIA GPUs and PRIME
- Use
- Add
devcontainer
for Github Codespaces - Add configuration for Spotify using
spicetify-nix
- Make VS Code Configuration mutable using this module
- Reimplement support for specifying Package Channel for configuration build
- Refactor Install Media build and upload image as Github artifact to circumvent size limit
- Re-expose
lib.build.device
- Add Hyprland Configuration
- Refactor GNOME
dconf
- Overhaul XFCE Configuration
- Use ULauncher
- Use the Picom Compositor
- Add Pantheon Desktop Configuration
- Add VS Code Extensions Repository
- Fix Android Virtualisation
- Support running AppImages
- Add multiple
gui
Modules - Refactor and add
hardware.cpu
- Add
sql
Shell - Actually persist
~/.local/share/Trash
- Use the
flake-parts
Flakes framework - Improve Syntax Formatting with
treefmt-nix
and droppre-commit-hooks
- Support declarative Flatpak application install
- Update Nix to version 2.19
- Enable Security & Hardening settings by default
- Add Boot Recovery Settings
- Support Secure Boot using
lanzaboote
- Allow patching Default Package Channel
- Show package delta using
nvd
- Upgrade to GNOME 45
- Update Extensions
- Fix Emoji Support
- Drop
.templates
- Multiple Refactors
- Separate
games
andlaptop
module - Separate
install
Script - Stop exposing
nixosModules
- Fix
user.homeConfig
- Separate
- Follow NixOS Unstable
- Improve
nix-index
- Move out proprietary files
- Refactor Secrets
- Drop
deploy-rs
Support - Remove
inputs
patching Support - Fix first boot installation
- Add conditional to
lib.map.files
- Add
gui.{wallpaper,wayland}
- Upgrade to NixOS v23.05 (Stoat)!
- Drop
cod
,nix-linter
,gedit
,touchegg
,vscode-server
andmutter-rounded
- Support Android Virtualisation using Waydroid
- Drop
compat
Libraries - Refactor GNOME Experience
- Improve XFCE Configuration and Handling
- Improve Automatic Package Update Script
- Enable ZFS encryption
- Support Network Printing
- Upgrade to NixOS v22.05 (Quokka)!
- Add
lib.map.array
- Improve
nixos
Script - Add
gui.fonts.usershare
- General Maintenance Updates
- Use
treefmt
for Formatting Code
- Deprecate
git-crypt
Usage - Improve Installation Experience
- Begin Work on Blog
- Stabilize with multiple Bug-Fixes
Archive
- Create Website using Zola
- Refine Compatibility Libraries
- Refine Scripts
- Use
nix-shell
Shebangs - Add
lib.build.script
- Use
- Support Visual Studio Code Editor
- Use
alejandra
for formatting code
- Improve
channels
Usage - Support
source
Filters - Refine
git
Configuration - Use
wine
Application Wrapper - Use System Independent
library
- Add Support for Ephemeral
/home
- Add Configuration for XFCE Desktop
- Bifurcate
users
and Refine User Configuration - Support Automatic
packages
Updates usingupdate.sh
- Add Support for Automatic Deployments using
deploy-rs
- Add Developer
shells
for Multiple Programming Languages integrated withlorri
- Use Calendar Versioning
- Use
nixConfig
- Support Auto-Upgrade
- Support Multiple Users per Device
- Improve Security and Harden System
- Use PipeWire (with low-latency) for audio
- Use
nixos-generators
for Image Generation
-
Use
nixConfig
-
Bifurcate
devices
- Refactor
lib.build.system
intobuild.iso
andbuild.device
- Refactor
-
Improve
lib
Handling -
Improve Module Imports
-
Improve and Bifurcate
docs
-
Handle
scripts
as packages -
Improve configuration
checks
-
Achieve
system
Independence -
Add
.editorconfig
andnanorc
-
Refactor
sops
Encrypted Secrets -
Stabilise and document
templates
-
Fix
devshells
,repl
andscripts
-
Fix Module Imports and
inputs
Patching -
Improve Mime Types Handling with
lib.xdg
-
Use
advanced
Ephemeral Root File System Layout with ZFS -
Use
flake-compat
,nix-gaming
andnix-wayland
-
Improve Code Consistency, reduce Complexity and fix Syntactic and Semantic Errors
- Use
pre-commit-hooks
to improve configurationchecks
- Use
nixfmt
for formatting code - Use
nix-linter
to check stylistic errors
- Use
- Upgrade to NixOS v21.11 (Porcupine)!
- Improve Package Declaration
- Add Support for Instant Nix REPL
- Add Support for patching
inputs
- Improve usage of Developer Shells
- Import Modules using
nixosModules
- Use
home-manager
as a Module - Merge Device and User Configuration
- Move all program configuration and dotfiles to
files
- Use
sops-nix
atsecrets
for managing authentication credentials - Automatically map
modules
,packages
,overlays
,shells
andinputs
- Add
docs
directory - Fix
.iso
Boot and Install Errors - Improve Scripts with error-checking
- Add
direnv
support atshells
- Add Support for Nix Developer Shells at
shells
- Use
secrets
as aninput
rather than as asubmodule
- Improve CI with automatic
flake.lock
update and dependency-checking - Bifurcate Flake
outputs
(asconfiguration.nix
),scripts
andoverlays
- Simplify Installation
- Add
install
Script - Add Support for creating Install Media
- Add overhauled
setup
Script - Automatically build
.iso
and publish release using CI
- Add
- Fix Home Activation
- Add BTRFS (opt-in state) Configuration
- Improve Ephemeral Root Support with impermanence
- Improve Installation Experience
- Improve Home Activation
- Bifurcate Modules and Roles
- Reduce CI Time
- Add the Office role
- Add Cachix Support
- Add Nix Shell Support
- Increase Readability
- Improve Package Management
- Under the hood CI changes
- Improve Secrets Management using Private Submodule at
secrets
- Overhaul Package Overrides
- Use
final: prev:
instead ofself: super:
- Add support for NUR
- Split System Scripts and import as overlay
- Refactor Package Overrides into
packages
- Use
- Add archived
dotfiles
and revitalize existing ones - Improve Modulated Imports
- Improve Fonts Management
- Update README and
scripts
- Added Support for Nix Flakes
- Added Custom Libraries for Device and User Management
- Created System Management Script
- Updated README and
install
Script - Add full support for Multi-Device Configuration
- Use Better Repository Management
- Added basic NixOS system configuration using GNOME and GTK+
- Added hardware support for 2 devices
- Added
setup
script - Added
home-manager
support and user dotfiles - Added Modulated Configuration
- Added Support for Nix User Repository
- Added Repository Pinning
- Added Essential Package Overlays
- Added Basic Password Management
- Added README
Known Limitations
- Home Configuration isn't be decoupled from System
Last Updated: February 2025
If you like this project, consider leaving a star