feat: overengineered python devshell

This commit is contained in:
Kat Inskip 2022-12-04 18:33:41 +01:00
parent 573563c3d2
commit 269d3929f6
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
3 changed files with 108 additions and 83 deletions

11
flake.lock generated
View file

@ -135,7 +135,9 @@
"nixpkgs": [
"nixpkgs"
],
"pypi-deps-db": "pypi-deps-db"
"pypi-deps-db": [
"pypi-deps-db"
]
},
"locked": {
"lastModified": 1654084003,
@ -170,11 +172,11 @@
"pypi-deps-db": {
"flake": false,
"locked": {
"lastModified": 1643877077,
"narHash": "sha256-jv8pIvRFTP919GybOxXE5TfOkrjTbdo9QiCO1TD3ZaY=",
"lastModified": 1669590640,
"narHash": "sha256-w7HNNhdrYX1ystc/Djo5nEy2YjoYoxmRMrsqCyIF3pg=",
"owner": "DavHau",
"repo": "pypi-deps-db",
"rev": "da53397f0b782b0b18deb72ef8e0fb5aa7c98aa3",
"rev": "982b6cdf6552fb9296e1ade29cf65a2818cbbd6b",
"type": "github"
},
"original": {
@ -217,6 +219,7 @@
"home-manager": "home-manager",
"mach-nix": "mach-nix",
"nixpkgs": "nixpkgs",
"pypi-deps-db": "pypi-deps-db",
"ragenix": "ragenix",
"scalpel": "scalpel",
"tree": "tree",

View file

@ -37,11 +37,16 @@
sops-nix.follows = "empty";
};
};
pypi-deps-db = {
url = "github:DavHau/pypi-deps-db";
flake = false;
};
mach-nix = {
url = "mach-nix/3.5.0";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "utils";
pypi-deps-db.follows = "pypi-deps-db";
};
};
arcexprs = {

View file

@ -35,8 +35,11 @@
};
}).impure;
lib = inputs.nixpkgs.lib;
inherit (lib.attrsets) mapAttrs;
in utils.lib.mkFlake {
inherit (lib.lists) fold;
inherit (lib.attrsets) mapAttrs recursiveUpdate;
recursiveMergeAttrs = listOfAttrsets: fold (attrset: acc: recursiveUpdate attrset acc) {} listOfAttrsets;
in recursiveMergeAttrs [
(utils.lib.mkFlake {
inherit self inputs;
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
channelsConfig.allowUnfree = true;
@ -108,14 +111,28 @@ in utils.lib.mkFlake {
];
}) tree.home.profiles;
devShells = {
rust = with channels.nixpkgs; mkShell {
nativeBuildInputs = [
cargo
rustc
rustfmt
rustPackages.clippy
rust-analyzer
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
};
inherit tree;
};
devShells = {
"python" = mach-nix.mkPythonShell {
})
(utils.lib.eachDefaultSystem (system: {
devShells.python = nixpkgs.legacyPackages."${system}".mkShell {
buildInputs = let
pythonWithPkgs = mach-nix.lib."${system}".mkPython {
ignoreDataOutdated = true;
python = "python310";
requirements = ''
'';
}; in [ pythonWithPkgs ];
};
};
}
}))
]