Skip to content

Commit

Permalink
build: Update flake with rust and maturin
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed May 24, 2024
1 parent b7d4e8d commit 6ac2c6a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 120 deletions.
110 changes: 20 additions & 90 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 26 additions & 30 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
nixpkgs-python.url = "github:cachix/nixpkgs-python";
};

nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = {
self,
nixpkgs,
devenv,
systems,
flake-parts,
...
} @ inputs: let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in {
devShells =
forEachSystem
(system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
languages.python = {
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [inputs.devenv.flakeModule];
systems = ["x86_64-linux" "aarch64-darwin"];

perSystem = {pkgs, ...}: {
devenv.shells.default = {
packages = with pkgs; [maturin];

languages = {
python = {
enable = true;
poetry = {
enable = true;
poetry = {
enable = true;
install.enable = true;
install.allExtras = true;
};
version = "3.11";
install.enable = true;
install.allExtras = true;
};
}
];
};
rust.enable = true;
};
};
});
};
};

nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
}

0 comments on commit 6ac2c6a

Please sign in to comment.