Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# we want to extract some metadata and especially the dependencies
# from the pyproject file, like this we do not have to maintain the
# list a second time
pyproject = pkgs.lib.trivial.importTOML ./pyproject.toml;
# get a list of python packages by name, used to get the nix packages
# for the dependency names from the pyproject file
getPkgs = names: builtins.attrValues (pkgs.lib.attrsets.getAttrs names pkgs.python3Packages);
# extract the python dependencies from the pyprojec file, cut the version constraint
dependencies' = pkgs.lib.lists.concatMap (builtins.match "([^>=<]*).*") pyproject.project.dependencies;
# the package is called gpg on PyPI but gpgme in nixpkgs
dependencies = map (x: if x == "gpg" then "gpgme" else x) dependencies';
in
{
packages = {
alot = pkgs.python3Packages.buildPythonApplication {
name = "alot";
version = "dev";
version = pyproject.project.version + "-post";
src = self;
pyproject = true;
outputs = [
"out"
"doc"
"man"
];
build-system = with pkgs.python3Packages; [
setuptools
setuptools-scm
];
dependencies = with pkgs.python3Packages; [
configobj
gpgme
notmuch2
python-magic
twisted
urwid
urwidtrees
];
build-system = getPkgs pyproject."build-system".requires;
dependencies = getPkgs dependencies;
postPatch = ''
substituteInPlace alot/settings/manager.py \
--replace /usr/share "$out/share"
Expand Down