From dbdb00123f2934d33026fb05fb66be919c431675 Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Mon, 8 Dec 2025 21:50:34 -0800 Subject: [PATCH] Setup flake-compat --- README.md | 2 ++ default.nix | 12 ++++++++++++ flake.lock | 17 +++++++++++++++++ flake.nix | 4 ++++ 4 files changed, 35 insertions(+) create mode 100644 default.nix diff --git a/README.md b/README.md index bb959db..e8d120d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ This repo provides the latest kernel version and the latest LTS kernel version: The kernel versions are automatically kept in sync with Nixpkgs, so once the latest/LTS kernel is updated in Nixpkgs, CachyOS kernels in this repo will automatically catch up. +Use `nix flake show github:xddxdd/nix-cachyos-kernel` to see the current effective versions. + The kernels ending in `-lto` has Clang+ThinLTO enabled. For each linux kernel entry under `packages`, we have a corresponding `linuxPackages` entry under `legacyPackages` for easier use in your NixOS configuration, e.g.: diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..c03ddc4 --- /dev/null +++ b/default.nix @@ -0,0 +1,12 @@ +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + nodeName = lock.nodes.root.inputs.flake-compat; + in + fetchTarball { + url = + lock.nodes.${nodeName}.locked.url + or "https://github.com/NixOS/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz"; + sha256 = lock.nodes.${nodeName}.locked.narHash; + } +) { src = ./.; }).defaultNix diff --git a/flake.lock b/flake.lock index 5a021c4..ac63614 100644 --- a/flake.lock +++ b/flake.lock @@ -32,6 +32,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1765121682, + "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -85,6 +101,7 @@ "inputs": { "cachyos-kernel": "cachyos-kernel", "cachyos-kernel-patches": "cachyos-kernel-patches", + "flake-compat": "flake-compat", "flake-parts": "flake-parts", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 1469af4..bdab133 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; flake-parts.url = "github:hercules-ci/flake-parts"; + flake-compat = { + url = "github:NixOS/flake-compat"; + flake = false; + }; cachyos-kernel = { url = "github:CachyOS/linux-cachyos";