Skip to content

Commit

Permalink
systemd: break too long lines of Nix code
Browse files Browse the repository at this point in the history
To improve readability.
  • Loading branch information
AndersonTorres committed Jan 24, 2024
1 parent 92dfeb7 commit 67643f8
Showing 1 changed file with 39 additions and 12 deletions.
51 changes: 39 additions & 12 deletions pkgs/os-specific/linux/systemd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 [
{
Expand Down Expand Up @@ -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 ? [ ] }:
Expand Down Expand Up @@ -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;
};
};

Expand Down

0 comments on commit 67643f8

Please sign in to comment.