modules.system.kernel: remove cachyos kernel

This commit is contained in:
2025-05-31 11:20:56 +08:00
parent f53e3d726a
commit ba9c67d7e8
6 changed files with 53 additions and 84 deletions

View File

@@ -23,7 +23,6 @@ inputs:
nixpkgs.march = "znver2";
initrd.sshd = {};
networking = {};
# do not use cachyos kernel, beesd + cachyos kernel + heavy io = system freeze, not sure why
};
services =
{

View File

@@ -1,6 +1,5 @@
* 完善 slurm 文档,调整 slurm 设置内存nice
* 调整 sbatch-tui 选项
* 打包 cachyos
* 打包 intel 编译器
* 切换到 niri清理 plasma
* 调整其它用户的 zsh 配置

16
flake.lock generated
View File

@@ -38,21 +38,6 @@
"type": "github"
}
},
"cachyos-lts": {
"locked": {
"lastModified": 1743535541,
"narHash": "sha256-OlBtXY26w9OcAmpqrTvxaG4/rfDdavauQF2eRxb+ySs=",
"owner": "drakon64",
"repo": "nixos-cachyos-kernel",
"rev": "8516d89c4e0c4a25cea1be8431db3963359ee81b",
"type": "github"
},
"original": {
"owner": "drakon64",
"repo": "nixos-cachyos-kernel",
"type": "github"
}
},
"catppuccin": {
"inputs": {
"nixpkgs": [
@@ -824,7 +809,6 @@
"inputs": {
"blog": "blog",
"bscpkgs": "bscpkgs",
"cachyos-lts": "cachyos-lts",
"catppuccin": "catppuccin",
"concurrencpp": "concurrencpp",
"cppcoro": "cppcoro",

View File

@@ -26,7 +26,6 @@
};
catppuccin = { url = "github:catppuccin/nix"; inputs.nixpkgs.follows = "nixpkgs"; };
bscpkgs = { url = "github:CHN-beta/bscpkgs"; inputs.nixpkgs.follows = "nixpkgs"; };
cachyos-lts.url = "github:drakon64/nixos-cachyos-kernel";
nixvirt = { url = "github:CHN-beta/NixVirt"; inputs.nixpkgs.follows = "nixpkgs"; };
misskey = { url = "git+https://github.com/CHN-beta/misskey?submodules=1"; flake = false; };

View File

@@ -4,74 +4,64 @@ inputs:
{
variant = mkOption
{
type = types.nullOr (types.enum [ "nixos" "xanmod-lts" "xanmod-latest" "cachyos" "cachyos-lts" ]);
type = types.nullOr (types.enum [ "nixos" "xanmod-lts" "xanmod-latest" ]);
default = "xanmod-lts";
};
patches = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
modules.modprobeConfig = mkOption { type = types.listOf types.str; default = []; };
};
config = let inherit (inputs.config.nixos.system) kernel; in inputs.lib.mkMerge
[
config = let inherit (inputs.config.nixos.system) kernel; in
{
boot =
{
boot =
kernelModules = [ "br_netfilter" ];
# modprobe --show-depends
initrd.availableKernelModules =
[
"bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "sd_mod"
"sr_mod" "usbcore" "usbhid" "usbip-core" "usb-common" "usb_storage" "vhci-hcd" "virtio" "virtio_blk"
"virtio_net" "virtio_ring" "virtio_scsi" "cryptd" "libaes"
"ahci" "ata_piix" "nvme" "sdhci_acpi" "virtio_pci" "xhci_pci"
# networking for nas
"igb"
# disk for srv1
"megaraid_sas"
# disks for cluster
"nfs" "nfsv4"
# netowrk for srv1
"bnx2x" "tg3"
# network for srv2
"e1000e" "igb" "atlantic" "igc"
# temp wireless for nas
"r8712u"
# network for srv3
"igb"
# touchscreen for one
"pinctrl-tigerlake"
]
++ (inputs.lib.optionals (kernel.variant != "nixos") [ "crypto_simd" ]);
extraModulePackages = with inputs.config.boot.kernelPackages; [ v4l2loopback zenpower ];
extraModprobeConfig = builtins.concatStringsSep "\n" kernel.modules.modprobeConfig;
kernelParams = [ "delayacct" ];
kernelPackages = inputs.lib.mkIf (kernel.variant != null)
{
kernelModules = [ "br_netfilter" ];
# modprobe --show-depends
initrd.availableKernelModules =
[
"bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "sd_mod"
"sr_mod" "usbcore" "usbhid" "usbip-core" "usb-common" "usb_storage" "vhci-hcd" "virtio" "virtio_blk"
"virtio_net" "virtio_ring" "virtio_scsi" "cryptd" "libaes"
"ahci" "ata_piix" "nvme" "sdhci_acpi" "virtio_pci" "xhci_pci"
# networking for nas
"igb"
# disk for srv1
"megaraid_sas"
# disks for cluster
"nfs" "nfsv4"
# netowrk for srv1
"bnx2x" "tg3"
# network for srv2
"e1000e" "igb" "atlantic" "igc"
# temp wireless for nas
"r8712u"
# network for srv3
"igb"
# touchscreen for one
"pinctrl-tigerlake"
]
++ (inputs.lib.optionals (kernel.variant != "nixos") [ "crypto_simd" ]);
extraModulePackages = with inputs.config.boot.kernelPackages; [ v4l2loopback zenpower ];
extraModprobeConfig = builtins.concatStringsSep "\n" kernel.modules.modprobeConfig;
kernelParams = [ "delayacct" ];
kernelPackages = inputs.lib.mkIf (kernel.variant != null)
{
nixos = inputs.pkgs.linuxPackages;
xanmod-lts = inputs.pkgs.linuxPackages_xanmod;
xanmod-latest = inputs.pkgs.linuxPackages_xanmod_latest;
cachyos = inputs.pkgs.linuxPackages_cachyos;
# TODO: package cachyos-lts
cachyos-lts = inputs.pkgs.linuxPackages_cachyos_lts;
}.${kernel.variant};
kernelPatches =
let
patches =
{
hibernate-progress =
[{
name = "hibernate-progress";
patch =
let version = inputs.lib.versions.majorMinor inputs.config.boot.kernelPackages.kernel.version;
in ./hibernate-progress-${version}.patch;
}];
};
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
};
}
# enable scx when using cachyos
(
inputs.lib.mkIf (builtins.elem kernel.variant [ "cachyos" "cachyos-lts" ])
{ services.scx = { enable = true; scheduler = "scx_rustland"; }; }
)
];
nixos = inputs.pkgs.linuxPackages;
xanmod-lts = inputs.pkgs.linuxPackages_xanmod;
xanmod-latest = inputs.pkgs.linuxPackages_xanmod_latest;
}.${kernel.variant};
kernelPatches =
let
patches =
{
hibernate-progress =
[{
name = "hibernate-progress";
patch =
let version = inputs.lib.versions.majorMinor inputs.config.boot.kernelPackages.kernel.version;
in ./hibernate-progress-${version}.patch;
}];
};
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
};
};
}

View File

@@ -39,8 +39,6 @@ in platformConfig //
{
inherit (inputs.topInputs.nix-vscode-extensions.overlays.default final prev) nix-vscode-extensions;
firefox-addons = (import "${inputs.topInputs.rycee}" { inherit (prev) pkgs; }).firefox-addons;
linuxPackages_cachyos_lts =
final.linuxPackagesFor (inputs.topInputs.cachyos-lts.overlays.default final prev).linuxPackages_cachyos;
})
inputs.topInputs.self.overlays.default
(final: prev: