diff options
| author | uakci <uakci@uakci.pl> | 2021-09-15 01:19:55 +0200 |
|---|---|---|
| committer | uakci <uakci@uakci.pl> | 2021-09-15 01:19:55 +0200 |
| commit | 20ef8a090c2bc552e8f1e5dd773cd086c9782a21 (patch) | |
| tree | 89b7efba3f301c11eaba53ce13bcca87a9648240 /flake.nix | |
| download | nuogai-20ef8a090c2bc552e8f1e5dd773cd086c9782a21.tar.gz nuogai-20ef8a090c2bc552e8f1e5dd773cd086c9782a21.zip | |
initial
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..de458af --- /dev/null +++ b/flake.nix @@ -0,0 +1,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; + }; + }); +} |
