Split some expressions out of home/default.nix, clean up

Move git, starship and btm expressions to own files

Move account dir expressions up a level, remove accounts dir

Clean up some unused expressions (like qutebrowser and firefox)
This commit is contained in:
Evie Litherland-Smith 2024-02-04 07:14:04 +00:00
parent eed793e9aa
commit ba9411fb9f
14 changed files with 220 additions and 469 deletions

View file

@ -1 +0,0 @@
{...}: {imports = [./pass.nix ./email.nix];}

28
home/bottom/default.nix Normal file
View file

@ -0,0 +1,28 @@
{config, ...}: {
programs.bottom = {
enable = true;
settings.colors = with config.lib.stylix.colors.withHashtag; {
table_header_color = base06;
all_cpu_color = base06;
avg_cpu_color = "#eba0ac";
cpu_core_colors = [base08 base09 base0A base0B "#74c7ec" base0E];
ram_color = base0B;
swap_color = base09;
rx_color = base0B;
tx_color = base08;
widget_title_color = base0F;
border_color = base02;
highlighted_border_color = base07;
text_color = base04;
graph_color = "#a6adc8";
cursor_color = "#f5c2e7";
selected_text_color = base05;
selected_bg_color = base0E;
high_battery_color = base0B;
medium_battery_color = base0A;
low_battery_color = base08;
gpu_core_colors = ["#74c7ec" base0E base08 base09 base0A base0B];
arc_color = "#89dceb";
};
};
}

View file

