Skip to content

Commit

Permalink
Merge pull request #154 from nix-community/upgrade-aarch64
Browse files Browse the repository at this point in the history
upgrade zfs on aarch64
  • Loading branch information
Mic92 authored Dec 23, 2023
2 parents d655cc0 + 3a769c8 commit 1d92ed3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 1,4' # Run twice a week
# schedule:
# - cron: '0 0 * * 1,4' # Run twice a week

jobs:
lockfile:
Expand Down
25 changes: 1 addition & 24 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
queue_rules:
- name: default
merge_conditions:
- check-success=Evaluate flake.nix
- check-success=check kexec-installer-2311 [x86_64-linux]
- check-success=check kexec-installer-unstable [x86_64-linux]
- check-success=check shellcheck [x86_64-linux]
- check-success=images (nixos-23.11, nscloud-ubuntu-22.04-arm64-4x16)
- check-success=images (nixos-23.11, ubuntu-latest)
- check-success=images (nixos-unstable, nscloud-ubuntu-22.04-arm64-4x16)
- check-success=images (nixos-unstable, ubuntu-latest)
- check-success=package kexec-installer-nixos-2311 [aarch64-linux]
- check-success=package kexec-installer-nixos-2311 [x86_64-linux]
- check-success=package kexec-installer-nixos-2311-noninteractive [aarch64-linux]
- check-success=package kexec-installer-nixos-2311-noninteractive [x86_64-linux]
- check-success=package kexec-installer-nixos-unstable [aarch64-linux]
- check-success=package kexec-installer-nixos-unstable [x86_64-linux]
- check-success=package kexec-installer-nixos-unstable-noninteractive [aarch64-linux]
- check-success=package kexec-installer-nixos-unstable-noninteractive [x86_64-linux]
- check-success=package netboot-installer-nixos-2311 [aarch64-linux]
- check-success=package netboot-installer-nixos-2311 [x86_64-linux]
- check-success=package netboot-installer-nixos-unstable [aarch64-linux]
- check-success=package netboot-installer-nixos-unstable [x86_64-linux]
- check-success=package netboot-nixos-2311 [aarch64-linux]
- check-success=package netboot-nixos-2311 [x86_64-linux]
- check-success=package netboot-nixos-unstable [aarch64-linux]
- check-success=package netboot-nixos-unstable [x86_64-linux]
- check-success=buildbot/nix-eval
defaults:
actions:
queue:
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

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

48 changes: 25 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
inputs.nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small";
inputs.nixos-2311.url = "github:NixOS/nixpkgs/release-23.11";

nixConfig.extra-substituters = [
"https://cache.garnix.io"
];
nixConfig.extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
nixConfig.extra-substituters = [ "https://nix-community.cachix.org" ];
nixConfig.extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];

outputs = { self, nixos-unstable, nixos-2311 }:
let
Expand Down Expand Up @@ -51,24 +47,30 @@
# TODO: also add a test here once we have https://github.com/NixOS/nixpkgs/pull/228346 merged
netboot-installer = ./nix/netboot-installer/module.nix;
};
checks.x86_64-linux =
checks =
let
pkgs = nixos-unstable.legacyPackages.x86_64-linux;
in
{
kexec-installer-unstable = pkgs.callPackage ./nix/kexec-installer/test.nix {
kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-unstable-noninteractive;
};
shellcheck = pkgs.runCommand "shellcheck"
# re-export the packages as checks
packages = forAllSystems (system: nixos-unstable.lib.mapAttrs' (n: nixos-unstable.lib.nameValuePair "package-${n}") self.packages.${system});
checks =
let
pkgs = nixos-unstable.legacyPackages.x86_64-linux;
in
{
nativeBuildInputs = [ pkgs.shellcheck ];
} ''
shellcheck ${(pkgs.nixos [self.nixosModules.kexec-installer]).config.system.build.kexecRun}
touch $out
'';
kexec-installer-2311 = nixos-2311.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix {
kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-2311-noninteractive;
};
};
kexec-installer-unstable = pkgs.callPackage ./nix/kexec-installer/test.nix {
kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-unstable-noninteractive;
};
shellcheck = pkgs.runCommand "shellcheck"
{
nativeBuildInputs = [ pkgs.shellcheck ];
} ''
shellcheck ${(pkgs.nixos [self.nixosModules.kexec-installer]).config.system.build.kexecRun}
touch $out
'';
kexec-installer-2311 = nixos-2311.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix {
kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-2311-noninteractive;
};
};
in
nixos-unstable.lib.recursiveUpdate packages { x86_64-linux = checks; };
};
}
5 changes: 4 additions & 1 deletion nix/installer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
system.stateVersion = config.system.nixos.version;

# use latest kernel we can support to get more hardware support
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernelPackages = lib.mkDefault (pkgs.zfs.override {
removeLinuxDRM = pkgs.hostPlatform.isAarch64;
}).latestCompatibleLinuxPackages;
boot.zfs.removeLinuxDRM = lib.mkDefault pkgs.hostPlatform.isAarch64;

# IPMI SOL console redirection stuff
boot.kernelParams =
Expand Down
13 changes: 12 additions & 1 deletion nix/noninteractive.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,20 @@
"dm-raid"
];
extraModulePackages = [
config.boot.kernelPackages.zfs
(config.boot.kernelPackages.zfs.override {
inherit (config.boot.zfs) removeLinuxDRM;
})
];
};

boot.kernelPatches = lib.optional (config.boot.zfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") {
name = "export-neon-symbols-as-gpl";
patch = pkgs.fetchpatch {
url = "https://github.com/torvalds/linux/commit/aaeca98456431a8d9382ecf48ac4843e252c07b3.patch";
hash = "sha256-L2g4G1tlWPIi/QRckMuHDcdWBcKpObSWSRTvbHRIwIk=";
revert = true;
};
};

networking.hostId = lib.mkDefault "8425e349";
}

0 comments on commit 1d92ed3

Please sign in to comment.