blob: de458af10295f9b24477fc7bbed79053cd2181a9 (
plain) (
blame)
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
70
71
72
73
74
|
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils/master";
gomod2nix.url = "github:tweag/gomod2nix/master";
nuigui-upstream.url = "github:uakci/nuigui/master";
nuigui-upstream.flake = false;
serial-predicate-engine-upstream.url =
"github:acotis/serial-predicate-engine/master";
serial-predicate-engine-upstream.flake = false;
};
outputs = { self, nixpkgs, gomod2nix, nuigui-upstream
, serial-predicate-engine-upstream, flake-utils, ... }:
{
inherit (gomod2nix) devShell;
nixosModule = { config, system, ... }: {
config.fonts.fonts = [ self.packages.toaqScript.${system} ];
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlay ];
}).pkgs;
in with pkgs;
let
toaqScript = pkgs.writeTextDir "share/fonts/ToaqScript.ttf" ./ToaqScript.ttf;
schemePkgs = lib.mapAttrs (name:
{ src, install, patches }:
pkgs.stdenv.mkDerivation {
inherit src name patches;
buildInputs = [ pkgs.guile ];
installPhase = ''
mkdir -p $out/bin
cp -r ./* $out
echo "${install}" > $out/bin/${name}
chmod +x $out/bin/${name}
'';
}) {
nuigui = {
src = nuigui-upstream;
patches = [ ./patches/nui.patch ];
install = ''
cd \$(dirname \$0)/../; ${pkgs.guile}/bin/guile web.scm
'';
};
serial-predicate-engine = {
src = serial-predicate-engine-upstream;
patches = [ ./patches/spe.patch ];
install = ''
cd \$(dirname \$0)/../web/; ${pkgs.guile}/bin/guile webservice.scm
'';
};
};
nuogai = buildGoApplication {
vendorSha256 = null;
runVend = true;
name = "nuogai";
src = ./.;
modules = ./gomod2nix.toml;
buildInputs = (builtins.attrValues schemePkgs) ++ [
toaqScript
(imagemagick.overrideAttrs
(a: { buildInputs = a.buildInputs ++ [ pango ]; }))
];
};
in {
defaultPackage = nuogai;
packages = schemePkgs // {
inherit toaqScript nuogai;
};
});
}
|