diff --git a/devices/vps6/default.nix b/devices/vps6/default.nix index 90ae4242..66c4f2d5 100644 --- a/devices/vps6/default.nix +++ b/devices/vps6/default.nix @@ -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 = { diff --git a/doc/todo.md b/doc/todo.md index 4fe9880d..b1cc8cfb 100644 --- a/doc/todo.md +++ b/doc/todo.md @@ -1,6 +1,5 @@ * 完善 slurm 文档,调整 slurm 设置:内存,nice * 调整 sbatch-tui 选项 -* 打包 cachyos * 打包 intel 编译器 * 切换到 niri,清理 plasma * 调整其它用户的 zsh 配置 diff --git a/flake.lock b/flake.lock index 48b89c74..d0d81b7a 100644 --- a/flake.lock +++ b/flake.lock @@ -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", diff --git a/flake.nix b/flake.nix index 6009eb5d..02a0336b 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; diff --git a/modules/system/kernel/default.nix b/modules/system/kernel/default.nix index 8b673bc4..362df2a7 100644 --- a/modules/system/kernel/default.nix +++ b/modules/system/kernel/default.nix @@ -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); + }; + }; } diff --git a/modules/system/nixpkgs/buildNixpkgsConfig.nix b/modules/system/nixpkgs/buildNixpkgsConfig.nix index 78aa27c0..61fb562e 100644 --- a/modules/system/nixpkgs/buildNixpkgsConfig.nix +++ b/modules/system/nixpkgs/buildNixpkgsConfig.nix @@ -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: