From 9a29d2e4f1b4683d15072134b8bfc7504d1b6f42 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 28 Feb 2022 10:50:45 +0100 Subject: gkleen@sif: ... --- accounts/gkleen@sif/default.nix | 23 ++++++++--------------- accounts/gkleen@sif/xmonad/xmonad.hs | 1 + 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 231c42ee..118d11d5 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -47,24 +47,16 @@ let --prefix PATH : ${pkgs.pulseaudio}/bin ''; }; - wrappedChrome = pkgs.runCommand "${pkgs.google-chrome.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' + wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or pkgs.lib.strings.nameFromURL package.name "-", outBin ? bin }: pkgs.runCommand "${package.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' mkdir -p "$out/bin" - install -m 0755 ${pkgs.google-chrome}/bin/google-chrome-stable $out/bin/google-chrome - wrapProgram $out/bin/google-chrome \ - --add-flags '--force-device-scale-factor=1.6' - ''; - wrappedZulip = pkgs.runCommand "${pkgs.zulip.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' - mkdir -p "$out/bin" - install -m 0755 ${pkgs.zulip}/bin/zulip $out/bin/zulip - wrapProgram $out/bin/zulip \ - --add-flags '--force-device-scale-factor=1.6' - ''; - wrappedElementDesktop = pkgs.runCommand "${pkgs.element-desktop.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' - mkdir -p "$out/bin" - install -m 0755 ${pkgs.element-desktop}/bin/element-desktop $out/bin/element-desktop - wrapProgram $out/bin/element-desktop \ + makeWrapper ${package}/bin/${bin} $out/bin/${outBin} \ --add-flags '--force-device-scale-factor=1.6' ''; + + wrappedChrome = wrapElectron { package = pkgs.google-chrome; outBin = "google-chrome"; }; + wrappedZulip = wrapElectron { package = pkgs.zulip; bin = "zulip"; outBin = "zulip"; }; + wrappedElementDesktop = wrapElectron { package = pkgs.element-desktop; bin = "element-desktop"; outBin = "element"; }; + wrappedRocketChatDesktop = wrapElectron { package = pkgs.rocketchat-desktop; bin = "rocketchat-desktop"; outBin = "rocketchat"; }; in { imports = with flake.nixosModules.userProfiles.${userName}; [ mpv yt-dlp @@ -298,6 +290,7 @@ in { wrappedChrome nixos-shell virt-viewer freerdp gnome-icon-theme paper-icon-theme sshpassSecret weechat helvum wrappedElementDesktop matrix-synapse-tools.synadm + wrappedRocketChatDesktop ]; file = { diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs index 688cd238..dfcd3083 100644 --- a/accounts/gkleen@sif/xmonad/xmonad.hs +++ b/accounts/gkleen@sif/xmonad/xmonad.hs @@ -192,6 +192,7 @@ hostFromName h , assign "comm" $ (className =? "Emacs" <&&> title =? "Mail") , assign "comm" $ className =? "Zulip" , assign "comm" $ className =? "Element" + , assign "comm" $ className =? "Rocket.Chat" , assign "comm" $ className =? "Discord" , assign "media" $ (className =? "Alacritty" <&&> resource =? "media") , assign "monitor" $ className =? "Grafana" -- cgit v1.2.3