From e1605aab29984309e419d904781edde8a3abb7a7 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 15 Nov 2024 00:21:53 +0100 Subject: [PATCH] modernize --- .gitignore | 2 ++ flake.lock | 8 ++++---- flake.nix | 4 +--- nix/dibbler.nix | 23 +++++++++++++++-------- nix/module.nix | 5 ++++- pyproject.toml | 3 +-- 6 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index d82db46..529b7f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ result result-* +.direnv +.devenv dist diff --git a/flake.lock b/flake.lock index 3f5c267..be183d5 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1693145325, - "narHash": "sha256-Gat9xskErH1zOcLjYMhSDBo0JTBZKfGS0xJlIRnj6Rc=", - "owner": "NixOS", + "lastModified": 1731611831, + "narHash": "sha256-R51rOqkWMfubBkZ9BY4Y1VaRoeqEBshlfQ8mMH5RjqI=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "cddebdb60de376c1bdb7a4e6ee3d98355453fe56", + "rev": "cea28c811faadb50bee00d433bbf2fea845a43e4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 499a8de..cf3c236 100644 --- a/flake.nix +++ b/flake.nix @@ -9,9 +9,7 @@ in { packages = { default = self.packages.${system}.dibbler; - dibbler = pkgs.callPackage ./nix/dibbler.nix { - python3Packages = pkgs.python311Packages; - }; + dibbler = pkgs.python311Packages.callPackage ./nix/dibbler.nix { }; }; apps = { diff --git a/nix/dibbler.nix b/nix/dibbler.nix index 527b7ba..0e11ba3 100644 --- a/nix/dibbler.nix +++ b/nix/dibbler.nix @@ -1,17 +1,24 @@ { lib -, python3Packages , fetchFromGitHub +, buildPythonApplication +, setuptools +, brother-ql +, matplotlib +, psycopg2 +, python-barcode +, sqlalchemy }: -python3Packages.buildPythonApplication { + +buildPythonApplication { pname = "dibbler"; - version = "unstable-2021-09-07"; + version = "0-unstable-2021-09-07"; + pyproject = true; + src = lib.cleanSource ../.; - format = "pyproject"; - - nativeBuildInputs = with python3Packages; [ setuptools ]; - propagatedBuildInputs = with python3Packages; [ - brother-ql + built-system = [ setuptools ]; + dependencies = [ + brother-ql#-next matplotlib psycopg2 python-barcode diff --git a/nix/module.nix b/nix/module.nix index 69aa1a1..e9a63b3 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -23,7 +23,10 @@ in { group = "dibbler"; extraGroups = [ "lp" ]; isNormalUser = true; - shell = ((pkgs.writeShellScriptBin "login-shell" "${screen} -x dibbler") // {shellPath = "/bin/login-shell";}); + shell = ( + (pkgs.writeShellScriptBin "login-shell" "${screen} -x dibbler") + // {shellPath = "/bin/login-shell";} + ); }; }; diff --git a/pyproject.toml b/pyproject.toml index 0de40ff..40f8655 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ ] dependencies = [ "SQLAlchemy >= 2.0, <2.1", - "brother-ql", + "brother_ql_next", "matplotlib", "psycopg2 >= 2.8, <2.10", "python-barcode", @@ -32,4 +32,3 @@ line-length = 100 [tool.ruff] line-length = 100 -