roc/devtools/flake.nix
Dawid Danieluk 15f162f83c
feat(nix): make buildRocPackage fetch dependencies recursively (#7729)
* update nix buildRocPackage script

* change list of prefetched urls to include all links from the repository

* update nix buildRocPackage script to also include gz files

add debug echo

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

* use descriptive variable names and add allowed domains list

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

* add fizzbuzz to examples folder

* limit fizzbuzz range to 10

* include buildRocPackage tests in flake checks

* revert formatter changes

* extend range to contain FizzBuzz

* run nix fmt

* add flake checks to CI

* hello world + fix warnings

* fix unnecessary deps

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* misc fixes

* nix fixes

---------

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-04-18 20:11:09 +02:00

65 lines
2.1 KiB
Nix
Executable file

{
description = "Allows sharing dependencies between dev tools and roc. Prevents version GLIBC_2.36 not found.";
inputs = {
# change this path to the path of your roc folder
roc.url = "path:/home/username/gitrepos/roc";
};
outputs = { self, roc, flake-utils }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
flake-utils = roc.inputs.flake-utils;
in
flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import roc.inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
isAarch64Darwin = pkgs.stdenv.hostPlatform.system == "aarch64-darwin";
rocShell = roc.devShells.${system}.default;
in
{
devShell = pkgs.mkShell {
packages =
let
devInputs = with pkgs;
[ less bashInteractive ]
++ (if isAarch64Darwin then [ ] else [ gdb ]);
vscodeWithExtensions = pkgs.vscode-with-extensions.override {
vscodeExtensions = with pkgs.vscode-extensions;
[
rust-lang.rust-analyzer
# eamodio.gitlens
bbenoist.nix
tamasfe.even-better-toml
] ++ (if isAarch64Darwin then [ ] else [ vadimcn.vscode-lldb ])
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "roc-lang-unofficial";
publisher = "IvanDemchenko";
version = "1.2.0";
sha256 = "sha256-lMN6GlUM20ptg1c6fNp8jwSzlCzE1U0ugRyhRLYGPGE=";
}
]
;
};
in
[ vscodeWithExtensions devInputs ];
inputsFrom = [ rocShell ];
# env vars
NIX_GLIBC_PATH = rocShell.NIX_GLIBC_PATH;
LD_LIBRARY_PATH = rocShell.LD_LIBRARY_PATH;
# to set the LLVM_SYS_<VERSION>_PREFIX
shellHook = rocShell.shellHook;
formatter = pkgs.nixpkgs-fmt;
};
});
}