added anyrun config

This commit is contained in:
Charlie Root 2024-05-05 22:12:18 +02:00
commit 0022cf7d50
13 changed files with 242 additions and 122 deletions

View file

@ -55,7 +55,7 @@ in {
cd = "z";
v = "nvim";
e = "emacs";
update = "sudo nixos-rebuild switch --flake \"${gitPath}#${hostname}\" --log-format internal-json |& nom --json";
update = "sudo nixos-rebuild switch --flake \"${gitPath}#${hostname}\"";
flake = "cd '${gitPath}'";
} // cfg.extraAliases;
};

View file

@ -1,97 +0,0 @@
{ config, pkgs, lib, inputs, ... }:
with lib;
let
username = config.modules.other.system.username;
cfg = config.modules.programs.anyrun;
in {
options.modules.programs.anyrun.enable = mkEnableOption "anyrun";
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [ inputs.anyrun.homeManagerModules.default ];
programs.anyrun = {
enable = true;
config = {
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
dictionary
kidex
rink
symbols
translate
];
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = true;
closeOnClick = true;
showResultsImmediately = true;
maxEntries = 50;
width.fraction = 0.5;
y.absolute = 15;
};
extraCss = ''
@define-color bg-col rgba(30, 30, 46, 0.7);
@define-color bg-col-light rgba(150, 220, 235, 0.7);
@define-color border-col rgba(30, 30, 46, 0.7);
@define-color selected-col rgba(150, 205, 251, 0.7);
@define-color fg-col #D9E0EE;
@define-color fg-col2 #F28FAD;
* {
transition: 200ms ease;
font-family: "JetBrainsMono Nerd Font";
font-size: 1.0rem;
}
#window {
background: transparent;
}
#plugin,
#main {
border: 3px solid @border-col;
color: @fg-col;
background-color: @bg-col;
}
/* anyrun's input window - Text */
#entry {
color: @fg-col;
background-color: @bg-col;
}
/* anyrun's ouput matches entries - Base */
#match {
color: @fg-col;
background: @bg-col;
}
/* anyrun's selected entry - Red */
#match:selected {
color: @fg-col2;
background: @selected-col;
}
#match {
padding: 3px;
border-radius: 16px;
}
#entry, #plugin:hover {
border-radius: 16px;
}
box#main {
background: rgba(30, 30, 46, 0.7);
border: 1px solid @border-col;
border-radius: 15px;
padding: 5px;
}
'';
};
};
};
}

View file

@ -0,0 +1,48 @@
{ config, pkgs, lib, inputs, ... }:
with lib;
let
username = config.modules.other.system.username;
cfg = config.modules.programs.anyrun;
in {
options.modules.programs.anyrun.enable = mkEnableOption "anyrun";
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [ inputs.anyrun.homeManagerModules.default ];
programs.anyrun = {
enable = true;
config = {
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
dictionary
kidex
rink
shell
symbols
translate
];
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = true;
closeOnClick = true;
showResultsImmediately = true;
maxEntries = 50;
width.fraction = 0.3;
y.absolute = 15;
};
extraCss = builtins.readFile (./. + "/style.css");
extraConfigFiles."applications.ron".text = ''
Config(
desktop_actions: false,
max_entries: 5,
terminal: Some("kitty"),
)
'';
};
};
};
}

View file

@ -0,0 +1,3 @@
_: {
imports = [./anyrun.nix];
}

View file

@ -0,0 +1,69 @@
* {
all: unset;
font-size: 1.3rem;
font-family: "JetBrains Mono"
}
#window,
#match,
#entry,
#plugin,
#main {
background: transparent;
}
#match.activatable {
border-radius: 16px;
padding: 0.3rem 0.9rem;
margin-top: 0.01rem;
}
#match.activatable:first-child {
margin-top: 0.7rem;
}
#match.activatable:last-child {
margin-bottom: 0.6rem;
}
#plugin:hover #match.activatable {
border-radius: 10px;
padding: 0.3rem;
margin-top: 0.01rem;
margin-bottom: 0;
}
#match:selected,
#match:hover,
#plugin:hover {
background: rgba(255, 255, 255, 0.1);
}
#entry {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
margin: 0.5rem;
padding: 0.3rem 1rem;
}
list > #plugin {
border-radius: 16px;
margin: 0 0.3rem;
}
list > #plugin:first-child {
margin-top: 0.3rem;
}
list > #plugin:last-child {
margin-bottom: 0.3rem;
}
list > #plugin:hover {
padding: 0.6rem;
}
box#main {
background: rgba(0, 0, 0, 0.5);
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.1),
0 0 0 1px rgba(0, 0, 0, 0.5);
border-radius: 24px;
padding: 0.3rem;
}

View file

@ -7,7 +7,7 @@ _: {
./qt.nix
./zathura.nix
./stylix.nix
./anyrun.nix
./anyrun
./rofi.nix
./kitty.nix
./vivado.nix

View file

@ -0,0 +1,90 @@
{ config, lib, pkgs, ... }:
with lib; let
cfg = config.modules.programs.emacs;
envExtra = ''
export PATH="${config.xdg.configHome}/emacs/bin:$PATH"
'';
shellAliases = {
e = "emacsclient --create-frame"; # gui
et = "emacsclient --create-frame --tty"; # termimal
};
librime-dir = "${config.xdg.dataHome}/emacs/librime";
parinfer-rust-lib-dir = "${config.xdg.dataHome}/emacs/parinfer-rust";
myEmacsPackagesFor = emacs: ((pkgs.emacsPackagesFor emacs).emacsWithPackages (epkgs: [
epkgs.vterm
]));
in {
options.modules.editors.emacs = {
enable = mkEnableOption "Emacs Editor";
};
config = mkIf cfg.enable (mkMerge [
{
home.packages = with pkgs; [
## Doom dependencies
git
(ripgrep.override {withPCRE2 = true;})
gnutls # for TLS connectivity
## Optional dependencies
fd # faster projectile indexing
imagemagick # for image-dired
fd # faster projectile indexing
zstd # for undo-fu-session/undo-tree compression
# go-mode
# gocode # project archived, use gopls instead
## Module dependencies
# :checkers spell
(aspellWithDicts (ds: with ds; [en en-computers en-science]))
# :tools editorconfig
editorconfig-core-c # per-project style config
# :tools lookup & :lang org +roam
sqlite
# :lang latex & :lang org (latex previews)
# texlive.combined.scheme-medium
];
programs.bash.bashrcExtra = envExtra;
programs.zsh.envExtra = envExtra;
home.shellAliases = shellAliases;
programs.nushell.shellAliases = shellAliases;
xdg.configFile."doom" = {
source = ./doom;
force = true;
};
home.activation.installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] ''
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${doomemacs}/ ${config.xdg.configHome}/emacs/
# librime for emacs-rime
mkdir -p ${librime-dir}
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${pkgs.librime}/ ${librime-dir}/
# libparinfer_rust for emacs' parinfer-rust-mode
mkdir -p ${parinfer-rust-lib-dir}
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${pkgs.vimPlugins.parinfer-rust}/lib/libparinfer_rust.* ${parinfer-rust-lib-dir}/parinfer-rust.so
'';
}
let
# Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode.
# pgtk (pure gtk) build add native support for wayland.
# https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases
emacsPkg = myEmacsPackagesFor pkgs.emacs29-pgtk;
in {
home.packages = [emacsPkg];
services.emacs = {
enable = true;
package = emacsPkg;
client = {
enable = true;
arguments = [" --create-frame"];
};
startWithUserSession = true;
};
}
]);
}

View file

@ -46,18 +46,13 @@ in {
popups = 14;
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
sansSerif = config.stylix.fonts.monospace;
serif = config.stylix.fonts.monospace;
emoji = config.stylix.fonts.monospace;
monospace = {
package = (pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];});
name = "JetBrainsMono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
};

View file

@ -12,21 +12,16 @@ let
terminal = "kitty.desktop";
in {
# xdg.portal = {
# enable = true;
# extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# config.common.default = "gtk";
# };
environment.sessionVariables = {
TERMINAL = "${terminal}";
};
home-manager.users.${username} = {
xdg = {
# cacheHome = "${hmCfg.home.homeDirectory}/.cache";
# configHome = "${hmCfg.home.homeDirectory}/.config";
# dataHome = "${hmCfg.home.homeDirectory}/.local/share";
# stateHome = "${hmCfg.home.homeDirectory}/.local/state";
cacheHome = "${hmCfg.home.homeDirectory}/.cache";
configHome = "${hmCfg.home.homeDirectory}/.config";
dataHome = "${hmCfg.home.homeDirectory}/.local/share";
stateHome = "${hmCfg.home.homeDirectory}/.local/state";
mimeApps = {
enable = true;
defaultApplications = {

View file

@ -8,10 +8,7 @@ in {
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
security.rtkit.enable = true;
};