Merge branch 'master' into flip-map-foreach
This commit is contained in:
@@ -46,8 +46,8 @@ let
|
||||
|
||||
ln -s ${kernelPath} $out/kernel
|
||||
ln -s ${config.system.modulesTree} $out/kernel-modules
|
||||
${optionalString (pkgs.stdenv.hostPlatform.platform.kernelDTB or false) ''
|
||||
ln -s ${config.boot.kernelPackages.kernel}/dtbs $out/dtbs
|
||||
${optionalString (config.hardware.deviceTree.package != null) ''
|
||||
ln -s ${config.hardware.deviceTree.package} $out/dtbs
|
||||
''}
|
||||
|
||||
echo -n "$kernelParams" > $out/kernel-params
|
||||
|
||||
@@ -115,6 +115,14 @@ let
|
||||
magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00'';
|
||||
mask = ''\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'';
|
||||
};
|
||||
wasm32-wasi = {
|
||||
magicOrExtension = ''\x00asm'';
|
||||
mask = ''\xff\xff\xff\xff'';
|
||||
};
|
||||
wasm64-wasi = {
|
||||
magicOrExtension = ''\x00asm'';
|
||||
mask = ''\xff\xff\xff\xff'';
|
||||
};
|
||||
x86_64-windows = {
|
||||
magicOrExtension = ".exe";
|
||||
recognitionType = "extension";
|
||||
@@ -226,6 +234,7 @@ in {
|
||||
|
||||
emulatedSystems = mkOption {
|
||||
default = [];
|
||||
example = [ "wasm32-wasi" "x86_64-windows" "aarch64-linux" ];
|
||||
description = ''
|
||||
List of systems to emulate. Will also configure Nix to
|
||||
support your new systems.
|
||||
|
||||
+2
-3
@@ -75,9 +75,8 @@ addEntry() {
|
||||
|
||||
copyToKernelsDir "$path/kernel"; kernel=$result
|
||||
copyToKernelsDir "$path/initrd"; initrd=$result
|
||||
# XXX UGLY: maybe the system config should have a top-level "dtbs" entry?
|
||||
dtbDir=$(readlink -m "$path/kernel/../dtbs")
|
||||
if [ -d "$dtbDir" ]; then
|
||||
dtbDir=$(readlink -m "$path/dtbs")
|
||||
if [ -e "$dtbDir" ]; then
|
||||
copyToKernelsDir "$dtbDir"; dtbs=$result
|
||||
fi
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ let
|
||||
|
||||
checkLink = checkUnitConfig "Link" [
|
||||
(assertOnlyFields [
|
||||
"Description" "Alias" "MACAddressPolicy" "MACAddress" "NamePolicy" "Name"
|
||||
"Description" "Alias" "MACAddressPolicy" "MACAddress" "NamePolicy" "OriginalName"
|
||||
"MTUBytes" "BitsPerSecond" "Duplex" "AutoNegotiation" "WakeOnLan" "Port"
|
||||
"TCPSegmentationOffload" "TCP6SegmentationOffload" "GenericSegmentationOffload"
|
||||
"GenericReceiveOffload" "LargeReceiveOffload" "RxChannels" "TxChannels"
|
||||
|
||||
@@ -217,13 +217,11 @@ let
|
||||
--replace ata_id ${extraUtils}/bin/ata_id \
|
||||
--replace scsi_id ${extraUtils}/bin/scsi_id \
|
||||
--replace cdrom_id ${extraUtils}/bin/cdrom_id \
|
||||
--replace ${pkgs.utillinux}/sbin/blkid ${extraUtils}/bin/blkid \
|
||||
--replace /sbin/blkid ${extraUtils}/bin/blkid \
|
||||
--replace ${pkgs.coreutils}/bin/basename ${extraUtils}/bin/basename \
|
||||
--replace ${pkgs.utillinux}/bin/blkid ${extraUtils}/bin/blkid \
|
||||
--replace ${pkgs.lvm2}/sbin ${extraUtils}/bin \
|
||||
--replace /sbin/mdadm ${extraUtils}/bin/mdadm \
|
||||
--replace ${pkgs.mdadm}/sbin ${extraUtils}/sbin \
|
||||
--replace ${pkgs.bash}/bin/sh ${extraUtils}/bin/sh \
|
||||
--replace /usr/bin/readlink ${extraUtils}/bin/readlink \
|
||||
--replace /usr/bin/basename ${extraUtils}/bin/basename \
|
||||
--replace ${udev}/bin/udevadm ${extraUtils}/bin/udevadm
|
||||
done
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ in rec {
|
||||
|
||||
environment = mkOption {
|
||||
default = {};
|
||||
type = with types; attrsOf (nullOr (either str (either path package)));
|
||||
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
|
||||
example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; };
|
||||
description = "Environment variables passed to the service's processes.";
|
||||
};
|
||||
|
||||
@@ -427,7 +427,8 @@ in
|
||||
systemd.packages = mkOption {
|
||||
default = [];
|
||||
type = types.listOf types.package;
|
||||
description = "Packages providing systemd units.";
|
||||
example = literalExample "[ pkgs.systemd-cryptsetup-generator ]";
|
||||
description = "Packages providing systemd units and hooks.";
|
||||
};
|
||||
|
||||
systemd.targets = mkOption {
|
||||
@@ -497,11 +498,14 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.generator-packages = mkOption {
|
||||
default = [];
|
||||
type = types.listOf types.package;
|
||||
example = literalExample "[ pkgs.systemd-cryptsetup-generator ]";
|
||||
description = "Packages providing systemd generators.";
|
||||
systemd.shutdown = mkOption {
|
||||
type = types.attrsOf types.path;
|
||||
default = {};
|
||||
description = ''
|
||||
Definition of systemd shutdown executables.
|
||||
For each <literal>NAME = VALUE</literal> pair of the attrSet, a link is generated from
|
||||
<literal>/etc/systemd/system-shutdown/NAME</literal> to <literal>VALUE</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.defaultUnit = mkOption {
|
||||
@@ -520,7 +524,7 @@ in
|
||||
};
|
||||
|
||||
systemd.globalEnvironment = mkOption {
|
||||
type = with types; attrsOf (nullOr (either str (either path package)));
|
||||
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
|
||||
default = {};
|
||||
example = { TZ = "CET"; };
|
||||
description = ''
|
||||
@@ -761,18 +765,21 @@ in
|
||||
environment.systemPackages = [ systemd ];
|
||||
|
||||
environment.etc = let
|
||||
# generate contents for /etc/systemd/system-generators from
|
||||
# systemd.generators and systemd.generator-packages
|
||||
generators = pkgs.runCommand "system-generators" {
|
||||
# generate contents for /etc/systemd/system-${type} from attrset of links and packages
|
||||
hooks = type: links: pkgs.runCommand "system-${type}" {
|
||||
preferLocalBuild = true;
|
||||
packages = cfg.generator-packages;
|
||||
} ''
|
||||
packages = cfg.packages;
|
||||
} ''
|
||||
set -e
|
||||
mkdir -p $out
|
||||
for package in $packages
|
||||
do
|
||||
ln -s $package/lib/systemd/system-generators/* $out/
|
||||
done;
|
||||
${concatStrings (mapAttrsToList (generator: target: "ln -s ${target} $out/${generator};\n") cfg.generators)}
|
||||
for hook in $package/lib/systemd/system-${type}/*
|
||||
do
|
||||
ln -s $hook $out/
|
||||
done
|
||||
done
|
||||
${concatStrings (mapAttrsToList (exec: target: "ln -s ${target} $out/${exec};\n") links)}
|
||||
'';
|
||||
in ({
|
||||
"systemd/system".source = generateUnits "system" cfg.units upstreamSystemUnits upstreamSystemWants;
|
||||
@@ -834,7 +841,8 @@ in
|
||||
${concatStringsSep "\n" cfg.tmpfiles.rules}
|
||||
'';
|
||||
|
||||
"systemd/system-generators" = { source = generators; };
|
||||
"systemd/system-generators" = { source = hooks "generators" cfg.generators; };
|
||||
"systemd/system-shutdown" = { source = hooks "shutdown" cfg.shutdown; };
|
||||
});
|
||||
|
||||
services.dbus.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user