diff --git a/flake.lock b/flake.lock index 9120aad..d0890ed 100644 --- a/flake.lock +++ b/flake.lock @@ -63,6 +63,43 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprspace", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739103745, + "narHash": "sha256-c53dcRaw0F4Os9WD05HwIRs9kTDZw4Mxe1XK4edEALo=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "a3dda0d10ce9aa1d1dfb7a6c139ea8c2872c74bd", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "astal": { "inputs": { "nixpkgs": [ @@ -189,6 +226,22 @@ } }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "locked": { "lastModified": 1733328505, "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", @@ -268,7 +321,7 @@ "stylix", "flake-compat" ], - "gitignore": "gitignore", + "gitignore": "gitignore_2", "nixpkgs": [ "stylix", "nixpkgs" @@ -289,6 +342,29 @@ } }, "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "stylix", @@ -369,6 +445,309 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1738664950, + "narHash": "sha256-xIeGNM+iivwVHkv9tHwOqoUP5dDrtees34bbFKKMZYs=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "7c6d165e1eb9045a996551eb9f121b6d1b30adc3", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739049071, + "narHash": "sha256-3+7TpXMrbsUXSwgr5VAKAnmkzMb6JO+Rvc9XRb5NMg4=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "175c6b29b6ff82100539e7c4363a35a02c74dd73", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_4", + "pre-commit-hooks": "pre-commit-hooks", + "systems": [ + "hyprspace", + "systems" + ], + "xdph": "xdph" + }, + "locked": { + "lastModified": 1739815352, + "narHash": "sha256-JqMiCMkkOOq5380y7S/xgBG9yd2C7/KjDbXqu4vLe2A=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "d01f9943e1d401b09fc53be3c161279ab4f2c5ba", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1738422629, + "narHash": "sha256-5v+bv75wJWvahyM2xcMTSNNxmV8a7hb01Eey5zYnBJw=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "755aef8dab49d0fc4663c715fa4ad221b2aedaed", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1737634706, + "narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "8810df502cdee755993cb803eba7b23f189db795", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739048983, + "narHash": "sha256-REhTcXq4qs3B3cCDtLlYDz0GZvmsBSh947Ub6pQWGTQ=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "3504a293c8f8db4127cb0f7cfc1a318ffb4316f8", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739048914, + "narHash": "sha256-vd5rJBTmp2w7SDgfv23Zcd84ktI5eDA7e5UBzx+pKrU=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "a7334904d591f38757c46fbe2ab68651877d9099", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprspace": { + "inputs": { + "hyprland": "hyprland", + "systems": "systems" + }, + "locked": { + "lastModified": 1742767019, + "narHash": "sha256-FdyHDbf31jl5rIU7IQtBVTbZ1ojGrrp5aFaRrE2819s=", + "owner": "KZDKM", + "repo": "Hyprspace", + "rev": "5b62529c2011ede6069445de9b5b3f8a1f10ecfe", + "type": "github" + }, + "original": { + "owner": "KZDKM", + "repo": "Hyprspace", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739048933, + "narHash": "sha256-ck6MaoYvISBQKqZR+HcxXnx0wOhyCauxfVMaV5zhJxQ=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "e4e018a2ca6f5a9c33511973454199e1c7c85499", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739049028, + "narHash": "sha256-RleJp7LYbr6s+M1xgbmhtBs+fYa3ZdIiF7+QalJ4D1g=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "04146df74a8d5ec0b579657307be01f1e241125f", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1742422364, @@ -418,6 +797,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1739020877, + "narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a79cfe0ebd24952b580b1cf08cd906354996d547", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1741862977, "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", @@ -433,7 +828,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1742422364, "narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=", @@ -449,7 +844,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1741513245, "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", @@ -467,7 +862,7 @@ }, "nordvpn": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1742098294, @@ -518,6 +913,30 @@ "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737465171, + "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "ags": "ags", @@ -525,7 +944,8 @@ "apple-fonts": "apple-fonts", "fingerprint-sensor": "fingerprint-sensor", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_4", + "hyprspace": "hyprspace", + "nixpkgs": "nixpkgs_5", "nordvpn": "nordvpn", "stylix": "stylix" } @@ -621,14 +1041,14 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils", "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "nur": "nur", - "systems": "systems", + "systems": "systems_2", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -650,6 +1070,21 @@ } }, "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -767,6 +1202,53 @@ "repo": "treefmt-nix", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprspace", + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprspace", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1737634991, + "narHash": "sha256-dBAnb7Kbnier30cA7AgxVSxxARmxKZ1vHZT33THSIr8=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "e09dfe2726c8008f983e45a0aa1a3b7416aaeb8a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 214b5df..d2e94b2 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,8 @@ fingerprint-sensor.url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor/24.11"; fingerprint-sensor.inputs.nixpkgs.follows = "nixpkgs"; + + hyprspace.url = "github:KZDKM/Hyprspace"; }; outputs = { self, nixpkgs, ... }: let diff --git a/hosts/base-configuration.nix b/hosts/base-configuration.nix index 1e9c35e..507954e 100644 --- a/hosts/base-configuration.nix +++ b/hosts/base-configuration.nix @@ -4,11 +4,15 @@ # DO NOT change this unless you know what you're doing! system.stateVersion = "24.11"; + # Enable cache + nix.settings = { + substituters = ["https://cache.nixos.org" "https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + nixpkgs.config = { allowInsecurePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ - "fluffychat-linux" "olm" - "python312Packages.youtube-dl" ]; }; diff --git a/hosts/hulk/default.nix b/hosts/hulk/default.nix index 56b0001..28a8ef7 100644 --- a/hosts/hulk/default.nix +++ b/hosts/hulk/default.nix @@ -7,8 +7,10 @@ ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.auto-optimise-store = true; nix.gc = { automatic = true; + dates = "weekly"; options = "--delete-older-than 7d"; }; diff --git a/hosts/hulk/modules.nix b/hosts/hulk/modules.nix index a90f5fd..f4fad18 100644 --- a/hosts/hulk/modules.nix +++ b/hosts/hulk/modules.nix @@ -2,9 +2,6 @@ { imports = [ - # DEs - ../../modules/desktop-environments/hyprland.nix - # Utilities ../../modules/nixos/nvidia-support.nix ../../modules/nixos/fingerprint.nix @@ -17,11 +14,6 @@ inputs.nordvpn.nixosModules.nordvpn ]; - modules.hyprland = { - enable = true; - additionalPackages = with pkgs; [ hyprshot ]; - }; - modules.apple-style.enable = true; modules.bluetooth.enable = true; modules.nvidia.enable = true; @@ -32,11 +24,25 @@ }; services = { + tlp.enable = false; nordvpn.enable = true; + dbus.enable = true; + gvfs.enable = true; + upower.enable = true; + power-profiles-daemon.enable = true; + xserver.displayManager = { + gdm.enable = true; + startx.enable = true; + }; + printing = { enable = true; drivers = with pkgs; [ hplipWithPlugin ]; }; + + udev.extraRules = '' + SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness" + ''; }; programs = { @@ -47,5 +53,7 @@ thunar-archive-plugin thunar-volman ]; + + light.enable = true; }; } diff --git a/hosts/hulk/users.nix b/hosts/hulk/users.nix index 1d8aae8..451e5d1 100644 --- a/hosts/hulk/users.nix +++ b/hosts/hulk/users.nix @@ -9,7 +9,7 @@ in { isNormalUser = true; description = fullname; home = "/home/${username}"; - extraGroups = [ "wheel" "networkmanager" "plugdev" "adbusers" "nordvpn" ]; + extraGroups = [ "wheel" "networkmanager" "plugdev" "adbusers" "video" ]; shell = preferredShell; ignoreShellProgramCheck = true; # Will do it later in profile configuration }; diff --git a/modules/desktop-environments/hyprland.nix b/modules/desktop-environments/hyprland.nix index 7d50f38..dc536e6 100644 --- a/modules/desktop-environments/hyprland.nix +++ b/modules/desktop-environments/hyprland.nix @@ -8,59 +8,66 @@ description = "Additional Hyprland-related packages to install"; default = []; }; + + additionalConfig = lib.mkOption { + type = lib.types.attrs; + description = "Additional options for Hyprland config"; + default = []; + }; + + plugins = lib.mkOption { + type = lib.types.listOf lib.types.package; + description = "Additional plugins for Hyprland"; + default = []; + }; + + sourceFiles = lib.mkOption { + type = lib.types.listOf lib.types.str; + description = "Config files to source"; + default = []; + }; }; config = lib.mkIf config.modules.hyprland.enable { - environment.systemPackages = with pkgs; [ + home.packages = with pkgs; [ hyprlock hypridle wl-clipboard cliphist swww ] ++ config.modules.hyprland.additionalPackages; - programs.hyprland.withUWSM = true; - programs.hyprland.enable = true; - programs.hyprland.xwayland.enable = true; - - services.logind.extraConfig = '' - HandleLidSwitch=suspend - HandleLidSwitchExternalPower=ignore - HandlePowerKey=ignore - ''; + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + plugins = config.modules.hyprland.plugins; + settings = config.modules.hyprland.additionalConfig // { + source = config.modules.hyprland.sourceFiles; + }; + }; xdg.portal = { enable = true; + config.common.default = "*"; extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; }; - security.polkit.enable = true; - systemd.user.services.authentication-agent = { - description = "GNOME Authentication Agent"; - wantedBy = ["graphical-session.target"]; - wants = ["graphical-session.target"]; - after = ["graphical-session.target"]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; + systemd.user.services.authentication-agent = { + Unit = { + Description = "GNOME Authentication Agent"; + After = [ "graphical-session.target" ]; + Wants = [ "graphical-session.target" ]; + }; - services = { - dbus.enable = true; - gvfs.enable = true; - upower.enable = true; - power-profiles-daemon.enable = true; - }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; - services.xserver.displayManager = { - gdm.enable = true; - startx.enable = true; - }; - - systemd.tmpfiles.rules = [ - "d '/var/cache/greeter' - greeter greeter - -" - ]; + Service = { + Type = "simple"; + ExecStart = "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; }; } diff --git a/profiles/hulk/programs.nix b/profiles/hulk/programs.nix index 73dd390..5a005f8 100644 --- a/profiles/hulk/programs.nix +++ b/profiles/hulk/programs.nix @@ -2,11 +2,42 @@ { imports = [ + # DEs + ../../modules/desktop-environments/hyprland.nix + + # Utilities + apps ../../modules/home-manager/darkman.nix ../../modules/home-manager/fish.nix + + # Home Manager modules inputs.ags.homeManagerModules.default ]; + modules.hyprland = { + enable = true; + additionalPackages = with pkgs; [ hyprshot ]; + plugins = with pkgs.hyprlandPlugins; [ hyprspace ]; + sourceFiles = [ + "~/.config/hypr/config/animations.conf" + "~/.config/hypr/config/autostart.conf" + "~/.config/hypr/config/binds.conf" + "~/.config/hypr/config/io.conf" + "~/.config/hypr/config/misc.conf" + "~/.config/hypr/config/rules.conf" + "~/.config/hypr/config/workspaces.conf" + ]; + + additionalConfig = { + "$terminal" = "alacritty"; + "$fileManager" = "thunar"; + "$browser" = "firefox-beta"; + "$email" = "thunderbird"; + "$shell" = "fish"; + + "$screenshot_dir" = "$HOME/images/screenshots"; + }; + }; + modules.darkman = { enable = true; customLightModeScript = "$HOME/.config/hypr/scripts/random-wallpaper.sh";