Files
nixpkgs/pkgs/by-name/sn/snapper/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

106 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
docbook_xsl,
libxslt,
docbook_xml_dtd_45,
acl,
attr,
boost,
btrfs-progs,
coreutils,
dbus,
diffutils,
e2fsprogs,
libxml2,
lvm2,
pam,
util-linux,
json_c,
nixosTests,
ncurses,
zlib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "snapper";
version = "0.13.0";
src = fetchFromGitHub {
owner = "openSUSE";
repo = "snapper";
tag = "v${finalAttrs.version}";
hash = "sha256-8rIjfulMuh4HzZv08bX7gveJAo2X2GvswmBD3Ziu0NM=";
};
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
pkg-config
docbook_xsl
libxslt
docbook_xml_dtd_45
];
buildInputs = [
acl
attr
boost
btrfs-progs
dbus
diffutils
e2fsprogs
libxml2
lvm2
pam
util-linux
json_c
ncurses
zlib
];
# Hard-coded root paths, hard-coded root paths everywhere...
postPatch = ''
for file in {client/installation-helper,client/systemd-helper,data,scripts,zypp-plugin,scripts/completion}/Makefile.am; do
substituteInPlace $file \
--replace-warn '$(DESTDIR)/usr' "$out" \
--replace-warn "DESTDIR" "out" \
--replace-warn "/usr" "$out"
done
'';
configureFlags = [
"--disable-ext4" # requires patched kernel & e2fsprogs
"DIFFBIN=${diffutils}/bin/diff"
"RMBIN=${coreutils}/bin/rm"
];
enableParallelBuilding = true;
postInstall = ''
rm -r $out/etc/cron.*
patchShebangs $out/lib/zypp/plugins/commit/*
for file in \
$out/lib/pam_snapper/* \
$out/lib/systemd/system/* \
$out/share/dbus-1/system-services/* \
; do
substituteInPlace $file --replace-warn "/usr" "$out"
done
'';
passthru.tests.snapper = nixosTests.snapper;
meta = {
description = "Tool for Linux filesystem snapshot management";
homepage = "http://snapper.io";
license = lib.licenses.gpl2Only;
mainProgram = "snapper";
maintainers = with lib.maintainers; [ markuskowa ];
platforms = lib.platforms.linux;
};
})