@ -1,46 +1,23 @@
{ {pkgs, ...}: {
config, imports = [
lib, ./git/default.nix
pkgs, ./ssh/default.nix
... ./nushell/default.nix
}: { ./starship/default.nix
imports = [./nushell/default.nix ./config/default.nix ./scripts/default.nix]; ./bottom/default.nix
./config/default.nix
./scripts/default.nix
];
stylix.targets = { stylix.targets = {
fzf.enable = true; fzf.enable = true;
zellij.enable = true; zellij.enable = true;
}; };
programs = rec { programs = {
bash.enable = true; bash.enable = true;
bat = { bat = {
enable = true; enable = true;
config.theme = "Catppuccin-mocha"; config.theme = "Catppuccin-mocha";
}; };
bottom = {
enable = true;
settings.colors = with config.lib.stylix.colors.withHashtag; {
table_header_color = base06;
all_cpu_color = base06;
avg_cpu_color = "#eba0ac";
cpu_core_colors = [base08 base09 base0A base0B "#74c7ec" base0E];
ram_color = base0B;
swap_color = base09;
rx_color = base0B;
tx_color = base08;
widget_title_color = base0F;
border_color = base02;
highlighted_border_color = base07;
text_color = base04;
graph_color = "#a6adc8";
cursor_color = "#f5c2e7";
selected_text_color = base05;
selected_bg_color = base0E;
high_battery_color = base0B;
medium_battery_color = base0A;
low_battery_color = base08;
gpu_core_colors = ["#74c7ec" base0E base08 base09 base0A base0B];
arc_color = "#89dceb";
};
};
carapace = { carapace = {
enable = true; enable = true;
enableBashIntegration = true; enableBashIntegration = true;
@ -73,175 +50,6 @@
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d"; changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f"; fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
}; };
git = {
enable = true;
userName = "Evie Litherland-Smith";
userEmail = lib.mkDefault "evie@xenia.me.uk";
delta = {
enable = true;
options = {
line-numbers = true;
hyprlinks = true;
navigate = true;
side-by-side = true;
syntax-theme = bat.config.theme;
};
};
extraConfig = {
github.user = "elitherl";
gitea.user = "xenia";
pull.rebase = false;
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
};
};
ssh = {
enable = true;
forwardAgent = true;
addKeysToAgent = "yes";
compression = true;
serverAliveInterval = 15;
serverAliveCountMax = 3;
controlMaster = "auto";
controlPersist = "10s";
extraConfig = ''
SetEnv TERM=xterm-256color
'';
matchBlocks = {
"git*".user = "git";
"legion" = {
user = "xenia";
hostname = "192.168.1.230";
};
"ionos" = {
user = "root";
hostname = "77.68.67.133";
};
"freia" = {
user = "elitherl";
hostname = "freia020.hpc.l";
};
"heimdall" = {
user = "elitherl";
hostname = "heimdall003.jet.uk";
};
};
};
starship = {
enable = true;
enableBashIntegration = true;
enableNushellIntegration = true;
enableTransience = true;
settings = {
c = {symbol = " ";};
command_timeout = 1000;
container = {symbol = " ";};
add_newline = false;
character = {
success_symbol = "[!](bold green)";
error_symbol = "[?](bold red)";
};
directory = {
truncation_length = 2;
fish_style_pwd_dir_length = 1;
read_only = "󰉐 ";
truncate_to_repo = false;
};
line_break.disabled = false;
git_branch = {
symbol = " ";
only_attached = true;
ignore_branches = ["master" "main"];
};
git_commit = {
format = "[󰜘 $hash | $tag]($style) ";
tag_symbol = "󰓹 ";
tag_disabled = false;
};
git_metrics.disabled = false;
git_status = {
stashed = "󰁯 ";
ahead = "󰁝 ";
behind = "󰁅 ";
up_to_date = "";
diverged = "󰹹 ";
conflicted = "󰦎 ";
deleted = " ";
renamed = " ";
modified = " ";
staged = " ";
untracked = " ";
typechanged = " ";
};
golang = {symbol = " ";};
guix_shell = {symbol = " ";};
haskell = {symbol = " ";};
hostname = {
ssh_only = true;
ssh_symbol = "󰢹 ";
};
java = {symbol = " ";};
localip = {disabled = false;};
lua = {symbol = " ";};
memory_usage = {
disabled = false;
symbol = "󰍛 ";
};
nix_shell.symbol = "󱄅 ";
os = {
disabled = false;
format = "on [$symbol]($style) ";
style = "bold blue";
symbols = {
Alpine = " ";
Android = " ";
Arch = " ";
CentOS = " ";
Debian = " ";
EndeavourOS = " ";
Fedora = " ";
FreeBSD = " ";
Gentoo = " ";
Illumos = " ";
Linux = " ";
Macos = " ";
Manjaro = " ";
Mint = "󰣭 ";
NixOS = " ";
OpenBSD = " ";
openSUSE = " ";
Pop = " ";
Raspbian = " ";
Redhat = " ";
RedHatEnterprise = " ";
Solus = " ";
SUSE = " ";
Ubuntu = " ";
Unknown = " ";
Windows = " ";
};
};
package = {symbol = "󰏗 ";};
python = {
symbol = "󰌠 ";
python_binary = "python3";
};
rust = {symbol = "󱘗 ";};
shell = {
disabled = false;
format = "using [$indicator ]($style)";
bash_indicator = "#";
nu_indicator = "ν";
unknown_indicator = "?";
};
status = {};
sudo = {
disabled = false;
symbol = "󰪋 ";
};
};
};
zellij = { zellij = {
enable = true; enable = true;
settings.default_layout = "compact"; settings.default_layout = "compact";

View file

@ -1,74 +0,0 @@
{pkgs, ...}: {
programs.firefox = {
enable = true;
package = null; # Use system Firefox
profiles.default = {
settings = {
"app.shield.optoutstudies.enabled" = false;
"browser.bookmarks.addedImportButton" = false;
"browser.bookmarks.showMobileBookmarks" = false;
"browser.toolbars.bookmarks.visibility" = "newtab";
"browser.contentblocking.category" = "strict";
"browser.search.region" = "GB";
"browser.search.isUS" = false;
"browser.warnOnQuitShortcut" = false;
"distribution.searchplugins.defaultLocale" = "en-GB";
"doh-rollout.home-region" = "GB";
# Catppuccin Mocha (Lavender) theme
"extensions.activeThemeID" = "{8446b178-c865-4f5c-8ccc-1d7887811ae3}";
"extensions.formautofill.creditCards.enabled" = false;
"general.useragent.locale" = "en-GB";
"intl.accept_languages" = "en-gb,en";
"intl.locale.requested" = "en-gb,en";
"intl.regional_prefs.use_os_locales" = false;
"media.eme.enabled" = true;
"privacy.webrtc.legacyGlobalIndicator" = false;
"signon.management.page.breach-alerts.enabled" = false;
"signon.rememberSignons" = false;
"browser.newtabpage.pinned" = [
{
title = "NixOS Wiki";
url = "https://nixos.wiki";
}
{
title = "Arch Wiki";
url = "https://wiki.archlinux.org";
}
{
title = "Hyprland Wiki";
url = "https://wiki.hyprland.org";
}
];
};
search = {
default = "DuckDuckGo";
force = true;
order = ["DuckDuckGo"];
engines = {
"Wikipedia" = {
urls = [{template = "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}&go=Go&ns0=1";}];
definedAliases = ["@w"];
};
"Arch Wiki" = {
urls = [{template = "https://wiki.archlinux.org/?search={searchTerms}";}];
definedAliases = ["@aw"];
};
"NixOS Wiki" = {
urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@nw"];
};
"MyNixOS" = {
urls = [{template = "https://mynixos.com/search?q={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@mn"];
};
"Atlas SearXNG" = {
urls = [{template = "https://search.atlas.engineer/searxng/search?q={searchTerms}";}];
definedAliases = ["@a"];
};
};
};
};
};
}

29
home/git/default.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
...
}: {
programs.git = {
enable = true;
userName = "Evie Litherland-Smith";
userEmail = lib.mkDefault "evie@xenia.me.uk";
delta = {
enable = true;
options = {
line-numbers = true;
hyprlinks = true;
navigate = true;
side-by-side = true;
syntax-theme = with config.programs; lib.mkIf bat.enable bat.config.theme;
};
};
extraConfig = {
github.user = "elitherl";
gitea.user = "xenia";
pull.rebase = false;
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
};
};
}

View file

@ -10,7 +10,8 @@
}; };
imports = [ imports = [
../default.nix ../default.nix
../accounts/default.nix ../email/default.nix
../password-store/default.nix
../swaylock/default.nix ../swaylock/default.nix
../waybar/default.nix ../waybar/default.nix
../rofi/default.nix ../rofi/default.nix

View file

@ -1,27 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
stylix.targets.qutebrowser.enable = true;
programs.qutebrowser = {
enable = true;
package = pkgs.qutebrowser-qt5; # Qt6 currently looks blurry with scaling on Wayland
loadAutoconfig = false;
enableDefaultBindings = true; # For now...
searchEngines = rec {
w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1";
aw = "https://wiki.archlinux.org/?search={}";
nw = "https://nixos.wiki/index.php?search={}";
mn = "https://mynixos.com/search?q={}";
ddg = "https://duckduckgo.com/?q={}";
a = "https://search.atlas.engineer/searxng/search?q={}";
DEFAULT = a;
};
settings = {
tabs.tabs_are_windows = true;
fonts.web.size.default = lib.mkForce config.stylix.fonts.sizes.applications; # Temp fix until stylix is updated
};
};
}

View file

@ -1,163 +0,0 @@
# qutemacs - a simple, preconfigured Emacs binding set for qutebrowser
#
# The aim of this binding set is not to provide bindings for absolutely
# everything, but to provide a stable launching point for people to make their
# own bindings.
#
# Installation:
#
# 1. Copy this file or add this repo as a submodule to your dotfiles.
# 2. Add this line to your config.py, and point the path to this file:
# config.source('qutemacs/qutemacs.py')
config = config # type: ConfigAPI # noqa: F821 pylint: disable=E0602,C0103
c = c # type: ConfigContainer # noqa: F821 pylint: disable=E0602,C0103
# c.input.insert_mode.auto_enter = False
# c.input.insert_mode.auto_leave = False
c.input.insert_mode.plugins = True
c.input.insert_mode.auto_load = True
# Forward unbound keys
c.input.forward_unbound_keys = "all"
ESC_BIND = "clear-keychain ;; search ;; fullscreen --leave"
c.bindings.default["normal"] = {}
# Bindings
c.bindings.commands["normal"] = {
# Navigation
"<ctrl-v>": "scroll-page 0 0.9",
"<alt-v>": "scroll-page 0 -0.9",
"<Backspace>": "scroll-page 0 -0.9",
# '<Space>': 'scroll-page 0 0.9',
"<alt-shift-.": "scroll-to-perc",
"<alt-shift-.>": "scroll-to-perc 0",
# Commands
"<alt-x>": "set-cmd-text :",
"<ctrl-x><ctrl-c>": "quit",
# searching
"<ctrl-s>": "set-cmd-text /",
"<ctrl-r>": "set-cmd-text ?",
# hinting
"<f>": "hint all",
"<ctrl-u><f>": "hint all hover",
"<shift-f>": "hint all tab-bg",
"<ctrl-u><shift-e>": "hint all tab-fg",
"<w><l>": "hint all yank-primary",
"<w><w>": "yank url",
"<d>": "yank all download",
# history
"<shift-f>": "forward",
"<shift-b>": "back",
"<ctrl-c><ctrl-f>": "forward",
"<ctrl-c><ctrl-b>": "back",
"shift-h>": "history",
# bookmarks
"m": "bookmark-add",
"M": "open qute://bookmarks",
# tabs
"<ctrl-tab>": "tab-next",
"<ctrl-shift-tab>": "tab-prev",
"<alt-n>": "tab-next",
"<shift-alt-n>": "tab-move +",
"<alt-p>": "tab-prev",
"<shift-alt-p>": "tab-move -",
"<ctrl-x><b>": "set-cmd-text -s :buffer",
"<ctrl-x><k>": "tab-close",
"<ctrl-c><p>": "tab-pin",
"<ctrl-c><m>": "tab-mute",
"<ctrl-x><0>": "tab-close",
"<ctrl-x><1>": "tab-only",
"<Alt-1>": "tab-focus 1",
"<Alt-2>": "tab-focus 2",
"<Alt-3>": "tab-focus 3",
"<Alt-4>": "tab-focus 4",
"<Alt-5>": "tab-focus 5",
"<Alt-6>": "tab-focus 6",
"<Alt-7>": "tab-focus 7",
"<Alt-8>": "tab-focus 8",
"<Alt-9>": "tab-focus -1",
# frames
"<ctrl-x><5><0>": "close",
"<ctrl-x><5><1>": "window-only",
"<ctrl-x><5><2>": "set-cmd-text -s :open -w",
"<ctrl-u><ctrl-x><5><2>": "set-cmd-text -s :open -p",
# open links
"<g>": "set-cmd-text -s :open",
"<shift-g>": "set-cmd-text -s :open -t",
# editing
"<ctrl-f>": "fake-key <Right>",
"<ctrl-b>": "fake-key <Left>",
"<ctrl-a>": "fake-key <Home>",
"<ctrl-e>": "fake-key <End>",
"<ctrl-n>": "fake-key <Down>",
"<ctrl-p>": "fake-key <Up>",
"<alt-f>": "fake-key <Ctrl-Right>",
"<alt-b>": "fake-key <Ctrl-Left>",
"<ctrl-d>": "fake-key <Delete>",
"<alt-d>": "fake-key <Ctrl-Delete>",
"<alt-backspace>": "fake-key <Ctrl-Backspace>",
"<ctrl-w>": "fake-key <Ctrl-backspace>",
"<ctrl-y>": "insert-text {primary}",
# Numbers
# https://github.com/qutebrowser/qutebrowser/issues/4213
"1": "fake-key 1",
"2": "fake-key 2",
"3": "fake-key 3",
"4": "fake-key 4",
"5": "fake-key 5",
"6": "fake-key 6",
"7": "fake-key 7",
"8": "fake-key 8",
"9": "fake-key 9",
"0": "fake-key 0",
# misc
"<ctrl-c><v>": "spawn --userscript ~/.bin/open_in_mpv.sh",
# Help
"<ctrl-h><b>": "open qute://bindings",
"<ctrl-h><h>": "set-cmd-text -s :help",
# escape hatch
"<ctrl-g>": ESC_BIND,
}
c.bindings.commands["command"] = {
"<ctrl-s>": "search-next",
"<ctrl-r>": "search-prev",
"<ctrl-p>": "completion-item-focus prev",
"<ctrl-n>": "completion-item-focus next",
"<alt-p>": "command-history-prev",
"<alt-n>": "command-history-next",
# escape hatch
"<ctrl-g>": "leave-mode",
}
c.bindings.commands["hint"] = {
# escape hatch
"<ctrl-g>": "leave-mode",
}
c.bindings.commands["caret"] = {
# escape hatch
"<ctrl-g>": "leave-mode",
}
c.bindings.commands["insert"] = {
# editing
"<ctrl-f>": "fake-key <Right>",
"<ctrl-b>": "fake-key <Left>",
"<ctrl-a>": "fake-key <Home>",
"<ctrl-e>": "fake-key <End>",
"<ctrl-n>": "fake-key <Down>",
"<ctrl-p>": "fake-key <Up>",
"<alt-f>": "fake-key <Ctrl-Right>",
"<alt-b>": "fake-key <Ctrl-Left>",
"<ctrl-d>": "fake-key <Delete>",
"<alt-d>": "fake-key <Ctrl-Delete>",
"<alt-backspace>": "fake-key <Ctrl-Backspace>",
"<ctrl-w>": "fake-key <Ctrl-backspace>",
"<ctrl-y>": "insert-text {primary}",
"<ctrl-g>": "leave-mode",
}

34
home/ssh/default.nix Normal file
View file

@ -0,0 +1,34 @@
{...}: {
programs.ssh = {
enable = true;
forwardAgent = true;
addKeysToAgent = "yes";
compression = true;
serverAliveInterval = 15;
serverAliveCountMax = 3;
controlMaster = "auto";
controlPersist = "10s";
extraConfig = ''
SetEnv TERM=xterm-256color
'';
matchBlocks = {
"git*".user = "git";
"legion" = {
user = "xenia";
hostname = "192.168.1.230";
};
"ionos" = {
user = "root";
hostname = "77.68.67.133";
};
"freia" = {
user = "elitherl";
hostname = "freia020.hpc.l";
};
"heimdall" = {
user = "elitherl";
hostname = "heimdall003.jet.uk";
};
};
};
}

116
home/starship/default.nix Normal file
View file

@ -0,0 +1,116 @@
{...}: {
programs.starship = {
enable = true;
enableBashIntegration = true;
enableNushellIntegration = true;
enableTransience = true;
settings = {
c = {symbol = " ";};
command_timeout = 1000;
container = {symbol = " ";};
add_newline = false;
character = {
success_symbol = "[!](bold green)";
error_symbol = "[?](bold red)";
};
directory = {
truncation_length = 2;
fish_style_pwd_dir_length = 1;
read_only = "󰉐 ";
truncate_to_repo = false;
};
line_break.disabled = false;
git_branch = {
symbol = " ";
only_attached = true;
ignore_branches = ["master" "main"];
};
git_commit = {
format = "[󰜘 $hash | $tag]($style) ";
tag_symbol = "󰓹 ";
tag_disabled = false;
};
git_metrics.disabled = false;
git_status = {
stashed = "󰁯 ";
ahead = "󰁝 ";
behind = "󰁅 ";
up_to_date = "";
diverged = "󰹹 ";
conflicted = "󰦎 ";
deleted = " ";
renamed = " ";
modified = " ";
staged = " ";
untracked = " ";
typechanged = " ";
};
golang = {symbol = " ";};
guix_shell = {symbol = " ";};
haskell = {symbol = " ";};
hostname = {
ssh_only = true;
ssh_symbol = "󰢹 ";
};
java = {symbol = " ";};
localip = {disabled = false;};
lua = {symbol = " ";};
memory_usage = {
disabled = false;
symbol = "󰍛 ";
};
nix_shell.symbol = "󱄅 ";
os = {
disabled = false;
format = "on [$symbol]($style) ";
style = "bold blue";
symbols = {
Alpine = " ";
Android = " ";
Arch = " ";
CentOS = " ";
Debian = " ";
EndeavourOS = " ";
Fedora = " ";
FreeBSD = " ";
Gentoo = " ";
Illumos = " ";
Linux = " ";
Macos = " ";
Manjaro = " ";
Mint = "󰣭 ";
NixOS = " ";
OpenBSD = " ";
openSUSE = " ";
Pop = " ";
Raspbian = " ";
Redhat = " ";
RedHatEnterprise = " ";
Solus = " ";
SUSE = " ";
Ubuntu = " ";
Unknown = " ";
Windows = " ";
};
};
package = {symbol = "󰏗 ";};
python = {
symbol = "󰌠 ";
python_binary = "python3";
};
rust = {symbol = "󱘗 ";};
shell = {
disabled = false;
format = "using [$indicator ]($style)";
bash_indicator = "#";
nu_indicator = "ν";
unknown_indicator = "?";
};
status = {};
sudo = {
disabled = false;
symbol = "󰪋 ";
};
};
};
}