|
| 1 | +{ |
| 2 | + inputs = { |
| 3 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 4 | + flake-utils.url = "github:numtide/flake-utils"; |
| 5 | + rust-overlay = { |
| 6 | + url = "github:oxalica/rust-overlay"; |
| 7 | + inputs.nixpkgs.follows = "nixpkgs"; |
| 8 | + }; |
| 9 | + }; |
| 10 | + outputs = { self, nixpkgs, flake-utils, rust-overlay }: |
| 11 | + flake-utils.lib.eachDefaultSystem |
| 12 | + (system: |
| 13 | + let |
| 14 | + overlays = [ (import rust-overlay) ]; |
| 15 | + pkgs = import nixpkgs { |
| 16 | + inherit system overlays; |
| 17 | + }; |
| 18 | + rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; |
| 19 | + beku = pkgs.python3Packages.buildPythonApplication rec { |
| 20 | + pname = "beku-stackabletech"; |
| 21 | + version = "0.0.10"; |
| 22 | + pyproject = true; |
| 23 | + src = pkgs.fetchFromGitHub { |
| 24 | + owner = "stackabletech"; |
| 25 | + repo = "beku.py"; |
| 26 | + rev = "${version}"; |
| 27 | + sha256 = "sha256-LaJdrNG5/fwpBl+Z0OmhSsM3uZXk7KX8QTCEC3xWXpQ="; |
| 28 | + }; |
| 29 | + build-system = with pkgs.python3Packages; [ setuptools ]; |
| 30 | + propagatedBuildInputs = with pkgs.python3Packages; [ jinja2 pyyaml ]; |
| 31 | + postConfigure = "echo -e \"from setuptools import setup\\nsetup()\" > setup.py"; |
| 32 | + }; |
| 33 | + nativeBuildInputs = with pkgs; [ rustToolchain pkg-config gnumake cmake crate2nix krb5 zlib glibc clang protobuf ]; |
| 34 | + buildInputs = with pkgs; [ |
| 35 | + openssl |
| 36 | + kuttl |
| 37 | + python3 |
| 38 | + beku |
| 39 | + ] ++ (with pkgs.python3Packages; [ |
| 40 | + jinja2 |
| 41 | + jinja2-cli |
| 42 | + ]); |
| 43 | + in |
| 44 | + with pkgs; |
| 45 | + { |
| 46 | + devShells.default = mkShell { |
| 47 | + inherit buildInputs nativeBuildInputs; |
| 48 | + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; |
| 49 | + BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion clang}/include"; |
| 50 | + }; |
| 51 | + } |
| 52 | + ); |
| 53 | +} |
0 commit comments