From 2c77ae6357da6b55c35f6b899e882e32ea66c2df Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 7 Jun 2025 15:02:29 +0200 Subject: [PATCH] flake.nix: add libdib --- flake.lock | 76 ++++++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 15 ++++++++-- nix/dibbler.nix | 1 + nix/shell.nix | 1 + 4 files changed, 86 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 4c928a4..a474bb1 100644 --- a/flake.lock +++ b/flake.lock @@ -17,13 +17,65 @@ "type": "indirect" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "libdib": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1749301134, + "narHash": "sha256-JHLVV4ug8AgG71xhXEdmXozQfesXut6NUdXbBZNkD3c=", + "ref": "refs/heads/main", + "rev": "ca26131c22bb2833c81254dbabab6d785b9f37f0", + "revCount": 8, + "type": "git", + "url": "https://git.pvv.ntnu.no/Projects/libdib.git" + }, + "original": { + "type": "git", + "url": "https://git.pvv.ntnu.no/Projects/libdib.git" + } + }, "nixpkgs": { "locked": { - "lastModified": 1742288794, - "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", + "lastModified": 1749143949, + "narHash": "sha256-QuUtALJpVrPnPeozlUG/y+oIMSLdptHxb3GK6cpSVhA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", + "rev": "d3d2d80a2191a73d1e86456a751b83aa13085d7d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1749143949, + "narHash": "sha256-QuUtALJpVrPnPeozlUG/y+oIMSLdptHxb3GK6cpSVhA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d3d2d80a2191a73d1e86456a751b83aa13085d7d", "type": "github" }, "original": { @@ -36,7 +88,8 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "libdib": "libdib", + "nixpkgs": "nixpkgs_2" } }, "systems": { @@ -53,6 +106,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 4410f60..33d62b6 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,13 @@ { description = "Dibbler samspleisebod"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - outputs = { self, nixpkgs, flake-utils }: let + libdib.url = "git+https://git.pvv.ntnu.no/Projects/libdib.git"; + }; + + outputs = { self, nixpkgs, flake-utils, libdib }: let inherit (nixpkgs) lib; systems = [ @@ -14,7 +18,12 @@ ]; forAllSystems = f: lib.genAttrs systems (system: let - pkgs = nixpkgs.legacyPackages.${system}; + pkgs = import nixpkgs { + inherit system; + overlays = [ + libdib.overlays.default + ]; + }; in f system pkgs); in { packages = forAllSystems (system: pkgs: { diff --git a/nix/dibbler.nix b/nix/dibbler.nix index 24dc21d..acbbcf1 100644 --- a/nix/dibbler.nix +++ b/nix/dibbler.nix @@ -16,6 +16,7 @@ python3Packages.buildPythonApplication { nativeBuildInputs = with python3Packages; [ setuptools ]; propagatedBuildInputs = with python3Packages; [ brother-ql + libdib matplotlib psycopg2 python-barcode diff --git a/nix/shell.nix b/nix/shell.nix index 7c93f0f..09ddbe8 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -12,6 +12,7 @@ mkShell { (python.withPackages (ps: with ps; [ brother-ql matplotlib + libdib psycopg2 python-barcode sqlalchemy