Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (50 loc) · 1.77 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (50 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Linux kernel tuned for one PC: CachyOS + BORE, Clang ThinLTO, -march=native, trimmed modules, auto-tracked";
inputs = {
# Own pin, so the update script can move the toolchain and NVIDIA driver
# forward together with the kernel. Do not make it follow another nixpkgs.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # NVIDIA driver modules
};
built = import ./kernel { inherit pkgs lib; };
in
{
packages.${system} = {
kernel = built.kernel;
config = built.trimmedConfig;
nvidia-open = built.linuxPackages.nvidiaPackages.optimized.open;
nvidia = built.linuxPackages.nvidiaPackages.optimized;
# nixpkgs' own driver, for comparison and as the fallback entries' driver
nvidia-open-nixpkgs = built.linuxPackages.nvidiaPackages.latest.open;
default = built.kernel;
};
legacyPackages.${system}.linuxPackages = built.linuxPackages;
# Adds pkgs.linuxPackages_optimized, built with this flake's own nixpkgs.
overlays.default = _final: _prev: {
linuxPackages_optimized = built.linuxPackages;
};
apps.${system}.update = {
type = "app";
program = lib.getExe (
pkgs.writeShellApplication {
name = "optimized-kernel-update";
# Uses the system's own nix on PATH.
runtimeInputs = with pkgs; [
python3
git
];
text = ''exec python3 -I ${./scripts/update.py} "$@"'';
}
);
};
formatter.${system} = pkgs.nixfmt-rfc-style;
};
}