Skip to content

Commit

Permalink
flake.nix: Make a MinGW dev shell
Browse files Browse the repository at this point in the history
This requires a `shellCrossSystems` for now, since Nix doesn't actually
build on Windows. This can be dropped once it does.
  • Loading branch information
Ericson2314 committed Dec 11, 2023
1 parent 46b98a4 commit b892161
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
"x86_64-unknown-netbsd"
];

# Nix doesn't yet build on this platform, so we put it in a
# separate list. We just use this for `devShells` and
# `nixpkgsFor`, which this depends on.
shellCrossSystems = crossSystems ++ [
"x86_64-w64-mingw32"
];

stdenvs = [ "gccStdenv" "clangStdenv" "clang11Stdenv" "stdenv" "libcxxStdenv" "ccacheStdenv" ];

forAllSystems = lib.genAttrs systems;
Expand Down Expand Up @@ -129,7 +136,7 @@
in {
inherit stdenvs native;
static = native.pkgsStatic;
cross = forAllCrossSystems (crossSystem: make-pkgs crossSystem "stdenv");
cross = lib.genAttrs shellCrossSystems (crossSystem: make-pkgs crossSystem "stdenv");
});

commonDeps =
Expand Down Expand Up @@ -808,7 +815,7 @@
in
(makeShells "native" nixpkgsFor.${system}.native) //
(makeShells "static" nixpkgsFor.${system}.static) //
(forAllCrossSystems (crossSystem: let pkgs = nixpkgsFor.${system}.cross.${crossSystem}; in makeShell pkgs pkgs.stdenv)) //
(lib.genAttrs shellCrossSystems (crossSystem: let pkgs = nixpkgsFor.${system}.cross.${crossSystem}; in makeShell pkgs pkgs.stdenv)) //
{
default = self.devShells.${system}.native-stdenvPackages;
}
Expand Down

0 comments on commit b892161

Please sign in to comment.