restructure home manager configs

This commit is contained in:
2025-06-24 18:47:45 +02:00
parent 6ca250dbaf
commit fe586d4a56
32 changed files with 58 additions and 58 deletions

10
modules/hm/btop.nix Normal file
View File

@ -0,0 +1,10 @@
{
programs.btop = {
enable = true;
settings = {
color_theme = "gruvbox_dark_v2";
theme_background = false;
update_ms = 1000;
};
};
}

View File

@ -0,0 +1,65 @@
{
pkgs,
pkgs-unstable,
...
}: {
# Cursor configuration
programs.vscode = {
enable = true;
package = pkgs-unstable.code-cursor;
profiles.default.enableUpdateCheck = false;
profiles.default.enableExtensionUpdateCheck = false;
profiles.default.extensions = with pkgs.vscode-extensions; [
ms-python.python # Python language
ms-python.vscode-pylance # Python LS
ms-python.black-formatter # Python formatter
dbaeumer.vscode-eslint # ESLint JS
esbenp.prettier-vscode # Prettier code formatting
bradlc.vscode-tailwindcss # Tailwind IntelliSense
unifiedjs.vscode-mdx # MDX language
waderyan.gitblame # Git blame
jdinhlife.gruvbox # Gruvbox theme
vscode-icons-team.vscode-icons # Icons
golang.go # Go language
budparr.language-hugo-vscode # HUGO language
bungcip.better-toml # TOML
jnoortheen.nix-ide # Nix language
redhat.vscode-yaml # YAML
ms-vscode.hexeditor # Hex editor
# Manually install these (not available as nixpkgs)
# pgourlain.erlang # Erlang language # not available
# csstools.postcss # PostCSS language # not available
];
profiles.default.userSettings = {
"terminal.external.linuxExec" = "ghostty";
"terminal.explorerKind" = "external";
"terminal.integrated.rescaleOverlappingGlyphs" = false;
"terminal.integrated.fontFamily" = "'Symbols Nerd Font Mono'";
"files.autoSave" = "onFocusChange";
"editor.fontFamily" = "'Intel One Mono', 'Droid Sans Mono', 'monospace', monospace";
"editor.tabSize" = 2;
"editor.wordWrap" = "on";
"workbench.colorTheme" = "Gruvbox Dark Medium";
"workbench.iconTheme" = "vscode-icons";
"editor.defaultFormatter" = "esbenp.prettier-vscode";
"editor.fontLigatures" = "'ss01'";
"editor.formatOnSave" = true;
"prettier.printWidth" = 120;
"prettier.proseWrap" = "always";
"vsicons.dontShowNewVersionMessage" = true;
"editor.minimap.enabled" = true;
"cursor.cpp.enablePartialAccepts" = true;
"cursor.diffs.useCharacterLevelDiffs" = true;
"nix.enableLanguageServer" = true;
"[nix]" = {
"editor.defaultFormatter" = "jnoortheen.nix-ide";
};
};
};
}

10
modules/hm/cursor.nix Normal file
View File

@ -0,0 +1,10 @@
{pkgs, ...}: {
home.pointerCursor = {
enable = true;
size = 32;
#name = "capitaine-cursors-themed";
#package = pkgs.capitaine-cursors-themed;
name = "capitaine-cursors";
package = pkgs.capitaine-cursors;
};
}

11
modules/hm/ghostty.nix Normal file
View File

@ -0,0 +1,11 @@
{
programs.ghostty = {
enable = true;
enableFishIntegration = true;
settings = {
"font-family" = "Intel One Mono";
"theme" = "GruvboxDark";
"background-opacity" = 0.6;
};
};
}

33
modules/hm/gtk.nix Normal file
View File

@ -0,0 +1,33 @@
{pkgs, ...}: {
home.packages = with pkgs; [
dconf
gruvbox-dark-gtk
];
gtk = {
enable = true;
theme = {
name = "Gruvbox-Dark-B";
package = pkgs.gruvbox-dark-gtk;
};
iconTheme = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
};
};
# ================================
# GTK THEMING CONFIGURATION
# ================================
# dconf: Configure GTK applications and GNOME settings
dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface" = {
gtk-theme = "Gruvbox-Dark-B";
color-scheme = "prefer-dark";
};
};
};
}

View File

@ -0,0 +1,3 @@
{
home.stateVersion = "25.05"; # Dont change
}

34
modules/hm/hypridle.nix Normal file
View File

@ -0,0 +1,34 @@
{
services.hypridle = {
enable = true;
settings = {
general = {
ignore_dbus_inhibit = false;
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
lock_cmd = "pidof hyprlock || hyprlock";
};
listener = [
{
timeout = 180; # 3min.
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = "brightnessctl -r"; # monitor backlight restore.
}
{
timeout = 600; # 10min.
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 900; # 15min.
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on && brightnessctl -r"; # screen on when activity is detected after timeout has fired.
}
#{
# timeout = 1800; # 30min.
# on-timeout = "systemctl suspend"; # suspend pc
#}
];
};
};
}

156
modules/hm/hyprland.nix Normal file
View File

@ -0,0 +1,156 @@
let
colors = import ../gruvbox-theme.nix;
in {
# Hyprland settings
wayland.windowManager.hyprland = {
enable = true;
settings = {
exec-once = [
"hyprpaper"
"hypridle"
"hyprsunset"
"hyprctl setcursor capitaine-cursors-white 32" # Set mouse cursor
"wl-paste --type text --watch cliphist store" # Stores only text data
"wl-paste --type image --watch cliphist store" # Stores only image data
];
input = {
kb_layout = "se";
kb_variant = "";
kb_model = "";
kb_options = "";
kb_rules = "";
kb_file = "";
follow_mouse = 1;
sensitivity = 0;
accel_profile = "flat";
repeat_delay = 250;
repeat_rate = 40;
touchpad = {
natural_scroll = true;
clickfinger_behavior = true;
};
};
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
workspace_swipe_direction_lock = false;
};
"$mod" = "SUPER";
"$terminal" = "ghostty";
"$filemanager" = "nautilus";
"$menu" = "rofi -show-icons -show drun";
general = {
gaps_in = 5;
gaps_out = 15;
border_size = 1;
"col.active_border" = "rgba(${colors.gruvbox-rgb.bright_orange},1.0) rgba(${colors.gruvbox-rgb.red},1.0) 45deg";
"col.inactive_border" = "rgba(${colors.gruvbox-rgb.bg4},0.66)";
layout = "dwindle";
allow_tearing = false;
};
decoration = {
rounding = 10;
rounding_power = 4;
blur = {
enabled = true;
xray = true;
size = 4;
passes = 4;
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default, slidevert"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
smart_split = true;
};
# Window rules
windowrulev2 = [
# Nice transparency for some apps (unless in fullscreen)
"opacity 0.9,fullscreen:0,class:^(cursor)$"
"opacity 0.9,fullscreen:0,class:^(firefox)$"
"opacity 0.9,fullscreen:0,class:^(GitKraken)$"
"opacity 0.9,fullscreen:0,class:^(obsidian)$"
# Keep Rofi focused
"stayfocused, class:^(Rofi)$"
];
# Bindings
bind =
[
"$mod, RETURN, exec, $terminal" # Open terminal
"$mod, C, killactive" # Kill active window
"$mod, E, exec, $filemanager" # Open file manager
"$mod, SPACE, exec, $menu" # Show menu (rofi)
"$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" # Show Clipboard history
", PRINT, exec, hyprshot -m region" # Screenshot region
"$mod, PRINT, exec, hyprshot -m window" # Screenshot window
"$mod, F, togglefloating" # Make active window floating
"$mod, L, exec, hyprlock" # Lock screen
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Workspace navigation
"$mod, J, workspace, r+1" # vim motions Down
"$mod, K, workspace, r-1" # vim motions Up
]
++ (
# workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists (builtins.genList (
i: let
ws = i + 1;
in [
"$mod, code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
)
9)
);
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
# l -> do stuff even when locked
# e -> repeats when key is held
bindle = [
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ --limit 1"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-"
", XF86MonBrightnessUp, exec, brightnessctl set +10%"
", XF86MonBrightnessDown, exec, brightnessctl set 10%-"
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
];
};
};
}

75
modules/hm/hyprlock.nix Normal file
View File

