Skip to content

Commit

Permalink
packages/nix-cleanup: fix nixos-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Oct 11, 2023
1 parent ef53eed commit 6ef6c3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/nix-cleanup/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
, isNixOS ? false
}:

stdenvNoCC.mkDerivation {
stdenvNoCC.mkDerivation (finalAttrs: {
name =
if isNixOS
then "nixos-cleanup"
else "nix-cleanup";

src = substituteAll {
src = ./nix-cleanup.sh;
isNixOS = if isNixOS then "1" else "0";
is_nixos = if isNixOS then "1" else "0";
path = lib.makeBinPath [
coreutils
findutils
Expand All @@ -35,7 +35,7 @@ stdenvNoCC.mkDerivation {
installPhase = ''
runHook preInstall
install -Dm0755 $src $out/bin/nix-cleanup
install -Dm0755 $src $out/bin/${finalAttrs.name}
runHook postInstall
'';
Expand All @@ -49,4 +49,4 @@ stdenvNoCC.mkDerivation {
runHook postCheck
'';
}
})
2 changes: 1 addition & 1 deletion packages/nix-cleanup/nix-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

readonly NIXOS=@isNixOS@
readonly NIXOS=@is_nixos@
PATH=@path@
AUTO=0
OPTIMIZE=0
Expand Down

0 comments on commit 6ef6c3d

Please sign in to comment.