mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
Refactors, konawall-py for darwin, sumireko update to Sonoma
This commit is contained in:
parent
091ddb5b91
commit
bc61d82487
151 changed files with 691 additions and 792 deletions
93
home/environments/darwin/konawall.nix
Normal file
93
home/environments/darwin/konawall.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
konawallConfig = {
|
||||
interval = 300;
|
||||
rotate = true;
|
||||
source = "konachan";
|
||||
tags = [
|
||||
"rating:s"
|
||||
"score:>=50"
|
||||
"width:>=1500"
|
||||
];
|
||||
logging = {
|
||||
file = "INFO";
|
||||
console = "DEBUG";
|
||||
};
|
||||
};
|
||||
in {
|
||||
home.file."Library/Application Support/konawall/config.toml".source = (pkgs.formats.toml {}).generate "konawall-config" konawallConfig;
|
||||
|
||||
launchd.agents.konawall = {
|
||||
enable = true;
|
||||
config = let
|
||||
replacementPyProject = ''
|
||||
[tool.poetry]
|
||||
name = "konawall"
|
||||
version = "0.1.0"
|
||||
license = "MIT"
|
||||
description = "A hopefully cross-platform service for fetching wallpapers and setting them"
|
||||
authors = [
|
||||
"Kat Inskip <kat@inskip.me>"
|
||||
]
|
||||
readme = "README.MD"
|
||||
packages = [
|
||||
{include = "konawall"}
|
||||
]
|
||||
|
||||
[tool.poetry.scripts]
|
||||
gui = "konawall.gui:main"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
pillow = "^10.0.1"
|
||||
screeninfo = "^0.8.1"
|
||||
requests = "^2.31.0"
|
||||
termcolor = "^2.3.0"
|
||||
wxpython = "^4.2.1"
|
||||
humanfriendly = "^10.0"
|
||||
xdg-base-dirs = "^6.0.1"
|
||||
|
||||
[build-system]
|
||||
requires = [ "poetry-core" ]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
'';
|
||||
konawallInitialize = pkgs.writeScriptBin "konawall-initialize" ''
|
||||
#!/usr/bin/env bash
|
||||
set -xeuo pipefail
|
||||
# get a temporary directory
|
||||
tmpDir=$(mktemp -d)
|
||||
# copy the repository to the temporary directory recursively without keeping the permissions from the nix store
|
||||
${pkgs.coreutils}/bin/cp -r --no-preserve=mode,ownership "${inputs.konawall-py.outPath}" "$tmpDir/konawall"
|
||||
# change directory to the copy
|
||||
cd $tmpDir/konawall
|
||||
# overwrite the pyproject.toml with the one that we want
|
||||
# use a EOF heredoc to avoid escaping the quotes
|
||||
cat <<EOF > pyproject.toml
|
||||
${replacementPyProject}
|
||||
EOF
|
||||
# install the dependencies
|
||||
${pkgs.poetry}/bin/poetry lock --no-update
|
||||
${pkgs.poetry}/bin/poetry install
|
||||
# run the package
|
||||
${pkgs.poetry}/bin/poetry run gui
|
||||
'';
|
||||
in {
|
||||
# yeah if https://github.com/NixOS/nixpkgs/issues/233265 and https://github.com/NixOS/nixpkgs/issues/101360
|
||||
# and https://github.com/NixOS/nixpkgs/issues/105156 were ok we might be able to do this
|
||||
#Program = "${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall";
|
||||
#ProgramArguments = ["${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall"];
|
||||
# it's unfortunate that this has to be done this way, for the most part.
|
||||
ProgramArguments = [
|
||||
"/usr/bin/env"
|
||||
"bash"
|
||||
"${konawallInitialize}/bin/konawall-initialize"
|
||||
];
|
||||
RunAtLoad = true;
|
||||
KeepAlive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
32
home/environments/gnome/dconf.nix
Normal file
32
home/environments/gnome/dconf.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
_: {
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"org/gnome/shell" = {
|
||||
favorite-apps = [
|
||||
"brave-browser.desktop"
|
||||
"thunderbird.desktop"
|
||||
"nheko.desktop"
|
||||
"discord.desktop"
|
||||
"signal-desktop.desktop"
|
||||
"org.telegram.desktop.desktop"
|
||||
"codium.desktop"
|
||||
"obsidian.desktop"
|
||||
"org.wezfurlong.wezterm.desktop"
|
||||
"spotify.desktop"
|
||||
"steam.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
"bitwarden.desktop"
|
||||
];
|
||||
};
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
enable-hot-corners = false;
|
||||
};
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
workspace-names = ["Main"];
|
||||
resize-with-right-button = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
35
home/environments/gnome/extensions.nix
Normal file
35
home/environments/gnome/extensions.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{pkgs, ...}: {
|
||||
dconf = {
|
||||
settings = {
|
||||
"org/gnome/shell" = {
|
||||
disable-user-extensions = false;
|
||||
|
||||
# `gnome-extensions list` for a list
|
||||
enabled-extensions = [
|
||||
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||
"trayIconsReloaded@selfmade.pl"
|
||||
"Vitals@CoreCoding.com"
|
||||
"dash-to-panel@jderose9.github.com"
|
||||
"space-bar@luchrioh"
|
||||
"date-menu-formatter@marcinjakubowski.github.com"
|
||||
];
|
||||
};
|
||||
"org/gnome/shell/extensions/date-menu-formatter" = {
|
||||
pattern = "y-MM-dd kk:mm XXX";
|
||||
"font-size" = "12";
|
||||
};
|
||||
"org/gnome/shell/extensions/vitals" = {
|
||||
"hot-sensors" = ["_memory_usage_" "_system_load_1m_" "__network-rx_max__" "_temperature_k10temp_tctl_"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs.gnomeExtensions; [
|
||||
space-bar
|
||||
user-themes
|
||||
tray-icons-reloaded
|
||||
vitals
|
||||
dash-to-panel
|
||||
date-menu-formatter
|
||||
];
|
||||
}
|
||||
33
home/environments/gnome/gtk.nix
Normal file
33
home/environments/gnome/gtk.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{pkgs, ...}: {
|
||||
gtk = {
|
||||
enable = true;
|
||||
iconTheme = {
|
||||
name = "Papirus-Dark";
|
||||
package = pkgs.papirus-icon-theme;
|
||||
};
|
||||
|
||||
theme = {
|
||||
name = "palenight";
|
||||
package = pkgs.palenight-theme;
|
||||
};
|
||||
|
||||
cursorTheme = {
|
||||
name = "Numix-Cursor";
|
||||
package = pkgs.numix-cursor-theme;
|
||||
};
|
||||
|
||||
gtk3.extraConfig = {
|
||||
Settings = ''
|
||||
gtk-application-prefer-dark-theme=1
|
||||
'';
|
||||
};
|
||||
|
||||
gtk4.extraConfig = {
|
||||
Settings = ''
|
||||
gtk-application-prefer-dark-theme=1
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables.GTK_THEME = "palenight";
|
||||
}
|
||||
15
home/environments/gnome/ssh.nix
Normal file
15
home/environments/gnome/ssh.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.strings) fileContents;
|
||||
in {
|
||||
home.sessionVariables.GSM_SKIP_SSH_AGENT_WORKAROUND = "1";
|
||||
|
||||
# Disable gnome-keyring ssh-agent
|
||||
xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = ''
|
||||
${fileContents "${pkgs.gnome3.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop"}
|
||||
Hidden=true
|
||||
'';
|
||||
}
|
||||
33
home/environments/kde/gtk.nix
Normal file
33
home/environments/kde/gtk.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{pkgs, ...}: {
|
||||
gtk = {
|
||||
enable = true;
|
||||
iconTheme = {
|
||||
name = "Papirus";
|
||||
package = pkgs.papirus-icon-theme;
|
||||
};
|
||||
|
||||
theme = {
|
||||
name = "Arc";
|
||||
package = pkgs.arc-theme;
|
||||
};
|
||||
|
||||
cursorTheme = {
|
||||
name = "Numix-Cursor";
|
||||
package = pkgs.numix-cursor-theme;
|
||||
};
|
||||
|
||||
gtk3.extraConfig = {
|
||||
Settings = ''
|
||||
gtk-application-prefer-dark-theme=1
|
||||
'';
|
||||
};
|
||||
|
||||
gtk4.extraConfig = {
|
||||
Settings = ''
|
||||
gtk-application-prefer-dark-theme=1
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables.GTK_THEME = "Arc";
|
||||
}
|
||||
16
home/environments/kde/kde.nix
Normal file
16
home/environments/kde/kde.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
_: {
|
||||
programs.plasma = {
|
||||
configFile = {
|
||||
"kded5rc"."PlasmaBrowserIntegration"."shownCount" = 1;
|
||||
"kdeglobals"."WM"."activeBackground" = "231,232,235";
|
||||
"kdeglobals"."WM"."activeBlend" = "231,232,235";
|
||||
"kdeglobals"."WM"."activeForeground" = "92,97,108";
|
||||
"kdeglobals"."WM"."inactiveBackground" = "231,232,235";
|
||||
"kdeglobals"."WM"."inactiveBlend" = "231,232,235";
|
||||
"kdeglobals"."WM"."inactiveForeground" = "163,165,172";
|
||||
"kxkbrc"."Layout"."Options" = "terminate:ctrl_alt_bksp,ctrl:nocaps";
|
||||
"kxkbrc"."Layout"."ResetOldOptions" = true;
|
||||
"plasmarc"."Theme"."name" = "Arc";
|
||||
};
|
||||
};
|
||||
}
|
||||
17
home/environments/kde/konawall.nix
Normal file
17
home/environments/kde/konawall.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
desktop_entry = ''
|
||||
[Desktop Entry]
|
||||
Exec=${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall
|
||||
Icon=
|
||||
Name=konawall
|
||||
Path=
|
||||
Terminal=False
|
||||
Type=Application
|
||||
'';
|
||||
in {
|
||||
xdg.configFile."autostart/konawall.desktop".text = desktop_entry;
|
||||
}
|
||||
10
home/environments/kde/qt.nix
Normal file
10
home/environments/kde/qt.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{pkgs, ...}: {
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "kde";
|
||||
style = {
|
||||
name = "arc";
|
||||
package = pkgs.arc-kde-theme;
|
||||
};
|
||||
};
|
||||
}
|
||||
8
home/environments/sway/barrier.nix
Normal file
8
home/environments/sway/barrier.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
_: {
|
||||
services.barrier.client = {
|
||||
enable = true;
|
||||
enableCrypto = true;
|
||||
enableDragDrop = true;
|
||||
server = "10.1.1.153";
|
||||
};
|
||||
}
|
||||
21
home/environments/sway/gtk.nix
Normal file
21
home/environments/sway/gtk.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
gnome.adwaita-icon-theme
|
||||
];
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "Iosevka";
|
||||
size = 9;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "Maia";
|
||||
package = pkgs.maia-icon-theme;
|
||||
};
|
||||
theme = {
|
||||
name = "Adapta";
|
||||
package = pkgs.adapta-gtk-theme;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home/environments/sway/layout.xkb
Normal file
7
home/environments/sway/layout.xkb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
default partial alphanumeric_keys
|
||||
xkb_symbols "basic" {
|
||||
include "us(altgr-intl)"
|
||||
name[Group1] = "English (US, international with pound sign)";
|
||||
key <AD03> { [ e, E, EuroSign, cent ] };
|
||||
key <AE03> { [ 3, numbersign, sterling] };
|
||||
};
|
||||
30
home/environments/sway/mako.nix
Normal file
30
home/environments/sway/mako.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.base16) palette;
|
||||
in {
|
||||
systemd.user.services = {
|
||||
mako = {
|
||||
Unit = {
|
||||
Description = "mako";
|
||||
X-Restart-Triggers = [(toString config.xdg.configFile."mako/config".source)];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.mako}/bin/mako";
|
||||
Restart = "always";
|
||||
};
|
||||
Install = {WantedBy = ["graphical-session.target"];};
|
||||
};
|
||||
};
|
||||
|
||||
services.mako = {
|
||||
enable = true;
|
||||
font = "Iosevka 10";
|
||||
defaultTimeout = 3000;
|
||||
borderColor = palette.base08;
|
||||
backgroundColor = "${palette.base00}BF";
|
||||
textColor = palette.base05;
|
||||
};
|
||||
}
|
||||
337
home/environments/sway/sway.nix
Normal file
337
home/environments/sway/sway.nix
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) list;
|
||||
inherit (lib.modules) mkMerge;
|
||||
in {
|
||||
programs.zsh.profileExtra = ''
|
||||
# If running from tty1 start sway
|
||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||
systemctl --user unset-environment \
|
||||
SWAYSOCK \
|
||||
I3SOCK \
|
||||
WAYLAND_DISPLAY \
|
||||
DISPLAY \
|
||||
IN_NIX_SHELL \
|
||||
__HM_SESS_VARS_SOURCED \
|
||||
GPG_TTY \
|
||||
NIX_PATH \
|
||||
SHLVL
|
||||
exec env --unset=SHLVL systemd-cat -t sway -- sway
|
||||
fi
|
||||
'';
|
||||
|
||||
home = {
|
||||
sessionVariables = {
|
||||
XDG_CURRENT_DESKTOP = "Unity";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
WLR_DRM_DEVICES = "/dev/dri/card0";
|
||||
};
|
||||
packages = with pkgs; [
|
||||
grim
|
||||
slurp
|
||||
swaylock-fancy
|
||||
wl-clipboard
|
||||
jq
|
||||
quintom-cursor-theme
|
||||
gsettings-desktop-schemas
|
||||
glib
|
||||
wofi
|
||||
wmctrl
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
i3gopher.enable = true;
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = let
|
||||
cfg = config.wayland.windowManager.sway.config;
|
||||
in {
|
||||
enable = true;
|
||||
config = let
|
||||
super = "Mod4";
|
||||
alt = "Mod1";
|
||||
actionMode = "(l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown";
|
||||
gapsMode = "Gaps: (o) outer, (i) inner";
|
||||
gapsOuterMode = "Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)";
|
||||
gapsInnerMode = "Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)";
|
||||
lockCommand = "${pkgs.swaylock}/bin/swaylock";
|
||||
in {
|
||||
bars = [];
|
||||
|
||||
modes = let
|
||||
defaultPath = {
|
||||
"Return" = "mode default";
|
||||
"Escape" = "mode default";
|
||||
"${cfg.modifier}+z" = "mode default";
|
||||
};
|
||||
in {
|
||||
${gapsOuterMode} =
|
||||
defaultPath
|
||||
// {
|
||||
"equal" = "gaps outer current plus 5";
|
||||
"minus" = "gaps outer current minus 5";
|
||||
"0" = "gaps outer current set 0";
|
||||
"plus" = "gaps outer all plus 5";
|
||||
"Shift+minus" = "gaps outer all minus 5";
|
||||
"Shift+0" = "gaps outer all set 0";
|
||||
};
|
||||
${gapsInnerMode} =
|
||||
defaultPath
|
||||
// {
|
||||
"equal" = "gaps inner current plus 5";
|
||||
"minus" = "gaps inner current minus 5";
|
||||
"0" = "gaps inner current set 0";
|
||||
"plus" = "gaps inner all plus 5";
|
||||
"Shift+minus" = "gaps inner all minus 5";
|
||||
"Shift+0" = "gaps inner all set 0";
|
||||
};
|
||||
${gapsMode} =
|
||||
defaultPath
|
||||
// {
|
||||
"o" = "mode ${gapsOuterMode}";
|
||||
"i" = "mode ${gapsInnerMode}";
|
||||
};
|
||||
${actionMode} =
|
||||
defaultPath
|
||||
// {
|
||||
"l" = "exec ${lockCommand}, mode default";
|
||||
"e" = "exec swaymsg exit, mode default";
|
||||
"s" = "exec systemctl suspend, mode default";
|
||||
"h" = "exec systemctl hibernate, mode default";
|
||||
"r" = "exec systemctl reboot, mode default";
|
||||
"Shift+s" = "exec systemctl shutdown, mode default";
|
||||
};
|
||||
resize =
|
||||
defaultPath
|
||||
// {
|
||||
"a" = "resize shrink width 4 px or 4 ppt";
|
||||
"s" = "resize shrink height 4 px or 4 ppt";
|
||||
"w" = "resize grow height 4 px or 4 ppt";
|
||||
"d" = "resize grow width 4 px or 4 ppt";
|
||||
"Left" = "resize shrink width 4 px or 4 ppt";
|
||||
"Down" = "resize shrink height 4 px or 4 ppt";
|
||||
"Up" = "resize grow height 4 px or 4 ppt";
|
||||
"Right" = "resize grow width 4 px or 4 ppt";
|
||||
};
|
||||
};
|
||||
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "us_gbp_map";
|
||||
xkb_options = "compose:rctrl,ctrl:nocaps";
|
||||
};
|
||||
};
|
||||
|
||||
gaps = {
|
||||
smartBorders = "no_gaps";
|
||||
};
|
||||
|
||||
fonts = {
|
||||
names = ["Iosevka"];
|
||||
style = "Regular";
|
||||
size = 10.0;
|
||||
};
|
||||
|
||||
terminal = "${pkgs.wezterm}/bin/wezterm";
|
||||
modifier = super;
|
||||
|
||||
startup = [
|
||||
];
|
||||
|
||||
window = {
|
||||
border = 1;
|
||||
titlebar = false;
|
||||
hideEdgeBorders = "smart";
|
||||
};
|
||||
|
||||
workspaceAutoBackAndForth = true;
|
||||
|
||||
floating = {
|
||||
border = 1;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
keybindings = let
|
||||
pactl = "${config.home.nixosConfig.hardware.pulseaudio.package or pkgs.pulseaudio}/bin/pactl";
|
||||
bindWorkspace = key: workspace: {
|
||||
"${cfg.modifier}+${key}" = "workspace number ${workspace}";
|
||||
"${cfg.modifier}+shift+${key}" = "move container to workspace number ${workspace}";
|
||||
};
|
||||
workspaceBindings =
|
||||
list.map (v: bindWorkspace v "${v}") (list.map builtins.toString (list.range 1 9))
|
||||
++ [
|
||||
(
|
||||
bindWorkspace "0" "10"
|
||||
)
|
||||
]
|
||||
++ list.imap (i: v: bindWorkspace v "${toString (11 + i)}") (list.map (n: "F${builtins.toString n}") (std.list.range 1 12));
|
||||
in
|
||||
mkMerge ([
|
||||
{
|
||||
# modes
|
||||
"${cfg.modifier}+Shift+g" = ''mode "${gapsMode}"'';
|
||||
"${cfg.modifier}+Delete" = ''mode "${actionMode}"'';
|
||||
|
||||
# focus windows - ESDF
|
||||
"${cfg.modifier}+s" = "focus left";
|
||||
"${cfg.modifier}+d" = "focus down";
|
||||
"${cfg.modifier}+e" = "focus up";
|
||||
"${cfg.modifier}+f" = "focus right";
|
||||
|
||||
# focus windows - arrows
|
||||
"${cfg.modifier}+Left" = "focus left";
|
||||
"${cfg.modifier}+Down" = "focus down";
|
||||
"${cfg.modifier}+Up" = "focus up";
|
||||
"${cfg.modifier}+Right" = "focus right";
|
||||
|
||||
# move window / container - ESDF
|
||||
"${cfg.modifier}+Shift+s" = "move left";
|
||||
"${cfg.modifier}+Shift+d" = "move down";
|
||||
"${cfg.modifier}+Shift+e" = "move up";
|
||||
"${cfg.modifier}+Shift+f" = "move right";
|
||||
|
||||
# move window / container - arrows
|
||||
"${cfg.modifier}+Shift+Left" = "move left";
|
||||
"${cfg.modifier}+Shift+Down" = "move down";
|
||||
"${cfg.modifier}+Shift+Up" = "move up";
|
||||
"${cfg.modifier}+Shift+Right" = "move right";
|
||||
|
||||
# focus output - ESDF
|
||||
"${cfg.modifier}+control+s" = "focus output left";
|
||||
"${cfg.modifier}+control+d" = "focus output down";
|
||||
"${cfg.modifier}+control+e" = "focus output up";
|
||||
"${cfg.modifier}+control+f" = "focus output right";
|
||||
|
||||
# focus output - arrows
|
||||
"${cfg.modifier}+control+Left" = "focus output left";
|
||||
"${cfg.modifier}+control+Down" = "focus output down";
|
||||
"${cfg.modifier}+control+Up" = "focus output up";
|
||||
"${cfg.modifier}+control+Right" = "focus output right";
|
||||
|
||||
# move container to output - ESDF
|
||||
"${cfg.modifier}+control+Shift+s" = "move container to output left";
|
||||
"${cfg.modifier}+control+Shift+d" = "move container to output down";
|
||||
"${cfg.modifier}+control+Shift+e" = "move container to output up";
|
||||
"${cfg.modifier}+control+Shift+f" = "move container to output right";
|
||||
|
||||
# move container to output - arrows
|
||||
"${cfg.modifier}+control+Shift+Left" = "move container to output left";
|
||||
"${cfg.modifier}+control+Shift+Down" = "move container to output down";
|
||||
"${cfg.modifier}+control+Shift+Up" = "move container to output up";
|
||||
"${cfg.modifier}+control+Shift+Right" = "move container to output right";
|
||||
|
||||
# move workspace to output - ESDF
|
||||
"${cfg.modifier}+control+Shift+Mod1+s" = "move workspace to output left";
|
||||
"${cfg.modifier}+control+Shift+Mod1+d" = "move workspace to output down";
|
||||
"${cfg.modifier}+control+Shift+Mod1+e" = "move workspace to output up";
|
||||
"${cfg.modifier}+control+Shift+Mod1+f" = "move workspace to output right";
|
||||
|
||||
# move workspace to output - arrows
|
||||
"${cfg.modifier}+control+Shift+Mod1+Left" = "move workspace to output left";
|
||||
"${cfg.modifier}+control+Shift+Mod1+Down" = "move workspace to output down";
|
||||
"${cfg.modifier}+control+Shift+Mod1+Up" = "move workspace to output up";
|
||||
"${cfg.modifier}+control+Shift+Mod1+Right" = "move workspace to output right";
|
||||
|
||||
# process management - q
|
||||
"${cfg.modifier}+q" = "exec ${cfg.menu}";
|
||||
"${cfg.modifier}+Shift+q" = "kill";
|
||||
"${cfg.modifier}+control+q" = "exec ${cfg.terminal}";
|
||||
|
||||
# focus parent/child - w
|
||||
"${cfg.modifier}+w" = "focus parent";
|
||||
"${cfg.modifier}+Shift+w" = "focus child";
|
||||
# unused control
|
||||
|
||||
# split management - a
|
||||
"${cfg.modifier}+a" = "splith";
|
||||
"${cfg.modifier}+Shift+a" = "splitv";
|
||||
"${cfg.modifier}+control+A" = "layout toggle split";
|
||||
|
||||
# resizing, reloading - r
|
||||
# unused base
|
||||
"${cfg.modifier}+Shift+r" = "mode resize";
|
||||
"${cfg.modifier}+control+r" = "reload";
|
||||
|
||||
# layout handling - t
|
||||
"${cfg.modifier}+t" = "layout tabbed";
|
||||
"${cfg.modifier}+Shift+t" = "layout stacking";
|
||||
"${cfg.modifier}+control+t" = "fullscreen toggle";
|
||||
|
||||
# locking - l
|
||||
"${cfg.modifier}+l" = "exec ${lockCommand}";
|
||||
# unused shift
|
||||
# unused control
|
||||
"control+${alt}+Delete" = "exec ${lockCommand}";
|
||||
|
||||
# floating - p
|
||||
"${cfg.modifier}+p" = "focus mode_toggle";
|
||||
"${cfg.modifier}+Shift+p" = "floating toggle";
|
||||
# unused control
|
||||
|
||||
# workspace history switching - tab
|
||||
"${cfg.modifier}+Tab" = "workspace back_and_forth";
|
||||
"${cfg.modifier}+Shift+Tab" = "exec ${config.services.i3gopher.focus-last}";
|
||||
# unused control
|
||||
|
||||
# multimedia / laptop
|
||||
"XF86AudioPlay" = "exec --no-startup-id ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
"XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMute+Shift" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86AudioMicMute" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
|
||||
}
|
||||
]
|
||||
++ workspaceBindings);
|
||||
|
||||
colors = let
|
||||
inherit (config.base16) palette;
|
||||
in {
|
||||
focused = {
|
||||
border = palette.base01;
|
||||
background = palette.base0D;
|
||||
text = palette.base07;
|
||||
indicator = palette.base0D;
|
||||
childBorder = palette.base0D;
|
||||
};
|
||||
focusedInactive = {
|
||||
border = palette.base02;
|
||||
background = palette.base04;
|
||||
text = palette.base00;
|
||||
indicator = palette.base04;
|
||||
childBorder = palette.base04;
|
||||
};
|
||||
unfocused = {
|
||||
border = palette.base01;
|
||||
background = palette.base02;
|
||||
text = palette.base06;
|
||||
indicator = palette.base02;
|
||||
childBorder = palette.base02;
|
||||
};
|
||||
urgent = {
|
||||
border = palette.base03;
|
||||
background = palette.base08;
|
||||
text = palette.base00;
|
||||
indicator = palette.base08;
|
||||
childBorder = palette.base08;
|
||||
};
|
||||
};
|
||||
|
||||
seat.seat0.xcursor_theme = ''"Quintom Snow" 20'';
|
||||
};
|
||||
|
||||
wrapperFeatures.gtk = true;
|
||||
|
||||
extraConfig = ''
|
||||
title_align center
|
||||
'';
|
||||
};
|
||||
}
|
||||
95
home/environments/sway/waybar.nix
Normal file
95
home/environments/sway/waybar.nix
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
kittywitch,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
style = let
|
||||
template = kittywitch.sassTemplate {
|
||||
name = "waybar-style";
|
||||
src = ./waybar.sass;
|
||||
};
|
||||
in
|
||||
template.source;
|
||||
systemd.enable = true;
|
||||
settings.main = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 18;
|
||||
|
||||
# Modules Placement
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
"sway/window"
|
||||
];
|
||||
modules-center = [
|
||||
"custom/clock"
|
||||
"mpris"
|
||||
];
|
||||
modules-right = [
|
||||
"network"
|
||||
"temperature"
|
||||
"idle_inhibitor"
|
||||
"tray"
|
||||
];
|
||||
|
||||
# Modules Definition
|
||||
"sway/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
# https://fontawesome.com/v5/cheatsheet
|
||||
"1" = ""; # chats
|
||||
"2" = ""; # cloud (browser)
|
||||
"3" = ""; # music
|
||||
"4" = ""; # brain
|
||||
"5" = ""; # terminal >_
|
||||
};
|
||||
};
|
||||
"sway/window" = {
|
||||
format = "{}";
|
||||
};
|
||||
tray = {
|
||||
show-passive-items = true;
|
||||
icon-size = 12;
|
||||
spacing = 2;
|
||||
};
|
||||
mpris = {
|
||||
format = "{player_icon} {dynamic}";
|
||||
format-paused = "{status_icon} {dynamic}";
|
||||
player-icons = {
|
||||
default = "";
|
||||
brave = "";
|
||||
mpv = "";
|
||||
spotify = "";
|
||||
};
|
||||
status-icons = {
|
||||
paused = "";
|
||||
};
|
||||
};
|
||||
temperature = {
|
||||
format = " {temperatureC}°C";
|
||||
critical-threshold = 80;
|
||||
};
|
||||
idle_inhibitor = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = "";
|
||||
deactivated = "";
|
||||
};
|
||||
};
|
||||
network = {
|
||||
format-wifi = " {essid} ({signalStrength}%)";
|
||||
format-ethernet = " {ipaddr}/{cidr}";
|
||||
format-linked = " No IP";
|
||||
format-disconnected = " Disconnected";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
"custom/clock" = {
|
||||
exec = ''${pkgs.coreutils}/bin/date +"%a, %F %T %Z"'';
|
||||
interval = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
84
home/environments/sway/waybar.sass
Normal file
84
home/environments/sway/waybar.sass
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
*
|
||||
padding: 0
|
||||
margin: 0
|
||||
border: none
|
||||
border-radius: 0
|
||||
background: none
|
||||
font-family: "Iosevka", "Font Awesome 6 Free", "Font Awesome 6 Brands"
|
||||
font-size: $font_size
|
||||
text-shadow: none
|
||||
box-shadow: none
|
||||
|
||||
%widget_unpadded
|
||||
transition: none
|
||||
background: $base01
|
||||
color: $base07
|
||||
margin: 0 4px
|
||||
|
||||
%widget
|
||||
@extend %widget_unpadded
|
||||
padding: 0 4px
|
||||
|
||||
window#waybar
|
||||
background: rgba($base00, 0.9)
|
||||
border-bottom: 2px solid transparent
|
||||
|
||||
// sway/workspaces
|
||||
#workspaces
|
||||
@extend %widget_unpadded
|
||||
button
|
||||
color: $base06
|
||||
&.focused
|
||||
color: $base07
|
||||
background: $base0D
|
||||
|
||||
&:hover
|
||||
transition: none
|
||||
box-shadow: inherit
|
||||
text-shadow: inherit
|
||||
background: $base06
|
||||
color: $base0C
|
||||
|
||||
|
||||
// widgets
|
||||
#mode, window#waybar #window,
|
||||
#custom-clock, #mpris,
|
||||
#pulseaudio, #backlight, #network, #temperature, #battery, #idle_inhibitor, #tray, #tray menu
|
||||
@extend %widget
|
||||
|
||||
// hide when empty
|
||||
window#waybar.empty #window
|
||||
opacity: 0
|
||||
|
||||
|
||||
// tooltips
|
||||
tooltip
|
||||
background: rgba($base00, 0.9)
|
||||
label
|
||||
color: $base07
|
||||
|
||||
// mpris player and state
|
||||
#mpris
|
||||
&.spotify
|
||||
background: #191414
|
||||
color: #1DB954
|
||||
|
||||
&.paused
|
||||
background: $base01
|
||||
color: $base03
|
||||
|
||||
/*.modules-left
|
||||
#window
|
||||
widget
|
||||
label
|
||||
margin: 0
|
||||
|
||||
&:first-child
|
||||
margin-left: 0
|
||||
|
||||
&:last-child
|
||||
margin-right: 0*/
|
||||
|
||||
.modules-center
|
||||
|
||||
.modules-right
|
||||
20
home/environments/sway/wofi.nix
Normal file
20
home/environments/sway/wofi.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{kittywitch, ...}: {
|
||||
programs.wofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
style = let
|
||||
template = kittywitch.sassTemplate {
|
||||
name = "wofi-style";
|
||||
src = ./wofi.sass;
|
||||
};
|
||||
in
|
||||
template.source;
|
||||
insensitive = true;
|
||||
allow_images = true;
|
||||
hide_scroll = true;
|
||||
width = "25%";
|
||||
mode = "dmenu";
|
||||
prompt = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
26
home/environments/sway/wofi.sass
Normal file
26
home/environments/sway/wofi.sass
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#scroll
|
||||
background: $base01
|
||||
border: 1px solid $base03
|
||||
|
||||
#input
|
||||
background: $base01
|
||||
border: 1px solid $base0C
|
||||
margin: 1em
|
||||
background: $base02
|
||||
color: $base04
|
||||
|
||||
window
|
||||
font-family: $font
|
||||
background: rgba($base00, .9)
|
||||
border-radius: 1em
|
||||
font-size: $font_size
|
||||
color: $base07
|
||||
|
||||
#outer-box
|
||||
margin: 1em
|
||||
|
||||
#entry
|
||||
border-bottom: 1px dashed $base04
|
||||
padding: .75em
|
||||
&:selected
|
||||
background-color: $base0D
|
||||
16
home/environments/sway/xdg.nix
Normal file
16
home/environments/sway/xdg.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
_: {
|
||||
xdg = {
|
||||
enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
pictures = "$HOME/pictures";
|
||||
videos = "$HOME/videos";
|
||||
documents = "$HOME/docs";
|
||||
download = "$HOME/downloads";
|
||||
desktop = "$HOME/desktop";
|
||||
templates = "$HOME/templates";
|
||||
publicShare = "$HOME/shared";
|
||||
music = "$HOME/music";
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home/environments/sway/xkb.nix
Normal file
7
home/environments/sway/xkb.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
_: {
|
||||
home.file = {
|
||||
".xkb/symbols/us_gbp_map".source = ./layout.xkb;
|
||||
};
|
||||
|
||||
home.keyboard = null;
|
||||
}
|
||||
19
home/profiles/common/base16.nix
Normal file
19
home/profiles/common/base16.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkMerge;
|
||||
in {
|
||||
base16 = {
|
||||
vim.enable = false;
|
||||
shell.enable = true;
|
||||
schemes = mkMerge [
|
||||
{
|
||||
light = "atelier.atelier-cave-light";
|
||||
dark = "atelier.atelier-cave";
|
||||
}
|
||||
{
|
||||
dark.ansi.palette.background.alpha = "ee00";
|
||||
light.ansi.palette.background.alpha = "d000";
|
||||
}
|
||||
];
|
||||
defaultSchemeName = "light";
|
||||
};
|
||||
}
|
||||
7
home/profiles/common/docs.nix
Normal file
7
home/profiles/common/docs.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
_: {
|
||||
manual = {
|
||||
html.enable = false;
|
||||
json.enable = false;
|
||||
manpages.enable = false;
|
||||
};
|
||||
}
|
||||
6
home/profiles/common/profile-inheritance.nix
Normal file
6
home/profiles/common/profile-inheritance.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{tree, ...}: {
|
||||
imports = with tree.home.profiles; [
|
||||
shell
|
||||
neovim
|
||||
];
|
||||
}
|
||||
25
home/profiles/devops/packages.nix
Normal file
25
home/profiles/devops/packages.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
# IAC
|
||||
|
||||
terraform # iac tool
|
||||
|
||||
# Kubernetes
|
||||
|
||||
kubectl # kubectl
|
||||
k9s # cute k8s client, canines~
|
||||
kubernetes-helm # k8s package manager
|
||||
|
||||
# AWS
|
||||
|
||||
awscli2 # awscli v2
|
||||
|
||||
# Nix
|
||||
|
||||
deadnix # nix dead-code scanner
|
||||
alejandra # nix code formatter
|
||||
statix # nix anti-pattern finder
|
||||
rnix-lsp # vscode nix extensions
|
||||
deploy-rs.deploy-rs # deployment system
|
||||
];
|
||||
}
|
||||
19
home/profiles/graphical/gpg.nix
Normal file
19
home/profiles/graphical/gpg.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkDefault mkMerge;
|
||||
in {
|
||||
services.gpg-agent = {
|
||||
enable = mkDefault true;
|
||||
enableExtraSocket = true;
|
||||
enableSshSupport = true;
|
||||
sshKeys = [
|
||||
"59921D2F4E6DF7EEC3CB2934BD3D53666007B1AB" # kat@inskip.me
|
||||
];
|
||||
extraConfig = mkMerge [
|
||||
"auto-expand-secmem 0x30000" # otherwise "gpg: public key decryption failed: Cannot allocate memory"
|
||||
"pinentry-timeout 30"
|
||||
"allow-loopback-pinentry"
|
||||
"enable-ssh-support"
|
||||
"no-allow-external-cache"
|
||||
];
|
||||
};
|
||||
}
|
||||
43
home/profiles/graphical/packages.nix
Normal file
43
home/profiles/graphical/packages.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{pkgs, ...}: {
|
||||
config = {
|
||||
home.packages = with pkgs; [
|
||||
# Password manager
|
||||
bitwarden
|
||||
|
||||
# Task managers
|
||||
btop
|
||||
htop
|
||||
|
||||
# Mail
|
||||
thunderbird
|
||||
|
||||
# Music
|
||||
spotify
|
||||
|
||||
# Chat
|
||||
discord
|
||||
nheko # Matrix
|
||||
tdesktop # Telegram
|
||||
dino # XMPP
|
||||
signal-desktop
|
||||
|
||||
# Exocortex
|
||||
obsidian
|
||||
|
||||
# Archivery
|
||||
unzip
|
||||
zip
|
||||
p7zip
|
||||
|
||||
# Misc
|
||||
gimp-with-plugins # GIMP
|
||||
exiftool # EXIF Stripping
|
||||
lm_sensors # Sensor Data
|
||||
cryptsetup # Encrypted block devices
|
||||
yubikey-manager # Yubikey
|
||||
imv # Image viewer
|
||||
yt-dlp # Downloading media
|
||||
v4l-utils # Webcam
|
||||
];
|
||||
};
|
||||
}
|
||||
50
home/profiles/graphical/vscode.nix
Normal file
50
home/profiles/graphical/vscode.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{pkgs, ...}: {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
kamadorueda.alejandra
|
||||
mkhl.direnv
|
||||
mhutchie.git-graph
|
||||
golang.go
|
||||
hashicorp.terraform
|
||||
arrterian.nix-env-selector
|
||||
jnoortheen.nix-ide
|
||||
vscodevim.vim
|
||||
catppuccin.catppuccin-vsc
|
||||
github.copilot
|
||||
];
|
||||
userSettings = {
|
||||
"nix.enableLanguageServer" = true;
|
||||
"workbench.colorTheme" = "Default Light Modern";
|
||||
"editor.suggest.preview" = true;
|
||||
"[nix]" = {
|
||||
"editor.defaultFormatter" = "kamadorueda.alejandra";
|
||||
"editor.formatOnPaste" = true;
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.formatOnType" = false;
|
||||
};
|
||||
"files.eol" = "\n";
|
||||
"alejandra.program" = "${pkgs.alejandra}/bin/alejandra";
|
||||
"editor.fontFamily" = ''"Iosevka", "Font Awesome 6 Free", "Font Awesome 6 Brands"'';
|
||||
"editor.fontLigatures" = true;
|
||||
"terraform.experimentalFeatures.prefillRequiredFields" = true;
|
||||
"terraform.experimentalFeatures.validateOnSave" = true;
|
||||
"terraform.codelens.referenceCount" = true;
|
||||
"go.alternateTools" = {
|
||||
gopls = "${pkgs.gopls}/bin/gopls";
|
||||
};
|
||||
"vim.useSystemClipboard" = true;
|
||||
go = {
|
||||
inlayHints = {
|
||||
assignVariableTypes = true;
|
||||
compositeLiteralFields = true;
|
||||
compositeLiteralTypes = true;
|
||||
constantValues = true;
|
||||
functionTypeParameters = true;
|
||||
parameterNames = true;
|
||||
rangeVariableTypes = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
15
home/profiles/graphical/wezterm.nix
Normal file
15
home/profiles/graphical/wezterm.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
_: {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
local wezterm = require 'wezterm';
|
||||
return {
|
||||
font = wezterm.font "Iosevka",
|
||||
font_size = 11.0,
|
||||
check_for_updates = false,
|
||||
show_update_window = false,
|
||||
enable_tab_bar = true
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
94
home/profiles/neovim/default.nix
Normal file
94
home/profiles/neovim/default.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
std,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (std) string set;
|
||||
initLua = pkgs.substituteAll ({
|
||||
name = "init.lua";
|
||||
src = ./init.lua;
|
||||
base16ShellPath = config.base16.shell.package;
|
||||
inherit (config.base16) defaultSchemeName;
|
||||
defaultSchemeSlug = config.base16.defaultScheme.slug;
|
||||
}
|
||||
// set.map (_: col: string.justifyRight 2 "0" (builtins.toString col.ansiIndex))
|
||||
(set.filter (var: _: string.hasInfix "base" var) config.base16.defaultScheme));
|
||||
in {
|
||||
home.sessionVariables = mkIf config.programs.neovim.enable {EDITOR = "nvim";};
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# Base16 manual
|
||||
config.base16.vim.plugin
|
||||
# Libraries
|
||||
plenary-nvim
|
||||
# Disables and re-enables highlighting when searching
|
||||
vim-cool
|
||||
# Colour highlighting
|
||||
vim-hexokinase
|
||||
# Git porcelain
|
||||
vim-fugitive
|
||||
# Start screen
|
||||
vim-startify
|
||||
# Re-open with cursor at the same place
|
||||
vim-lastplace
|
||||
# Status Bar
|
||||
lualine-nvim
|
||||
# EasyMotion Equivalent
|
||||
hop-nvim
|
||||
# org-mode for vim
|
||||
# neorg
|
||||
# base16
|
||||
config.base16.vim.plugin
|
||||
# Fonts
|
||||
nvim-web-devicons
|
||||
# Completion
|
||||
nvim-cmp
|
||||
# Fuzzy Finder
|
||||
telescope-nvim
|
||||
# Buffers
|
||||
bufferline-nvim
|
||||
# Language Server
|
||||
nvim-lspconfig
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_:
|
||||
with pkgs.tree-sitter-grammars; [
|
||||
tree-sitter-c
|
||||
tree-sitter-lua
|
||||
tree-sitter-rust
|
||||
#tree-sitter-bash
|
||||
tree-sitter-css
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-go
|
||||
tree-sitter-hcl
|
||||
tree-sitter-html
|
||||
tree-sitter-javascript
|
||||
tree-sitter-markdown
|
||||
tree-sitter-nix
|
||||
tree-sitter-norg
|
||||
tree-sitter-python
|
||||
tree-sitter-regex
|
||||
tree-sitter-scss
|
||||
]))
|
||||
# Treesitter Plugins
|
||||
nvim-ts-rainbow
|
||||
nvim-treesitter-context
|
||||
twilight-nvim
|
||||
];
|
||||
extraPackages = with pkgs; [
|
||||
# For nvim-lspconfig, Terraform Language Server
|
||||
terraform-ls
|
||||
# For tree-sitter
|
||||
tree-sitter
|
||||
nodejs
|
||||
clang
|
||||
clangStdenv.cc
|
||||
];
|
||||
};
|
||||
xdg.configFile."nvim/init.lua".source = initLua;
|
||||
}
|
||||
340
home/profiles/neovim/init.lua
Normal file
340
home/profiles/neovim/init.lua
Normal file
|
|
@ -0,0 +1,340 @@
|
|||
-----------------------------------------------------------
|
||||
-- Variables
|
||||
-----------------------------------------------------------
|
||||
local g = vim.g -- Global variables
|
||||
local opt = vim.opt -- Set options (global/buffer/windows-scoped)
|
||||
local wo = vim.wo -- Window local variables
|
||||
local api = vim.api -- Lua API
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Base16
|
||||
-----------------------------------------------------------
|
||||
vim.g.base16colorspace = 256
|
||||
vim.g.base16background = "@defaultSchemeName@"
|
||||
g.base16_shell_path = "@base16ShellPath@"
|
||||
vim.cmd("colorscheme base16-@defaultSchemeSlug@")
|
||||
g.colors_name = "@defaultSchemeSlug@"
|
||||
|
||||
local base16 = {
|
||||
base00 = "@base00@",
|
||||
base01 = "@base01@",
|
||||
base02 = "@base02@",
|
||||
base03 = "@base03@",
|
||||
base04 = "@base04@",
|
||||
base05 = "@base05@",
|
||||
base06 = "@base06@",
|
||||
base07 = "@base07@",
|
||||
base08 = "@base08@",
|
||||
base09 = "@base09@",
|
||||
base0A = "@base0A@",
|
||||
base0B = "@base0B@",
|
||||
base0C = "@base0C@",
|
||||
base0D = "@base0D@",
|
||||
base0E = "@base0E@",
|
||||
base0F = "@base0F@"
|
||||
}
|
||||
|
||||
api.nvim_create_autocmd("vimenter", {
|
||||
command = "highlight Normal guibg=NONE ctermbg=NONE"
|
||||
})
|
||||
api.nvim_create_autocmd("SourcePost", {
|
||||
command = "highlight Normal ctermbg=NONE guibg=NONE | " ..
|
||||
"highlight LineNr ctermbg=NONE guibg=NONE | " ..
|
||||
"highlight SignColumn ctermbg=NONE guibg=NONE"
|
||||
})
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- General
|
||||
-----------------------------------------------------------
|
||||
opt.mouse = 'a' -- Enable mouse support
|
||||
opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard
|
||||
opt.completeopt = 'longest,menuone' -- Autocomplete options
|
||||
opt.backup = false -- Disable backup
|
||||
opt.writebackup = false -- Disable backup
|
||||
opt.ttimeoutlen = 100 -- Mapping timeout
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Neovim UI
|
||||
-----------------------------------------------------------
|
||||
opt.number = true -- Show line number
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.showmatch = true -- Highlight matching parenthesis
|
||||
opt.foldmethod = 'marker' -- Enable folding (default 'foldmarker')
|
||||
opt.colorcolumn = '80' -- Line length marker at 80 columns
|
||||
opt.splitright = true -- Vertical split to the right
|
||||
opt.splitbelow = true -- Horizontal split to the bottom
|
||||
opt.ignorecase = true -- Ignore case letters when search
|
||||
opt.smartcase = true -- Ignore lowercase for the whole pattern
|
||||
opt.wrap = true -- Wrap on word boundary
|
||||
opt.linebreak = true -- Wrap on word boundary
|
||||
opt.showbreak = " ↳" -- Character to use to display word boundary
|
||||
opt.termguicolors = false -- Enable 24-bit RGB colors
|
||||
opt.laststatus = 3 -- Set global statusline
|
||||
opt.cursorline = true -- Highlight cursor screenline
|
||||
opt.cmdheight = 1 -- Command entry line height
|
||||
opt.hlsearch = true -- Highlight matches with last search pattern
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Tabs, indent
|
||||
-----------------------------------------------------------
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.shiftwidth = 2 -- Shift 2 spaces when tab
|
||||
opt.tabstop = 2 -- 1 tab == 2 spaces
|
||||
opt.smartindent = true -- Autoindent new lines
|
||||
opt.list = true -- List chars
|
||||
opt.listchars = {
|
||||
tab = '» ',
|
||||
extends = '›',
|
||||
precedes= '‹',
|
||||
nbsp = '·',
|
||||
trail = '✖'
|
||||
}
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Memory, CPU
|
||||
-----------------------------------------------------------
|
||||
opt.hidden = true -- Enable background buffers
|
||||
opt.history = 1000 -- Remember N lines in history
|
||||
opt.shada = "'1000,f1,<500,@500,/500"
|
||||
opt.lazyredraw = true -- Faster scrolling
|
||||
opt.synmaxcol = 240 -- Max column for syntax highlight
|
||||
opt.updatetime = 700 -- ms to wait for trigger an event
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Plugins
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Remove perl
|
||||
g.loaded_perl_provider = 0
|
||||
|
||||
-- Hexokinaise
|
||||
g.Hexokinase_highlighters = {'virtual'}
|
||||
g.Hexokinase_optInPatterns = {
|
||||
'full_hex',
|
||||
'rgb',
|
||||
'rgba',
|
||||
'hsl',
|
||||
'hsla',
|
||||
'colour_names'
|
||||
}
|
||||
|
||||
-- Lastplace
|
||||
g.lastplace_ignore = 'gitcommit,gitrebase,svn,hgcommit'
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Startup
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Disable builtins plugins
|
||||
local disabled_built_ins = {
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"gzip",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"2html_plugin",
|
||||
"logipat",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"matchit"
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Plugins
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- lualine
|
||||
require('lualine').setup{}
|
||||
|
||||
-- nvim-cmp
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
-- { name = 'neorg' },
|
||||
}
|
||||
})
|
||||
|
||||
-- lspconfig
|
||||
require('lspconfig').terraformls.setup{}
|
||||
|
||||
api.nvim_create_autocmd('BufWritePre', {
|
||||
pattern = '*.tf',
|
||||
command = 'lua vim.lsp.buf.formatting_sync()'
|
||||
})
|
||||
|
||||
--[[
|
||||
-- neorg
|
||||
require('neorg').setup {
|
||||
-- Tell Neorg what modules to load
|
||||
load = {
|
||||
['core.defaults'] = {}, -- Load all the default modules
|
||||
['core.norg.concealer'] = {}, -- Allows for use of icons
|
||||
['core.norg.dirman'] = { -- Manage your directories with Neorg
|
||||
config = {
|
||||
engine = 'nvim-cmp',
|
||||
workspaces = {
|
||||
home = '~/neorg'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}]]--
|
||||
|
||||
-- telescope
|
||||
local telescope = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set("n", "<leader>ff", function()
|
||||
telescope.find_files()
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>fg", function()
|
||||
telescope.live_grep()
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>fb", function()
|
||||
telescope.buffers()
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>fh", function()
|
||||
telescope.help_tags()
|
||||
end, { silent = true })
|
||||
|
||||
-- treesitter
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
},
|
||||
|
||||
sync_install = false,
|
||||
auto_install = false,
|
||||
ignore_install = {},
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true
|
||||
},
|
||||
}
|
||||
|
||||
-- twilight
|
||||
require("twilight").setup {
|
||||
dimming = {
|
||||
alpha = 0.5,
|
||||
},
|
||||
context = 10,
|
||||
expand = {
|
||||
"function",
|
||||
"method",
|
||||
"table",
|
||||
"if_statement",
|
||||
},
|
||||
}
|
||||
|
||||
-- bufferline
|
||||
require('bufferline').setup {
|
||||
options = {
|
||||
mode = "buffers", -- set to "tabs" to only show tabpages instead
|
||||
numbers = "ordinal",
|
||||
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||
indicator = {
|
||||
icon = '▎',
|
||||
style = 'icon',
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
right_trunc_marker = '',
|
||||
name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||
-- remove extension from markdown files for example
|
||||
if buf.name:match('%.md') then
|
||||
return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||
end
|
||||
end,
|
||||
max_name_length = 18,
|
||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||
tab_size = 18,
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
color_icons = true,
|
||||
show_buffer_icons = true, -- disable filetype icons for buffers
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
separator_style = "slant",
|
||||
always_show_bufferline = true,
|
||||
}
|
||||
}
|
||||
|
||||
local barColor = base16.base00;
|
||||
|
||||
local highlightItems = {
|
||||
BufferLineFill = "bg",
|
||||
BufferLineBackground = "bg",
|
||||
BufferLineSeparator = "fg",
|
||||
BufferLineSeparatorSelected = "fg",
|
||||
BufferLineSeparatorVisible = "fg",
|
||||
}
|
||||
|
||||
local commandString = ""
|
||||
|
||||
for item, ground in pairs(highlightItems) do
|
||||
commandString = "highlight " .. item .. " cterm" .. ground .. "=" .. barColor .. " | " .. commandString
|
||||
end
|
||||
|
||||
api.nvim_create_autocmd("ColorScheme", {
|
||||
command = commandString;
|
||||
})
|
||||
|
||||
-- hop
|
||||
local hop = require('hop')
|
||||
local directions = require("hop.hint").HintDirection
|
||||
hop.setup()
|
||||
|
||||
vim.keymap.set("", "t", function()
|
||||
hop.hint_words()
|
||||
end, {})
|
||||
|
||||
vim.keymap.set("", "T", function()
|
||||
hop.hint_lines_skip_whitespace()
|
||||
end, {remap=true})
|
||||
|
||||
vim.keymap.set("", "f", function()
|
||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
||||
end, {remap=true})
|
||||
|
||||
vim.keymap.set("", "F", function()
|
||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
||||
end, {remap=true})
|
||||
16
home/profiles/shell/bitw.nix
Normal file
16
home/profiles/shell/bitw.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
tree,
|
||||
...
|
||||
}: {
|
||||
programs.rbw = {
|
||||
enable = false;
|
||||
package = pkgs.rbw-bitw;
|
||||
settings = {
|
||||
inherit (tree.home.user.data) email;
|
||||
base_url = "https://vault.kittywit.ch";
|
||||
identity_url = null;
|
||||
lock_timeout = 3600;
|
||||
};
|
||||
};
|
||||
}
|
||||
6
home/profiles/shell/direnv.nix
Normal file
6
home/profiles/shell/direnv.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
6
home/profiles/shell/eza.nix
Normal file
6
home/profiles/shell/eza.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableAliases = true;
|
||||
};
|
||||
}
|
||||
16
home/profiles/shell/fzf.nix
Normal file
16
home/profiles/shell/fzf.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) list;
|
||||
in {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
programs.zsh.plugins = list.optional (pkgs.hostPlatform == pkgs.buildPlatform) {
|
||||
name = "fzf-tab";
|
||||
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||
};
|
||||
}
|
||||
31
home/profiles/shell/git.nix
Normal file
31
home/profiles/shell/git.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
tree,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
gitAndTools.git-remote-gcrypt
|
||||
git-crypt
|
||||
git-revise
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
inherit (tree.home.user.data) userName userEmail;
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
init = {defaultBranch = "main";};
|
||||
protocol.gcrypt.allow = "always";
|
||||
merge.conflictstyle = "diff3";
|
||||
annex = {
|
||||
autocommit = false;
|
||||
backend = "BLAKE2B512";
|
||||
synccontent = true;
|
||||
};
|
||||
};
|
||||
signing = {
|
||||
inherit (tree.home.user.data) key;
|
||||
signByDefault = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
home/profiles/shell/inputrc.nix
Normal file
19
home/profiles/shell/inputrc.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{config, ...}: {
|
||||
xdg.configFile."inputrc".text = ''
|
||||
set editing-mode vi
|
||||
set keyseq-timeout 1
|
||||
set mark-symlinked-directories on
|
||||
set completion-prefix-display-length 8
|
||||
set show-all-if-ambiguous on
|
||||
set show-all-if-unmodified on
|
||||
set visible-stats on
|
||||
set colored-stats on
|
||||
set bell-style audible
|
||||
set meta-flag on
|
||||
set input-meta on
|
||||
set convert-meta off
|
||||
set output-meta on
|
||||
'';
|
||||
|
||||
home.sessionVariables.INPUTRC = "${config.xdg.configHome}/inputrc";
|
||||
}
|
||||
18
home/profiles/shell/lc.nix
Normal file
18
home/profiles/shell/lc.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
_: {
|
||||
home.language = let
|
||||
ca = "en_CA.UTF-8";
|
||||
in {
|
||||
base = ca;
|
||||
ctype = ca;
|
||||
time = ca;
|
||||
numeric = ca;
|
||||
collate = ca;
|
||||
monetary = ca;
|
||||
messages = ca;
|
||||
paper = ca;
|
||||
name = ca;
|
||||
address = ca;
|
||||
telephone = ca;
|
||||
measurement = ca;
|
||||
};
|
||||
}
|
||||
34
home/profiles/shell/packages.nix
Normal file
34
home/profiles/shell/packages.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
# task managers
|
||||
htop
|
||||
btop
|
||||
# disk usage
|
||||
duc-cli
|
||||
# nix formatting
|
||||
nixpkgs-fmt
|
||||
# show type of files
|
||||
file
|
||||
# command monitoring
|
||||
pv
|
||||
# cat but better
|
||||
bat
|
||||
# sed replacement
|
||||
sd
|
||||
# sops
|
||||
sops
|
||||
# find replacement
|
||||
fd
|
||||
# ripgrep / grep replacement
|
||||
ripgrep
|
||||
# rename with sed
|
||||
rename
|
||||
# remote tmux
|
||||
tmate
|
||||
# remote utilities
|
||||
socat
|
||||
rsync
|
||||
wget
|
||||
whois
|
||||
];
|
||||
}
|
||||
42
home/profiles/shell/rink.nix
Normal file
42
home/profiles/shell/rink.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) serde;
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
rink
|
||||
];
|
||||
|
||||
xdg.configFile."rink/config.toml".text = serde.toTOML {
|
||||
colors = {
|
||||
enabled = true;
|
||||
theme = "my_theme";
|
||||
};
|
||||
currency = {
|
||||
cache_duration = "1h";
|
||||
enabled = true;
|
||||
endpoint = "https://rinkcalc.app/data/currency.json";
|
||||
timeout = "2s";
|
||||
};
|
||||
rink = {
|
||||
long_output = true;
|
||||
prompt = "> ";
|
||||
};
|
||||
themes = {
|
||||
my_theme = {
|
||||
date_time = "default";
|
||||
doc_string = "italic";
|
||||
error = "red";
|
||||
number = "default";
|
||||
plain = "default";
|
||||
pow = "default";
|
||||
prop_name = "cyan";
|
||||
quantity = "dimmed cyan";
|
||||
unit = "cyan";
|
||||
user_input = "bold";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
home/profiles/shell/ssh.nix
Normal file
9
home/profiles/shell/ssh.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
_: {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
hashKnownHosts = true;
|
||||
compression = true;
|
||||
};
|
||||
}
|
||||
12
home/profiles/shell/starship.nix
Normal file
12
home/profiles/shell/starship.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
"custom.kubeprompt" = {
|
||||
command = ''${pkgs.kubeprompt}/bin/kubeprompt -f default'';
|
||||
when = ''test "$KUBECONFIG" '';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
54
home/profiles/shell/tmux.nix
Normal file
54
home/profiles/shell/tmux.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
std,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (std) set;
|
||||
in {
|
||||
programs.zsh.shellAliases = {
|
||||
tt = "tmux new -AD -s";
|
||||
};
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
terminal = "tmux-256color";
|
||||
keyMode = "vi";
|
||||
baseIndex = 1;
|
||||
extraConfig = with set.map (_: v: "colour${builtins.toString v}") pkgs.base16.shell.shell256; ''
|
||||
# proper title handling
|
||||
set -g set-titles on
|
||||
set -g set-titles-string "#T"
|
||||
set -ga terminal-overrides ",xterm-256color:Tc"
|
||||
|
||||
# modes
|
||||
setw -g clock-mode-colour colour8
|
||||
setw -g mode-style 'fg=${base07} bg=${base02} bold'
|
||||
|
||||
# panes
|
||||
set -g pane-border-style 'fg=${base06} bg=${base02}'
|
||||
set -g pane-active-border-style 'bg=${base0D} fg=${base07}'
|
||||
|
||||
# statusbar
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
set -g status-style 'bg=${base00} fg=${base06}'
|
||||
set -g status-left '#[fg=${base06} bg=${base01}] #S@#h '
|
||||
set -g status-right '#[fg=${base07},bg=${base01}] %F #[fg=${base07},bg=${base02}] %H:%M:%S %Z '
|
||||
set -g status-right-length 50
|
||||
set -g status-left-length 20
|
||||
|
||||
setw -g window-status-current-style 'fg=${base07} bg=${base0D} bold'
|
||||
setw -g window-status-current-format ' #I#[fg=${base07}]:#[fg=${base07}]#W#[fg=${base07}]#F '
|
||||
|
||||
setw -g window-status-style 'fg=${base06} bg=${base03}'
|
||||
setw -g window-status-format ' #I#[fg=${base07}]:#[fg=${base06}]#W#[${base06}]#F '
|
||||
|
||||
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
|
||||
|
||||
# messages
|
||||
set -g message-style 'fg=colour232 bg=colour16 bold'
|
||||
|
||||
# mouse
|
||||
set -g mouse on
|
||||
'';
|
||||
};
|
||||
}
|
||||
21
home/profiles/shell/z.nix
Normal file
21
home/profiles/shell/z.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# ensure .local/share/z is created
|
||||
xdg.dataFile."z/.keep".text = "";
|
||||
|
||||
programs.zsh = {
|
||||
localVariables = {
|
||||
_Z_DATA = "${config.xdg.dataHome}/z/data";
|
||||
};
|
||||
plugins =
|
||||
map (plugin: (with pkgs.${plugin}; {
|
||||
name = pname;
|
||||
inherit src;
|
||||
})) [
|
||||
"zsh-z"
|
||||
];
|
||||
};
|
||||
}
|
||||
121
home/profiles/shell/zsh.nix
Normal file
121
home/profiles/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
std,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge mkIf;
|
||||
inherit (std) string list serde;
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
|
||||
zsh-completions
|
||||
fortune
|
||||
neofetch
|
||||
ponysay
|
||||
];
|
||||
|
||||
xdg.configFile."kattheme_immutable.json".text = serde.toJSON rec {
|
||||
default = config.base16.defaultSchemeName;
|
||||
current = default;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
enableAutosuggestions = true;
|
||||
initExtra = let
|
||||
zshOpts = [
|
||||
"auto_pushd"
|
||||
"pushd_ignore_dups"
|
||||
"pushdminus"
|
||||
"rmstarsilent"
|
||||
"nonomatch"
|
||||
"long_list_jobs"
|
||||
"interactivecomments"
|
||||
"append_history"
|
||||
"hist_ignore_space"
|
||||
"hist_verify"
|
||||
"inc_append_history"
|
||||
"nosharehistory"
|
||||
"nomenu_complete"
|
||||
"auto_menu"
|
||||
"no_auto_remove_slash"
|
||||
"complete_in_word"
|
||||
"always_to_end"
|
||||
"nolistbeep"
|
||||
"autolist"
|
||||
"listrowsfirst"
|
||||
];
|
||||
in ''
|
||||
${
|
||||
if pkgs.hostPlatform.isLinux
|
||||
then ''
|
||||
eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90")
|
||||
''
|
||||
else ''
|
||||
''
|
||||
}
|
||||
PROMPT_EOL_MARK='''
|
||||
ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm'
|
||||
ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true
|
||||
zmodload -i zsh/complist
|
||||
h=()
|
||||
if [[ -r ~/.ssh/config ]]; then
|
||||
h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
|
||||
fi
|
||||
if [[ $#h -gt 0 ]]; then
|
||||
zstyle ':completion:*:ssh:*' hosts $h
|
||||
zstyle ':completion:*:slogin:*' hosts $h
|
||||
fi
|
||||
unset h
|
||||
u=(root ${config.home.username})
|
||||
zstyle ':completion:*:ssh:*' users $u
|
||||
unset u
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
|
||||
zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1lb --color=always $realpath'
|
||||
${string.concatSep "\n" (map (opt: "setopt ${opt}") zshOpts)}
|
||||
bindkey '^ ' autosuggest-accept
|
||||
${
|
||||
if pkgs.hostPlatform.isDarwin
|
||||
then ''
|
||||
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||
''
|
||||
else ""
|
||||
}
|
||||
'';
|
||||
shellAliases = mkMerge [
|
||||
{
|
||||
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||
dmesg = "dmesg -HP";
|
||||
hg = "history 0 | rg";
|
||||
}
|
||||
(mkIf pkgs.hostPlatform.isLinux {
|
||||
sys = "systemctl";
|
||||
sysu = "systemctl --user";
|
||||
logu = "journalctl --user";
|
||||
log = "journalctl";
|
||||
lg = "log --no-pager | rg";
|
||||
})
|
||||
];
|
||||
localVariables = {
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold";
|
||||
ZSH_AUTOSUGGEST_USE_ASYNC = 1;
|
||||
};
|
||||
plugins = with pkgs.zsh-plugins; (list.map (plugin: plugin.zshPlugin) [
|
||||
tab-title
|
||||
vim-mode
|
||||
evil-registers
|
||||
]);
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
XDG_DATA_HOME = "${config.xdg.dataHome}";
|
||||
};
|
||||
}
|
||||
10
home/user/common.nix
Normal file
10
home/user/common.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
pkgs,
|
||||
tree,
|
||||
...
|
||||
}: {
|
||||
users.users.kat = {
|
||||
inherit (tree.home.user.data) description;
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
}
|
||||
10
home/user/darwin.nix
Normal file
10
home/user/darwin.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
_: {
|
||||
users.users.kat = {
|
||||
name = "kat";
|
||||
home = "/Users/kat";
|
||||
uid = 501;
|
||||
};
|
||||
users.knownUsers = [
|
||||
"kat"
|
||||
];
|
||||
}
|
||||
13
home/user/data.nix
Normal file
13
home/user/data.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
_: rec {
|
||||
description = "Kat Inskip";
|
||||
email = "kat@inskip.me";
|
||||
keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPsu3vNsvBb/G+wALpstD/DnoRZ3fipAs00jtl8rzDuv96RlS7AJr4aNvG6Pt2D9SYn2wVLaiw+76mz2gOycH9/N+VCvL4/0MN9uqj+7XIcxNRo0gHVOblmi2bOXcmGKh3eRwHj1xyDwRxo9WIuBEP2bPpDPz75OXRtEdlTgvky7siSguQxJu03cb0p9hNAYhUoohNXyWW2CjDCLUQVE1+QRVUzsKq3KkPy0cHYgmZC1gRSMQyKpMt72L5tayLz3Tp/zrshucc+QO5IJeZdqMxsNAcvALsysT1J5EqxZoYH9VpWLRhSgVD6Nvn853pycJAlXQxgOCpSD3/v/JbgUe5NE+ci0o7NMy5IiHUv2gQMRIEhwBHlRGwokUPL9upx0lsjaEiPya5xQqqDKRom87xytM778ANS5CuMdQMWg9qVbpHZUHMjA0QmNkjPgq71pUDXHk5L4mZuS8wVjyjnvlw68yIJuHEc8P7QiLcjvRHFS2L9Ck8NRmPDTQXlQi9kk6LmMyu6fdevR/kZL21b+xO1e2DMyxBbNDTot8luppiiL8adgUDMwptpIne7JCWB1o9NFCbXUVgwuCCYBif6pOGSc6bGo1JTAKMflRlcy6Mi3t5H0mR2lj/sCSTWwTlP5FM4aPIq08NvW6PeuK1bFJY9fIgTwVsUnbAKOhmsMt62w== pgp-${email}"
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCp+yOUFckh5ZQpXDDq0eKD8K2DVzwPyzoVSkpRTPy0JTeEQCviVvsEPASgJG1HbLYNcf2CDY8cD5efRPafPw2kQSDKPBUOqCo3/HlMRoCFt2CazcTe3AfqCDyebjs3fUAVsi/qMiO7L4N1kjz+hQJdq6xTQpXCpe4TPasi23Om8kmepdagJubtKVeuUISkkye8s/iCIsEGQV4c3YifmAq9FhpalXJ0Su7O9NY3EtUYhs9wNtHGKn9so1NyCmQBtaYQQaYqZUr5+XrfYl7UcNrXXsbattIcQyzfehvbP5tBeBoIjt1ug3+8CBS3bYxWzxk3RnYFwPgaMHPXg2okaL4L3PMWgjkEt809qeDTRfhi+2uI0N9sFcjpXHV61Wz94xSc+zwnJi9nabXgwtY0TjU2eF9eAcxTous3PT/+trp1E81O+IXh2PxAw9hgJqfd6eC0B6/JDYw7I2K2HVZC+9amQdySDa/pPyoMSVHgw5imdXkJ1+jHKbV6iXgEbFvbMD0= kat@sumireko"
|
||||
];
|
||||
keyid = "9CC644B569CDA59BC874C4C9E8DDE3ED1C90F3A0";
|
||||
keygrip = "59921D2F4E6DF7EEC3CB2934BD3D53666007B1AB";
|
||||
userName = description;
|
||||
userEmail = email;
|
||||
key = keyid;
|
||||
}
|
||||
16
home/user/default.nix
Normal file
16
home/user/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{tree, ...}:
|
||||
tree.prev
|
||||
// {
|
||||
nixos = {
|
||||
imports = with tree.prev; [
|
||||
nixos
|
||||
common
|
||||
];
|
||||
};
|
||||
darwin = {
|
||||
imports = with tree.prev; [
|
||||
darwin
|
||||
common
|
||||
];
|
||||
};
|
||||
}
|
||||
18
home/user/nixos.nix
Normal file
18
home/user/nixos.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{tree, ...}: {
|
||||
users.users.kat = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys = {
|
||||
inherit (tree.home.user.data) keys;
|
||||
};
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
"systemd-journal"
|
||||
"networkmanager"
|
||||
"plugdev"
|
||||
"input"
|
||||
"uinput"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue