WIP 2
This commit is contained in:
45
flake.nix
45
flake.nix
@@ -4,22 +4,23 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
pyproject-nix = {
|
||||
url = "github:pyproject-nix/pyproject.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||
outputs = { self, nixpkgs, flake-utils, pyproject-nix }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
python = pkgs.python313.withPackages (ps: with ps; [
|
||||
isort
|
||||
flake8
|
||||
semver
|
||||
toml
|
||||
requests
|
||||
pyyaml
|
||||
packaging
|
||||
]);
|
||||
pythonProject = pyproject-nix.lib.project.loadPyproject {
|
||||
projectRoot = ./.;
|
||||
};
|
||||
|
||||
pythonInterpreter = pkgs.python313;
|
||||
|
||||
pythonPackage = pkgs.python3Packages.buildPythonPackage {
|
||||
name = "release-action";
|
||||
@@ -32,24 +33,18 @@
|
||||
pkgs.envsubst
|
||||
pkgs.just
|
||||
pkgs.gitea-actions-runner
|
||||
python
|
||||
(pythonInterpreter.withPackages
|
||||
(pythonProject.renderers.withPackages {
|
||||
python = pythonInterpreter;
|
||||
extraPackages = ps: with ps; [ flake8 isort ];
|
||||
}))
|
||||
];
|
||||
};
|
||||
|
||||
packages.default = pkgs.writers.writePython3Bin
|
||||
"release-action"
|
||||
{
|
||||
libraries = with pkgs.python3Packages; [
|
||||
semver # TODO move to setup.py?
|
||||
toml
|
||||
requests
|
||||
pythonPackage
|
||||
pyyaml
|
||||
packaging
|
||||
];
|
||||
}
|
||||
(builtins.readFile ./src/main.py)
|
||||
;
|
||||
packages.default = pythonInterpreter.pkgs.buildPythonPackage (
|
||||
pythonProject.renderers.buildPythonPackage {
|
||||
python = pythonInterpreter;
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user