From 2dd1bd6cd369460f3ea2d438041f2ccc2b75463d Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Fri, 2 May 2025 16:53:00 +0100 Subject: [PATCH] Add home hyprland config --- flake.lock | 7 ++- flake.nix | 2 +- home/base/shell.nix | 2 +- home/default.nix | 1 + home/desktop/default.nix | 16 +++++++ home/desktop/hyprland.nix | 71 ++++++++++++++++++++++++++++ machines/sodacream/configuration.nix | 2 +- machines/sodacream/home.nix | 1 + modules/desktop/session.nix | 24 ---------- 9 files changed, 95 insertions(+), 31 deletions(-) create mode 100644 home/desktop/default.nix create mode 100644 home/desktop/hyprland.nix diff --git a/flake.lock b/flake.lock index 9f1098c..9930495 100644 --- a/flake.lock +++ b/flake.lock @@ -310,16 +310,15 @@ ] }, "locked": { - "lastModified": 1745557122, - "narHash": "sha256-eqSo9ugzsqhFgaDFYUZj943nurlX4L6f+AW0skJ4W+M=", + "lastModified": 1746193516, + "narHash": "sha256-7KqthzbP7LbJpo6DtxlTg2Fqcs7HL1iV1vd1mM8q/u0=", "owner": "nix-community", "repo": "home-manager", - "rev": "dd26f75fb4ec1c731d4b1396eaf4439ce40a91c1", + "rev": "355a6b937d07a95cb0b753ef513bcaad09128dea", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.11", "repo": "home-manager", "type": "github" } diff --git a/flake.nix b/flake.nix index c76cf4b..03948bd 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ flake-utils.url = "github:numtide/flake-utils"; home-manager = { - url = "github:nix-community/home-manager/release-24.11"; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/home/base/shell.nix b/home/base/shell.nix index ec36cca..0a2fbbc 100644 --- a/home/base/shell.nix +++ b/home/base/shell.nix @@ -55,7 +55,7 @@ in { src = pkgs.pure-prompt; } ]; - initExtra = /*sh*/'' + initContent = /*sh*/'' setopt NO_NOMATCH stty -ixon -ixoff ''; diff --git a/home/default.nix b/home/default.nix index 2ffd133..431a83e 100644 --- a/home/default.nix +++ b/home/default.nix @@ -4,6 +4,7 @@ imports = [ ./base ./development + ./desktop ./apps ]; } diff --git a/home/desktop/default.nix b/home/desktop/default.nix new file mode 100644 index 0000000..905daa5 --- /dev/null +++ b/home/desktop/default.nix @@ -0,0 +1,16 @@ +{ lib, ... }: + +with lib; { + options.modules.desktop = { + enable = mkOption { + default = false; + example = true; + description = "Whether to enable Deskop options."; + type = types.bool; + }; + }; + + imports = [ + ./hyprland.nix + ]; +} diff --git a/home/desktop/hyprland.nix b/home/desktop/hyprland.nix new file mode 100644 index 0000000..d0cf91b --- /dev/null +++ b/home/desktop/hyprland.nix @@ -0,0 +1,71 @@ +{ lib, config, pkgs, ... }: + +with lib; +let + cfg = config.modules.desktop; +in { + options.modules.desktop.hyprland = { + enable = mkOption { + default = cfg.enable; + example = true; + description = "Whether to enable Hyprland configuration."; + type = types.bool; + }; + }; + + config = mkIf cfg.hyprland.enable { + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = false; + xwayland.enable = true; + settings = { + "$mod" = "SUPER"; + + general = { + gaps_out = 10; + }; + + input = { + kb_options = "ctrl:nocaps"; + touchpad = { + clickfinger_behavior = true; + tap-to-click = false; + tap-and-drag = false; + scroll_factor = 0.2; + }; + }; + + monitor = [ + "eDP-1, preferred, 0x0, 1.6" + "eDP-1, addreserved, 35, 0, 0, 0" + ]; + + debug = { + error_position = 1; + }; + + bind = [ + "$mod, Q, exec, uwsm app -- ghostty" + ]; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + hyprcursor.enable = true; + x11.enable = true; + package = pkgs.apple-cursor; + name = "macOS"; + size = 28; + }; + + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + ]; + }; + }; +} diff --git a/machines/sodacream/configuration.nix b/machines/sodacream/configuration.nix index 51d3af9..e595346 100644 --- a/machines/sodacream/configuration.nix +++ b/machines/sodacream/configuration.nix @@ -25,7 +25,7 @@ server = { enable = true; tailscale.enable = true; - sshd.enable = false; + sshd.enable = true; podman.enable = true; }; }; diff --git a/machines/sodacream/home.nix b/machines/sodacream/home.nix index e70bcd4..6e4af5c 100644 --- a/machines/sodacream/home.nix +++ b/machines/sodacream/home.nix @@ -1,5 +1,6 @@ { ... }: { modules = { + desktop.enable = true; development = { enable = true; js.enable = true; diff --git a/modules/desktop/session.nix b/modules/desktop/session.nix index 4409080..f466cc2 100644 --- a/modules/desktop/session.nix +++ b/modules/desktop/session.nix @@ -18,7 +18,6 @@ in { plymouth.enable = true; initrd.verbose = mkDefault false; consoleLogLevel = 0; - kernelParams = [ "console=tty1" "vt.global_cursor_default=0" ]; }; services.greetd = { @@ -35,29 +34,6 @@ in { xwayland.enable = true; }; - environment = { - systemPackages = with pkgs.kdePackages; [ - sddm-kcm - qtmultimedia - pkgs.apple-cursor - ]; - plasma6 = { - excludePackages = with pkgs.kdePackages; [ - discover - ffmpegthumbs - plasma-browser-integration - kate - konsole - krdp - elisa - gwenview - oxygen - oxygen-sounds - khelpcenter - ]; - }; - }; - security = { polkit.enable = true; }; -- knotmirror 0.0.1