forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
systemd: break too long lines of Nix code
To improve readability.
- Loading branch information
1 parent
92dfeb7
commit 67643f8
Showing
1 changed file
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -636,17 +636,31 @@ stdenv.mkDerivation (finalAttrs: { | |
# exhaustive. If another (unhandled) case is found in the source code the | ||
# build fails with an error message. | ||
binaryReplacements = [ | ||
{ search = "/usr/bin/getent"; replacement = "${getent}/bin/getent"; where = [ "src/nspawn/nspawn-setuid.c" ]; } | ||
|
||
{ | ||
search = "/usr/bin/getent"; | ||
replacement = "${getent}/bin/getent"; | ||
where = [ "src/nspawn/nspawn-setuid.c" ]; | ||
} | ||
{ | ||
search = "/sbin/mkswap"; | ||
replacement = "${lib.getBin util-linux}/sbin/mkswap"; | ||
where = [ | ||
"man/[email protected]" | ||
]; | ||
} | ||
{ search = "/sbin/swapon"; replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon"; where = [ "src/core/swap.c" "src/basic/unit-def.h" ]; } | ||
{ search = "/sbin/swapoff"; replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff"; where = [ "src/core/swap.c" ]; } | ||
{ | ||
search = "/sbin/swapon"; | ||
replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon"; | ||
where = [ | ||
"src/core/swap.c" | ||
"src/basic/unit-def.h" | ||
]; | ||
} | ||
{ | ||
search = "/sbin/swapoff"; | ||
replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff"; | ||
where = [ "src/core/swap.c" ]; | ||
} | ||
{ | ||
search = "/bin/echo"; | ||
replacement = "${coreutils}/bin/echo"; | ||
|
@@ -663,14 +677,15 @@ stdenv.mkDerivation (finalAttrs: { | |
{ | ||
search = "/bin/cat"; | ||
replacement = "${coreutils}/bin/cat"; | ||
where = [ "test/test-execute/exec-noexecpaths-simple.service" "src/journal/cat.c" ]; | ||
where = [ | ||
"test/test-execute/exec-noexecpaths-simple.service" | ||
"src/journal/cat.c" | ||
]; | ||
} | ||
{ | ||
search = "/usr/lib/systemd/systemd-fsck"; | ||
replacement = "$out/lib/systemd/systemd-fsck"; | ||
where = [ | ||
"man/[email protected]" | ||
]; | ||
where = [ "man/[email protected]" ]; | ||
} | ||
] ++ lib.optionals withImportd [ | ||
{ | ||
|
@@ -699,10 +714,14 @@ stdenv.mkDerivation (finalAttrs: { | |
]; | ||
} | ||
] ++ lib.optionals withKmod [ | ||
{ search = "/sbin/modprobe"; replacement = "${lib.getBin kmod}/sbin/modprobe"; where = [ "units/[email protected]" ]; } | ||
{ | ||
search = "/sbin/modprobe"; | ||
replacement = "${lib.getBin kmod}/sbin/modprobe"; | ||
where = [ "units/[email protected]" ]; | ||
} | ||
]; | ||
|
||
# { replacement, search, where } -> List[str] | ||
# { replacement, search, where, ignore } -> List[str] | ||
mkSubstitute = { replacement, search, where, ignore ? [ ] }: | ||
map (path: "substituteInPlace ${path} --replace '${search}' \"${replacement}\"") where; | ||
mkEnsureSubstituted = { replacement, search, where, ignore ? [ ] }: | ||
|
@@ -831,15 +850,23 @@ stdenv.mkDerivation (finalAttrs: { | |
# needed - and therefore `interfaceVersion` should be incremented. | ||
interfaceVersion = 2; | ||
|
||
inherit withCryptsetup withHostnamed withImportd withKmod withLocaled withMachined withPortabled withTimedated withUtmp util-linux kmod kbd; | ||
inherit withCryptsetup withHostnamed withImportd withKmod withLocaled | ||
withMachined withPortabled withTimedated withUtmp util-linux kmod kbd; | ||
|
||
tests = { | ||
inherit (nixosTests) | ||
switchTest | ||
systemd-journal | ||
systemd-journal-gateway | ||
systemd-journal-upload; | ||
cross = pkgsCross.${if stdenv.buildPlatform.isAarch64 then "gnu64" else "aarch64-multiplatform"}.systemd; | ||
cross = | ||
let | ||
systemString = | ||
if stdenv.buildPlatform.isAarch64 | ||
then "gnu64" | ||
else "aarch64-multiplatform"; | ||
in | ||
pkgsCross.${systemString}.systemd; | ||
}; | ||
}; | ||
|
||
|