Skip to content

Commit

Permalink
nix flake cleanup (#7576)
Browse files Browse the repository at this point in the history
* nix flake cleanup

* fix devtools

* remove old zig version check

Signed-off-by: Anton-4 <[email protected]>

---------

Signed-off-by: Anton-4 <[email protected]>
  • Loading branch information
Anton-4 authored Feb 4, 2025
1 parent 5261062 commit 5e4ff44
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nix_macos_apple_silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# These started to accumulate quickly since #5990, not sure why
- name: Clean up old nix shells
run: rm -rf /private/tmp/nix-shell.*

- name: check formatting with rustfmt
run: nix develop -c cargo fmt --all -- --check

Expand Down
68 changes: 19 additions & 49 deletions devtools/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion devtools/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
# env vars
NIX_GLIBC_PATH = rocShell.NIX_GLIBC_PATH;
LD_LIBRARY_PATH = rocShell.LD_LIBRARY_PATH;
NIXPKGS_ALLOW_UNFREE = rocShell.NIXPKGS_ALLOW_UNFREE;

# to set the LLVM_SYS_<VERSION>_PREFIX
shellHook = rocShell.shellHook;
Expand Down
24 changes: 0 additions & 24 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 2 additions & 29 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
};
# to easily make configs for multiple architectures
flake-utils.url = "github:numtide/flake-utils";
# to be able to use vulkan system libs for graphics in examples/gui
nixgl = {
url = "github:guibou/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};

# for non flake backwards compatibility
flake-compat = {
Expand All @@ -25,7 +19,7 @@
};
};

outputs = { self, nixpkgs, rust-overlay, flake-utils, nixgl, ... }@inputs:
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];

Expand All @@ -38,7 +32,6 @@
let

overlays = [ (import rust-overlay) ]
++ (if system == "x86_64-linux" then [ nixgl.overlay ] else [ ])
++ [(final: prev: {
# using a custom simple-http-server fork because of github.com/TheWaWaR/simple-http-server/issues/111
# the server is used for local testing of the roc website
Expand All @@ -56,15 +49,6 @@
linuxDevInputs = with pkgs;
lib.optionals stdenv.isLinux [
valgrind # used in cli tests, see cli/tests/cli_tests.rs
vulkan-headers # here and below is all graphics stuff for examples/gui
vulkan-loader
vulkan-tools
vulkan-validation-layers
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libxcb
cargo-llvm-cov # to visualize code coverage
curl # used by www/build.sh
];
Expand All @@ -73,8 +57,6 @@
darwinDevInputs = with pkgs;
lib.optionals stdenv.isDarwin
(with pkgs.darwin.apple_sdk.frameworks; [
CoreVideo # for examples/gui
Metal # for examples/gui
curl # for wasm-bindgen-cli libcurl (see ./ci/www-repl.sh)
]);

Expand Down Expand Up @@ -107,8 +89,6 @@
sharedDevInputs = (with pkgs; [
git
python3
libiconv # for examples/gui
libxkbcommon # for examples/gui
cargo-criterion # for benchmarks
wasm-pack # for repl_wasm
jq # used in several bash scripts
Expand All @@ -127,11 +107,7 @@
{

devShell = pkgs.mkShell {
buildInputs = sharedInputs ++ sharedDevInputs ++ darwinInputs ++ darwinDevInputs ++ linuxDevInputs
++ (if system == "x86_64-linux" then
[ pkgs.nixgl.nixVulkanIntel ]
else
[ ]);
buildInputs = sharedInputs ++ sharedDevInputs ++ darwinInputs ++ darwinDevInputs ++ linuxDevInputs;

# nix does not store libs in /usr/lib or /lib
# for libgcc_s.so.1
Expand All @@ -146,9 +122,6 @@
([ pkg-config stdenv.cc.cc.lib libffi ncurses zlib ]
++ linuxDevInputs);

NIXPKGS_ALLOW_UNFREE =
1; # to run the GUI examples with NVIDIA's closed source drivers

shellHook = ''
export LLVM_SYS_180_PREFIX="${llvmPkgs.dev}"
${aliases}
Expand Down

0 comments on commit 5e4ff44

Please sign in to comment.