From 3dbfeee0dfadc93b27cc504b8ad1c0805a6fbdd0 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Thu, 1 Feb 2024 23:32:16 -0700 Subject: [PATCH] flake: format nix code --- flake.nix | 70 +++++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/flake.nix b/flake.nix index 7e88b8e..5fc1689 100644 --- a/flake.nix +++ b/flake.nix @@ -13,52 +13,40 @@ }: let inherit (nixpkgs.lib) genAttrs; forAllSystems = f: - genAttrs - ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"] - (system: f nixpkgs.legacyPackages.${system}); + genAttrs [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-linux" + "aarch64-darwin" + ] (system: f nixpkgs.legacyPackages.${system}); in { - packages = forAllSystems ( - pkgs: + packages = forAllSystems (pkgs: with pkgs; { default = stdenv.mkDerivation { - name = "monolisa-nerdfont-patch"; - src = ./.; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ - fontforge - python3 - ]; - unpackPhase = ":"; - buildPhase = ":"; - installPhase = '' - mkdir -p $out/bin - install -m755 -D ${./patch-monolisa} $out/bin/monolisa-nerdfont-patch - 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 - ]} + name = "monolisa-nerdfont-patch"; + src = ./.; + nativeBuildInputs = [makeWrapper]; + buildInputs = [fontforge python3]; + unpackPhase = ":"; + buildPhase = ":"; + installPhase = '' + mkdir -p $out/bin + install -m755 -D ${./patch-monolisa} $out/bin/monolisa-nerdfont-patch + 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]} + ''; + }; + }); - devShells = forAllSystems ( - pkgs: - with pkgs; { - default = mkShell { - buildInputs = [ - fontforge - python3 - pre-commit - ]; - }; - } - ); + devShells = forAllSystems (pkgs: + with pkgs; { + default = mkShell {buildInputs = [fontforge python3 pre-commit];}; + }); formatter.x86_64-linux = alejandra.packages.x86_64-linux.default; };