{"id":16345248,"url":"https://github.com/mirkolenz/nixos","last_synced_at":"2025-10-26T01:31:27.793Z","repository":{"id":153433115,"uuid":"610790221","full_name":"mirkolenz/nixos","owner":"mirkolenz","description":"Personal nix-based configuration for all my computers and servers","archived":false,"fork":false,"pushed_at":"2025-10-24T01:17:03.000Z","size":3500,"stargazers_count":19,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T03:27:29.739Z","etag":null,"topics":["dotfiles","flake","linux","macos","nix","nixos","nixos-configuration"],"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/mirkolenz.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-07T13:44:16.000Z","updated_at":"2025-10-24T01:17:07.000Z","dependencies_parsed_at":"2023-10-11T12:03:00.159Z","dependency_job_id":"e240658b-3095-45c1-88e6-af96deb0e5b2","html_url":"https://github.com/mirkolenz/nixos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mirkolenz/nixos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fnixos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fnixos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fnixos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fnixos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirkolenz","download_url":"https://codeload.github.com/mirkolenz/nixos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirkolenz%2Fnixos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281047804,"owners_count":26435124,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dotfiles","flake","linux","macos","nix","nixos","nixos-configuration"],"created_at":"2024-10-11T00:30:25.247Z","updated_at":"2025-10-26T01:31:27.787Z","avatar_url":"https://github.com/mirkolenz.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 --\u003e\n\n# NixOS Setup\n\nThis repo contains a custom wrapper to build NixOS/nix-darwin/home-manager:\n\n```shell\nnix run github:mirkolenz/nixos -- --help\n```\n\n## NixOS\n\n### Graphical Setup\n\n1. Install NixOS with provided ISO\n2. Create config: `nixos-generate-config`\n3. Migrate generated `/etc/nixos/configuration.nix` and `/etc/nixos/hardware-configuration.nix` to this flake manually\n4. Eventually install git in a temporary shell: `nix shell nixpkgs#git`\n\n```shell\n# Large changes (like first time)\nsudo nix run github:mirkolenz/nixos -- -o boot\n# Small changes\nsudo nix run github:mirkolenz/nixos\n```\n\n### Terminal Setup\n\n- \u003chttps://www.adaltas.com/en/2022/02/08/nixos-installation/\u003e\n- \u003chttps://wiki.nixos.org/wiki/NixOS_Installation_Guide\u003e\n- \u003chttps://gist.github.com/Vincibean/baf1b76ca5147449a1a479b5fcc9a222\u003e\n\n#### Partitioning using `parted`\n\n```shell\nparted -l # find device name, most likely /dev/sda\nwipefs -a /dev/sda\nparted /dev/sda\nmklabel gpt\nmkpart boot fat32 0% 512MiB\nset 1 esp on\nunit GiB print free\n# determine the swap size by substractting the amount of your ram from the free size\n# for instance, free size here is 238GiB and the ram of the system is 8GiB\nmkpart root ext4 512MiB 230GiB\nmkpart swap linux-swap 230GiB 100%\n```\n\n#### Partitioning using `fdisk`\n\nOne can also use the ncurses-based program `cfdisk`.\n\n```shell\n# Find out the device name, most likely /dev/sda\nfdisk -l # or lsblk\nwipefs -a /dev/sda\nfdisk /dev/sda\ng # empty gpt partition table\nn # new partition\n1 # partition number\n2048 # first sector, default\n+512M # last sector\nt # change partition type\n1 # partition number (if not already selected)\n1 # efi partition type\nn # new partition\n2 # partition number\n# first sector, default\n-16G # last sector, size of swap (about the size of your ram)\nn # new partition\n3 # partition number\n# first sector, default\n# last sector, default\nt # change partition type\n3 # partition number\n19 # linux swap\nv # verify\nw # write\n```\n\n#### Formatting\n\n```shell\nmkfs.fat -F 32 -n boot /dev/sda1\nmkfs.ext4 -L root /dev/sda2\nmkswap -L swap /dev/sda3\n```\n\n#### Mounting\n\n```shell\nmount /dev/disk/by-label/root /mnt\nswapon /dev/disk/by-label/swap\nmkdir -p /mnt/boot\nmount /dev/disk/by-label/boot /mnt/boot\n```\n\n#### Installation\n\nIf you get an error like `too many open files` during `nixos-install`, try one of the following options:\n\n- Execute `ulimit -n 65535` before installing to increase the number of open files for the current shell session\n- Use `--max-jobs 2` to limit the number of parallel jobs (could also try with 1 max job)\n\n```shell\nnixos-generate-config --root /mnt\ncd /mnt/etc/nixos/\n# Now verify that the hardware configuration of this flake is in sync with the generated `hardware-configuration.nix`\n# The machine name is required for the nixos-install command, even if hostname is updated\nnixos-install --flake github:mirkolenz/nixos#MACHINE_NAME\n# One could append --no-root-passwd to the command, but that may affect the ability to enter emergency mode\n```\n\nA warning about `/boot` being world-readable is not an issue, [the permissions are correctly set after a reboot](https://discourse.nixos.org/t/nixos-install-with-custom-flake-results-in-boot-being-world-accessible/34555).\n\n### Troubleshooting\n\nIf getting an error like `Getting status of /nix/store/...: No such file or directory`, try the following\n\n```shell\nnix-store --verify --check-contents --repair\n```\n\n### Tailscale\n\n- Create auth key: \u003chttps://login.tailscale.com/admin/settings/keys\u003e\n- SSH into the machine\n- Save the auth key to `./tsauth.txt`\n- Run `sudo tailscale up --auth-key file:tsauth.txt`\n- Run `tailscale status` to verify the connection\n- Remove the auth key file: `rm ./tsauth.txt`\n- Approve exit-node/routes: \u003chttps://login.tailscale.com/admin/machines\u003e\n\n## Mac Computers\n\n### Installation\n\n1. Install Apple Developer Tools: `xcode-select --install`\n2. [Install Homebrew](https://github.com/Homebrew/brew/releases/latest)\n3. [Install Nix](https://docs.determinate.systems)\n4. Sign into the App Store\n5. Enable Full Disk Access for terminal application\n\n```shell\nsudo nix run github:mirkolenz/nixos\nsudo reboot\n# Add ssh key to keychain\nssh-add --apple-use-keychain ~/.ssh/id_ed25519\n```\n\n### Uninstallation\n\n```shell\nchsh -s /bin/zsh\n# if nix is not in PATH, use this: /nix/var/nix/profiles/default/bin/nix\nsudo nix --extra-experimental-features \"nix-command flakes\" run github:mirkolenz/nixos#darwin-uninstaller\nsudo /nix/nix-installer uninstall\n```\n\n### Applications and Settings\n\n\u003cdetails\u003e\n\u003csummary\u003eShell\u003c/summary\u003e\n\n- Copy `$HOME/.local/share/fish/fish_history`\n- Copy `$HOME/.ssh/id_ed25519`\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\n\u003csummary\u003eZed\u003c/summary\u003e\n\n- Copy keymap/settings/tasks from `$HOME/.config/zed`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSystem Preferences\u003c/summary\u003e\n\n- `General \u003e About`: Set name\n- `Wallpaper`: Solid color (black)\n- `Appearance \u003e Allow wallpaper tinting in windows`: Off\n- `Keyboard \u003e Keyboard Shortcuts \u003e Modifier Keys`: Caps Lock -\u003e Option\n- `Keyboard \u003e Keyboard Shortcuts \u003e App Shortcuts`: Disable all\n- `Keyboard \u003e Keyboard Shortcuts \u003e Spotlight`: Disable all\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRaycast\u003c/summary\u003e\n\n- `Settings \u003e Advanced \u003e Import/Export` (also set up new schedule)\n- `Settings \u003e Account \u003e Login`\n- `Settings \u003e Extensions \u003e Scripts \u003e Plus`: iCloud Drive\n- `Launch \u003e Manage Fallback Command`: Add Kagi\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVisual Studio Code\u003c/summary\u003e\n\n- `Settings \u003e Backup and Sync Setting \u003e GitHub`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eZotero\u003c/summary\u003e\n\n- Install [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex/releases)\n- Install [Open PDF](https://github.com/retorquere/zotero-open-pdf/releases)\n- `Settings \u003e General \u003e Customize Filename Format \u003e {{ creators max=\"1\" case=\"hyphen\" }}-{{ year }}-{{ title truncate=\"50\" case=\"hyphen\" }}`\n- `Settings General \u003e Reader \u003e Tabs \u003e Creator - Title - Year`\n- `Settings \u003e Export \u003e Item Format \u003e Better BibTeX Citation Key Quick Copy`\n- `Settings \u003e Export \u003e Note Format \u003e Markdown + Rich Text`\n- `Settings \u003e Better BibTeX \u003e Citation Key Format \u003e auth.capitalize + year + shorttitle(3,3)`\n- `Settings \u003e Better BibTeX \u003e Citation Key Format \u003e Automatic Export \u003e Delay \u003e 10 seconds`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDefault Folder X\u003c/summary\u003e\n\n- `Settings \u003e Options \u003e Sync settings via iCloud`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eiA Presenter\u003c/summary\u003e\n\n- Move theme to `$HOME/Library/Containers/net.ia.presenter/Data/Library/Application Support/iA Presenter/Themes`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eArq Backup\u003c/summary\u003e\n\nAdditional wildcard exclude rules:\n\n```txt\n.cache\n.devenv\n.direnv\n.orbstack\n.venv\nnode_modules\n*/OrbStack\n*/Library/CloudStorage\n*/Library/Application Support/\n```\n\n\u003c/details\u003e\n\n## Home-Manger Standalone\n\n_Note:_ Reconnect via SSH after installing nix.\n\n```shell\nssh-copy-id -i \"$HOME/.ssh/id_ed25519.pub\" \"USER@MACHINE_NAME\"\nsudo /nix/var/nix/profiles/default/bin/nix upgrade-nix\nnix run github:mirkolenz/nixos\nsudo usermod -s $(which fish) \"$USER\"\n```\n\n## Utilities and Snippets\n\n### Nix Access Tokens\n\nTo avoid rate limiting, add a [GitHub access token](https://nix.dev/manual/nix/stable/command-ref/conf-file.html#conf-access-tokens).\nAdd the following to `/etc/nix/nix.secrets.conf`:\n\n```ini\naccess-tokens = github.com=github_pat_XXX\n```\n\n### Image Building\n\nIf building for another architecture on NixOS:\n[Enable cross compiling](https://github.com/nix-community/nixos-generators#cross-compiling)\n\n```shell\n# for iso installer disc\nnix build --system x86_64-linux github:mirkolenz/nixos#installers.unstable.iso-installer\n# for raspberry pi sd card\nnix build --system aarch64-linux github:mirkolenz/nixos#installers.raspi\n```\n\n### Update Raspberry Pi\n\n\u003chttps://nix.dev/tutorials/installing-nixos-on-a-raspberry-pi#updating-firmware\u003e\n\n```shell\nsudo mount /dev/disk/by-label/FIRMWARE /mnt\nsudo env BOOTFS=/mnt FIRMWARE_RELEASE_STATUS=default rpi-eeprom-update -d -a\nsudo reboot\n```\n\n### Use MakeMKV\n\n```shell\n# otherwise the optical drive is not found: https://discourse.nixos.org/t/makemkv-cant-find-my-usb-blu-ray-drive/23714\nsudo modprobe sg\n# if that does not work, try again with sudo\nNIXPKGS_ALLOW_UNFREE=1 nix run pkgs#makemkv --impure\n```\n\n### Investigate ID Mappings\n\n```shell\nsudo podman run --rm --subuidname=$USER ubuntu cat /proc/self/uid_map\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirkolenz%2Fnixos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirkolenz%2Fnixos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirkolenz%2Fnixos/lists"}