Add developer shell for Rust programming language
https://www.rust-lang.org
https://www.rust-lang.org
# What does this fix?
# ===================
#
# If you define a developer shell like:
#
# devShells."rust-1.66.1" = mkShell { … };
#
# … and you try to use with:
#
# nix develop ".#rust-1.66.1"
#
# … you will get an error!
#
# Because Nix is looking for something like:
#
# devShells.rust-1."66"."1" = mkShell { … };
#
# The following code will therefore transform an attribute set of the form
# { "rust-1.66.1" = expr; }
# into
# { "rust-1.66.1" = expr;
# rust-1 = { "66" = { "1" = expr; }; };
# }
{ pkgs ? import <nixpkgs> }:
with builtins;
let
fix = name: value: {
name = head name;
value = let xs = tail name;
in if xs == [ ] then value else (listToAttrs [ (fix xs value) ]);
};
in devShells:
foldl' (x: y: (pkgs.lib.recursiveUpdate (listToAttrs [ y ]) x)) { }
(map (name: fix (filter isString (split "\\." name)) devShells.${name})
(attrNames devShells))
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
"type": "github"
}
},
"flake-utils_5": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghc-8.6.5-iohk": {
"flake": false,
"locked": {
"hackage": {
"flake": false,
"locked": {
"lastModified": 1678926579,
"narHash": "sha256-5t1QRBTsEM2wREtDf3xrHp9Kphs+AdQZKAEltaylIJQ=",
"lastModified": 1679012701,
"narHash": "sha256-qWldqfEJEkqhQGEbx5yeZ+huc2muYj8WrMKx+uFqgMo=",
"owner": "input-output-hk",
"repo": "hackage.nix",
"rev": "fb58b0ba5773c5f0211f284b0fae061426cf8267",
"rev": "a618dbd152ae5a8de7978ea5655096f7846cb880",
"type": "github"
},
"original": {
"tullia": "tullia"
},
"locked": {
"lastModified": 1678949091,
"narHash": "sha256-GtpNyN1dva16OSpPdBeAjS12xOG09Yj8nSEbO1t8qJ8=",
"lastModified": 1679014270,
"narHash": "sha256-ydAiOHzogqVa0PDBUPJR1WcZsijJEQyKMRaySZo+dNI=",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "976f18860640d7a3b219f0e04e2791d480e72b11",
"rev": "25d82a0091227c7d4c0eb18fba522559a58bd3db",
"type": "github"
},
"original": {
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nosys": {
"locked": {
"lastModified": 1667881534,
"nixpkgs": [
"haskellNix",
"nixpkgs-unstable"
]
],
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1679019776,
"narHash": "sha256-0E/zReDMCVEV24OCISKEw0ofPkW8ZSlLwD/XDwSOFFI=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "41872ef6ee3d14236c345a5c528d679533e045dd",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"stackage": {
"flake": false,
"locked": {
"lastModified": 1678925630,
"narHash": "sha256-rl8qnpAUJl4tRZpaZ5DpgSueNfreArW09t4zTnOaoYA=",
"lastModified": 1679011783,
"narHash": "sha256-3tqEBYPToq0K0aJ+CvyTunmCArQjF5+AlL3BGbkbfvM=",
"owner": "input-output-hk",
"repo": "stackage.nix",
"rev": "bf29b23fb77017e78c6e7b199b2c7bfb5079c4cd",
"rev": "8ebbee5894003ed558bec9a6b372afe514a6405d",
"type": "github"
},
"original": {
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
outputs = { self, nixpkgs, flake-utils, haskellNix }:
outputs = { self, nixpkgs, flake-utils, haskellNix, rust-overlay }:
let overlays = {
crypto = final: prev: {
libsodium-vrf = final.callPackage ({ stdenv, lib, fetchFromGitHub, autoreconfHook }:
});
cddl-tools = (final: prev: {
cbor-diag = final.callPackage ./pkgs/cbor-diag { };
cddl = final.callPackage ./pkgs/cddl { };
cddl = final.callPackage ./pkgs/cddl { };
});
};
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
];
in flake-utils.lib.eachSystem supportedSystems (system:
let
let
pkgs = import nixpkgs {
overlays = [haskellNix.overlay] ++ __attrValues overlays;
overlays = [ haskellNix.overlay (import rust-overlay) ] ++ __attrValues overlays;
inherit system;
inherit (haskellNix) config;
};
pkgs.lib.nameValuePair "${compiler-nix-name}-minimal" (
import ./dynamic.nix { inherit pkgs compiler compiler-nix-name; withHLS = false; withHlint = false; }
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
pkgs.lib.nameValuePair "${compiler-nix-name}-static" (
import ./static.nix { pkgs = static-pkgs; inherit compiler compiler-nix-name; }
)) (compilers static-pkgs.buildPackages)
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
pkgs.lib.nameValuePair "${compiler-nix-name}-static-minimal" (
import ./static.nix { pkgs = static-pkgs; inherit compiler compiler-nix-name; withHLS = false; withHlint = false; }
)) (compilers static-pkgs.buildPackages)
);
) // (import ./rust.nix { inherit pkgs; });
hydraJobs = devShells;
});
# Developer shell for Rust programming language
# =============================================
#
# This heavily relies on https://github.com/oxalica/rust-overlay
#
# You can spawn a Rust development shell by running:
#
# nix develop "github:input-output-hk/devx#rust"
#
# You can specify a channel by replacing `#rust` by `#rust-beta` or
# `#rust-nightly` (by default the shell will use the latest stable), or
# directly specify a Rust version, e.g., `#rust-1.66.1`.
{ pkgs ? import <nixpkgs> { overlays = [ (import <rust-overlay>) ]; } }:
with builtins;
let
rust-channels = [ "stable" "beta" "nightly" ];
rust-versions = [
"1.66.1"
"1.65.0"
"1.64.0"
"1.63.0"
"1.62.1"
"1.61.0"
"1.60.0"
"1.59.0"
"1.58.1"
"1.57.0"
"1.56.1"
];
shell = channel: version: {
name = "rust-${channel}-${version}";
value = with pkgs;
mkShell {
nativeBuildInputs = [
openssl
pkg-config
((if channel == "nightly" then
rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)
else
rust-bin.${channel}.${version}.default).override {
extensions = [ "rust-src" ];
})
rust-analyzer
];
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
RUST_BACKTRACE = 1;
};
};
toolchains = listToAttrs ((map (x: shell x "latest") rust-channels)
++ (map (x: shell "stable" x) rust-versions));
fix = import ./fix-devshells.nix { inherit pkgs; };
in fix (toolchains // { rust = toolchains.rust-stable-latest; }
// (listToAttrs ((map (x: { name = "rust-${x}"; value = toolchains."rust-${x}-latest"; }) rust-channels)
++ (map (x: { name = "rust-${x}"; value = toolchains."rust-stable-${x}"; }) rust-versions))))
Bumps [bech32](https://github.com/rust-bitcoin/rust-bech32) from 0.8.1 to 0.9.1. - [Changelog](https://github.com/rust-bitcoin/rust-bech32/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-bitcoin/rust-bech32/compare/v0.8.1...v0.9.1) --- updated-dependencies: - dependency-name: bech32 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [log](https://github.com/rust-lang/log) from 0.4.17 to 0.4.18. - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/log/compare/0.4.17...0.4.18) --- updated-dependencies: - dependency-name: log dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.1 to 1.28.2. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.1...tokio-1.28.2) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
PLT-5901 Implemented checks for valid network addresses.
fix: tuple clause must preserve previous clause properties state
fix: rearrange clauses and fill in gaps now handles nested patterns in a uniform way fix: discards in records was being sorted incorrectly leading to type issues chore: remove some filter maps in cases where None is impossible anyway chore: some refactoring on a couple functions to clean up
fix: tuple clause must preserve previous clause properties state