Skip to content

Conversation

Enzime
Copy link
Member

@Enzime Enzime commented Jul 31, 2025

This PR reverts #570 as I think we still want to run nixos-facter with sudo if possible and the changing the order of the flags doesn't fix the quoting issues

@Enzime Enzime marked this pull request as ready for review July 31, 2025 05:52
@Enzime
Copy link
Member Author

Enzime commented Jul 31, 2025

Tested this locally and it works 👍

@Enzime Enzime requested a review from a-kenji July 31, 2025 05:52
Copy link
Contributor

@a-kenji a-kenji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the PR and it now fails when nixos-facter is not installed as opposed to before.
This is the error I get:

error: unable to execute 'sudo': No such file or directory

On main this works. I suspect it is because of: abfb275

The quoting is now correct so that is approved. Unsure if the first revert is really necessary seeing as you completely rewrote everything there anyway.

@Enzime
Copy link
Member Author

Enzime commented Jul 31, 2025

How are you testing it? sudo should be present on the NixOS installer I believe

@a-kenji
Copy link
Contributor

a-kenji commented Jul 31, 2025

This is how I tested it:

nix run . -- --phases kexec --generate-hardware-config nixos-facter [FILE] [HOST] --flake [FLAKE]

@a-kenji
Copy link
Contributor

a-kenji commented Jul 31, 2025

Ah, I found the issue.
If sudo should be present in the installer then we shouldn't set it to an empty string when we are in the installer. We should probably test if it is not y?

Edit: #576

@a-kenji a-kenji self-requested a review July 31, 2025 06:32
Copy link
Contributor

@a-kenji a-kenji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok tested together with: #576, which works.

@Enzime
Copy link
Member Author

Enzime commented Aug 7, 2025

@a-kenji can you review this?

The latest commit should supercede #576

Enzime added 5 commits August 7, 2025 14:00
This is unnecessary because we switch to using `root` after we kexec and
`nixos-images` provides an installer without `sudo` so this actively causes
installations to fail if a user wasn't already booted into a NixOS installer.
@Enzime Enzime force-pushed the push-krzlkykyknrl branch from e25d677 to d239ac6 Compare August 7, 2025 04:01
@Enzime Enzime added this pull request to the merge queue Aug 11, 2025
Merged via the queue into main with commit 3de4f12 Aug 11, 2025
4 checks passed
@Enzime Enzime deleted the push-krzlkykyknrl branch August 11, 2025 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants