/ flake.nix
flake.nix
  1  {
  2    description = "various dev shells as flakes";
  3    inputs = {
  4      nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  5      utils.url = "github:numtide/flake-utils";
  6      fenix-monthly.url = "github:nix-community/fenix/monthly";
  7      flake-compat = {
  8        url = "github:edolstra/flake-compat";
  9        flake = false;
 10      };
 11    };
 12  
 13    outputs = {
 14      self,
 15      fenix-monthly,
 16      flake-compat,
 17      nixpkgs,
 18      utils,
 19    }:
 20      utils.lib.eachDefaultSystem (system: let
 21        pkgs = nixpkgs.legacyPackages."${system}";
 22        rust-monthly = fenix-monthly.packages."${system}".complete;
 23  
 24        mkPythonShell = python: pkgs.mkShell {
 25          nativeBuildInputs = with pkgs; [
 26            # Build tools
 27            autoconf
 28            automake
 29            cmake
 30            gcc
 31            gnumake
 32            libtool
 33  
 34            # Common native dependencies for Python packages
 35            libffi
 36            openssl
 37            zlib
 38  
 39            # Development tools
 40            cacert
 41            git
 42            nodejs
 43            pkg-config
 44            python
 45            uv
 46          ];
 47        };
 48      in rec {
 49        devShells.rust = pkgs.mkShell {
 50          nativeBuildInputs = with pkgs; [
 51            buck2
 52            cacert
 53            cargo
 54            cargo-edit
 55            cargo-outdated
 56            cargo-release
 57            cargo-watch
 58            clippy
 59            dotslash
 60            git
 61            llvmPackages_20.llvm
 62            openssh
 63            openssl
 64            pkg-config
 65            rustc
 66            rustfmt
 67          ];
 68          RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
 69        };
 70        devShells.rust-nightly =
 71          pkgs.mkShell
 72          {
 73            nativeBuildInputs = with pkgs; [
 74            buck2
 75            cacert
 76            cargo-edit
 77            cargo-outdated
 78            cargo-release
 79            cargo-watch
 80            clippy
 81            git
 82            llvmPackages_20.llvm
 83            openssh
 84            openssl
 85            pkg-config
 86            rustfmt
 87              rust-monthly.toolchain
 88            ];
 89            RUST_SRC_PATH = "${rust-monthly.rust-src}/lib/rustlib/src/rust/";
 90          };
 91        devShells.qmk =
 92          pkgs.mkShell
 93          {
 94            nativeBuildInputs = with pkgs; [
 95              cacert
 96              git
 97              keymapviz
 98              llvmPackages_17.llvm
 99              openssh
100              openssl
101              pkg-config
102              qmk
103              qmk_hid
104              vial
105            ];
106          };
107        devShells.python314 = mkPythonShell pkgs.python314;
108        devShells.python313 = mkPythonShell pkgs.python313;
109        devShells.python312 = mkPythonShell pkgs.python312;
110        devShells.default = pkgs.mkShell {
111          nativeBuildInputs = with pkgs; [
112            nodejs
113          ];
114        };
115      });
116  }