Use same stdenv for kernel and ZFS (#14)

This commit is contained in:
Lan Tian 2025-12-23 19:02:37 -08:00
parent 6165a9592d
commit 4d1b0c56ac
No known key found for this signature in database
GPG Key ID: 04E66B6B25A0862B
2 changed files with 45 additions and 35 deletions

View File

@ -44,9 +44,11 @@
kernels kernels
// packages // packages
// { // {
zfs-cachyos = pkgs.callPackage ./zfs-cachyos { zfs-cachyos = packages.linuxPackages-cachyos-latest.callPackage ./zfs-cachyos {
inherit inputs;
};
zfs-cachyos-lto = packages.linuxPackages-cachyos-latest-lto.callPackage ./zfs-cachyos {
inherit inputs; inherit inputs;
kernel = kernels.linux-cachyos-latest;
}; };
}; };
in in
@ -84,37 +86,48 @@
cachyosKernels = self.legacyPackages."${final.stdenv.hostPlatform.system}"; cachyosKernels = self.legacyPackages."${final.stdenv.hostPlatform.system}";
}; };
hydraJobs.packages = self.packages; hydraJobs = {
inherit (self) packages;
nixosConfigurations = lib.mapAttrs (n: v: v.config.system.build.toplevel) self.nixosConfigurations;
};
# Example configurations for testing CachyOS kernel # Example configurations for testing CachyOS kernel
nixosConfigurations = lib.genAttrs systems ( nixosConfigurations =
system: let
inputs.nixpkgs.lib.nixosSystem { mkSystem =
inherit system; kernelPackageName:
modules = [ inputs.nixpkgs.lib.nixosSystem {
( system = "x86_64-linux";
{ pkgs, config, ... }: modules = [
{ (
nixpkgs.overlays = [ self.overlays.pinned ]; { pkgs, config, ... }:
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest; {
nixpkgs.overlays = [ self.overlays.pinned ];
boot.kernelPackages = pkgs.cachyosKernels."${kernelPackageName}";
# ZFS test # ZFS test
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
boot.zfs.package = config.boot.kernelPackages.zfs_cachyos; boot.zfs.package = config.boot.kernelPackages.zfs_cachyos;
networking.hostId = "12345678"; networking.hostId = "12345678";
# Minimal config to make test configuration build # Minimal config to make test configuration build
boot.loader.grub.devices = [ "/dev/vda" ]; boot.loader.grub.devices = [ "/dev/vda" ];
fileSystems."/" = { fileSystems."/" = {
device = "tmpfs"; device = "tmpfs";
fsType = "tmpfs"; fsType = "tmpfs";
}; };
system.stateVersion = lib.trivial.release; system.stateVersion = lib.trivial.release;
} }
) )
]; ];
} };
); in
{
cachyos-latest = mkSystem "linuxPackages-cachyos-latest";
cachyos-latest-lto = mkSystem "linuxPackages-cachyos-latest-lto";
cachyos-lts = mkSystem "linuxPackages-cachyos-lts";
cachyos-lts-lto = mkSystem "linuxPackages-cachyos-lts-lto";
};
}; };
} }
); );

View File

@ -14,15 +14,12 @@ in
lib.mapAttrs' ( lib.mapAttrs' (
n: v: n: v:
let let
zfsPackage = callPackage ../zfs-cachyos {
inherit inputs;
kernel = v;
};
packages = kernelModuleLLVMOverride ( packages = kernelModuleLLVMOverride (
(linuxKernel.packagesFor v).extend ( (linuxKernel.packagesFor v).extend (
final: prev: { final: prev: {
zfs_cachyos = zfsPackage; zfs_cachyos = final.callPackage ../zfs-cachyos {
inherit inputs;
};
} }
) )
); );