From 880a346b4b647351531e0ca9bb508c52f0b094f1 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 28 Aug 2024 23:54:48 -0500 Subject: [PATCH] flake.lock: update --- flake.lock | 56 ++++----- flake.nix | 1 + .../terminal/tools/fastfetch/default.nix | 7 +- modules/home/suites/business/default.nix | 4 +- packages/teams-for-linux/default.nix | 113 ++++++++++++++++++ 5 files changed, 146 insertions(+), 35 deletions(-) create mode 100644 packages/teams-for-linux/default.nix diff --git a/flake.lock b/flake.lock index aedc35f4c..b9f56e688 100644 --- a/flake.lock +++ b/flake.lock @@ -49,11 +49,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1724697376, - "narHash": "sha256-H1bMY9e8HnHGiquUSAKz7rNWSTPgYeZ2m7tB/0RFAh4=", + "lastModified": 1724850097, + "narHash": "sha256-3BHxvFb3NJzch1X8puRMkVZujOoarQ1llu3ZcwuvsKU=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "abb3c81c59f64e37d7abbe4bc874302507042a7b", + "rev": "23c7925dd31e79e8c06086ace3edb129a070ac01", "type": "github" }, "original": { @@ -879,11 +879,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1722631742, - "narHash": "sha256-HJWmbQo/vseT2vb3yQsbrN/gnlKj21HWRqlZrJp44Os=", + "lastModified": 1724785279, + "narHash": "sha256-XEb6gkcIcCsPMJegkNNvlwvEmklXoIU8vBhYgodlkrs=", "owner": "hyprwm", "repo": "Hypridle", - "rev": "96d51ec2a749a928cb9d48b1fc0ea4898e73a335", + "rev": "a46cd0bb0592d3fa40de8fdd9ee94de2bceffbef", "type": "github" }, "original": { @@ -916,11 +916,11 @@ ] }, "locked": { - "lastModified": 1724696697, - "narHash": "sha256-wZXL/5Vpmrjn9+0S0TGxvxd57mniD8Ou4vfksBiwgYg=", + "lastModified": 1724874889, + "narHash": "sha256-Zb+IQjUMSE+6LPMg9HuxVvHHJsamU5VB13tD7XmBugY=", "ref": "refs/heads/main", - "rev": "09dbcabcc71f412dcaf86dbed7b67d58a273fa50", - "revCount": 5144, + "rev": "b9b8e6220f55af34e862b541a5a4b30ae6d8f15f", + "revCount": 5155, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -1299,11 +1299,11 @@ "systems": "systems_10" }, "locked": { - "lastModified": 1722869141, - "narHash": "sha256-0KU4qhyMp441qfwbirNg3+wbm489KnEjXOz2I/RbeFs=", + "lastModified": 1724863980, + "narHash": "sha256-7Ke9wFRYPUIXwm5ZndGHkWBKj6BsFTkSEXUNXQRHE54=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "0252fd13e78e60fb0da512a212e56007515a49f7", + "rev": "aadf9a27dddd2272ca354ba5a22a0c2d1f919039", "type": "github" }, "original": { @@ -1425,11 +1425,11 @@ ] }, "locked": { - "lastModified": 1724697520, - "narHash": "sha256-Li7R0pE2wZgS4aEVF3puxGIYDBNLllyx8tnGBUW53J8=", + "lastModified": 1724877652, + "narHash": "sha256-UCGdfoaaC7abDMzBdZTxUEFCuAzGYNODpvXS8ZmB8Zc=", "owner": "khaneliman", "repo": "khanelivim", - "rev": "f77a4bae597efc7c907021bb83b545bba1a61af7", + "rev": "aa6d4d75d9f85d940801c721c4524cfaddddfcc5", "type": "github" }, "original": { @@ -1713,11 +1713,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1724479785, - "narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=", + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", "type": "github" }, "original": { @@ -1790,11 +1790,11 @@ }, "nur": { "locked": { - "lastModified": 1724697237, - "narHash": "sha256-Ta3oGez+0G1a9XLopW81VsQRLZc7oyQ65dGk7GQYYrU=", + "lastModified": 1724904356, + "narHash": "sha256-uKaTCmGg0o3UJPeJfBBfcjnLYu7H2vSeGGUXAp673xs=", "owner": "nix-community", "repo": "NUR", - "rev": "7956bf38e8524b6760dece1677ccc602a5c79edf", + "rev": "254e567d713131a413195a2d331c8e2b4831c044", "type": "github" }, "original": { @@ -1865,11 +1865,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1724440431, - "narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=", + "lastModified": 1724857454, + "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "c8a54057aae480c56e28ef3e14e4960628ac495b", + "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6", "type": "github" }, "original": { @@ -2079,11 +2079,11 @@ ] }, "locked": { - "lastModified": 1724645793, - "narHash": "sha256-z0QdJ8N24msqy6uakRNHpCsrNsswTA9/Evsd3+DOAZc=", + "lastModified": 1724904972, + "narHash": "sha256-UuMf0oHOZqiU81WNSnk30XJ5sKYvvSiChvotptI1Zm0=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "2e3b9ea2f89113d71ab57127ca7226253afd2660", + "rev": "6c7bd8132eb69880b7ec8935b6f55dbca1e69424", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 44e32c5eb..a909aa27a 100644 --- a/flake.nix +++ b/flake.nix @@ -229,6 +229,7 @@ permittedInsecurePackages = [ "freeimage-unstable-2021-11-01" "jitsi-meet-1.0.8043" + "electron-29.4.6" ]; }; diff --git a/modules/home/programs/terminal/tools/fastfetch/default.nix b/modules/home/programs/terminal/tools/fastfetch/default.nix index 1c19716c3..541c9372e 100644 --- a/modules/home/programs/terminal/tools/fastfetch/default.nix +++ b/modules/home/programs/terminal/tools/fastfetch/default.nix @@ -20,12 +20,7 @@ in programs.fastfetch = { enable = true; - package = - # NOTE: Getting missing X11 header during compilation for some reason on darwin all of a sudden. - if pkgs.stdenv.isDarwin then - pkgs.fastfetch.override { imagemagick_light = pkgs.imagemagick; } - else - pkgs.fastfetch; + package = pkgs.fastfetch; settings = { "$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"; diff --git a/modules/home/suites/business/default.nix b/modules/home/suites/business/default.nix index 4d84530d4..71008bd06 100644 --- a/modules/home/suites/business/default.nix +++ b/modules/home/suites/business/default.nix @@ -30,7 +30,9 @@ in ] ++ lib.optionals stdenv.isLinux [ libreoffice - teams-for-linux + # TODO: replace once https://github.com/NixOS/nixpkgs/pull/337868 is available + # teams-for-linux + pkgs.khanelinix.teams-for-linux ] ++ lib.optionals stdenv.isDarwin [ teams ]; diff --git a/packages/teams-for-linux/default.nix b/packages/teams-for-linux/default.nix new file mode 100644 index 000000000..a7b895a7a --- /dev/null +++ b/packages/teams-for-linux/default.nix @@ -0,0 +1,113 @@ +{ + lib, + stdenv, + buildNpmPackage, + fetchFromGitHub, + alsa-utils, + copyDesktopItems, + electron_30, + makeDesktopItem, + makeWrapper, + which, +}: + +let + electronDist = "${electron_30}/${if stdenv.isDarwin then "Applications" else "libexec/electron"}"; +in +buildNpmPackage rec { + pname = "teams-for-linux"; + version = "1.9.5"; + + src = fetchFromGitHub { + owner = "IsmaelMartinez"; + repo = "teams-for-linux"; + rev = "refs/tags/v${version}"; + hash = "sha256-+rEGDg+/qvjCMhGHccb4p+CKOo/65RpkFT/WnCDlCgU="; + }; + + npmDepsHash = "sha256-vDRFFxkIQo5qU9gmkSwUhPz4FG2XbUNkTw6SCuvMqCc="; + + nativeBuildInputs = [ + makeWrapper + ] ++ lib.optionals stdenv.isLinux [ copyDesktopItems ]; + + env = { + # disable code signing on Darwin + CSC_IDENTITY_AUTO_DISCOVERY = "false"; + ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; + }; + + buildPhase = '' + runHook preBuild + + cp -r ${electronDist} electron-dist + chmod -R u+w electron-dist + + npm exec electron-builder -- \ + --dir \ + -c.npmRebuild=true \ + -c.asarUnpack="**/*.node" \ + -c.electronDist=electron-dist \ + -c.electronVersion=${electron_30.version} + + runHook postBuild + ''; + + installPhase = + '' + runHook preInstall + + '' + + lib.optionalString stdenv.isLinux '' + mkdir -p $out/share/{applications,teams-for-linux} + cp dist/*-unpacked/resources/app.asar $out/share/teams-for-linux/ + + pushd build/icons + for image in *png; do + mkdir -p $out/share/icons/hicolor/''${image%.png}/apps + cp -r $image $out/share/icons/hicolor/''${image%.png}/apps/teams-for-linux.png + done + popd + + # Linux needs 'aplay' for notification sounds + makeWrapper '${lib.getExe electron_30}' "$out/bin/teams-for-linux" \ + --prefix PATH : ${ + lib.makeBinPath [ + alsa-utils + which + ] + } \ + --add-flags "$out/share/teams-for-linux/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" + '' + + lib.optionalString stdenv.isDarwin '' + mkdir -p $out/Applications + cp -r dist/mac*/teams-for-linux.app $out/Applications + makeWrapper $out/Applications/teams-for-linux.app/Contents/MacOS/teams-for-linux $out/bin/teams-for-linux + '' + + '' + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + name = "teams-for-linux"; + exec = "teams-for-linux"; + icon = "teams-for-linux"; + desktopName = "Microsoft Teams for Linux"; + comment = meta.description; + categories = [ + "Network" + "InstantMessaging" + "Chat" + ]; + }) + ]; + + meta = { + description = "Unofficial Microsoft Teams client for Linux"; + mainProgram = "teams-for-linux"; + platforms = with lib.platforms; darwin ++ linux; + }; +}