diff --git a/flake.lock b/flake.lock index 4c7746ba..52ae0601 100644 --- a/flake.lock +++ b/flake.lock @@ -267,11 +267,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1718714799, - "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", + "lastModified": 1718895438, + "narHash": "sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw+0Bwe5DLU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", + "rev": "d603719ec6e294f034936c0d0dc06f689d91b6c3", "type": "github" }, "original": { diff --git a/home-manager/home.nix b/home-manager/home.nix index 2a78af11..099c0a99 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -46,7 +46,7 @@ # Add stuff for your user as you see fit: # programs.neovim.enable = true; - home.packages = with pkgs; [ + home.packages = with pkgs; [ # Desktop firefox alacritty @@ -74,36 +74,65 @@ tofi pamixer virt-manager + qbittorrent + waybar + mullvad-vpn ]; # Hyprland & accessories # wayland.windowManager.hyprland.enable = true; # programs.waybar.enable = true; - home.file."~/.config/hypr/hyprland.conf".text = '' - decoration { - shadow_offset = 0 5 - col.shadow = rgba(00000099) - } + wayland.windowManager.hyprland = { + # Whether to enable Hyprland wayland compositor + enable = true; + # The hyprland package to use + package = pkgs.hyprland; + # Whether to enable XWayland + xwayland.enable = true; + extraConfig = '' + ${builtins.readFile ./hypr/hyprland.conf} + ''; + # Optional + # Whether to enable hyprland-session.target on hyprland startup + systemd.enable = true; + }; - $mod = SUPER - - bindm = $mod, mouse:272, movewindow - bindm = $mod, mouse:273, resizewindow - bindm = $mod ALT, mouse:272, resizewindow - ''; - home.sessionVariables = { MOZ_ENABLE_WAYLAND = 1; QT_QPA_PLATFORM = "wayland"; }; - - xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-wlr]; - - # Enable home-manager and git - programs.home-manager.enable = true; - programs.git.enable = true; + xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-wlr]; + + programs = { + home-manager.enable = true; + git = { + enable = true; + userName = "cnst"; + userEmail = "cnst@cana.st"; + }; + zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + shellAliases = { + ll = "ls -l"; + update = "sudo nixos-rebuild switch"; + }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + plugins = ["git" "thefuck"]; + theme = "robbyrussell"; + }; + }; + }; # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; diff --git a/home-manager/hypr/hypridle.conf b/home-manager/hypr/hypridle.conf new file mode 100644 index 00000000..c4fb5637 --- /dev/null +++ b/home-manager/hypr/hypridle.conf @@ -0,0 +1,18 @@ +$lock_cmd = pidof hyprlock || hyprlock +$suspend_cmd = pidof steam || systemctl suspend || loginctl suspend # fuck nvidia + +general { + lock_cmd = $lock_cmd + before_sleep_cmd = $lock_cmd +} + +listener { + timeout = 900 # 15mins + on-timeout = $lock_cmd +} + +listener { + timeout = 1200 # 20mins + on-timeout = hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on +} diff --git a/home-manager/hypr/hyprland.conf b/home-manager/hypr/hyprland.conf new file mode 100644 index 00000000..d63e0e49 --- /dev/null +++ b/home-manager/hypr/hyprland.conf @@ -0,0 +1,7 @@ +# HYPRLAND CONFIGURATION + +source=./land/appearance.conf +source=./land/inputs.conf +source=./land/keybinds.conf +source=./land/rules.conf +source=./land/startup.conf diff --git a/home-manager/hypr/hyprlock.conf b/home-manager/hypr/hyprlock.conf new file mode 100644 index 00000000..3c8570ac --- /dev/null +++ b/home-manager/hypr/hyprlock.conf @@ -0,0 +1,112 @@ +# $text_color = rgba(F6DECEFF) +# $entry_background_color = rgba(1C110811) +# $entry_border_color = rgba(A48C7B55) +# $entry_color = rgba(DDC1AEFF) +$text_color = rgba(FFFFFFFF) +$entry_background_color = rgba(33333311) +$entry_border_color = rgba(3B3B3B55) +$entry_color = rgba(FFFFFFFF) +$font_family = JetBrains Mono +#$font_family_clock = DSEG14 Classic Mini +$font_family_clock = JetBrains Mono +# font_material_symbols = FontAwesome + +background { + # color = rgba(170C04FF) + color = rgba(000000FF) + path = ~/Images/lockscreen.png + # path = screenshot + blur_size = 3 + blur_passes = 2 +} +input-field { + monitor = + size = 200, 50 + outline_thickness = 2 + dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true + dots_rounding = -1 # -1 default circle, -2 follow input-field rounding + outer_color = rgba(3B3B3B55) + inner_color = rgba(33333311) + font_color = rgba(FFFFFFFF) + fade_on_empty = true + fade_timeout = 5000 # Milliseconds before fade_on_empty is triggered. + placeholder_text = # Text rendered in the input box when it's empty. + hide_input = false + rounding = -1 # -1 means complete rounding (circle/oval) + check_color = rgb(204, 136, 34) + fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color + fail_text = $FAIL ($ATTEMPTS) # can be set to empty + fail_transition = 300 # transition time in ms between normal outer_color and fail_color + capslock_color = -1 + numlock_color = -1 + bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above) + invert_numlock = false # change color if numlock is off + swap_font_color = false # see below + position = 0, -20 + halign = center + valign = center + shadow_passes = + shadow_size = + shadow_color = rgb(0,0,0) + shadow_boost = +} + + +label { # Clock + monitor = + text = cmd[update:1000] echo "$TIME" + shadow_passes = 1 + shadow_boost = 0.5 + color = $text_color + font_size = 85 + font_family = $font_family_clock + + position = 0, 300 + halign = center + valign = center +} + +label { # Date + monitor = + text = cmd[update:1000] echo "$(date -I)" + shadow_passes = 1 + shadow_boost = 0.5 + color = $text_color + font_size = 25 + font_family = $font_family_clock + + position = 0, 280 + halign = center + valign = center +} + +label { # "locked" text + monitor = + text = locked + shadow_passes = 1 + shadow_boost = 0.5 + color = $text_color + font_size = 14 + font_family = $font_family + + position = 0, 45 + halign = center + valign = bottom +} + +label { # Status + monitor = + text = cmd[update:5000] ~/.config/hypr/hyprlock/status.sh + shadow_passes = 1 + shadow_boost = 0.5 + color = $text_color + font_size = 14 + font_family = $font_family + + position = 30, 30 + halign = left + valign = top +} + diff --git a/home-manager/hypr/hyprlock/status.sh b/home-manager/hypr/hyprlock/status.sh new file mode 100755 index 00000000..0d4ec2dc --- /dev/null +++ b/home-manager/hypr/hyprlock/status.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +############ Variables ############ +enable_battery=false +battery_charging=false + +####### Check availability ######## +for battery in /sys/class/power_supply/*BAT*; do + if [[ -f "$battery/uevent" ]]; then + enable_battery=true + if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then + battery_charging=true + fi + break + fi +done + +############# Output ############# +if [[ $enable_battery == true ]]; then + if [[ $battery_charging == true ]]; then + echo -n "(+) " + fi + echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"% + if [[ $battery_charging == false ]]; then + echo -n " remaining" + fi +fi + +echo '' diff --git a/home-manager/hypr/hyprpaper.conf b/home-manager/hypr/hyprpaper.conf new file mode 100644 index 00000000..428e6f3b --- /dev/null +++ b/home-manager/hypr/hyprpaper.conf @@ -0,0 +1,16 @@ +preload = /home/cnst/Pictures/wallhaven-gpxl97.jpg +#if more than one preload is desired then continue to preload other backgrounds +#preload = /path/to/next_image.png +# .. more preloads + +#set the default wallpaper(s) seen on initial workspace(s) --depending on the number of monitors used +wallpaper = DP-3,/home/cnst/Pictures/wallhaven-gpxl97.jpg +#if more than one monitor in use, can load a 2nd image +#wallpaper = monitor2,/path/to/next_image.png +# .. more monitors + +#enable splash text rendering over the wallpaper +splash = false + +#fully disable ipc +# ipc = off diff --git a/home-manager/hypr/land/appearance.conf b/home-manager/hypr/land/appearance.conf new file mode 100644 index 00000000..c1b11a9a --- /dev/null +++ b/home-manager/hypr/land/appearance.conf @@ -0,0 +1,49 @@ +# APPEARANCE + +general { + gaps_in = 3 + gaps_out = 6 + border_size = 2 + #col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + #col.inactive_border = rgba(595959aa) + col.active_border = rgb(689d6a) # rgba(b16286ee) 45deg + col.inactive_border = rgb(504945) + layout = dwindle +} + +decoration { + rounding = 0 + blur { + enabled = true + size = 8 + passes = 1 + vibrancy = 0.1696 + } + + drop_shadow = true + shadow_range = 4 + shadow_render_power = 3 + # col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = true + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + animation = windows, 1, 3, myBezier + animation = windowsOut, 1, 3, default, popin 80% + animation = border, 1, 3, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 3, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} diff --git a/home-manager/hypr/land/inputs.conf b/home-manager/hypr/land/inputs.conf new file mode 100644 index 00000000..e24762a6 --- /dev/null +++ b/home-manager/hypr/land/inputs.conf @@ -0,0 +1,53 @@ +# INPUTS + +monitor=DP-3,2560x1440@143.86,0x0,1 +monitor=eDP-1,1920x1200@60.02,0x0,1 + +# Some default env vars. +env = XCURSOR_SIZE,24 +# env = QT_QPA_PLATFORMTHEME,qt6ct # change to qt6ct if you have that +# env = GTK_THEME,Orchis-Orange-Dark + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + follow_mouse = 1 + accel_profile = flat + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + + touchpad { + natural_scroll = true + disable_while_typing = true + clickfinger_behavior = true + scroll_factor = 0.5 + } +} + # Desktop keyboard +device { + name = pfu-limited-hhkb-hybrid + kb_layout = hhkbse + kb_options = lv3:rwin_switch +} + # Laptop keyboard +device { + name = at-translated-set-2-keyboard + kb_layout = se + kb_options = ctrl:swapcaps +} +gestures { + workspace_swipe = true + workspace_swipe_distance = 400 + workspace_swipe_fingers = 3 + workspace_swipe_cancel_ratio = 0.2 + workspace_swipe_min_speed_to_force = 5 + workspace_swipe_direction_lock = true + workspace_swipe_direction_lock_threshold = 10 + workspace_swipe_create_new = true +} +misc { + vrr = 0 + mouse_move_enables_dpms = 1 + key_press_enables_dpms = 0 + force_default_wallpaper = 0 + disable_hyprland_logo = true + disable_splash_rendering = true +} diff --git a/home-manager/hypr/land/keybinds.conf b/home-manager/hypr/land/keybinds.conf new file mode 100644 index 00000000..da4e3325 --- /dev/null +++ b/home-manager/hypr/land/keybinds.conf @@ -0,0 +1,92 @@ +# KEYBINDS + +$terminal = alacritty +$fileManager = thunar +$passwordManager = keepassxc +$menu = pkill tofi-run || tofi-run | xargs hyprctl dispatch exec -- +$browser = firefox +$browserinc = firefox --private-window + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Custom binds +bind = SUPER SHIFT, B, exec, killall -SIGUSR2 waybar # Reload waybar + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = SUPER, A, exec, pkill -SIGUSR1 waybar +bind = SUPER, T, exec, $terminal +bind = SUPER, W, exec, $browser +bind = SUPER, K, exec, $passwordManager +bind = SUPER SHIFT, W, exec, $browserinc +bind = SUPER, Q, killactive, +bind = SUPER, M, exec, hyprctl dispatch exit +#bind = SUPER, E, exec, $fileManager +bind = SUPER, E, exec, hyprctl dispatch togglespecialworkspace fm | hyprctl dispatch rangerscript & +bind = SUPER SHIFT, E, exec, $fileManager +bind = SUPER, F, fullscreen, +bind = SUPER SHIFT, F, togglefloating, +bind = SUPER, SPACE, exec, $menu +bind = SUPER, P, pseudo, # dwindle +bind = SUPER, J, togglesplit, # dwindle +bind = SUPER, C, exec, hyprctl dispatch exec copyq toggle + +# Move focus with mainMod + arrow keys +bind = SUPER, left, movefocus, l +bind = SUPER, right, movefocus, r +bind = SUPER, up, movefocus, u +bind = SUPER, down, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = SUPER, 1, workspace, 1 +bind = SUPER, 2, workspace, 2 +bind = SUPER, 3, workspace, 3 +bind = SUPER, 4, workspace, 4 +bind = SUPER, 5, workspace, 5 +bind = SUPER, 6, workspace, 6 +bind = SUPER, 7, workspace, 7 +bind = SUPER, 8, workspace, 8 +bind = SUPER, 9, workspace, 9 +bind = SUPER, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = SUPER SHIFT, 1, movetoworkspace, 1 +bind = SUPER SHIFT, 2, movetoworkspace, 2 +bind = SUPER SHIFT, 3, movetoworkspace, 3 +bind = SUPER SHIFT, 4, movetoworkspace, 4 +bind = SUPER SHIFT, 5, movetoworkspace, 5 +bind = SUPER SHIFT, 6, movetoworkspace, 6 +bind = SUPER SHIFT, 7, movetoworkspace, 7 +bind = SUPER SHIFT, 8, movetoworkspace, 8 +bind = SUPER SHIFT, 9, movetoworkspace, 9 +bind = SUPER SHIFT, 0, movetoworkspace, 10 + +# Laptop controls +bind = ,XF86AudioLowerVolume, exec, pactl -- set-sink-volume 0 -5% +bind = ,XF86AudioRaiseVolume, exec, pactl -- set-sink-volume 0 +5% +bind = ,XF86AudioMute, exec, pactl -- set-sink-mute 0 toggle +bind = ,XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle +bind = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- +bind = ,XF86MonBrightnessUp, exec, brightnessctl s +10% + +bind = SUPER, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on +bind = SUPER, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off + +# Screenshot a window +bind = SUPER, F10, exec, hyprshot -m window +# Screenshot a monitor +bind = , F10, exec, hyprshot -m output +# Screenshot a region +bind = SUPER SHIFT, F10, exec, hyprshot -m region + +# Example special workspace (scratchpad) +bind = SUPER, S, togglespecialworkspace, magic +bind = SUPER SHIFT, S, movetoworkspace, special:magic + +# Scroll through existing workspaces with mainMod + scroll +bind = SUPER, mouse_down, workspace, e+1 +bind = SUPER, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = SUPER, mouse:272, movewindow +bindm = SUPER, mouse:273, resizewindow diff --git a/home-manager/hypr/land/rules.conf b/home-manager/hypr/land/rules.conf new file mode 100644 index 00000000..49a552e8 --- /dev/null +++ b/home-manager/hypr/land/rules.conf @@ -0,0 +1,35 @@ +# RULES + +# CALCURSE SETTINGS +windowrulev2 = float,class:(floatcal) +windowrulev2 = size 843 650,class:(floatcal) +windowrulev2 = move 100%-w-20 40,class:(floatcal) +#windowrulev2 = move 1708 32,class:(floatcal) + +# RANGER/NNN SETTINGS +windowrulev2 = float,class:(floatranger) +windowrulev2 = float,class:(floatnnn) +#windowrulev2 = size 843 650,class:(floatranger) +#windowrulev2 = move 1708 32,class:(floatranger) +#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. +#windowrulev2 = noshadow, floating:0 +windowrulev2 = float,class:^(org.keepassxc.KeePassXC)$ +windowrulev2 = center,class:^(org.keepassxc.KeePassXC)$ +windowrule = float, ^(xarchiver)$ +windowrulev2 = float,class:^(imv)$ +windowrulev2 = float,class:^(com.github.hluk.copyq)$ +windowrule = center, ^(xarchiver)$ +windowrulev2 = float,class:^(blueman-manager)$ +windowrulev2 = center,class:^(nwg-look)$ +windowrulev2 = float,class:^(nwg-look)$ +windowrulev2 = float,class:^(Lxappearance)$ +windowrulev2 = float,class:^(org.pulseaudio.pavucontrol)$ +windowrule = move 1813 33,^(org.pulseaudio.pavucontrol)$ +windowrule = size 741 585,^(org.pulseaudio.pavucontrol)$ +windowrule = dimaround,^(org.pulseaudio.pavucontrol)$ + +windowrulev2 = float,class: ^(thunar) +windowrulev2 = float,class: ^(thunar) +windowrulev2 = workspace special:fm,class: ^(thunar) diff --git a/home-manager/hypr/land/startup.conf b/home-manager/hypr/land/startup.conf new file mode 100644 index 00000000..5179a1d3 --- /dev/null +++ b/home-manager/hypr/land/startup.conf @@ -0,0 +1,13 @@ +# STARTUP + +exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once = /usr/lib/polkit-kde-authentication-agent-1 +exec-once = pamixer --set-volume 50 & +exec-once = dunst & waybar & hypridle & blueman-applet & udiskie -Nt & +exec-once = nm-applet --indicator & +exec-once = mullvad-vpn & +exec-once = swaybg -i ~/Images/wallpaper.png & +exec-once = wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+' +exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server" +exec-once = hyprctl dispatch exec "sleep 5s && keepassxc" +exec-once = hyprctl dispatch exec "sleep 3s && solaar -w hide" diff --git a/home-manager/hypr/scripts/calvin b/home-manager/hypr/scripts/calvin new file mode 100755 index 00000000..87297d71 --- /dev/null +++ b/home-manager/hypr/scripts/calvin @@ -0,0 +1,36 @@ +ignore-empty-password +disable-caps-lock-text +image=$HOME/.config/hypr/bg/calvin2.jpeg +font=Calvin and Hobbes + +text-ver-color=00000000 +text-wrong-color=00000000 +text-clear-color=00000000 +inside-color=00000000 +inside-ver-color=00000000 +inside-wrong-color=00000000 +inside-clear-color=00000000 +inside-caps-lock-color=00000000 +ring-color=00000000 +ring-ver-color=00000000 +ring-wrong-color=00000000 +ring-clear-color=00000000 +line-color=00000000 +line-clear-color=00000000 +line-ver-color=00000000 +key-hl-color=00000000 +bs-hl-color=00000000 +caps-lock-bs-hl-color=00000000 +caps-lock-key-hl-color=00000000 +separator-color=00000000 + +scaling=fill +indicator +clock +timestr=%I:%M %p +datestr=%A, %d %B +indicator-x-position=400 +indicator-y-position=875 +indicator-radius=450 +font-size=200 +text-color=080808 diff --git a/home-manager/hypr/scripts/exit.sh b/home-manager/hypr/scripts/exit.sh new file mode 100755 index 00000000..e23661e4 --- /dev/null +++ b/home-manager/hypr/scripts/exit.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sleep 1 +killall -9 Hyprland sleep 2 diff --git a/home-manager/hypr/scripts/logoutlaunch.sh b/home-manager/hypr/scripts/logoutlaunch.sh new file mode 100755 index 00000000..00b7c217 --- /dev/null +++ b/home-manager/hypr/scripts/logoutlaunch.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# set variables +wLayout="$HOME/.config/wlogout/layout_2" +wlTmplt="$HOME/.config/wlogout/style_2.css" + +# set font size +fntSize=`gsettings get org.gnome.desktop.interface font-name | sed "s/'//g" | awk '{print $2}'` +export fntSize=$(( fntSize * 2 )) + +# set scaling as per monitor res +res=`cat /sys/class/drm/*/modes | head -1 | cut -d 'x' -f 2` +case $1 in + 1) wlColms=1 + export mgn=$(( res * 10 / 100 )) + export hvr=$(( res * 5 / 100 )) ;; + 2) wlColms=5 + export mgn=$(( res * 8 / 100 )) + export mgn2=$(( res * 65 / 100 )) + export hvr=$(( res * 3 / 100 )) + export hvr2=$(( res * 60 / 100 )) ;; + *) echo "Error: invalid parameter passed..." + exit 1 ;; +esac + +# eval config files +wlStyle=`envsubst < $wlTmplt` + +# launch wlogout +wlogout -b $wlColms -c 0 -r 0 --layout $wLayout --css <(echo "$wlStyle") --protocol layer-shell diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 55c564f7..fc19c13a 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -77,14 +77,32 @@ pkgs.nixd ]; - # Bootloader - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/vda"; - boot.loader.grub.useOSProber = true; - + fonts.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + liberation_ttf + fira-code-symbols + font-awesome + jetbrains-mono + (nerdfonts.override {fonts = ["JetBrainsMono" "FiraCode" "Iosevka" "3270" "DroidSansMono"];}) + ]; # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # Enable networking + networking.networkmanager.enable = true; # TODO: Set your hostname networking.hostName = "cnix"; + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + programs.hyprland = { + # Install the packages from nixpkgs + enable = true; + # Whether to enable XWayland + xwayland.enable = true; + }; # Time zone & Locale time.timeZone = "Europe/Stockholm"; @@ -102,49 +120,62 @@ LC_TIME = "sv_SE.UTF-8"; }; - - # Configure keymap in X11 - services.xserver.xkb = { - extraLayouts.hhkbse = { - description = "HHKBse by cnst"; - languages = [ "se" ]; - symbolsFile = /home/cnst/Documents/nix-config/nixos/xkb/symbols/hhkbse; - }; - layout = "hhkbse"; - # dir = "/home/cnst/Documents/nix-config/nixos/xkb"; - variant = ""; - options = "lv3:rwin_switch"; - }; - # Console keymap console.useXkbConfig = true; # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. users.users = { cnst = { - # TODO: You can set an initial password for your user. - # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. - # Be sure to change it (using passwd) after rebooting! - initialPassword = "1234"; isNormalUser = true; openssh.authorizedKeys.keys = [ # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect ]; # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) - extraGroups = [ "wheel" "networkmanager" "audio" "video" ]; + extraGroups = ["wheel" "networkmanager" "audio" "video"]; }; }; - # This setups a SSH server. Very important if you're setting up a headless system. - # Feel free to remove if you don't need it. - services.openssh = { - enable = true; - settings = { - # Opinionated: forbid root login through SSH. - PermitRootLogin = "no"; - # Opinionated: use keys only. - # Remove if you want to SSH using passwords - PasswordAuthentication = false; + # services + services = { + mullvad-vpn.enable = true; + mullvad-vpn.package = pkgs.mullvad-vpn; + openssh = { + enable = true; + settings = { + # Opinionated: forbid root login through SSH. + PermitRootLogin = "no"; + # Opinionated: use keys only. + # Remove if you want to SSH using passwords + PasswordAuthentication = false; + }; + }; + xserver = { + enable = true; + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + xkb = { + extraLayouts.hhkbse = { + description = "HHKBse by cnst"; + languages = ["se"]; + symbolsFile = /home/cnst/.nix-config/nixos/xkb/symbols/hhkbse; + }; + layout = "hhkbse"; + # dir = "/home/cnst/.nix-config/nixos/xkb"; + variant = ""; + options = "lv3:rwin_switch"; + }; + }; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; }; }; diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 5cd37093..598229a2 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -1,23 +1,42 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: { imports = - [ (modulesPath + "/profiles/qemu-guest.nix") + [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/66495946-e6f4-48db-bab3-e1d4cafc326d"; + { device = "/dev/disk/by-uuid/de372c64-89a2-4bbe-ad57-926cdd98e97d"; fsType = "ext4"; }; - swapDevices = [ ]; + boot.initrd.luks.devices."luks-60ba815c-481b-4932-94d2-b8d29465d3eb".device = "/dev/disk/by-uuid/60ba815c-481b-4932-94d2-b8d29465d3eb"; - networking.useDHCP = lib.mkDefault true; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/0954-2370"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }