dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates, step-by-step guides, and more ✨
BSD 3-Clause "New" or "Revised" License
1.29k stars 81 forks source link

Define user context in `flake.nix` and refactor install scripts #27

Open dustinlyons opened 8 months ago

dustinlyons commented 8 months ago

Currently, we run bin/apply to ask the user for some info, and run a sed replace function to replace various static tokens throughout the code.

These look like %USER%, %HOST_NAME%, etc. in the templates. We should clean these up so that it's defined once in flake.nix, and that input is provided as part of building the system.

ar4s-gh commented 2 weeks ago

is this why I'm getting "Invalid option. Exiting script" after running

nix run --extra-experimental-features 'nix-command flakes' '.#apply'

and entering my details?

dustinlyons commented 2 weeks ago

@ar4s-gh You're probably typing 'yes' or 'no'. It should be 'Y', 'y', 'N', or 'n'. I think this is a bug in the apply script I need to fix.

Edit: I just fixed this on main. If you try to initialize the template again, you'll likely grab the cache of the old one, so first delete ~/.cache/nix before initializing again.

Or just type 'y' or 'n' instead of 'yes' and 'no', that's an easy workaround.