-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
systemd-lock-handler: init at 2.4.1 #228063
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 | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,33 @@ | ||||||
{ | ||||||
config, | ||||||
pkgs, | ||||||
lib, | ||||||
... | ||||||
}: | ||||||
with lib; let | ||||||
cfg = config.services.systemd-lock-handler; | ||||||
in { | ||||||
options.services.systemd-lock-handler = { | ||||||
enable = mkEnableOption (lib.mdDoc "systemd-lock-handler"); | ||||||
package = mkOption { | ||||||
default = pkgs.systemd-lock-handler; | ||||||
defaultText = literalExpression "pkgs.systemd-lock-handler"; | ||||||
type = types.package; | ||||||
description = lib.mdDoc "systemd-lock-handler package to use."; | ||||||
}; | ||||||
config = mkIf cfg.enable { | ||||||
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. This is nested inside |
||||||
systemd.user.services.systemd-lock-handler = { | ||||||
description = "Logind lock event to systemd target translation"; | ||||||
wantedBy = [ "default.target" ]; | ||||||
serviceConfig = { | ||||||
Documentation = "https://sr.ht/~whynothugo/systemd-lock-handler"; | ||||||
Slice = [ "session.slice" ]; | ||||||
ExecStart = "${cfg.package}/bin/systemd-lock-handler"; | ||||||
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.
Suggested change
|
||||||
Type = "notify"; | ||||||
Restart = "on-failure"; | ||||||
RestartSec = "10s"; | ||||||
}; | ||||||
}; | ||||||
}; | ||||||
}; | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ lib | ||
, buildGoModule | ||
, fetchFromSourcehut | ||
}: | ||
|
||
buildGoModule rec { | ||
pname = "systemd-lock-handler"; | ||
version = "2.4.1"; | ||
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. Version 2.4.2 has been released. 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. Perhaps also add passthru.updateScript = nix-update-script { }; |
||
|
||
src = fetchFromSourcehut { | ||
owner = "~whynothugo"; | ||
repo = "systemd-lock-handler"; | ||
rev = "v${version}"; | ||
hash = "sha256-dkOgdDGwinCvv+pO6wqykhG0J/cRtUb7uOSpIFDReoQ="; | ||
}; | ||
|
||
vendorHash = "sha256-dWzojV3tDA5lLdpAQNC9NaADGyvV7dNOS3x8mfgNNtA="; | ||
|
||
meta = with lib; { | ||
description = "A systemd helper to handle lock events in systemd"; | ||
homepage = "https://git.sr.ht/~whynothugo/systemd-lock-handler"; | ||
license = licenses.isc; | ||
maintainers = with maintainers; [ matthewcroughan ]; | ||
}; | ||
} |
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.
There seems to be a helper, like
mkEnableOption
, for this: