move old nixos-config over here
This commit is contained in:
parent
346d80ae7e
commit
54baace7c1
35 changed files with 850 additions and 44 deletions
|
@ -1,40 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.atuin = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
ctrl_n_shortcuts = true;
|
||||
enter_accept = true;
|
||||
filter_mode_shell_up_key_binding = "session";
|
||||
history_filter = [ ];
|
||||
inline_height = 8;
|
||||
prefers_reduced_motion = true;
|
||||
search_mode_shell_up_key_binding = "prefix";
|
||||
show_help = false;
|
||||
style = "compact";
|
||||
sync_address = "https://atuin.aarn.shelman.io";
|
||||
sync.records = true;
|
||||
|
||||
stats.common_subcommands = [
|
||||
"cargo"
|
||||
"git"
|
||||
"go"
|
||||
"jj"
|
||||
"just"
|
||||
"kubectl"
|
||||
"nix"
|
||||
"npm"
|
||||
"pnpm"
|
||||
"talosctl"
|
||||
"task"
|
||||
"yarn"
|
||||
];
|
||||
|
||||
stats.common_prefix = [
|
||||
"doas"
|
||||
"sudo"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
42
common/base.nix
Normal file
42
common/base.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Stockholm";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
btrfs-progs
|
||||
btrfs-snap
|
||||
git
|
||||
glibcLocales
|
||||
qemu_kvm
|
||||
qemu-utils
|
||||
vim
|
||||
zstd
|
||||
];
|
||||
|
||||
# Use fish, but not in /etc/passwd . See https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
|
||||
programs.bash = {
|
||||
interactiveShellInit = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
shellInit = ''
|
||||
export NIX_LD=$(nix eval --impure --raw --expr 'let pkgs = import <nixpkgs> {}; NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; in NIX_LD')
|
||||
'';
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.broot = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
content_search_max_file_size = "10MB";
|
||||
enable_kitty_keyboard = lib.mkForce true;
|
||||
icon_theme = "nerdfont";
|
||||
lines_before_match_in_preview = 1;
|
||||
lines_after_match_in_preview = 1;
|
||||
quit_on_last_cancel = true;
|
||||
show_selection_mark = true;
|
||||
special_paths = {
|
||||
"~/media" = {
|
||||
list = "never";
|
||||
sum = "never";
|
||||
};
|
||||
"~/.config" = {
|
||||
show = "always";
|
||||
};
|
||||
"trav" = {
|
||||
show = "always";
|
||||
list = "always";
|
||||
sum = "never";
|
||||
};
|
||||
};
|
||||
true_colors = true;
|
||||
|
||||
verbs = [
|
||||
{
|
||||
invocation = "broot_home";
|
||||
key = "ctrl-7";
|
||||
external = "br $HOME";
|
||||
from_shell = true;
|
||||
leave_broot = true;
|
||||
}
|
||||
{
|
||||
invocation = "edit";
|
||||
key = "enter";
|
||||
shortcut = "e";
|
||||
external = "edit {file}";
|
||||
apply_to = "text_file";
|
||||
from_shell = true;
|
||||
leave_broot = true;
|
||||
}
|
||||
{
|
||||
invocation = "nvim";
|
||||
key = "enter";
|
||||
apply_to = "text_file";
|
||||
external = "edit {file}";
|
||||
from_shell = true;
|
||||
leave_broot = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,21 +1,11 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./atuin.nix
|
||||
./broot.nix
|
||||
./devel.nix
|
||||
./fish.nix
|
||||
./gnome.nix
|
||||
./k8s.nix
|
||||
./base.nix
|
||||
./desktop.nix
|
||||
./hardening.nix
|
||||
./laptop.nix
|
||||
./nix.nix
|
||||
./nvim.nix
|
||||
./scripts.nix
|
||||
./ssh.nix
|
||||
./utils.nix
|
||||
./vcs.nix
|
||||
./web.nix
|
||||
./wezterm.nix
|
||||
./plymouth.nix
|
||||
./podman.nix
|
||||
];
|
||||
|
||||
options.shelman.desktop.enable = lib.mkEnableOption "Desktop environment";
|
||||
}
|
||||
|
|
107
common/desktop.nix
Normal file
107
common/desktop.nix
Normal file
|
@ -0,0 +1,107 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.shelman.podman;
|
||||
in
|
||||
{
|
||||
options.shelman.desktop.enable = mkEnableOption "Desktop environment and common applications";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ gnome-ssh-askpass4 ];
|
||||
|
||||
# Excluding some GNOME applications from the default install
|
||||
environment.gnome.excludePackages =
|
||||
(with pkgs; [
|
||||
gnome-connections
|
||||
gnome-photos
|
||||
gnome-tour
|
||||
snapshot
|
||||
])
|
||||
++ (with pkgs.gnome; [
|
||||
atomix # puzzle game
|
||||
baobab # disk usage analyzer
|
||||
cheese # webcam tool
|
||||
epiphany # web browser
|
||||
geary # email reader
|
||||
gnome-clocks
|
||||
gnome-contacts
|
||||
gnome-disk-utility
|
||||
gnome-logs
|
||||
gnome-music
|
||||
gnome-terminal
|
||||
hitori # sudoku game
|
||||
iagno # go game
|
||||
simple-scan
|
||||
tali # poker game
|
||||
yelp # help viewer
|
||||
]);
|
||||
|
||||
fonts = {
|
||||
fontDir.enable = true;
|
||||
fontconfig = {
|
||||
allowBitmaps = false;
|
||||
antialias = true;
|
||||
defaultFonts = {
|
||||
serif = [ "Liberation Serif" ];
|
||||
sansSerif = [ "Inter" ];
|
||||
monospace = [ "BerkeleyMono Nerd Font" ];
|
||||
};
|
||||
hinting.enable = true;
|
||||
hinting.style = "slight";
|
||||
subpixel.rgba = "rgb";
|
||||
};
|
||||
packages = with pkgs; [
|
||||
inter
|
||||
jetbrains-mono
|
||||
liberation_ttf
|
||||
monaspace
|
||||
(pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-color-emoji
|
||||
roboto
|
||||
ubuntu_font_family
|
||||
];
|
||||
};
|
||||
|
||||
programs.ssh.askPassword = "${pkgs.gnome-ssh-askpass4}/bin/gnome-ssh-askpass4";
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.defaultSession = "gnome";
|
||||
displayManager.gdm.enable = true;
|
||||
displayManager.gdm.autoSuspend = false;
|
||||
desktopManager.gnome.enable = true;
|
||||
xkb.layout = "se";
|
||||
xkb.variant = "us";
|
||||
};
|
||||
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
bacon
|
||||
cargo
|
||||
clang
|
||||
codeium
|
||||
gnumake
|
||||
go
|
||||
just
|
||||
ldns
|
||||
nixfmt-rfc-style
|
||||
nodejs_22
|
||||
passage
|
||||
rage
|
||||
prettierd
|
||||
rust-analyzer
|
||||
rustc
|
||||
sqlite
|
||||
stylua
|
||||
tree-sitter
|
||||
zig
|
||||
];
|
||||
}
|
122
common/fish.nix
122
common/fish.nix
|
@ -1,122 +0,0 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "transient-fish";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zzhaolei";
|
||||
repo = "transient.fish";
|
||||
rev = "deb35c4d07ea6acc56b073d7ba84f8ed76356abd";
|
||||
sha256 = "sha256-BQvuqY7D+9fTDeLb7Fz9Ll/7uIlqrmRmn0S+G9v+2Uc=";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
functions = {
|
||||
edit = {
|
||||
description = "Open a file in already running nvim and switch tab";
|
||||
argumentNames = [ "file" ];
|
||||
body = ''
|
||||
set _file (readlink -f "$file")
|
||||
if test -z "$file"
|
||||
set _root (vcs_root)
|
||||
set _file (fd --type f . "$_root" | sed -e "s#^$_root/##" | fzf --no-sort --layout=reverse)
|
||||
set _file "$_root/$_file"
|
||||
end
|
||||
nvim --server "$XDG_RUNTIME_DIR/nvim-persistent.sock" --remote "$_file" &>/dev/null
|
||||
or return 1
|
||||
# Wezterm: switch tab to nvim
|
||||
printf "\033]1337;SetUserVar=nvim_activate=\007"
|
||||
'';
|
||||
};
|
||||
|
||||
__zoxide_zi_repaint.body = ''
|
||||
__zoxide_zi
|
||||
commandline -f repaint
|
||||
'';
|
||||
|
||||
fish_jj_prompt.body = ''
|
||||
# Is jj installed?
|
||||
if not command -sq jj
|
||||
return 1
|
||||
end
|
||||
|
||||
# Are we in a jj repo?
|
||||
if not jj root --quiet &>/dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
# Generate prompt
|
||||
jj log --ignore-working-copy --no-graph --color always -r @ -T '
|
||||
separate(
|
||||
" ",
|
||||
change_id.shortest(),
|
||||
coalesce(
|
||||
surround(
|
||||
"\"",
|
||||
"\"",
|
||||
if(
|
||||
description.first_line().substr(0, 24).starts_with(description.first_line()),
|
||||
description.first_line().substr(0, 24),
|
||||
description.first_line().substr(0, 23) ++ "…"
|
||||
)
|
||||
),
|
||||
"(no description set)"
|
||||
),
|
||||
branches.join(", "),
|
||||
commit_id.shortest(),
|
||||
if(conflict, "(conflict)"),
|
||||
if(empty, "(empty)"),
|
||||
if(divergent, "(divergent)"),
|
||||
if(hidden, "(hidden)"),
|
||||
)
|
||||
'
|
||||
'';
|
||||
|
||||
fish_prompt.body = ''
|
||||
echo
|
||||
string join "" -- (set_color --italics) (prompt_hostname) ':' (prompt_pwd) (set_color green) ' ❯ ' (set_color normal)
|
||||
'';
|
||||
|
||||
fish_right_prompt.body = ''
|
||||
fish_jj_prompt || fish_vcs_prompt
|
||||
'';
|
||||
|
||||
transient_prompt_func.body = ''
|
||||
echo
|
||||
string join "" -- (set_color green) '❯ ' (set_color normal)
|
||||
'';
|
||||
|
||||
rg.body = ''
|
||||
if status is-interactive
|
||||
command rg --json $argv | delta
|
||||
else
|
||||
command rg $argv
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
interactiveShellInit = lib.concatStringsSep "\n" [
|
||||
(builtins.readFile ../files/config/fish/config.fish)
|
||||
(builtins.readFile ../files/config/fish/semantic-prompt.fish)
|
||||
(builtins.readFile ../files/config/fish/go-task.fish)
|
||||
(builtins.readFile ../files/config/fish/jj.fish)
|
||||
(builtins.readFile ../files/config/fish/vcs.fish)
|
||||
];
|
||||
|
||||
shellAbbrs = {
|
||||
e = "edit";
|
||||
l = "bat";
|
||||
ls = "eza";
|
||||
tree = "eza --tree";
|
||||
top = "btm --basic --enable_cache_memory --enable_gpu_memory --battery";
|
||||
ts = "TZ=Z date '+%Y%m%dT%H%M%SZ'";
|
||||
w = "viddy -n1 $history[1]";
|
||||
xc = "fish_clipboard_copy";
|
||||
};
|
||||
};
|
||||
}
|
194
common/gnome.nix
194
common/gnome.nix
|
@ -1,194 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib.hm.gvariant;
|
||||
{
|
||||
config = lib.mkIf config.shelman.desktop.enable {
|
||||
home.packages = with pkgs; [
|
||||
gnome-tweaks
|
||||
gnome-pomodoro
|
||||
gnomeExtensions.desktop-clock
|
||||
gnomeExtensions.just-perfection
|
||||
gnomeExtensions.vitals
|
||||
];
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/background" = {
|
||||
color-shading-type = "solid";
|
||||
picture-options = "zoom";
|
||||
picture-uri = "file:///run/current-system/sw/share/backgrounds/gnome/vnc-l.png";
|
||||
picture-uri-dark = "file:///run/current-system/sw/share/backgrounds/gnome/vnc-d.png";
|
||||
primary-color = "#77767B";
|
||||
secondary-color = "#000000";
|
||||
};
|
||||
|
||||
"org/gnome/desktop/screensaver" = {
|
||||
color-shading-type = "solid";
|
||||
picture-options = "zoom";
|
||||
picture-uri = "file:///run/current-system/sw/share/backgrounds/gnome/vnc-l.png";
|
||||
primary-color = "#77767B";
|
||||
secondary-color = "#000000";
|
||||
};
|
||||
|
||||
"org/gnome/desktop/wm/keybindings" = {
|
||||
close = [ "<Super>q" ];
|
||||
toggle-on-all-workspaces = [ "<Super>s" ];
|
||||
toggle-maximized = [ "<Super>m" ];
|
||||
maximize-vertically = [ "<Super>Up" ];
|
||||
minimize = [ "<Super>comma" ];
|
||||
move-to-center = [ "<Super>c" ];
|
||||
switch-applications = [ "<Super>Tab" ];
|
||||
switch-windows = [ "<Alt>Tab" ];
|
||||
move-to-workspace-1 = [ "<Shift>F1" ];
|
||||
move-to-workspace-2 = [ "<Shift>F2" ];
|
||||
move-to-workspace-3 = [ "<Shift>F3" ];
|
||||
move-to-workspace-4 = [ "<Shift>F4" ];
|
||||
move-to-workspace-5 = [ "<Shift>F5" ];
|
||||
move-to-workspace-6 = [ "<Shift>F6" ];
|
||||
move-to-workspace-7 = [ "<Shift>F7" ];
|
||||
move-to-workspace-8 = [ "<Shift>F8" ];
|
||||
move-to-workspace-9 = [ "<Shift>F9" ];
|
||||
switch-to-workspace-1 = [ "F1" ];
|
||||
switch-to-workspace-2 = [ "F2" ];
|
||||
switch-to-workspace-3 = [ "F3" ];
|
||||
switch-to-workspace-4 = [ "F4" ];
|
||||
switch-to-workspace-5 = [ "F5" ];
|
||||
switch-to-workspace-6 = [ "F6" ];
|
||||
switch-to-workspace-7 = [ "F7" ];
|
||||
switch-to-workspace-8 = [ "F8" ];
|
||||
switch-to-workspace-9 = [ "F9" ];
|
||||
};
|
||||
|
||||
"org/gnome/desktop/input-sources" = {
|
||||
mru-sources = [
|
||||
(mkTuple [
|
||||
"xkb"
|
||||
"us"
|
||||
])
|
||||
];
|
||||
sources = [
|
||||
(mkTuple [
|
||||
"xkb"
|
||||
"se+us"
|
||||
])
|
||||
];
|
||||
xkb-options = [ "caps:ctrl_modifier" ];
|
||||
};
|
||||
|
||||
"org/gnome/desktop/interface" = {
|
||||
enable-animations = false;
|
||||
enable-hot-corners = false;
|
||||
show-battery-percentage = true;
|
||||
font-antialiasing = "grayscale";
|
||||
font-hinting = "slight";
|
||||
font-name = "Inter Variable 11";
|
||||
document-font-name = "Inter Variable 11";
|
||||
monospace-font-name = "BerkeleyMono Nerd Font 11";
|
||||
toolkit-accessibility = false;
|
||||
};
|
||||
|
||||
"org/gnome/desktop/search-providers" = {
|
||||
disabled = [
|
||||
"org.gnome.Contacts.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
"org.gnome.Calendar.desktop"
|
||||
"org.gnome.clocks.desktop"
|
||||
"org.gnome.Epiphany.desktop"
|
||||
];
|
||||
sort-order = [
|
||||
"org.gnome.Contacts.desktop"
|
||||
"org.gnome.Documents.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
"org.gnome.Settings.desktop"
|
||||
"org.gnome.Calculator.desktop"
|
||||
"org.gnome.Calendar.desktop"
|
||||
"org.gnome.clocks.desktop"
|
||||
"org.gnome.seahorse.Application.desktop"
|
||||
"org.gnome.Weather.desktop"
|
||||
"org.gnome.Characters.desktop"
|
||||
];
|
||||
};
|
||||
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
focus-mode = "sloppy";
|
||||
num-workspaces = 10;
|
||||
resize-with-right-button = true;
|
||||
};
|
||||
|
||||
"org/gnome/GWeather4" = {
|
||||
temperature-unit = "centigrade";
|
||||
};
|
||||
|
||||
"org/gnome/Weather" = {
|
||||
locations = [
|
||||
(mkVariant (mkTuple [
|
||||
(mkUint32 2)
|
||||
(mkVariant (mkTuple [
|
||||
"Stockholm-Arlanda Airport"
|
||||
"ESSA"
|
||||
false
|
||||
[
|
||||
(mkTuple [
|
||||
1.0410888988146176
|
||||
0.31328660073298215
|
||||
])
|
||||
]
|
||||
[
|
||||
(mkTuple [
|
||||
1.0410888988146176
|
||||
0.31328660073298215
|
||||
])
|
||||
]
|
||||
]))
|
||||
]))
|
||||
];
|
||||
};
|
||||
|
||||
"org/gnome/desktop/calendar" = {
|
||||
show-weekdate = true;
|
||||
};
|
||||
|
||||
"org/gnome/mutter" = {
|
||||
center-new-windows = true;
|
||||
edge-tiling = true;
|
||||
};
|
||||
|
||||
"org/gnome/settings-daemon/plugins/color" = {
|
||||
night-light-schedule-automatic = false;
|
||||
night-light-schedule-from = 0.0;
|
||||
night-light-schedule-to = 0.0;
|
||||
night-light-temperature = mkUint32 3575;
|
||||
};
|
||||
|
||||
"org/gnome/shell" = {
|
||||
enabled-extensions = [
|
||||
"just-perfection-desktop@just-perfection"
|
||||
"Vitals@CoreCoding.com"
|
||||
];
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/just-perfection" = {
|
||||
animation = 0;
|
||||
notification-banner-position = 2;
|
||||
osd-position = 6;
|
||||
panel = false;
|
||||
panel-in-overview = true;
|
||||
startup-status = 0;
|
||||
switcher-popup-delay = false;
|
||||
top-panel-position = 0;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/vitals" = {
|
||||
update-time = 15;
|
||||
};
|
||||
|
||||
"org/gnome/tweaks" = {
|
||||
show-extensions-notice = false;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
43
common/hardening.nix
Normal file
43
common/hardening.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nix.settings.allowed-users = [
|
||||
"@wheel"
|
||||
"root"
|
||||
];
|
||||
|
||||
boot.specialFileSystems = lib.mkIf (
|
||||
!config.security.rtkit.enable && !config.security.polkit.enable
|
||||
) { "/proc".options = [ "hidepid=2" ]; };
|
||||
|
||||
boot.kernel.sysctl."kernel.dmesg_restrict" = 1;
|
||||
|
||||
environment.systemPackages = [ pkgs.doas-sudo-shim ];
|
||||
|
||||
security = {
|
||||
doas = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
groups = [ "wheel" ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
sudo.enable = false;
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
settings.PasswordAuthentication = false;
|
||||
settings.KbdInteractiveAuthentication = false;
|
||||
# prevents mutable /home/$user/.ssh/authorized_keys from being loaded to ensure that all user keys are config managed
|
||||
# authorizedKeysFiles = lib.mkForce [ "/etc/ssh/authorized_keys.d/%u" ];
|
||||
};
|
||||
|
||||
users.users.root.hashedPassword = "!";
|
||||
}
|
176
common/k8s.nix
176
common/k8s.nix
|
@ -1,176 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
kail
|
||||
kapp
|
||||
krew
|
||||
kubectl
|
||||
kubectl-cnpg
|
||||
kubectl-neat
|
||||
kubectl-view-secret
|
||||
kubectx
|
||||
kubelogin-oidc
|
||||
kubernetes-helm
|
||||
kustomize
|
||||
];
|
||||
|
||||
programs.k9s = {
|
||||
enable = true;
|
||||
settings.k9s = {
|
||||
liveViewAutoRefresh = false;
|
||||
refreshRate = 2;
|
||||
maxConnRetry = 5;
|
||||
readOnly = false;
|
||||
noExitOnCtrlC = false;
|
||||
skipLatestRevCheck = false;
|
||||
disablePodCounting = false;
|
||||
imageScans.enable = false;
|
||||
logger = {
|
||||
tail = 100;
|
||||
buffer = 5000;
|
||||
sinceSeconds = -1;
|
||||
textWrap = false;
|
||||
showTime = false;
|
||||
};
|
||||
shellPod.image = "alpine:3";
|
||||
thresholds = {
|
||||
cpu = {
|
||||
critical = 90;
|
||||
warn = 70;
|
||||
};
|
||||
memory = {
|
||||
critical = 90;
|
||||
warn = 70;
|
||||
};
|
||||
};
|
||||
ui = {
|
||||
crumbsless = true;
|
||||
defaultsToFullScreen = true;
|
||||
enableMouse = false;
|
||||
headless = true;
|
||||
logoless = true;
|
||||
noIcons = false;
|
||||
reactive = false;
|
||||
skin = "dieter";
|
||||
};
|
||||
};
|
||||
|
||||
views = {
|
||||
views = {
|
||||
"v1/pods" = {
|
||||
columns = [
|
||||
"NAME"
|
||||
"PF"
|
||||
"READY"
|
||||
"STATUS"
|
||||
"NODE"
|
||||
"AGE"
|
||||
"RESTARTS"
|
||||
"IP"
|
||||
"CPU"
|
||||
"MEM"
|
||||
"CPU/R:L"
|
||||
"MEM/R:L"
|
||||
"%CPU/R"
|
||||
"%CPU/L"
|
||||
"%MEM/R"
|
||||
"%MEM/L"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
skins.dieter.k9s = {
|
||||
body = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
logoColor = "default";
|
||||
};
|
||||
prompt = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
suggestColor = "default";
|
||||
};
|
||||
info = {
|
||||
fgColor = "default";
|
||||
sectionColor = "default";
|
||||
};
|
||||
dialog = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
buttonFgColor = "default";
|
||||
buttonBgColor = "default";
|
||||
buttonFocusFgColor = "white";
|
||||
buttonFocusBgColor = "darkblue";
|
||||
labelFgColor = "default";
|
||||
fieldFgColor = "default";
|
||||
};
|
||||
frame = {
|
||||
border = {
|
||||
fgColor = "default";
|
||||
focusColor = "default";
|
||||
};
|
||||
menu = {
|
||||
fgColor = "default";
|
||||
keyColor = "default";
|
||||
numKeyColor = "default";
|
||||
};
|
||||
crumbs = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
activeColor = "default";
|
||||
};
|
||||
status = {
|
||||
newColor = "default";
|
||||
modifyColor = "default";
|
||||
addColor = "default";
|
||||
errorColor = "red";
|
||||
highlightColor = "default";
|
||||
killColor = "default";
|
||||
completedColor = "default";
|
||||
};
|
||||
title = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
highlightColor = "default";
|
||||
counterColor = "default";
|
||||
filterColor = "default";
|
||||
};
|
||||
};
|
||||
views = {
|
||||
table = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
cursorFgColor = "teal";
|
||||
cursorBgColor = "darkblue";
|
||||
header = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
sorterColor = "blue";
|
||||
};
|
||||
};
|
||||
xray = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
cursorColor = "blue";
|
||||
graphicColor = "blue";
|
||||
};
|
||||
yaml = {
|
||||
keyColor = "default";
|
||||
colonColor = "default";
|
||||
valueColor = "default";
|
||||
};
|
||||
logs = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
indicator = {
|
||||
fgColor = "default";
|
||||
bgColor = "default";
|
||||
toggleOnColor = "default";
|
||||
toggleOffColor = "default";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
20
common/laptop.nix
Normal file
20
common/laptop.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.shelman.podman;
|
||||
in
|
||||
{
|
||||
options.shelman.laptop.enable = mkEnableOption "Laptop tools and configuration";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ gnomeExtensions.battery-health-charging ];
|
||||
|
||||
services.fprintd.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,15 +1,47 @@
|
|||
{ outputs, ... }:
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
nix =
|
||||
let
|
||||
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
||||
in
|
||||
{
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = "nix-command flakes";
|
||||
flake-registry = "";
|
||||
# Workaround for https://github.com/NixOS/nix/issues/9574
|
||||
nix-path = config.nix.nixPath;
|
||||
substituters = [ "https://cache.nixos.org/" ];
|
||||
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
|
||||
};
|
||||
channel.enable = false;
|
||||
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
|
||||
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.unstable-packages
|
||||
];
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
clean.extraArgs = "--keep-since 14d --keep 5";
|
||||
};
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
environment.systemPackages = with pkgs; [ nvd ];
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withNodeJs = false;
|
||||
withPython3 = false;
|
||||
withRuby = false;
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
"nvim" = {
|
||||
recursive = true;
|
||||
source = ./../files/config/nvim;
|
||||
};
|
||||
};
|
||||
}
|
45
common/plymouth.nix
Normal file
45
common/plymouth.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.shelman.plymouth;
|
||||
in
|
||||
{
|
||||
options.shelman.plymouth.enable = mkEnableOption "Fancy boot splash";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot = {
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
|
||||
# Hide the OS choice for bootloaders.
|
||||
# It's still possible to open the bootloader list by pressing any key
|
||||
# It will just not appear on screen unless a key is pressed
|
||||
loader.timeout = 0;
|
||||
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
|
||||
plymouth = {
|
||||
enable = true;
|
||||
theme = "spinner_alt";
|
||||
themePackages = with pkgs; [
|
||||
(adi1090x-plymouth-themes.override { selected_themes = [ "spinner_alt" ]; })
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
48
common/podman.nix
Normal file
48
common/podman.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.shelman.podman;
|
||||
in
|
||||
{
|
||||
options.shelman.podman.enable = mkEnableOption "Podman";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.extraInit = ''
|
||||
if [ -z "$DOCKER_HOST" -a -n "$XDG_RUNTIME_DIR" ]; then
|
||||
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
|
||||
fi
|
||||
'';
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker-compose
|
||||
podman-compose
|
||||
];
|
||||
|
||||
virtualisation = {
|
||||
containers = {
|
||||
enable = true;
|
||||
storage.settings = {
|
||||
storage = {
|
||||
driver = "overlay";
|
||||
runroot = "/run/containers/storage";
|
||||
graphroot = "/var/lib/containers/storage";
|
||||
rootless_storage_path = "/tmp/containers-$USER";
|
||||
options.overlay.mountopt = "nodev,metacopy=on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
oci-containers.backend = "podman";
|
||||
podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.file = {
|
||||
".local/bin" = {
|
||||
recursive = true;
|
||||
source = ./../files/scripts;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
home.sessionPath = [ "$HOME/.local/bin" ];
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
compression = false;
|
||||
controlMaster = "auto";
|
||||
controlPath = "\${XDG_RUNTIME_DIR}/ssh_control:%h:%p:%r";
|
||||
controlPersist = "15m";
|
||||
extraConfig = ''
|
||||
PreferredAuthentications publickey
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
dust
|
||||
jless
|
||||
procs
|
||||
viddy
|
||||
];
|
||||
|
||||
programs = {
|
||||
bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
italic-text = "always";
|
||||
paging = "auto";
|
||||
style = "plain";
|
||||
theme = "ansi";
|
||||
};
|
||||
};
|
||||
|
||||
bottom.enable = true;
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
silent = false;
|
||||
};
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
fd.enable = true;
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
jq.enable = true;
|
||||
less.enable = true;
|
||||
lesspipe.enable = true;
|
||||
tmux.enable = true;
|
||||
|
||||
ripgrep = {
|
||||
enable = true;
|
||||
arguments = [
|
||||
"--glob=!.git/*"
|
||||
"--glob=!.jj/*"
|
||||
];
|
||||
};
|
||||
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
options = [ "--cmd=cd" ];
|
||||
};
|
||||
};
|
||||
}
|
166
common/vcs.nix
166
common/vcs.nix
|
@ -1,166 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
|
||||
home.packages = with pkgs; [
|
||||
delta
|
||||
diffedit3
|
||||
difftastic
|
||||
git-graph
|
||||
git-town
|
||||
lazyjj
|
||||
tea
|
||||
];
|
||||
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
aliases = {
|
||||
b = "branch -va";
|
||||
cl = "clone --filter=blob:none";
|
||||
co = "checkout";
|
||||
d = "diff --stat -p -C --color-words";
|
||||
ds = "diff --staged --stat -p -C --color-words";
|
||||
g = "graph -S -m simple -s round";
|
||||
guilt = "!f(){ git log --pretty='format:%an <%ae>' $@ | sort | uniq -c | sort -rn; }; f";
|
||||
lla = "log --graph --all --topo-order --pretty='format:\t%x1B[0;3;36m%as %x1B[0;95;3m%<(12)%al %x1B[3;32m• %h%x1B[0;1;92m%d%x1B[0m %s'";
|
||||
ll = "log --pretty='format:%x1B[0;3;36m%as %G? %x1B[0;95;3m%<(12,trunc)%al %x1B[3;32m• %h%x1B[0;1;92m%(decorate:prefix= [,suffix=]%n)%>|(35)%Creset %s'";
|
||||
patch = "!git --no-pager diff --no-color";
|
||||
pullr = "pull --rebase --autostash";
|
||||
sh = "show --stat -p -C --color-words --show-signature";
|
||||
st = "status -sb";
|
||||
};
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
file-added-label = "[+]";
|
||||
file-decoration-style = "none";
|
||||
file-modified-label = "[*]";
|
||||
file-removed-label = "[-]";
|
||||
file-renamed-label = "[>]";
|
||||
file-style = "bold reverse";
|
||||
file-transformation = "s/$/ ░▒▓/";
|
||||
hunk-header-decoration-style = "none";
|
||||
hunk-header-file-style = "bold";
|
||||
hunk-header-line-number-style = "bold";
|
||||
hunk-header-style = "bold";
|
||||
hunk-label = "⯁";
|
||||
hunk-label-style = "bold";
|
||||
line-numbers = true;
|
||||
max-line-distance = "0.9";
|
||||
navigate = true;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
apply.whitespace = "nowarn";
|
||||
blame.date = "relative";
|
||||
branch.main.rebase = true;
|
||||
color = {
|
||||
branch = "auto";
|
||||
diff = "auto";
|
||||
status = "auto";
|
||||
ui = "auto";
|
||||
};
|
||||
column.ui = "auto";
|
||||
core = {
|
||||
compression = 3;
|
||||
looseCompression = 3;
|
||||
excludesfile = "~/.config/git/ignore";
|
||||
};
|
||||
fetch = {
|
||||
prune = true;
|
||||
prunetags = true;
|
||||
showForcedUpdates = true;
|
||||
};
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
ssh = {
|
||||
allowedSignersFile = "${config.home.homeDirectory}/.ssh/authorized_keys";
|
||||
defaultKeyCommand = "${config.home.homeDirectory}/.local/bin/git-signing-key";
|
||||
};
|
||||
};
|
||||
init.defaultBranch = "main";
|
||||
merge.conflictstyle = "zdiff3";
|
||||
pack = {
|
||||
compression = 3;
|
||||
threads = 0;
|
||||
};
|
||||
pull.rebase = true;
|
||||
push.default = "tracking";
|
||||
rebase.autosquash = true;
|
||||
rerere.enabled = true;
|
||||
tag.sort = "-v:refname";
|
||||
user.useConfigOnly = true;
|
||||
};
|
||||
|
||||
ignores = [
|
||||
"*~"
|
||||
"*.a"
|
||||
"*.class"
|
||||
"*.iml"
|
||||
"*.ipr"
|
||||
"*.iwr"
|
||||
"*.iws"
|
||||
"*.la"
|
||||
"*.o"
|
||||
"*.pyc"
|
||||
"*.so"
|
||||
"*.swp"
|
||||
".direnv"
|
||||
".idea"
|
||||
".null-ls_*"
|
||||
];
|
||||
|
||||
signing = {
|
||||
key = null;
|
||||
signByDefault = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.gitui = {
|
||||
enable = true;
|
||||
keyConfig = ''
|
||||
(
|
||||
open_help: Some(( code: F(1), modifiers: "")),
|
||||
move_left: Some(( code: Char('h'), modifiers: "")),
|
||||
move_right: Some(( code: Char('l'), modifiers: "")),
|
||||
move_up: Some(( code: Char('k'), modifiers: "")),
|
||||
move_down: Some(( code: Char('j'), modifiers: "")),
|
||||
popup_up: Some(( code: Char('p'), modifiers: "CONTROL")),
|
||||
popup_down: Some(( code: Char('n'), modifiers: "CONTROL")),
|
||||
page_up: Some(( code: Char('b'), modifiers: "CONTROL")),
|
||||
page_down: Some(( code: Char('f'), modifiers: "CONTROL")),
|
||||
home: Some(( code: Char('g'), modifiers: "")),
|
||||
end: Some(( code: Char('G'), modifiers: "SHIFT")),
|
||||
shift_up: Some(( code: Char('K'), modifiers: "SHIFT")),
|
||||
shift_down: Some(( code: Char('J'), modifiers: "SHIFT")),
|
||||
edit_file: Some(( code: Char('I'), modifiers: "SHIFT")),
|
||||
status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")),
|
||||
diff_reset_lines: Some(( code: Char('u'), modifiers: "")),
|
||||
diff_stage_lines: Some(( code: Char('s'), modifiers: "")),
|
||||
stashing_save: Some(( code: Char('w'), modifiers: "")),
|
||||
stashing_toggle_index: Some(( code: Char('m'), modifiers: "")),
|
||||
stash_open: Some(( code: Char('l'), modifiers: "")),
|
||||
abort_merge: Some(( code: Char('M'), modifiers: "SHIFT")),
|
||||
)
|
||||
'';
|
||||
theme = ''
|
||||
(
|
||||
selection_bg: Some(Black),
|
||||
selection_fg: Some(Reset),
|
||||
cmdbar_bg: Some(Reset),
|
||||
cmdbar_extra_lines_bg: Some(Reset),
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
package = pkgs.jujutsu-openssh;
|
||||
};
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = lib.mkIf config.shelman.desktop.enable {
|
||||
|
||||
home.packages = with pkgs; [ tor-browser ];
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
package = pkgs.ungoogled-chromium;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.shelman.desktop.enable {
|
||||
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
extraConfig = builtins.readFile ./../files/config/wezterm/wezterm.lua;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue