From 782dc4da706b19299b9297033f8c1a0c68843c38 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 5 Jan 2025 01:08:38 -0600 Subject: [PATCH] Thablet things --- flake.lock | 218 +++++++++++++++++++++--------- flake.nix | 14 +- modules/home-manager/hyprland.nix | 2 +- modules/nixos/default.nix | 12 ++ nixos/thablet.nix | 55 ++++++++ 5 files changed, 234 insertions(+), 67 deletions(-) diff --git a/flake.lock b/flake.lock index 2d95732..74483e3 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1731959031, - "narHash": "sha256-TGcvIjftziC1CjuiHCzrYDwmOoSFYIhdiKmLetzB5L0=", + "lastModified": 1734906446, + "narHash": "sha256-6OWluVE2A8xi+8V3jN9KA72RCgJjYdyyuLBUjxZ2q2U=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "4468981c1c50999f315baa1508f0e53c4ee70c52", + "rev": "eecb74dc79bb6752a2a507e6edee3042390a6091", "type": "github" }, "original": { @@ -137,7 +137,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1726560853, @@ -318,7 +318,9 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs-unstable" + ], "rust-overlay": "rust-overlay" }, "locked": { @@ -393,11 +395,11 @@ ] }, "locked": { - "lastModified": 1728669738, - "narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", + "lastModified": 1734906540, + "narHash": "sha256-vQ/L9hZFezC0LquLo4TWXkyniWtYBlFHAKIsDc7PYJE=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "0264e698149fcb857a66a53018157b41f8d97bb0", + "rev": "69270ba8f057d55b0e6c2dca0e165d652856e613", "type": "github" }, "original": { @@ -406,25 +408,78 @@ "type": "github" } }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906236, + "narHash": "sha256-vH/ysV2ONGQgYZPtcJKwc8jJivzyVxru2aaOxC20ZOE=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "6dea3fba08fd704dd624b6d4b261638fb4003c9c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprgrass": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1734643652, + "narHash": "sha256-gnxQWeIitwduGalKZgO21B+7fJAnFRl2nlmPzzKoWno=", + "owner": "horriblename", + "repo": "hyprgrass", + "rev": "b2a1da139bbb4e12d67c9c1569a32ce54f5ebc6b", + "type": "github" + }, + "original": { + "owner": "horriblename", + "repo": "hyprgrass", + "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_2", + "nixpkgs": [ + "nixpkgs-unstable" + ], "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_2", "xdph": "xdph" }, "locked": { - "lastModified": 1733157082, - "narHash": "sha256-rmJkUKyvaejRaQeEOpInjGjQv6rgFkm2uJ2iVlMEuOk=", + "lastModified": 1735084675, + "narHash": "sha256-PhQgwy3B/QYPefsCXpOds4Pa93h8u4agpv96rq3Knqs=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "92186898c0ca1b3f72922b72c4af1723f0d9b888", + "rev": "2a24a61126dcebd2e1f7862e5c21c105900110ac", "type": "github" }, "original": { @@ -458,6 +513,35 @@ "type": "github" } }, + "hyprland-qtutils": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906472, + "narHash": "sha256-pWPRv/GA/X/iAwoE6gMNUqn/ZeJX1IeLPRpZI0tTPK0=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "c77109d7e1ddbcdb87cafd32ce411f76328ae152", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, "hyprlang": { "inputs": { "hyprutils": [ @@ -474,11 +558,11 @@ ] }, "locked": { - "lastModified": 1728168612, - "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", + "lastModified": 1734906259, + "narHash": "sha256-P79t/7HbACO4/PuJBroGpTptvCWJtXTv+gWsF+sM6MI=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", + "rev": "0404833ea18d543df44df935ebf1b497310eb046", "type": "github" }, "original": { @@ -499,11 +583,11 @@ ] }, "locked": { - "lastModified": 1732288281, - "narHash": "sha256-XTU9B53IjGeJiJ7LstOhuxcRjCOFkQFl01H78sT9Lg4=", + "lastModified": 1734796073, + "narHash": "sha256-TnuKsa8OHrSJEmHm3TLGOWbPNA1gRjmZLsRzKrCqOsg=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "b26f33cc1c8a7fd5076e19e2cce3f062dca6351c", + "rev": "c3331116ebd0b71df5ae8c6efe9a7f94148b03bf", "type": "github" }, "original": { @@ -524,11 +608,11 @@ ] }, "locked": { - "lastModified": 1726874836, - "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", + "lastModified": 1734793513, + "narHash": "sha256-rrrHcXapXJvGFqX+L/Bb0182L25jofAZ0fm1FInvrTQ=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", + "rev": "4d7367b6eee87397e2dbca2e78078dd0a4ef4c61", "type": "github" }, "original": { @@ -537,6 +621,27 @@ "type": "github" } }, + "iio-hyprland": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1727632156, + "narHash": "sha256-gfH/jcrmI27OEge8OGPe7JpC0jrQJuX7v9hM/ObjjW8=", + "owner": "JeanSchoeller", + "repo": "iio-hyprland", + "rev": "bd6be6b7e0fbc8ca1a5ccbf536602838e52c347e", + "type": "github" + }, + "original": { + "owner": "JeanSchoeller", + "repo": "iio-hyprland", + "type": "github" + } + }, "jovian": { "inputs": { "nix-github-actions": "nix-github-actions", @@ -616,16 +721,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728018373, - "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", + "lastModified": 1732981179, + "narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", + "rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } @@ -694,38 +799,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1732758367, - "narHash": "sha256-RzaI1RO0UXqLjydtz3GAXSTzHkpb/lLD1JD8a0W4Wpo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fa42b5a5f401aab8a32bd33c9a4de0738180dc59", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1732981179, - "narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_2", @@ -737,11 +810,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1732021966, - "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", + "lastModified": 1734797603, + "narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", + "rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498", "type": "github" }, "original": { @@ -758,10 +831,12 @@ "helix": "helix", "home-manager": "home-manager", "home-manager-unstable": "home-manager-unstable", + "hyprgrass": "hyprgrass", "hyprland": "hyprland", + "iio-hyprland": "iio-hyprland", "jovian": "jovian", "mobile-nixos": "mobile-nixos", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "slippi": "slippi", "sops-nix": "sops-nix", @@ -885,6 +960,21 @@ } }, "systems_3": { + "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_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -955,11 +1045,11 @@ ] }, "locked": { - "lastModified": 1731703417, - "narHash": "sha256-rheDc/7C+yI+QspYr9J2z9kQ5P9F4ATapI7qyFAe1XA=", + "lastModified": 1734907020, + "narHash": "sha256-p6HxwpRKVl1KIiY5xrJdjcEeK3pbmc///UOyV6QER+w=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "8070f36deec723de71e7557441acb17e478204d3", + "rev": "d7f18dda5e511749fa1511185db3536208fb1a63", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 38858cc..2167e91 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + hardware.url = "github:nixos/nixos-hardware"; disko.url = "github:nix-community/disko/master"; disko.inputs.nixpkgs.follows = "nixpkgs"; @@ -20,8 +21,16 @@ home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable"; helix.url = "github:helix-editor/helix/master"; - hardware.url = "github:nixos/nixos-hardware"; + helix.inputs.nixpkgs.follows = "nixpkgs-unstable"; + hyprland.url = "github:hyprwm/Hyprland"; + hyprland.inputs.nixpkgs.follows = "nixpkgs-unstable"; + + hyprgrass.url = "github:horriblename/hyprgrass"; + hyprgrass.inputs.hyprland.follows = "hyprland"; + + iio-hyprland.url = "github:JeanSchoeller/iio-hyprland"; + iio-hyprland.inputs.nixpkgs.follows = "nixpkgs"; wezterm.url = "github:wez/wezterm?dir=nix"; wezterm.inputs.nixpkgs.follows = "nixpkgs-unstable"; @@ -524,9 +533,10 @@ common password-manager graphical-workstation - plasma6 + # plasma6 music-production laptop + touchscreen gaming ./nixos/thablet.nix diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index c82a3d0..9fb0789 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -272,7 +272,7 @@ in { general = { grace = 0; - no_face_out = true; + no_fade_out = true; }; input-field = [ diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 67ed909..2f2f7b8 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -422,6 +422,10 @@ wifi ]; + environment.systemPackages = with pkgs; [ + acpi + ]; + services.udev.extraRules = '' ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" @@ -452,6 +456,14 @@ }; }; + touchscreen = {pkgs, ...}: { + environment.systemPackages = with pkgs; [ + wvkbd # on-screen keyboard + flakeInputs.iio-hyprland.outputs.packages.${system}.default # auto-rotate hyprland displays + flakeInputs.hyprgrass.outputs.packages.${system}.hyprgrass # hyprland touch gestures + ]; + }; + emacs = {pkgs, ...}: { environment.systemPackages = with pkgs; [ emacs diff --git a/nixos/thablet.nix b/nixos/thablet.nix index 56fb004..f72bac9 100644 --- a/nixos/thablet.nix +++ b/nixos/thablet.nix @@ -75,6 +75,61 @@ }; home-manager.users.daniel = { + home = { + pointerCursor = { + size = 40; + }; + }; + + programs.hyprlock.settings = { + label = [ + { + monitor = ""; + font_size = 32; + + halign = "center"; + valign = "center"; + text_align = "center"; + color = "rgba(255, 255, 255, 0.5)"; + + position = "0 -500"; + font_family = "IosevkaLyteTerm"; + text = "cmd[update:30000] acpi"; + + shadow_passes = 3; + shadow_size = 1; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_boost = 1.0; + } + ]; + }; + + services.hypridle = let + secondsPerMinute = 60; + lockSeconds = 10 * secondsPerMinute; + in { + settings = { + listener = [ + { + timeout = lockSeconds + 55; + on-timeout = ''systemctl suspend''; + } + ]; + }; + }; + + wayland.windowManager.hyprland = { + settings = { + exec-once = [ + "eww open bar0" + ]; + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + monitor = [ + "eDP-1,2560x1440@60Hz,0x0,1.25" + ]; + }; + }; + wayland.windowManager.sway = { config = { output = {