-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
31 lines (29 loc) · 1.02 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
{
description = "Marimo-Quarto scripts";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
python = pkgs.python3.withPackages (ps: with ps; [ ]);
marimoQuarto = { tex ? false, ... }@opts:
pkgs.writeShellScriptBin ''marimo-quarto${if tex then "-tex" else ""}'' (''
PATH_EXTRA=${
if tex then "${pkgs.texliveFull}/bin" else ""
} ${run}/bin/run $@'');
run = pkgs.writeShellScriptBin "run" ''
PATH=$PATH:${pkgs.toybox}/bin:${python}/bin:${pkgs.quarto}/bin:$PATH_EXTRA $BASH ${pkgs.copyPathToStore ./run.sh} $@
'';
in
{
packages = rec {
inherit run;
marimo-quarto = marimoQuarto {};
marimo-quarto-tex = marimoQuarto {tex = true;};
default = marimo-quarto;
};
});
}