{"id":20383063,"url":"https://github.com/headblockhead/nixos","last_synced_at":"2025-05-08T09:32:29.421Z","repository":{"id":65416495,"uuid":"534279616","full_name":"headblockhead/nixos","owner":"headblockhead","description":"NixOS and Home Manager config for all of my systems.","archived":false,"fork":false,"pushed_at":"2025-05-05T02:25:36.000Z","size":5674,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T03:26:55.442Z","etag":null,"topics":["configuration","dotfiles","nix","nixos"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/headblockhead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-08T15:38:57.000Z","updated_at":"2025-05-05T02:25:39.000Z","dependencies_parsed_at":"2023-10-01T12:46:31.569Z","dependency_job_id":"f915b545-cc23-44e2-ba5f-f909b29725e2","html_url":"https://github.com/headblockhead/nixos","commit_stats":null,"previous_names":["headblockhead/nixos-network"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headblockhead%2Fnixos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headblockhead%2Fnixos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headblockhead%2Fnixos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headblockhead%2Fnixos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/headblockhead","download_url":"https://codeload.github.com/headblockhead/nixos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253036711,"owners_count":21844266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","dotfiles","nix","nixos"],"created_at":"2024-11-15T02:20:09.927Z","updated_at":"2025-05-08T09:32:29.403Z","avatar_url":"https://github.com/headblockhead.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nixos\n\n![NixOS](https://img.shields.io/badge/NIXOS-5277C3.svg?logo=NixOS\u0026logoColor=white) [![xc compatible](https://xcfile.dev/badge.svg)](https://xcfile.dev) \n\nA continuously updated reproducable config for:\n- a desktop workstation\n- a mail+calendar+web+DNS server running in AWS ([edwardh](systems/edwardh))\n- a laptop (Lenovo Thinkpad)\n- a router (old DELL Optiplex machine) ([gateway](systems/gateway))\n- a Nix binary cache server running on a Raspberry Pi 5\n\nWhere **everything** about my systems is controlled by NixOS in plenty of detail, making for a perfectly-configured install *every time*, down to [the seconds on the clock](https://github.com/headblockhead/nixos/blob/dddba60346632e95b1840a7c95379396a8193fd1/modules/nixos/desktop.nix#L125)!\n\n## Table of Contents\n\n  * [Tour](#tour)\n  * [Desktop Screenshots](#desktop-screenshots)\n  * [Installation](#installation)\n  * [Troubleshooting](#troubleshooting)\n  * [Tasks](#tasks)\n\n## Tour\n\nHere is an overview of the most important files and folders in my config:\n\n  * [modules/nixos](modules/nixos) is the **most most important** folder, as it contains the core of my configuration (desktop environment/theming, ssh config, git config, zsh config, etc.) as parts that can be included and reused across systems.\n  * [systems](systems) contains the individual configurations for each of my systems, importing some of the modules, and adding some per-device extras.\n  * [flake.nix](flake.nix) defines the ssh keys used for login across all of my systems, along with the versions of nixpkgs to use, and the files to use for each machine's config.\n  * [custom-packages](custom-packages) contains modified versions of existing programs used by me.\n  * [neovim](neovim) contains lua-based neovim configuration, [modified from @a-h's config](https://github.com/a-h/dotfiles/tree/3037eb252c0aab44d420c52b61fb98f17c6923a0/.config/nvim/lua).\n\n## Desktop Screenshots\n\n![neofetch and web browser](screenshots/edward-desktop-01-01.png)\n![neovim and mouth dreams](screenshots/edward-desktop-01-02.png)\n![cube](screenshots/edward-desktop-01-03.png)\n\n## Installation\n\n### Boot from NixOS installation media\n\n\u003e [!TIP]\n\u003e Using the minimal installation media is recommended, as it is smaller and faster to download. However, you cannot use network manager (`nmtui`) to setup wireless networking with the minimal image.\n\n### Set up internet\n\n\u003e [!NOTE]\n\u003e If you already have a wired connection, you can skip this step.\n\n```bash\nsudo systemctl start wpa_supplicant\nsudo wpa_cli\n\u003e add_network\n\u003e set_network 0 ssid \"your_ssid_here\"\n\u003e set_network 0 psk \"your_password_here\"\n\u003e enable_network 0\n\u003e save_config\n\u003e quit\n```\n\n### Partition and format\n\n\u003e [!CAUTION]\n\u003e This deletes your data, check drive names carefully.\n\n```bash\ncfdisk /dev/drivename\n```\n\nNow, delete all partitions on the disk and create the new partitions:\n  - A 525M \"EFI System\" partition,\n  - a \"Linux Swap\" partition,\n  - and a generic \"Linux Filesystem\" partition to fill the rest of the disk.\n\nFirst, format the EFI System partition with FAT:\n\n```bash\nmkfs.fat -F 32 -n boot /dev/drivename1\n```\n\nThen, format the swap partition, giving it the label of 'swap':\n\n```bash\nmkswap -L swap /dev/drivename2\n```\n\nAnd finally, format the main Linux Filesystem partition with ext4, giving it the label of 'nixos':\n\n```bash\nmkfs.ext4 -L nixos /dev/drivename3\n```\n\nThese drive labels are used by the system config in [fileSystems.nix](modules/nixos/fileSystems.nix) to avoid hardcoding drive UUIDs.\n\n### Mount to edit.\n\nTo edit the contents of the disk, it needs to be mounted into a folder.\nFirst, mount the main Linux Filesystem:\n\n```bash\nmount /dev/whatever3 /mnt # Mount root filesystem\n```\n\nThen, mount the boot filesystem:\n\n```bash\nmkdir -p /mnt/boot\nmount /dev/whatever1 /mnt/boot # Mount boot partition\n```\n\nFinally, enable the swap:\n\n```bash\nswapon /dev/whatever2 # Use the swap partition\n```\n\n\n### First system install.\n\nGenerate example configuration as referance.\n```bash\nnixos-generate-config --root ./\n```\n\n\u003e [!NOTE]\n\u003e Copy unique parts of the autogenerated `hardware-configuration.nix` to the `hardware.nix` of the system to ensure compatibilty with hardware.\n\nDownload this repo. This is stored in a tmpfs, so it will be lost on reboot.\n```bash\nnix-shell -p git\ngit clone https://github.com/headblockhead/nixos.git\n```\n\n\u003e [!WARNING]\n\u003e Changes made to this copy of the nixos are not saved, so copy changes to the /mnt folder or other means of persistance to avoid pain later.\n\nBuild and install. Set a root password, it can be anything as we will disable direct root in a minute.\n```bash\ncd nixos\nnixos-install --root /mnt --flake .#HOSTNAME\nreboot\n```\n\n### Set password and lock root\n\nUse a TTY shell to login as root, then set the user password.\n\n```bash\npasswd headb\n```\n\nFinally, delete the password for the root user and lock the root account.\n\n```bash\nsudo passwd -dl root\nsudo usermod -L root\n```\n\n### Post-installation\n\n#### GNOME theme for Firefox\n\nsource: [firefox-gnome-theme](https://github.com/rafaelmardojai/firefox-gnome-theme)\n\n```bash\ncurl -s -o- https://raw.githubusercontent.com/rafaelmardojai/firefox-gnome-theme/master/scripts/install-by-curl.sh | bash\n```\n\n## Troubleshooting\n\n### Missing boot option\n\nTry [re-installing the bootloader from installation media](https://nixos.wiki/wiki/Bootloader#Re-installing_the_bootloader).\nOr move EFI files to generic locations for old BIOSes:\n```bash\nmv /boot/EFI/NixOS-boot /boot/EFI/boot\nmv /boot/EFI/boot/grubx64.efi /boot/EFI/boot/bootx64.efi\n```\n\n### No display output after GRUB\n\nTry adding `nomodeset` to the kernel parameters in GRUB.\n\n## Tasks\n\n### nixos\n\nSwitch to the new nixos configuration.\n\n```bash\nsudo nixos-rebuild switch --flake .# --accept-flake-config\n```\n\n### home-manager\n\nSwitch to the new home-manager configuration for the current user.\n\n```bash\nhome-manager switch --flake \".#$USER@`hostname`\" \n```\n\n### test-deploy\n\nDeploy the nixos configurations to all machines, without setting the boot-default.\n\n```bash\nnixos-rebuild test --target-host 172.16.1.1 --use-remote-sudo --flake .#gateway\nnixos-rebuild test --target-host 172.16.3.51 --use-remote-sudo --flake .#rpi5-01 --fast\nnixos-rebuild test --target-host 172.16.3.41 --use-remote-sudo --flake .#rpi4-01 --fast\nnixos-rebuild test --target-host 172.16.3.42 --use-remote-sudo --flake .#rpi4-02 --fast\nnixos-rebuild test --target-host edwardh.dev --use-remote-sudo --flake .#edwardh --fast\n```\n\n### rollout\n\nDeploy the nixos configurations to all machines, setting the boot-default.\n\n```bash\nnixos-rebuild switch --target-host 172.16.1.1 --use-remote-sudo --flake .#gateway\nnixos-rebuild switch --target-host 172.16.3.51 --use-remote-sudo --flake .#rpi5-01 --fast\nnixos-rebuild switch --target-host 172.16.3.41 --use-remote-sudo --flake .#rpi4-01 --fast\nnixos-rebuild switch --target-host 172.16.3.42 --use-remote-sudo --flake .#rpi4-02 --fast\nnixos-rebuild switch --target-host edwardh.dev --use-remote-sudo --flake .#edwardh --fast\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheadblockhead%2Fnixos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheadblockhead%2Fnixos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheadblockhead%2Fnixos/lists"}