I'd love some advice on getting flakes to use private repos #14

Closed
opened 2025-12-28 23:18:51 +01:00 by adam · 3 comments
Owner

Originally created by @zdcthomas on GitHub (Nov 21, 2023).

Hi! Love reading through your config for inspiration!
I noticed that you use a private repo in your flake inputs. I'm trying to do a similar thing with my own private repo in my dotfiles, but I keep seeing Permission denied (publickey). I have git happily set up for my user, but since I have to use sudo for nixos-rebuild, that ssh doesn't have the right access.

Also, it feels like there would be a chicken and egg problem. How does the nix configuration know to setup the righ ssh configuration before it's been run the first time?

Anyway, I'd love any advice or resources you have. Thanks!

Originally created by @zdcthomas on GitHub (Nov 21, 2023). Hi! Love reading through your config for inspiration! I noticed that you use a private repo in your flake inputs. I'm trying to do a similar thing with my own private repo in my dotfiles, but I keep seeing `Permission denied (publickey)`. I have git happily set up for my user, but since I have to use `sudo` for nixos-rebuild, that ssh doesn't have the right access. Also, it feels like there would be a chicken and egg problem. How does the nix configuration know to setup the righ ssh configuration before it's been run the first time? Anyway, I'd love any advice or resources you have. Thanks!
adam closed this issue 2025-12-28 23:18:51 +01:00
Author
Owner

@ryan4yin commented on GitHub (Nov 21, 2023):

The key parameter is --use-remote-sudo
https://github.com/ryan4yin/nix-config/blob/main/Makefile#L14

@ryan4yin commented on GitHub (Nov 21, 2023): The key parameter is `--use-remote-sudo` https://github.com/ryan4yin/nix-config/blob/main/Makefile#L14
Author
Owner

@zdcthomas commented on GitHub (Nov 21, 2023):

That did it! thanks so much!

Does that mean that there's an extra step when setting up a new machine? I'd assume you have to auth with github first before you can apply

@zdcthomas commented on GitHub (Nov 21, 2023): That did it! thanks so much! Does that mean that there's an extra step when setting up a new machine? I'd assume you have to auth with github first before you can apply
Author
Owner

@ryan4yin commented on GitHub (Nov 29, 2023):

That did it! thanks so much!

Does that mean that there's an extra step when setting up a new machine? I'd assume you have to auth with github first before you can apply

Yes, an ssh private key should be prepared before deploying this flake.

See this branch for more details: https://github.com/ryan4yin/nix-config/tree/nixos-install

@ryan4yin commented on GitHub (Nov 29, 2023): > That did it! thanks so much! > > Does that mean that there's an extra step when setting up a new machine? I'd assume you have to auth with github first before you can apply Yes, an ssh private key should be prepared before deploying this flake. See this branch for more details: <https://github.com/ryan4yin/nix-config/tree/nixos-install>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/nix-config#14