-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix roc path - replace flake-utils with genAttrs - use node v20? - corepack enable for future pnpm?
- Loading branch information
1 parent
9cbcd46
commit d53277f
Showing
2 changed files
with
48 additions
and
81 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,30 +1,45 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
roc = { | ||
url = "github:roc-lang/roc"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }@inputs: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
node = pkgs.nodejs_18; | ||
# NOTE: this includes the cli as well as the lang server | ||
# we could switch to .lang-server if we wanted to be slightly smaller on the dep | ||
roc-full = inputs.roc.packages.${system}.full; | ||
in { | ||
formatter = pkgs.nixpkgs-fmt; | ||
devShells = { | ||
default = pkgs.mkShell { | ||
buildInputs = [ node roc-full ]; | ||
shellHook = '' | ||
export ROC_LSP_PATH=${roc-full}/bin/roc_ls | ||
''; | ||
}; | ||
}; | ||
}); | ||
outputs = { | ||
nixpkgs, | ||
roc, | ||
... | ||
}: let | ||
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; | ||
in { | ||
formatter = nixpkgs.lib.genAttrs systems ( | ||
system: let | ||
pkgs = import nixpkgs {inherit system;}; | ||
in | ||
pkgs.nixpkgs-fmt | ||
); | ||
devShells = nixpkgs.lib.genAttrs systems (system: let | ||
pkgs = import nixpkgs {inherit system;}; | ||
rocPkgs = roc.packages.${system}; | ||
node = pkgs.nodejs_20; | ||
corepackEnable = pkgs.runCommand "corepack-enable" {} '' | ||
mkdir -p $out/bin | ||
${node}/bin/corepack enable --install-directory $out/bin | ||
''; | ||
in { | ||
default = pkgs.mkShell { | ||
buildInputs = [ | ||
corepackEnable | ||
node | ||
# NOTE: this includes the cli as well as the language server | ||
# we could switch it if we wanted to be slightly smaller on the dep | ||
(with rocPkgs; [full]) | ||
]; | ||
shellHook = '' | ||
export ROC_LSP_PATH=${rocPkgs.full}/bin/roc_language_server | ||
''; | ||
}; | ||
}); | ||
}; | ||
} |