mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
nix:use variables
This commit is contained in:
parent
cf221c7c4b
commit
dfcbd50294
14 changed files with 121 additions and 10 deletions
|
|
@ -202,6 +202,7 @@ const mapLists = {
|
||||||
"<Alt-h>": "E",
|
"<Alt-h>": "E",
|
||||||
"<Alt-l>": "R",
|
"<Alt-l>": "R",
|
||||||
gi: "i", // Use `gl` to search and focus on input box
|
gi: "i", // Use `gl` to search and focus on input box
|
||||||
|
i: "gi",
|
||||||
// t -> Open Link in New Tab
|
// t -> Open Link in New Tab
|
||||||
t: "gf",
|
t: "gf",
|
||||||
// 缩放
|
// 缩放
|
||||||
|
|
@ -218,7 +219,7 @@ forwardFactory.map(mapLists);
|
||||||
|
|
||||||
// All other unmapped keys should be defined here
|
// All other unmapped keys should be defined here
|
||||||
// TODO: Add more mouse click keymap
|
// TODO: Add more mouse click keymap
|
||||||
api.unmap("gi"); // conflict with `gi` in `mapLists`
|
// api.unmap("gi"); // conflict with `gi` in `mapLists`
|
||||||
api.unmap("C"); // Use `F` instead (Open Link in New Tab)
|
api.unmap("C"); // Use `F` instead (Open Link in New Tab)
|
||||||
api.map("g/", "gU"); // Goto Root Domain
|
api.map("g/", "gU"); // Goto Root Domain
|
||||||
// TODO: Add SPC keymap as leader (maybe change `,` to `SPC`)
|
// TODO: Add SPC keymap as leader (maybe change `,` to `SPC`)
|
||||||
|
|
|
||||||
31
nixcfgs/modules/home/options.nix
Normal file
31
nixcfgs/modules/home/options.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options.currentUser = {
|
||||||
|
defaultShell = lib.mkOption {
|
||||||
|
type = lib.types.enum ["zsh" "bash" "fish"];
|
||||||
|
default = "zsh";
|
||||||
|
description = "The default shell to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultTerminal = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "ghostty";
|
||||||
|
description = "The default terminal emulator.";
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultTerminalRunner = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = config.currentUser.defaultTerminal;
|
||||||
|
description = "The default terminal emulator to run CLI softwares directly";
|
||||||
|
};
|
||||||
|
|
||||||
|
iconTheme = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Breeze";
|
||||||
|
description = "Default icon theme";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,16 @@
|
||||||
rofimoji
|
rofimoji
|
||||||
rofi-power-menu
|
rofi-power-menu
|
||||||
swaylock-effects
|
swaylock-effects
|
||||||
|
swayidle
|
||||||
xwayland-satellite
|
xwayland-satellite
|
||||||
wmname
|
wmname
|
||||||
|
hyprpolkitagent
|
||||||
];
|
];
|
||||||
|
fonts.packages = [pkgs.font-awesome];
|
||||||
|
xdg.portal = {
|
||||||
|
extraPortals = with pkgs; [
|
||||||
|
kdePackages.xdg-desktop-portal-kde
|
||||||
|
];
|
||||||
|
config.common.default = ["kde" "wlr"];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,8 @@
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
libnotify
|
libnotify
|
||||||
];
|
];
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
wlr.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
pkgs.nerd-fonts.jetbrains-mono
|
pkgs.nerd-fonts.jetbrains-mono
|
||||||
pkgs.nur.repos.definfo.sarasa-term-sc-nerd
|
pkgs.nur.repos.definfo.sarasa-term-sc-nerd
|
||||||
pkgs.vollkorn
|
pkgs.vollkorn
|
||||||
|
pkgs.font-awesome
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = fontPkgs;
|
environment.systemPackages = fontPkgs;
|
||||||
|
|
|
||||||
10
nixcfgs/users/js0ny/config.nix
Normal file
10
nixcfgs/users/js0ny/config.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
currentUser = {
|
||||||
|
defaultShell = "zsh";
|
||||||
|
defaultTerminal = "ghostty";
|
||||||
|
defaultTerminalRunner = "alacritty";
|
||||||
|
iconTheme = "Papirus";
|
||||||
|
};
|
||||||
|
currentHost = {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,15 @@
|
||||||
# ~/.config/nixcfgs/users/js0ny/default.nix
|
# ~/.config/nixcfgs/users/js0ny/default.nix
|
||||||
{pkgs, ...}: let
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
username = "js0ny";
|
username = "js0ny";
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
../../modules/home/options.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
home.username = username;
|
home.username = username;
|
||||||
home.homeDirectory =
|
home.homeDirectory =
|
||||||
if pkgs.stdenv.isDarwin
|
if pkgs.stdenv.isDarwin
|
||||||
|
|
@ -12,5 +20,7 @@ in {
|
||||||
home-manager
|
home-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.sessionVariables.TERMINAL = config.currentUser.defaultTerminal;
|
||||||
|
|
||||||
home.stateVersion = "25.05";
|
home.stateVersion = "25.05";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@
|
||||||
vivaldi
|
vivaldi
|
||||||
rustdesk
|
rustdesk
|
||||||
kdePackages.krdc
|
kdePackages.krdc
|
||||||
|
kdePackages.breeze
|
||||||
|
zotero
|
||||||
|
|
||||||
# Email
|
# Email
|
||||||
protonmail-bridge
|
protonmail-bridge
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
QT_STYLE_OVERRIDE = "adwaita";
|
QT_STYLE_OVERRIDE = "adwaita";
|
||||||
};
|
};
|
||||||
|
|
@ -42,7 +46,7 @@
|
||||||
"org/gnome/desktop/interface" = {
|
"org/gnome/desktop/interface" = {
|
||||||
clock-show-seconds = true;
|
clock-show-seconds = true;
|
||||||
clock-show-weekday = true;
|
clock-show-weekday = true;
|
||||||
icon-theme = "Papirus";
|
icon-theme = "${config.currentUser.iconTheme}";
|
||||||
accent-color = "pink";
|
accent-color = "pink";
|
||||||
show-battery-percentage = true;
|
show-battery-percentage = true;
|
||||||
cursor-theme = "Adwaita";
|
cursor-theme = "Adwaita";
|
||||||
|
|
@ -107,12 +111,12 @@
|
||||||
};
|
};
|
||||||
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-1" = {
|
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-1" = {
|
||||||
name = "Open Terminal via Win-R";
|
name = "Open Terminal via Win-R";
|
||||||
command = "ghostty";
|
command = "${config.currentUser.defaultTerminal}";
|
||||||
binding = "<Super>r";
|
binding = "<Super>r";
|
||||||
};
|
};
|
||||||
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-2" = {
|
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-2" = {
|
||||||
name = "Open Terminal via Ctrl-Alt-T";
|
name = "Open Terminal via Ctrl-Alt-T";
|
||||||
command = "ghostty";
|
command = "${config.currentUser.defaultTerminal}";
|
||||||
binding = "<Ctrl><Alt>t";
|
binding = "<Ctrl><Alt>t";
|
||||||
};
|
};
|
||||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = [pkgs.miniserve];
|
home.packages = [pkgs.miniserve];
|
||||||
home.file.".local/share/kio/servicemenus/miniserve.desktop" = {
|
home.file.".local/share/kio/servicemenus/miniserve.desktop" = {
|
||||||
text = ''
|
text = ''
|
||||||
|
|
@ -14,7 +18,7 @@
|
||||||
Name=Map Directory to Port 8080
|
Name=Map Directory to Port 8080
|
||||||
Name[CN]=将目录映射到网上(8080)
|
Name[CN]=将目录映射到网上(8080)
|
||||||
Icon=network-server
|
Icon=network-server
|
||||||
Exec=alacritty -t "miniserve" -e miniserve "%f" --port 8080
|
Exec=${config.currentUser.defaultTerminalRunner} -t "miniserve" -e miniserve "%f" --port 8080
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
nixcfgs/users/js0ny/programs/niri.nix
Normal file
25
nixcfgs/users/js0ny/programs/niri.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.file."${config.xdg.configHome}/niri/config.kdl" = {
|
||||||
|
text = ''
|
||||||
|
spawn-at-startup "waybar" // Status Bar
|
||||||
|
spawn-at-startup "dunst" // Notifications
|
||||||
|
spawn-at-startup "fcitx5" // Input Method
|
||||||
|
spawn-at-startup "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"
|
||||||
|
spawn-at-startup
|
||||||
|
input {
|
||||||
|
xkb {}
|
||||||
|
numlock
|
||||||
|
touchpad {
|
||||||
|
tap
|
||||||
|
naturalscroll
|
||||||
|
}
|
||||||
|
mouse {}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
enable = false; # TODO:
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# kdePackages.yakuake
|
# kdePackages.yakuake
|
||||||
krunner-vscodeprojects
|
krunner-vscodeprojects
|
||||||
|
|
@ -20,7 +24,7 @@
|
||||||
position = "center";
|
position = "center";
|
||||||
};
|
};
|
||||||
workspace = {
|
workspace = {
|
||||||
iconTheme = "Papirus";
|
iconTheme = "${config.currentUser.iconTheme}";
|
||||||
colorScheme = "BreezeDark";
|
colorScheme = "BreezeDark";
|
||||||
};
|
};
|
||||||
kwin = {
|
kwin = {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ in {
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autocd = true;
|
autocd = true;
|
||||||
|
# oh-my-zsh.enable = true;
|
||||||
autosuggestion.enable = true;
|
autosuggestion.enable = true;
|
||||||
historySubstringSearch.enable = true;
|
historySubstringSearch.enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
|
@ -42,6 +43,10 @@ in {
|
||||||
#
|
#
|
||||||
# bindkey -M viins '^?' backward-delete-char
|
# bindkey -M viins '^?' backward-delete-char
|
||||||
# bindkey -M viins '^H' backward-kill-word
|
# bindkey -M viins '^H' backward-kill-word
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 'r:|=*'
|
||||||
|
|
||||||
|
# fzf-tab 模糊匹配
|
||||||
|
zstyle ':fzf-tab:*' use-fzf-default-bindings yes
|
||||||
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
# Desktop Linux
|
# Desktop Linux
|
||||||
./programs/plasma.nix
|
./programs/plasma.nix
|
||||||
|
./programs/niri.nix
|
||||||
|
|
||||||
# General Program config
|
# General Program config
|
||||||
../../modules/home/programs/eza.nix
|
../../modules/home/programs/eza.nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue