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;
eachSystem = fn:
lib.genAttrs (import systems) (system: let
pkgs = import nixpkgs {localSystem.system = system;};
pkgs = import nixpkgs {
localSystem.system = system;
overlays = [self.overlays.default];
};
in
fn system pkgs);
in {
packages = eachSystem (_: pkgs: {
default = pkgs.stdenv.mkDerivation {
overlays = {
default = final: prev: {
monolisa-nerdfont-patch = final.stdenv.mkDerivation {
name = "monolisa-nerdfont-patch";
src = ./.;
nativeBuildInputs = with pkgs; [makeWrapper];
buildInputs = with pkgs; [fontforge python3];
nativeBuildInputs = with final; [makeWrapper];
buildInputs = with final; [fontforge python3];
unpackPhase = ":";
buildPhase = ":";
installPhase = ''
@ -37,9 +41,15 @@
'';
postFixup = ''
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: {