summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/lsd.nix12
-rw-r--r--pkgs/tools/misc/lsd/default.nix14
3 files changed, 12 insertions, 15 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 847c9b7e567..fe5519041bb 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -237,7 +237,6 @@ in
   locate = handleTest ./locate.nix {};
   login = handleTest ./login.nix {};
   loki = handleTest ./loki.nix {};
-  lsd = handleTest ./lsd.nix {};
   lxd = handleTest ./lxd.nix {};
   lxd-nftables = handleTest ./lxd-nftables.nix {};
   #logstash = handleTest ./logstash.nix {};
diff --git a/nixos/tests/lsd.nix b/nixos/tests/lsd.nix
deleted file mode 100644
index c643f2f0b7b..00000000000
--- a/nixos/tests/lsd.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-import ./make-test-python.nix ({ pkgs, ... }: {
-  name = "lsd";
-  meta = with pkgs.lib.maintainers; { maintainers = [ nequissimus ]; };
-
-  nodes.lsd = { pkgs, ... }: { environment.systemPackages = [ pkgs.lsd ]; };
-
-  testScript = ''
-    lsd.succeed('echo "abc" > /tmp/foo')
-    assert "4 B /tmp/foo" in lsd.succeed('lsd --classic --blocks "size,name" -l /tmp/foo')
-    assert "lsd ${pkgs.lsd.version}" in lsd.succeed("lsd --version")
-  '';
-})
diff --git a/pkgs/tools/misc/lsd/default.nix b/pkgs/tools/misc/lsd/default.nix
index 54b3b443d0a..c0d1c278bfd 100644
--- a/pkgs/tools/misc/lsd/default.nix
+++ b/pkgs/tools/misc/lsd/default.nix
@@ -1,5 +1,4 @@
 { lib
-, nixosTests
 , fetchFromGitHub
 , rustPlatform
 , installShellFiles
@@ -26,7 +25,18 @@ rustPlatform.buildRustPackage rec {
   # Found argument '--test-threads' which wasn't expected, or isn't valid in this context
   doCheck = false;
 
-  passthru.tests = { inherit (nixosTests) lsd; };
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    testFile=$(mktemp /tmp/lsd-test.XXXX)
+    echo 'abc' > $testFile
+    $out/bin/lsd --classic --blocks "size,name" -l $testFile | grep "4 B $testFile"
+    $out/bin/lsd --version | grep "${version}"
+    rm $testFile
+
+    runHook postInstallCheck
+  '';
 
   meta = with lib; {
     homepage = "https://github.com/Peltoche/lsd";