Skip to content

Commit

Permalink
Merge branch 'master' into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin committed Sep 25, 2024
2 parents cd039ce + 210a547 commit f0e657f
Show file tree
Hide file tree
Showing 4,377 changed files with 17,303 additions and 9,611 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
checks = forAllSystems (system: {
tarball = jobs.${system}.tarball;
# Exclude power64 due to "libressl is not available on the requested hostPlatform" with hostPlatform being power64
} // lib.optionalAttrs (self.legacyPackages.${system}.stdenv.isLinux && !self.legacyPackages.${system}.targetPlatform.isPower64) {
} // lib.optionalAttrs (self.legacyPackages.${system}.stdenv.hostPlatform.isLinux && !self.legacyPackages.${system}.targetPlatform.isPower64) {
# Test that ensures that the nixosSystem function can accept a lib argument
# Note: prefer not to extend or modify `lib`, especially if you want to share reusable modules
# alternatives include: `import` a file, or put a custom library in an option or in `_module.args.<libname>`
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/test-with-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}" {
nativeBuildInputs = [
nix
pkgs.gitMinimal
] ++ lib.optional pkgs.stdenv.isLinux pkgs.inotify-tools;
] ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools;
strictDeps = true;
} ''
datadir="${nix}/share"
Expand Down
2 changes: 1 addition & 1 deletion maintainers/scripts/convert-to-import-cargo-lock/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ mkShell {
clippy
rustfmt
]
++ lib.optional stdenv.isDarwin pkgs.libiconv;
++ lib.optional stdenv.hostPlatform.isDarwin pkgs.libiconv;
}
2 changes: 1 addition & 1 deletion nixos/modules/config/fonts/fontconfig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let
${lib.optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
<!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir>
${lib.optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
${lib.optionalString (pkgs.stdenv.hostPlatform.isx86_64 && cfg.cache32Bit) ''
<cachedir>${cache32}</cachedir>
''}
''}
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/config/ldso.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in {

config = {
assertions = [
{ assertion = isNull config.environment.ldso32 || pkgs.stdenv.isx86_64;
{ assertion = isNull config.environment.ldso32 || pkgs.stdenv.hostPlatform.isx86_64;
message = "Option environment.ldso32 currently only works on x86_64.";
}
];
Expand All @@ -44,7 +44,7 @@ in {
"d /${libDir} 0755 root root - -"
"L+ /${libDir}/${ldsoBasename} - - - - ${config.environment.ldso}"
]
) ++ optionals pkgs.stdenv.isx86_64 (
) ++ optionals pkgs.stdenv.hostPlatform.isx86_64 (
if isNull config.environment.ldso32 then [
"r /${libDir32}/${ldsoBasename32} - - - - -"
] else [
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let

# Forces 32bit pulseaudio and alsa-plugins to be built/supported for apps
# using 32bit alsa on 64bit linux.
enable32BitAlsaPlugins = cfg.support32Bit && pkgs.stdenv.isx86_64 && (pkgs.pkgsi686Linux.alsa-lib != null && pkgs.pkgsi686Linux.libpulseaudio != null);
enable32BitAlsaPlugins = cfg.support32Bit && pkgs.stdenv.hostPlatform.isx86_64 && (pkgs.pkgsi686Linux.alsa-lib != null && pkgs.pkgsi686Linux.libpulseaudio != null);


myConfigFile =
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/stub-ld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ in {

config = mkIf cfg.enable {
environment.ldso = mkDefault stub-ld;
environment.ldso32 = mkIf pkgs.stdenv.isx86_64 (mkDefault stub-ld32);
environment.ldso32 = mkIf pkgs.stdenv.hostPlatform.isx86_64 (mkDefault stub-ld32);
};

meta.maintainers = with lib.maintainers; [ tejing ];
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/hardware/graphics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ in
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable32Bit -> pkgs.stdenv.isx86_64;
assertion = cfg.enable32Bit -> pkgs.stdenv.hostPlatform.isx86_64;
message = "`hardware.graphics.enable32Bit` only makes sense on a 64-bit system.";
}
{
Expand All @@ -112,7 +112,7 @@ in
systemd.tmpfiles.settings.graphics-driver = {
"/run/opengl-driver"."L+".argument = toString driversEnv;
"/run/opengl-driver-32" =
if pkgs.stdenv.isi686 then
if pkgs.stdenv.hostPlatform.isi686 then
{ "L+".argument = "opengl-driver"; }
else if cfg.enable32Bit then
{ "L+".argument = toString driversEnv32; }
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/profiles/all-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ in
# VMware support.
"mptspi" "vmxnet3" "vsock"
] ++ lib.optional platform.isx86 "vmw_balloon"
++ lib.optionals (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) [
++ lib.optionals (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) [
"vmw_vmci" "vmwgfx" "vmw_vsock_vmci_transport"

# Hyper-V support.
Expand All @@ -68,7 +68,7 @@ in

# Broadcom
"vc4"
] ++ lib.optionals pkgs.stdenv.isAarch64 [
] ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch64 [
# Most of the following falls into two categories:
# - early KMS / early display
# - early storage (e.g. USB) support
Expand Down
8 changes: 1 addition & 7 deletions nixos/modules/profiles/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@
pkgs.cryptsetup # needed for dm-crypt volumes

# Some text editors.
(pkgs.vim.customize {
name = "vim";
vimrcConfig.packages.default = {
start = [ pkgs.vimPlugins.vim-nix ];
};
vimrcConfig.customRC = "syntax on";
})
pkgs.vim

# Some networking tools.
pkgs.fuse
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/audio/jack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
pcmPlugin = cfg.jackd.enable && cfg.alsa.enable;
loopback = cfg.jackd.enable && cfg.loopback.enable;

enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.isx86_64 && pkgs.pkgsi686Linux.alsa-lib != null;
enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.hostPlatform.isx86_64 && pkgs.pkgsi686Linux.alsa-lib != null;

umaskNeeded = versionOlder cfg.jackd.package.version "1.9.12";
bridgeNeeded = versionAtLeast cfg.jackd.package.version "1.9.12";
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/audio/snapserver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ let
lib.optionalString (val != null) "${val}";
os' = prefix: val:
lib.optionalString (val != null) (prefix + "${val}");
flatten = key: value:
toQueryString = key: value:
"&${key}=${value}";
in
"--stream.stream=\"${opt.type}://" + os opt.location + "?" + os' "name=" name
+ os' "&sampleformat=" opt.sampleFormat + os' "&codec=" opt.codec
+ lib.concatStrings (lib.mapAttrsToList lib.flatten opt.query) + "\"";
+ lib.concatStrings (lib.mapAttrsToList toQueryString opt.query) + "\"";

optionalNull = val: ret:
lib.optional (val != null) ret;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/desktops/pipewire/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let
'';
cfg = config.services.pipewire;
enable32BitAlsaPlugins = cfg.alsa.support32Bit
&& pkgs.stdenv.isx86_64
&& pkgs.stdenv.hostPlatform.isx86_64
&& pkgs.pkgsi686Linux.pipewire != null;

# The package doesn't output to $out/lib/pipewire directly so that the
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/logging/promtail.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ in {
PrivateUsers = true;

SupplementaryGroups = lib.optional (allowSystemdJournal) "systemd-journal";
} // (optionalAttrs (!pkgs.stdenv.isAarch64) { # FIXME: figure out why this breaks on aarch64
} // (optionalAttrs (!pkgs.stdenv.hostPlatform.isAarch64) { # FIXME: figure out why this breaks on aarch64
SystemCallFilter = "@system-service";
});
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/mame.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.mame;
mame = "mame${lib.optionalString pkgs.stdenv.is64bit "64"}";
mame = "mame${lib.optionalString pkgs.stdenv.hostPlatform.is64bit "64"}";
in
{
options = {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/tabby.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ in
- nixpkgs.config.cudaSupport
- nixpkgs.config.rocmSupport
- if stdenv.isDarwin && stdenv.isAarch64
- if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
IFF multiple acceleration methods are found to be enabled or if you
haven't set either `cudaSupport or rocmSupport` you will have to
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/networking/cjdns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ in
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_RAW CAP_SETUID";
ProtectSystem = true;
# Doesn't work on i686, causing service to fail
MemoryDenyWriteExecute = !pkgs.stdenv.isi686;
MemoryDenyWriteExecute = !pkgs.stdenv.hostPlatform.isi686;
ProtectHome = true;
PrivateTmp = true;
};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/networking/nsd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ in

reuseport = mkOption {
type = types.bool;
default = pkgs.stdenv.isLinux;
defaultText = literalExpression "pkgs.stdenv.isLinux";
default = pkgs.stdenv.hostPlatform.isLinux;
defaultText = literalExpression "pkgs.stdenv.hostPlatform.isLinux";
description = ''
Whether to enable SO_REUSEPORT on all used sockets. This lets multiple
processes bind to the same port. This speeds up operation especially
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/video/frigate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ in
libva-utils
procps
radeontop
] ++ lib.optionals (!stdenv.isAarch64) [
] ++ lib.optionals (!stdenv.hostPlatform.isAarch64) [
# not available on aarch64-linux
intel-gpu-tools
];
Expand Down
9 changes: 9 additions & 0 deletions nixos/modules/services/web-apps/pretalx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ in
'')
];

services.logrotate.settings.pretalx = {
files = "${cfg.settings.filesystem.logs}/*.log";
su = "${cfg.user} ${cfg.group}";
frequency = "weekly";
rotate = "12";
copytruncate = true;
compress = true;
};

services = {
nginx = lib.mkIf cfg.nginx.enable {
enable = true;
Expand Down
9 changes: 9 additions & 0 deletions nixos/modules/services/web-apps/pretix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,15 @@ in
'')
];

services.logrotate.settings.pretix = {
files = "${cfg.settings.pretix.logdir}/*.log";
su = "${cfg.user} ${cfg.group}";
frequency = "weekly";
rotate = "12";
copytruncate = true;
compress = true;
};

services = {
nginx = mkIf cfg.nginx.enable {
enable = true;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/stage-1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ let

setHostId = optionalString (config.networking.hostId != null) ''
hi="${config.networking.hostId}"
${if pkgs.stdenv.isBigEndian then ''
${if pkgs.stdenv.hostPlatform.isBigEndian then ''
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > /etc/hostid
'' else ''
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > /etc/hostid
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ in

# Increase numeric PID range (set directly instead of copying a one-line file from systemd)
# https://github.com/systemd/systemd/pull/12226
boot.kernel.sysctl."kernel.pid_max" = mkIf pkgs.stdenv.is64bit (lib.mkDefault 4194304);
boot.kernel.sysctl."kernel.pid_max" = mkIf pkgs.stdenv.hostPlatform.is64bit (lib.mkDefault 4194304);

services.logrotate.settings = {
"/var/log/btmp" = mapAttrs (_: mkDefault) {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/tasks/network-interfaces.nix
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ let

hostidFile = pkgs.runCommand "gen-hostid" { preferLocalBuild = true; } ''
hi="${cfg.hostId}"
${if pkgs.stdenv.isBigEndian then ''
${if pkgs.stdenv.hostPlatform.isBigEndian then ''
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > $out
'' else ''
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > $out
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ in
};

assertions = [
{ assertion = cfg.enableNvidia && pkgs.stdenv.isx86_64 -> config.hardware.graphics.enable32Bit or false;
{ assertion = cfg.enableNvidia && pkgs.stdenv.hostPlatform.isx86_64 -> config.hardware.graphics.enable32Bit or false;
message = "Option enableNvidia on x86_64 requires 32-bit support libraries";
}];

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/xen-dom0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ in
config = lib.modules.mkIf cfg.enable {
assertions = [
{
assertion = pkgs.stdenv.isx86_64;
assertion = pkgs.stdenv.hostPlatform.isx86_64;
message = "Xen is currently not supported on ${pkgs.stdenv.hostPlatform.system}.";
}
{
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/filesender.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "filesender";
meta = {
maintainers = with lib.maintainers; [ nhnn ];
broken = pkgs.stdenv.isAarch64; # selenium.common.exceptions.WebDriverException: Message: Unsupported platform/architecture combination: linux/aarch64
broken = pkgs.stdenv.hostPlatform.isAarch64; # selenium.common.exceptions.WebDriverException: Message: Unsupported platform/architecture combination: linux/aarch64
};

nodes.filesender = { ... }: let
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/freetube.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let
nodes = { "${name}" = machine; };
meta.maintainers = with pkgs.lib.maintainers; [ kirillrdy ];
# time-out on ofborg
meta.broken = pkgs.stdenv.isAarch64;
meta.broken = pkgs.stdenv.hostPlatform.isAarch64;
enableOCR = true;

testScript = ''
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/installed-tests/gdk-pixbuf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ makeInstalledTest {
testConfig = {
# Tests allocate a lot of memory trying to exploit a CVE
# but qemu-system-i386 has a 2047M memory limit
virtualisation.memorySize = if pkgs.stdenv.isi686 then 2047 else 4096;
virtualisation.memorySize = if pkgs.stdenv.hostPlatform.isi686 then 2047 else 4096;
};

testRunnerFlags = [ "--timeout" "1800" ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/k3s/multi-node.nix
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ import ../make-test-python.nix (
m.start()
m.wait_for_unit("k3s")
is_aarch64 = "${toString pkgs.stdenv.isAarch64}" == "1"
is_aarch64 = "${toString pkgs.stdenv.hostPlatform.isAarch64}" == "1"
# wait for the agent to show up
server.wait_until_succeeds("k3s kubectl get node agent")
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/libvirtd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {

testScript = let
nixosInstallISO = (import ../release.nix {}).iso_minimal.${pkgs.stdenv.hostPlatform.system};
virshShutdownCmd = if pkgs.stdenv.isx86_64 then "shutdown" else "destroy";
virshShutdownCmd = if pkgs.stdenv.hostPlatform.isx86_64 then "shutdown" else "destroy";
in ''
start_all()
Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let
};

environment.systemPackages = [ testers.testPlay pkgs.pavucontrol ]
++ lib.optional pkgs.stdenv.isx86_64 testers.testPlay32;
++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 testers.testPlay32;
} // lib.optionalAttrs systemWide {
users.users.alice.extraGroups = [ "pulse-access" ];
systemd.services.pulseaudio.wantedBy = [ "multi-user.target" ];
Expand All @@ -54,7 +54,7 @@ let
machine.send_chars("testPlay \n")
machine.wait_for_file("/tmp/testPlay_success")
${lib.optionalString pkgs.stdenv.isx86_64 ''
${lib.optionalString pkgs.stdenv.hostPlatform.isx86_64 ''
machine.send_chars("testPlay32 \n")
machine.wait_for_file("/tmp/testPlay32_success")
''}
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/stub-ld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
libDir = pkgs.stdenv.hostPlatform.libDir;
ldsoBasename = lib.last (lib.splitString "/" pkgs.stdenv.cc.bintools.dynamicLinker);

check32 = pkgs.stdenv.isx86_64;
check32 = pkgs.stdenv.hostPlatform.isx86_64;
pkgs32 = pkgs.pkgsi686Linux;

libDir32 = pkgs32.stdenv.hostPlatform.libDir;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/sunshine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "sunshine";
meta = {
# test is flaky on aarch64
broken = pkgs.stdenv.isAarch64;
broken = pkgs.stdenv.hostPlatform.isAarch64;
maintainers = [ lib.maintainers.devusb ];
};

Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/wine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let
in
listToAttrs (
map (makeWineTest "winePackages" [ hello32 ]) variants
++ optionals pkgs.stdenv.is64bit
++ optionals pkgs.stdenv.hostPlatform.is64bit
(map (makeWineTest "wineWowPackages" [ hello32 hello64 ])
# This wayland combination times out after spending many hours.
# https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.wine.wineWowPackages-wayland.x86_64-linux
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/ario/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
taglib
];

postInstall = lib.optionalString stdenv.isDarwin ''
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
for file in $out/lib/ario/plugins/*.dylib; do
ln -s $file $out/lib/ario/plugins/$(basename $file .dylib).so
done
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/ashuffle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
dontUseCmakeConfigure = true;
nativeBuildInputs = [ cmake pkg-config meson ninja ];
buildInputs = [ libmpdclient yaml-cpp ]
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.CoreFoundation ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.CoreFoundation ];

mesonFlags = [ "-Dunsupported_use_system_yamlcpp=true" ];

Expand Down
Loading

0 comments on commit f0e657f

Please sign in to comment.