Initial commit
This commit is contained in:
35
flake.nix
Normal file
35
flake.nix
Normal 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}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user