Add NixOS config

This commit is contained in:
Zeph Levy 2025-11-11 16:09:55 +01:00
commit 6020d64797
43 changed files with 1372 additions and 0 deletions

View file

@ -0,0 +1,12 @@
{
imports = [
./hyprpaper/hyprpaper.nix
./hyprland.nix
./hypridle.nix
./hyprlock.nix
./hyprsunset.nix
./waybar.nix
./theming.nix
./cursor.nix
];
}

View file

@ -0,0 +1,3 @@
{ config, pkgs, ... }: {
home.file.".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/\"Capitaine Cursors (Gruvbox)\"";
}

View file

@ -0,0 +1,8 @@
{
services.hypridle.enable = true;
services.hypridle.settings = {
general = {
before_sleep_cmd = "pidof hyprlock || hyprlock";
};
};
}

View file

@ -0,0 +1,180 @@
{ config, pkgs, ... }: {
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = {
exec-once = [
"hyprpaper" "systemctl --user start hyprpolkitagent"
"hyprctl setcursor \"Capitaine Cursors (Gruvbox)\" 24"
"swayosd-server"
"hyprsunset"
];
monitor = [
"eDP-1,2880x1920@120,auto,auto"
",preferred,auto,2,"
];
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
"col.active_border" = "rgba(d65d0eff)";
"col.inactive_border" = "rgba(181926ff)";
resize_on_border = false;
allow_tearing = false;
layout = "master";
};
master = {
new_status = "slave";
};
decoration = {
rounding = 0;
active_opacity = 1.0;
inactive_opacity = 1.0;
shadow = {
enabled = true;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
};
blur = {
enabled = true;
size = 3;
passes = 1;
vibrancy = 0.1696;
};
};
animations = {
enabled = true;
bezier = [
"easeOutQuint,0.23,1,0.32,1"
"easeInOutCubic,0.65,0.05,0.36,1"
"linear,0,0,1,1"
"almostLinear,0.5,0.5,0.75,1.0"
"quick,0.15,0,0.1,1"
];
animation = [
"global, 1, 10, default"
"border, 1, 5.39, easeOutQuint"
"windows, 1, 4.79, easeOutQuint"
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
"windowsOut, 1, 1.49, linear, popin 87%"
"fadeIn, 1, 1.73, almostLinear"
"fadeOut, 1, 1.46, almostLinear"
"fade, 1, 3.03, quick"
"layers, 1, 3.81, easeOutQuint"
"layersIn, 1, 4, easeOutQuint, fade"
"layersOut, 1, 1.5, linear, fade"
"fadeLayersIn, 1, 1.79, almostLinear"
"fadeLayersOut, 1, 1.39, almostLinear"
"workspaces, 1, 1.94, almostLinear, fade"
"workspacesIn, 1, 1.21, almostLinear, fade"
"workspacesOut, 1, 1.94, almostLinear, fade"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = false;
};
input = {
kb_layout = "us,us";
kb_variant = "colemak_dh_iso,";
kb_options = "grp:alt_shift_toggle,compose:ralt";
follow_mouse = 1;
sensitivity = -0.15;
touchpad = {
natural_scroll = true;
disable_while_typing = false;
};
};
"$mainMod" = "SUPER";
"$terminal" = "foot";
"$fileManager" = "thunar";
"$menu" = "fuzzel";
bind = [
"$mainMod, RETURN, exec, $terminal"
"$mainMod, Q, killactive,"
"$mainMod, T, exec, $fileManager"
"$mainMod, V, togglefloating,"
"$mainMod, SPACE, exec, $menu"
"$mainMod, P, pseudo,"
"$mainMod, J, togglesplit,"
"$mainMod, F, fullscreen, 0"
"$mainMod, N, movefocus, l"
"$mainMod, O, movefocus, r"
"$mainMod, I, movefocus, u"
"$mainMod, E, movefocus, d"
"$mainMod, H, layoutmsg, swapwithmaster auto"
"$mainMod, M, layoutmsg, cyclenext"
"$mainMod, K, layoutmsg, cycleprev"
"$mainMod SHIFT, M, layoutmsg, swapnext"
"$mainMod SHIFT, K, layoutmsg, swapprev"
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
# Screenshots
"$mainMod, 0, exec, hyprshot -m region --clipboard-only"
"$mainMod SHIFT, 0, exec, hyprshot -m region"
"$mainMod, 9, exec, hyprshot -m window --clipboard-only"
"$mainMod SHIFT, 9, exec, hyprshot -m window"
"$mainMod, 8, exec, hyprshot -m output --clipboard-only"
"$mainMod SHIFT, 8, exec, hyprshot -m output"
"$mainMod SHIFT, 1, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
"$mainMod SHIFT, 3, movetoworkspace, 3"
"$mainMod SHIFT, 4, movetoworkspace, 4"
];
bindel = [
",XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise"
",XF86AudioLowerVolume, exec, swayosd-client --output-volume lower"
",XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
",XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
];
bindl = [
", XF86AudioNext, exec, playerctl next"
", XF86AudioPause, exec, playerctl play-pause"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
];
windowrule = [
"suppressevent maximize, class:.*"
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
];
};
}

View file

