generated from nix-community/nur-packages-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
59 lines (54 loc) · 1.88 KB
/
flake.nix
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
57
58
59
{
description = "My personal NUR repository";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
bcachefs-tools = {
url = "github:YellowOnion/bcachefs-tools";
};
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, bcachefs-tools, utils, flake-compat }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
dotToUnderscore = pkgs.lib.strings.stringAsChars (x: if x == "." then "_" else x);
kernelVersion = lib.versions.majorMinor (lib.readFile ./VERSION);
rebaseBroken = (lib.readFile ./REBASE_BROKEN) == "yes\n";
baseKernel = pkgs.linuxKernel.kernels."linux_${dotToUnderscore kernelVersion}";
mkKernel = broken: name: debug: extraPatches : (pkgs.callPackage ./pkgs/bcachefs-kernel {
inherit broken rebaseBroken debug;
kernel = baseKernel;
variant = name ;
kernelPatches = [
pkgs.kernelPatches.bridge_stp_helper
pkgs.kernelPatches.request_key_helper
] ++ extraPatches;
useLocalPatch = false;
});
bcachefs-kernel = mkKernel false "master" true [];
packages = {
inherit bcachefs-kernel;
bcachefs-tools = bcachefs-tools.packages.${system}.default;
};
overlay = super: final: packages;
in
{
inherit packages;
nixosConfigurations = {
bcachefs-iso = (nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({...}: {
nixpkgs.overlays = [ overlay ];
})
./iso.nix
];
}).config.system.build.isoImage.overrideAttrs (self: self // { perferLocalBuilds = true ;});
};
});
}