Initial commit

This commit is contained in:
Michael Smith
2024-07-26 22:48:08 +02:00
commit 3ca3139b0e
4 changed files with 64 additions and 0 deletions

35
flake.nix Normal file
View File

@@ -0,0 +1,35 @@
{
description = "A Python project";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
my-python = pkgs.python3.withPackages (ps: [ps.numpy]);
in {
formatter.${system} = pkgs.alejandra;
devShells.${system} = {
default = self.devShells.${system}.foo;
foo = pkgs.mkShell {
packages = with pkgs; [
my-python
];
};
};
packages.${system} = {
default = self.packages.${system}.hello;
hello = pkgs.writeShellScriptBin "hello" ''
${pkgs.python3}/bin/python ${./main.py}
'';
};
};
}