nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 pkgs,
4 python,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pygobject3,
8 libblockdev,
9 bytesize,
10 pyudev,
11 dbus-python,
12 util-linux,
13 kmod,
14 libndctl,
15 nvme-cli,
16 dosfstools,
17 e2fsprogs,
18 hfsprogs,
19 xfsprogs,
20 f2fs-tools,
21 ntfs3g,
22 btrfs-progs,
23 mdadm,
24 lvm2,
25 gfs2-utils,
26 cryptsetup,
27 multipath-tools,
28 dracut,
29 stratisd,
30}:
31
32let
33 libblockdevPython = (libblockdev.override { python3 = python; }).python;
34in
35buildPythonPackage rec {
36 pname = "blivet";
37 version = "3.13.1";
38 format = "setuptools";
39
40 src = fetchFromGitHub {
41 owner = "storaged-project";
42 repo = "blivet";
43 tag = "blivet-${version}";
44 hash = "sha256-5uhiCnwj5DyffsI2XEaLdvHMepjGWt2JlDmyZExSNRI=";
45 };
46
47 postPatch = ''
48 find blivet -name '*.py' | while IFS= read -r i ; do
49 substituteInPlace "$i" \
50 --replace \
51 'gi.require_version("BlockDev",' \
52 'import gi.repository
53 gi.require_version("GIRepository", "3.0")
54 from gi.repository import GIRepository
55 GIRepository.Repository.dup_default().prepend_search_path("${libblockdev}/lib/girepository-1.0")
56 gi.require_version("BlockDev",'
57 done
58 '';
59
60 propagatedBuildInputs = [
61 pygobject3
62 libblockdevPython
63 bytesize
64 pyudev
65 dbus-python
66 util-linux
67 kmod
68 libndctl
69 nvme-cli
70 pkgs.systemd
71 dosfstools
72 e2fsprogs
73 hfsprogs
74 xfsprogs
75 f2fs-tools
76 ntfs3g
77 btrfs-progs
78 mdadm
79 lvm2
80 gfs2-utils
81 cryptsetup
82 multipath-tools
83 dracut
84 stratisd
85 ];
86
87 pythonImportsCheck = [ "blivet" ];
88
89 # Even unit tests require a system D-Bus.
90 # TODO: Write a NixOS VM test?
91 doCheck = false;
92
93 meta = {
94 description = "Python module for system storage configuration";
95 homepage = "https://github.com/storaged-project/blivet";
96 license = [
97 lib.licenses.gpl2Plus
98 lib.licenses.lgpl2Plus
99 ];
100 maintainers = with lib.maintainers; [ cybershadow ];
101 platforms = lib.platforms.linux;
102 };
103}