dynix/shell.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2026 Qyriad <qyriad@qyriad.me>
#
# SPDX-License-Identifier: EUPL-1.1
2026-01-21 15:23:04 +01:00
{
2026-02-17 20:17:39 +01:00
pkgs ? import <nixpkgs> {
config = {
checkMeta = true;
allowAliases = false;
};
},
qpkgs ? let
src = fetchTarball "https://github.com/Qyriad/nur-packages/archive/main.tar.gz";
in import src { inherit pkgs; },
dynix ? import ./default.nix { inherit pkgs qpkgs; },
fenixLib ? let
src = fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz";
in import src { inherit pkgs; },
2026-03-22 17:15:04 +01:00
fenixBaseToolchain ? fenixLib.stable.withComponents [
"cargo"
"rustc"
"llvm-tools"
"rust-std"
"rust-docs"
"rust-src"
"rustc-dev"
"clippy"
],
fenixToolchain ? fenixLib.combine [
fenixBaseToolchain
# Rustfmt is very handy to have as nightly.
fenixLib.latest.rustfmt
],
2026-01-21 15:23:04 +01:00
}: let
2026-02-17 20:17:39 +01:00
inherit (pkgs) lib;
2026-01-21 15:23:04 +01:00
2026-02-17 20:17:39 +01:00
mkDevShell = dynix: qpkgs.callPackage dynix.mkDevShell { inherit fenixToolchain; };
2026-03-22 15:57:38 +01:00
devShell = mkDevShell dynix |> qpkgs.stdlib.mkStdenvPretty;
2026-01-21 15:23:04 +01:00
2026-02-17 20:17:39 +01:00
byStdenv = lib.mapAttrs (lib.const mkDevShell) dynix.byStdenv;
2026-01-21 15:23:04 +01:00
2026-02-09 14:32:56 +01:00
in devShell.overrideAttrs (prev: {
2026-02-17 20:17:39 +01:00
passthru = { inherit byStdenv; };
2026-01-21 15:23:04 +01:00
})