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

15
home-manager/home.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, pkgs, lib, ... }: {
imports = [
./modules/bundle.nix
];
home = {
username = "zeph";
homeDirectory = "/home/zeph";
stateVersion = "25.05";
packages = with pkgs; [
];
};
}

View file

@ -0,0 +1,14 @@
{ config, pkgs, ...}: {
# This is to launch fish interactively, to avoid problems
# with fish's non-POSIX compliance
programs.bash = {
enable = true;
initExtra = ''
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
'';
};
}

View file

@ -0,0 +1,14 @@
{
imports = [
./bash.nix
./fish.nix
./helix.nix
./hypr/bundle.nix
./mako.nix
./fuzzel.nix
./foot.nix
./git.nix
./starship.nix
./desktop_overrides.nix
];
}

View file

@ -0,0 +1,46 @@
{pkgs, ...}: {
# This file contains all the desktop entries that I don't want in my app finder,
# either because I open them with shortcuts or because I never use them (but they come with an app)
xdg.desktopEntries = {
# I open this with a shortcut
"thunar" = {
name = "thunar";
noDisplay = true;
};
# This is opened from inside thunar
"thunar-settings" = {
name = "thunar-settings";
noDisplay = true;
};
# This comes installed with thunar and I don't want it
"thunar-bulk-rename" = {
name = "thunar-bulk-rename";
noDisplay = true;
};
# I open this with a shortcut
"foot" = {
name = "foot";
noDisplay = true;
};
"foot-server" = {
name = "foot-server";
noDisplay = true;
};
"footclient" = {
name = "footclient";
noDisplay = true;
};
# Fixes missing icons
"protonvpn-app" = {
name = "Proton VPN";
icon = "${pkgs.protonvpn-gui}/share/pixmaps/proton-vpn-logo.svg";
};
# "sioyek" = {
# name = "Sioyek";
# icon = "${pkgs.sioyek}/share/pixmaps/sioyek-linux-logo.png";
# };
};
}

View file

@ -0,0 +1,23 @@
{ config, pkgs, ... }: {
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting
starship init fish | source
'';
shellAliases = let flakeDir = "~/nix"; in {
rb = "sudo nixos-rebuild switch --flake ${flakeDir}";
upg = "sudo nix flake update --flake ${flakeDir} && sudo nixos-rebuild switch --flake ${flakeDir}";
hms = "home-manager switch --flake ${flakeDir}";
ed = "hx ${flakeDir}";
ff = "fastfetch -c neofetch";
ls = "lsd";
};
shellAbbrs = {
dcu = "podman-compose up";
dcub = "podman-compose up --build";
dcd = "podman-compose down";
dcdv = "podman-compose down -v";
};
};
}

View file

@ -0,0 +1,33 @@
{ config, pkgs, ... }: {
programs.foot.enable = true;
programs.foot.settings = {
main = {
font = "IosevkaTerm Nerd Font Mono:size=12";
font-italic = "IosevkaTerm Nerd Font Mono:size=12";
};
colors = {
alpha = 0.85;
# Gruvbox; copied from https://codeberg.org/dnkl/foot/src/branch/master/themes/gruvbox-dark
background="282828";
foreground="ebdbb2";
regular0="282828";
regular1="cc241d";
regular2="98971a";
regular3="d79921";
regular4="458588";
regular5="b16286";
regular6="689d6a";
regular7="a89984";
bright0="928374";
bright1="fb4934";
bright2="b8bb26";
bright3="fabd2f";
bright4="83a598";
bright5="d3869b";
bright6="8ec07c";
bright7="ebdbb2";
};
};
}

View file

@ -0,0 +1,27 @@
{ config, pkgs, ... }: {
programs.fuzzel.enable = true;
programs.fuzzel.settings = {
main = {
image-size-ratio = 1;
cache = "/dev/null";
};
colors = {
background = "#282828ff";
text = "#ebdbb2ff";
# prompt = "#d65d0eff";
prompt = "#458588ff";
placeholder = "#bdae93ff";
input = "#d5c4a1ff";
match = "#83a598ff";
selection = "#504945ff";
selection-text = "#fbf1c7ff";
selection-match = "#fabd2fff";
counter = "#928374ff";
border = "#d65d0eff";
};
border = {
width = 2;
radius = 0;
};
};
}

View file

@ -0,0 +1,17 @@
{ config, pkgs, ... }: {
programs.git = {
enable = true;
settings = {
user.name = "Zeph Levy";
user.email = "171337931+ZephLevy@users.noreply.github.com";
core = {
editor = "hx";
};
init = {
defaultBranch = "main";
};
credential.helper = "/run/current-system/sw/bin/git-credential-libsecret";
pull.rebase = true;
};
};
}

View file

