-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
services.logind: add options for lid-switch behavior #25971
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
Conversation
@Ma27, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @abbradar and @ericsagnes to be potential reviewers. |
@@ -595,6 +595,25 @@ in | |||
''; | |||
}; | |||
|
|||
services.logind.lidSwitch = mkOption { | |||
default = "ignore"; |
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.
Please use the default of logind here.
@@ -595,6 +595,25 @@ in | |||
''; | |||
}; | |||
|
|||
services.logind.lidSwitch = mkOption { | |||
default = "suspend"; | |||
example = "ignore"; |
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.
Missing type. Prefer enum, IMHO.
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.
done
default = "ignore"; | ||
example = "suspend"; | ||
|
||
type = types.enum([ |
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.
Maybe factor out the enum and re-use it here and above.
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.
done
is there anything else missing or can this be merged? |
"hibernate" | ||
"hybrid-sleep" | ||
"lock" | ||
]); |
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.
That code and the naming looks a bit clunky IMHO.
What about:
logindHandlerType = types.enum [
"ignore" "poweroff" "reboot" "halt" "kexec" "suspend"
"hibernate" "hybrid-sleep" "lock"
];
Oh, and please squash your commits. That way we don't have to rebase/squash and remove your PGP signature in the process. :) |
@fpletz done :-) |
btw: the failure seems to be unrelated (I think there's another PR which was supposed to fix that problem)
… On 23. May 2017, at 1:06 AM, Franz Pletz ***@***.***> wrote:
Oh, and please squash your commits. That way we don't have to rebase/squash and remove your PGP signature in the process. :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@fpletz I rebased onto the latest master (which seems to pass), so the build should get green now :-) |
Awesome, thanks! |
Motivation for this change
Right now it's necessary to use the
services.logind.extraConfig
option to define the wanted lid-switch behavior. However well-defined options are better (and more predictable) than placing several params into aconfig
option.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)