add rstudio; add lib function: addFlags

This commit is contained in:
EdenQwQ 2025-03-09 21:24:54 +08:00
parent 7a4adf172d
commit 7ec03b1d88
6 changed files with 31 additions and 39 deletions

13
home/lib/addFlags.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
config.lib.misc.addFlags =
flags: name: pkg:
pkgs.symlinkJoin {
name = "${name}-wrapped";
paths = [ "${pkg}" ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${name} --add-flags "${flags}"
'';
};
}

View file

@ -4,6 +4,6 @@
./wallpaper ./wallpaper
./monitors.nix ./monitors.nix
./swhkd.nix ./swhkd.nix
./fixChromeIME.nix ./addFlags.nix
]; ];
} }

View file

@ -1,13 +0,0 @@
{ pkgs, ... }:
{
config.lib.misc.fixChromeIME =
package:
pkgs.symlinkJoin {
name = "${package}-wrapped";
paths = [ pkgs.${package} ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${package} --add-flags "--wayland-text-input-version=3"
'';
};
}

View file

@ -4,7 +4,10 @@ let
in in
{ {
home.packages = [ home.packages = [
(import ../../../pkgs/rstudio.nix pkgs) (
import ../../../pkgs/rstudio.nix pkgs
|> config.lib.misc.addFlags "--enable-features=UseOzonePlatform --ozone-platform=wayland --use-gl=angle --wayland-text-input-version=3" "rstudio"
)
]; ];
xdg.configFile."rstudio/themes/stylix.rstheme".text = with colors; '' xdg.configFile."rstudio/themes/stylix.rstheme".text = with colors; ''
/* rsthemes 0.5.0 */ /* rsthemes 0.5.0 */

View file

@ -41,7 +41,7 @@
nurl nurl
wl-color-picker wl-color-picker
matugen matugen
(config.lib.misc.fixChromeIME "cherry-studio") (config.lib.misc.addFlags "--wayland-text-input-version=3" "cherry-studio" cherry-studio)
]; ];
imports = [ imports = [
./eye-candy.nix ./eye-candy.nix

View file

@ -1,25 +1,14 @@
pkgs: pkgs:
let pkgs.rstudioWrapper.override {
myRstudio = pkgs.rstudioWrapper.override { packages = with pkgs.rPackages; [
packages = with pkgs.rPackages; [ ggplot2
ggplot2 dplyr
dplyr tidyverse
tidyverse bruceR
bruceR afex
afex ggpubr
ggpubr reshape2
reshape2 rmdformats
rmdformats see
see ];
];
};
in
pkgs.symlinkJoin {
name = "rstudio-wrapped";
paths = [ myRstudio ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/rstudio --add-flags \
"--enable-features=UseOzonePlatform --ozone-platform=wayland --use-gl=angle"
'';
} }