@ -0,0 +1,75 @@
let
colors = import ../gruvbox-theme.nix;
in {
programs.hyprlock = {
enable = true;
settings = {
background = {
# Background image is set in host specific configuration
#path = "$HOME/git/nixos/modules/hm/images/sky.png";
blur_size = 3;
blur_passes = 4;
contrast = 1;
brightness = 0.5;
vibrancy = 0.2;
vibrancy_darkness = 0.2;
};
# GENERAL
general = {
no_fade_in = false;
no_fade_out = false;
hide_cursor = true;
grace = 0;
disable_loading_bar = true;
};
# INPUT FIELD
input-field = {
monitor = "";
size = "250, 60";
outline_thickness = 2;
dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.35; # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true;
outer_color = "rgba(${colors.gruvbox-rgb.blue}, 0.8)";
inner_color = "rgba(${colors.gruvbox-rgb.bg0}, 0.4)";
font_color = "rgba(${colors.gruvbox-rgb.fg1}, 1.0)";
placeholder_text = "Welcome $USER";
fade_on_empty = false;
rounding = -1;
check_color = "rgba(${colors.gruvbox-rgb.yellow}, 1.0)";
hide_input = false;
position = "0, -200";
halign = "center";
valign = "center";
};
# DATE
label = [
{
monitor = "";
text = "cmd[update:10000] echo \"$(date +\"%A, %B %d\")\"";
color = "rgba(${colors.gruvbox-rgb.fg2}, 1.0)";
font_size = 34;
font_family = "Intel One Mono";
position = "0, 300";
halign = "center";
valign = "center";
}
# TIME
{
monitor = "";
text = "cmd[update:2000] echo \"$(date +\"%H:%M\")\"";
color = "rgba(${colors.gruvbox-rgb.fg1}, 1.0)";
font_size = 94;
font_family = "Intel One Mono Bold";
position = "0, 200";
halign = "center";
valign = "center";
}
];
};
};
}

19
modules/hm/hyprsunset.nix Normal file
View File

@ -0,0 +1,19 @@
{
services.hyprsunset = {
enable = true;
transitions = {
sunrise = {
calendar = "*-*-* 06:00:00";
requests = [
["identity"]
];
};
sunset = {
calendar = "*-*-* 20:00:00";
requests = [
["temperature" "3000"]
];
};
};
};
}

BIN
modules/hm/images/control-panel.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
modules/hm/images/forest.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
modules/hm/images/nix.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
modules/hm/images/sky.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
modules/hm/images/statue.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
modules/hm/images/sunset-rocks.png (Stored with Git LFS) Normal file

Binary file not shown.

6
modules/hm/nextcloud.nix Normal file
View File

@ -0,0 +1,6 @@
{
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
}

137
modules/hm/rofi.nix Normal file
View File

@ -0,0 +1,137 @@
{config, ...}: let
colors = import ../gruvbox-theme.nix;
in {
programs.rofi = {
enable = true;
modes = [
"drun"
"window"
];
terminal = "ghostty";
font = "Intel One Mono 14";
location = "center";
theme = let
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
margin = 0;
padding = 0;
spacing = 0;
bg0 = mkLiteral "${colors.gruvbox.bg0}9A";
bg1 = mkLiteral "${colors.gruvbox.bg1}";
bg2 = mkLiteral "${colors.gruvbox.bg2}9A";
bg3 = mkLiteral "${colors.gruvbox.bg3}9A";
fg0 = mkLiteral "${colors.gruvbox.fg0}";
fg1 = mkLiteral "${colors.gruvbox.fg1}";
fg2 = mkLiteral "${colors.gruvbox.fg2}";
fg3 = mkLiteral "${colors.gruvbox.fg3}";
blue = mkLiteral "${colors.gruvbox.blue}";
orange = mkLiteral "${colors.gruvbox.orange}";
brightOrange = mkLiteral "${colors.gruvbox.bright_orange}";
brightBlue = mkLiteral "${colors.gruvbox.bright_blue}9A";
red = mkLiteral "${colors.gruvbox.red}";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@fg0";
};
"window" = {
background-color = mkLiteral "@bg0";
#transparency = mkLiteral "'real'";
width = mkLiteral "480";
border-radius = mkLiteral "8px";
border = mkLiteral "1px";
border-color = mkLiteral "@red";
};
"mainbox" = {
padding = mkLiteral "12px";
#children = mkLiteral "[inputbar, listview]";
};
"inputbar" = {
background-color = mkLiteral "@bg1";
border-color = mkLiteral "@orange";
border = mkLiteral "2px";
border-radius = mkLiteral "4px";
padding = mkLiteral "8px 16px";
spacing = mkLiteral "8px";
children = mkLiteral "[prompt, entry]";
};
"prompt" = {
text-color = mkLiteral "@brightOrange";
};
"entry" = {
placeholder = "Search";
placeholder-color = mkLiteral "@fg3";
};
"message" = {
margin = mkLiteral "12px 0 0";
border-radius = mkLiteral "4px";
border-color = mkLiteral "@bg2";
background-color = mkLiteral "@bg2";
};
"textbox" = {
padding = mkLiteral "8px 24px";
};
"listview" = {
background-color = mkLiteral "transparent";
margin = mkLiteral "12px 0 0";
lines = 10;
columns = 1;
};
"element" = {
padding = mkLiteral "8px 16px";
spacing = mkLiteral "8px";
border-radius = mkLiteral "4px";
#spacing = mkLiteral "8px";
};
"element normal active" = {
text-color = mkLiteral "@bg3";
};
"element alternate active" = {
text-color = mkLiteral "@bg3";
};
"element selected normal, element selected active" = {
background-color = mkLiteral "@brightBlue";
border = mkLiteral "2px";
border-color = mkLiteral "@blue";
};
"element-icon" = {
size = mkLiteral "1em";
vertical-align = mkLiteral "0.5";
};
"element-text" = {
text-color = mkLiteral "inherit";
#padding = mkLiteral "10px";
};
"element selected" = {
#text-color = mkLiteral "@bg1";
#border-color = mkLiteral "@orange";
};
"element-text.selected" = {
#background-color = mkLiteral "@orange-alt";
#text-color = mkLiteral "@orange";
};
};
};
}

