flake.nix: exclude armv6-linux, riscv64-linux, and FreeBSD from devShells

nixfmt-rfc-style is built with Haskell, and the packaged GHC compiler
does not support any of these platforms (currently?).

    error:
           … while checking flake output 'devShells'
             at /nix/store/p36amaznf46ic90fb2rw5c952mgj6mfi-source/flake.nix:123:7:
              122|
              123|       devShells = forAllSystems (system: { } // lib.optionalAttrs (system != "armv6l-linux" && system != "riscv64-linux") {
                 |       ^
              124|         /** A shell to get tooling for Nixpkgs development. See nixpkgs/shell.nix. */

           … while checking the derivation 'devShells.x86_64-freebsd.default'
             at /nix/store/p36amaznf46ic90fb2rw5c952mgj6mfi-source/flake.nix:125:9:
              124|         /** A shell to get tooling for Nixpkgs development. See nixpkgs/shell.nix. */
              125|         default = import ./shell.nix { inherit system; };
                 |         ^
              126|       });

           (stack trace truncated; use '--show-trace' to show the full, detailed trace)

           error: Package ‘ghc-9.6.6’ in /nix/store/8akjd9ngyzhzi1412nxmw26rnj93l3gp-source/pkgs/development/compilers/ghc/common-hadrian.nix:579 is not available on the requested hostPlatform:
             hostPlatform.config = "x86_64-unknown-freebsd"
             package.meta.platforms = [
               "aarch64-darwin"
               "aarch64-linux"
               "i686-linux"
               "x86_64-darwin"
               "x86_64-linux"
             ]
             package.meta.badPlatforms = [ ]
           , refusing to evaluate.
This commit is contained in:
Cole Helbling 2024-10-16 08:46:44 -07:00
parent db1b484d98
commit ccb779782c

View File

@ -120,7 +120,17 @@
}).nixos.manual; }).nixos.manual;
}; };
devShells = forAllSystems (system: { devShells = forAllSystems (system:
{ } // lib.optionalAttrs
(
# Exclude armv6l-linux because "Package ghc-9.6.6 in .../pkgs/development/compilers/ghc/common-hadrian.nix:579 is not available on the requested hostPlatform"
system != "armv6l-linux"
# Exclude riscv64-linux because "Package ghc-9.6.6 in .../pkgs/development/compilers/ghc/common-hadrian.nix:579 is not available on the requested hostPlatform"
&& system != "riscv64-linux"
# Exclude FreeBSD because "Package ghc-9.6.6 in .../pkgs/development/compilers/ghc/common-hadrian.nix:579 is not available on the requested hostPlatform"
&& !self.legacyPackages.${system}.stdenv.hostPlatform.isFreeBSD
)
{
/** A shell to get tooling for Nixpkgs development. See nixpkgs/shell.nix. */ /** A shell to get tooling for Nixpkgs development. See nixpkgs/shell.nix. */
default = import ./shell.nix { inherit system; }; default = import ./shell.nix { inherit system; };
}); });