Compare commits

...

13 Commits

Author SHA1 Message Date
Daylin Morgan 8a95f2c77d
chore: change mkShell back to buildInputs 2024-02-10 14:28:42 -06:00
Daylin Morgan 4ae59887b1
chore: remove some lets add others 2024-02-10 14:28:18 -06:00
Daylin Morgan 589b98cb27
chore: inherit from nixpkgs.lib not nixpkgs 2024-02-10 14:27:57 -06:00
Daylin Morgan 9c8d7f6915
chore: move alejandra to pre-commit-hook 2024-02-10 14:20:18 -06:00
Jacob Birkett 5b9e5fa889 flake: devShell: replace buildInputs with packages 2024-02-10 12:38:46 -07:00
Jacob Birkett 29aef1df84 flake: package: remove needless unpackPase override 2024-02-10 12:38:00 -07:00
Jacob Birkett 8841ba2fe0 flake: introduce overlay 2024-02-10 12:37:58 -07:00
Jacob Birkett 9fb310f51e flake: move usages of with to smallest scopes 2024-02-10 12:32:59 -07:00
Jacob Birkett fabe645c8b flake: inherit lib at top level 2024-02-10 12:32:07 -07:00
Jacob Birkett 35b4ac836b flake: replace forAllSystems with eachSystem 2024-02-10 12:31:14 -07:00
Jacob Birkett f5aef0b4d2 flake: make systems overrideable 2024-02-10 12:18:15 -07:00
Jacob Birkett 3dbfeee0df flake: format nix code 2024-02-10 12:18:01 -07:00
Jacob Birkett 4e9e3abbb3 flake: add alejandra as formatter 2024-02-10 12:17:59 -07:00
3 changed files with 70 additions and 47 deletions

View File

@ -12,3 +12,8 @@ repos:
- id: ruff-format - id: ruff-format
- id: ruff - id: ruff
args: [ --fix ] args: [ --fix ]
- repo: https://github.com/kamadorueda/alejandra
rev: 3.0.0
hooks:
# Requires Alejandra to be previously installed in the system
- id: alejandra-system

View File

@ -18,7 +18,23 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
} }
} }
}, },

View File

@ -1,58 +1,60 @@
{ {
description = "A script to patch the MonoLisa font with Nerd Fonts glyphs."; description = "A script to patch the MonoLisa font with Nerd Fonts glyphs.";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = inputs @ { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
};
outputs = {
self, self,
nixpkgs, nixpkgs,
systems,
}: let }: let
inherit (nixpkgs.lib) genAttrs; inherit (nixpkgs.lib) genAttrs makeBinPath;
forAllSystems = f: eachSystem = fn:
genAttrs genAttrs (import systems)
["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"] (system:
(system: f nixpkgs.legacyPackages.${system}); fn system
(import nixpkgs {
localSystem.system = system;
overlays = [self.overlays.default];
}));
in { in {
packages = forAllSystems ( overlays = {
pkgs: default = final: _prev: let
with pkgs; { pkgs = final;
default = stdenv.mkDerivation { in {
name = "monolisa-nerdfont-patch"; monolisa-nerdfont-patch = pkgs.stdenv.mkDerivation {
src = ./.; name = "monolisa-nerdfont-patch";
nativeBuildInputs = [ makeWrapper ]; src = ./.;
buildInputs = [ nativeBuildInputs = with pkgs; [makeWrapper];
fontforge buildInputs = with pkgs; [fontforge python3];
python3 buildPhase = ":";
]; installPhase = ''
unpackPhase = ":"; mkdir -p $out/bin
buildPhase = ":"; install -m755 -D ${./patch-monolisa} $out/bin/monolisa-nerdfont-patch
installPhase = '' install -m755 -D ${./font-patcher} $out/bin/font-patcher
mkdir -p $out/bin cp -r ${./bin} $out/bin/bin
install -m755 -D ${./patch-monolisa} $out/bin/monolisa-nerdfont-patch cp -r ${./src} $out/bin/src
install -m755 -D ${./font-patcher} $out/bin/font-patcher
cp -r ${./bin} $out/bin/bin
cp -r ${./src} $out/bin/src
'';
postFixup = ''
wrapProgram $out/bin/monolisa-nerdfont-patch \
--set PATH ${lib.makeBinPath [
fontforge
]}
''; '';
postFixup = ''
wrapProgram $out/bin/monolisa-nerdfont-patch \
--set PATH ${makeBinPath (with final; [fontforge])}
'';
};
}; };
} };
);
devShells = forAllSystems ( packages = eachSystem (system: pkgs: {
pkgs: default = self.packages.${system}.monolisa-nerdfont-patch;
with pkgs; { monolisa-nerdfont-patch = pkgs.monolisa-nerdfont-patch;
default = mkShell { });
buildInputs = [
fontforge devShells = eachSystem (_: pkgs: {
python3 default = pkgs.mkShell {
pre-commit buildInputs = with pkgs; [fontforge python3 pre-commit];
]; };
}; });
}
);
}; };
} }