[home] split out home-manager from configuration

This commit is contained in:
2024-06-28 03:04:24 +08:00
parent 28810c407b
commit 6f9de6434c
8 changed files with 23 additions and 18 deletions
+22
View File
@@ -0,0 +1,22 @@
{ pkgs, lib, config, ... }:
{
home.packages = with pkgs; [
desktop-file-utils
telegram-desktop
qq
mpv
feishu
moonlight-qt
];
# An Apple Music client, only can be downloaded after purchasing
xdg.desktopEntries = {
Cider = {
name = "Cider";
exec = "appimage-run ${config.home.homeDirectory}/app/Cider-2.4.1.AppImage";
terminal = false;
categories = [ "Application" ];
};
};
}
+39
View File
@@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
{
home.packages = with pkgs; [
lldb
clang-tools
python312
python312Packages.ipython
];
programs.fish.shellAliases = {
"ipy" = "ipython --no-confirm-exit";
};
programs.direnv.enable = true;
programs.fish.shellInit = ''
direnv hook fish | source
'';
programs.git = {
enable = true;
lfs.enable = true;
userName = "Origami404";
userEmail = "Origami404@foxmail.com";
extraConfig = {
user.signingKey = "5C7FCAFBC961E2E312B47FEC76447D4671CB3CC0";
core.autocrlf = "input";
push.autoSetupRemote = true;
pull.rebase = true;
init.defaultBranch = "main";
};
aliases = {
"l" = "log --date-order --graph --pretty=\"format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset\"";
};
};
programs.vscode = {
enable = true;
package = pkgs.vscode.fhs;
};
}
+183
View File
@@ -0,0 +1,183 @@
# Generated via dconf2nix: https://github.com/nix-commmunity/dconf2nix
{ lib, ... }:
with lib.hm.gvariant;
{
dconf = {
enable = true;
settings = {
# UI 和字体
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
titlebar-font = "LXGW WenKai 13";
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
document-font-name = "LXGW WenKai Mono 12";
font-antialiasing = "rgba";
font-hinting = "slight";
font-name = "LXGW WenKai 12";
gtk-theme = "Adwaita-dark";
monospace-font-name = "CaskaydiaCove Nerd Font Propo Semi-Light 12";
show-battery-percentage = true;
text-scaling-factor = mkDouble "1.25";
toolkit-accessibility = false;
};
# 输入法
"org/gnome/desktop/input-sources" = {
current = mkUint32 0;
mru-sources = [ (mkTuple [ "xkb" "us" ]) ];
per-window = false;
show-all-sources = true;
sources = [ (mkTuple [ "xkb" "us" ]) ];
xkb-options = [ "lv3:ralt_switch" "caps:super" ];
};
# 键盘鼠标触控板
"org/gnome/desktop/peripherals/keyboard" = {
numlock-state = false;
};
"org/gnome/desktop/peripherals/touchpad" = {
edge-scrolling-enabled = false;
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
# 快捷键
"org/gnome/desktop/wm/keybindings" = {
cycle-group = [ ];
cycle-group-backward = [ ];
cycle-panels = [ ];
cycle-panels-backward = [ ];
cycle-windows = [ ];
cycle-windows-backward = [ ];
move-to-monitor-down = [ ];
move-to-monitor-left = [ ];
move-to-monitor-right = [ ];
move-to-monitor-up = [ ];
move-to-workspace-1 = [ "<Shift><Super>1" ];
move-to-workspace-2 = [ "<Shift><Super>2" ];
move-to-workspace-3 = [ "<Shift><Super>3" ];
move-to-workspace-4 = [ "<Shift><Super>4" ];
move-to-workspace-5 = [ "<Super><Shift>5" ];
move-to-workspace-down = [ "<Super><Shift>Page_Down" ];
move-to-workspace-last = [ ];
move-to-workspace-left = [ "<Shift><Super>Left" ];
move-to-workspace-right = [ "<Shift><Super>Right" ];
move-to-workspace-up = [ "<Super><Shift>Page_Up" ];
panel-run-dialog = [ ];
switch-applications = [ ];
switch-applications-backward = [ ];
switch-group = [ ];
switch-group-backward = [ ];
switch-input-source = [ "<Control>space" ];
switch-input-source-backward = [ "<Shift><Control>space" ];
switch-panels = [ ];
switch-panels-backward = [ ];
switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ];
switch-to-workspace-4 = [ "<Super>4" ];
switch-to-workspace-5 = [ "<Super>5" ];
switch-to-workspace-last = [ ];
switch-to-workspace-left = [ "<Super>Left" ];
switch-to-workspace-right = [ "<Super>Right" ];
switch-windows = [ "<Alt>Tab" ];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>Return";
command = "kgx";
name = "Run terminal";
};
"org/gnome/mutter" = {
overlay-key = "Super_L";
};
"org/gnome/mutter/keybindings" = {
toggle-tiled-left = [ "<Alt><Super>Left" ];
toggle-tiled-right = [ "<Alt><Super>Right" ];
};
"org/gnome/shell/keybindings" = {
screenshot = [ ];
screenshot-window = [ ];
show-screen-recording-ui = [ ];
show-screenshot-ui = [ "<Shift><Super>s" ];
switch-to-application-1 = [ ];
switch-to-application-2 = [ ];
switch-to-application-3 = [ ];
switch-to-application-4 = [ ];
toggle-application-view = [ ];
};
"org/gnome/shell/app-switcher" = {
current-workspace-only = true;
};
# 登录和休眠
"org/gnome/login-screen" = {
enable-fingerprint-authentication = true;
enable-password-authentication = true;
enable-smartcard-authentication = false;
};
"org/gnome/settings-daemon/plugins/power" = {
idle-dim = false;
sleep-inactive-ac-type = "nothing";
};
# 截图自动保存
"org/gnome/desktop/screensaver" = {
color-shading-type = "solid";
lock-delay = mkUint32 60;
lock-enabled = true;
picture-options = "zoom";
primary-color = "#241f31";
secondary-color = "#000000";
};
# 文件管理器
"org/gnome/nautilus/compression" = {
default-compression-format = "zip";
};
"org/gnome/nautilus/icon-view" = {
default-zoom-level = "extra-large";
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
migrated-gtk-settings = true;
search-filter-time-type = "last_modified";
};
# 隐私
"org/gnome/desktop/privacy" = {
disable-camera = true;
disable-microphone = true;
old-files-age = mkUint32 7;
recent-files-max-age = -1;
remember-recent-files = false;
remove-old-temp-files = true;
report-technical-problems = false;
};
"org/gnome/system/location" = {
enabled = false;
};
# 杂七杂八
"org/gnome/desktop/search-providers" = {
disable-external = true;
sort-order = [ "org.gnome.Contacts.desktop" "org.gnome.Documents.desktop" "org.gnome.Nautilus.desktop" ];
};
"org/gnome/desktop/session" = {
idle-delay = mkUint32 0;
};
"org/gnome/desktop/sound" = {
event-sounds = true;
};
"org/gnome/software" = {
download-updates = false;
download-updates-notify = false;
};
"org/gnome/tweaks" = {
show-extensions-notice = false;
};
};
};
}
+10
View File
@@ -0,0 +1,10 @@
{ pkgs, lib, config, ... }:
{
programs.gnupg = {
enable = true;
agent = {
enable = true;
enableSSHSupport = true;
};
};
}
+67
View File
@@ -0,0 +1,67 @@
{ pkgs, lib, config, ... }:
{
home.packages = with pkgs; [
atool # all-in-one tar
ripgrep # better grep
jq # better cat on json
bat # better cat on everything
eza # better ls
fzf # A command-line fuzzy finder
du-dust # better du
duf # better df
fd # better find
btop # better top
procs # better ps
scc # better cloc
btop # better top
grc # log file colorize
neofetch # tool for showing off
mtr # better traceroute
iperf3
q # better dig/nslookup
socat # better netcat
nmap
];
programs.nix-index.enableFishIntegration = true;
programs.fzf.enableFishIntegration = false; # use fish.fzf keybinding
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
'';
plugins = with pkgs.fishPlugins; [
{ name = "z"; src = z.src; }
{ name = "grc"; src = grc.src; }
{ name = "fzf-fish"; src = fzf-fish.src; }
{ name = "autopair"; src = autopair.src; }
{ name = "colored-man-pages"; src = colored-man-pages.src; }
];
shellInit = ''
fzf_configure_bindings --directory=\cp --git_log=\cl --history=\cr \
--git_status= --processes= --variables=
'';
shellAbbrs = {
"..." = "../..";
"...." = "../../..";
};
shellAliases = {
"ls" = "eza";
"ll" = "eza -l";
"la" = "eza -a";
"grep" = "rg";
"top" = "btop";
"dig" = "q";
"nc" = "socat";
"netcat" = "socat";
"find" = "fd";
"du" = "dust";
"df" = "duf";
"cloc" = "scc";
"cat" = "bat";
"x" = "atool -x";
"flake-update" = "nixos-rebuild switch --use-remote-sudo --flake ${config.home.homeDirectory}/flakes#um790-nix";
"cl" = "clear";
};
};
}