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
./monitors.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
{
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; ''
/* rsthemes 0.5.0 */

View file

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

View file

@ -1,25 +1,14 @@
pkgs:
let
myRstudio = pkgs.rstudioWrapper.override {
packages = with pkgs.rPackages; [
ggplot2
dplyr
tidyverse
bruceR
afex
ggpubr
reshape2
rmdformats
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"
'';
pkgs.rstudioWrapper.override {
packages = with pkgs.rPackages; [
ggplot2
dplyr
tidyverse
bruceR
afex
ggpubr
reshape2
rmdformats
see
];
}