mirror of
https://github.com/NixOS/templates.git
synced 2026-01-14 10:18:27 +01:00
python: refactor and cleanup
This commit is contained in:
parent
2f86534428
commit
cd093ed16b
6 changed files with 21 additions and 60 deletions
|
|
@ -1 +0,0 @@
|
|||
use flake
|
||||
13
python/.github/workflows/build_nix.yml
vendored
13
python/.github/workflows/build_nix.yml
vendored
|
|
@ -1,13 +0,0 @@
|
|||
name: "Build legacy Nix package on Ubuntu"
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v12
|
||||
- name: Building package
|
||||
run: nix-build . -A defaultPackage.x86_64-linux
|
||||
6
python/.gitignore
vendored
6
python/.gitignore
vendored
|
|
@ -1,6 +0,0 @@
|
|||
__pycache__
|
||||
secrets.py
|
||||
runs
|
||||
.ipynb_*
|
||||
*.csv
|
||||
.direnv
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
(import (
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
||||
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
|
||||
) {
|
||||
src = ./.;
|
||||
}).defaultNix
|
||||
|
|
@ -1,29 +1,24 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system: {
|
||||
default = pkgs.${system}.poetry2nix.mkPoetryApplication { projectDir = self; };
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system: {
|
||||
default = pkgs.${system}.mkShellNoCC {
|
||||
packages = with pkgs.${system}; [
|
||||
(poetry2nix.mkPoetryEnv { projectDir = self; })
|
||||
poetry
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
outputs = {self, nixpkgs, utils}:
|
||||
let out = system:
|
||||
let pkgs = nixpkgs.legacyPackages."${system}";
|
||||
in {
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
python3Packages.poetry
|
||||
];
|
||||
};
|
||||
|
||||
defaultPackage = with pkgs.poetry2nix; mkPoetryApplication {
|
||||
projectDir = ./.;
|
||||
preferWheels = true;
|
||||
};
|
||||
|
||||
defaultApp = utils.lib.mkApp {
|
||||
drv = self.defaultPackage."${system}";
|
||||
};
|
||||
|
||||
}; in with utils.lib; eachSystem defaultSystems out;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
(import (
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
||||
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
|
||||
) {
|
||||
src = ./.;
|
||||
}).shellNix
|
||||
Loading…
Add table
Add a link
Reference in a new issue