Update flake to use bitsnpicas from nixpkgs

Bits'N'Picas is available since nixpkgs 25.11:
29ed443f2c

Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/bf3287dac860542719fe7554e21e686108716879?narHash=sha256-kwaaguGkAqTZ1oK0yXeQ3ayYjs8u/W7eEfrFpFfIDFA%3D' (2025-05-02)
  → 'github:nixos/nixpkgs/c6f52ebd45e5925c188d1a20119978aa4ffd5ef6?narHash=sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8%3D' (2025-12-15)
This commit is contained in:
Kenichi Kamiya 2025-12-20 01:09:04 +09:00
parent d2282e728a
commit 8c6ab0e2d5
No known key found for this signature in database
GPG key ID: 9BE4016A38165CCB
2 changed files with 27 additions and 49 deletions

View file

@ -20,16 +20,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1746183838, "lastModified": 1765838191,
"narHash": "sha256-kwaaguGkAqTZ1oK0yXeQ3ayYjs8u/W7eEfrFpFfIDFA=", "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bf3287dac860542719fe7554e21e686108716879", "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.11", "ref": "nixos-25.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -1,18 +1,24 @@
{ {
description = "A bitmap programming font optimized for coziness"; description = "A bitmap programming font optimized for coziness";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }: outputs =
flake-utils.lib.eachDefaultSystem (system: {
let pkgs = nixpkgs.legacyPackages.${system}; self,
in { nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells = { devShells = {
default = pkgs.mkShellNoCC { default = pkgs.mkShellNoCC {
packages = with pkgs; [ packages = with pkgs; [
# BitsNPicas GUI wrapped with java
self.packages.${system}.bitsnpicas-bin
# FontForge GUI # FontForge GUI
fontforge-gtk fontforge-gtk
# Python tools # Python tools
@ -24,35 +30,6 @@
}; };
}; };
packages = rec { packages = rec {
# BitsNPicas needs to be fetched here since `nix build` is sandboxed
# and does not have internet access
bitsnpicas = pkgs.stdenvNoCC.mkDerivation rec {
pname = "bitsnpicas";
version = "2.1";
src = pkgs.fetchFromGitHub {
owner = "kreativekorp";
repo = "bitsnpicas";
rev = "v${version}";
hash = "sha256-hw7UuzesqpmnTjgpfikAIYyY70ni7BxjaUtHAPEdkXI=";
};
buildInputs = [ pkgs.zulu23 pkgs.zip ];
buildPhase = ''
cd main/java/BitsNPicas
make
'';
installPhase = ''
mkdir -p $out
cp BitsNPicas.jar $out
cp KeyEdit.jar $out
cp MapEdit.jar $out
'';
};
# Shell script to run the BitsNPicas GUI
bitsnpicas-bin = pkgs.writeShellScriptBin "bitsnpicas" ''
${pkgs.zulu23}/bin/java -jar ${bitsnpicas}/BitsNPicas.jar $@
'';
# Derivation to build and install cozette # Derivation to build and install cozette
cozette = pkgs.stdenvNoCC.mkDerivation { cozette = pkgs.stdenvNoCC.mkDerivation {
pname = "cozette"; pname = "cozette";
@ -61,8 +38,8 @@
src = ./.; src = ./.;
buildInputs = with pkgs; [ buildInputs = with pkgs; [
(pkgs.python312.withPackages (ppkgs: (pkgs.python312.withPackages (
with ppkgs; [ ppkgs: with ppkgs; [
numpy numpy
pillow pillow
fonttools fonttools
@ -70,18 +47,18 @@
gitpython gitpython
setuptools setuptools
pip pip
])) ]
))
fontforge fontforge
zulu23 bitsnpicas
]; ];
configurePhase = '' postPatch = ''
mkdir -p deps substituteInPlace build.py --replace-fail \
cp ${bitsnpicas}/BitsNPicas.jar deps/ 'bitsnpicas.sh' '${pkgs.lib.getExe pkgs.bitsnpicas}'
''; '';
buildPhase = '' buildPhase = ''
patchShebangs bitsnpicas.sh
python3 build.py fonts python3 build.py fonts
''; '';
@ -102,5 +79,6 @@
}; };
default = cozette; default = cozette;
}; };
}); }
);
} }