-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
69 lines (62 loc) · 1.82 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
description = "F-Engrave Nix shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = {
self,
nixpkgs,
}: let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
pkgsFor = system: nixpkgs.legacyPackages.${system};
version = "1.75";
srcFor = system:
(pkgsFor system).fetchzip {
url = "https://www.scorchworks.com/Fengrave/F-Engrave-${version}_src.zip";
hash = "sha256-aMchmn6B0VfpBiOTbXM6MDmLfAn7iLPI2oF0B36ttDo=";
};
in {
devShells = forAllSystems (system: let
pkgs = pkgsFor system;
in {
default = pkgs.mkShell {
packages = with pkgs; [
nil # Nix LS
self.packages.${system}.ttf2xcf_stream
potrace
(python3.withPackages (pypkgs: [
pypkgs.python-lsp-server
pypkgs.tkinter
pypkgs.pillow
pypkgs.pyclipper
]))
];
shellHook = ''
# Copy the f-engrave.py script from source into the working directory
# if it is not already present.
if [ ! -e f-engrave.py ]; then
sed 's,#!/usr/bin/python,#!/usr/bin/env python3,' < ${srcFor system}/f-engrave.py | \
tr -d '\r' > f-engrave.py
chmod u+wx f-engrave.py
fi
'';
};
});
packages = forAllSystems (system: let
pkgs = pkgsFor system;
in {
ttf2xcf_stream = pkgs.callPackage ./ttf2cxf_stream.nix {
inherit version;
src = srcFor system;
};
});
checks = forAllSystems (system: let
pkgs = pkgsFor system;
in {
fmt = pkgs.runCommandLocal "alejandra" {} ''
${pkgs.alejandra}/bin/alejandra --check ${./.} > "$out";
'';
});
formatter = forAllSystems (system: (pkgsFor system).alejandra);
};
}