{"id":21214427,"url":"https://github.com/slice/nixfiles","last_synced_at":"2025-08-25T02:14:07.828Z","repository":{"id":83250362,"uuid":"420395366","full_name":"slice/nixfiles","owner":"slice","description":"skip's machines","archived":false,"fork":false,"pushed_at":"2025-07-03T21:42:19.000Z","size":574,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T22:28:32.087Z","etag":null,"topics":["nix","nix-darwin"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/slice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-10-23T11:38:07.000Z","updated_at":"2025-07-03T21:42:22.000Z","dependencies_parsed_at":"2023-12-18T08:31:37.579Z","dependency_job_id":"76864ea1-ed2e-40d7-ae7a-9f0ac3f366da","html_url":"https://github.com/slice/nixfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/slice/nixfiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice%2Fnixfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice%2Fnixfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice%2Fnixfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice%2Fnixfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slice","download_url":"https://codeload.github.com/slice/nixfiles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice%2Fnixfiles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264565657,"owners_count":23629016,"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":["nix","nix-darwin"],"created_at":"2024-11-20T21:27:50.113Z","updated_at":"2025-07-10T10:30:25.020Z","avatar_url":"https://github.com/slice.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `nixfiles`\n\n[Nix] code that is responsible for managing the configuration and environment of\nmy personal machines.\n\nMostly documented for my own sake. I am trapped in a prison of my own design.\n\n[nix]: https://nixos.org\n[home-manager]: https://github.com/nix-community/home-manager\n[nix-darwin]: https://github.com/LnL7/nix-darwin\n\n## Bringup\n\n\u003c!-- prettier-ignore --\u003e\n\u003e [!WARNING]\n\u003e This procedure has only been tested on Macs with Apple silicon.\n\n\u003c!-- prettier-ignore --\u003e\n\u003e [!IMPORTANT]\n\u003e [nix-darwin] configurations will only work if your hostname matches a\n\u003e corresponding configuration in [`flake.nix`](./flake.nix).\n\n1. [Install Nix](https://nixos.org/download/):\n\n   ```\n   sh \u003c(curl -L https://nixos.org/nix/install)\n   ```\n\n   The installer will describe what it intends to do before prompting you to\n   continue. However, in general, it:\n\n   - Creates a new APFS volume for the Nix store.\n   - Creates and registers Launch Daemons that mount the volume and spawn the\n     Nix daemon.\n   - Downloads and unpacks Nix.\n   - Creates Nix build users and groups.\n   - Writes the necessary shell profiles to make Nix usable.\n\n1. Clone this repository to `~/src/prj/nixfiles`. (As you might guess, this path\n   is _also_ hardcoded. For now. Maybe.)\n\n1. Pop open a fresh shell so the computer knows where `nix` lives. Then,\n   bootstrap [Home Manager][home-manager] and [nix-darwin]:\n\n   ```\n   nix run home-manager/master -- switch --flake ~/src/prj/nixfiles\n   nix run nix-darwin -- switch --flake ~/src/prj/nixfiles\n   ```\n\n   You will likely have to mess with some files in `/etc` to let nix-darwin\n   manage the environment.\n\n1. Change your shell:\n\n   ```\n   sudo chsh -s ~/.nix-profile/bin/fish $USER\n   ```\n\n1. If you set up nix-darwin, then you probably have\n   [two Nix installations](https://github.com/LnL7/nix-darwin/issues/931) now,\n   which needs to be somehow fixed.\n\n   (Nix is required to bootstrap nix-darwin, but nix-darwin essentially acts as\n   a Nix installation in and of itself by managing a Nix daemon for you.\n   Furthermore, a nix-darwin module is used to version-manage Nix, which will\n   conflict with the Nix binary that was previously used to bootstrap this\n   entire setup.)\n\n   - Use `nix doctor` to verify that you don't have conflicting `nix` binaries\n     in your `PATH`.\n   - Use `launchctl` to ensure that you only have a single Nix daemon (e.g.\n     `launchctl print system`, `launchctl disable system/…`, etc.)\n\n1. All done.\n\n## Usage\n\nThis repository is a [flake] mostly because it makes pinning dependencies\neasier. However, `flake.nix` doesn't do much; in fact, it can largely be boiled\ndown to:\n\n[flake]: https://nixos.wiki/wiki/Flakes\n\n```nix\noutputs = inputs: {\n  packages.aarch64-darwin.homeConfigurations.skip = import ./home/bootstrap.nix {\n    inherit inputs;\n    system = \"aarch64-darwin\";\n    username = \"skip\";\n  };\n\n  packages.x86_64-linux.homeConfigurations.skip = import ./home/bootstrap.nix {\n    inherit inputs;\n    system = \"x86_64-linux\";\n    username = \"skip\";\n  };\n\n  # ... etc. ...\n};\n```\n\nTo instantiate the `homeManagerConfiguration` outside of a flake context,\n[`home/bootstrap.nix`](./home/bootstrap.nix) can be used like so:\n\n```nix\nimport \"${\u003cnixfiles\u003e}/home/bootstrap.nix\" {\n  system = \"aarch64-darwin\";\n  inputs = {\n    inherit nixpkgs home-manager; # etc.\n  };\n  server = \"infer\"; # all Macs are workstations\n};\n```\n\nCheck out that file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslice%2Fnixfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslice%2Fnixfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslice%2Fnixfiles/lists"}