Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't hardcode PATH #7

Merged
merged 3 commits into from
Jan 4, 2024
Merged

Don't hardcode PATH #7

merged 3 commits into from
Jan 4, 2024

Conversation

RebeccaMahany
Copy link
Contributor

We don't want to rely on the static paths like /run/current-system/sw/bin because its contents will change if the user reinstalls anything. Instead, set the systemd service path to include all dependencies from allowedcmd. If we don't require the dependency, mark it as optional depending on install status, so that we don't e.g. install zerotier when it's not already there and in use.

systemd # Provides loginctl, systemctl; loginctl required to run desktop
xdg-utils # Provides xdg-open, required to open browser from notifications and menu bar app
]
++ optional (builtins.elem apt config.environment.systemPackages) apt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i.e.: "if apt is in system packages, then append it to the path list".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To understand Nix syntax, this is the best/quickest overview I've found

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm hoping we can autogen this from allowedcmd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am hoping we can do that eventually too. It's a bit of a pain to track down what nix package provides which commands, though, so it wasn't simple to do here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm imagining we'll need to record those in allowdcmd

@RebeccaMahany RebeccaMahany marked this pull request as ready for review January 4, 2024 20:45
@RebeccaMahany RebeccaMahany merged commit f10936c into main Jan 4, 2024
1 check passed
@RebeccaMahany RebeccaMahany deleted the becca/path branch January 4, 2024 20:49
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