flake: introduce overlay

This commit is contained in:
Jacob Birkett 2024-02-01 23:48:11 -07:00
parent 9fb310f51e
commit 8841ba2fe0

View file

@ -16,16 +16,20 @@
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
eachSystem = fn: eachSystem = fn:
lib.genAttrs (import systems) (system: let lib.genAttrs (import systems) (system: let
pkgs = import nixpkgs {localSystem.system = system;}; pkgs = import nixpkgs {
localSystem.system = system;
overlays = [self.overlays.default];
};
in in
fn system pkgs); fn system pkgs);
in { in {
packages = eachSystem (_: pkgs: { overlays = {
default = pkgs.stdenv.mkDerivation { default = final: prev: {
monolisa-nerdfont-patch = final.stdenv.mkDerivation {
name = "monolisa-nerdfont-patch"; name = "monolisa-nerdfont-patch";
src = ./.; src = ./.;
nativeBuildInputs = with pkgs; [makeWrapper]; nativeBuildInputs = with final; [makeWrapper];
buildInputs = with pkgs; [fontforge python3]; buildInputs = with final; [fontforge python3];
unpackPhase = ":"; unpackPhase = ":";
buildPhase = ":"; buildPhase = ":";
installPhase = '' installPhase = ''
@ -37,9 +41,15 @@
''; '';
postFixup = '' postFixup = ''
wrapProgram $out/bin/monolisa-nerdfont-patch \ wrapProgram $out/bin/monolisa-nerdfont-patch \
--set PATH ${lib.makeBinPath (with pkgs; [fontforge])} --set PATH ${lib.makeBinPath (with final; [fontforge])}
''; '';
}; };
};
};
packages = eachSystem (system: pkgs: {
default = self.packages.${system}.monolisa-nerdfont-patch;
monolisa-nerdfont-patch = pkgs.monolisa-nerdfont-patch;
}); });
devShells = eachSystem (_: pkgs: { devShells = eachSystem (_: pkgs: {