-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
203 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Notes for using this package outside of NixOS: | ||
# 1. --pure cannot be used (as pkexec will be used from the path, | ||
# and we can't use nixpkgs polkit due to lack of setuid bit) | ||
# 2. You must prefix the blivet-gui command with "SHELL=/bin/bash" | ||
# (otherwise your system polkit will reject the SHEL Lfrom nixpkgs). | ||
|
||
{ | ||
lib, | ||
python3, | ||
fetchFromGitHub, | ||
gtk3, | ||
util-linux, | ||
gobject-introspection, | ||
adwaita-icon-theme, | ||
hicolor-icon-theme, | ||
wrapGAppsHook3, | ||
pkexecPath ? "pkexec", | ||
testers, | ||
blivet-gui, | ||
}: | ||
|
||
python3.pkgs.buildPythonApplication rec { | ||
pname = "blivet-gui"; | ||
version = "2.5.0"; | ||
format = "setuptools"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "storaged-project"; | ||
repo = "blivet-gui"; | ||
rev = version; | ||
hash = "sha256-fKd2Vj8clZ6Q7bZipfN5umyMW2rBXMUnpAuDE70p67U="; | ||
}; | ||
|
||
postPatch = '' | ||
substituteInPlace blivetgui/gui_utils.py --replace-fail /usr/share $out/share | ||
substituteInPlace blivet-gui --replace-fail "pkexec blivet-gui-daemon" "pkexec $out/bin/blivet-gui-daemon" | ||
substituteInPlace blivet-gui --replace-fail "pkexec" "${pkexecPath}" | ||
''; | ||
|
||
nativeBuildInputs = [ | ||
util-linux | ||
gobject-introspection | ||
wrapGAppsHook3 | ||
]; | ||
|
||
buildInputs = [ gtk3 ]; | ||
|
||
dependencies = [ | ||
python3.pkgs.blivet | ||
python3.pkgs.pyparted | ||
python3.pkgs.pid | ||
]; | ||
|
||
dontWrapGApps = true; | ||
|
||
preFixup = '' | ||
makeWrapperArgs+=( | ||
''${gappsWrapperArgs[@]} | ||
--prefix XDG_DATA_DIRS : ${adwaita-icon-theme}/share | ||
) | ||
''; | ||
|
||
passthru.tests.version = testers.testVersion { package = blivet-gui; }; | ||
|
||
meta = { | ||
description = "GUI tool for storage configuration using blivet library"; | ||
homepage = "https://fedoraproject.org/wiki/Blivet"; | ||
license = lib.licenses.gpl2Plus; | ||
mainProgram = "blivet-gui"; | ||
maintainers = with lib.maintainers; [ cybershadow ]; | ||
platforms = lib.platforms.linux; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
python, | ||
buildPythonPackage, | ||
fetchFromGitHub, | ||
pygobject3, | ||
libblockdev, | ||
bytesize, | ||
pyudev, | ||
dbus-python, | ||
util-linux, | ||
kmod, | ||
libndctl, | ||
nvme-cli, | ||
dosfstools, | ||
e2fsprogs, | ||
hfsprogs, | ||
xfsprogs, | ||
f2fs-tools, | ||
ntfs3g, | ||
btrfs-progs, | ||
reiserfsprogs, | ||
mdadm, | ||
lvm2, | ||
gfs2-utils, | ||
cryptsetup, | ||
multipath-tools, | ||
dracut, | ||
stratisd, | ||
}: | ||
|
||
let | ||
libblockdevPython = (libblockdev.override { python3 = python; }).python; | ||
in | ||
buildPythonPackage rec { | ||
pname = "blivet"; | ||
version = "3.10.1"; | ||
format = "setuptools"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "storaged-project"; | ||
repo = "blivet"; | ||
rev = "blivet-${version}"; | ||
hash = "sha256-Ooc63mf03ZO7zxm8s/Tm8jSQg5LWyKnHAqbyvn1UHB8="; | ||
}; | ||
|
||
postPatch = '' | ||
find blivet -name '*.py' | while IFS= read -r i ; do | ||
substituteInPlace "$i" \ | ||
--replace \ | ||
'gi.require_version("BlockDev",' \ | ||
'import gi.repository | ||
gi.require_version("GIRepository", "2.0") | ||
from gi.repository import GIRepository | ||
GIRepository.Repository.prepend_search_path("${libblockdev}/lib/girepository-1.0") | ||
gi.require_version("BlockDev",' | ||
done | ||
''; | ||
|
||
propagatedBuildInputs = [ | ||
pygobject3 | ||
libblockdevPython | ||
bytesize | ||
pyudev | ||
dbus-python | ||
util-linux | ||
kmod | ||
libndctl | ||
nvme-cli | ||
pkgs.systemd | ||
dosfstools | ||
e2fsprogs | ||
hfsprogs | ||
xfsprogs | ||
f2fs-tools | ||
ntfs3g | ||
btrfs-progs | ||
reiserfsprogs | ||
mdadm | ||
lvm2 | ||
gfs2-utils | ||
cryptsetup | ||
multipath-tools | ||
dracut | ||
stratisd | ||
]; | ||
|
||
pythonImportsCheck = [ "blivet" ]; | ||
|
||
# Even unit tests require a system D-Bus. | ||
# TODO: Write a NixOS VM test? | ||
doCheck = false; | ||
|
||
# Fails with: TypeError: don't know how to make test from: | ||
# <blivet.static_data.luks_data.LUKS_Data object at 0x7ffff4a34b90> | ||
dontUseSetuptoolsCheck = true; | ||
|
||
meta = { | ||
description = "Python module for system storage configuration"; | ||
homepage = "https://github.com/storaged-project/blivet"; | ||
license = [ | ||
lib.licenses.gpl2Plus | ||
lib.licenses.lgpl2Plus | ||
]; | ||
maintainers = with lib.maintainers; [ cybershadow ]; | ||
platforms = lib.platforms.linux; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters