From 1222848114d8c01a5d30fc4c5a7eb95b97e39091 Mon Sep 17 00:00:00 2001 From: Sergei Blinov Date: Mon, 30 Sep 2024 10:27:08 +0200 Subject: [PATCH] WIP: flake --- .gitignore | 1 + flake.lock | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 52 ++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index d6c93b1..6fe9d3a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ _output _output.* +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d30cf0e --- /dev/null +++ b/flake.lock @@ -0,0 +1,78 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "font_src": { + "flake": false, + "locked": { + "lastModified": 1727006927, + "narHash": "sha256-yio+ZJ+hgybgEUfxXt/xk3ahM5lollKGJC0821vi9e0=", + "owner": "be5invis", + "repo": "Iosevka", + "rev": "d63e3630c70831b1ba0b3568aa4e12c11d4f3d01", + "type": "github" + }, + "original": { + "owner": "be5invis", + "repo": "Iosevka", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "font_src": "font_src", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..01ea514 --- /dev/null +++ b/flake.nix @@ -0,0 +1,52 @@ +{ + description = "A flake for building afio font"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + + font_src = { + url = "github:be5invis/Iosevka?shallow=1"; + flake = false; + }; + + # font_config = { + # url = "./private-build-plans.toml"; + # flake = false; + # }; + }; + + outputs = { self, nixpkgs, flake-utils, font_src, ... }@inputs: flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages = rec { + default = pkgs.stdenv.mkDerivation { + name = "afio"; + buildInputs = with pkgs; [ + qt5.qmake + qt5.qtbase + cacert + ttfautohint + nodejs + nodePackages.pnpm + ]; + + src = font_src; + + buildPhase = '' + cp -v ${./private-build-plans.toml} private-build-plans.toml + pnpm i + npm run build -- ttf::afio + ''; + installPhase = '' + mkdir -p $out/ + ls -la > $out/ls.txt + cp -avL dist/*/ttf/* $out + ''; + }; + }; + }); +} +