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 Obsidian
Older...
|  |
| :------------------------------------------------------: |
| _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-nix module and gnupg keys
- Comprehensive User Configuration using the
home-manager module
- Support for NixOS on WSL with shared CLI configuration
- Ephemeral, opt-in filesystem state using the
impermanence module and ZFS
- Declarative disk partitioning and installation using
disko
- Support for Secure Boot using
lanzaboote
- Multiple development
shells integrated with direnv and lorri
- Automatic
packages updates using update.sh
- Syntax formatting using
treefmt
- Support for
source filters with nix-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
Structure
Overview of File Hierarchy
Outputs
$ nix flake show
github:maydayv7/dotfiles
├───apps
│ └───x86_64-linux
│ ├───hyprutils: app
│ ├───install: app
│ └───os: app
├───checks
│ └───x86_64-linux
│ ├───configurations:nixos:install: derivation
│ ├───configurations:nixos:futura: derivation
│ ├───configurations:nixos:valkyrie: derivation
│ ├───configurations:nixos:vortex: derivation
│ ├───configurations:nixos:wsl: 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
│ └───v7@wsl: 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
│ └───wsl: NixOS configuration
├───overlays
├───packages
│ └───x86_64-linux
│ ├───install: package 'os-install'
│ ├───os: package 'os'
│ └───website: package 'website-stable'
├───patchedPkgs: patched package source
└───templates
└───default: template: My NixOS Configuration
┌── flake.nix
├── flake.lock
├── files
├── site
├── secrets
│ └── passwords
├── shells
├── scripts
│ ├── install.nix
│ └── os.nix
├── packages
│ ├── overlays
│ └── patches
└── modules
├── core
├── lib
├── hosts
├── users
├── apps
├── desktop
├── games
├── gui
├── hardware
├── shell
├── system
└── virt
-
flake.nix: toplevel configuration file and repository version control
flake-parts is used for modularization, following the dendritic pattern
-
files: dotfiles and program configuration
site: personal website generated using zola
secrets: authentication credentials and user passwords managed using sops-nix
shells: sand-boxed shells for development purposes
scripts: useful system management scripts
packages: locally built custom packages
overlays: overrides for pre-built packages
modules: custom configuration modules for additional functionality
lib: custom functions designed for conveniently defining configuration
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.pgp` and `private.pgp` in a secure location_
4. Import all required GPG Keys into a convenient location (like `/etc/gpg`) using gpg --homedir DIR --import KEY_FILE 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 successful run listed [here](https://github.com/maydayv7/dotfiles/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/).
The image supports both UEFI and legacy BIOS USB boot with Secure Boot disabled.
> [!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
#### Partition Scheme
> [!WARNING]
> The `install` script **erases the entire target disk** and creates the layout below automatically.
| Partition | Label | Format | Size |
| :--------- | :----: | :-------------------------------------------- | :------------------------------ |
| EFI System | ESP | `vfat` | 1 GiB |
| SWAP Area | swap | `swap` | `system.fs.swap` (8GiB default) |
| System | System | `ext4` (`simple`) / ZFS `fspool` (`advanced`) | Remaining space |
> [!NOTE]
> The layout is derived from the device's `system.fs.scheme`.
> The `advanced` scheme additionally creates the encrypted `fspool` datasets - `system/root` (opt-in state), `system/nix`, `data` and `reserve`
#### Procedure
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 `os 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.
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.
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.
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 to evaluate configurations, update inputs and custom packages, 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
If you like this project, consider leaving a star
1<picture>
2 <source media="(prefers-color-scheme: light)" srcset="./files/images/banner-light.png"/>
3 <source media="(prefers-color-scheme: dark)" srcset="./files/images/banner-dark.png"/>
4 <img alt="Banner" src="./files/images/banner-dark.png">
5</picture>
6
7[](https://nixos.org)
8<picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/github/license/maydayv7/dotfiles.svg?variant=ghost&size=sm&mode=dark&font=jetbrains-mono">
9<img alt="License" src="https://www.shieldcn.dev/github/license/maydayv7/dotfiles.svg?variant=ghost&size=sm&mode=light&font=jetbrains-mono">
10</picture>
11<picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/github/last-commit/maydayv7/dotfiles.svg?variant=secondary&size=sm&mode=dark&font=jetbrains-mono">
12<img alt="Last commit" src="https://www.shieldcn.dev/github/last-commit/maydayv7/dotfiles.svg?variant=secondary&size=sm&mode=light&font=jetbrains-mono">
13</picture>
14
15This directory contains the configuration and `dotfiles` for my continuously evolving multi-PC setup (using [Nix](https://nixos.org/)).
16All the devices I own, controlled by code.
17It also builds and deploys my website to [maydayv7.dev](https://maydayv7.dev).
18
19<details>
20<summary><b>Pictures</b></summary>
21
22**_Note:_** These may be outdated
23
24|  |
25| :----------------------------------------------: |
26| _Hyprland_ |
27
28|  |
29| :------------------------------------------------: |
30| _GNOME Desktop_ |
31
32| Windows |
33| :--------------------------------------------: |
34|  |
35| |
36
37<details>
38<summary>Theming</summary>
39
40- [Starship](https://starship.rs/) Prompt Theme: Minimal, blazing-fast, and infinitely customizable prompt for any shell
41- [Bibata Cursor](https://github.com/ful1e5/Bibata_Cursor): Compact and material designed cursor set
42- [Papirus Icon Theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme): Pixel perfect icon theme for Linux
43- [Catppuccin](https://github.com/catppuccin) Theme: A community-driven Pastel Theme consisting of 4 soothing warm Flavors with 26 eye-candy Colors each
44
45- [Adwaita GTK3](https://github.com/lassekongo83/adw-gtk3): Theme from `libadwaita` ported to GTK3
46- [KvLibadwaita](https://github.com/GabePoel/KvLibadwaita) Kvantum Theme: Integrates QT Apps with GNOME Desktop
47- Firefox [GNOME Theme](https://github.com/rafaelmardojai/firefox-gnome-theme): GNOME Theme for the Mozilla Firefox Browser
48- VS Code [Adwaita Theme](https://github.com/piousdeer/vscode-adwaita): Integrates Visual Studio Code with GNOME Desktop
49- Discord [GNOME Theme](https://github.com/ricewind012/discord-gnome-theme): A GNOME theme for Discord, following the Adwaita style & GNOME HIG
50- Obsidian [Adwaita Theme](https://github.com/birneee/obsidian-adwaita-theme): A GNOME Adwaita theme for Obsidian
51
52</details>
53
54<details>
55<summary><i>Older...</i></summary>
56
57|  |
58| :------------------------------------------------------: |
59| _Pantheon Desktop_ |
60
61| [](https://www.reddit.com/r/unixporn/comments/19efxry/xfce_functional_and_beautiful/) |
62| :-----------------------------------------------------------------------------------------------------------------------------------: |
63| _XFCE Desktop_ |
64
65|  |
66| :--------------------------------------------------: |
67| _GNOME 45_ |
68
69|  |
70| :--------------------------------------------------: |
71| _GNOME 44_ |
72
73| [](https://www.reddit.com/r/unixporn/comments/ssb7mf/gnome_my_dream/) |
74| :-----------------------------------------------------------------------------------------------------------------------: |
75| _GNOME 41_ |
76
77</details>
78
79</details>
80
81## Features
82
83<img alt="Built with Nix" src="https://raw.githubusercontent.com/nix-community/builtwithnix.org/62897617ceefe428f135e82c3a87ea093e29e045/img/built_with_nix.svg" width="130" height="50"/>
84
85- Device-Agnostic
86- Convenient and Automated
87- Hermetically Reproducible
88- Declarative and Derivational
89- Atomic, Generational and Immutable
90
91#### Notable Features
92
93- Supports multiple users and devices
94- Configuration for multiple DEs and Compositors
95- Incorporates PipeWire, Wayland, ...!
96- Automatically builds and deploys my [Website](./site)
97- Credentials management using the [`sops-nix`](https://github.com/Mic92/sops-nix) module and [`gnupg`](https://gnupg.org/) keys
98- Comprehensive User Configuration using the [`home-manager`](https://github.com/nix-community/home-manager) module
99- Support for [NixOS on WSL](./modules/hosts/wsl) with shared CLI configuration
100- Ephemeral, opt-in filesystem state using the [`impermanence`](https://github.com/nix-community/impermanence) module and [ZFS](https://zfsonlinux.org/)
101- Declarative disk partitioning and installation using [`disko`](https://github.com/nix-community/disko)
102- Support for Secure Boot using [`lanzaboote`](https://github.com/nix-community/lanzaboote)
103- Multiple development [`shells`](./shells) integrated with [`direnv`](https://direnv.net/) and [`lorri`](https://github.com/nix-community/lorri)
104- Automatic `packages` updates using [`update.sh`](./packages/update.sh)
105- Syntax [formatting](./modules/core/checks.nix) using [`treefmt`](https://github.com/numtide/treefmt)
106- Support for `source` filters with [`nix-filter`](https://github.com/numtide/nix-filter)
107- Support for Base16 color theming using [`stylix`](https://github.com/danth/stylix)
108- Support for declaratively installing [Flatpak](./modules/apps/flatpak.nix) applications using [`nix-flatpak`](https://github.com/gmodena/nix-flatpak)
109- Support for Android Virtualisation using [Waydroid](https://waydro.id/)
110- Support for VFIO PCI Device Passthrough with a declarative, performant Windows VM using [NixVirt](https://github.com/AshleyYakeley/NixVirt) and [Looking Glass](https://looking-glass.io/) (see my [blog post](https://maydayv7.dev/blog/nixos/win11vm))
111
112## Programs
113
114| Type | Programs |
115| :------- | :--------------------------------------------------------------------------------------------------------------------------: |
116| Editors | [`nano`](https://www.nano-editor.org/), [`micro`](https://micro-editor.github.io), [VS Code](https://code.visualstudio.com/) |
117| Shells | [`bash`](https://www.gnu.org/software/bash/), [`zsh`](https://www.zsh.org) |
118| Terminal | [Ghostty](https://ghostty.org/), [Kitty](https://sw.kovidgoyal.net/kitty/) |
119| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/) |
120| Desktops | [GNOME](https://www.gnome.org), [Hyprland](https://hypr.land/), [Niri](https://github.com/YaLTeR/niri) |
121
122## Structure
123
124**_Overview of File Hierarchy_**
125
126<details>
127<summary><b>Outputs</b></summary>
128
129```shellsession
130$ nix flake show
131github:maydayv7/dotfiles
132├───apps
133│ └───x86_64-linux
134│ ├───hyprutils: app
135│ ├───install: app
136│ └───os: app
137├───checks
138│ └───x86_64-linux
139│ ├───configurations:nixos:install: derivation
140│ ├───configurations:nixos:futura: derivation
141│ ├───configurations:nixos:valkyrie: derivation
142│ ├───configurations:nixos:vortex: derivation
143│ ├───configurations:nixos:wsl: derivation
144│ └───treefmt: derivation 'treefmt-check'
145├───devShells
146│ └───x86_64-linux
147│ ├───cc: development environment 'C'
148│ ├───android: development environment 'Android'
149│ ├───default: development environment 'devShell'
150│ ├───format: development environment 'nix-shell'
151│ ├───java: development environment 'Java'
152│ ├───js: development environment 'JavaScript'
153│ ├───lua: development environment 'Lua'
154│ ├───python: development environment 'Python'
155│ ├───rust: development environment 'Rust'
156│ ├───sql: development environment 'SQL'
157│ ├───video: development environment 'Video'
158│ └───website: development environment 'Website'
159├───files: 'dotfiles' and program configuration
160├───formatter
161│ └───x86_64-linux: package 'treefmt'
162├───homeConfigurations
163│ ├───navya@futura: Home Manager configuration
164│ ├───v7@valkyrie: Home Manager configuration
165│ ├───v7@vortex: Home Manager configuration
166│ └───v7@wsl: Home Manager configuration
167├───legacyPackages
168│ └───x86_64-linux (Default package channel)
169├───modules: dendritic configuration modules
170├───nixosConfigurations
171│ ├───futura: NixOS configuration
172│ ├───install: NixOS configuration
173│ ├───valkyrie: NixOS configuration
174│ ├───vortex: NixOS configuration
175│ └───wsl: NixOS configuration
176├───overlays
177├───packages
178│ └───x86_64-linux
179│ ├───install: package 'os-install'
180│ ├───os: package 'os'
181│ └───website: package 'website-stable'
182├───patchedPkgs: patched package source
183└───templates
184 └───default: template: My NixOS Configuration
185```
186
187</details>
188
189```
190┌── flake.nix
191├── flake.lock
192├── files
193├── site
194├── secrets
195│ └── passwords
196├── shells
197├── scripts
198│ ├── install.nix
199│ └── os.nix
200├── packages
201│ ├── overlays
202│ └── patches
203└── modules
204 ├── core
205 ├── lib
206 ├── hosts
207 ├── users
208 ├── apps
209 ├── desktop
210 ├── games
211 ├── gui
212 ├── hardware
213 ├── shell
214 ├── system
215 └── virt
216```
217
218- `flake.nix`: toplevel configuration file and repository version control
219 [`flake-parts`](https://github.com/hercules-ci/flake-parts) is used for modularization, following the [dendritic](https://github.com/mightyiam/dendritic) pattern
220
221- [`files`](./files/README.md): `dotfiles` and program configuration
222- [`site`](./site/README.md): personal website generated using [`zola`](https://www.getzola.org/)
223- [`secrets`](./secrets/README.md): authentication credentials and user passwords managed using [`sops-nix`](https://github.com/Mic92/sops-nix)
224- [`shells`](./shells): sand-boxed shells for development purposes
225- [`scripts`](./scripts/README.md): useful system management scripts
226- [`packages`](./packages/README.md): locally built custom packages
227- [`overlays`](./packages/overlays): overrides for pre-built packages
228- [`modules`](./modules/README.md): custom configuration modules for additional functionality
229- [`lib`](./modules/lib/README.md): custom functions designed for conveniently defining configuration
230
231## Installation
232
233<details>
234<summary><b>Already Installed</b></summary>
235
236To use my configuration as-is for a fresh NixOS installation, you can try the following steps:
237
238**_Note:_** Run `nix develop` in the repository to install all required dependencies
239
2401. Prepare `/etc/nixos`:
241 <pre><code>sudo mkdir /etc/nixos
242 sudo chown $USER /etc/nixos && sudo chmod ugo+rw /etc/nixos
243 cd /etc/nixos
244 </code></pre>
245
2462. Clone this repository (and preferably initialize it using `git`):
247 <pre><code>nix flake init -t github:maydayv7/dotfiles
248 git init
249 </code></pre>
250
2513. 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):
252 _Replace_ **_USER_** _,_ **_EMAIL_** _and_ **_COMMENT_**
253 <pre><code>gpg --full-generate-key
254 1
255 4096
256 0
257 y
258 <b><i>USER
259 EMAIL
260 COMMENT</i></b>
261 O
262 gpg --output public.pgp --armor --export <b><i>USER</i></b>@<b><i>EMAIL</i></b>
263 gpg --output private.pgp --armor --export-secret-key <b><i>USER</i></b>@<b><i>EMAIL</i></b>
264 </code></pre>
265
266 _Save the keys `public.pgp` and `private.pgp` in a secure location_
267
2684. Import all required GPG Keys into a convenient location (like `/etc/gpg`) using <code>gpg --homedir <i>DIR</i> --import <i>KEY_FILE</i></code> and specify it at `config.sops.gnupg.home` (Required for decryption of `secrets` on boot, can also be on an external drive)
269
2705. 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):
271 _Replace_ **_PATH_** _with the path to the `secret`_
272 <pre><code>sops --config <i>/path/to/<b>secrets.yaml</b></i> -i <b><i>PATH</i></b></code></pre>
273
2746. 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.
275
2767. Finally, run `nixos-rebuild switch --flake /etc/nixos#HOSTNAME` (as `root`) to switch to the configuration!
277
278</details>
279
280<details>
281<summary><b>From Scratch</b></summary>
282
283> [!IMPORTANT]
284> These instructions are mainly intended for personal use
285
286To download the Install Media, click on the latest successful run listed [here](https://github.com/maydayv7/dotfiles/actions/workflows/install.yml) and download the image artifact.
287Burn it to a USB using a flashing utility such as [Etcher](https://www.balena.io/etcher/).
288The image supports both UEFI and legacy BIOS USB boot with Secure Boot disabled.
289
290> [!TIP]
291> 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
292
293<details>
294<summary><i>Build</i></summary>
295If Nix is already installed on your system, you may run the following command to build the Install Media image:
296
297<pre><code>nix build github:maydayv7/dotfiles#nixosConfigurations.install.config.system.build.images.iso</code></pre>
298
299To build and run the `install` script, use the following commands:
300
301```
302nix build github:maydayv7/dotfiles#install
303sudo ./result/bin/os-install
304```
305
306If you want to create an `.iso` image of the entire system, run the following command:
307_Replace_ **_DEVICE_** _with the name of Device to build_
308
309<pre><code>nix build github:maydayv7/dotfiles#nixosConfigurations.<b><i>DEVICE</i></b>.config.system.build.images.iso</code></pre>
310
311</details>
312
313#### Partition Scheme
314
315> [!WARNING]
316> The `install` script **erases the entire target disk** and creates the layout below automatically.
317
318| Partition | Label | Format | Size |
319| :--------- | :----: | :-------------------------------------------- | :------------------------------ |
320| EFI System | ESP | `vfat` | 1 GiB |
321| SWAP Area | swap | `swap` | `system.fs.swap` (8GiB default) |
322| System | System | `ext4` (`simple`) / ZFS `fspool` (`advanced`) | Remaining space |
323
324> [!NOTE]
325> The layout is derived from the device's `system.fs.scheme`.
326> The `advanced` scheme additionally creates the encrypted `fspool` datasets - `system/root` (opt-in state), `system/nix`, `data` and `reserve`
327
328#### Procedure
329
330To install the OS, just boot the Live USB and run `sudo os-install`
331_If the image doesn't boot, try disabling the `secure boot` and `RAID` options from `BIOS`_
332After the reboot, run `os setup` to finish the install
333_In case you are using the `advanced` filesystem scheme, you may need to set the boot flag `zfs_force=1` on first boot_
334
335</details>
336
337<details>
338<summary><b>Build It Yourself</b></summary>
339
340If 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.
341Follow along with my [NixOS Desktop](https://maydayv7.dev/series/nixos-desktop/) Series
342
343**Welcome** to the Nix Community! ;)
344
345</details>
346
347## Notes
348
349### Caution
350
351This repository contains my personal configuration, and may cause undesirable effects on other systems.
352It may also be subject to rapid undocumented changes, and uses Nix [Flakes](https://wiki.nixos.org/wiki/Flakes), an experimental feature.
353
354> [!NOTE]
355> Required Nix Version >= 2.19
356
357It 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.
358
359### Platform
360
361_May change according to available hardware_
362
363This 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.
364
365See [this](./modules/hardware/README.md) for additional information
366
367### Cache
368
369The system build cache is publicly hosted using [Cachix](https://www.cachix.org) at [maydayv7-dotfiles](https://app.cachix.org/cache/maydayv7-dotfiles), and can be used while building the system to prevent rebuilding from scratch
370
371### Continuous Integration
372
373This repository makes use of [`GitHub Actions`](./.github/workflows) to evaluate configurations, update `inputs` and custom packages, build the Install Media `.iso` every month, and upload the build cache to [Cachix](https://app.cachix.org/cache/maydayv7-dotfiles).
374A `git` [hook](./files/git/hooks) is used to check the commit message to adhere to the [`Conventional Commits`](https://www.conventionalcommits.org) specification
375
376##### Variables
377
378- [`GITHUB_TOKEN`](./secrets/github-token.secret): Personal Access Token
379 (To create one, see [this](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token))
380- [`CACHIX_TOKEN`](./secrets/cachix-token.secret): Cachix Authentication Token
381
382---
383
384If you like this project, consider leaving a [star](https://github.com/maydayv7/dotfiles)