swapspace: add passthru.binlore

Consider this Nix expression:

  let
    pkgs = import /path/to/nixpkgs { };
  in

  pkgs.resholve.writeScript "mime-construct-binlore-test" {
    inputs = [ pkgs.swapspace ];
    interpreter = "${pkgs.lib.getExe pkgs.bash}";
  } ''
    swapspace --version
  ''

Before this change, that expression would fail to build because resholve
would think that swapspace might be able to execute its arguments. This
commit fixes that problem.
This commit is contained in:
Jason Yundt
2024-09-22 14:33:19 -04:00
parent 9c0af0e544
commit cf5eb4882e
+7 -1
View File
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, installShellFiles, util-linux }:
{ lib, stdenv, fetchFromGitHub, autoreconfHook, installShellFiles, util-linux, binlore, swapspace }:
stdenv.mkDerivation rec {
pname = "swapspace";
@@ -35,6 +35,12 @@ stdenv.mkDerivation rec {
install --mode=444 -D 'swapspace.service' "$out/etc/systemd/system/swapspace.service"
'';
# Nothing in swapspace --help or swapspaces man page mentions
# anything about swapspace executing its arguments.
passthru.binlore.out = binlore.synthesize swapspace ''
execer cannot bin/swapspace
'';
meta = with lib; {
description = "Dynamic swap manager for Linux";
homepage = "https://github.com/Tookmund/Swapspace";