Compare commits

..

3 commits

Author SHA1 Message Date
Evie Litherland-Smith 93d1867f5f Move ssh and starship config into own files
Add helper script ssh-keygen-defaults

starship: always enable hostname module, add octicon icon for package
module
2024-05-20 09:35:15 +01:00
Evie Litherland-Smith 1cccd418b5 Add swayidle daemon
Move default swaylock-effects command into script "swaylockfx" to
reuse for swayidle
2024-05-20 09:28:00 +01:00
Evie Litherland-Smith dc8e3340bd Add zellij back with config 2024-05-20 09:17:43 +01:00
7 changed files with 198 additions and 146 deletions

View file

@ -5,7 +5,10 @@
}: {
imports = [
./git.nix
./ssh.nix
./starship.nix
./bottom.nix
./zellij.nix
];
xdg.configFile = let
variants = ["Latte" "Frappe" "Macchiato" "Mocha"];
@ -41,151 +44,6 @@
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
};
ssh = {
enable = true;
forwardAgent = true;
compression = true;
serverAliveInterval = 15;
serverAliveCountMax = 3;
controlMaster = "auto";
controlPersist = "10s";
extraConfig = ''
AddKeysToAgent=yes
SetEnv TERM=xterm-256color
'';
matchBlocks = {
"git*".user = "git";
"legion" = {
user = "pixelifytica";
hostname = "192.168.0.31";
};
"vanguard" = {
user = "pixelifytica";
hostname = "192.168.0.90";
};
"ionos" = {
user = "root";
hostname = "77.68.67.133";
};
"freia" = {
user = "elitherl";
hostname = "freia020.hpc.l";
forwardX11Trusted = true;
};
"heimdall" = {
user = "elitherl";
hostname = "heimdall003.jet.uk";
forwardX11Trusted = true;
};
};
};
starship = {
enable = true;
enableTransience = true;
settings = {
add_newline = false;
c = {symbol = " ";};
character = {
success_symbol = "[󰁔 ](bold green)";
error_symbol = "[󰁔 ](bold red)";
};
command_timeout = 2000;
container = {symbol = " ";};
directory = {
truncation_length = 2;
fish_style_pwd_dir_length = 1;
truncate_to_repo = false;
};
direnv = {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 = " ";
};
hostname = {
ssh_only = true;
ssh_symbol = "󰢹 ";
};
jobs = {symbol = "󰈏 ";};
line_break = {disabled = false;};
localip = {disabled = false;};
lua = {symbol = " ";};
memory_usage = {disabled = false;};
nodejs = {symbol = " ";};
os = {
disabled = false;
format = "on [$symbol]($style) ";
symbols = {
Alpine = " ";
Arch = " ";
Artix = " ";
CentOS = " ";
Debian = " ";
EndeavourOS = " ";
Fedora = " ";
FreeBSD = " ";
Gentoo = " ";
Illumos = " ";
Linux = " ";
Macos = " ";
Manjaro = " ";
Mint = " ";
NixOS = " ";
OpenBSD = " ";
openSUSE = " ";
Pop = " ";
Raspbian = " ";
Redhat = " ";
RedHatEnterprise = " ";
Solus = " ";
SUSE = " ";
Ubuntu = " ";
Unknown = " ";
Windows = " ";
};
};
python = {
python_binary = "python3";
symbol = " ";
};
shell = {
disabled = false;
format = "using [$indicator ]($style)";
};
status = {
disabled = false;
map_symbol = true;
pipestatus = true;
symbol = " ";
success_symbol = "";
not_executable_symbol = " ";
not_found_symbol = " ";
sigint_symbol = " ";
signal_symbol = " ";
};
sudo = {disabled = false;};
};
};
zsh = {
enable = true;
enableCompletion = true;

44
programs/shell/ssh.nix Normal file
View file

@ -0,0 +1,44 @@
{pkgs, ...}: {
home.packages = with pkgs; [
(writeShellScriptBin "ssh-keygen-defaults"
''ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)"'')
];
programs.ssh = {
enable = true;
forwardAgent = true;
compression = true;
serverAliveInterval = 15;
serverAliveCountMax = 3;
controlMaster = "auto";
controlPersist = "10s";
extraConfig = ''
AddKeysToAgent=yes
SetEnv TERM=xterm-256color
'';
matchBlocks = {
"git*".user = "git";
"legion" = {
user = "pixelifytica";
hostname = "192.168.0.31";
};
"vanguard" = {
user = "pixelifytica";
hostname = "192.168.0.90";
};
"ionos" = {
user = "root";
hostname = "77.68.67.133";
};
"freia" = {
user = "elitherl";
hostname = "freia020.hpc.l";
forwardX11Trusted = true;
};
"heimdall" = {
user = "elitherl";
hostname = "heimdall003.jet.uk";
forwardX11Trusted = true;
};
};
};
}

110
programs/shell/starship.nix Normal file
View file

@ -0,0 +1,110 @@
{...}: {
programs.starship = {
enable = true;
enableTransience = true;
settings = {
add_newline = false;
c = {symbol = " ";};
character = {
success_symbol = "[󰁔 ](bold green)";
error_symbol = "[󰁔 ](bold red)";
};
command_timeout = 2000;
container = {symbol = " ";};
directory = {
truncation_length = 2;
fish_style_pwd_dir_length = 1;
truncate_to_repo = false;
};
direnv = {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 = " ";
};
hostname = {
ssh_only = false;
ssh_symbol = "󰢹 ";
};
jobs = {symbol = "󰈏 ";};
line_break = {disabled = false;};
localip = {disabled = false;};
lua = {symbol = " ";};
memory_usage = {disabled = false;};
nodejs = {symbol = " ";};
os = {
disabled = false;
format = "on [$symbol]($style) ";
symbols = {
Alpine = " ";
Arch = " ";
Artix = " ";
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 = {
python_binary = "python3";
symbol = " ";
};
shell = {
disabled = false;
format = "using [$indicator ]($style)";
};
status = {
disabled = false;
map_symbol = true;
pipestatus = true;
symbol = " ";
success_symbol = "";
not_executable_symbol = " ";
not_found_symbol = " ";
sigint_symbol = " ";
signal_symbol = " ";
};
sudo = {disabled = false;};
};
};
}

23
programs/shell/zellij.nix Normal file
View file

@ -0,0 +1,23 @@
{
config,
lib,
...
}: {
programs.zellij = {
enable = true;
settings = {
themes.base16 = with config.scheme.withHashtag; rec {
inherit red green yellow blue magenta cyan orange;
black = base05;
bg = black;
white = base00;
fg = white;
};
theme = "base16";
default_mode = "locked";
mouse_mode = true;
copy_command = lib.mkIf config.wayland.windowManager.sway.enable "wl-copy";
copy_on_select = true;
};
};
}

View file

@ -11,6 +11,7 @@
./avizo/default.nix
./rofi/default.nix
./swaylock/default.nix
./swayidle/default.nix
./swaync/default.nix
./waybar/default.nix
./wlogout/default.nix
@ -157,7 +158,7 @@
"XF86MonBrightnessDown" = "exec ${services.avizo.package}/bin/lightctl - 5";
# System utilities
"${modifier}+F1" = "exec ${programs.swaylock.package}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse";
"${modifier}+F1" = "exec swaylockfx";
"${modifier}+p" = "exec ${programs.wlogout.package}/bin/wlogout";
"${modifier}+z" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
"${modifier}+Shift+z" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";

View file

@ -0,0 +1,12 @@
{...}: {
imports = [../swaylock/default.nix];
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 60 * 15; # 15 minutes
command = "swaylockfx";
}
];
};
}

View file

@ -4,6 +4,10 @@
accentColour ? "base07",
...
}: {
home.packages = with pkgs; [
(writeShellScriptBin "swaylockfx"
"${config.programs.swaylock.package}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse")
];
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;