greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

kore / overlays / default.nix40 lines · 1288B · raw

1{ inputs, outputs, ... }:
2
3{
4  # https://m7.rs/git/nix-config/tree/overlays/default.nix#line-13
5  flake-inputs = final: _: {
6    inputs =
7      builtins.mapAttrs (_: flake:
8        let
9          inherit (final.stdenv.hostPlatform) system;
10          legacyPackages = (flake.legacyPackages or {}).${system} or {};
11          packages = (flake.packages or {}).${system} or {};
12        in
13          if legacyPackages != {} then legacyPackages else packages
14      )
15      inputs;
16  };
17
18  modifications = final: prev: {
19    dwl =
20      let
21        inherit (final) lib;
22        hex = c: lib.removePrefix "#" c;
23        colors = lib.getAttrs [ "bg" "fg" "surface" "green" "red" "teal" ] outputs.palette.colors;
24      in
25        (prev.dwl.override {
26          configH = final.replaceVars ./dwl/config.h (
27            lib.mapAttrs (_: c: "0x${hex c}ff") colors
28            // lib.mapAttrs' (n: c: lib.nameValuePair "${n}Rgb" (hex c))
29              (lib.getAttrs [ "bg" "fg" "surface" "green" ] colors)
30          );
31        }).overrideAttrs (old: {
32          patches = (old.patches or [ ]) ++ [
33            ./dwl/bar.patch
34            ./dwl/gaps.patch
35            ./dwl/garden.patch
36          ];
37          buildInputs = old.buildInputs ++ [ final.fcft final.pixman final.libdrm ];
38        });
39  };
40}