Rename main.py -> cli.py and add poetry pre-commit hooks

Add apps section to flake.nix output to explicitly define CLI output
path
This commit is contained in:
Evie Litherland-Smith 2024-05-26 10:52:54 +01:00
parent b48d53fa2a
commit c477ec58a9
4 changed files with 17 additions and 2 deletions

View file

@ -8,6 +8,11 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/python-poetry/poetry
rev: "1.8.0" # add version here
hooks:
- id: poetry-check
- id: poetry-lock
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:

View file

@ -16,7 +16,17 @@
packages = forAllSystems (system: let
inherit (poetry2nix.lib.mkPoetry2Nix {pkgs = pkgs.${system};}) mkPoetryApplication;
in {
default = mkPoetryApplication {projectDir = self;};
default = mkPoetryApplication {
projectDir = self;
checkGroups = [];
};
});
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/nix-background-upgrade";
};
});
devShells = forAllSystems (system: let

View file

@ -9,7 +9,7 @@ repository = "https://git.xenia.me.uk/pixelifytica/nix-background-upgrade"
packages = [{include = "nix_background_upgrade", from = "src"}]
[tool.poetry.scripts]
nbu = 'nix_background_upgrade.main:main'
nix-background-upgrade = 'nix_background_upgrade.cli:main'
[tool.poetry.dependencies]
python = "^3.9"