add shell.nix and fix some deps
Some checks failed
build / build (push) Failing after 2m58s

This commit is contained in:
zapashcanon 2025-07-11 14:59:09 +02:00
parent cdbc4dcceb
commit 2295807eee
3 changed files with 36 additions and 6 deletions

31
shell.nix Normal file
View File

@ -0,0 +1,31 @@
{ pkgs ? import <nixpkgs> { } }:
let
ocamlPackages = pkgs.ocaml-ng.ocamlPackages_5_3;
in
pkgs.mkShell {
name = "frost";
dontDetectOcamlConflicts = false;
nativeBuildInputs = with ocamlPackages; [
dune_3
findlib
merlin
ocaml
ocamlformat
odoc
];
buildInputs = with ocamlPackages; [
bos
cmdliner
directories
fmt
fpath
ptime
prelude
scfg
];
shellHook = ''
export PATH=$PATH:${pkgs.lib.makeBinPath [
]}
'';
}

View File

@ -2,8 +2,11 @@
(public_name sun)
(libraries
astring
bos
cmdliner
directories
fmt
fpath
scfg
prelude
ptime

View File

@ -15,7 +15,7 @@ let choose_output = function
let module Project_dirs = Directories.Project_dirs (App_id) in
match Project_dirs.config_dir with
| None -> Fmt.failwith "can't compute configuration directory path"
| Some config_dir -> Fpath.v config_dir
| Some config_dir -> config_dir
in
let file_name = Fpath.(config_dir / "config.scfg") in
(* if the config file doesn't exist, then we use the empty configuration *)
@ -38,11 +38,7 @@ let choose_output = function
(* If we can't compute `picture_dir`, we use the current working directory. *)
begin
match User_dirs.picture_dir with
| Some dir -> begin
match Fpath.of_string dir with
| Error (`Msg e) -> Fmt.failwith "%s" e
| Ok dir -> dir
end
| Some dir -> dir
| None -> (
match Bos.OS.Dir.current () with
| Error (`Msg e) -> Fmt.failwith "%s" e