dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates + step-by-step guides ✨
BSD 3-Clause "New" or "Revised" License
1.52k stars 95 forks source link

Couple of issues found with the latest instructions/code #59

Closed mayersj1 closed 6 months ago

mayersj1 commented 7 months ago

Just going to put these into one issue as improvements that can be made/noted in the README file (installing onto MacOS Sonoma):

  1. In section 8. Optional: Setup secrets, step 8a notes to create the repo and keep it empty. There are two issues here with the workflow: a. The code assumes that your default branch is 'master'. With the changes to GitHub lately, this is 'main' by default. b. The statement to leave the repository empty is a little misleading as, if you create an empty repo on GitHub, you cannot clone it using the ssh:// URL. Only the git:// format will work. Otherwise, you get a publickey denial. Adding a single file (empty README.md works) to the repository allows you to now successfully execute the 'nix run .#create-keys' command.

  2. Clarification on whether an existing standalone installation of home-manager will work with this configuration or not would be greatly appreciated. Would that be something easy to add here?

  3. Clarification on whether or not there are any issues when applying OS upgrades. Is it as simple as runnning 'nix run .#build-switch' aftwards? Is that even needed?

Thanks for the work! This is very interesting and I'm still studying the code to see what might break in my existing home-manager configuration as I'm using that across three different machines and two platforms.

dustinlyons commented 7 months ago

Hi @mayersj1! Thanks a ton for taking the time to write this. It helps make the README better.

My responses:

  1. a. Can you help me understand where you found the master branch? Some dependencies use master that I have no control over, but this code should use main.

  2. b. Thanks! I've added this to the README.

  3. Unfortunately, I'm not really sure. I'd have to build a standalone and test it to be sure. This configuration has only used the home-manager module. Perhaps if you get this working, you can report back on any challenges and I can update the README for future folks?

  4. I had an issue with OS upgrades last year, but that's a single time. Since then, I've not had issues. Upgrades happen independent of this Nix configuration, the Nix Store, etc. So you should be good (no need to run .#build-switch).

mayersj1 commented 7 months ago

I'm unable to reproduce 1a. now. It may have been the same reason that caused 1b. and I assumed it was a branch name thing. Sorry for the confusion. I'll keep you updated as I go along!

Thanks for the quick responses!

sandipndev commented 7 months ago

Actually I faced 1a as well but it was not a problem/hassle.

I had a fresh install of MacOS and with no keys attached to git. When I run nix run .#create-keys, the script was trying to clone the master branch of nix-secrets repository in my account (thanks for updated readme). Git failed because of missing SSH Key but in the logs I found that it tried to clone the master branch.

I am right now trying to set up my Github SSH Key that I always use and my GPG Private Key via the secrets method and will keep you posted how it goes. I didn't find good documentation on the GPG Private Key part and as a beginner in Nix, it's a little daunting to imagine how can I set it up.

PS: Great work on the repo @dustinlyons - I haven't seen anything better. The templates are the perfect way to get an absolute beginner onboarded.

dustinlyons commented 6 months ago

Closing for now, feel free to respond here if any additional questions.

wramalho commented 2 months ago

I have the same issue, where can I change the code to ask for main branch instead of master branch? Thanks!