Fix self reference in README (Fix #22)

This commit is contained in:
Lan Tian 2026-01-10 22:32:31 -08:00
parent f620f05781
commit eac41befde
No known key found for this signature in database
GPG Key ID: 04E66B6B25A0862B

143
README.md
View File

@ -85,35 +85,36 @@ Add the repo's overlay in your NixOS configuration, this will expose the package
```nix ```nix
{ {
nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem { outputs = { nix-cachyos-kernel, ... }: {
system = "x86_64-linux"; nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
modules = [ system = "x86_64-linux";
( modules = [
{ pkgs, ... }: (
{ { pkgs, ... }:
nixpkgs.overlays = [ {
# Build the kernels on top of nixpkgs version in your flake. nixpkgs.overlays = [
# Binary cache may be unavailable for the kernel/nixpkgs version combos. # Build the kernels on top of nixpkgs version in your flake.
self.overlays.default # Binary cache may be unavailable for the kernel/nixpkgs version combos.
nix-cachyos-kernel.overlays.default
# Alternatively: use the exact kernel versions as defined in this repo. # Alternatively: use the exact kernel versions as defined in this repo.
# Guarantees you have binary cache. # Guarantees you have binary cache.
self.overlays.pinned nix-cachyos-kernel.overlays.pinned
# Only use one of the two overlays! # Only use one of the two overlays!
]; ];
# ... your other configs # ... your other configs
} }
) )
]; ];
};
}; };
} }
``` ```
Then specify `pkgs.cachyosKernels.linuxPackages-cachyos-latest` (or other variants you'd like) in your `boot.kernelPackages` option. Then specify `pkgs.cachyosKernels.linuxPackages-cachyos-latest` (or other variants you'd like) in your `boot.kernelPackages` option.
### Binary cache ### Binary cache
I'm running a Hydra CI to build the kernels and push them to my Attic binary cache. You can see the build status here: <https://hydra.lantian.pub/jobset/lantian/nix-cachyos-kernel> I'm running a Hydra CI to build the kernels and push them to my Attic binary cache. You can see the build status here: <https://hydra.lantian.pub/jobset/lantian/nix-cachyos-kernel>
@ -144,31 +145,35 @@ This repo also has [Garnix CI](https://garnix.io) set up, and should work as lon
```nix ```nix
{ {
nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem { outputs = { nix-cachyos-kernel, ... }: {
system = "x86_64-linux"; nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
modules = [ system = "x86_64-linux";
( modules = [
{ pkgs, ... }: (
{ { pkgs, ... }:
nixpkgs.overlays = [ self.overlays.pinned ]; {
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest; nixpkgs.overlays = [ nix-cachyos-kernel.overlays.pinned ];
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest;
# Binary cache # Binary cache
nix.settings.substituters = [ "https://attic.xuyh0120.win/lantian" ]; nix.settings.substituters = [ "https://attic.xuyh0120.win/lantian" ];
nix.settings.trusted-public-keys = [ "lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc=" ]; nix.settings.trusted-public-keys = [ "lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc=" ];
# ... your other configs # ... your other configs
} }
) )
]; ];
};
}; };
} }
``` ```
### Help! My kernel is failing to build! ### Help! My kernel is failing to build!
In most cases, failing to build a kernel is caused by version mismatch between CachyOS patches and nixpkgs kernel version. (e.g. hardened 6.18 kernel as of 2025-12-12) In most cases, failing to build a kernel is caused by version mismatch between CachyOS patches and nixpkgs kernel version. (e.g. hardened 6.18 kernel as of 2025-12-12)
Common symptoms are: Common symptoms are:
- "File not found" error, which indicates that CachyOS patches for given kernel version/variant are unavailable. - "File not found" error, which indicates that CachyOS patches for given kernel version/variant are unavailable.
- Failures/conflicts when applying patches, which indicates that CachyOS patches are for an older kernel version. - Failures/conflicts when applying patches, which indicates that CachyOS patches are for an older kernel version.
@ -182,23 +187,25 @@ To use ZFS module with `linuxPackages-cachyos-*` provided by this flake, point `
```nix ```nix
{ {
nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem { outputs = { nix-cachyos-kernel, ... }: {
system = "x86_64-linux"; nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
modules = [ system = "x86_64-linux";
( modules = [
{ pkgs, ... }: (
{ { pkgs, ... }:
nixpkgs.overlays = [ self.overlay ]; {
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest; nixpkgs.overlays = [ nix-cachyos-kernel.overlays.default ];
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest;
# ZFS config # ZFS config
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
boot.zfs.package = config.boot.kernelPackages.zfs_cachyos; boot.zfs.package = config.boot.kernelPackages.zfs_cachyos;
# ... your other configs # ... your other configs
} }
) )
]; ];
};
}; };
} }
``` ```
@ -207,25 +214,27 @@ If you want to construct your own `linuxPackages` attrset with `linuxKernel.pack
```nix ```nix
{ {
nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem { outputs = { nix-cachyos-kernel, ... }: {
system = "x86_64-linux"; nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
modules = [ system = "x86_64-linux";
( modules = [
{ pkgs, ... }: (
{ { pkgs, ... }:
nixpkgs.overlays = [ self.overlay ]; {
boot.kernelPackages = pkgs.linuxKernel.packagesFor pkgs.cachyosKernels.linux-cachyos-latest; nixpkgs.overlays = [ nix-cachyos-kernel.overlays.default ];
boot.kernelPackages = pkgs.linuxKernel.packagesFor pkgs.cachyosKernels.linux-cachyos-latest;
# ZFS config # ZFS config
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
boot.zfs.package = pkgs.cachyosKernels.zfs-cachyos.override { boot.zfs.package = pkgs.cachyosKernels.zfs-cachyos.override {
kernel = config.boot.kernelPackages.kernel; kernel = config.boot.kernelPackages.kernel;
}; };
# ... your other configs # ... your other configs
} }
) )
]; ];
};
}; };
} }
``` ```