79
modules/hm/ssh.nix Normal file
View File

@ -0,0 +1,79 @@
{
programs.ssh = {
enable = true;
serverAliveInterval = 60;
serverAliveCountMax = 2;
matchBlocks = {
"d10.csb.brainmill.com" = {
forwardAgent = true;
port = 22;
};
"prod-admin-jump1.infra.csbnet.se" = {
forwardAgent = true;
port = 22;
};
"prod-jump-got1.infra.brainmill.com" = {
forwardAgent = true;
port = 22;
};
"sw-fys-kt11-serv1.net.chsfg.se" = {
hostname = "10.2.13.10";
};
"sw-fys-kt11-kansli1.net.chsfg.se" = {
hostname = "10.2.13.11";
};
"sw-fys-kt11-kansli2.net.chsfg.se" = {
hostname = "10.2.13.12";
};
"sw-fys-kt11-reception1.net.chsfg.se" = {
hostname = "10.2.13.13";
};
"sw-fys-kt11-reception2.net.chsfg.se" = {
hostname = "10.2.13.14";
};
"sw-fys-gg39-kom.net.chsfg.se" = {
hostname = "10.1.13.10";
};
"sw-fys-gg39-skap.net.chsfg.se" = {
hostname = "10.1.13.11";
};
"sw-fys-ev1.net.chsfg.se" = {
hostname = "10.62.13.10";
};
"192.168.10.20" = {
hostname = "192.168.10.20";
user = "manager";
};
"192.168.10.50" = {
hostname = "192.168.10.50";
};
"gw1.net.chsfg.se" = {
forwardAgent = true;
hostname = "2a02:9a0:fffe:4::3";
};
"gw2.net.chsfg.se" = {
forwardAgent = true;
hostname = "2a02:9a0:fffe:4::5";
};
"cv11-stor-gw.net.chsfg.se" = {
proxyCommand = "ssh prod-admin-jump1.infra.csbnet.se /bin/nc %h 22";
hostname = "176.10.244.136";
user = "root";
port = 8822;
};
"tp2-core1.net.chsfg.se" = {
hostname = "192.168.10.52";
user = "nvg";
};
"gw-shg9d-ctk.net.chsfg.se" = {
hostname = "83.218.70.146";
user = "admin";
};
"lp5-core1.net.chsfg.se" = {
hostname = "192.168.10.51";
user = "nvg";
};
};
};
}

10
modules/hm/vim.nix Normal file
View File

@ -0,0 +1,10 @@
{
programs.vim = {
enable = true;
defaultEditor = true;
settings = {
number = true;
relativenumber = true;
};
};
}