0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

Merge staging-next into staging

This commit is contained in:
github-actions[bot] 2023-01-05 00:02:56 +00:00 committed by GitHub
commit 0c98bf3e85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 867 additions and 1801 deletions

View file

@ -62,6 +62,21 @@ let
);
# Ensure the CLI uses our generated configFile
wrappedBinaries = pkgs.runCommandLocal "apcupsd-wrapped-binaries"
{ nativeBuildInputs = [ pkgs.makeWrapper ]; }
''
for p in "${lib.getBin pkgs.apcupsd}/bin/"*; do
bname=$(basename "$p")
makeWrapper "$p" "$out/bin/$bname" --add-flags "-f ${configFile}"
done
'';
apcupsdWrapped = pkgs.symlinkJoin {
name = "apcupsd-wrapped";
# Put wrappers first so they "win"
paths = [ wrappedBinaries pkgs.apcupsd ];
};
in
{
@ -138,7 +153,7 @@ in
} ];
# Give users access to the "apcaccess" tool
environment.systemPackages = [ pkgs.apcupsd ];
environment.systemPackages = [ apcupsdWrapped ];
# NOTE 1: apcupsd runs as root because it needs permission to run
# "shutdown"