Reorganized
This commit is contained in:
1 parent
c3c61ce654
commit
760815da50
145 files changed
-1444
No files matched your search
@@ -0,0 +1,35 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
packages = config.python.packages;
|
||||
pythonPackage = pkgs.python3.withPackages packages;
|
||||
in
|
||||
{
|
||||
options.python = {
|
||||
enable = mkEnableOption "Python";
|
||||
packages = mkOption {
|
||||
type = types.functionTo (types.listOf types.package) // {
|
||||
merge =
|
||||
loc: defs: p:
|
||||
lib.concatMap (def: (def.value p)) defs;
|
||||
};
|
||||
default = p: [ ];
|
||||
description = "Python packages to install";
|
||||
};
|
||||
# TODO: Add option to directly read from requirements.txt, maybe with mach-nix
|
||||
};
|
||||
|
||||
config = mkIf config.python.enable {
|
||||
packages = [
|
||||
pythonPackage
|
||||
];
|
||||
|
||||
env.PYTHONINTERPRETER = "${pythonPackage}/bin/python";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
rustPackage = pkgs.rustc;
|
||||
in
|
||||
{
|
||||
options.rust = {
|
||||
enable = mkEnableOption "Rust";
|
||||
# TODO: Add option to specify toolchain file
|
||||
# See https://ayats.org/blog/nix-rustup
|
||||
};
|
||||
|
||||
config = mkIf config.rust.enable {
|
||||
packages = with pkgs; [
|
||||
rustPackage
|
||||
cargo
|
||||
clippy
|
||||
rustfmt
|
||||
cargo-audit
|
||||
|
||||
bacon
|
||||
evcxr
|
||||
|
||||
# TODO: Might be needed for bindgen
|
||||
# rustPlatform.bindgenHook
|
||||
# pkg-config
|
||||
];
|
||||
|
||||
# env.RUST_SRC_PATH = "${rustPackage}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user