This commit is contained in:
parent
cdbc4dcceb
commit
2295807eee
31
shell.nix
Normal file
31
shell.nix
Normal 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 [
|
||||
]}
|
||||
'';
|
||||
}
|
||||
3
src/dune
3
src/dune
@ -2,8 +2,11 @@
|
||||
(public_name sun)
|
||||
(libraries
|
||||
astring
|
||||
bos
|
||||
cmdliner
|
||||
directories
|
||||
fmt
|
||||
fpath
|
||||
scfg
|
||||
prelude
|
||||
ptime
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user