-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add onix-based flake, associated make task, and .envrc template
- Loading branch information
1 parent
dd3a90d
commit 22b13a6
Showing
6 changed files
with
1,065 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# rebuild the environment on `nix-direnv-reload` only | ||
nix_direnv_manual_reload | ||
|
||
# direnv will consider the environment changed if these files change, and | ||
# nix-direnv will then prompt for the manual reload | ||
watch_file flake.nix flake.lock onix-lock.json onix-lock-dev.json | ||
|
||
# use the flake with the `default` devShell: | ||
use flake | ||
|
||
# To use another devShell, you can use (e.g. for devShell.other: | ||
# use flake .#other | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
onix.url = "github:rizo/onix"; | ||
onix.inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, onix }@inputs: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
onix' = onix.packages.${system}.latest; | ||
opamFiles = [ | ||
./imandra-document.opam | ||
]; | ||
onixEnv = onix'.env { | ||
path = ./.; | ||
roots = opamFiles; | ||
lock = ./onix-lock.json; | ||
deps = { "ocaml-system" = "*"; }; | ||
}; | ||
onixEnvDev = onix'.env { | ||
path = ./.; | ||
roots = opamFiles; | ||
lock = ./onix-lock-dev.json; | ||
deps = { | ||
"ocaml-system" = "*"; | ||
"ocaml-lsp-server" = "*"; | ||
}; | ||
}; | ||
|
||
in rec { | ||
formatter = pkgs.nixfmt-rfc-style; | ||
|
||
packages.imandra-document = onixEnv.pkgs.imandra-document; | ||
|
||
devShells.onixLock = pkgs.mkShell { | ||
buildInputs = [ | ||
onix' | ||
]; | ||
}; | ||
|
||
devShells.default = onixEnvDev.shell.overrideAttrs (final: prev: { | ||
buildInputs = prev.buildInputs ++ [ | ||
pkgs.ocamlformat_0_22_4 | ||
pkgs.dune_3 | ||
pkgs.ocaml | ||
onix' | ||
]; | ||
}); | ||
|
||
packages.dev-shell = devShells.default.inputDerivation; | ||
}); | ||
} |
Oops, something went wrong.