{"id":20807558,"url":"https://github.com/clo4/nix-dotfiles","last_synced_at":"2025-05-07T05:42:10.109Z","repository":{"id":185843630,"uuid":"674095534","full_name":"clo4/nix-dotfiles","owner":"clo4","description":"Manages my nix-darwin Mac, standalone Home Manager Mac, and NixOS home server. Public domain, unless noted otherwise.","archived":false,"fork":false,"pushed_at":"2025-04-28T13:23:33.000Z","size":505,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T14:30:28.290Z","etag":null,"topics":["dotfiles","nix-darwin","nix-flake","nixos-configuration"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clo4.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}},"created_at":"2023-08-03T06:12:38.000Z","updated_at":"2025-04-28T13:23:36.000Z","dependencies_parsed_at":"2023-09-29T03:40:53.117Z","dependency_job_id":"7c99ee62-a637-4a9b-baa9-cb6e4237253e","html_url":"https://github.com/clo4/nix-dotfiles","commit_stats":null,"previous_names":["clo4/nix-config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fnix-dotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fnix-dotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fnix-dotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fnix-dotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clo4","download_url":"https://codeload.github.com/clo4/nix-dotfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823665,"owners_count":21809707,"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":["dotfiles","nix-darwin","nix-flake","nixos-configuration"],"created_at":"2024-11-17T19:38:38.431Z","updated_at":"2025-05-07T05:42:10.100Z","avatar_url":"https://github.com/clo4.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clo4's configuration\n\nThis is my dead-simple configuration. Maybe something to take inspiration from\nif you're getting stuck configuring your own Nix flake setup! I currently\nactively maintain my nix-darwin and standalone Home Manager configurations, but\nsupporting NixOS or WSL would be as simple as adding another entry to `hosts`.\n\nTraditional Nix system configuration requires a rebuild to apply, but I found\nthat this was slowing me down and disincentivising me from changing things on my\nsystem. This time around, everything about the way my config is structured is to\nallow me to iterate raplidly:\n\n- Home Manager symlinks my config to the right location. This results in the\n  normal instant feedback loop of editing your dotfiles, but with the certainty\n  that you can reapply it at any point exactly the same way it is now.\n- The flake uses [Blueprint](https://github.com/numtide/blueprint), which gets\n  rid of all the glue code I would otherwise need. Creating hosts is as simple\n  as creating a directory in `hosts`, or making a package, creating a file in\n  `packages`.\n\nProgram configuration is all stored in [config](/config).\n\nMy shared Home Manager config applies this configuration:\n[users/robert/home-configuration.nix](/users/robert/home-configuration.nix)\n\nThis configuration is applied per-host with tweaks on top of it: [hosts](/hosts)\n\n## Custom stuff\n\nI keep finding yaks to shave.\n\n- Fish is my interactive shell, but all _initial_ environment setup is delegated\n  to ZSH. This means the login shell is always guaranteed to be POSIX-enough to\n  work, but I still get to benefit from using the _best_ shell. I'm particularly\n  proud that the `$PATH` works flawlessly on my Darwin systems, which has been a\n  known issue with Fish + Nix.\n- I implemented a Fish plugin manager in Nix for declarative plugins with\n  imperative configuration. Plugins don't clutter up my config, nor can they\n  accidentally clobber any files. Updates are done by updating the Nix plugin\n  package definitions.\n- This config uses\n  [mattwparas' fork of Helix](https://github.com/mattwparas/helix/tree/steel-event-system)\n  with support for plugins, though I haven't set up or written any plugins yet.\n  I had to fork it to get the Steel language server integration working. A build\n  that uses this version and has working a working scheme language server for\n  building plugins is available by running\n  `nix run github:clo4/nix-dotfiles#helix`.\n- Homebrew is installed automatically and managed declaratively with\n  [nix-homebrew](https://github.com/zhaofengli/nix-homebrew)\n- Since fish is the best language for shell scripting, I wrote a custom command\n  runner for fish functions. It replaces tools like `just` and common abuse of\n  `make`. You just write fish functions in `run.fish`, then run them with `run`.\n  This is also usable as `nix run github:clo4/nix-dotfiles#run`.\n- My server hosts a Minecraft server using `virtualisation.oci-containers` with\n  podman. The container is launched as root, but switched to a system\n  user/group. Its data is stored in `/srv/minecraft/family`. It restarts every\n  day at 4 am local-time. It has a DDNS client. I think this may be the best\n  reference configuration for setting up a Minecraft server on NixOS.\n- I built a simple DDNS client for Cloudflare to keep my DNS record up to date\n  with my home internet's IP address. It's a simple Go program, it compiles\n  quickly, it caches IP to minimise useless updates. The credentials are stored\n  encrypted with Agenix. It's been moved into its own repository:\n  [clo4/clouddns](https://github.com/clo4/clouddns)\n\nMore of my custom things will be documented in the future.\n\n## Hosts\n\n- `macmini`\n  - This is my main dev machine. Most configuration will be up-to-date for it.\n    It's a nix-darwin system that also configures my user using Home Manager.\n- `macbook-air`\n  - This is my secondary computer. It's owned by my partner, so I haven't\n    installed nix-darwin. Instead, this is a standalone configuration.\n- `homeserver1`\n  - This is my personal server. It's a Minisforum NAB6 Lite running an Intel\n    Core i5 12600, so it uses \u003c9w at idle.\n  - Hopefully not the first of many, but knowing me, it's best to start adding\n    versioning to the names.\n\n### Building and switching\n\nAs a way to make sure I always get the commands right, there's a command runner\nincluded in the developer environment named `run`. Run `run` with no arguments\nto print the available commands.\n\nSwitching `macmini` and `macbook-air` will attempt to switch the currently\nactive device, but switching `homeserver1` will cause the server to rebuild and\nswitch remotely, allowing the command to be run from whatever device is being\nused without an SSH connection. The only requirement is that Tailscale is up and\nconnected.\n\n`run` can be used from any shell, but is intended for use within Fish.\n\n### Bootstrapping homeserver1\n\nThis isn't included in `run.fish` because it has to be executed from the system\nitself or over SSH.\n\n```bash\nsudo nix --extra-experimental-features 'nix-command flakes' run github:clo4/nix-dotfiles/vps#homeserver1-install\n```\n\n## Personal notes\n\n### Moving configuration directories\n\nTo migrate from one directory to another, create an exact copy of the\nconfiguration in the new destination **without removing the existing\nconfiguration.** Once created, edit the new configuration, changing\n`my.config.directory` to whatever the new path is. Now you can reapply the\nconfiguration from the new directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclo4%2Fnix-dotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclo4%2Fnix-dotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclo4%2Fnix-dotfiles/lists"}