Generate flake.nix from module options. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ dendrix.oeiuwq.com/Dendritic.html
dendritic nix inputs

tangled

+20 -18
-1
.github/FUNDING.yml
··· 1 1 # These are supported funding model platforms 2 - 3 2 github: [vic] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 3 patreon: # Replace with a single Patreon username 5 4 open_collective: # Replace with a single Open Collective username
-11
.github/workflows/tangled.yaml
··· 1 - on: 2 - workflow_dispatch: 3 - push: 4 - concurrency: 5 - group: tangled 6 - cancel-in-progress: true 7 - jobs: 8 - tangled: 9 - uses: vic/vic/.github/workflows/tangled.yml@main 10 - secrets: 11 - TANGLED_SSH_KEY: ${{secrets.TANGLED_SSH_KEY}}
+12
.tangled/workflows/mirror.yml
··· 1 + when: 2 + - event: ["push"] 3 + branch: ["*"] 4 + engine: "nixery" 5 + clone: 6 + skip: true 7 + dependencies: 8 + nixpkgs: 9 + - gh 10 + steps: 11 + - name: mirror 12 + command: gh -R vic/vic issue comment 3 -b flake-file
+8 -6
README.md
··· 1 1 <!-- Badges --> 2 + 2 3 <p align="right"> 3 4 <a href="https://github.com/sponsors/vic"><img src="https://img.shields.io/badge/sponsor-vic-white?logo=githubsponsors&logoColor=white&labelColor=%23FF0000" alt="Sponsor Vic"/> 4 5 </a> ··· 317 318 This section outlines the recommended steps for adopting `flake-file` in your own repository. 318 319 319 320 1. **Prerequisite:** Ensure you have already adopted [flake-parts](https://flake.parts). 320 - 2. **Add Inputs:** In your current `flake.nix`, add the following input: 321 + 322 + 1. **Add Inputs:** In your current `flake.nix`, add the following input: 321 323 322 324 ```nix 323 325 flake-file.url = "github:vic/flake-file"; 324 326 ``` 325 327 326 - 3. **Move Outputs:** Copy the contents of your `outputs` function into a file `./outputs.nix`: 328 + 1. **Move Outputs:** Copy the contents of your `outputs` function into a file `./outputs.nix`: 327 329 328 330 ```nix 329 331 # outputs.nix -- this is the contents of your `outputs` function from the original flake.nix file. ··· 336 338 } 337 339 ``` 338 340 339 - 4. **Move Inputs:** Copy your current flake.nix file as a flake-parts module (e.g., `modules/inputs.nix`): 341 + 1. **Move Inputs:** Copy your current flake.nix file as a flake-parts module (e.g., `modules/inputs.nix`): 340 342 341 343 > [!IMPORTANT] 342 344 > Make sure you `git add` so that new files are visible to Nix. ··· 360 362 ``` 361 363 362 364 5. **Backup:** Back up your flake.nix into flake.nix.bak before regenerating it. 363 - 6. **Generate:** Execute `nix run .#write-flake` to generate flake.nix. 364 - 7. **Verify:** Check flake.nix and if everything is okay, remove the backup file. 365 + 1. **Generate:** Execute `nix run .#write-flake` to generate flake.nix. 366 + 1. **Verify:** Check flake.nix and if everything is okay, remove the backup file. 365 367 366 368 You are done! Now you can split dependencies from `modules/inputs.nix` into other flake-part modules as you see fit: 367 369 ··· 399 401 400 402 --- 401 403 402 - Made with <3 by [@vic](https://x.com/oeiuwq) 404 + Made with \<3 by [@vic](https://x.com/oeiuwq)