blob: 36d39189efe5ba851969b15d819f740832c551df (
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
75
76
|
{
inputs = {
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, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlay ];
}).pkgs;
in with pkgs;
let
toaqScript = runCommand "toaq-script" { } ''
mkdir -p $out/share/fonts
cp ${./ToaqScript.ttf} $out/share/fonts/ToaqScript.ttf
'';
imagemagick' = imagemagick.overrideAttrs
(a: { buildInputs = a.buildInputs ++ [ pango ]; });
schemePkgs = lib.mapAttrs (name:
{ src, install, patches }:
pkgs.stdenv.mkDerivation {
inherit src name patches;
buildInputs = [ guile ];
installPhase = ''
mkdir -p $out/bin
cp -r ./* $out
cp "${writers.writeBash "${name}-start" install}" $out/bin/${name}
'';
}) {
nuigui = {
src = nuigui-upstream;
patches = [ ./patches/nui.patch ];
install = ''
cd $(dirname $0)/../
${guile}/bin/guile web.scm
'';
};
serial-predicate-engine = {
src = serial-predicate-engine-upstream;
patches = [ ./patches/spe.patch ];
install = ''
cd $(dirname $0)/../web/
${guile}/bin/guile webservice.scm
'';
};
};
nuogai = buildGoApplication {
vendorSha256 = null;
runVend = true;
name = "nuogai";
src = ./.;
modules = ./gomod2nix.toml;
propagatedBuildInputs = (builtins.attrValues schemePkgs)
++ [ toaqScript imagemagick' ];
};
in {
defaultPackage = nuogai;
packages = schemePkgs // {
inherit toaqScript nuogai;
imagemagickWithPango = imagemagick';
};
nixosModule = { config, pkgs, lib, ... }@args:
import ./module.nix (args // { inherit self system; });
}) // {
inherit (gomod2nix) devShell;
};
}
|