Skip to content

Commit

Permalink
Merge pull request #2 from mardukpill/app
Browse files Browse the repository at this point in the history
flake: create .desktop entry for razer-settings
  • Loading branch information
mardukpill authored Sep 4, 2024
2 parents 609b0b1 + 31a1097 commit 897247b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,30 @@
substituteInPlace src/device.rs --replace '/usr/share/razercontrol/laptops.json' '${./razer_control_gui/data/devices/laptops.json}'
'';

postBuild =
let
app = "razer-settings";
path = "$out/share/applications/${app}.desktop";
in
''
# Install .desktop file
mkdir -p $out/share/applications
cat > ${path} <<EOF
[Desktop Entry]
Name=Razer Settings
Exec=$out/bin/${app}
Type=Application
Categories=Utility;
EOF
chmod +x ${path}
'';

postInstall = ''
mkdir -p $out/lib/udev/rules.d
mkdir -p $out/libexec
mv $out/bin/daemon $out/libexec
cp ${./razer_control_gui/data/udev/99-hidraw-permissions.rules} $out/lib/udev/rules.d/99-hidraw-permissions.rules
'';

cargoLock = {
Expand Down

0 comments on commit 897247b

Please sign in to comment.