diff --git a/bootstrap.sh b/bootstrap.sh index 92dbee5..af3ce04 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -80,11 +80,9 @@ function cmd_install() { exit 1 fi - #$ TODO - # # Validate mainDiskID Exists if ! disk_id=$(nix eval --raw --impure \ - ".#nixosConfigurations.$name.config.mainDiskID" 2>/dev/null); then + ".#nixosConfigurations.$name.config.disko.devices.disk.main.device" 2>/dev/null); then echo "Error: mainDiskID not defined for configuration '$name'" exit 1 fi diff --git a/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix b/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix index ad5d6d3..f33e23b 100755 --- a/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix +++ b/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix @@ -24,7 +24,12 @@ in programs = { graphical = { - wms.hyprland = enabled; + wms.hyprland = { + enable = true; + monitors = [ + ",highres,auto,2" # Optional - 1.68 + ]; + }; ghostty = enabled; ghidra = enabled; browsers.firefox = { diff --git a/homes/x86_64-linux/evanreichard@lin-va-thinkpad/default.nix b/homes/x86_64-linux/evanreichard@lin-va-thinkpad/default.nix new file mode 100755 index 0000000..9140531 --- /dev/null +++ b/homes/x86_64-linux/evanreichard@lin-va-thinkpad/default.nix @@ -0,0 +1,102 @@ +{ pkgs, lib, config, namespace, ... }: +let + inherit (lib.${namespace}) enabled; +in +{ + home.stateVersion = "24.11"; + + reichard = { + user = { + enable = true; + inherit (config.snowfallorg.user) name; + }; + + services = { + ssh-agent = enabled; + fusuma = enabled; + swww = enabled; + # sops = { + # enable = true; + # defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml"; + # sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; + # }; + }; + + programs = { + graphical = { + wms.hyprland = { + enable = true; + mainMod = "SUPER"; + }; + ghostty = enabled; + ghidra = enabled; + browsers.firefox = { + enable = true; + gpuAcceleration = true; + hardwareDecoding = true; + }; + }; + + terminal = { + btop = enabled; + direnv = enabled; + git = enabled; + k9s = enabled; + nvim = enabled; + }; + }; + }; + + # home.packages = with pkgs; [ + # catppuccin-gtk + # ]; + + dconf = { + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + cursor-theme = "catppuccin-macchiato-mauve-cursors"; + cursor-size = 24; + # enable-hot-corners = false; + # font-name = osConfig.${namespace}.system.fonts.default; + # gtk-theme = cfg.theme.name; + # icon-theme = cfg.icon.name; + }; + }; + }; + + + home.pointerCursor = { + # x11.enable = true; + gtk.enable = true; + name = "catppuccin-macchiato-mauve-cursors"; + package = pkgs.catppuccin-cursors.macchiatoMauve; + size = 24; + }; + + # Kubernetes Secrets + # sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + # rke2_kubeconfig = { + # path = "${config.home.homeDirectory}/.kube/rke2"; + # }; + # }; + + # Global Packages + # programs.jq = enabled; + # programs.pandoc = enabled; + # home.packages = with pkgs; [ + # android-tools + # imagemagick + # mosh + # python311 + # texliveSmall # Pandoc PDF Dep + # google-cloud-sdk + # tldr + # ]; + + # SQLite Configuration + home.file.".sqliterc".text = '' + .headers on + .mode column + ''; +} diff --git a/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf b/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf index 55e3f72..6c700fe 100755 --- a/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf +++ b/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf @@ -1,54 +1,7 @@ -################ -### MONITORS ### -################ - -# See https://wiki.hyprland.org/Configuring/Monitors/ -# debug:disable_scale_checks = true -monitor=,highres,auto,2 # 1.68 - -################### -### MY PROGRAMS ### -################### - -# See https://wiki.hyprland.org/Configuring/Keywords/ - -# Set programs that you use -$terminal = ghostty -$fileManager = dolphin -$menu = wofi --show drun - - -################# -### AUTOSTART ### -################# - -# Autostart necessary processes (like notifications daemons, status bars, etc.) -# Or execute your favorite apps at launch like this: - -# exec-once = $terminal -# exec-once = nm-applet & exec-once = uwsm app -- waybar exec-once = uwsm app -- $terminal exec-once = uwsm app -- firefox - -############################# -### ENVIRONMENT VARIABLES ### -############################# - -# See https://wiki.hyprland.org/Configuring/Environment-variables/ - -# env = XCURSOR_SIZE,24 -# env = HYPRCURSOR_SIZE,24 - - -##################### -### LOOK AND FEEL ### -##################### - -# Refer to https://wiki.hyprland.org/Configuring/Variables/ - -# https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 12 @@ -180,95 +133,11 @@ gestures { workspace_swipe_invert = true } -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more -# device { -# name = epic-mouse-v1 -# sensitivity = -0.5 -# } - - -################### -### KEYBINDINGS ### -################### - -# Super Bindings (macOS Transition) -bind = SUPER_SHIFT, 1, exec, hyprshot -m output -bind = SUPER_SHIFT, 2, exec, hyprshot -m window -bind = SUPER_SHIFT, 3, exec, hyprshot -m region -bind = SUPER, Q, killactive, -bind = SUPER, SPACE, exec, $menu - -# See https://wiki.hyprland.org/Configuring/Keywords/ -$mainMod = ALT # Sets "Windows" key as main modifier - -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, RETURN, exec, $terminal -bind = $mainMod, M, exit, -bind = $mainMod, E, exec, $fileManager -bind = $mainMod, V, togglefloating, -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle - -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d - -# Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 - -# Example special workspace (scratchpad) -bind = $mainMod, S, togglespecialworkspace, magic -bind = $mainMod SHIFT, S, movetoworkspace, special:magic - -# Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -# Generic Laptop Multimedia Keys for Volume and LCD brightness -bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle -bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle -bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ -bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- - -# macOS Keyboard Brightness -bindel = ALT, XF86MonBrightnessUp, exec, brightnessctl -d kbd_backlight s 10%+ -bindel = ALT, XF86MonBrightnessDown, exec, brightnessctl -d kbd_backlight s 10%- - -# Requires playerctl -bindl = , XF86AudioNext, exec, playerctl next -bindl = , XF86AudioPause, exec, playerctl play-pause -bindl = , XF86AudioPlay, exec, playerctl play-pause -bindl = , XF86AudioPrev, exec, playerctl previous +# Thinkpad Trackpoint +device { + name = tpps/2-elan-trackpoint + sensitivity = -0.3 +} ############################## ### WINDOWS AND WORKSPACES ### diff --git a/modules/home/programs/graphical/wms/hyprland/default.nix b/modules/home/programs/graphical/wms/hyprland/default.nix index 5b45d8f..15670cd 100755 --- a/modules/home/programs/graphical/wms/hyprland/default.nix +++ b/modules/home/programs/graphical/wms/hyprland/default.nix @@ -1,13 +1,17 @@ { lib, pkgs, config, namespace, ... }: let - inherit (lib) mkIf; - inherit (lib.${namespace}) enabled; + inherit (lib) types mkIf; + inherit (lib.${namespace}) mkOpt enabled; cfg = config.${namespace}.programs.graphical.wms.hyprland; in { options.${namespace}.programs.graphical.wms.hyprland = { enable = lib.mkEnableOption "Hyprland"; + mainMod = mkOpt types.str "ALT" "Hyprland main modifier key"; + monitors = mkOpt (with types; listOf str) [ + ", preferred, auto, 1" + ] "Hyprland monitor configuration"; }; config = mkIf cfg.enable { @@ -16,6 +20,87 @@ in wayland.windowManager.hyprland = { enable = true; extraConfig = builtins.readFile ./config/hyprland.conf; + settings = { + "$mainMod" = cfg.mainMod; + "$terminal" = "ghostty"; + "$menu" = "wofi --show drun"; + + monitor = cfg.monitors; + + bind = [ + # Super Bindings (macOS Transition) + "SUPER_SHIFT, 1, exec, hyprshot -m output" + "SUPER_SHIFT, 2, exec, hyprshot -m window" + "SUPER_SHIFT, 3, exec, hyprshot -m region" + "SUPER, Q, killactive" + "SUPER, SPACE, exec, $menu" + + # Primary Bindings + "$mainMod, RETURN, exec, $terminal" + "$mainMod, M, exit" + # "$mainMod, E, exec, $fileManager" + "$mainMod, V, togglefloating" + "$mainMod, P, pseudo" # dwindle + "$mainMod, J, togglesplit" # dwindle + "$mainMod, S, togglespecialworkspace, magic" + "$mainMod SHIFT, S, movetoworkspace, special:magic" + + # Window Focus + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + # Workspace Switch + "$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" + + # Window Workspace Move + "$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" + ]; + bindm = [ + # Window Resizing + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + bindel = [ + # Multimedia & Brightness Keys + ",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%-" + + # macOS Keyboard Brightness + "ALT, XF86MonBrightnessUp, exec, brightnessctl -d kbd_backlight s 10%+" + "ALT, XF86MonBrightnessDown, exec, brightnessctl -d kbd_backlight s 10%-" + ]; + bindl = [ + # Player Controls + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPause, exec, playerctl play-pause" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ]; + }; }; programs.waybar = { diff --git a/modules/nixos/display-managers/sddm/default.nix b/modules/nixos/display-managers/sddm/default.nix index 6ad3d9f..a871326 100644 --- a/modules/nixos/display-managers/sddm/default.nix +++ b/modules/nixos/display-managers/sddm/default.nix @@ -1,19 +1,17 @@ { config, lib, pkgs, namespace, ... }: let - inherit (lib) mkIf; + inherit (lib) mkIf types; + inherit (lib.${namespace}) mkOpt; cfg = config.${namespace}.display-managers.sddm; in { options.${namespace}.display-managers.sddm = { enable = lib.mkEnableOption "sddm"; + scale = mkOpt types.str "1.5" "Scale"; }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - catppuccin-sddm - ]; - services = { displayManager = { sddm = { @@ -25,9 +23,13 @@ in }; }; + environment.systemPackages = with pkgs; [ + catppuccin-sddm + ]; + environment.sessionVariables = { - QT_SCREEN_SCALE_FACTORS = "2"; - QT_FONT_DPI = "192"; + QT_SCREEN_SCALE_FACTORS = cfg.scale; + # QT_FONT_DPI = "192"; }; }; } diff --git a/modules/nixos/hardware/opengl/default.nix b/modules/nixos/hardware/opengl/default.nix index 75e6833..04425c4 100644 --- a/modules/nixos/hardware/opengl/default.nix +++ b/modules/nixos/hardware/opengl/default.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, namespace, ... }: let - inherit (lib) mkIf; + inherit (lib) mkIf mkForce; inherit (lib.${namespace}) mkBoolOpt; cfg = config.${namespace}.hardware.opengl; @@ -24,7 +24,7 @@ in ]; # Add Intel Arc / Nvidia Drivers - hardware.enableRedistributableFirmware = cfg.enableIntel; + hardware.enableRedistributableFirmware = mkIf cfg.enableIntel (mkForce true); hardware.graphics = { enable = true; enable32Bit = cfg.enable32Bit; diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix new file mode 100644 index 0000000..649f021 --- /dev/null +++ b/modules/nixos/home/default.nix @@ -0,0 +1,8 @@ +{ + config = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; + }; +} diff --git a/modules/nixos/services/openssh/default.nix b/modules/nixos/services/openssh/default.nix index fa8f508..17300a8 100644 --- a/modules/nixos/services/openssh/default.nix +++ b/modules/nixos/services/openssh/default.nix @@ -12,6 +12,8 @@ let authorizedKeys = [ # evanreichard@lin-va-mbp-personal "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILJJoyXQOv9cAjGUHrUcvsW7vY9W0PmuPMQSI9AMZvNY" + # evanreichard@lin-va-thinkpad + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAq5JQr/6WJMIHhR434nK95FrDmf2ApW2Ahd2+cBKwDz" ]; in { diff --git a/modules/nixos/system/networking/networkmanager/default.nix b/modules/nixos/system/networking/networkmanager/default.nix index 57253e2..919c555 100644 --- a/modules/nixos/system/networking/networkmanager/default.nix +++ b/modules/nixos/system/networking/networkmanager/default.nix @@ -10,6 +10,7 @@ in networking.networkmanager = { enable = true; + wifi.backend = mkIf cfg.enableIWD "iwd"; connectionConfig = { "connection.mdns" = "2"; diff --git a/systems/x86_64-linux/lin-va-nix-builder/default.nix b/systems/x86_64-linux/lin-va-nix-builder/default.nix index 3a80b3e..36b7141 100755 --- a/systems/x86_64-linux/lin-va-nix-builder/default.nix +++ b/systems/x86_64-linux/lin-va-nix-builder/default.nix @@ -1,7 +1,5 @@ -{ namespace, lib, config, pkgs, ... }: +{ namespace, config, pkgs, ... }: let - inherit (lib.${namespace}) enabled; - cfg = config.${namespace}.user; in { @@ -35,6 +33,8 @@ in authorizedKeys = [ # evanreichard@lin-va-mbp-personal "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILJJoyXQOv9cAjGUHrUcvsW7vY9W0PmuPMQSI9AMZvNY" + # evanreichard@lin-va-thinkpad + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAq5JQr/6WJMIHhR434nK95FrDmf2ApW2Ahd2+cBKwDz" # NixOS Builder "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDF8QjeN8lpT+Mc70zwEJQqN9W/GKvTOTd32VgfNhVdN" ]; @@ -47,6 +47,8 @@ in authorizedKeys.keys = [ # evanreichard@lin-va-mbp-personal "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILJJoyXQOv9cAjGUHrUcvsW7vY9W0PmuPMQSI9AMZvNY" + # evanreichard@lin-va-thinkpad + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAq5JQr/6WJMIHhR434nK95FrDmf2ApW2Ahd2+cBKwDz" # NixOS Builder "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDF8QjeN8lpT+Mc70zwEJQqN9W/GKvTOTd32VgfNhVdN" ]; diff --git a/systems/x86_64-linux/lin-va-thinkpad/default.nix b/systems/x86_64-linux/lin-va-thinkpad/default.nix new file mode 100755 index 0000000..6c32a80 --- /dev/null +++ b/systems/x86_64-linux/lin-va-thinkpad/default.nix @@ -0,0 +1,56 @@ +{ namespace, lib, ... }: +let + inherit (lib.${namespace}) enabled; +in +{ + system.stateVersion = "24.11"; + time.timeZone = "America/New_York"; + hardware.enableRedistributableFirmware = true; + + # System Config + reichard = { + nix = enabled; + + system = { + boot = { + enable = true; + silentBoot = true; + }; + disk = { + enable = true; + diskPath = "/dev/nvme0n1"; + }; + networking = { + enable = true; + enableIWD = true; + }; + }; + + hardware = { + opengl = enabled; + }; + + services = { + avahi = enabled; + ydotool = enabled; + }; + + virtualisation = { + podman = enabled; + }; + + programs = { + graphical = { + wms.hyprland = enabled; + }; + }; + + # security = { + # sops = { + # enable = true; + # # sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + # defaultSopsFile = lib.snowfall.fs.get-file "secrets/lin-mbp-personal/default.yaml"; + # }; + # }; + }; +}