-
Notifications
You must be signed in to change notification settings - Fork 0
Revert password requirement for sudo and enhance host detection #747
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,21 @@ | ||
| { | ||
| # Detect if running on kyber (requires --impure flag, which Makefile already uses) | ||
| # Detect if running on kyber (linux) | ||
| isKyber = builtins.getEnv "HOSTNAME" == "kyber" || builtins.getEnv "HOST" == "kyber"; | ||
|
|
||
| # Detect if running on galactica (macOS node) | ||
| isGalactica = builtins.getEnv "HOSTNAME" == "galactica" || builtins.getEnv "HOST" == "galactica"; | ||
|
|
||
| # Detect if running on matic (Framework 13" AMD AI 300) | ||
| # Detect if running on matic (Framework 13) | ||
| isMatic = builtins.getEnv "HOSTNAME" == "matic" || builtins.getEnv "HOST" == "matic"; | ||
|
|
||
| # Desktop machines with GUI (matic, galactica) | ||
| isDesktop = | ||
| let | ||
| hostname = builtins.getEnv "HOSTNAME"; | ||
| host = builtins.getEnv "HOST"; | ||
| in | ||
| hostname == "matic" || host == "matic" || hostname == "galactica" || host == "galactica"; | ||
|
Comment on lines
+12
to
+17
|
||
|
|
||
| # Get the node name for OpenClaw remote mode | ||
| # Falls back to "unknown" if no hostname is detected | ||
| nodeName = | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,12 @@ | |
| allowUnfreePredicate = | ||
| pkg: | ||
| builtins.elem (nixpkgsLib.getName pkg) [ | ||
| "1password" | ||
| "claude-code" | ||
| "qwen-code" | ||
| "clickup" | ||
| "crush" | ||
| "qwen-code" | ||
| "slack" | ||
|
Comment on lines
+7
to
+12
|
||
| ]; | ||
| joypixels.acceptLicense = true; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,7 @@ inputs.nixpkgs.lib.nixosSystem { | |||||
| initialPassword = "changemeow"; # Change this after first login with: passwd | ||||||
| }; | ||||||
|
|
||||||
| security.sudo.wheelNeedsPassword = true; | ||||||
| security.sudo.wheelNeedsPassword = false; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disabling the password requirement for
|
||||||
| security.sudo.wheelNeedsPassword = false; | |
| security.sudo.wheelNeedsPassword = true; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,12 @@ in | |
| else | ||
| ''echo "FAIL: host.nodeName must exist and be a string" && exit 1'' | ||
| } | ||
| ${ | ||
| if host ? isDesktop && builtins.isBool host.isDesktop then | ||
| ''echo "lib/host.nix: isDesktop is a boolean (value: ${builtins.toString host.isDesktop})"'' | ||
| else | ||
| ''echo "FAIL: host.isDesktop must exist and be a boolean" && exit 1'' | ||
| } | ||
|
Comment on lines
+47
to
+52
|
||
| touch $out | ||
| ''; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation for
isDesktopduplicates logic already present forisMaticandisGalacticaand involves redundant calls tobuiltins.getEnv. While a broader refactoring of this file to use a recursive set (rec { ... }) would be the ideal way to eliminate this duplication, you can make this specific block more concise and maintainable by introducing a small helper function within theletexpression. This will also make it easier to add more desktop hosts in the future.