summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/Fluffy/default.nix
blob: b32c6cab4a83442f25cd03d283a946b31e5f8a9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, pkgs, python3Packages, ... }:

with python3Packages; buildPythonApplication rec {
  name = "Fluffy-${version}";
  format = "other";
  version = "2.9";

  src = pkgs.fetchFromGitHub {
    owner = "fourminute";
    repo = "Fluffy";
    rev = "v${version}";
    sha256 = "1w1j7cdp0zpgwn7zi28z8dcbgnhxvllgh3rp1gkdjnpr4a6ngj8z";
  };

  prePatch = ''
    sed -e "s|/tmp|$HOME/.config/fluffy|" -i linux/fluffy.desktop
  '';

  installPhase = ''
    env
    install -Dm 644 linux/80-fluffy-switch.rules "$out/etc/udev/rules.d/80-fluffy-switch.rules"
    install -Dm 644 linux/fluffy.desktop "$out/usr/share/applications/fluffy.desktop"
    install -Dm 644 icons/16x16/fluffy.png "$out/share/icons/hicolor/16x16/apps/fluffy.png"
    install -Dm 644 icons/24x24/fluffy.png "$out/share/icons/hicolor/24x24/apps/fluffy.png"
    install -Dm 644 icons/32x32/fluffy.png "$out/share/icons/hicolor/32x32/apps/fluffy.png"
    install -Dm 644 icons/48x48/fluffy.png "$out/share/icons/hicolor/48x48/apps/fluffy.png"
    install -Dm 644 icons/64x64/fluffy.png "$out/share/icons/hicolor/64x64/apps/fluffy.png"
    install -Dm 644 icons/128x128/fluffy.png "$out/share/icons/hicolor/128x128/apps/fluffy.png"
    install -Dm 755 fluffy.pyw "$out/bin/fluffy"
    wrapProgram  "$out/bin/fluffy" --set PYTHONPATH "$PYTHONPATH"
  '';

  propagatedBuildInputs = [
    pyqt5 pyusb  libusb1 configparser tkinter
  ];

  meta = {
    homepage = https://github.com/fourminute/Fluffy;
    description = "A feature-rich tool for installing NSPs";
    license = lib.licenses.gpl3;
  };
}