Initial NixOS config

This commit is contained in:
2025-11-19 08:42:21 +01:00
commit 61adc10c49
14 changed files with 1645 additions and 0 deletions

83
home/home.nix Normal file
View File

@@ -0,0 +1,83 @@
{ config, pkgs, inputs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should manage
home.username = "yourusername";
home.homeDirectory = "/home/yourusername";
# Packages to install for this user
home.packages = with pkgs; [
# Browsers
firefox
# Communication
discord
# Media
mpv
# Text editors
vscode
# Terminal tools
neofetch
# Additional ricing tools
cava # Audio visualizer
cmatrix # Matrix effect
pipes # Animated pipes
];
# Import Hyprland home config
imports = [
./hyprland.nix
./waybar.nix
];
# Git configuration
programs.git = {
enable = true;
userName = "crib";
userEmail = "haugseth.martin@gmail.com";
};
# ZSH configuration
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "eza -la";
ls = "eza";
cat = "bat";
vim = "nvim";
update = "sudo nixos-rebuild switch --flake ~/.config/nixos#myhost";
};
oh-my-zsh = {
enable = true;
theme = "robbyrussell";
plugins = [ "git" "sudo" "docker" "kubectl" ];
};
};
# Kitty terminal configuration
programs.kitty = {
enable = true;
theme = "Tokyo Night";
font.name = "JetBrainsMono Nerd Font";
font.size = 12;
settings = {
background_opacity = "0.9";
confirm_os_window_close = 0;
};
};
# This value determines the Home Manager release
home.stateVersion = "24.05";
# Let Home Manager install and manage itself
programs.home-manager.enable = true;
}

194
home/hyprland.nix Normal file
View File

@@ -0,0 +1,194 @@
{ config, pkgs, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
settings = {
# Monitor configuration
monitor = ",preferred,auto,1";
# Startup applications
exec-once = [
"waybar"
"dunst"
"hyprpaper"
"nm-applet --indicator"
"blueman-applet"
];
# Environment variables
env = [
"XCURSOR_SIZE,24"
"QT_QPA_PLATFORMTHEME,qt5ct"
];
# Input configuration
input = {
kb_layout = "us";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
};
sensitivity = 0;
};
# General settings
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
allow_tearing = false;
};
# Decoration
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
};
# Animations
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"
];
};
# Layout
dwindle = {
pseudotile = true;
preserve_split = true;
};
master = {
new_status = "master";
};
# Gestures
gestures = {
workspace_swipe = true;
};
# Misc
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
};
# Window rules
windowrulev2 = [
"suppressevent maximize, class:.*"
"float, class:^(pavucontrol)$"
"float, class:^(blueman-manager)$"
];
# Keybindings
"$mainMod" = "SUPER";
bind = [
# Program launches
"$mainMod, Return, exec, kitty"
"$mainMod, Q, killactive,"
"$mainMod, M, exit,"
"$mainMod, E, exec, thunar"
"$mainMod, V, togglefloating,"
"$mainMod, D, exec, wofi --show drun"
"$mainMod, P, pseudo,"
"$mainMod, J, togglesplit,"
"$mainMod, F, fullscreen,"
# Screenshot
"$mainMod SHIFT, S, exec, grim -g \"$(slurp)\" - | wl-copy"
", Print, exec, grim -g \"$(slurp)\" ~/Pictures/screenshot_$(date +%Y%m%d_%H%M%S).png"
# Move focus
"$mainMod, left, movefocus, l"
"$mainMod, right, movefocus, r"
"$mainMod, up, movefocus, u"
"$mainMod, down, movefocus, d"
# Switch workspaces
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
"$mainMod, 5, workspace, 5"
"$mainMod, 6, workspace, 6"
"$mainMod, 7, workspace, 7"
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
# Move active window to workspace
"$mainMod SHIFT, 1, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
"$mainMod SHIFT, 3, movetoworkspace, 3"
"$mainMod SHIFT, 4, movetoworkspace, 4"
"$mainMod SHIFT, 5, movetoworkspace, 5"
"$mainMod SHIFT, 6, movetoworkspace, 6"
"$mainMod SHIFT, 7, movetoworkspace, 7"
"$mainMod SHIFT, 8, movetoworkspace, 8"
"$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10"
# Scroll through workspaces
"$mainMod, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
];
# Mouse bindings
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
# Volume and brightness keys
bindel = [
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
", XF86MonBrightnessUp, exec, brightnessctl s 10%+"
", XF86MonBrightnessDown, exec, brightnessctl s 10%-"
];
};
};
# Hyprpaper configuration
services.hyprpaper = {
enable = true;
settings = {
preload = [ "~/wallpapers/default.jpg" ];
wallpaper = [ ",~/wallpapers/default.jpg" ];
splash = false;
};
};
}

175
home/waybar.nix Normal file
View File

@@ -0,0 +1,175 @@
{ config, pkgs, ... }:
{
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
modules-left = [ "hyprland/workspaces" "hyprland/window" ];
modules-center = [ "clock" ];
modules-right = [ "pulseaudio" "network" "cpu" "memory" "battery" "tray" ];
"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";
format-icons = {
"1" = "󰲠";
"2" = "󰲢";
"3" = "󰲤";
"4" = "󰲦";
"5" = "󰲨";
"6" = "󰲪";
"7" = "󰲬";
"8" = "󰲮";
"9" = "󰲰";
"10" = "󰿬";
};
};
"hyprland/window" = {
format = "{}";
separate-outputs = true;
};
clock = {
format = "󰃰 {:%H:%M}";
format-alt = "󰃰 {:%A, %B %d, %Y (%R)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
};
pulseaudio = {
format = "{icon} {volume}%";
format-muted = "󰝟 Muted";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" "" ];
};
on-click = "pavucontrol";
};
network = {
format-wifi = " {essid}";
format-ethernet = "󰈀 Wired";
format-disconnected = "󰤭 Disconnected";
tooltip-format = "{ifname} via {gwaddr}";
tooltip-format-wifi = "{essid} ({signalStrength}%)";
on-click = "nm-connection-editor";
};
cpu = {
format = " {usage}%";
tooltip = false;
};
memory = {
format = " {}%";
tooltip-format = "RAM: {used:0.1f}G / {total:0.1f}G";
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = "󰂄 {capacity}%";
format-plugged = " {capacity}%";
format-icons = [ "󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
};
tray = {
icon-size = 18;
spacing = 10;
};
};
};
style = ''
* {
border: none;
border-radius: 0;
font-family: "JetBrainsMono Nerd Font";
font-size: 13px;
min-height: 0;
}
window#waybar {
background: rgba(30, 30, 46, 0.9);
color: #cdd6f4;
}
#workspaces button {
padding: 0 10px;
color: #cdd6f4;
background: transparent;
border-bottom: 3px solid transparent;
}
#workspaces button.active {
color: #89b4fa;
border-bottom: 3px solid #89b4fa;
}
#workspaces button:hover {
background: rgba(137, 180, 250, 0.2);
}
#window {
margin: 0 10px;
color: #cdd6f4;
}
#clock,
#battery,
#cpu,
#memory,
#network,
#pulseaudio,
#tray {
padding: 0 10px;
margin: 0 2px;
background: rgba(49, 50, 68, 0.8);
border-radius: 5px;
}
#battery.charging {
color: #a6e3a1;
}
#battery.warning:not(.charging) {
color: #f9e2af;
}
#battery.critical:not(.charging) {
color: #f38ba8;
}
#pulseaudio.muted {
color: #f38ba8;
}
'';
};
}