{"id":50472308,"url":"https://github.com/alexghr/nix","last_synced_at":"2026-06-01T11:03:06.342Z","repository":{"id":36954067,"uuid":"424878920","full_name":"alexghr/nix","owner":"alexghr","description":"My Nix configuration","archived":false,"fork":false,"pushed_at":"2026-05-01T08:36:25.000Z","size":751,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-01T10:25:42.721Z","etag":null,"topics":["home-manager","linux","nix","nix-darwin","nix-flake","nixos"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexghr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-11-05T08:36:18.000Z","updated_at":"2026-05-01T08:36:27.000Z","dependencies_parsed_at":"2026-03-01T10:17:45.248Z","dependency_job_id":null,"html_url":"https://github.com/alexghr/nix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexghr/nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexghr%2Fnix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexghr%2Fnix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexghr%2Fnix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexghr%2Fnix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexghr","download_url":"https://codeload.github.com/alexghr/nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexghr%2Fnix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33771630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"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":["home-manager","linux","nix","nix-darwin","nix-flake","nixos"],"created_at":"2026-06-01T11:03:06.263Z","updated_at":"2026-06-01T11:03:06.336Z","avatar_url":"https://github.com/alexghr.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nix configuration\n\nThis repo contains the Nix configuration for the various machines I use. I'm\nnew to Nix/NixOS and its ecosystem so a lot of the code you'll see here might\nnot be its best.\n\n## Flakes\n\nWhen I first started using NixOS I used the standard configuration at\n`/etc/nixos/configuration.nix`. This worked well for me while I was managing\nonly one machine. As I installed Nix on more and more machines I wanted a more\nelegant way to manage shared configuration. So I arrived at Flakes.\n\nThis repo is a mix of Flakes and non-Flakes configuration, but most of the\nhosts I use daily have been converted to Flakes.\n\nFor an intro to flakes I recommend the [original Tweag Flakes intro] on using\nNix Flakes to manage a NixOS system.\n\nFor other example configs on Github, have a look at this list I made\n[nix-configs].\n\n## Btrfs \u0026 backups\n\nIn before people get triggered, I use Btrfs on all of my machines (including\na raspi's SDCard). It's great 👌\n\nTo prevent sadness in case something goes wrong in the future I back up daily\nto Backblaze. See my custom [restic module] for that\n\n## Hosts\n\nThe [./hosts] directory contains the configuration files for my machines.\n\n- 🖥️ [vader] - Main NixOS install\n- 💻 [mackey] - A macbook running [nix-darwin] \u0026 [home-manager]\n- \u003cimg alt=\"raspi\" src=\"./.github/img/raspi.png\" style=\"height:1.5em;vertical-align:middle\"/\u003e [hk47] -\n  A Raspberry Pi 4B in my closet. Mainly runs the Unifi controller\n- 🖥️ [nix-1] - A Hetzner VPS. Runs k3s\n\n## System management\n\nMost of the time it boils down to this:\n\n- make a change in this repo (e.g. add a new package, add a new env var)\n- execute\n\n  ```shell\n  $ sudo nixos-rebuild switch --flake /path/to/git/repo\n  ```\n\n  alternatively, you can push the change to Github and run\n\n  ```shell\n  $ sudo nixos-rebuild switch --flake github:alexghr/nix\n  ```\n\n`nixos-rebuild` will default to apply the `nixosConfiguration` named after the\ncurrent system's hostname, so the above command is equivalent to\n\n```shell\n$ sudo nixos-rebuild switch --flake github:alexghr/nix#$(hostname)\n```\n\n## Todo\n\n- [x] remove stale hosts\n- [x] migrate other machines to Flakes\n- [x] setup CI (update flakes, push derivations to cachix, etc)\n\n[original Tweag Flakes intro]: https://www.tweag.io/blog/2020-07-31-nixos-flakes/\n[nix-configs]: https://github.com/stars/alexghr/lists/nix-configs\n[restic module]: ./modules/restic/default.nix\n[./hosts]: ./hosts\n[vader]: ./hosts/vader/configuration.nix\n[mackey]: ./hosts/mackey/darwin-configuration.nix\n[hk47]: ./hosts/hk47/configuration.nix\n[nix-1]: ./hosts/nix-1/configuration.nix\n[stormtrooper]: ./hosts/stormtrooper\n[wsltrooper]: ./hosts/wsltrooper\n[nixtrooper]: ./hosts/nixtrooper/etc/nixos/configuration.nix\n[nix-darmin]: https://github.com/LnL7/nix-darwin\n[home-manager]: https://github.com/nix-community/home-manager\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexghr%2Fnix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexghr%2Fnix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexghr%2Fnix/lists"}