feat: update anyrun & use gtk4 css, revert nvidia to prod driver (#220)

fix: nvidia: revert to prod driver to fix GTK4 apps hang on close
This commit is contained in:
Ryan Yin
2025-09-11 10:41:09 +08:00
committed by GitHub
parent 07d6a5e102
commit e902a9bdb1
7 changed files with 153 additions and 119 deletions

View File

@@ -8,6 +8,19 @@ let
anyrunPackages = anyrun.packages.${pkgs.system};
in
{
imports = [
(
{ modulesPath, ... }:
{
# Important! We disable home-manager's module to avoid option
# definition collisions
disabledModules = [ "${modulesPath}/programs/anyrun.nix" ];
}
)
anyrun.homeManagerModules.default
];
programs.anyrun = {
enable = true;
# The package should come from the same flake as all the plugins to avoid breakage.
@@ -42,118 +55,12 @@ in
];
};
extraConfigFiles."applications.ron".text = ''
Config(
// Also show the Desktop Actions defined in the desktop files, e.g. "New Window" from LibreWolf
desktop_actions: true,
max_entries: 5,
// The terminal used for running terminal based desktop entries, if left as `None` a static list of terminals is used
// to determine what terminal to use.
terminal: Some(Terminal(
// The main terminal command
command: "alacritty",
// What arguments should be passed to the terminal process to run the command correctly
// {} is replaced with the command in the desktop entry
args: "-e {}",
)),
)
'';
extraConfigFiles."symbols.ron".text = ''
Config(
// The prefix that the search needs to begin with to yield symbol results
prefix: "",
// Custom user defined symbols to be included along the unicode symbols
symbols: {
// "name": "text to be copied"
"shrug": "¯\\_()_/¯",
},
max_entries: 3,
)
'';
# https://github.com/anyrun-org/anyrun/discussions/179
extraCss = ''
/* GTK Vars */
@define-color bg-color #313244;
@define-color fg-color #cdd6f4;
@define-color primary-color #89b4fa;
@define-color secondary-color #cba6f7;
@define-color border-color @primary-color;
@define-color selected-bg-color @primary-color;
@define-color selected-fg-color @bg-color;
* {
all: unset;
font-family: JetBrainsMono Nerd Font;
}
#window {
background: transparent;
}
box#main {
border-radius: 16px;
background-color: alpha(@bg-color, 0.8);
border: 0.5px solid alpha(@fg-color, 0.25);
}
entry#entry {
font-size: 1.25rem;
background: transparent;
box-shadow: none;
border: none;
border-radius: 16px;
padding: 16px 24px;
min-height: 40px;
caret-color: @primary-color;
}
list#main {
background-color: transparent;
}
#plugin {
background-color: transparent;
padding-bottom: 4px;
}
#match {
font-size: 1.1rem;
padding: 2px 4px;
}
#match:selected,
#match:hover {
background-color: @selected-bg-color;
color: @selected-fg-color;
}
#match:selected label#info,
#match:hover label#info {
color: @selected-fg-color;
}
#match:selected label#match-desc,
#match:hover label#match-desc {
color: alpha(@selected-fg-color, 0.9);
}
#match label#info {
color: transparent;
color: @fg-color;
}
label#match-desc {
font-size: 1rem;
color: @fg-color;
}
label#plugin {
font-size: 16px;
}
'';
extraConfigFiles = {
"symbols.ron".source = ./conf/anyrun/symbols.ron;
"applications.ron".source = ./conf/anyrun/applications.ron;
};
};
# https://github.com/anyrun-org/anyrun/discussions/179
xdg.configFile."anyrun/style.css".source = ./conf/anyrun/style.css;
}