Create flake config with dev shell to load poetry

This commit is contained in:
Tim Van Baak 2022-12-12 20:17:25 -08:00
parent 76aac8cce0
commit c51e70a809
2 changed files with 66 additions and 0 deletions

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"my-flake": {
"locked": {
"lastModified": 1670879933,
"narHash": "sha256-V45PH0cnFLilx66x4td5qQnWNn/V/6/6b7FQDIHvdyI=",
"owner": "Jaculabilis",
"repo": "my-flake",
"rev": "2b2cd07a6d971b15fc5f65d6d963d0da551a5892",
"type": "github"
},
"original": {
"owner": "Jaculabilis",
"repo": "my-flake",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1669833724,
"narHash": "sha256-/HEZNyGbnQecrgJnfE8d0WC5c1xuPSD2LUpB6YXlg4c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4d2b37a84fad1091b9de401eb450aae66f1a741e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "refs/tags/22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"my-flake": "my-flake",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

23
flake.nix Normal file
View File

@ -0,0 +1,23 @@
{
inputs = {
my-flake.url = "github:Jaculabilis/my-flake";
nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11";
};
outputs = { self, my-flake, nixpkgs }:
let
systems = [ "aarch64-linux" "x86_64-linux" ];
each = system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = [ (pkgs.python3.withPackages (py: [ py.poetry ])) ];
shellHook = ''
PS1="(nix develop) $PS1"
'';
};
};
in my-flake.outputs-for each systems;
}