Skip to content

Commit

Permalink
nix: update flake.lock and face the problems
Browse files Browse the repository at this point in the history
  • Loading branch information
liferooter committed Dec 21, 2024
1 parent 3f2033b commit 8bcc402
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 111 deletions.
20 changes: 10 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 8 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,23 @@
];

perSystem =
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
project = pyproject-nix.lib.project.loadPyproject {
projectRoot = ./.;
pyproject = lib.pipe ./pyproject.toml [
lib.readFile
(lib.replaceStrings ["cryptg-anyos"] ["cryptg"])
builtins.fromTOML
];
};
python = pkgs.python3.override {
packageOverrides = import ./nix/mkPackageOverrides.nix { inherit pkgs; };
};
packageAttrs = project.renderers.buildPythonPackage { inherit python; };
packageAttrs = import ./nix/mkPackageAttrs.nix { inherit pkgs project python; };
in
{
packages = {
tgpy = python.pkgs.buildPythonPackage (
packageAttrs
// {
meta = {
license = pkgs.lib.licenses.mit;
homepage = "https://tgpy.tmat.me/";
pythonImportsCheck = [ "tgpy" ];
};
}
);
tgpy = python.pkgs.buildPythonPackage packageAttrs;
default = config.packages.tgpy;
};

Expand Down
16 changes: 16 additions & 0 deletions nix/mkPackageAttrs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ pkgs, project, python }:
(project.renderers.buildPythonPackage { inherit python; }) // {
src = ./..;
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "cryptg-anyos" "cryptg"
'';
pythonRelaxDeps = [
"cryptg"
];
meta = {
license = pkgs.lib.licenses.mit;
homepage = "https://tgpy.tmat.me/";
pythonImportsCheck = [ "tgpy" ];
};
}
16 changes: 5 additions & 11 deletions nix/mkPackageOverrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ self: super: {
};
doCheck = false;
});
cryptg-anyos = super.cryptg.overridePythonAttrs (old: rec {
version = "0.4.1";
pname = "cryptg-anyos";
src = super.fetchPypi {
inherit version pname;
hash = "sha256-pXY0CfdZRDjgID78STTDrvm1wUj4z1AooUBtrSG09Qo=";
};
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
inherit src;
hash = "sha256-AqSVFOB9Lfvk9h3GtoYlEOXBEt7YZYLhCDNKM9upQ2U=";
};
mkdocs-git-revision-date-localized-plugin = super.mkdocs-git-revision-date-localized-plugin.overridePythonAttrs (old: {
pyproject = true;
format = null;

dependencies = old.propagatedBuildInputs ++ [ super.setuptools-scm ];
});
}
4 changes: 2 additions & 2 deletions nix/poetry-master.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pkgs.poetry.overridePythonAttrs (old: {
hash = "sha256-tBim3dlKdkcvWWGavHpv52HAZX1FvPh2S+FTKPMrZVs=";
};

propagatedBuildInputs = builtins.map (
dependencies = builtins.map (
x: if x.pname or "" == "poetry-core" then poetry-core else x
) old.propagatedBuildInputs;
) old.dependencies;

pythonRelaxDeps = [
"dulwich"
Expand Down
Loading

0 comments on commit 8bcc402

Please sign in to comment.