diff --git a/flake.nix b/flake.nix index c3bd57d..5a2cc89 100644 --- a/flake.nix +++ b/flake.nix @@ -33,24 +33,6 @@ wayland ]; - commonArgs = { - # all that's needed for artifacts and checks - nativeBuildInputs = with pkgs; [ - # pkg-config - ]; - buildInputs = with pkgs; [ - ]; - - strictDeps = true; - __structuredAttrs = true; - - src = lib.sourceFilesBySuffices ./. [ - "Cargo.toml" - "Cargo.lock" - ".rs" - ]; - }; - crate = let desktopItem = pkgs.makeDesktopItem { @@ -59,30 +41,35 @@ exec = name; }; in - pkgs.rustPlatform.buildRustPackage ( - commonArgs - // { - inherit name; - cargoLock.lockFile = "${commonArgs.src}/Cargo.lock"; + pkgs.rustPlatform.buildRustPackage rec { + inherit name; - nativeBuildInputs = commonArgs.nativeBuildInputs ++ [ - pkgs.autoPatchelfHook - ]; + src = lib.sourceFilesBySuffices ./. [ + "Cargo.toml" + "Cargo.lock" + ".rs" + ]; + cargoLock.lockFile = "${src}/Cargo.lock"; - buildInputs = commonArgs.buildInputs ++ [ - pkgs.libgcc - ]; + nativeBuildInputs = with pkgs; [ + autoPatchelfHook + ]; + buildInputs = with pkgs; [ + libgcc + ]; - runtimeDependencies = dlDeps; + runtimeDependencies = dlDeps; - doCheck = false; + postFixup = '' + mkdir -p "$out/share/applications" + ln -s "${desktopItem}"/share/applications/* "$out/share/applications/" + ''; - postFixup = '' - mkdir -p "$out/share/applications" - ln -s "${desktopItem}"/share/applications/* "$out/share/applications/" - ''; - } - ); + doCheck = false; + + strictDeps = true; + __structuredAttrs = true; + }; in { packages.default = crate;