@ -0,0 +1,82 @@
{
programs.hyprlock.enable = true;
programs.hyprlock.settings = {
"$font" = "JetBrainsMono NF";
general = {
hide_cursor = true;
};
auth = {
fingerprint = {
enabled = true;
ready_message = "Scan fingerprint to unlock";
present_message = "Scanning...";
retry_delay = 250;
};
};
animations = {
enabled = true;
bezier = [ "linear,1,1,0,0" ];
animation = [
"fadeIn, 1, 5, linear"
"fadeOut, 1, 5, linear"
"inputFieldDots, 1, 2, linear"
];
};
background = {
path = "/home/zeph/nix/home-manager/modules/hypr/hyprpaper/wallpaper.png";
blur_passes = 3;
};
input-field = {
size = "20%, 5%";
outline_thickness = 3;
inner_color = "rgba(0, 0, 0, 0.0)";
outer_color = "rgba(d65d0eff) rgba(d6740eff) 45deg";
check_color = "rgba(00ff99ee) rgba(ff6633ee) 45deg";
fail_color = "rgba(ff6633ee) rgba(ff0066ee) 40deg";
font_color = "rgb(143, 143, 143)";
fade_on_empty = false;
rounding = 0;
font_family = "$font";
placeholder_text = "Input password...";
fail_text = "$PAMFAIL";
position = "0, -20";
halign = "center";
valign = "center";
};
label = [
{
text = "$TIME";
font_size = 90;
font_family = "$font";
position = "-30, 0";
halign = "right";
valign = "top";
}
{
text = "cmd[update:60000] date +\"%A, %d %B %Y\"";
font_size = 25;
font_family = "$font";
position = "-30, -150";
halign = "right";
valign = "top";
}
{
text = "<i>Hello, Zeph.</i>";
font_size = 50;
font_family = "$font";
halign = "center";
valign = "center";
position = "0, 5%";
}
];
};
}

View file

@ -0,0 +1,12 @@
{ config, pkgs, ... }: {
services.hyprpaper.enable = true;
services.hyprpaper.settings = {
preload = [
"/home/zeph/nix/home-manager/modules/hypr/hyprpaper/wallpaper.png"
];
wallpaper = [
", /home/zeph/nix/home-manager/modules/hypr/hyprpaper/wallpaper.png"
];
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View file

@ -0,0 +1,16 @@
{
services.hyprsunset.enable = true;
services.hyprsunset.settings = {
profile = [
{
time = "7:30";
identity = true;
}
{
time = "20:00";
temperature = 5000;
gamma = 0.8;
}
];
};
}

View file

@ -0,0 +1,48 @@
{ config, pkgs, ... }:
{
gtk = {
enable = true;
theme = {
package = pkgs.gruvbox-gtk-theme;
name = "Gruvbox-Dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
cursorTheme = {
package = pkgs.capitaine-cursors;
name = "Capitaine Cursors (Gruvbox)";
size = 24;
};
};
qt = {
enable = true;
platformTheme.name = "gtk";
};
dconf.settings = {
"org/gnome/desktop/interface" = {
gtk-theme = "Gruvbox-Dark";
icon-theme = "Adwaita";
cursor-theme = "Capitaine Cursors (Gruvbox)";
cursor-size = 24;
color-scheme = "prefer-dark";
};
};
home.sessionVariables = {
XCURSOR_THEME = "Capitaine Cursors (Gruvbox)";
XCURSOR_SIZE = "24";
HYPRCURSOR_SIZE = "24";
GTK_THEME = "Gruvbox-Dark";
NIXOS_OZONE_WL = "1";
ELECTRON_OZONE_PLATFORM_HINT = "wayland";
GDK_BACKEND = "wayland";
};
}

View file

@ -0,0 +1,138 @@
{ config, pkgs, ... }: {
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 26;
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "clock" ];
modules-right = [ "cpu" "memory" "temperature" "battery" ];
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = true;
format = "{icon}";
format-icons = {
"1" = "";
"2" = "󰖟";
"3" = "";
"4" = "󰝚";
active = "";
default = "";
};
persistent-workspaces."*" = 4;
};
"clock" = {
# format = " {:%a %d %b  %H:%M}";
format = " {:%H:%M:%S}";
tooltip-format = " {:%a, %d %b}";
interval = 1;
};
"cpu" = {
format = " {usage: >3}%";
};
"memory" = {
format = " {used:0.1f}G";
tooltip = false;
};
"temperature" = {
format = " {temperatureC}°C";
tooltip = false;
};
"battery" = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-icons = [ "" "" "" "" "" ];
};
};
};
style = ''
/* Gruvbox palette */
@define-color bg #282828;
@define-color bg1 #3c3836;
@define-color fg #ebdbb2;
@define-color red #cc241d;
@define-color green #98971a;
@define-color yellow #d79921;
@define-color blue #458588;
@define-color purple #b16286;
@define-color aqua #689d6a;
@define-color orange #d65d0e;
* {
font-family: "JetBrainsMono Nerd Font", monospace;
font-size: 14px;
font-weight: bold;
border: none;
padding: 0;
margin: 0;
color: @fg;
}
window#waybar {
background: transparent;
border: none;
}
/* All modules have boxy container */
#workspaces,
#clock,
#cpu,
#memory,
#temperature,
#battery {
background-color: @bg1;
margin: 6px 4px; /* keep normal spacing between modules */
padding: 4px 8px; /* module padding stays same */
border: 2px solid @orange;
border-radius: 0;
}
#workspaces {
margin-left: 10px
}
#battery {
margin-right: 10px
}
/* Workspaces buttons */
#workspaces button {
color: @fg;
background: none;
border: none;
padding: 0 6px; /* normal spacing between workspace buttons */
}
#workspaces button.focused {
color: @yellow;
background: none;
}
#workspaces button:hover {
color: @orange;
}
#clock { color: @blue; }
#cpu { color: @green; }
#memory { color: @purple; }
#temperature { color: @aqua; }
#temperature.critical { color: @red; }
#battery { color: @fg; }
#battery.charging { color: @blue; }
#battery.critical:not(.charging) { color: @red; }
'';
};
}