@ -0,0 +1,106 @@
{ config, pkgs, ...}: {
programs.helix.enable = true;
programs.helix.settings = {
# theme = "everforest_dark";
theme = "gruvbox";
editor = {
mouse = true;
auto-save = true;
line-number = "relative";
rulers = [ 100 ];
cursorline = true;
cursorcolumn = true;
bufferline = "always";
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
soft-wrap = {
enable = true;
wrap-indicator = " ";
};
whitespace = {
render = {
space = "all";
tab = "all";
newline = "none";
};
characters = {
space = " ";
nbsp = "";
tab = "";
tabpad = "·";
newline = "";
};
};
statusline = {
left = [ "mode" "spinner" "diagnostics" ];
center = [ "file-name" "separator" "version-control" "separator"];
separator = "";
mode.normal = "NORMAL";
mode.insert = "INSERT";
mode.select = "SELECT";
};
lsp.display-inlay-hints = false;
indent-guides = {
render = true;
character = "";
skip-levels = 1;
};
file-picker.hidden = false;
};
keys = {
normal = {
l = "insert_mode";
esc = ["collapse_selection" "keep_primary_selection"];
n = "move_char_left";
o = "move_char_right";
e = "move_line_down";
i = "move_line_up";
q = "goto_line_end";
h = "goto_line_start";
j = "search_next";
J = "search_prev";
f = "open_below";
F = "open_above";
"C-o" = ":buffer-close-others";
"C-x" = ":buffer-close";
p = "paste_before";
y = "yank_main_selection_to_clipboard";
up = "no_op";
down = "no_op";
left = "no_op";
right = "no_op";
};
select = {
n = "extend_char_left";
o = "extend_char_right";
e = "extend_line_down";
i = "extend_line_up";
q = "goto_line_end";
h = "goto_line_start";
up = "no_op";
down = "no_op";
left = "no_op";
right = "no_op";
};
insert = {
"S-ret" = "open_below";
};
};
};
}

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; }
'';
};
}

View file

@ -0,0 +1,43 @@
{ pkgs, ... }:
{
services.mako = {
enable = true;
settings = {
font = "Monospace 10";
anchor = "top-right";
# margin = "10,40"; # right=10px, top=40px
width = 320;
height = 70;
padding = 10;
border-size = 2;
default-timeout = 8000;
background-color = "#282828";
text-color = "#ebdbb2";
border-color = "#458588";
};
extraConfig = ''
[urgency=low]
background-color=#3c3836
text-color=#ebdbb2
border-color=#928374
default-timeout=6000
[urgency=normal]
background-color=#282828
text-color=#ebdbb2
border-color=#458588
default-timeout=8000
[urgency=critical]
background-color=#cc241d
text-color=#282828
border-color=#fb4934
default-timeout=0
'';
};
}

View file

@ -0,0 +1,127 @@
{ config, pkgs, lib, ... }: {
programs.starship = {
enable = true;
settings = {
"$schema" = "https://starship.rs/config-schema.json";
format = lib.concatStrings [
" "
"[](color_orange)"
"$os"
"$username"
"[](bg:color_yellow fg:color_orange)"
"$directory"
"[](fg:color_yellow bg:color_aqua)"
"$git_branch"
"$git_status"
"[](fg:color_aqua bg:color_blue)"
"$rust"
"$golang"
"$nodejs"
"$python"
"[](fg:color_blue bg:color_bg3)"
"$conda"
"$pixi"
"[](fg:color_bg3 bg:color_bg1)"
"$time"
"[ ](fg:color_bg1)"
"$line_break"
" "
"$character"
];
palette = "gruvbox_dark";
palettes = {
gruvbox_dark = {
color_fg0 = "#fbf1c7";
color_bg1 = "#3c3836";
color_bg3 = "#665c54";
color_blue = "#458588";
color_aqua = "#689d6a";
color_green = "#98971a";
color_orange = "#d65d0e";
color_purple = "#b16286";
color_red = "#cc241d";
color_yellow = "#d79921";
};
};
os = {
disabled = false;
style = "bg:color_orange fg:color_fg0";
symbols = {
NixOS = "";
};
};
username = {
show_always = true;
style_user = "bg:color_orange fg:color_fg0";
style_root = "bg:color_orange fg:color_fg0";
format = "[ $user ]($style)";
};
directory = {
style = "fg:color_fg0 bg:color_yellow";
format = "[ $path ]($style)";
truncation_length = 3;
truncation_symbol = "/";
};
git_branch = {
symbol = "";
style = "bg:color_aqua";
format = "[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)";
};
git_status = {
style = "bg:color_aqua";
format = "[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)";
};
nodejs = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
rust = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
golang = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
python = {
symbol = "";
style = "bg:color_blue";
format = "[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)";
};
time = {
disabled = false;
time_format = "%R";
style = "bg:color_bg1";
format = "[[ $time ](fg:color_fg0 bg:color_bg1)]($style)";
};
line_break = { disabled = false; };
character = {
disabled = false;
success_symbol = "[](bold fg:color_green)";
error_symbol = "[](bold fg:color_red)";
vimcmd_symbol = "[](bold fg:color_green)";
vimcmd_replace_one_symbol = "[](bold fg:color_purple)";
vimcmd_replace_symbol = "[](bold fg:color_purple)";
vimcmd_visual_symbol = "[](bold fg:color_yellow)";
};
};
};
}