From e8228570b5e50c025fb2369543f7f2b55d3dfa36 Mon Sep 17 00:00:00 2001 From: Sergey Bubnov Date: Sat, 19 Oct 2024 13:09:40 +0400 Subject: [PATCH] pin magika python package to version 0.5.0 --- flake.lock | 39 ++++++++++++++++++++++++++++----------- flake.nix | 16 ++++++++++++++-- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 1f29dd1..80854ac 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1722113426, - "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "lastModified": 1728330715, + "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", "owner": "numtide", "repo": "devshell", - "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1722555600, - "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "type": "github" }, "original": { @@ -114,14 +114,14 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1722555339, - "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", + "lastModified": 1727825735, + "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" } }, "nixpkgs-lib_2": { @@ -154,7 +154,8 @@ "flake-parts": "flake-parts", "neontology-py": "neontology-py", "nixpkgs": "nixpkgs", - "strictjson-py": "strictjson-py" + "strictjson-py": "strictjson-py", + "unstable": "unstable" } }, "strictjson-py": { @@ -177,6 +178,22 @@ "repo": "strictjson.py-nix", "type": "github" } + }, + "unstable": { + "locked": { + "lastModified": 1729265718, + "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ccc0c2126893dd20963580b6478d1a10a4512185", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 173115c..a85f5df 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/24.05"; - #nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; neontology-py.url = "github:mindwm/neontology"; neontology-py.inputs.nixpkgs.follows = "nixpkgs"; @@ -21,7 +21,18 @@ systems = [ "x86_64-linux" "aarch64-linux" ]; perSystem = { config, self', inputs', pkgs, system, ... }: let - my_python = pkgs.python3.withPackages (ps: with ps; [ + packageOverrides = self: super: { + magika = super.magika.overridePythonAttrs (old: rec { + version = "0.5.0"; + src = super.fetchPypi { + pname = "magika"; + inherit version; + hash = "sha256-r6C7iDCG/o3JEvweQGb4upr+LuHvmNtkwtduZGehCsc="; + }; + }); + }; + python = pkgs.python3.override { inherit packageOverrides; }; + my_python = python.withPackages (ps: with ps; [ inputs.neontology-py.packages.${system}.default inputs.strictjson-py.packages.${system}.default pydantic dateutil urllib3 @@ -34,6 +45,7 @@ pyyaml openai cloudevents deprecation + magika ]); project = pkgs.callPackage ./package.nix { my_python = pkgs.python3;