diff --git a/flake.nix b/flake.nix index 2e951e3..d4c59f1 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,8 @@ modules = [ ./hosts/nixos/yveltal/configuration.nix inputs.home-manager.nixosModules.default + inputs.disko.nixosModules.disko + ./hosts/nixos/yveltal/disko.nix ]; }; vaniville = nixpkgs.lib.nixosSystem { diff --git a/hosts/nixos/snowbelle/configuration.nix b/hosts/nixos/snowbelle/configuration.nix index f984602..c0bc824 100644 --- a/hosts/nixos/snowbelle/configuration.nix +++ b/hosts/nixos/snowbelle/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, stable_pkgs, unstable_pkgs, ... }: +{ config, lib, inputs, stable_pkgs, unstable_pkgs, ... }: let pkgs = stable_pkgs.x86_64; @@ -16,6 +16,10 @@ in ../../../modules/gameservers/minecraft_recpro ]; + home-manager.users.blake.imports = [ + ../../../users/blake/dots/git + ]; + system = { ssh.enable = true; sops.enable = true; @@ -139,7 +143,7 @@ in # Or disable the firewall altogether. networking.firewall.enable = true; - system.stateVersion = "25.05"; # Did you read the comment? + system.stateVersion = "25.05"; # stays here : ) } diff --git a/hosts/nixos/yveltal/configuration.nix b/hosts/nixos/yveltal/configuration.nix new file mode 100644 index 0000000..9d9d9f8 --- /dev/null +++ b/hosts/nixos/yveltal/configuration.nix @@ -0,0 +1,57 @@ +{ config, lib, inputs, stable_pkgs, unstable_pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../nixos + ../../../modules/desktop/hypr + ../../../users/blake + ../../../modules/system + ]; + + home-manager.users.blake.imports = [ + ../../../users/blake/hosts/yveltal + ]; + + system = { + ssh.enable = true; + sops.enable = true; + yubikey.enable = true; + tailscale.enable = true; + }; + + # boot (systemd is going on me) + boot.loader.systemd-boot.enable = true; # systemd your pretty cool ya know + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.systemd.enable = true; # better logging + + # setup hostname and networking stack + services.resolved = { + enable = true; + fallbackDns = [ "1.1.1.1" "9.9.9.9" ]; + dnsovertls = "opportunistic"; + }; + networking = { + hostName = "yveltal"; # hostname + networkmanager = { + enable = true; # the goat + dns = "systemd-resolved"; # the backup dancer! + }; + }; + + hardware.bluetooth.enable = true; + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ + 22 + ]; + + networking.firewall.allowedUDPPorts = [ 51820 ]; + # Or disable the firewall altogether. + networking.firewall.enable = true; + + system.stateVersion = "25.05"; # stays here : ) + +} + diff --git a/hosts/nixos/yveltal/disko.nix b/hosts/nixos/yveltal/disko.nix new file mode 100644 index 0000000..dd123d3 --- /dev/null +++ b/hosts/nixos/yveltal/disko.nix @@ -0,0 +1,70 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = ""; # disk id here + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + # disable settings.keyFile if you want to use interactive password entry + #passwordFile = "/tmp/secret.key"; # Interactive + settings = { + allowDiscards = true; + #keyFile = "/tmp/secret.key"; + }; + #additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "@root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@swap" = { + mountpoint = "/.swapvol"; + swap.swapfile.size = "32G"; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/users/blake/assets/wallpapers/antartica.png b/users/blake/assets/wallpapers/antartica.png new file mode 100644 index 0000000..222bbfd Binary files /dev/null and b/users/blake/assets/wallpapers/antartica.png differ diff --git a/users/blake/dots/hypr/default.nix b/users/blake/dots/hypr/default.nix new file mode 100644 index 0000000..60b7cde --- /dev/null +++ b/users/blake/dots/hypr/default.nix @@ -0,0 +1,375 @@ +{ + pkgs, + config, + ... +}: { + home.packages = with pkgs; [ + nwg-displays + ]; + + + + + wayland.windowManager.hyprland = { + enable = true; + systemd.variables = ["--all"]; + settings = { + # --- displays --- + source = [ + "~/.config/hypr/monitors.conf" + "~/.config/hypr/workspaces.conf" + ]; + + # --- environment variables --- + env = [ + "MOZ_ENABLE_WAYLAND,1" + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + ]; + + # --- input --- + input = { + kb_layout = "us"; + numlock_by_default = true; + follow_mouse = 2; + sensitivity = -0.6; + + touchpad = { + disable_while_typing = true; + natural_scroll = true; + clickfinger_behavior = true; + tap-to-click = true; + }; + }; + + # --- general --- + general = { + gaps_in = 2; + gaps_out = 5; + border_size = 3; + col = { + active_border = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + inactive_border = "rgba(595959aa)"; + }; + layout = "dwindle"; + allow_tearing = false; + }; + + # --- decoration --- + decoration = { + rounding = 3; + blur = { + enabled = true; + size = 3; + passes = 1; + }; + }; + + # --- 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" + ]; + }; + + # --- dwindle --- + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + gestures = { + workspace_swipe = "on"; + }; + + misc = { + force_default_wallpaper = -1; + disable_hyprland_logo = true; + disable_splash_rendering = true; + focus_on_activate = true; + }; + + # --- window rules --- + windowrulev2 = [ + ]; + + # --- binds --- + "$mainMod" = "SUPER"; + + bind = [ + # system + "$mainMod CONTROL, Q, exec, loginctl lock-session" + + # programs + "$mainMod, Return, exec, kitty" + "$mainMod, E, exec, kitty lf" + "$mainMod, R, exec, tofi-drun --drun-launch=true --prompt-text=\"launch:\"" + "$mainMod, B, exec, firefox" + "$mainMod, G, exec, lutris" + "$mainMod, M, exec, thunderbird" + "$mainMod, D, exec, flatpak run com.discordapp.Discord" + "$mainMod, K, exec, hyprpicker --autocopy --format=hex" + "$mainMod, T, exec, cliphist list | tofi | cliphist decode | wl-copy" + "$mainMod CONTROL, T, exec, cliphist wipe" + + # screenshots + "$mainMod SHIFT, C, exec, hyprshot --mode region --output-folder ~/pictures/screenshots" + + # multimedia + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioPlay, exec, playerctl play-pause" + + # brightness + ", XF86MonBrightnessUp, exec, brightnessctl set +10%" + ", XF86MonBrightnessDown, exec, brightnessctl set 10%- --min-value" + + # scratchpad + "$mainMod, S, togglespecialworkspace, magic" + "$mainMod SHIFT, S, movetoworkspace, special:magic" + + # window management + "$mainMod, Q, killactive" + "$mainMod SHIFT, M, exit" + "$mainMod, V, togglefloating" + "$mainMod, F, fullscreen, 1" + "$mainMod SHIFT, F, fullscreen, 0" + "$mainMod, P, pseudo" + "$mainMod, J, togglesplit" + + # focus movement + "$mainMod, tab, cyclenext" + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + # move windows + "$mainMod SHIFT, left, swapwindow, l" + "$mainMod SHIFT, right, swapwindow, r" + "$mainMod SHIFT, up, swapwindow, u" + "$mainMod SHIFT, down, swapwindow, d" + + # resize + "$mainMod CTRL, left, resizeactive, -60 0" + "$mainMod CTRL, right, resizeactive, 60 0" + "$mainMod CTRL, up, resizeactive, 0 -60" + "$mainMod CTRL, down, resizeactive, 0 60" + + # workspace switching + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + "$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 windows between workspaces + "$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" + + # waybar + "$mainMod, N, exec, pkill -SIGUSR1 waybar" + "$mainMod SHIFT, N, exec, pkill -SIGUSR2 waybar" + ]; + + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + }; + }; + + # enable polkit agent + services.hyprpolkitagent.enable = true; + + # wallpaper + services.hyprpaper = { + enable = true; + settings = { + preload = [ "~/.nix/user/blake/assets/wallpapers/antartica.png" ]; + wallpaper = [ ",~/.nix/user/blake/assets/wallpapers/antartica.png" ]; + ipc = "off"; + splash = false; + }; + }; + + # screenlocker + services.hyprlock = { + enable = true; + settings = { + general = { + disable_loading_bar = true; + hide_cursor = true; + }; + + background = [ + { + monitor = ""; + path = "~/pictures/wallpapers/antartica.png"; + blur_passes = 1; + color = "rgb(0047ab)"; + } + ]; + + label = [ + { + monitor = ""; + text = "cmd[update:30000] echo \"$(date +'%R')\""; + color = "rgb(ffffff)"; + font_size = 90; + position = "-130, -100"; + halign = "right"; + valign = "top"; + shadow_passes = 1; + } + { + monitor = ""; + text = "cmd[update:43200000] echo \"$(date +'%Y/%m/%d')\""; + color = "$text"; + font_size = 25; + position = "-130, -250"; + halign = "right"; + valign = "top"; + shadow_passes = 2; + } + { + monitor = ""; + text = "$LAYOUT"; + color = "rgb(ffffff)"; + font_size = 20; + rotate = 0; + position = "-130, -310"; + halign = "right"; + valign = "top"; + shadow_passes = 2; + } + ]; + + image = [ + { + monitor = ""; + path = "~/pictures/pfps/pikacig.png"; + size = 350; + border_color = "rgb(0047ab)"; + rounding = -1; + position = "0, 85"; + halign = "center"; + valign = "center"; + shadow_passes = 2; + } + ]; + + input-field = [ + { + monitor = ""; + size = "400, 70"; + outline_thickness = 4; + dots_size = 0.2; + dots_spacing = 0.2; + dots_center = true; + outer_color = "$accent"; + inner_color = "$surface0"; + font_color = "$text"; + fade_on_empty = false; + placeholder_text = + "# 󰌾 Logged in as $USER"; + hide_input = false; + check_color = "rgb(0047ab)"; + fail_color = "rgb(ff0000)"; + fail_text = "$FAIL ($ATTEMPTS)"; + capslock_color = "rgb(ff0000)"; + position = "0, -185"; + halign = "center"; + valign = "center"; + shadow_passes = 2; + } + ]; + }; + }; + + + # idle daemon + services.hypridle = { + enable = true; + settings = { + # --- general settings --- + general = { + lock_cmd = "pidof hyprlock || hyprlock"; # avoid multiple instances + before_sleep_cmd = "loginctl lock-session"; # lock before suspend + after_sleep_cmd = "hyprctl dispatch dpms on"; # wake display properly + }; + + # --- dim screen --- + listener = [ + { + timeout = 150; # 2.5 min + on-timeout = "brightnessctl -s set 1"; # dim monitor (avoid 0 on OLED) + on-resume = "brightnessctl -r"; # restore brightness + } + + # --- blank screen --- + { + timeout = 330; # 5.5 min + on-timeout = "hyprctl dispatch dpms off"; # turn off screen + on-resume = "hyprctl dispatch dpms on"; # restore screen + } + + # --- lock screen --- + { + timeout = 900; # 15 min + on-timeout = "loginctl lock-session"; # lock screen + } + + # --- suspend timeout --- + { + timeout = 1800; # 30 min + on-timeout = "systemctl suspend"; # suspend computer + } + + # --- keyboard backlight (optional) --- + # Uncomment if your keyboard supports it + # { + # timeout = 150; + # on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0"; + # on-resume = "brightnessctl -rd rgb:kbd_backlight"; + # } + ]; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + # x11.enable = true; + package = pkgs.posy-cursors; + name = "posy"; + size = 48; + }; + + #xdg.configFile."hypr/hyprland.conf" = { + # source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/hypr/hyprland.conf"; + #}; +} diff --git a/users/blake/dots/hyprland/hypridle.conf b/users/blake/dots/hypr/hypridle.conf similarity index 100% rename from users/blake/dots/hyprland/hypridle.conf rename to users/blake/dots/hypr/hypridle.conf diff --git a/users/blake/dots/hyprland/hyprland.conf b/users/blake/dots/hypr/hyprland.conf similarity index 100% rename from users/blake/dots/hyprland/hyprland.conf rename to users/blake/dots/hypr/hyprland.conf diff --git a/users/blake/dots/hyprland/hyprlock.conf b/users/blake/dots/hypr/hyprlock.conf similarity index 100% rename from users/blake/dots/hyprland/hyprlock.conf rename to users/blake/dots/hypr/hyprlock.conf diff --git a/users/blake/dots/hyprland/hyprpaper.conf b/users/blake/dots/hypr/hyprpaper.conf similarity index 100% rename from users/blake/dots/hyprland/hyprpaper.conf rename to users/blake/dots/hypr/hyprpaper.conf diff --git a/users/blake/dots/hyprland/default.nix b/users/blake/dots/hyprland/default.nix deleted file mode 100644 index 51a8bef..0000000 --- a/users/blake/dots/hyprland/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - pkgs, - config, - ... -}: { - home.packages = with pkgs; [ - nwg-displays - hyprlock - hypridle - hyprpaper - ]; - - wayland.windowManager.hyprland = { - enable = true; - systemd.variables = ["--all"]; - settings = { - - }; - }; - - home.pointerCursor = { - gtk.enable = true; - # x11.enable = true; - package = pkgs.posy-cursors; - name = "posy"; - size = 48; - }; - - #xdg.configFile."hypr/hyprland.conf" = { - # source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/hypr/hyprland.conf"; - #}; -} diff --git a/users/blake/home.nix b/users/blake/home.nix index 14d6e37..ca472b3 100644 --- a/users/blake/home.nix +++ b/users/blake/home.nix @@ -3,13 +3,10 @@ lib, pkgs, inputs, - system, - current_system, ... }: let platform = if builtins.pathExists "/System/Library/CoreServices" then "darwin" else "nixos"; - #platform = if current_system "x86_64-darwin" then "darwin" else "nixos"; # general config home_linux = { @@ -24,7 +21,7 @@ in { imports = [ inputs.sops-nix.homeManagerModules.sops - ./os/${platform}.nix + #./os/${platform}.nix ./dots/neovim ./dots/lf ./dots/zsh @@ -35,7 +32,7 @@ in ]; # set home manager config based on system type - home = (if pkgs.system == "x86_64-darwin" then home_darwin else home_linux) // { + home = (if platform == "darwin" then home_darwin else home_linux) // { # cross party general packages here : ) stateVersion = "25.05"; packages = with pkgs; [ diff --git a/users/blake/hosts/yveltal.nix b/users/blake/hosts/yveltal.nix new file mode 100644 index 0000000..653ed19 --- /dev/null +++ b/users/blake/hosts/yveltal.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: + +{ + imports = [ + ../dots/hypr + ../dots/kitty + ]; + + home.packages = with pkgs; [ + htop + sl + ]; +}