From 12ae7b6497446d2d57c0ab012013aff99645477a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Fri, 22 Nov 2024 15:17:52 +0100 Subject: [PATCH] :sparkles: Added a `vkquake` overriding `pkgs.vkquake` --- flake.lock | 37 +++++++++++++------------- modules/home/games/vkquake/default.nix | 2 +- packages/vkquake/default.nix | 34 +++++++++++++++++++++++ 3 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 packages/vkquake/default.nix diff --git a/flake.lock b/flake.lock index 6a87beb..1ca1e71 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1708890466, - "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "665b3c6748534eb766c777298721cece9453fdae", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", "type": "github" }, "original": { @@ -339,11 +339,11 @@ "fromYaml": { "flake": false, "locked": { - "lastModified": 1689549921, - "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", "owner": "SenchoPens", "repo": "fromYaml", - "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", "type": "github" }, "original": { @@ -418,11 +418,11 @@ ] }, "locked": { - "lastModified": 1724435763, - "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "lastModified": 1730837930, + "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", "owner": "nix-community", "repo": "home-manager", - "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", "type": "github" }, "original": { @@ -777,11 +777,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1725194671, - "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "lastModified": 1731531548, + "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "rev": "24f0d4acd634792badd6470134c387a3b039dace", "type": "github" }, "original": { @@ -979,11 +979,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1729963473, - "narHash": "sha256-uGjTjvvlGQfQ0yypVP+at0NizI2nrb6kz4wGAqzRGbY=", + "lastModified": 1732261424, + "narHash": "sha256-8uTKUHkaU980J5kRnLYrdwmjZYB88eBGUk1oVgIUHFE=", "owner": "danth", "repo": "stylix", - "rev": "04afcfc0684d9bbb24bb1dc77afda7c1843ec93b", + "rev": "b667a340730dd3d0596083aa7c949eef01367c62", "type": "github" }, "original": { @@ -1069,16 +1069,17 @@ "tinted-foot": { "flake": false, "locked": { - "lastModified": 1696725948, - "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", "owner": "tinted-theming", "repo": "tinted-foot", - "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", "type": "github" } }, diff --git a/modules/home/games/vkquake/default.nix b/modules/home/games/vkquake/default.nix index 776a88e..c0ecec3 100644 --- a/modules/home/games/vkquake/default.nix +++ b/modules/home/games/vkquake/default.nix @@ -16,5 +16,5 @@ in enable = mkBoolOpt false "Enable vkquake."; }; - config = mkIf cfg.enable { home.packages = with pkgs; [ vkquake ]; }; + config = mkIf cfg.enable { home.packages = [ pkgs.${namespace}.vkquake ]; }; } diff --git a/packages/vkquake/default.nix b/packages/vkquake/default.nix new file mode 100644 index 0000000..907ee6e --- /dev/null +++ b/packages/vkquake/default.nix @@ -0,0 +1,34 @@ +{ + vkquake, + makeDesktopItem, + copyDesktopItems, + ... +}: +vkquake.overrideAttrs ( + _final: prev: { + nativeBuildInputs = prev.nativeBuildInputs ++ [ copyDesktopItems ]; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/bin" + cp vkquake "$out/bin" + + mkdir -p $out/share/icons/hicolor/256x256/apps + cp ../Misc/vkQuake_256.png $out/share/icons/hicolor/256x256/apps/vkquake.png + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + exec = prev.meta.mainProgram; + name = "vkquake"; + icon = "vkquake"; + comment = prev.meta.description; + desktopName = "vkQuake"; + categories = [ "Game" ]; + }) + ]; + } +)