mirror of
https://github.com/DeterminateSystems/flake-checker.git
synced 2024-09-11 14:25:44 +03:00
Remove rust-toolchain.toml and reformat Nix sources
This commit is contained in:
parent
5b593d5200
commit
4776c20c2e
24
crane.nix
24
crane.nix
@ -19,11 +19,14 @@ let
|
|||||||
|
|
||||||
# For easy cross-compilation in devShells
|
# For easy cross-compilation in devShells
|
||||||
# We are just composing the pkgsCross.*.stdenv.cc together
|
# We are just composing the pkgsCross.*.stdenv.cc together
|
||||||
crossPlatforms = let
|
crossPlatforms =
|
||||||
makeCrossPlatform = crossSystem: let
|
let
|
||||||
|
makeCrossPlatform = crossSystem:
|
||||||
|
let
|
||||||
pkgsCross =
|
pkgsCross =
|
||||||
if crossSystem == system then pkgs
|
if crossSystem == system then pkgs
|
||||||
else import pkgs.path {
|
else
|
||||||
|
import pkgs.path {
|
||||||
inherit system crossSystem;
|
inherit system crossSystem;
|
||||||
overlays = [ ];
|
overlays = [ ];
|
||||||
};
|
};
|
||||||
@ -35,7 +38,8 @@ let
|
|||||||
cargoCcEnv = "CC_${rustTargetSpecUnderscored}"; # for ring
|
cargoCcEnv = "CC_${rustTargetSpecUnderscored}"; # for ring
|
||||||
|
|
||||||
cc = "${pkgsCross.stdenv.cc}/bin/${pkgsCross.stdenv.cc.targetPrefix}cc";
|
cc = "${pkgsCross.stdenv.cc}/bin/${pkgsCross.stdenv.cc.targetPrefix}cc";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
name = crossSystem;
|
name = crossSystem;
|
||||||
value = {
|
value = {
|
||||||
inherit rustTargetSpec cc;
|
inherit rustTargetSpec cc;
|
||||||
@ -47,12 +51,14 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
systems = lib.filter (s: s == system || lib.hasInfix "linux" s) supportedSystems;
|
systems = lib.filter (s: s == system || lib.hasInfix "linux" s) supportedSystems;
|
||||||
in builtins.listToAttrs (map makeCrossPlatform systems);
|
in
|
||||||
|
builtins.listToAttrs (map makeCrossPlatform systems);
|
||||||
|
|
||||||
cargoTargets = lib.mapAttrsToList (_: p: p.rustTargetSpec) crossPlatforms;
|
cargoTargets = lib.mapAttrsToList (_: p: p.rustTargetSpec) crossPlatforms;
|
||||||
cargoCrossEnvs = lib.foldl (acc: p: acc // p.env) { } (builtins.attrValues crossPlatforms);
|
cargoCrossEnvs = lib.foldl (acc: p: acc // p.env) { } (builtins.attrValues crossPlatforms);
|
||||||
|
|
||||||
buildFor = system: let
|
buildFor = system:
|
||||||
|
let
|
||||||
crossPlatform = crossPlatforms.${system};
|
crossPlatform = crossPlatforms.${system};
|
||||||
inherit (crossPlatform) pkgs;
|
inherit (crossPlatform) pkgs;
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
|
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
|
||||||
@ -95,8 +101,10 @@ let
|
|||||||
# The resulting executable must be standalone
|
# The resulting executable must be standalone
|
||||||
allowedRequisites = [ ];
|
allowedRequisites = [ ];
|
||||||
});
|
});
|
||||||
in crate;
|
in
|
||||||
in {
|
crate;
|
||||||
|
in
|
||||||
|
{
|
||||||
inherit crossPlatforms cargoTargets cargoCrossEnvs rustNightly;
|
inherit crossPlatforms cargoTargets cargoCrossEnvs rustNightly;
|
||||||
|
|
||||||
flake-checker = buildFor system;
|
flake-checker = buildFor system;
|
||||||
|
10
flake.nix
10
flake.nix
@ -22,9 +22,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }: let
|
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }:
|
||||||
|
let
|
||||||
supportedSystems = flake-utils.lib.defaultSystems;
|
supportedSystems = flake-utils.lib.defaultSystems;
|
||||||
in flake-utils.lib.eachSystem supportedSystems (system: let
|
in
|
||||||
|
flake-utils.lib.eachSystem supportedSystems (system:
|
||||||
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
@ -37,7 +40,8 @@
|
|||||||
cranePkgs = pkgs.callPackage ./crane.nix {
|
cranePkgs = pkgs.callPackage ./crane.nix {
|
||||||
inherit crane supportedSystems;
|
inherit crane supportedSystems;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
packages = rec {
|
packages = rec {
|
||||||
inherit (cranePkgs) flake-checker;
|
inherit (cranePkgs) flake-checker;
|
||||||
default = flake-checker;
|
default = flake-checker;
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
[toolchain]
|
|
||||||
channel = "1.69.0"
|
|
Loading…
Reference in New Issue
Block a user