-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
35 lines (29 loc) · 1.17 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
{
description = "CodeDown Go Screenshotter";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [];
pkgs = import nixpkgs { inherit system overlays; };
in {
packages = (rec {
screenshotterStatic = pkgs.callPackage ./. { static = true; };
screenshotterDynamic = pkgs.callPackage ./. { static = false; };
default = screenshotterStatic;
mkScreenshotter = { chromePath, static ? true }:
let
screenshotter = if static then screenshotterStatic else screenshotterDynamic;
in
with pkgs; runCommand "codedown-screenshotter-go" {
buildInputs = [makeWrapper];
inherit (screenshotter) meta version;
} ''
mkdir -p $out/bin
makeWrapper ${screenshotter}/bin/codedown-screenshotter "$out/bin/codedown-screenshotter" \
--add-flags "--chrome-path \"${chromePath}\""
'';
});
});
}