Files
nixpkgs/pkgs/by-name/wi/wifi-qr/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

101 lines
1.9 KiB
Nix

{
lib,
fetchFromGitHub,
installShellFiles,
makeWrapper,
zenity,
ncurses,
networkmanager,
patsh,
procps,
qrencode,
stdenvNoCC,
xdg-utils,
zbar,
coreutils,
gnused,
gnugrep,
file,
}:
stdenvNoCC.mkDerivation (finalAttr: {
pname = "wifi-qr";
version = "0.4";
outputs = [
"out"
"man"
];
src = fetchFromGitHub {
owner = "kokoye2007";
repo = "wifi-qr";
tag = "v${finalAttr.version}";
hash = "sha256-tE+9bFDgiFS1Jj+AAwTMKjMh5wS5/gkRSQaCBR/riYQ=";
};
buildInputs = [
zenity
ncurses
networkmanager
procps
qrencode
xdg-utils
zbar
# needed for cross
# TODO: somehow splice the packages in stdenvNoCC.initialPath and use that
coreutils
gnugrep
gnused
file
];
nativeBuildInputs = [
installShellFiles
makeWrapper
patsh
];
dontBuild = true;
dontConfigure = true;
postPatch = ''
substituteInPlace wifi-qr.desktop \
--replace-fail "Icon=wifi-qr.svg" "Icon=wifi-qr"
substituteInPlace wifi-qr \
--replace-fail "/usr/share/doc/wifi-qr/copyright" "$out/share/doc/wifi-qr/copyright"
'';
installPhase = ''
runHook preInstall
install -Dm755 wifi-qr $out/bin/wifi-qr
install -Dm644 wifi-qr.desktop $out/share/applications/wifi-qr.desktop
install -Dm644 wifi-qr.svg $out/share/icons/hicolor/scalable/apps/wifi-qr.svg
install -Dm644 LICENSE $out/share/doc/wifi-qr/copyright
installManPage wifi-qr.1
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
patchShebangs $out/bin/wifi-qr
patsh -f $out/bin/wifi-qr -s ${builtins.storeDir} --path "$HOST_PATH"
runHook postFixup
'';
meta = {
description = "WiFi password sharing via QR codes";
homepage = "https://github.com/kokoye2007/wifi-qr";
license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [ ambroisie ];
mainProgram = "wifi-qr";
platforms = lib.platforms.linux;
};
})