From 14a58df89499780555401028eb0711ef13d9705c Mon Sep 17 00:00:00 2001 From: Max Koon Date: Mon, 22 Dec 2025 15:59:25 -0500 Subject: [PATCH] refactor: move to hyprland --- flake.lock | 197 ++++++++++-- flake.nix | 28 +- home/common/optional/desktop/hyprland.nix | 24 ++ .../optional/desktop/hyprland/hypridle.nix | 27 ++ .../optional/desktop/hyprland/hyprland.nix | 296 ++++++++++++++++++ .../optional/desktop/hyprland/hyprlock.nix | 58 ++++ .../desktop/hyprland/scripts/default.nix | 7 + .../desktop/hyprland/swayosd/style.css | 35 +++ .../desktop/hyprland/walker/config.toml | 252 +++++++++++++++ .../optional/desktop/hyprland/wallpaper.nix | 16 + .../desktop/hyprland/waybar/config.jsonc | 133 ++++++++ .../desktop/hyprland/waybar/style.css | 84 +++++ .../common/optional/desktop/plasma.nix | 3 +- host/common/core/default.nix | 2 +- host/common/optional/desktop/hyprland.nix | 16 + .../optional/desktop/hyprland/cursor.nix | 10 + .../common/optional/desktop/hyprland/font.nix | 28 ++ .../optional/desktop/hyprland/greeter.nix | 12 + .../optional/desktop/hyprland/hyprlock.nix | 4 + .../optional/desktop/hyprland/packages.nix | 22 ++ .../{desktop.nix => desktop/plasma.nix} | 1 + host/common/optional/fonts.nix | 19 -- host/common/optional/locale.nix | 2 +- host/max/default.nix | 54 ++-- host/max/home.nix | 4 +- host/max/home/browser.nix | 30 ++ host/max/home/git.nix | 7 +- host/max/home/nvim.nix | 27 +- host/max/home/terminal.nix | 20 +- host/max/user.nix | 11 +- justfile | 6 + 31 files changed, 1331 insertions(+), 104 deletions(-) create mode 100644 home/common/optional/desktop/hyprland.nix create mode 100644 home/common/optional/desktop/hyprland/hypridle.nix create mode 100644 home/common/optional/desktop/hyprland/hyprland.nix create mode 100644 home/common/optional/desktop/hyprland/hyprlock.nix create mode 100644 home/common/optional/desktop/hyprland/scripts/default.nix create mode 100644 home/common/optional/desktop/hyprland/swayosd/style.css create mode 100644 home/common/optional/desktop/hyprland/walker/config.toml create mode 100644 home/common/optional/desktop/hyprland/wallpaper.nix create mode 100644 home/common/optional/desktop/hyprland/waybar/config.jsonc create mode 100644 home/common/optional/desktop/hyprland/waybar/style.css rename host/max/home/desktop.nix => home/common/optional/desktop/plasma.nix (94%) create mode 100644 host/common/optional/desktop/hyprland.nix create mode 100644 host/common/optional/desktop/hyprland/cursor.nix create mode 100644 host/common/optional/desktop/hyprland/font.nix create mode 100644 host/common/optional/desktop/hyprland/greeter.nix create mode 100644 host/common/optional/desktop/hyprland/hyprlock.nix create mode 100644 host/common/optional/desktop/hyprland/packages.nix rename host/common/optional/{desktop.nix => desktop/plasma.nix} (99%) delete mode 100644 host/common/optional/fonts.nix diff --git a/flake.lock b/flake.lock index 8445aa9..c8419c7 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,31 @@ { "nodes": { + "apple-fonts": { + "inputs": { + "nixpkgs": "nixpkgs", + "ny": "ny", + "sf-arabic": "sf-arabic", + "sf-armenian": "sf-armenian", + "sf-compact": "sf-compact", + "sf-georgian": "sf-georgian", + "sf-hebrew": "sf-hebrew", + "sf-mono": "sf-mono", + "sf-pro": "sf-pro" + }, + "locked": { + "lastModified": 1758228441, + "narHash": "sha256-3mA9oFuhJ1EHyhPd17g/EuJi4jDYPGhyxkEitdh3Kmc=", + "owner": "Lyndeno", + "repo": "apple-fonts.nix", + "rev": "aba9944f6606a69ebedf7bfb723316139eec3f72", + "type": "github" + }, + "original": { + "owner": "Lyndeno", + "repo": "apple-fonts.nix", + "type": "github" + } + }, "elytrarides": { "inputs": { "flake-utils": "flake-utils", @@ -122,16 +148,16 @@ ] }, "locked": { - "lastModified": 1753592768, - "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", + "lastModified": 1766292113, + "narHash": "sha256-sWTtmkQujRpjWYCnZc8LWdDiCzrRlSBPrGovkZpLkBI=", "owner": "nix-community", "repo": "home-manager", - "rev": "fc3add429f21450359369af74c2375cb34a2d204", + "rev": "fdec8815a86db36f42fc9c8cb2931cd8485f5aed", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "release-25.11", "repo": "home-manager", "type": "github" } @@ -188,24 +214,40 @@ "nixos-apple-silicon": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1748659443, - "narHash": "sha256-dav2hzyCmXZ3n6lEZrfZBG51+g6PUhkzRl3d6Ypd9x0=", + "lastModified": 1763596466, + "narHash": "sha256-CTSUc4Fk1lHMQZMJ5LczPDYGLq5UjXDFKLSpuA3mKmI=", "owner": "nix-community", "repo": "nixos-apple-silicon", - "rev": "3ddc251d2acce5019b0fa770e224d068610a34e4", + "rev": "73b7103c4e3996e3e20868d510b0e8797f279323", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-2025-05-30", + "ref": "release-2025-11-18", "repo": "nixos-apple-silicon", "type": "github" } }, "nixpkgs": { + "locked": { + "lastModified": 1757745802, + "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -221,34 +263,34 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { - "lastModified": 1748460289, - "narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=", - "owner": "nixos", + "lastModified": 1766070988, + "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102", + "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1754563854, - "narHash": "sha256-YzNTExe3kMY9lYs23mZR7jsVHe5TWnpwNrsPOpFs/b8=", + "lastModified": 1766201043, + "narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e728d7ae4bb6394bbd19eec52b7358526a44c414", + "rev": "b3aad468604d3e488d627c0b43984eb60e75e782", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-25.05", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } @@ -263,16 +305,16 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1754262585, - "narHash": "sha256-Yz5dJ0VzGRzSRHdHldsWQbuFYmtP3NWNreCvPfCi9CI=", + "lastModified": 1766256678, + "narHash": "sha256-LLpJEUFNrj6pO8hvkZMjuuBUeCrjJp/PnVSp2huR+ZA=", "owner": "nix-community", "repo": "nixvim", - "rev": "ab1b5962e1ca90b42de47e1172e0d24ca80e6256", + "rev": "204a2f3d359e01fcf5af4433adc8cdbb434c9ded", "type": "github" }, "original": { "owner": "nix-community", - "ref": "nixos-25.05", + "ref": "nixos-25.11", "repo": "nixvim", "type": "github" } @@ -300,6 +342,18 @@ "type": "github" } }, + "ny": { + "flake": false, + "locked": { + "narHash": "sha256-3257NAH4qlan2YHVLpNRy7x8IJqR2pal3OzFo/ykqXs=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" + } + }, "plasma-manager": { "inputs": { "home-manager": [ @@ -325,10 +379,11 @@ }, "root": { "inputs": { + "apple-fonts": "apple-fonts", "elytrarides": "elytrarides", "home-manager": "home-manager", "nixos-apple-silicon": "nixos-apple-silicon", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixvim": "nixvim", "plasma-manager": "plasma-manager", "sops-nix": "sops-nix", @@ -339,7 +394,7 @@ }, "rust-overlay": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1758204348, @@ -355,6 +410,90 @@ "type": "github" } }, + "sf-arabic": { + "flake": false, + "locked": { + "narHash": "sha256-/0gjRimqvZyE60xYxxPdlU+7Q2LJnnvtbmwOP0YmS9U=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" + } + }, + "sf-armenian": { + "flake": false, + "locked": { + "narHash": "sha256-rRoDkbNMYkzOHZmQm96Zv80TZvRlAeoxkv4pMHP5nUg=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg" + } + }, + "sf-compact": { + "flake": false, + "locked": { + "narHash": "sha256-WeqT80cdK/XzTLSaJs5DHodzxoeAzwL/xTgdq0YwQbM=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" + } + }, + "sf-georgian": { + "flake": false, + "locked": { + "narHash": "sha256-IevVNOC28IiR45YfI3PsZzXLMRxuB5u7UiE53Zn6tRU=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg" + } + }, + "sf-hebrew": { + "flake": false, + "locked": { + "narHash": "sha256-Dw84kYwMpCtKKKqm8cZcQ9TZ7GayU5MO7W0LJw0Rcwk=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg" + } + }, + "sf-mono": { + "flake": false, + "locked": { + "narHash": "sha256-ICdHRFdNL7PM/fXJUzS7LgZxZiqcyIuCMHLze4En4vg=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" + } + }, + "sf-pro": { + "flake": false, + "locked": { + "narHash": "sha256-vprahHpCUf9O8RualBrEuLEfuLfzI/2d8AQmwlCGPPk=", + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" + }, + "original": { + "type": "file", + "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" + } + }, "sops-nix": { "inputs": { "nixpkgs": [ @@ -459,11 +598,11 @@ }, "unstable": { "locked": { - "lastModified": 1763835633, - "narHash": "sha256-HzxeGVID5MChuCPESuC0dlQL1/scDKu+MmzoVBJxulM=", + "lastModified": 1765779637, + "narHash": "sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "050e09e091117c3d7328c7b2b7b577492c43c134", + "rev": "1306659b587dc277866c7b69eb97e5f07864d8c4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ee8a253..d7ee9cc 100644 --- a/flake.nix +++ b/flake.nix @@ -2,26 +2,20 @@ description = "Koon OS"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05"; + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11"; unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixos-apple-silicon.url = - "github:nix-community/nixos-apple-silicon?ref=release-2025-05-30"; + "github:nix-community/nixos-apple-silicon?ref=release-2025-11-18"; home-manager = { - url = "github:nix-community/home-manager?ref=release-25.05"; + url = "github:nix-community/home-manager?ref=release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; - plasma-manager = { - url = "github:nix-community/plasma-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.home-manager.follows = "home-manager"; - }; - nixvim = { - url = "github:nix-community/nixvim?ref=nixos-25.05"; + url = "github:nix-community/nixvim?ref=nixos-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -46,10 +40,18 @@ # to have it up-to-date or simply don't specify the nixpkgs input inputs.nixpkgs.follows = "unstable"; }; + + apple-fonts.url= "github:Lyndeno/apple-fonts.nix"; + + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; }; outputs = { self, nixpkgs, unstable, nixos-apple-silicon, home-manager - , plasma-manager, nixvim, sops-nix, terranix, elytrarides, zen-browser, ... }: + , plasma-manager, nixvim, sops-nix, terranix, elytrarides, zen-browser, apple-fonts, ... }: let forAllSystems = function: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed @@ -109,7 +111,7 @@ secrets = import ./secrets; in nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { inherit pkgs-unstable secrets zen-browser; }; + specialArgs = { inherit pkgs-unstable secrets zen-browser apple-fonts; }; modules = [ ./host/max/default.nix nixos-apple-silicon.nixosModules.apple-silicon-support @@ -122,7 +124,7 @@ home-manager.users.max = { config, pkgs, lib, ... }: { imports = [ sops-nix.homeManagerModules.sops - nixvim.homeManagerModules.nixvim + nixvim.homeModules.nixvim plasma-manager.homeManagerModules.plasma-manager zen-browser.homeModules.beta ./host/max/home.nix # Import your home.nix here diff --git a/home/common/optional/desktop/hyprland.nix b/home/common/optional/desktop/hyprland.nix new file mode 100644 index 0000000..0490081 --- /dev/null +++ b/home/common/optional/desktop/hyprland.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: +let + scripts = import ./hyprland/scripts/default.nix { inherit pkgs; }; +in +{ + imports = [ + (import ./hyprland/hyprland.nix { inherit pkgs scripts; }) + (import ./hyprland/wallpaper.nix { inherit pkgs scripts; }) + (import ./hyprland/hyprlock.nix { inherit pkgs scripts; }) + (import ./hyprland/hypridle.nix { inherit pkgs scripts; }) + ]; + + home.file.".config/waybar/config.jsonc".source = ./hyprland/waybar/config.jsonc; + home.file.".config/waybar/style.css".source = ./hyprland/waybar/style.css; + + services.swayosd = { + enable = true; + }; + + home.file.".config/swayosd/style.css".source = ./hyprland/swayosd/style.css; + + home.file.".config/walker/config.toml".source = ./hyprland/walker/config.toml; +} + diff --git a/home/common/optional/desktop/hyprland/hypridle.nix b/home/common/optional/desktop/hyprland/hypridle.nix new file mode 100644 index 0000000..92fcbff --- /dev/null +++ b/home/common/optional/desktop/hyprland/hypridle.nix @@ -0,0 +1,27 @@ +{ pkgs, scripts, ... }: +{ + services.hypridle = { + enable = true; + + settings = { + general = { + lock_cmd = "${scripts.lock}"; + before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + inhibit_sleep = 3; # wait until screen is locked + }; + + listener = [ + { + timeout = 60 * 5; # 5min + on-timeout = "${pkgs.systemd}/bin/loginctl lock-session"; # lock screen when timeout has passed + } + { + timeout = 60 * 5.5; # 5.5min + on-timeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on && brightnessctl -r"; # screen on when activity is detected + } + ]; + }; + }; +} diff --git a/home/common/optional/desktop/hyprland/hyprland.nix b/home/common/optional/desktop/hyprland/hyprland.nix new file mode 100644 index 0000000..52d95b4 --- /dev/null +++ b/home/common/optional/desktop/hyprland/hyprland.nix @@ -0,0 +1,296 @@ +{ pkgs, scripts, ... }: +{ + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = false; + + plugins = with pkgs; [ + (hyprlandPlugins.mkHyprlandPlugin { + pluginName = "hyprselect"; + version = "0.1"; + src = fetchFromGitHub { + owner = "jmanc3"; + repo = "hyprselect"; + rev = "f9651b5fd64c730ee164a6fee6a08d0398dcbe0a"; + hash = "sha256-tY8EdfsjlUOuQ9v/POqpyLlkRO5wqEVSE9UeHfXuaGk="; + }; + + inherit (hyprland) nativeBuildInputs; + + meta = with lib; { + homepage = "https://github.com/jmanc3/hyprselect"; + description = "A plugin that adds a completely useless desktop selection box to Hyprland"; + license = licenses.unlicense; + platforms = platforms.linux; + }; + }) + ]; + + settings = { + "$terminal" = "${pkgs.uwsm}/bin/uwsm-app -- ${pkgs.alacritty}/bin/alacritty"; + "$fileManager" = "${pkgs.uwsm}/bin/uwsm-app -- ${pkgs.pcmanfm}/bin/pcmanfm"; + "$menu" = "${pkgs.walker}/bin/walker"; + + monitor = [ + "eDP-1,preferred,1721x1080,auto" + "HDMI-A-1,preferred,1450x0,auto" + ]; + + exec-once = [ + "${pkgs.uwsm}/bin/uwsm-app -- ${pkgs.hypridle}/bin/hypridle" + "${pkgs.uwsm}/bin/uwsm-app -- ${pkgs.waybar}/bin/waybar" + "${pkgs.uwsm}/bin/uwsm-app -- ${pkgs.hyprpaper}/bin/hyprpaper" + "sleep 2 && pw-play --volume=0 ~/Downloads/empty.wav" + ]; + + env = [ + "XCURSOR_SIZE,20" + "XCURSOR_THEME,macOS" + ]; + + general = { + gaps_in = 5; + gaps_out = 20; + + border_size = 2; + + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = false; + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false; + + layout = "dwindle"; + }; + + decoration = { + # rounding = 10 + # rounding_power = 2 + + # Change transparency of focused and unfocused windows + active_opacity = 1.0; + inactive_opacity = 1.0; + + shadow = { + enabled = true; + range = 4; + render_power = 3; + color = "rgba(1a1a1aee)"; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#blur + blur = { + enabled = true; + size = 3; + passes = 1; + + vibrancy = 0.1696; + }; + }; + + + # https://wiki.hyprland.org/Configuring/Variables/#animations + animations = { + enabled = true; + + # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + bezier = [ + "easeOutQuint,0.23,1,0.32,1" + "easeInOutCubic,0.65,0.05,0.36,1" + "linear,0,0,1,1" + "almostLinear,0.5,0.5,0.75,1.0" + "quick,0.15,0,0.1,1" + + ]; + + animation = [ + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + "windows, 1, 4.79, easeOutQuint" + "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + "windowsOut, 1, 1.49, linear, popin 87%" + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + "workspaces, 1, 1.94, almostLinear, fade" + "workspacesIn, 1, 1.21, almostLinear, fade" + "workspacesOut, 1, 1.94, almostLinear, fade" + ]; + }; + + + dwindle = { + pseudotile = true; # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true; # You probably want this + }; + + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + master = { + new_status = "master"; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#misc + misc = { + force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + + ############# + ### INPUT ### + ############# + + # https://wiki.hyprland.org/Configuring/Variables/#input + input = { + kb_layout = "us"; + # kb_variant = + # kb_model = + kb_options = "caps:swapescape"; + # kb_rules = + + follow_mouse = 1; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + repeat_rate = 35; + repeat_delay = 300; + + touchpad = { + natural_scroll = true; + tap-to-click = false; + clickfinger_behavior = true; + }; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#gestures + # gestures = { + # workspace_swipe = true; + # }; + + # See https://wiki.hyprland.org/Configuring/Keywords/ + "$mainMod" = "SUPER"; # Sets "Windows" key as main modifier + bind = [ + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + "$mainMod, return, exec, $terminal" + "$mainMod, W, killactive," + # bind = $mainMod, M, exit, + "$mainMod, E, exec, $fileManager" + # "$mainMod, V, togglefloating," + "$mainMod, space, exec, $menu" + "$mainMod, P, pseudo, # dwindle" + "$mainMod, F, fullscreen" + # bind = $mainMod, J, togglesplit, # dwindle + + "$mainMod SHIFT, L, exec, ${scripts.lock}" + + # Move focus with mainMod + arrow keys + "$mainMod, H, movefocus, l" + "$mainMod, L, movefocus, r" + "$mainMod, K, movefocus, u" + "$mainMod, J, movefocus, d" + + # Switch workspaces with mainMod + [0-9] + "$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 active window to a workspace with mainMod + SHIFT + [0-9] + "$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" + + # Example special workspace (scratchpad) + "$mainMod, S, togglespecialworkspace, magic" + "$mainMod SHIFT, S, movetoworkspace, special:magic" + + # Scroll through existing workspaces with mainMod + scroll + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + ]; + + + # Move/resize windows with mainMod + LMB/RMB and dragging + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + "$osdclient" = "swayosd-client --monitor \"$(hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.focused == true).name')\""; + + bindel = [ + # Laptop multimedia keys for volume and LCD brightness + # bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ + # bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- + ",XF86AudioRaiseVolume, exec, $osdclient --output-volume=raise" + ",XF86AudioLowerVolume, exec, $osdclient --output-volume=lower" + ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + # bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+ + # bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%- + ",XF86MonBrightnessUp, exec, $osdclient --brightness=raise" + ",XF86MonBrightnessDown, exec, $osdclient --brightness=lower" + ]; + + bindl = [ + # Requires playerctl + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPause, exec, playerctl play-pause" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ]; + + bindd = [ + "$mainMod, C, Universal copy, sendshortcut, CTRL, Insert," + "$mainMod, V, Universal paste, sendshortcut, SHIFT, Insert," + "$mainMod, X, Universal cut, sendshortcut, CTRL, X," + "$mainMod, A, Universal select all, sendshortcut, CTRL, A," + "$mainMod, T, Universal new tab, sendshortcut, CTRL, T," + ]; + + windowrule = [ + # Just dash of opacity by default + "opacity 0.97 0.9, class:.*" + + # Ignore maximize requests from apps. You'll probably like this. + "suppressevent maximize, class:.*" + + # Fix some dragging issues with XWayland + "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" + ]; + + plugin = { + hyprselect = { + "col.main" = "rgba(ffffff25)"; + "col.border" = "rgba(ffffff88)"; + + fade_time_ms = 165.0; + + border_size = 1.0; + }; + }; + }; + }; +} diff --git a/home/common/optional/desktop/hyprland/hyprlock.nix b/home/common/optional/desktop/hyprland/hyprlock.nix new file mode 100644 index 0000000..5f369ab --- /dev/null +++ b/home/common/optional/desktop/hyprland/hyprlock.nix @@ -0,0 +1,58 @@ +{ ... }: +{ + programs.hyprlock = { + enable = true; + + settings = { + "$color" = "rgba(26,27,38,1.0)"; + "$inner_color" = "rgba(26,27,38,0.8)"; + "$outer_color" = "rgba(205,214,244,1.0)"; + "$font_color" = "rgba(205,214,244,1.0)"; + "$check_color" = "rgba(68, 157, 171, 1.0)"; + + general = { + ignore_empty_input = true; + }; + + background = { + monitor = ""; + color = "$color"; + path = "~/Downloads/wallpaper.png"; + blur_passes = 3; + }; + + animations = { + enabled = false; + }; + + input-field = { + monitor = ""; + size = "650, 100"; + position = "0, 0"; + halign = "center"; + valign = "center"; + + inner_color = "$inner_color"; + outer_color = "$outer_color"; + outline_thickness = 4; + + font_family = "JetBrainsMono Nerd Font"; + font_color = "$font_color"; + + placeholder_text = "Enter Password"; + check_color = "$check_color"; + fail_text = "$FAIL ($ATTEMPTS)"; + + rounding = 0; + shadow_passes = 0; + fade_on_empty = false; + }; + + auth = { + "fingerprint:enabled" = true; + }; + + }; + + }; +} diff --git a/home/common/optional/desktop/hyprland/scripts/default.nix b/home/common/optional/desktop/hyprland/scripts/default.nix new file mode 100644 index 0000000..4932de8 --- /dev/null +++ b/home/common/optional/desktop/hyprland/scripts/default.nix @@ -0,0 +1,7 @@ +{ pkgs }: +{ + lock = + pkgs.writeShellScript "koonos-lock-screen" '' + ${pkgs.hyprlock}/bin/hyprlock + ''; +} diff --git a/home/common/optional/desktop/hyprland/swayosd/style.css b/home/common/optional/desktop/hyprland/swayosd/style.css new file mode 100644 index 0000000..ae920b9 --- /dev/null +++ b/home/common/optional/desktop/hyprland/swayosd/style.css @@ -0,0 +1,35 @@ +@define-color background-color #1a1b26; +@define-color border-color #33354a; +@define-color label #a9b1d6; +@define-color image #a9b1d6; +@define-color progress #a9b1d6; + +window { + border-radius: 999; + opacity: 0.97; + border: 1px solid @border-color; + padding: 0; + + background-color: @background-color; +} + +label { + font-family: 'JetBrainsMono Nerd Font'; + font-size: 11pt; + + color: @label; +} + +image { + color: @image; + -gtk-icon-transform: scale(0.5); +} + +progressbar { + border-radius: 999; +} + +progress { + background-color: @progress; +} + diff --git a/home/common/optional/desktop/hyprland/walker/config.toml b/home/common/optional/desktop/hyprland/walker/config.toml new file mode 100644 index 0000000..417f945 --- /dev/null +++ b/home/common/optional/desktop/hyprland/walker/config.toml @@ -0,0 +1,252 @@ +app_launch_prefix = "" +terminal_title_flag = "" +locale = "" +close_when_open = false +theme = "default" +monitor = "" +hotreload_theme = false +as_window = false +timeout = 0 +disable_click_to_close = false +force_keyboard_focus = false + +[keys] +accept_typeahead = ["tab"] +trigger_labels = "lalt" +next = ["down"] +prev = ["up"] +close = ["esc"] +remove_from_history = ["shift backspace"] +resume_query = ["ctrl r"] +toggle_exact_search = ["ctrl m"] + +[keys.activation_modifiers] +keep_open = "shift" +alternate = "alt" + +[keys.ai] +clear_session = ["ctrl x"] +copy_last_response = ["ctrl c"] +resume_session = ["ctrl r"] +run_last_response = ["ctrl e"] + +[events] +on_activate = "" +on_selection = "" +on_exit = "" +on_launch = "" +on_query_change = "" + +[list] +dynamic_sub = true +keyboard_scroll_style = "emacs" +max_entries = 50 +show_initial_entries = true +single_click = true +visibility_threshold = 20 +placeholder = "No Results" + +[search] +argument_delimiter = "#" +placeholder = "Search..." +delay = 0 +resume_last_query = false + +[activation_mode] +labels = "jkl;asdf" + +[builtins.applications] +weight = 5 +name = "applications" +placeholder = "Applications" +prioritize_new = true +hide_actions_with_empty_query = true +context_aware = true +refresh = true +show_sub_when_single = true +show_icon_when_single = true +show_generic = true +history = true + +[builtins.applications.actions] +enabled = true +hide_category = false +hide_without_query = true + +[builtins.bookmarks] +weight = 5 +placeholder = "Bookmarks" +name = "bookmarks" +icon = "bookmark" +switcher_only = true + +[[builtins.bookmarks.entries]] +label = "Walker" +url = "https://github.com/abenz1267/walker" +keywords = ["walker", "github"] + +[builtins.xdph_picker] +hidden = true +weight = 5 +placeholder = "Screen/Window Picker" +show_sub_when_single = true +name = "xdphpicker" +switcher_only = true + +[builtins.ai] +weight = 5 +placeholder = "AI" +name = "ai" +icon = "help-browser" +switcher_only = true +show_sub_when_single = true + +[[builtins.ai.anthropic.prompts]] +model = "claude-3-7-sonnet-20250219" +temperature = 1 +max_tokens = 1_000 +label = "General Assistant" +prompt = "You are a helpful general assistant. Keep your answers short and precise." + +[builtins.calc] +require_number = true +weight = 5 +name = "calc" +icon = "accessories-calculator" +placeholder = "Calculator" +min_chars = 4 + +[builtins.windows] +weight = 5 +icon = "view-restore" +name = "windows" +placeholder = "Windows" +show_icon_when_single = true + +[builtins.clipboard] +always_put_new_on_top = true +exec = "wl-copy" +weight = 5 +name = "clipboard" +avoid_line_breaks = true +placeholder = "Clipboard" +image_height = 300 +max_entries = 10 +switcher_only = true + +[builtins.commands] +weight = 5 +icon = "utilities-terminal" +switcher_only = true +name = "commands" +placeholder = "Commands" + +[builtins.custom_commands] +weight = 5 +icon = "utilities-terminal" +name = "custom_commands" +placeholder = "Custom Commands" + +[builtins.emojis] +exec = "wl-copy" +weight = 5 +name = "emojis" +placeholder = "Emojis" +switcher_only = true +history = true +typeahead = true +show_unqualified = false + +[builtins.symbols] +after_copy = "" +weight = 5 +name = "symbols" +placeholder = "Symbols" +switcher_only = true +history = true +typeahead = true + +[builtins.finder] +use_fd = false +fd_flags = "--ignore-vcs --type file" +weight = 5 +icon = "file" +name = "finder" +placeholder = "Finder" +switcher_only = true +ignore_gitignore = true +refresh = true +concurrency = 8 +show_icon_when_single = true +preview_images = false + +[builtins.runner] +eager_loading = true +weight = 5 +icon = "utilities-terminal" +name = "runner" +placeholder = "Runner" +typeahead = true +history = true +generic_entry = false +refresh = true +use_fd = false + +[builtins.ssh] +weight = 5 +icon = "preferences-system-network" +name = "ssh" +placeholder = "SSH" +switcher_only = true +history = true +refresh = true + +[builtins.switcher] +weight = 5 +name = "switcher" +placeholder = "Switcher" +prefix = "/" + +[builtins.websearch] +keep_selection = true +weight = 5 +icon = "applications-internet" +name = "websearch" +placeholder = "Websearch" + +[[builtins.websearch.entries]] +name = "Google" +url = "https://www.google.com/search?q=%TERM%" + +[[builtins.websearch.entries]] +name = "DuckDuckGo" +url = "https://duckduckgo.com/?q=%TERM%" +switcher_only = true + +[[builtins.websearch.entries]] +name = "Ecosia" +url = "https://www.ecosia.org/search?q=%TERM%" +switcher_only = true + +[[builtins.websearch.entries]] +name = "Yandex" +url = "https://yandex.com/search/?text=%TERM%" +switcher_only = true + +[builtins.dmenu] +hidden = true +weight = 5 +name = "dmenu" +placeholder = "Dmenu" +switcher_only = true +show_icon_when_single = true + +[builtins.translation] +delay = 1000 +weight = 5 +name = "translation" +icon = "accessories-dictionary" +placeholder = "Translation" +switcher_only = true +provider = "googlefree" + diff --git a/home/common/optional/desktop/hyprland/wallpaper.nix b/home/common/optional/desktop/hyprland/wallpaper.nix new file mode 100644 index 0000000..edd0a87 --- /dev/null +++ b/home/common/optional/desktop/hyprland/wallpaper.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + services.hyprpaper = { + enable = true; + settings = { + spash = false; + + preload = ["~/Downloads/wallpaper.png"]; + + wallpaper = [ + "eDP-1,~/Downloads/wallpaper.png" + "HDMI-A-1,~/Downloads/wallpaper.png" + ]; + }; + }; +} diff --git a/home/common/optional/desktop/hyprland/waybar/config.jsonc b/home/common/optional/desktop/hyprland/waybar/config.jsonc new file mode 100644 index 0000000..229e7dc --- /dev/null +++ b/home/common/optional/desktop/hyprland/waybar/config.jsonc @@ -0,0 +1,133 @@ +{ + "reload_style_on_change": true, + "layer": "top", + "position": "top", + "spacing": 0, + "height": 26, + "modules-left": ["custom/logo", "hyprland/workspaces"], + "modules-center": ["clock", "custom/update", "custom/screenrecording-indicator"], + "modules-right": [ + "group/tray-expander", + "bluetooth", + "network", + "pulseaudio", + "cpu", + "battery" + ], + "hyprland/workspaces": { + "on-click": "activate", + "format": "{icon}", + "format-icons": { + "default": "", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "0", + "active": "󱓻" + }, + "persistent-workspaces": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [] + } + }, + "custom/logo": { + "format": "󰳭 ", + "on-click": "omarchy-menu", + "on-click-right": "xdg-terminal-exec", + "tooltip-format": "" + }, + "cpu": { + "interval": 5, + "format": "󰍛", + "on-click": "omarchy-launch-or-focus-tui btop", + "on-click-right": "alacritty" + }, + "clock": { + "format": "{:L%A %I:%M}", + "format-alt": "{:L%d %B W%V %Y}", + "tooltip": false, + "on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select" + }, + "network": { + "format-icons": ["󰤯", "󰤟", "󰤢", "󰤥", "󰤨"], + "format": "{icon}", + "format-wifi": "{icon}", + "format-ethernet": "󰀂", + "format-disconnected": "󰤮", + "tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}", + "tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}", + "tooltip-format-disconnected": "Disconnected", + "interval": 3, + "spacing": 1, + "on-click": "omarchy-launch-wifi" + }, + "battery": { + "format": "{capacity}% {icon}", + "format-discharging": "{icon}", + "format-charging": "{icon}", + "format-plugged": "", + "format-icons": { + "charging": ["󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"], + "default": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"] + }, + "format-full": "󰂅", + "tooltip-format-discharging": "{power:>1.0f}W↓ {capacity}%", + "tooltip-format-charging": "{power:>1.0f}W↑ {capacity}%", + "interval": 5, + "on-click": "omarchy-menu power", + "states": { + "warning": 20, + "critical": 10 + } + }, + "bluetooth": { + "format": "", + "format-disabled": "󰂲", + "format-connected": "󰂱", + "format-no-controller": "", + "tooltip-format": "Devices connected: {num_connections}", + "on-click": "omarchy-launch-bluetooth" + }, + "pulseaudio": { + "format": "{icon}", + "on-click": "omarchy-launch-or-focus-tui wiremix", + "on-click-right": "pamixer -t", + "tooltip-format": "Playing at {volume}%", + "scroll-step": 5, + "format-muted": "", + "format-icons": { + "default": ["", "", ""] + } + }, + "group/tray-expander": { + "orientation": "inherit", + "drawer": { + "transition-duration": 600, + "children-class": "tray-group-item" + }, + "modules": ["custom/expand-icon", "tray"] + }, + "custom/expand-icon": { + "format": "", + "tooltip": false + }, + "custom/screenrecording-indicator": { + "on-click": "omarchy-cmd-screenrecord", + "exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh", + "signal": 8, + "return-type": "json" + }, + "tray": { + "icon-size": 12, + "spacing": 17 + } +} diff --git a/home/common/optional/desktop/hyprland/waybar/style.css b/home/common/optional/desktop/hyprland/waybar/style.css new file mode 100644 index 0000000..f608dd2 --- /dev/null +++ b/home/common/optional/desktop/hyprland/waybar/style.css @@ -0,0 +1,84 @@ +@define-color foreground #cdd6f4; +@define-color background #1a1b26; + +* { + background-color: @background; + color: @foreground; + + border: none; + border-radius: 0; + min-height: 0; + font-family: 'JetBrainsMono Nerd Font'; + font-size: 12px; +} + +.modules-left { + margin-left: 8px; +} + +.modules-right { + margin-right: 8px; +} + +#workspaces button { + all: initial; + padding: 0 6px; + margin: 0 1.5px; + min-width: 9px; +} + +#workspaces button.empty { + opacity: 0.5; +} + +#cpu, +#battery, +#pulseaudio, +#custom-omarchy, +#custom-screenrecording-indicator, +#custom-update { + min-width: 12px; + margin: 0 7.5px; +} + +#tray { + margin-right: 16px; +} + +#bluetooth { + margin-right: 17px; +} + +#network { + margin-right: 13px; +} + +#custom-expand-icon { + margin-right: 18px; +} + +tooltip { + padding: 2px; +} + +#custom-update { + font-size: 10px; +} + +#clock { + margin-left: 8.75px; +} + +.hidden { + opacity: 0; +} + +#custom-screenrecording-indicator { + min-width: 12px; + margin-left: 8.75px; + font-size: 10px; +} + +#custom-screenrecording-indicator.active { + color: #a55555; +} diff --git a/host/max/home/desktop.nix b/home/common/optional/desktop/plasma.nix similarity index 94% rename from host/max/home/desktop.nix rename to home/common/optional/desktop/plasma.nix index 3689c0d..dc2e048 100644 --- a/host/max/home/desktop.nix +++ b/home/common/optional/desktop/plasma.nix @@ -1,4 +1,4 @@ -{ lib, ... }: { +{ ... }: { programs.plasma = { enable = true; workspace = { wallpaper = "/home/max/bg.jpg"; }; @@ -13,3 +13,4 @@ }; }; } + diff --git a/host/common/core/default.nix b/host/common/core/default.nix index 94ef0fa..a12dd83 100644 --- a/host/common/core/default.nix +++ b/host/common/core/default.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: { +{ ... }: { time.timeZone = "America/New_York"; # security.sudo.wheelNeedsPassword = false; diff --git a/host/common/optional/desktop/hyprland.nix b/host/common/optional/desktop/hyprland.nix new file mode 100644 index 0000000..6edae96 --- /dev/null +++ b/host/common/optional/desktop/hyprland.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + imports = [ + ./hyprland/font.nix + ./hyprland/cursor.nix + ./hyprland/packages.nix + ./hyprland/greeter.nix + ./hyprland/hyprlock.nix + ]; + + programs.hyprland = { + enable = true; + withUWSM = true; + xwayland.enable = true; + }; +} diff --git a/host/common/optional/desktop/hyprland/cursor.nix b/host/common/optional/desktop/hyprland/cursor.nix new file mode 100644 index 0000000..2bc6a40 --- /dev/null +++ b/host/common/optional/desktop/hyprland/cursor.nix @@ -0,0 +1,10 @@ +{ pkgs, lib, ... }: +{ + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "apple_cursor" + ]; + + environment.systemPackages = with pkgs; [ + apple-cursor + ]; +} diff --git a/host/common/optional/desktop/hyprland/font.nix b/host/common/optional/desktop/hyprland/font.nix new file mode 100644 index 0000000..d129000 --- /dev/null +++ b/host/common/optional/desktop/hyprland/font.nix @@ -0,0 +1,28 @@ +{ pkgs, apple-fonts, ... }: { + fonts = { + fontconfig.defaultFonts = { + sansSerif = [ "SF Pro" ]; + serif = [ "SF Pro" ]; + monospace = [ "JetBrainsMono Nerd Font" ]; + }; + + packages = with pkgs; [ + monocraft + noto-fonts-cjk-sans + nerd-fonts.jetbrains-mono + (apple-fonts.packages.${pkgs.system}.sf-pro) + (stdenv.mkDerivation { + name = "apple-color-emoji"; + src = fetchurl { + url = + "https://github.com/samuelngs/apple-emoji-linux/releases/download/v17.4/AppleColorEmoji.ttf"; + sha256 = "1wahjmbfm1xgm58madvl21451a04gxham5vz67gqz1cvpi0cjva8"; + }; + dontUnpack = true; + installPhase = '' + install -Dm644 $src $out/share/fonts/truetype/AppleColorEmoji.ttf + ''; + }) + ]; + }; +} diff --git a/host/common/optional/desktop/hyprland/greeter.nix b/host/common/optional/desktop/hyprland/greeter.nix new file mode 100644 index 0000000..69ec4b5 --- /dev/null +++ b/host/common/optional/desktop/hyprland/greeter.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd 'uwsm start hyprland-uwsm.desktop'"; + user = "greeter"; + }; + }; + }; +} diff --git a/host/common/optional/desktop/hyprland/hyprlock.nix b/host/common/optional/desktop/hyprland/hyprlock.nix new file mode 100644 index 0000000..3c6e8f4 --- /dev/null +++ b/host/common/optional/desktop/hyprland/hyprlock.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + security.pam.services.hyprlock = {}; +} diff --git a/host/common/optional/desktop/hyprland/packages.nix b/host/common/optional/desktop/hyprland/packages.nix new file mode 100644 index 0000000..55e3945 --- /dev/null +++ b/host/common/optional/desktop/hyprland/packages.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + hyprpaper + hypridle + hyprpicker + hyprsunset + hyprshot + waybar + walker + swayosd + + playerctl + brightnessctl + wl-clipboard + wdisplays + + bluetui + + kdePackages.dolphin + ]; +} diff --git a/host/common/optional/desktop.nix b/host/common/optional/desktop/plasma.nix similarity index 99% rename from host/common/optional/desktop.nix rename to host/common/optional/desktop/plasma.nix index eb4c1cd..707e2d5 100644 --- a/host/common/optional/desktop.nix +++ b/host/common/optional/desktop/plasma.nix @@ -26,3 +26,4 @@ wl-clipboard # Command-line copy/paste utilities for Wayland ]; } + diff --git a/host/common/optional/fonts.nix b/host/common/optional/fonts.nix deleted file mode 100644 index 8189ceb..0000000 --- a/host/common/optional/fonts.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: { - fonts.packages = with pkgs; [ - monocraft - noto-fonts-cjk-sans - - (stdenv.mkDerivation { - name = "apple-color-emoji"; - src = fetchurl { - url = - "https://github.com/samuelngs/apple-emoji-linux/releases/download/v17.4/AppleColorEmoji.ttf"; - sha256 = "1wahjmbfm1xgm58madvl21451a04gxham5vz67gqz1cvpi0cjva8"; - }; - dontUnpack = true; - installPhase = '' - install -Dm644 $src $out/share/fonts/truetype/AppleColorEmoji.ttf - ''; - }) - ]; -} diff --git a/host/common/optional/locale.nix b/host/common/optional/locale.nix index 98f1d17..1e22983 100644 --- a/host/common/optional/locale.nix +++ b/host/common/optional/locale.nix @@ -7,7 +7,7 @@ fcitx5.addons = with pkgs; [ # fcitx5-gtk # alternatively, kdePackages.fcitx5-qt kdePackages.fcitx5-qt # alternatively, kdePackages.fcitx5-qt - fcitx5-chinese-addons # table input method support + qt6Packages.fcitx5-chinese-addons # table input method support fcitx5-nord # a color theme ]; }; diff --git a/host/max/default.nix b/host/max/default.nix index ff26a5f..f529091 100644 --- a/host/max/default.nix +++ b/host/max/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, pkgs-unstable, ... }: +{ pkgs, config, pkgs-unstable, lib, ... }: let openconnect-sso-src = builtins.fetchTree { type = "github"; @@ -16,11 +16,13 @@ in ./work.nix ./sops.nix + ../common/optional/desktop/hyprland.nix + ../common/optional/yubikey.nix ../common/optional/browser.nix - ../common/optional/desktop.nix - ../common/optional/fonts.nix + + ../common/optional/locale.nix ../common/optional/email.nix @@ -37,16 +39,14 @@ in hardware = { asahi = { peripheralFirmwareDirectory = ./firmware; - useExperimentalGPUDriver = true; - experimentalGPUInstallMode = "replace"; + # useExperimentalGPUDriver = true; + # experimentalGPUInstallMode = "replace"; setupAsahiSound = true; }; }; - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - networking.networkmanager.enable = - true; # Easiest to use and most distros use this by default. + networking.networkmanager.enable = true; + # networking.wireless.iwd.enable = true; hardware.bluetooth = { enable = true; @@ -66,6 +66,8 @@ in programs.kdeconnect.enable = true; environment.systemPackages = with pkgs; [ + networkmanager + vim git wget @@ -77,12 +79,12 @@ in libreoffice-qt # ncmpcpp - pkgs-unstable.signal-desktop + pkgs-unstable.signal-desktop-bin gnupg (pass.withExtensions (exts: [ exts.pass-otp ])) - pinentry + # pinentry pinentry-curses pinentry-qt @@ -129,7 +131,7 @@ in fi '') - (pkgs.callPackage "${openconnect-sso-src}/nix" {}).openconnect-sso + # (pkgs.callPackage "${openconnect-sso-src}/nix" {}).openconnect-sso ]; programs.zsh.enable = true; @@ -141,20 +143,20 @@ in }; - services.keyd = { - enable = true; - - keyboards.default = { - ids = [ "*" ]; - - settings = { - main = { - pageup = "leftmouse"; - pagedown = "rightmouse"; - }; - }; - }; - }; + # services.keyd = { + # enable = true; + # + # keyboards.default = { + # ids = [ "*" ]; + # + # settings = { + # main = { + # pageup = "leftmouse"; + # pagedown = "rightmouse"; + # }; + # }; + # }; + # }; system.stateVersion = "25.05"; diff --git a/host/max/home.nix b/host/max/home.nix index d4b9c1b..a0542f3 100644 --- a/host/max/home.nix +++ b/host/max/home.nix @@ -7,7 +7,9 @@ ./home/git.nix ./home/browser.nix - ./home/desktop.nix + + ../../home/common/optional/desktop/hyprland.nix + ./home/nvim.nix ./home/terminal.nix ./home/zathura.nix diff --git a/host/max/home/browser.nix b/host/max/home/browser.nix index af9f846..451371e 100644 --- a/host/max/home/browser.nix +++ b/host/max/home/browser.nix @@ -1,5 +1,35 @@ { config, ... }: { + xdg.mimeApps = { + enable = true; + + defaultApplications = { + "x-scheme-handler/http" = "zen-beta.desktop"; + "x-scheme-handler/https" = "zen-beta.desktop"; + "x-scheme-handler/chrome" = "zen-beta.desktop"; + "text/html" = "zen-beta.desktop"; + "application/x-extension-htm" = "zen-beta.desktop"; + "application/x-extension-html" = "zen-beta.desktop"; + "application/x-extension-shtml" = "zen-beta.desktop"; + "application/xhtml+xml" = "zen-beta.desktop"; + "application/x-extension-xhtml" = "zen-beta.desktop"; + "application/x-extension-xht" = "zen-beta.desktop"; + }; + + associations.added = { + "x-scheme-handler/http" = [ "zen-beta.desktop" ]; + "x-scheme-handler/https" = [ "zen-beta.desktop" ]; + "x-scheme-handler/chrome" = [ "zen-beta.desktop" ]; + "text/html" = [ "zen-beta.desktop" ]; + "application/x-extension-htm" = [ "zen-beta.desktop" ]; + "application/x-extension-html" = [ "zen-beta.desktop" ]; + "application/x-extension-shtml" = [ "zen-beta.desktop" ]; + "application/xhtml+xml" = [ "zen-beta.desktop" ]; + "application/x-extension-xhtml" = [ "zen-beta.desktop" ]; + "application/x-extension-xht" = [ "zen-beta.desktop" ]; + }; + }; + programs.zen-browser = { enable = true; profiles."default" = { diff --git a/host/max/home/git.nix b/host/max/home/git.nix index e80dab7..f11e65c 100644 --- a/host/max/home/git.nix +++ b/host/max/home/git.nix @@ -6,14 +6,15 @@ in { programs.git = { enable = true; - userName = "Max Koon"; - userEmail = publicGitEmail; - extraConfig = { + settings = { init.defaultBranch = "main"; push.autoSetupRemote = true; commit.gpgsign = true; gpg.format = "ssh"; + + user.name = "Max Koon"; + user.email = publicGitEmail; user.signing.key = publicKey; gpg.ssh.allowedSignersFile = "/home/max/.ssh/allowed_signers"; }; diff --git a/host/max/home/nvim.nix b/host/max/home/nvim.nix index 0593656..b95637c 100644 --- a/host/max/home/nvim.nix +++ b/host/max/home/nvim.nix @@ -2,7 +2,7 @@ programs.nixvim = { enable = true; - colorschemes.one.enable = true; + colorschemes.tokyonight.enable = true; globals = { mapleader = " "; @@ -15,7 +15,7 @@ }; opts = { - background = "light"; + background = "dark"; relativenumber = true; cursorline = true; number = true; @@ -29,6 +29,25 @@ }; + highlight = { + Normal = { + bg = "NONE"; + ctermbg = "NONE"; + }; + NormalFloat = { + bg = "NONE"; + ctermbg = "NONE"; + }; + SignColumn = { + bg = "NONE"; + ctermbg = "NONE"; + }; + EndOfBuffer = { + bg = "NONE"; + ctermbg = "NONE"; + }; + }; + extraConfigLua = '' require('stay-centered').setup({ enable = true }) require('mini.ai').setup() @@ -238,7 +257,7 @@ }; neo-tree = { enable = true; - extraOptions = { + settings = { filesystem = { filtered_items = { visible = true; @@ -252,7 +271,7 @@ bullets.enable = true; spider = { enable = true; - extraOptions = { + settings = { subwordMovement = true; skipInsignificantPunctuation = false; }; diff --git a/host/max/home/terminal.nix b/host/max/home/terminal.nix index 18aaf98..1c6cb7d 100644 --- a/host/max/home/terminal.nix +++ b/host/max/home/terminal.nix @@ -1,12 +1,19 @@ -{ pkgs, ... }: { +{ pkgs, config, ... }: { programs.alacritty = { enable = true; - theme = "one_light"; + theme = "tokyo_night"; settings = { + window = { + padding = { x = 14; y = 14; }; + }; font = { - normal.family = "Monocraft"; + normal.family = "JetBrainsMono Nerd Font"; size = 10; }; + keyboard.bindings = [ + { key = "Insert"; mods = "Shift"; action = "Paste"; } + { key = "Insert"; mods = "Control"; action = "Copy"; } + ]; }; }; @@ -18,12 +25,15 @@ keyMode = "vi"; shell = "${pkgs.zsh}/bin/zsh"; extraConfig = '' - set -g status-style bg=white + set -g status-style bg=default bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R + + set -g default-terminal "tmux-256color" + set -ga terminal-overrides ",alacritty:Tc" ''; }; @@ -35,7 +45,7 @@ highlight = "fg=#bbbbbb"; }; syntaxHighlighting.enable = true; - dotDir = ".config/zsh"; + dotDir = "${config.home.homeDirectory}/.config/zsh"; autocd = true; initContent = '' diff --git a/host/max/user.nix b/host/max/user.nix index ca7dd93..db10d6b 100644 --- a/host/max/user.nix +++ b/host/max/user.nix @@ -6,8 +6,17 @@ users.users.max = { isNormalUser = true; hashedPasswordFile = config.sops.secrets.max-password.path; - extraGroups = [ "wheel" "networkmanager" "video" "wireshark" "kvm" ]; + extraGroups = [ "wheel" "networkmanager" "video" "kvm" "docker" ]; packages = with pkgs; [ tree ]; shell = pkgs.zsh; }; + + virtualisation.docker = { + enable = true; + + rootless = { + enable = true; + setSocketVariable = true; + }; + }; } diff --git a/justfile b/justfile index edb98a4..a5d0930 100644 --- a/justfile +++ b/justfile @@ -13,6 +13,12 @@ rebuild: git add . sudo nixos-rebuild switch --flake '.?submodules=1#max' +rebuild-offline: + just add-secrets + + git add . + sudo nixos-rebuild switch --flake '.?submodules=1#max' --offline + rebuild-ark: just add-secrets