From 55c4f44c2c8dee0cc9ca1b9fc2690526b2970bce Mon Sep 17 00:00:00 2001 From: Franek Date: Thu, 17 Apr 2025 19:55:49 +0200 Subject: [PATCH] remove clutter --- element-web | 1 - flake.nix | 23 ++++++++--------------- nix/schildichat-desktop.nix | 7 +++---- 3 files changed, 11 insertions(+), 20 deletions(-) delete mode 160000 element-web diff --git a/element-web b/element-web deleted file mode 160000 index 904c637..0000000 --- a/element-web +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 904c6378682d314fe91bf536b6207c6d5e320459 diff --git a/flake.nix b/flake.nix index 6999342..961ccab 100644 --- a/flake.nix +++ b/flake.nix @@ -7,31 +7,24 @@ systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); in { - packages = forAllSystems(system: { + packages = forAllSystems(system: let pkgs = nixpkgs.legacyPackages.${system}; cleanSource = src: with pkgs.lib; cleanSourceWith { filter = name: type: cleanSourceFilter name type - && !(hasInfix "/node_modules/" name) - && !(hasInfix "/nix/" name && hasSuffix ".nix" name); + && !(hasInfix "/node_modules/" name) + && !(hasInfix "/nix/" name && hasSuffix ".nix" name); - inherit src; - }; - - schildichat-web = import ./nix/schildichat-web.nix { - inherit (pkgs.darwin.apple_sdk.frameworks) Security AppKit CoreServices; - inherit pkgs cleanSource; - }; - - schildichat-desktop = import ./nix/schildichat-desktop.nix { - inherit (pkgs.darwin.apple_sdk.frameworks) Security AppKit CoreServices; - inherit pkgs cleanSource; + inherit src; }; + in { + schildichat-web = import ./nix/schildichat-web.nix { inherit pkgs cleanSource; }; + schildichat-desktop = import ./nix/schildichat-desktop.nix { inherit pkgs cleanSource; }; schildichat-desktop-wayland = self.packages.${system}.schildichat-desktop { useWayland = true; }; - default = self.packages.${system}.schildichat-desktop + default = self.packages.${system}.schildichat-desktop; }); }; } diff --git a/nix/schildichat-desktop.nix b/nix/schildichat-desktop.nix index ae87d62..802ce23 100644 --- a/nix/schildichat-desktop.nix +++ b/nix/schildichat-desktop.nix @@ -5,7 +5,6 @@ }: let - inherit (pkgs.nodePackages) mkYarnPackage; inherit (pkgs.darwin.apple_sdk.frameworks) Security AppKit CoreServices; schildichat-web = pkgs.callPackage ./schildichat-web.nix { inherit pkgs cleanSource; }; @@ -14,11 +13,11 @@ let yarnLock = schildichat-desktop-src + "/element-desktop/yarn.lock"; version = builtins.fromJSON (builtins.readFile packageJSON).version; - electron_exec = if stdenv.isDarwin then + electron_exec = if pkgs.stdenv.isDarwin then "${pkgs.electron}/Applications/Electron.app/Contents/MacOS/Electron" else "${pkgs.electron}/bin/electron"; -in mkYarnPackage { +in pkgs.mkYarnPackage { pname = "schildichat-desktop"; src = cleanSource (schildichat-desktop-src + "/element-desktop"); @@ -65,6 +64,6 @@ in mkYarnPackage { done makeWrapper '${electron_exec}' "$out/bin/schildichat-desktop" \ - --add-flags "$out/share/element/electron${lib.optionalString useWayland " --enable-features=UseOzonePlatform --ozone-platform=wayland"}" + --add-flags "$out/share/element/electron${pkgs.lib.optionalString useWayland " --enable-features=UseOzonePlatform --ozone-platform=wayland"}" ''; }