refactor(nix): Use nixpkgs' vesktop now that it supports darwin

This commit is contained in:
Ahmad Ansori Palembani 2024-11-07 09:03:35 +07:00
parent 94d596e386
commit b48174745d
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
7 changed files with 33 additions and 54 deletions

30
nix/flake.lock generated
View file

@ -3,11 +3,11 @@
"brew-api": { "brew-api": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1730811879, "lastModified": 1730943370,
"narHash": "sha256-AiFBI++t4OVlVB6lGlyF7cUHCgPmxh5qtDP19UgnUC4=", "narHash": "sha256-P/ecx9MCT2TBkrZlMufl9VrhyokGDi4HqFdSZI0aIlY=",
"owner": "null2264", "owner": "null2264",
"repo": "brew-api", "repo": "brew-api",
"rev": "332865573611b0936f939b0aff0867d2e65aee3c", "rev": "884398d0769bc4651bb16f8ff1b2cc5f0308ba2c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -59,11 +59,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730768115, "lastModified": 1730940937,
"narHash": "sha256-BbEg1w+y4+CrS5gFiR6YPGrXN0OvdyfOI8p1SgNnSzg=", "narHash": "sha256-1qtKUlQPBq9cQSAJCFv5+OaxTcP8Y8TAyBLS7/zO7Es=",
"owner": "bandithedoge", "owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin", "repo": "nixpkgs-firefox-darwin",
"rev": "4eb20be71869d6314ce7b383b63064140851d87a", "rev": "74c4cac1fc8c07f8e9dffcb9bf1ada240f243f82",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -227,11 +227,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1730806663, "lastModified": 1730940508,
"narHash": "sha256-yFmtgfZnzcoJy+z26+ilRq0oxZHCwifsUMjO6pa7hIc=", "narHash": "sha256-sXS72AYXN/V1Ehp82/46Rqjw5Q6ayCy28ku3980+LSM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a417c003326c9a0cdebb62157466603313ffd47e", "rev": "f39f1d2a8fe191e442ce641a6dc1320f6aa17d04",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -275,11 +275,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1730811841, "lastModified": 1730937175,
"narHash": "sha256-xMI+Ov/67jMDE+RK915iaJBqNrbTB7mI4Yux0y3J/Iw=", "narHash": "sha256-YDJ1R6NmTpGhLpXrlqp3p9H/ktr2BJD1GoG1WMagYRc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "e356541e9a30c987e72f994011770c385322ad67", "rev": "340b8c3ca8a5fcfe8a2230a5e76442b36f68e2ca",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -355,11 +355,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730780158, "lastModified": 1730866626,
"narHash": "sha256-ZJkCFn4PL49rINz7xrjlBqw9nF8wWJE7fSVqbHlCWSA=", "narHash": "sha256-0PzP+JdLcTExFXgR4h3exTZFHXANm4VZcEwgK2RtICk=",
"owner": "Gerg-L", "owner": "Gerg-L",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"rev": "2791c6662002731d3dfc00312307aef547e1c8be", "rev": "396cf13f9310aa82c1a5da24a5213e7170d40642",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -17,8 +17,11 @@ in {
pkgs.zoxide pkgs.zoxide
pkgs.ruby pkgs.ruby
pkgs._7zz pkgs._7zz
pkgs.enchive pkgs.enchive
(pkgs.pass.withExtensions (exts: [ exts.pass-otp ])) (pkgs.pass.withExtensions (exts: [ exts.pass-otp ]))
pkgs.gnupg pkgs.gnupg
pkgs.vesktop
]; ];
} }

View file

@ -3,6 +3,7 @@
let let
overlays = [ overlays = [
(import ../overlays/python.nix) (import ../overlays/python.nix)
(import ../overlays/vesktop.nix)
] ++ extraOverlays; ] ++ extraOverlays;
# Placed here so that we don't need to specify hash for fetchTarball # Placed here so that we don't need to specify hash for fetchTarball

View file

@ -1,35 +0,0 @@
# REF: https://github.com/bandithedoge/nixpkgs-firefox-darwin/blob/ceaca2359e5371ccef3f92a36baf7c438b354afb/overlay.nix
final: prev:
let
mkApp = import ../../lib/darwin/mkApp.nix;
appFileName = "Vesktop.app";
version = "1.5.3";
in {
vesktop = mkApp {
inherit (final) stdenv undmg _7zz;
pname = "Vesktop";
inherit appFileName version;
src = final.fetchurl {
url = "https://github.com/Vencord/Vesktop/releases/download/v${version}/Vesktop-${version}-universal.dmg";
hash = "sha256-ceOUNHSOaEqCbzkM64RtUu0Yhrq4tThcXZTDd+OsEXI";
};
# Replace the icon with a much more low profile icon
# REF: https://github.com/Vencord/Vesktop/pull/865
configurePhase = ''
cp -f ${../../../include/vesktop/icon.icns} ${appFileName}/Contents/Resources/icon.icns
'';
meta = with final.lib; {
description = "An alternate client for Discord with Vencord built-in";
homepage = "https://github.com/Vencord/Vesktop";
license = licenses.gpl3Only;
platforms = platforms.darwin;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
};
}

13
nix/overlays/vesktop.nix Normal file
View file

@ -0,0 +1,13 @@
final: prev:
{
# Replace the icon with a much more low profile icon
# REF: https://github.com/Vencord/Vesktop/pull/865
vesktop = prev.vesktop.overrideAttrs (old: {
preBuild =
old.preBuild
+ ''
cp -f ${../../include/vesktop/icon.icns} build/icon.icns
'';
});
}

View file

@ -55,7 +55,6 @@ in {
pkgs.casks.zotero pkgs.casks.zotero
# pkgs.casks.lulu # Doesn't work, it needs to be installed on /Applications/ # pkgs.casks.lulu # Doesn't work, it needs to be installed on /Applications/
# pkgs.heliport # FIXME: https://github.com/matthewbauer/undmg/issues/2 # pkgs.heliport # FIXME: https://github.com/matthewbauer/undmg/issues/2
pkgs.vesktop
pkgs.lf pkgs.lf
pkgs.yazi # lf replacement, need further testing pkgs.yazi # lf replacement, need further testing

View file

@ -24,7 +24,6 @@ in
inputs.firefox-darwin.overlay inputs.firefox-darwin.overlay
(mkBrew { inherit system brew-api; nixpkgs = nixpkgs-stable; }) (mkBrew { inherit system brew-api; nixpkgs = nixpkgs-stable; })
(import ../../overlays/darwin/heliport.nix) (import ../../overlays/darwin/heliport.nix)
(import ../../overlays/darwin/vesktop.nix)
]; ];
nur = nur; nur = nur;
} }
@ -53,7 +52,6 @@ in
extraOverlays = [ extraOverlays = [
inputs.firefox-darwin.overlay inputs.firefox-darwin.overlay
(mkBrew { inherit system brew-api; nixpkgs = nixpkgs-stable; }) (mkBrew { inherit system brew-api; nixpkgs = nixpkgs-stable; })
(import ../../overlays/darwin/vesktop.nix)
]; ];
nur = nur; nur = nur;
} }