From 0ac9b5a78baddacce029435fcea285f55b0e8090 Mon Sep 17 00:00:00 2001 From: Anish Govind Date: Sat, 15 Aug 2026 23:56:29 +0000 Subject: [PATCH] disko --- flake.lock | 21 ++++ flake.nix | 5 + home/hypr/hyprland.nix | 143 +++++++++++++++---------- hosts/hades/default.nix | 12 ++- hosts/hades/disko.nix | 50 +++++++++ hosts/hades/display-configuration.nix | 7 +- hosts/hades/hardware-configuration.nix | 16 +-- 7 files changed, 180 insertions(+), 74 deletions(-) create mode 100644 hosts/hades/disko.nix diff --git a/flake.lock b/flake.lock index 7da2718..ec0aa61 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,26 @@ "type": "github" } }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781152676, + "narHash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=", + "owner": "nix-community", + "repo": "disko", + "rev": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -92,6 +112,7 @@ "root": { "inputs": { "antigravity": "antigravity", + "disko": "disko", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2" diff --git a/flake.nix b/flake.nix index 4947e91..11ff0de 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + antigravity = { url = "github:Hy4ri/antigravity-flake"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/hypr/hyprland.nix b/home/hypr/hyprland.nix index 79faa73..a354dc8 100644 --- a/home/hypr/hyprland.nix +++ b/home/hypr/hyprland.nix @@ -2,86 +2,113 @@ let mod = "SUPER"; + terminal = "foot"; + menu = "rofi -show drun"; + browser = "brave"; in { wayland.windowManager.hyprland = { + enable = true; + configType = "lua"; + package = null; + settings = { # ----------------------------------------------------------------------- # 1. Variables & Modifiers # ----------------------------------------------------------------------- "$mod" = mod; - "$terminal" = "foot"; - "$menu" = "rofi -show drun"; - "$browser" = "brave"; + "$terminal" = terminal; + "$menu" = menu; + "$browser" = browser; # ----------------------------------------------------------------------- - # 2. General, Layout & Decoration + # 2. Main Config (hl.config) # ----------------------------------------------------------------------- - general = { - gaps_in = 4; - gaps_out = 8; - border_size = 2; - "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; - layout = "dwindle"; - allow_tearing = false; - }; + config = { + general = { + gaps_in = 4; + gaps_out = 8; + border_size = 2; + col = { + active_border = { + colors = [ "rgba(33ccffee)" "rgba(00ff99ee)" ]; + angle = 45; + }; + inactive_border = "rgba(595959aa)"; + }; + layout = "dwindle"; + allow_tearing = false; + }; - decoration = { - rounding = 8; - active_opacity = 1.0; - inactive_opacity = 0.95; + decoration = { + rounding = 8; + active_opacity = 1.0; + inactive_opacity = 0.95; - blur = { + blur = { + enabled = true; + size = 5; + passes = 2; + new_optimizations = true; + }; + + shadow = { + enabled = true; + range = 4; + render_power = 3; + color = "rgba(1a1a1aee)"; + }; + }; + + animations = { enabled = true; - size = 5; - passes = 2; - new_optimizations = true; }; - shadow = { - enabled = true; - range = 4; - render_power = 3; - color = "rgba(1a1a1aee)"; + input = { + kb_layout = "us"; + follow_mouse = 1; + touchpad = { + natural_scroll = true; + }; + sensitivity = 0; }; - }; - animations = { - enabled = true; - bezier = [ - "easeOutQuint, 0.23, 1, 0.32, 1" - ]; - animation = [ - "windows, 1, 3, easeOutQuint" - "windowsOut, 1, 3, easeOutQuint, popin 80%" - "border, 1, 3, easeOutQuint" - "fade, 1, 3, easeOutQuint" - "workspaces, 1, 3, easeOutQuint" - ]; - }; - - input = { - kb_layout = "us"; - follow_mouse = 1; - touchpad = { - natural_scroll = true; + dwindle = { + pseudotile = true; + preserve_split = true; }; - sensitivity = 0; - }; - dwindle = { - pseudotile = true; - preserve_split = true; - }; - - misc = { - force_default_wallpaper = 0; - disable_hyprland_logo = true; + misc = { + force_default_wallpaper = 0; + disable_hyprland_logo = true; + }; }; # ----------------------------------------------------------------------- - # 3. Autostart Daemons & Apps + # 3. Animation Curves (hl.curve) & Animations + # ----------------------------------------------------------------------- + curve = [ + { + _args = [ + "easeOutQuint" + { + type = "bezier"; + points = [ [ 0.23 1 ] [ 0.32 1 ] ]; + } + ]; + } + ]; + + animation = [ + "windows, 1, 3, easeOutQuint" + "windowsOut, 1, 3, easeOutQuint, popin 80%" + "border, 1, 3, easeOutQuint" + "fade, 1, 3, easeOutQuint" + "workspaces, 1, 3, easeOutQuint" + ]; + + # ----------------------------------------------------------------------- + # 4. Autostart Daemons & Apps # ----------------------------------------------------------------------- exec-once = [ "waybar" @@ -92,7 +119,7 @@ in ]; # ----------------------------------------------------------------------- - # 4. Keybindings + # 5. Keybindings # ----------------------------------------------------------------------- bind = [ # Launchers & Applications diff --git a/hosts/hades/default.nix b/hosts/hades/default.nix index 7ee7cb4..5fe5b06 100644 --- a/hosts/hades/default.nix +++ b/hosts/hades/default.nix @@ -1,7 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: { imports = [ + inputs.disko.nixosModules.disko + ./disko.nix ./hardware-configuration.nix ./display-configuration.nix ../../modules/hardware/nvidia.nix @@ -10,6 +12,14 @@ networking.hostName = "hades"; + # Enable in-memory compressed swap + zramSwap.enable = true; + + # Ensure /games directory is accessible by default user + systemd.tmpfiles.rules = [ + "d /games 0755 anish users -" + ]; + powerManagement.cpuFreqGovernor = "performance"; hardware.nvidia.prime = { diff --git a/hosts/hades/disko.nix b/hosts/hades/disko.nix new file mode 100644 index 0000000..ae09d88 --- /dev/null +++ b/hosts/hades/disko.nix @@ -0,0 +1,50 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S59CNZ0NB09730Z"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "fmask=0077" "dmask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + games = { + type = "disk"; + device = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_1TB_S5H9NS0N401375F"; + content = { + type = "gpt"; + partitions = { + games = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/games"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/hades/display-configuration.nix b/hosts/hades/display-configuration.nix index 6875c59..2edf7ff 100644 --- a/hosts/hades/display-configuration.nix +++ b/hosts/hades/display-configuration.nix @@ -2,6 +2,11 @@ { home-manager.users.anish.wayland.windowManager.hyprland.settings.monitor = [ - "HDMI-A-1, 3840x2160, auto, 2" + { + output = "HDMI-A-1"; + mode = "3840x2160"; + position = "auto"; + scale = 2; + } ]; } diff --git a/hosts/hades/hardware-configuration.nix b/hosts/hades/hardware-configuration.nix index 65154fa..8d526f1 100644 --- a/hosts/hades/hardware-configuration.nix +++ b/hosts/hades/hardware-configuration.nix @@ -13,20 +13,8 @@ boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/b4665ea7-2347-4075-8fb5-5b9c838a4852"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3FEE-E289"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/37ad0ef8-95d4-4cf5-a443-a867bca3d974"; } - ]; + # File systems and swap partitions are managed by disko (./disko.nix) + # and zramSwap in ./default.nix nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;