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

View file

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

View file

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