Skip to content

Commit

Permalink
Merge branch 'main' into darwin-support
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Jun 30, 2024
2 parents 86ee7e2 + e938f07 commit 204bb10
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 49 deletions.
2 changes: 1 addition & 1 deletion dev/private.narHash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256-MU++F+34tn7/uKXZHQUHFeyF3TEYOiofTy9p3ANCrSQ=
sha256-eeoCvcTflhCki44jpVJpHAUOhdC1KyZU6B3l+Eg9Fi0=
26 changes: 13 additions & 13 deletions dev/private/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev/private/flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "srvos private inputs";

inputs.nixos-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
inputs.nixos-stable.url = "github:NixOS/nixpkgs/nixos-24.05";

inputs.nix-darwin.url = "github:LnL7/nix-darwin";
inputs.nix-darwin.inputs.nixpkgs.follows = "";
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions nixos/common/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A default configuration that applies to all servers.
# Common configuration across *all* the machines
{ options, config, lib, ... }:
{ config, lib, ... }:
{

imports = [
Expand All @@ -16,8 +16,7 @@
./zfs.nix
];

system.switch = lib.optionalAttrs (options.system.switch ? enableNg) {
# can be dropped after 24.05
system.switch = {
enable = lib.mkDefault false;
enableNg = lib.mkDefault true;
};
Expand All @@ -27,10 +26,7 @@
# - for containers we currently rely on the `stage-2` init script that sets up our /etc
# - For systemd in initrd we have now systemd-repart, but many images still set boot.growPartition
boot.initrd.systemd.enable = lib.mkDefault (
!(if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then
config.boot.swraid.enable
else
config.boot.initrd.services.swraid.enable) &&
!config.boot.swraid.enable &&
!config.boot.isContainer &&
!config.boot.growPartition
);
Expand All @@ -42,7 +38,6 @@
# This is pulled in by the container profile, but it seems broken and causes
# unnecessary rebuilds.
noXlibs = false;
} // lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") {
# Don't install the /lib/ld-linux.so.2 stub. This saves one instance of
# nixpkgs.
ldso32 = null;
Expand Down
9 changes: 2 additions & 7 deletions nixos/common/mdmonitor-fix.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{ lib, ... }: {
{
# See https://github.com/NixOS/nixpkgs/issues/72394#issuecomment-549110501
config =
if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then {
boot.swraid.mdadmConf = "MAILADDR root";
} else {
boot.initrd.services.swraid.mdadmConf = "MAILADDR root";
};
boot.swraid.mdadmConf = "MAILADDR root";
}
2 changes: 1 addition & 1 deletion nixos/mixins/cloud-init.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
settings.ssh_deletekeys = lib.mkDefault false;

## Automatically enable the filesystems that are used
} // (lib.genAttrs ([ "btrfs" "ext4" ] ++ lib.optional (lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11") "xfs")
} // (lib.genAttrs ([ "btrfs" "ext4" "xfs" ])
(fsName: {
enable = lib.mkDefault (lib.any (fs: fs.fsType == fsName) (lib.attrValues config.fileSystems));
}));
Expand Down
8 changes: 2 additions & 6 deletions nixos/mixins/telegraf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ let
# potentially wrong if the nvme is not used at boot...
hasNvme = lib.any (m: m == "nvme") config.boot.initrd.availableKernelModules;

supportsFs = fs:
if builtins.isAttrs config.boot.supportedFilesystems then
config.boot.supportedFilesystems.${fs} or false
else # FIXME: When nixos 24.05 is released, supportedFilesystems will be always an attrset
lib.any (fs2: fs2 == fs) config.boot.supportedFilesystems;
supportsFs = fs: config.boot.supportedFilesystems.${fs} or false;

ipv6DadCheck = pkgs.writeShellScript "ipv6-dad-check" ''
${pkgs.iproute2}/bin/ip --json addr | \
Expand Down Expand Up @@ -135,7 +131,7 @@ in
zfs = {
poolMetrics = true;
};
} // lib.optionalAttrs (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then config.boot.swraid.enable else config.boot.initrd.services.swraid.enable) {
} // lib.optionalAttrs config.boot.swraid.enable {
mdstat = { };
};
outputs.prometheus_client = {
Expand Down
2 changes: 0 additions & 2 deletions nixos/modules/github-runners/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ in
};

config = {
warnings = lib.optional (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11" && lib.any (runner: runner.nodeRuntimes != [ "node20" ]) (builtins.attrValues cfg))
"services.srvos-github-runner.<name>.nodeRuntimes is only supported in NixOS 23.11 and later";
assertions =
(mapAttrsToList
(_name: c:
Expand Down
7 changes: 1 addition & 6 deletions nixos/modules/github-runners/service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
with lib;

let
package =
if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then
# we do not have this option in 23.04 yet
cfg.package.override { inherit (cfg) nodeRuntimes; }
else
cfg.package;
package = cfg.package.override { inherit (cfg) nodeRuntimes; };
in
{
description = "GitHub Actions runner";
Expand Down
1 change: 0 additions & 1 deletion nixos/server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
];
# Print the URL instead on servers
variables.BROWSER = "echo";
} // lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") {
# Don't install the /lib/ld-linux.so.2 and /lib64/ld-linux-x86-64.so.2
# stubs. Server users should know what they are doing.
stub-ld.enable = lib.mkDefault false;
Expand Down

0 comments on commit 204bb10

Please sign in to comment.