Skip to content

Commit

Permalink
Merge pull request NixOS#214207 from Artturin/ssytemdbuildbash1
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin authored Feb 13, 2023
2 parents 938a52f + 1db2422 commit fa169bb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkgs/os-specific/linux/systemd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{ stdenv
, lib
, nixosTests
, pkgsCross
, fetchFromGitHub
, fetchpatch
, fetchzip
Expand Down Expand Up @@ -63,6 +64,7 @@
, withKexectools ? lib.meta.availableOn stdenv.hostPlatform kexec-tools
, kexec-tools
, bashInteractive
, bash
, libmicrohttpd
, libfido2
, p11-kit
Expand Down Expand Up @@ -139,7 +141,7 @@ let
# jq '.created_at|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime'
releaseTimestamp = "1667246393";
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
inherit pname version;

# We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly
Expand Down Expand Up @@ -339,7 +341,7 @@ stdenv.mkDerivation {
# when cross-compiling.
+ ''
shopt -s extglob
patchShebangs tools test src/!(rpm)
patchShebangs tools test src/!(rpm|kernel-install) src/kernel-install/test-kernel-install.sh
'';

outputs = [ "out" "man" "dev" ];
Expand All @@ -362,6 +364,7 @@ stdenv.mkDerivation {
docbook_xsl
docbook_xml_dtd_42
docbook_xml_dtd_45
bash
(buildPackages.python3Packages.python.withPackages (ps: with ps; [ lxml jinja2 ]))
]
++ lib.optionals withLibBPF [
Expand All @@ -382,6 +385,7 @@ stdenv.mkDerivation {
libuuid
linuxHeaders
pam
bashInteractive # for patch shebangs
]

++ lib.optionals wantGcrypt [ libgcrypt libgpg-error ]
Expand Down Expand Up @@ -694,6 +698,10 @@ stdenv.mkDerivation {
mv $out/dont-strip-me $out/lib/systemd/boot/efi
'';

disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform)
# 'or p' is for manually specified buildPackages as they dont have __spliced
(builtins.map (p: p.__spliced.buildHost or p) finalAttrs.nativeBuildInputs);

passthru = {
# The interface version prevents NixOS from switching to an
# incompatible systemd at runtime. (Switching across reboots is
Expand All @@ -707,6 +715,7 @@ stdenv.mkDerivation {

tests = {
inherit (nixosTests) switchTest;
cross = pkgsCross.aarch64-multiplatform.systemd;
};
};

Expand All @@ -721,4 +730,4 @@ stdenv.mkDerivation {
priority = 10;
maintainers = with maintainers; [ flokli kloenk mic92 ];
};
}
})

0 comments on commit fa169bb

Please sign in to comment.