13 stdenv.mkDerivation (finalAttrs: {
17 src = fetchFromGitHub {
20 tag = "v${finalAttrs.version}";
21 sha256 = "sha256-KrPdmF1H7WFI78ZJlLqDyfxbs7fymSUQpXL+7XjN9bI=";
30 substituteInPlace 'swapspace.service' \
31 --replace '/usr/local/sbin/' "$out/bin/"
32 substituteInPlace 'src/support.c' \
33 --replace '/sbin/swapon' '${lib.getBin util-linux}/bin/swapon' \
34 --replace '/sbin/swapoff' '${lib.getBin util-linux}/bin/swapoff'
35 substituteInPlace 'src/swaps.c' \
36 --replace 'mkswap' '${lib.getBin util-linux}/bin/mkswap'
38 # Don't create empty directory $out/var/lib/swapspace
39 substituteInPlace 'Makefile.am' \
40 --replace 'install-data-local:' 'do-not-execute:'
44 installManPage doc/swapspace.8
45 install --mode=444 -D 'swapspace.service' "$out/etc/systemd/system/swapspace.service"
49 # Nothing in swapspace --help or swapspace’s man page mentions
50 # anything about swapspace executing its arguments.
51 binlore.out = binlore.synthesize swapspace ''
52 execer cannot bin/swapspace
55 inherit (nixosTests) swapspace;
60 description = "Dynamic swap manager for Linux";
61 homepage = "https://github.com/Tookmund/Swapspace";
62 changelog = "https://github.com/Tookmund/Swapspace/releases/tag/v${finalAttrs.version}";
63 mainProgram = "swapspace";
64 license = lib.licenses.gpl2Only;
65 platforms = lib.platforms.linux;
66 maintainers = with lib.maintainers; [ Luflosi ];