Add flake input tracking

and restructure the whole codebase!

Not fully tested due to #4; theoretically resolves #1
This commit is contained in:
Bryan Bennett 2023-12-29 15:34:44 -05:00
parent e3688e207e
commit 6ec3bd2378
No known key found for this signature in database
GPG key ID: EE149E4215408DE9
7 changed files with 175 additions and 124 deletions

10
lib/flake_env__util.re Normal file
View file

@ -0,0 +1,10 @@
open Core;
module Unix = Core_unix;
let nix = (args) => {
let stdout_chan = Unix.open_process_in(
"nix --extra-experimental-features \"nix-command flakes\" " ++ (args |> String.concat));
let stdout_content = stdout_chan |> In_channel.input_all;
let exit_code = Unix.close_process_in(stdout_chan);
(exit_code, stdout_content)
}