Skip to content

Commit

Permalink
linux_cachyos: 6.6.0 -> 6.6.1; refactor (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroHLC authored Nov 9, 2023
1 parent fac0eb5 commit 3398a78
Show file tree
Hide file tree
Showing 10 changed files with 393 additions and 242 deletions.
98 changes: 12 additions & 86 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
{ flakes, self ? flakes.self, selfOverlay ? self.overlays.default }:
final: prev:
let
# Required to load version files.
inherit (final.lib.trivial) importJSON;
# Required to load version files and warning.
inherit (final.lib.trivial) importJSON warn;

# Our utilities/helpers.
nyxUtils = import ../shared/utils.nix { inherit (final) lib; nyxOverlay = selfOverlay; };
inherit (nyxUtils) dropAttrsUpdateScript dropUpdateScript multiOverride multiOverrides overrideDescription;
inherit (nyxUtils) dropUpdateScript multiOverride multiOverrides overrideDescription;

# Helps when calling .nix that will override packages.
callOverride = path: attrs: import path ({ inherit final flakes nyxUtils prev gitOverride; } // attrs);
Expand All @@ -29,37 +29,16 @@ let
prev = prev.pkgsi686Linux;
} // attrs);

# CachyOS repeating stuff.
cachyVersions = importJSON ../pkgs/linux-cachyos/versions.json;

# CachyOS repeating stuff.
cachyZFS = _finalAttrs: prevAttrs:
let
zfs = prevAttrs.zfsUnstable.overrideAttrs (prevAttrs: {
src =
final.fetchFromGitHub {
owner = "cachyos";
repo = "zfs";
inherit (cachyVersions.zfs) rev hash;
};
meta = prevAttrs.meta // { broken = false; };
patches = [ ];
});
in
{
kernel_configfile = prevAttrs.kernel.configfile;
inherit zfs;
zfsStable = zfs;
zfsUnstable = zfs;
};

# Magic helper for _git packages.
gitOverride = import ../shared/git-override.nix {
inherit (final) lib callPackage fetchFromGitHub fetchFromGitLab;
nyx = self;
fetchRevFromGitHub = final.callPackage ../shared/github-rev-fetcher.nix { };
fetchRevFromGitLab = final.callPackage ../shared/gitlab-rev-fetcher.nix { };
};

# Too much variations
cachyosPackages = callOverride ../pkgs/linux-cachyos/all-packages.nix { };
in
{
inherit nyxUtils;
Expand Down Expand Up @@ -125,65 +104,12 @@ in

latencyflex-vulkan = final.callPackage ../pkgs/latencyflex-vulkan { };

linux_cachyos = final.callPackage ../pkgs/linux-cachyos {
inherit cachyVersions;
cachyFlavor = rec {
taste = "linux-cachyos";
configfile = final.callPackage ../pkgs/linux-cachyos/configfile-raw.nix {
inherit cachyVersions;
cachyTaste = taste;
};
config = import ../pkgs/linux-cachyos/config-x86_64-linux.nix;
baked = final.callPackage ../pkgs/linux-cachyos/configfile-bake.nix {
inherit configfile;
};
};
kernelPatches = [ ]; # feel free to override.
};

linux_cachyos-server = final.callPackage ../pkgs/linux-cachyos {
inherit cachyVersions;
cachyFlavor = rec {
taste = "linux-cachyos-server";
configfile = final.callPackage ../pkgs/linux-cachyos/configfile-raw.nix {
inherit cachyVersions;
cachyTaste = taste;
};
config = import ../pkgs/linux-cachyos/config-x86_64-linux-server.nix;
baked = final.callPackage ../pkgs/linux-cachyos/configfile-bake.nix {
inherit configfile;
};
};
kernelPatches = [ ]; # feel free to override.
};

linux-hardened_cachyos = final.callPackage ../pkgs/linux-cachyos {
inherit cachyVersions;
cachyFlavor = rec {
taste = "linux-cachyos-hardened";
configfile = final.callPackage ../pkgs/linux-cachyos/configfile-raw.nix {
inherit cachyVersions;
cachyTaste = taste;
};
config = import ../pkgs/linux-cachyos/config-x86_64-linux-hardened.nix;
baked = final.callPackage ../pkgs/linux-cachyos/configfile-bake.nix {
inherit configfile;
};
};
kernelPatches = [ ]; # feel free to override.
};

linuxPackages_cachyos = (dropAttrsUpdateScript
((final.linuxPackagesFor final.linux_cachyos).extend cachyZFS)
) // { _description = "Kernel modules for linux_cachyos"; };

linuxPackages_cachyos-server = (dropAttrsUpdateScript
((final.linuxPackagesFor final.linux_cachyos-server).extend cachyZFS)
) // { _description = "Kernel modules for linux_cachyos-server"; };

linuxPackages-hardened_cachyos = (dropAttrsUpdateScript
((final.linuxPackagesFor final.linux-hardened_cachyos).extend cachyZFS)
) // { _description = "Kernel modules for linux-hardened_cachyos"; };
linuxPackages_cachyos = cachyosPackages.cachyos;
linuxPackages_cachyos-server = cachyosPackages.cachyos-server;
linuxPackages_cachyos-hardened = cachyosPackages.cachyos-hardened;
linuxPackages-hardened_cachyos = warn
"`linuxPackages-hardened_cachyos` was renamed to `linuxPackages_cachyos-hardened`"
(final.linuxPackages_cachyos-hardened // { recurseForDerivations = false; });

luxtorpeda = final.callPackage ../pkgs/luxtorpeda {
luxtorpedaVersion = importJSON ../pkgs/luxtorpeda/version.json;
Expand Down
36 changes: 36 additions & 0 deletions pkgs/linux-cachyos/all-packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ final, ... }:

let
# CachyOS repeating stuff.
mainVersions = final.lib.trivial.importJSON ./versions.json;

mkCachyKernel = attrs: final.callPackage ./make.nix
({ versions = mainVersions; } // attrs);
in
{
inherit mainVersions mkCachyKernel;

cachyos = mkCachyKernel {
taste = "linux-cachyos";
configPath = ./config-nix/cachyos.x86_64-linux.nix;
};

cachyos-server = mkCachyKernel {
taste = "linux-cachyos-server";
configPath = ./config-nix/cachyos-server.x86_64-linux.nix;
basicCachy = false;
cpuSched = "eevdf";
ticksHz = 300;
tickRate = "idle";
preempt = "server";
hugePages = "madvise";
withDAMON = true;
description = "Linux EEVDF scheduler Kernel by CachyOS targeted for Servers";
};

cachyos-hardened = mkCachyKernel {
taste = "archive/linux-cachyos-hardened";
configPath = ./config-nix/cachyos-hardened.x86_64-linux.nix;
cpuSched = "hardened";
};
}
Loading

1 comment on commit 3398a78

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to build 9 packages:

9 packages failed
  • linuxPackages_cachyos.kernel
  • linuxPackages_cachyos.cpupower
  • linuxPackages_cachyos.usbip
  • linuxPackages_cachyos-hardened.kernel
  • linuxPackages_cachyos-hardened.cpupower
  • linuxPackages_cachyos-hardened.usbip
  • linuxPackages_cachyos-server.kernel
  • linuxPackages_cachyos-server.cpupower
  • linuxPackages_cachyos-server.usbip
New build failures found! Consider adding failed builds to devshells/failures.nix @PedroHLC

Please sign in to comment.