From 17c1a38c90759ca843c5ad41d04826c63efd686d Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 2 Sep 2021 18:12:12 +0200 Subject: [PATCH] swaycwd: convert to buildNimPackage --- pkgs/tools/wayland/swaycwd/default.nix | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/pkgs/tools/wayland/swaycwd/default.nix b/pkgs/tools/wayland/swaycwd/default.nix index 36e223f8d4ca..401144f74d2a 100644 --- a/pkgs/tools/wayland/swaycwd/default.nix +++ b/pkgs/tools/wayland/swaycwd/default.nix @@ -1,8 +1,8 @@ -{ lib, nim, stdenv, fetchFromGitLab +{ lib, nimPackages, fetchFromGitLab , enableShells ? [ "bash" "zsh" "fish" "sh" "posh" ] }: -stdenv.mkDerivation { +nimPackages.buildNimPackage { name = "swaycwd"; version = "0.0.1"; @@ -13,27 +13,18 @@ stdenv.mkDerivation { hash = "sha256-MkyY3wWByQo0l0J28xKDfGtxfazVPRyZHCObl9Fszh4="; }; - configurePhase = '' - runHook preConfigure + preConfigure = '' { echo 'let enabledShells: seq[string] = @${builtins.toJSON enableShells}' echo 'export enabledShells' } > shells.nim - runHook postConfigure + cat << EOF > swaycwd.nimble + srcDir = "." + bin = "swaycwd" + EOF ''; - nativeBuildInputs = [ nim ]; - - buildPhase = '' - export HOME=$TMPDIR - nim c --opt:speed -d:release swaycwd.nim - ''; - - installPhase = '' - runHook preInstall - install -D -m555 -t $out/bin swaycwd - runHook postInstall - ''; + nimFlags = [ "--opt:speed" ]; meta = with lib; { homepage = "https://gitlab.com/cab404/swaycwd";