From 9f05e45d68e7b5648d32a92da7cdaeded35fba38 Mon Sep 17 00:00:00 2001 From: cnst Date: Tue, 29 Oct 2024 18:33:37 +0100 Subject: [PATCH] hyprland module consolidation and some refactoring --- flake.lock | 724 ++---------------- flake.nix | 100 +-- hosts/cnix/default.nix | 4 +- hosts/cnix/modules.nix | 17 +- hosts/cnixpad/default.nix | 2 + hosts/cnixpad/modules.nix | 1 - hosts/toothpc/default.nix | 2 + hosts/toothpc/modules.nix | 1 - modules/home/programs/hyprland/appearance.nix | 60 ++ modules/home/programs/hyprland/default.nix | 49 +- modules/home/programs/hyprland/inputs.nix | 93 +++ modules/home/programs/hyprland/keybinds.nix | 134 ++++ modules/home/programs/hyprland/rules.nix | 67 ++ modules/home/programs/hyprland/startup.nix | 40 + .../cnst/appearance.nix | 0 .../programs/hyprlandbak/cnst/default.nix | 54 ++ .../programs/hyprlandbak/cnst/imports.nix | 38 + .../{hyprland => hyprlandbak}/cnst/inputs.nix | 0 .../cnst/keybinds.nix | 0 .../{hyprland => hyprlandbak}/cnst/rules.nix | 0 .../cnst/startup.nix | 0 modules/home/programs/hyprlandbak/default.nix | 6 + .../hyprlandbak/toothpick/appearance.nix | 60 ++ .../toothpick}/default.nix | 16 +- .../programs/hyprlandbak/toothpick/inputs.nix | 81 ++ .../hyprlandbak/toothpick/keybinds.nix | 115 +++ .../programs/hyprlandbak/toothpick/rules.nix | 59 ++ .../hyprlandbak/toothpick/startup.nix | 29 + modules/home/programs/hyprlock/default.nix | 8 +- modules/home/programs/misc/default.nix | 9 +- modules/home/services/gtk/default.nix | 2 +- modules/home/services/hypridle/default.nix | 8 +- modules/home/services/hyprpaper/default.nix | 8 +- modules/nixos/boot/kernel/default.nix | 5 +- .../nixos/hardware/graphics/amd/default.nix | 67 +- modules/nixos/hardware/network/default.nix | 6 - modules/nixos/programs/hyprland/default.nix | 10 +- modules/nixos/programs/lutris/default.nix | 2 - modules/nixos/programs/misc/default.nix | 1 + modules/nixos/services/greetd/default.nix | 8 +- modules/nixos/services/xserver/default.nix | 1 + modules/nixos/system/devpkgs/default.nix | 2 +- modules/nixos/system/xdg/default.nix | 2 +- users/cnst/default.nix | 10 +- users/cnst/modules.nix | 13 +- users/toothpick/modules.nix | 7 +- 46 files changed, 1115 insertions(+), 806 deletions(-) create mode 100644 modules/home/programs/hyprland/appearance.nix create mode 100644 modules/home/programs/hyprland/inputs.nix create mode 100644 modules/home/programs/hyprland/keybinds.nix create mode 100644 modules/home/programs/hyprland/rules.nix create mode 100644 modules/home/programs/hyprland/startup.nix rename modules/home/programs/{hyprland => hyprlandbak}/cnst/appearance.nix (100%) create mode 100644 modules/home/programs/hyprlandbak/cnst/default.nix create mode 100644 modules/home/programs/hyprlandbak/cnst/imports.nix rename modules/home/programs/{hyprland => hyprlandbak}/cnst/inputs.nix (100%) rename modules/home/programs/{hyprland => hyprlandbak}/cnst/keybinds.nix (100%) rename modules/home/programs/{hyprland => hyprlandbak}/cnst/rules.nix (100%) rename modules/home/programs/{hyprland => hyprlandbak}/cnst/startup.nix (100%) create mode 100644 modules/home/programs/hyprlandbak/default.nix create mode 100644 modules/home/programs/hyprlandbak/toothpick/appearance.nix rename modules/home/programs/{hyprland/cnst => hyprlandbak/toothpick}/default.nix (62%) create mode 100644 modules/home/programs/hyprlandbak/toothpick/inputs.nix create mode 100644 modules/home/programs/hyprlandbak/toothpick/keybinds.nix create mode 100644 modules/home/programs/hyprlandbak/toothpick/rules.nix create mode 100644 modules/home/programs/hyprlandbak/toothpick/startup.nix diff --git a/flake.lock b/flake.lock index ea4de9f0..d3955c4d 100644 --- a/flake.lock +++ b/flake.lock @@ -41,39 +41,6 @@ "type": "github" } }, - "aquamarine": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1729527199, - "narHash": "sha256-D5/YksfRga8Akd04ZtIkuYSIOjXVrAzQIQBSeplokzU=", - "owner": "hyprwm", - "repo": "aquamarine", - "rev": "8d732fa8aff8b12ef2b1e2f00fc8153e41312b72", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "aquamarine", - "type": "github" - } - }, "chaotic": { "inputs": { "flake-schemas": "flake-schemas", @@ -111,11 +78,11 @@ }, "crane_2": { "locked": { - "lastModified": 1728776144, - "narHash": "sha256-fROVjMcKRoGHofDm8dY3uDUtCMwUICh/KjBFQnuBzfg=", + "lastModified": 1730060262, + "narHash": "sha256-RMgSVkZ9H03sxC+Vh4jxtLTCzSjPq18UWpiM0gq6shQ=", "owner": "ipetkov", "repo": "crane", - "rev": "f876e3d905b922502f031aeec1a84490122254b7", + "rev": "498d9f122c413ee1154e8131ace5a35a80d8fa76", "type": "github" }, "original": { @@ -154,11 +121,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1730010749, - "narHash": "sha256-UBckyKItSD0z50+3YQOqfOuyvUI7UjPHiLbOPFUolqo=", + "lastModified": 1730183653, + "narHash": "sha256-dcJGcoDgNBxTagW8kECwBKsRBA1ZITtQ+p3N6KHg5ps=", "owner": "nix-community", "repo": "fenix", - "rev": "5fa09829e74070c1e83b2aaa50b71bbc6da3f37c", + "rev": "dc19afc39af5f5e69fca78ebae59170e61017df8", "type": "github" }, "original": { @@ -198,22 +165,6 @@ "type": "github" } }, - "flake-compat_3": { - "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-parts": { "inputs": { "nixpkgs-lib": [ @@ -297,6 +248,24 @@ "type": "github" } }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-schemas": { "locked": { "lastModified": 1721999734, @@ -350,28 +319,6 @@ } }, "gitignore": { - "inputs": { - "nixpkgs": [ - "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": [ "lanzaboote", @@ -395,11 +342,11 @@ }, "hardware": { "locked": { - "lastModified": 1729742320, - "narHash": "sha256-u3Of8xRkN//me8PU+RucKA59/6RNy4B2jcGAF36P4jI=", + "lastModified": 1730161780, + "narHash": "sha256-z5ILcmwMtiCoHTXS1KsQWqigO7HJO8sbyK7f7wn9F/E=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "e8a2f6d5513fe7b7d15701b2d05404ffdc3b6dda", + "rev": "07d15e8990d5d86a631641b4c429bc0a7400cfb8", "type": "github" }, "original": { @@ -429,31 +376,6 @@ "type": "github" } }, - "hercules-ci-effects": { - "inputs": { - "flake-parts": [ - "nixpak", - "flake-parts" - ], - "nixpkgs": [ - "nixpak", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1724947644, - "narHash": "sha256-MHHrHasTngp7EYQOObHJ1a/IsRF+wodHqOckhH6uZbk=", - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "rev": "dba4367b9a9d9615456c430a6d6af716f6e84cef", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "type": "github" - } - }, "hm": { "inputs": { "nixpkgs": [ @@ -516,341 +438,6 @@ "type": "github" } }, - "hyprcursor": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1728669738, - "narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", - "owner": "hyprwm", - "repo": "hyprcursor", - "rev": "0264e698149fcb857a66a53018157b41f8d97bb0", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprcursor", - "type": "github" - } - }, - "hypridle": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1729679960, - "narHash": "sha256-RoFKwZsx4RHKUwO8LhEZtmI08VBVrWt3TdzoJgx1HJ0=", - "owner": "hyprwm", - "repo": "hypridle", - "rev": "4d2fb9e73eb6b75336ed3eb198e900f94ada24f4", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hypridle", - "type": "github" - } - }, - "hyprland": { - "inputs": { - "aquamarine": "aquamarine", - "hyprcursor": "hyprcursor", - "hyprland-protocols": "hyprland-protocols", - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_5", - "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems_4", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1729989895, - "narHash": "sha256-IFctdjt+v7zRDe24Y8+BdVDaKy0pmn60FWDzpYg4CT0=", - "owner": "hyprwm", - "repo": "hyprland", - "rev": "a3d3b4fd64a51a8c1663b450bd2a408f1f0fa9b3", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland", - "type": "github" - } - }, - "hyprland-contrib": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729224425, - "narHash": "sha256-w9dNUedNe2qnhHuhcRf7A1l29+/6DxdMfwN6g4U3c/w=", - "owner": "hyprwm", - "repo": "contrib", - "rev": "d72bc8b1cd30d448bd438e8328f8eeb4c0f2ddb6", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "contrib", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1728345020, - "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "a7c183800e74f337753de186522b9017a07a8cee", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1728168612, - "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlock": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1729967244, - "narHash": "sha256-AfgcduDOjfBCpe4vzjhiuIiRRhmi03sLaN0fX+JrZ3E=", - "owner": "hyprwm", - "repo": "hyprlock", - "rev": "29dd33d6a46242ec49f0145946fd7e05d6970e0d", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlock", - "type": "github" - } - }, - "hyprpaper": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1729890887, - "narHash": "sha256-Vg98Dm6MaglEUNNTRgLF2Lxy02FrU5ntnlwsMkBSTKg=", - "owner": "hyprwm", - "repo": "hyprpaper", - "rev": "3f8cc92109209364e9d39789b3631e9ac109987a", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprpaper", - "type": "github" - } - }, - "hyprsysteminfo": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1729184813, - "narHash": "sha256-ARrsIQPFCHWjVl9Sxh8tedIoEsvnV4nORaDmYCyK+kk=", - "owner": "hyprwm", - "repo": "hyprsysteminfo", - "rev": "8b271e2ba39a5a9299e4e7bb60245a71704f5a89", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprsysteminfo", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1728941256, - "narHash": "sha256-WRypmcZ2Bw94lLmcmxYokVOHPJSZ7T06V49QZ4tkZeQ=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "fd4be8b9ca932f7384e454bcd923c5451ef2aa85", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprwayland-scanner": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1726874836, - "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, - "hyprwayland-scanner_2": { - "inputs": { - "nixpkgs": [ - "hyprpaper", - "nixpkgs" - ], - "systems": [ - "hyprpaper", - "systems" - ] - }, - "locked": { - "lastModified": 1721324119, - "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, "jovian": { "inputs": { "nix-github-actions": "nix-github-actions", @@ -876,18 +463,18 @@ "lanzaboote": { "inputs": { "crane": "crane_2", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_3", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_5", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1729064530, - "narHash": "sha256-oSr/w/5dvf/8ll6NvQlL7+rrK8wzjIcEMP1LvI4Ag08=", + "lastModified": 1730107060, + "narHash": "sha256-EnVVq1oNcimZmQYl6UlLYs0jhC6aLah0bsFMy2syEak=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "2fa1368f938b50e35ca87334b5aeba38a3402165", + "rev": "0ad4ce46649b390da8bebcc229917f9863c98fe2", "type": "github" }, "original": { @@ -898,7 +485,7 @@ }, "microfetch": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1723918449, @@ -925,11 +512,11 @@ "umu": "umu" }, "locked": { - "lastModified": 1729993301, - "narHash": "sha256-1SJ5Ky+HSMXAf+uij34MIB2jii0RZwFmOaJg1/e9Rzg=", + "lastModified": 1730186798, + "narHash": "sha256-rGrhFuH3d869rG1cmfuuuPksKyCJUfkBTenQbtnlsr8=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "655bf9e689c9f7b15ba6521b849321120c0af616", + "rev": "8756862665662edad5bbb098d0cba727cde57fec", "type": "github" }, "original": { @@ -961,30 +548,6 @@ "type": "github" } }, - "nixpak": { - "inputs": { - "flake-parts": [ - "flake-parts" - ], - "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": [ - "nixpkgs-small" - ] - }, - "locked": { - "lastModified": 1729736570, - "narHash": "sha256-myif5yBLFTH8D6PGWNTz1G+nm/3Vpk6ccbLtG70W5Rc=", - "owner": "nixpak", - "repo": "nixpak", - "rev": "46c141cc392805a0df2838d2a54860017c4cdb31", - "type": "github" - }, - "original": { - "owner": "nixpak", - "repo": "nixpak", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1703013332, @@ -1001,20 +564,16 @@ "type": "github" } }, - "nixpkgs-small": { + "nixpkgs-lib": { "locked": { - "lastModified": 1730025694, - "narHash": "sha256-Isj+5RY86+N+JrotqpaXqi6hUAABcF6pIOlIWy2leC8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "23664a7358c599dd4f975f16cea0865bf423e83d", - "type": "github" + "lastModified": 1727825735, + "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" } }, "nixpkgs-stable": { @@ -1033,22 +592,6 @@ "type": "github" } }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1728492678, @@ -1099,27 +642,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1729413321, - "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=", + "lastModified": 1730025694, + "narHash": "sha256-Isj+5RY86+N+JrotqpaXqi6hUAABcF6pIOlIWy2leC8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1728897630, - "narHash": "sha256-0utJPs4o2Mody8GDwo4hnGuxc8dJqju4u9lLJY4d/Lw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c9f0b4a395289ce18727e2a8e43cae6796693ccc", + "rev": "23664a7358c599dd4f975f16cea0865bf423e83d", "type": "github" }, "original": { @@ -1129,7 +656,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1722719969, "narHash": "sha256-E47qbT/mRtBCSZra+9S9208sp/QnNeOAq7EhHX+eMNE=", @@ -1144,23 +671,23 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1729880355, "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "18536bf04cd71abd345f9579158841376fdd0c5a", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1726755586, "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", @@ -1176,12 +703,15 @@ "type": "github" } }, - "pre-commit-hooks": { + "pre-commit-hooks-nix": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": [ + "lanzaboote", + "flake-compat" + ], "gitignore": "gitignore", "nixpkgs": [ - "hyprland", + "lanzaboote", "nixpkgs" ], "nixpkgs-stable": "nixpkgs-stable" @@ -1190,35 +720,8 @@ "lastModified": 1729104314, "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks-nix": { - "inputs": { - "flake-compat": [ - "lanzaboote", - "flake-compat" - ], - "gitignore": "gitignore_2", - "nixpkgs": [ - "lanzaboote", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_2" - }, - "locked": { - "lastModified": 1728778939, - "narHash": "sha256-WybK5E3hpGxtCYtBwpRj1E9JoiVxe+8kX83snTNaFHE=", - "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ff68f91754be6f3427e4986d7949e6273659be1d", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", "type": "github" }, "original": { @@ -1239,19 +742,11 @@ "hardware": "hardware", "helix-flake": "helix-flake", "hm": "hm", - "hypridle": "hypridle", - "hyprland": "hyprland", - "hyprland-contrib": "hyprland-contrib", - "hyprlock": "hyprlock", - "hyprpaper": "hyprpaper", - "hyprsysteminfo": "hyprsysteminfo", "lanzaboote": "lanzaboote", "microfetch": "microfetch", "nix-gaming": "nix-gaming", - "nixpak": "nixpak", - "nixpkgs": "nixpkgs_8", - "nixpkgs-small": "nixpkgs-small", - "systems": "systems_5", + "nixpkgs": "nixpkgs_7", + "systems": "systems_4", "tuirun": "tuirun", "zen-browser": "zen-browser" } @@ -1259,11 +754,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1729923686, - "narHash": "sha256-Tc+5E/UmjpXlYGQQ6X2nGDv6J6VQgZ+pVOJLcNCIVQc=", + "lastModified": 1730123801, + "narHash": "sha256-11FMcPraLSKuvfFF4OzmKWSKE5zXAzFqZOi3k/8/HFg=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "26d2fbaef2d68a2fccf55d725915188c2634439a", + "rev": "cf8f950baab30f335917b177536d2d73e0aaa1ae", "type": "github" }, "original": { @@ -1302,11 +797,11 @@ ] }, "locked": { - "lastModified": 1728959392, - "narHash": "sha256-fp4he1QQjE+vasDMspZYeXrwTm9otwEqLwEN6FKZ5v0=", + "lastModified": 1729996302, + "narHash": "sha256-QEU1NQq1+7s1na69Chig9K0iDDTKN0O4Zreo9A9rccA=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "4c6e317300f05b8871f585b826b6f583e7dc4a9b", + "rev": "a1b337569f334ff0a01b57627f17b201d746d24c", "type": "github" }, "original": { @@ -1390,26 +885,11 @@ "type": "github" } }, - "systems_6": { - "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" - } - }, "tuirun": { "inputs": { "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_9", - "systems": "systems_6" + "nixpkgs": "nixpkgs_8", + "systems": "systems_5" }, "locked": { "lastModified": 1727200565, @@ -1434,11 +914,11 @@ }, "locked": { "dir": "packaging/nix", - "lastModified": 1729978972, - "narHash": "sha256-Zox0iAi4CRPn4rxrhOetFFZ2jcSipe8tGD8nMTgcjhE=", + "lastModified": 1730165291, + "narHash": "sha256-XPsXlLuvvaRs7y6tiJR+GQmqHVuLazqN0PCUPdF8xwE=", "ref": "refs/heads/main", - "rev": "72499f349ca81cb2838eced9d7c465b2cf71c4a2", - "revCount": 825, + "rev": "2d91dc5e98a147784eeb72f451b8cd28042ee241", + "revCount": 827, "submodules": true, "type": "git", "url": "https://github.com/Open-Wine-Components/umu-launcher/" @@ -1450,65 +930,25 @@ "url": "https://github.com/Open-Wine-Components/umu-launcher/" } }, - "xdph": { - "inputs": { - "hyprland-protocols": [ - "hyprland", - "hyprland-protocols" - ], - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1728166987, - "narHash": "sha256-w6dVTguAn9zJ+7aPOhBQgDz8bn6YZ7b56cY8Kg5HJRI=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "fb9c8d665af0588bb087f97d0f673ddf0d501787", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" - } - }, "zen-browser": { "inputs": { + "flake-parts": "flake-parts_5", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1730051017, - "narHash": "sha256-7n+4NlrURzLlOhzbYKyXRYjdxBPhVkvuJeAdy8DRuYU=", - "owner": "cnsta", - "repo": "zen-browser-flake", - "rev": "f51f96f708c8709c96c17994298b5249d70e3780", - "type": "github" + "lastModified": 1730204238, + "narHash": "sha256-DdF10j6dHUe+WGvf/uuCUwZSpoq5Hoo2+yBBY+ZXhsI=", + "ref": "refs/heads/main", + "rev": "daf7b3635cbc0401b20ae4a4f9af3e180dcf7097", + "revCount": 48, + "type": "git", + "url": "https://git.sr.ht/~canasta/zen-browser-flake" }, "original": { - "owner": "cnsta", - "repo": "zen-browser-flake", - "type": "github" + "type": "git", + "url": "https://git.sr.ht/~canasta/zen-browser-flake" } } }, diff --git a/flake.nix b/flake.nix index e8f9f2db..0fbadd74 100644 --- a/flake.nix +++ b/flake.nix @@ -19,24 +19,24 @@ inputs = { # Nix environment - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-small.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; systems.url = "github:nix-systems/default-linux"; hardware.url = "github:nixos/nixos-hardware"; lanzaboote.url = "github:nix-community/lanzaboote"; - nixpak = { - url = "github:nixpak/nixpak"; - inputs = { - nixpkgs.follows = "nixpkgs-small"; - flake-parts.follows = "flake-parts"; - }; - }; + # nixpak = { + # url = "github:nixpak/nixpak"; + # inputs = { + # nixpkgs.follows = "nixpkgs"; + # flake-parts.follows = "flake-parts"; + # }; + # }; flake-utils = { url = "github:numtide/flake-utils"; inputs.systems.follows = "systems"; }; + flake-compat.url = "github:edolstra/flake-compat"; hm = { @@ -50,51 +50,51 @@ }; # Hyprland environment - hyprland.url = "github:hyprwm/hyprland"; + # hyprland.url = "github:hyprwm/hyprland"; - hyprland-contrib = { - url = "github:hyprwm/contrib"; - inputs.nixpkgs.follows = "hyprland/nixpkgs"; - }; + # hyprland-contrib = { + # url = "github:hyprwm/contrib"; + # inputs.nixpkgs.follows = "hyprland/nixpkgs"; + # }; - hyprlock = { - url = "github:hyprwm/hyprlock"; - inputs = { - hyprlang.follows = "hyprland/hyprlang"; - hyprutils.follows = "hyprland/hyprutils"; - nixpkgs.follows = "hyprland/nixpkgs"; - systems.follows = "hyprland/systems"; - }; - }; + # hyprlock = { + # url = "github:hyprwm/hyprlock"; + # inputs = { + # hyprlang.follows = "hyprland/hyprlang"; + # hyprutils.follows = "hyprland/hyprutils"; + # nixpkgs.follows = "hyprland/nixpkgs"; + # systems.follows = "hyprland/systems"; + # }; + # }; - hypridle = { - url = "github:hyprwm/hypridle"; - inputs = { - hyprlang.follows = "hyprland/hyprlang"; - hyprutils.follows = "hyprland/hyprutils"; - nixpkgs.follows = "hyprland/nixpkgs"; - systems.follows = "hyprland/systems"; - }; - }; + # hypridle = { + # url = "github:hyprwm/hypridle"; + # inputs = { + # hyprlang.follows = "hyprland/hyprlang"; + # hyprutils.follows = "hyprland/hyprutils"; + # nixpkgs.follows = "hyprland/nixpkgs"; + # systems.follows = "hyprland/systems"; + # }; + # }; - hyprpaper = { - url = "github:hyprwm/hyprpaper"; - inputs = { - hyprlang.follows = "hyprland/hyprlang"; - hyprutils.follows = "hyprland/hyprutils"; - nixpkgs.follows = "hyprland/nixpkgs"; - systems.follows = "hyprland/systems"; - }; - }; + # hyprpaper = { + # url = "github:hyprwm/hyprpaper"; + # inputs = { + # hyprlang.follows = "hyprland/hyprlang"; + # hyprutils.follows = "hyprland/hyprutils"; + # nixpkgs.follows = "hyprland/nixpkgs"; + # systems.follows = "hyprland/systems"; + # }; + # }; - hyprsysteminfo = { - url = "github:hyprwm/hyprsysteminfo"; - inputs = { - hyprutils.follows = "hyprland/hyprutils"; - nixpkgs.follows = "hyprland/nixpkgs"; - systems.follows = "hyprland/systems"; - }; - }; + # hyprsysteminfo = { + # url = "github:hyprwm/hyprsysteminfo"; + # inputs = { + # hyprutils.follows = "hyprland/hyprutils"; + # nixpkgs.follows = "hyprland/nixpkgs"; + # systems.follows = "hyprland/systems"; + # }; + # }; # Chaotic chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz"; @@ -121,7 +121,7 @@ }; zen-browser = { - url = "github:cnsta/zen-browser-flake"; + url = "git+https://git.sr.ht/~canasta/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/hosts/cnix/default.nix b/hosts/cnix/default.nix index 26872ad3..bc14251b 100644 --- a/hosts/cnix/default.nix +++ b/hosts/cnix/default.nix @@ -35,8 +35,10 @@ in { ./modules.nix ]; + networking.hostName = "cnix"; + environment.variables.FLAKE = "/home/cnst/.nix-config"; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + # # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = lib.mkDefault "23.11"; } diff --git a/hosts/cnix/modules.nix b/hosts/cnix/modules.nix index d1cd97cb..5c3c9648 100644 --- a/hosts/cnix/modules.nix +++ b/hosts/cnix/modules.nix @@ -34,7 +34,6 @@ }; network = { enable = true; - hostName = "cnix"; interfaces = { "enp7s0" = { allowedTCPPorts = [22 80 443]; @@ -57,9 +56,9 @@ enable = false; }; blender = { - enable = true; + enable = false; hip = { - enable = true; + enable = false; }; }; brightnessctl = { @@ -78,7 +77,7 @@ enable = true; }; gimp = { - enable = true; + enable = false; }; gnome = { enable = false; @@ -87,7 +86,7 @@ enable = true; }; inkscape = { - enable = true; + enable = false; }; lutris = { enable = true; @@ -112,7 +111,7 @@ }; }; npm = { - enable = true; + enable = false; }; obsidian = { enable = true; @@ -150,11 +149,11 @@ enable = false; }; greetd = { + enable = true; + user = "cnst"; autologin = { enable = false; - user = "cnst"; }; - enable = true; gnomeKeyring = { enable = false; }; @@ -204,8 +203,8 @@ enable = true; }; locale = { - defaultLocale = "en_US.UTF-8"; enable = true; + defaultLocale = "en_US.UTF-8"; extraLocale = "sv_SE.UTF-8"; timeZone = "Europe/Stockholm"; }; diff --git a/hosts/cnixpad/default.nix b/hosts/cnixpad/default.nix index 1f042667..965e1994 100644 --- a/hosts/cnixpad/default.nix +++ b/hosts/cnixpad/default.nix @@ -35,6 +35,8 @@ in { ./modules.nix ]; + networking.hostName = "cnixpad"; + swapDevices = [ { device = "/var/lib/swapfile"; diff --git a/hosts/cnixpad/modules.nix b/hosts/cnixpad/modules.nix index f7b14cff..590d39f3 100644 --- a/hosts/cnixpad/modules.nix +++ b/hosts/cnixpad/modules.nix @@ -34,7 +34,6 @@ }; network = { enable = true; - hostName = "cnixpad"; interfaces = { "wlp6s0" = { allowedTCPPorts = [22 80 443]; diff --git a/hosts/toothpc/default.nix b/hosts/toothpc/default.nix index 02bec33b..c8fc4782 100644 --- a/hosts/toothpc/default.nix +++ b/hosts/toothpc/default.nix @@ -35,6 +35,8 @@ in { ./modules.nix ]; + networking.hostName = "toothpc"; + environment.variables.FLAKE = "/home/toothpick/.nix-config"; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion diff --git a/hosts/toothpc/modules.nix b/hosts/toothpc/modules.nix index 73e1dce3..115aa13e 100644 --- a/hosts/toothpc/modules.nix +++ b/hosts/toothpc/modules.nix @@ -34,7 +34,6 @@ }; network = { enable = true; - hostName = "toothpc"; interfaces = { "enp4s0" = { allowedTCPPorts = [22 80 443]; diff --git a/modules/home/programs/hyprland/appearance.nix b/modules/home/programs/hyprland/appearance.nix new file mode 100644 index 00000000..74e77556 --- /dev/null +++ b/modules/home/programs/hyprland/appearance.nix @@ -0,0 +1,60 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.appearance; +in { + options = { + home.programs.hyprland.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + general = { + gaps_in = 2; + gaps_out = 4; + border_size = 3; + #col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + #col.inactive_border = rgba(595959aa) + "col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg + "col.inactive_border" = "rgb(504945)"; + layout = "dwindle"; + allow_tearing = false; + resize_on_border = true; + }; + decoration = { + rounding = 0; + blur = { + enabled = true; + size = 8; + passes = 1; + vibrancy = 0.1696; + }; + drop_shadow = false; + shadow_range = 4; + shadow_render_power = 3; + # col.shadow = rgba(1a1a1aee) + }; + animations = { + enabled = true; + bezier = [ + "myBezier,0.05, 0.9, 0.1, 1.05" + ]; + animation = [ + "windows, 1, 3, myBezier" + "windowsOut, 1, 3, default, popin 80%" + "border, 1, 3, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 3, default" + ]; + }; + dwindle = { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true; # you probably want this + }; + }; + }; +} diff --git a/modules/home/programs/hyprland/default.nix b/modules/home/programs/hyprland/default.nix index e456108d..3cd0a2fa 100644 --- a/modules/home/programs/hyprland/default.nix +++ b/modules/home/programs/hyprland/default.nix @@ -1,6 +1,49 @@ -{umodPath, ...}: { +{ + config, + lib, + pkgs, + umodPath, + osConfig, + ... +}: let + inherit (lib) mkIf mkEnableOption mkOption types mkDefault; + cfg = config.home.programs.hyprland; + hyprlandPkg = pkgs.hyprland; + isCnst = osConfig.networking.hostName == "cnix"; +in { imports = [ - "${umodPath}/programs/hyprland/cnst" - "${umodPath}/programs/hyprland/toothpick" + ./appearance.nix + ./inputs.nix + ./keybinds.nix + ./rules.nix + ./startup.nix ]; + + options = { + home.programs.hyprland = { + enable = mkEnableOption "Enable Hyprland"; + }; + }; + + config = mkIf cfg.enable { + home.programs.hyprland = { + appearance.enable = mkDefault true; + inputs.enable = mkDefault true; + keybinds.enable = mkDefault true; + rules.enable = mkDefault true; + startup.enable = mkDefault true; + }; + + wayland.windowManager.hyprland = { + enable = true; + package = hyprlandPkg; + systemd = { + variables = ["--all"]; + extraCommands = [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; + }; + }; + }; } diff --git a/modules/home/programs/hyprland/inputs.nix b/modules/home/programs/hyprland/inputs.nix new file mode 100644 index 00000000..b01fc5ea --- /dev/null +++ b/modules/home/programs/hyprland/inputs.nix @@ -0,0 +1,93 @@ +{ + lib, + config, + osConfig, + ... +}: let + inherit (lib) mkIf mkEnableOption; + toothpc = osConfig.networking.hostName == "toothpc"; + kbOption = + if osConfig.networking.hostName == "cnixpad" + then "ctrl:swapcaps" + else ""; + cfg = config.home.programs.hyprland.inputs; + + renderSettings = + if toothpc + then { + explicit_sync = 0; + explicit_sync_kms = 0; + direct_scanout = false; + } + else { + explicit_sync = 2; + explicit_sync_kms = 2; + direct_scanout = false; + }; +in { + options = { + home.programs.hyprland.inputs.enable = mkEnableOption "Enables input settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + monitor = map ( + m: "${m.name},${ + if m.enabled + then "${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},1${ + if m.bitDepth != null + then ",bitdepth,${toString m.bitDepth}" + else "" + }" + else "disable" + }" + ) (config.monitors); + + workspace = map ( + m: "name:${m.workspace},monitor:${m.name}" + ) (lib.filter (m: m.enabled && m.workspace != null) config.monitors); + + env = [ + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + ]; + + input = { + kb_layout = "se"; + kb_variant = "nodeadkeys"; + kb_options = kbOption; + follow_mouse = 1; + accel_profile = "flat"; + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + + touchpad = { + natural_scroll = true; + disable_while_typing = true; + clickfinger_behavior = true; + scroll_factor = 0.5; + }; + }; + gestures = { + workspace_swipe = true; + workspace_swipe_distance = 400; + workspace_swipe_fingers = 3; + workspace_swipe_cancel_ratio = 0.2; + workspace_swipe_min_speed_to_force = 5; + workspace_swipe_direction_lock = true; + workspace_swipe_direction_lock_threshold = 10; + workspace_swipe_create_new = true; + }; + misc = { + vrr = 0; + mouse_move_enables_dpms = 1; + key_press_enables_dpms = 0; + force_default_wallpaper = 0; + disable_hyprland_logo = true; + disable_splash_rendering = true; + disable_autoreload = true; + }; + xwayland = { + force_zero_scaling = false; + }; + render = renderSettings; + }; + }; +} diff --git a/modules/home/programs/hyprland/keybinds.nix b/modules/home/programs/hyprland/keybinds.nix new file mode 100644 index 00000000..cbf151ba --- /dev/null +++ b/modules/home/programs/hyprland/keybinds.nix @@ -0,0 +1,134 @@ +{ + lib, + config, + pkgs, + osConfig, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.keybinds; +in { + options = { + home.programs.hyprland.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = let + cnixpad = osConfig.networking.hostName == "cnixpad"; + toothpc = osConfig.networking.hostName == "toothpc"; + modKey = + if (cnixpad || toothpc) + then "ALT_L" + else "SUPER"; + term = + if (cnixpad || toothpc) + then "foot" + else "alacritty"; + browser = + if toothpc + then "firefox" + else "zen"; + in { + "$terminal" = term; + "$fileManager" = "thunar"; + "$passwordManager" = "keepassxc"; + "$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --"; + "$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --"; + "$browser" = browser; + "$browserinc" = "${browser} --private-window"; + "$yazi" = "alacritty -e yazi"; + "$tuirun" = "tuirun-toggle.sh"; + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + "$mod" = modKey; + + bind = let + grimblast = lib.getExe pkgs.grimblast; + tesseract = lib.getExe pkgs.tesseract; + notify-send = lib.getExe' pkgs.libnotify "notify-send"; + in [ + # Custom binds + "$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + "$mod, A, exec, pkill -SIGUSR1 waybar" + "$mod, T, exec, $terminal" + "$mod, W, exec, $browser" + "$mod, K, exec, $passwordManager" + "$mod SHIFT, W, exec, $browserinc" + "$mod, Q, killactive," + #bind = $mod, M, exec, hyprctl dispatch exit + #bind = $mod, E, exec, $fileManager + "$mod, E, exec, $fileManager" + "$mod, R, exec, $tuirun" + "$mod SHIFT, E, exec, $yazi" + "$mod, F, fullscreen," + "$mod SHIFT, F, togglefloating," + "$mod, SPACE, exec, $tuirun" + "$mod, P, pseudo," # dwindle + "$mod, J, togglesplit," # dwindle + "$mod, C, exec, hyprctl dispatch exec copyq toggle" + # "$mod, TAB, exec, $menuw" + + # Move focus with mainMod + arrow keys + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # Switch workspaces with mainMod + [0-9] + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" + + # Laptop controls + ",XF86AudioLowerVolume, exec, pamixer -d 5" + ",XF86AudioRaiseVolume, exec, pamixer -i 5" + ",XF86AudioMute, exec, pamixer -t" + ",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle" + ",XF86MonBrightnessDown, exec, brightnessctl s 5%-" + ",XF86MonBrightnessUp, exec, brightnessctl s +5%" + + "$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on" + "$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off" + + # Screenshotting + ",Insert,exec,${grimblast} --notify --freeze copysave area" + "SHIFT,Insert,exec,${grimblast} --notify --freeze copysave output" + # To OCR + "ALT,Insert,exec,${grimblast} --freeze save area - | ${tesseract} - - | wl-copy && ${notify-send} -t 3000 'OCR result copied to buffer'" + + # Example special workspace (scratchpad) + "$mod, S, togglespecialworkspace, magic" + "$mod SHIFT, S, movetoworkspace, special:magic" + + # Scroll through existing workspaces with mainMod + scroll + # bind = $mod, mouse_down, workspace, e+1 + # bind = $mod, mouse_up, workspace, e-1 + ]; + # Move/resize windows with mainMod + LMB/RMB and dragging + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + }; + }; +} diff --git a/modules/home/programs/hyprland/rules.nix b/modules/home/programs/hyprland/rules.nix new file mode 100644 index 00000000..46744b05 --- /dev/null +++ b/modules/home/programs/hyprland/rules.nix @@ -0,0 +1,67 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.rules; +in { + options = { + home.programs.hyprland.rules.enable = mkEnableOption "Enables window rule settings in Hyprland"; + }; + + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + windowrulev2 = [ + # === CALCURSE SETTINGS === + "size 843 650, initialTitle:^(floatcal)$" + "move 100%-w-20 40, initialTitle:^(floatcal)$" + "float, initialTitle:^(floatcal)$" + + # === TUIRUN SETTINGS === + "size 600 300, initialTitle:^(tuirun)$" + "center, initialTitle:^(tuirun)$" + "workspace special:tuirun, initialTitle:^(tuirun)$" + "noborder, initialTitle:^(tuirun)$" + "float, initialTitle:^(tuirun)$" + + # === KEEPASSXC SETTINGS === + "size 843 530, class:^(org.keepassxc.KeePassXC)$" + "move 100%-w-20 40, class:^(org.keepassxc.KeePassXC)$" + "float, class:^(org.keepassxc.KeePassXC)$" + + # === SUPPRESS MAXIMIZE EVENT === + "suppressevent maximize, class:.*" # Suppress maximize events for all windows + + # === NWG-LOOK SETTINGS === + "center, class:^(nwg-look)$" + "float, class:^(nwg-look)$" + + # === PAVUCONTROL SETTINGS === + "move 100%-w-20 40, class:^(pavucontrol)$" + "size 741 585, class:^(pavucontrol)$" + "float, class:^(pavucontrol)$" + + # === XARCHIVER SETTINGS === + "center, class:^(xarchiver)$" + "float, class:^(xarchiver)$" + + # === FLOATING APPLICATIONS === + "float, class:^(org.gnome.FileRoller)$" + "float, class:^(org.freedesktop.impl.portal.desktop.kde)$" + "float, class:^(org.corectrl.CoreCtrl)$" + "float, class:^(feh)$" + "float, class:^(polkit-gnome-authentication-agent-1)$" + "float, class:^(org.gnome.Calculator)$" + "float, class:^(Lxappearance)$" + "float, class:^(imv)$" + "float, class:^(com.github.hluk.copyq)$" + "float, class:^(blueman-manager)$" + "float, class:^(floatranger)$" + "float, class:^(floatnnn)$" + ]; + + windowrule = []; + }; + }; +} diff --git a/modules/home/programs/hyprland/startup.nix b/modules/home/programs/hyprland/startup.nix new file mode 100644 index 00000000..1cbf4b2a --- /dev/null +++ b/modules/home/programs/hyprland/startup.nix @@ -0,0 +1,40 @@ +{ + lib, + config, + osConfig, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.startup; + isCnix = osConfig.networking.hostName == "cnix"; + isCnixpad = osConfig.networking.hostName == "cnixpad"; + isToothpc = osConfig.networking.hostName == "toothpc"; +in { + options = { + home.programs.hyprland.startup.enable = mkEnableOption "Enables startup settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + exec-once = + [ + "systemctl --user start polkit-gnome-authentication-agent-1" + "udiskie -Nt" + "wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'" + "hyprctl dispatch exec 'sleep 5s && keepassxc'" + ] + ++ lib.optionals isCnix [ + "mullvad-vpn" + "blueman-applet" + "pamixer --set-volume 50" + "hyprctl dispatch exec 'sleep 3s && solaar -w hide'" + ] + ++ lib.optionals isCnixpad [ + "blueman-applet" + ] + ++ lib.optionals isToothpc [ + "mullvad-vpn" + "hyprctl dispatch exec 'sleep 3s && solaar -w hide'" + ]; + }; + }; +} diff --git a/modules/home/programs/hyprland/cnst/appearance.nix b/modules/home/programs/hyprlandbak/cnst/appearance.nix similarity index 100% rename from modules/home/programs/hyprland/cnst/appearance.nix rename to modules/home/programs/hyprlandbak/cnst/appearance.nix diff --git a/modules/home/programs/hyprlandbak/cnst/default.nix b/modules/home/programs/hyprlandbak/cnst/default.nix new file mode 100644 index 00000000..ed6b0afb --- /dev/null +++ b/modules/home/programs/hyprlandbak/cnst/default.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + pkgs, + umodPath, + osConfig, + ... +}: let + inherit (lib) mkIf mkEnableOption mkOption types mkDefault; + cfg = config.home.programs.hyprland; + hyprlandPkg = pkgs.hyprland; + isCnst = osConfig.networking.hostName == "cnix"; +in { + imports = ++ lib.optionals isCnst [ + "${umodPath}/programs/hyprland/cnst/appearance.nix" + "${umodPath}/programs/hyprland/cnst/inputs.nix" + "${umodPath}/programs/hyprland/cnst/keybinds.nix" + "${umodPath}/programs/hyprland/cnst/rules.nix" + "${umodPath}/programs/hyprland/cnst/startup.nix" + ]; + + options = { + home.programs.hyprland = { + enable = mkEnableOption "Enable Hyprland"; + user = mkOption { + type = types.str; + description = "The user-specific configuration directory for Hyprland."; + example = "cnst"; + }; + }; + }; + + config = mkIf cfg.enable { + home.programs.hyprland.user = { + appearance.enable = mkDefault true; + inputs.enable = mkDefault true; + keybinds.enable = mkDefault true; + rules.enable = mkDefault true; + startup.enable = mkDefault true; + }; + + wayland.windowManager.hyprland = { + enable = true; + package = hyprlandPkg; + systemd = { + variables = ["--all"]; + extraCommands = [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; + }; + }; + }; +} diff --git a/modules/home/programs/hyprlandbak/cnst/imports.nix b/modules/home/programs/hyprlandbak/cnst/imports.nix new file mode 100644 index 00000000..40d8d40a --- /dev/null +++ b/modules/home/programs/hyprlandbak/cnst/imports.nix @@ -0,0 +1,38 @@ +{ + config, + lib, + pkgs, + umodPath, + user, + ... +}: let + inherit (lib) mkIf mkEnableOption mkOption types mkDefault; + cfg = config.home.programs.hyprland.user; +in { + imports = [ + "${umodPath}/programs/hyprland/cnst/appearance.nix" + "${umodPath}/programs/hyprland/cnst/inputs.nix" + "${umodPath}/programs/hyprland/cnst/keybinds.nix" + "${umodPath}/programs/hyprland/cnst/rules.nix" + "${umodPath}/programs/hyprland/cnst/startup.nix" + ]; + + options.home.programs.hyprland.user = { + enable = mkEnableOption "Enable Hyprland user-specific configuration"; + appearance.enable = mkDefault true; + inputs.enable = mkDefault true; + keybinds.enable = mkDefault true; + rules.enable = mkDefault true; + startup.enable = mkDefault true; + }; + + config = mkIf cfg.enable { + home.programs.hyprland.${user} = { + appearance.enable = cfg.appearance.enable; + inputs.enable = cfg.inputs.enable; + keybinds.enable = cfg.keybinds.enable; + rules.enable = cfg.rules.enable; + startup.enable = cfg.startup.enable; + }; + }; +} diff --git a/modules/home/programs/hyprland/cnst/inputs.nix b/modules/home/programs/hyprlandbak/cnst/inputs.nix similarity index 100% rename from modules/home/programs/hyprland/cnst/inputs.nix rename to modules/home/programs/hyprlandbak/cnst/inputs.nix diff --git a/modules/home/programs/hyprland/cnst/keybinds.nix b/modules/home/programs/hyprlandbak/cnst/keybinds.nix similarity index 100% rename from modules/home/programs/hyprland/cnst/keybinds.nix rename to modules/home/programs/hyprlandbak/cnst/keybinds.nix diff --git a/modules/home/programs/hyprland/cnst/rules.nix b/modules/home/programs/hyprlandbak/cnst/rules.nix similarity index 100% rename from modules/home/programs/hyprland/cnst/rules.nix rename to modules/home/programs/hyprlandbak/cnst/rules.nix diff --git a/modules/home/programs/hyprland/cnst/startup.nix b/modules/home/programs/hyprlandbak/cnst/startup.nix similarity index 100% rename from modules/home/programs/hyprland/cnst/startup.nix rename to modules/home/programs/hyprlandbak/cnst/startup.nix diff --git a/modules/home/programs/hyprlandbak/default.nix b/modules/home/programs/hyprlandbak/default.nix new file mode 100644 index 00000000..e456108d --- /dev/null +++ b/modules/home/programs/hyprlandbak/default.nix @@ -0,0 +1,6 @@ +{umodPath, ...}: { + imports = [ + "${umodPath}/programs/hyprland/cnst" + "${umodPath}/programs/hyprland/toothpick" + ]; +} diff --git a/modules/home/programs/hyprlandbak/toothpick/appearance.nix b/modules/home/programs/hyprlandbak/toothpick/appearance.nix new file mode 100644 index 00000000..f2d0ed85 --- /dev/null +++ b/modules/home/programs/hyprlandbak/toothpick/appearance.nix @@ -0,0 +1,60 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.toothpick.appearance; +in { + options = { + home.programs.hyprland.toothpick.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + general = { + gaps_in = 2; + gaps_out = 4; + border_size = 3; + #col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + #col.inactive_border = rgba(595959aa) + "col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg + "col.inactive_border" = "rgb(504945)"; + layout = "dwindle"; + allow_tearing = false; + resize_on_border = true; + }; + decoration = { + rounding = 0; + blur = { + enabled = true; + size = 8; + passes = 1; + vibrancy = 0.1696; + }; + drop_shadow = false; + shadow_range = 4; + shadow_render_power = 3; + # col.shadow = rgba(1a1a1aee) + }; + animations = { + enabled = true; + bezier = [ + "myBezier,0.05, 0.9, 0.1, 1.05" + ]; + animation = [ + "windows, 1, 3, myBezier" + "windowsOut, 1, 3, default, popin 80%" + "border, 1, 3, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 3, default" + ]; + }; + dwindle = { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true; # you probably want this + }; + }; + }; +} diff --git a/modules/home/programs/hyprland/cnst/default.nix b/modules/home/programs/hyprlandbak/toothpick/default.nix similarity index 62% rename from modules/home/programs/hyprland/cnst/default.nix rename to modules/home/programs/hyprlandbak/toothpick/default.nix index bcac9877..2a52b9b7 100644 --- a/modules/home/programs/hyprland/cnst/default.nix +++ b/modules/home/programs/hyprlandbak/toothpick/default.nix @@ -7,22 +7,22 @@ ... }: let inherit (lib) mkIf mkEnableOption mkDefault; - cfg = config.home.programs.hyprland.cnst; + cfg = config.home.programs.hyprland.toothpick; in { imports = [ - "${umodPath}/programs/hyprland/cnst/appearance.nix" - "${umodPath}/programs/hyprland/cnst/inputs.nix" - "${umodPath}/programs/hyprland/cnst/keybinds.nix" - "${umodPath}/programs/hyprland/cnst/rules.nix" - "${umodPath}/programs/hyprland/cnst/startup.nix" + "${umodPath}/programs/hyprland/toothpick/appearance.nix" + "${umodPath}/programs/hyprland/toothpick/inputs.nix" + "${umodPath}/programs/hyprland/toothpick/keybinds.nix" + "${umodPath}/programs/hyprland/toothpick/rules.nix" + "${umodPath}/programs/hyprland/toothpick/startup.nix" ]; options = { - home.programs.hyprland.cnst.enable = mkEnableOption "Enable Hyprland"; + home.programs.hyprland.toothpick.enable = mkEnableOption "Enable Hyprland"; }; config = mkIf cfg.enable { - home.programs.hyprland.cnst = { + home.programs.hyprland.toothpick = { appearance.enable = mkDefault cfg.enable; inputs.enable = mkDefault cfg.enable; keybinds.enable = mkDefault cfg.enable; diff --git a/modules/home/programs/hyprlandbak/toothpick/inputs.nix b/modules/home/programs/hyprlandbak/toothpick/inputs.nix new file mode 100644 index 00000000..f4564c35 --- /dev/null +++ b/modules/home/programs/hyprlandbak/toothpick/inputs.nix @@ -0,0 +1,81 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.toothpick.inputs; +in { + options = { + home.programs.hyprland.toothpick.inputs.enable = mkEnableOption "Enables input settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + monitor = map ( + m: "${m.name},${ + if m.enabled + then "${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},1${ + if m.bitDepth != null + then ",bitdepth,${toString m.bitDepth}" + else "" + }" + else "disable" + }" + ) (config.monitors); + workspace = map ( + m: "name:${m.workspace},monitor:${m.name}" + ) (lib.filter (m: m.enabled && m.workspace != null) config.monitors); + + env = [ + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + ]; + + input = { + kb_layout = "se"; + kb_variant = "nodeadkeys"; + + follow_mouse = 1; + accel_profile = "flat"; + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + + touchpad = { + natural_scroll = true; + disable_while_typing = true; + clickfinger_behavior = true; + scroll_factor = 0.5; + }; + }; + gestures = { + workspace_swipe = true; + workspace_swipe_distance = 400; + workspace_swipe_fingers = 3; + workspace_swipe_cancel_ratio = 0.2; + workspace_swipe_min_speed_to_force = 5; + workspace_swipe_direction_lock = true; + workspace_swipe_direction_lock_threshold = 10; + workspace_swipe_create_new = true; + }; + misc = { + vrr = 0; + mouse_move_enables_dpms = 1; + key_press_enables_dpms = 0; + force_default_wallpaper = 0; + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + xwayland = { + force_zero_scaling = false; + }; + render = { + explicit_sync = 0; + explicit_sync_kms = 0; + direct_scanout = false; + }; + cursor = { + no_hardware_cursors = true; + # no_break_fs_vrr = true; + # min_refresh_rate = 60; + }; + }; + }; +} diff --git a/modules/home/programs/hyprlandbak/toothpick/keybinds.nix b/modules/home/programs/hyprlandbak/toothpick/keybinds.nix new file mode 100644 index 00000000..744f3927 --- /dev/null +++ b/modules/home/programs/hyprlandbak/toothpick/keybinds.nix @@ -0,0 +1,115 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.toothpick.keybinds; +in { + options = { + home.programs.hyprland.toothpick.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + "$terminal" = "foot"; + "$fileManager" = "thunar"; + "$passwordManager" = "keepassxc"; + "$tuirun" = "tuirun-toggle.sh"; + "$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --"; + "$browser" = "firefox"; + "$browserinc" = "firefox --private-window"; + "$ranger" = "rangerscript"; + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + "$mod" = "ALT_L"; + + bind = let + grimblast = lib.getExe pkgs.grimblast; + tesseract = lib.getExe pkgs.tesseract; + notify-send = lib.getExe' pkgs.libnotify "notify-send"; + in [ + # Custom binds + "$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + "$mod, A, exec, pkill -SIGUSR1 waybar" + "$mod, T, exec, $terminal" + "$mod, W, exec, $browser" + "$mod, K, exec, $passwordManager" + "$mod SHIFT, W, exec, $browserinc" + "$mod, Q, killactive," + #bind = $mod, M, exec, hyprctl dispatch exit + #bind = $mod, E, exec, $fileManager + "$mod, E, exec, $fileManager" + "$mod SHIFT, E, exec, $ranger" + "$mod, F, fullscreen," + "$mod SHIFT, F, togglefloating," + "$mod, SPACE, exec, $tuirun" + "$mod, P, pseudo," # dwindle + "$mod, J, togglesplit," # dwindle + "$mod, C, exec, hyprctl dispatch exec copyq toggle" + + # Move focus with mainMod + arrow keys + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # Switch workspaces with mainMod + [0-9] + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" + + # Laptop controls + ",XF86AudioLowerVolume, exec, pamixer -d 5" + ",XF86AudioRaiseVolume, exec, pamixer -i 5" + ",XF86AudioMute, exec, pamixer -m" + ",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle" + ",XF86MonBrightnessDown, exec, brightnessctl s 10%-" + ",XF86MonBrightnessUp, exec, brightnessctl s +10%" + + "$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on" + "$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off" + + # Screenshotting + ",Print,exec,${grimblast} --notify --freeze copysave area" + "SHIFT,Print,exec,${grimblast} --notify --freeze copysave output" + # To OCR + "ALT,Print,exec,${grimblast} --freeze save area - | ${tesseract} - - | wl-copy && ${notify-send} -t 3000 'OCR result copied to buffer'" + + # Example special workspace (scratchpad) + "$mod, S, togglespecialworkspace, magic" + "$mod SHIFT, S, movetoworkspace, special:magic" + + # Scroll through existing workspaces with mainMod + scroll + # bind = $mod, mouse_down, workspace, e+1 + # bind = $mod, mouse_up, workspace, e-1 + ]; + # Move/resize windows with mainMod + LMB/RMB and dragging + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + }; + }; +} diff --git a/modules/home/programs/hyprlandbak/toothpick/rules.nix b/modules/home/programs/hyprlandbak/toothpick/rules.nix new file mode 100644 index 00000000..b0fbdb2b --- /dev/null +++ b/modules/home/programs/hyprlandbak/toothpick/rules.nix @@ -0,0 +1,59 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.toothpick.rules; +in { + options = { + home.programs.hyprland.toothpick.rules.enable = mkEnableOption "Enables window rule settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + # CALCURSE SETTINGS + windowrulev2 = [ + "float,initialTitle:(floatcal)" + "size 843 650,initialTitle:(floatcal)" + "move 100%-w-20 40,initialTitle:(floatcal)" + "float,initialTitle:(tuirun)" + "size 600 300,initialTitle:(tuirun)" + "center,initialTitle:(tuirun)" + # "workspace special:tuirun,initialTitle:(tuirun)" + "noborder,initialTitle:(tuirun)" + #windowrulev2 = move 1708 32,class:(floatcal) + "float,class:(org.keepassxc.KeePassXC)" + "size 843 530,class:(org.keepassxc.KeePassXC)" + "move 100%-w-20 40,class:(org.keepassxc.KeePassXC)" + + # RANGER/NNN SETTINGS + "float,class:(floatranger)" + "float,class:(floatnnn)" + #windowrulev2 = size 843 650,class:(floatranger) + #windowrulev2 = move 1708 32,class:(floatranger) + #windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$ + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + "suppressevent maximize, class:.* # You'll probably like this." + #windowrulev2 = noshadow, floating:0 + "float,class:^(imv)$" + "float,class:^(com.github.hluk.copyq)$" + "float,class:^(blueman-manager)$" + "center,class:^(nwg-look)$" + "float,class:^(nwg-look)$" + "float,class:^(Lxappearance)$" + "float,class:(pavucontrol)$" + "move 100%-w-20 40,class:(pavucontrol)$" + "float,class:^(polkit-gnome-authentication-agent-1)$" + "float,class:^(org.gnome.Calculator)$" + "size 741 585,class:(pavucontrol)$" + "float,class:^(org.corectrl.CoreCtrl)$" + "float,class:^(feh)$" + ]; + windowrule = [ + "center, ^(xarchiver)$" + "float, ^(xarchiver)$" + "float, ^(org.gnome.FileRoller)$" + ]; + }; + }; +} diff --git a/modules/home/programs/hyprlandbak/toothpick/startup.nix b/modules/home/programs/hyprlandbak/toothpick/startup.nix new file mode 100644 index 00000000..75329ed4 --- /dev/null +++ b/modules/home/programs/hyprlandbak/toothpick/startup.nix @@ -0,0 +1,29 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.hyprland.toothpick.startup; +in { + options = { + home.programs.hyprland.toothpick.startup.enable = mkEnableOption "Enables startup settings in Hyprland"; + }; + config = mkIf cfg.enable { + wayland.windowManager.hyprland.settings = { + exec-once = [ + # STARTUP + # exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + "systemctl --user start polkit-gnome-authentication-agent-1" + # exec-once = lxqt-policykit-agent & + "mullvad-vpn" + "pamixer --set-volume 50" + # exec-once = swaybg -i ~/media/images/wallpaper.png + "wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'" + # exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server" + "hyprctl dispatch exec 'sleep 5s && keepassxc'" + "hyprctl dispatch exec 'sleep 3s && solaar -w hide'" + ]; + }; + }; +} diff --git a/modules/home/programs/hyprlock/default.nix b/modules/home/programs/hyprlock/default.nix index 200c53e1..171812c2 100644 --- a/modules/home/programs/hyprlock/default.nix +++ b/modules/home/programs/hyprlock/default.nix @@ -1,5 +1,5 @@ { - inputs, + # inputs, pkgs, config, lib, @@ -8,8 +8,8 @@ inherit (lib) mkIf mkEnableOption; cfg = config.home.programs.hyprlock; - hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock; - # hyprlockPkg = pkgs.hyprlock; + # hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock; + hyprlockPkg = pkgs.hyprlock; in { options = { home.programs.hyprlock.enable = mkEnableOption "Enables hyprlock"; @@ -17,7 +17,7 @@ in { config = mkIf cfg.enable { programs.hyprlock = { enable = true; - package = hyprlockFlake; + package = hyprlockPkg; settings = { general = { disable_loading_bar = true; diff --git a/modules/home/programs/misc/default.nix b/modules/home/programs/misc/default.nix index 809ed3d2..d626a57d 100644 --- a/modules/home/programs/misc/default.nix +++ b/modules/home/programs/misc/default.nix @@ -19,10 +19,6 @@ in { feh = { enable = true; }; - # system information - fastfetch = { - enable = true; - }; # a monitor of resources btop = { enable = true; @@ -33,12 +29,12 @@ in { }; home.packages = with pkgs; [ # misc.gui - virt-manager + # virt-manager xfce.thunar file-roller # archiver gnome-calculator keepassxc - networkmanagerapplet # tray icon for NetworkManager + # networkmanagerapplet # tray icon for NetworkManager nwg-look # GTK settings pavucontrol # GUI sound control qbittorrent @@ -47,6 +43,7 @@ in { # misc.tui ranger xcur2png + cmatrix calcurse # calendar chatgpt-cli exiftool diff --git a/modules/home/services/gtk/default.nix b/modules/home/services/gtk/default.nix index d3ae1cfc..b8838220 100644 --- a/modules/home/services/gtk/default.nix +++ b/modules/home/services/gtk/default.nix @@ -12,7 +12,7 @@ in { }; config = mkIf cfg.enable { home = { - packages = [pkgs.glib]; # gsettings + # packages = [pkgs.glib]; # gsettings pointerCursor = { # package = pkgs.catppuccin-cursors.latteDark; # name = "catppuccin-latte-dark-cursors"; diff --git a/modules/home/services/hypridle/default.nix b/modules/home/services/hypridle/default.nix index 607e30b3..27daf5d2 100644 --- a/modules/home/services/hypridle/default.nix +++ b/modules/home/services/hypridle/default.nix @@ -2,14 +2,14 @@ config, lib, pkgs, - inputs, + # inputs, ... }: let inherit (lib) mkIf mkEnableOption; cfg = config.home.services.hypridle; - hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle; - # hypridlePkg = pkgs.hypridle; + # hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle; + hypridlePkg = pkgs.hypridle; in { options = { home.services.hypridle.enable = mkEnableOption "Enables hypridle"; @@ -17,7 +17,7 @@ in { config = mkIf cfg.enable { services.hypridle = { enable = true; - package = hypridleFlake; + package = hypridlePkg; settings = { general = { lock_cmd = "hyprlock"; diff --git a/modules/home/services/hyprpaper/default.nix b/modules/home/services/hyprpaper/default.nix index ea71abf3..e00664ba 100644 --- a/modules/home/services/hyprpaper/default.nix +++ b/modules/home/services/hyprpaper/default.nix @@ -2,14 +2,14 @@ config, lib, pkgs, - inputs, + # inputs, ... }: let inherit (lib) mkIf mkEnableOption; cfg = config.home.services.hyprpaper; - hyprpaperFlake = inputs.hyprpaper.packages.${pkgs.system}.default; - # hyprpaperPkg = pkgs.hyprpaper; + # hyprpaperFlake = inputs.hyprpaper.packages.${pkgs.system}.default; + hyprpaperPkg = pkgs.hyprpaper; in { options = { home.services.hyprpaper.enable = mkEnableOption "Enables hyprpaper"; @@ -17,7 +17,7 @@ in { config = mkIf cfg.enable { services.hyprpaper = { enable = true; - package = hyprpaperFlake; + package = hyprpaperPkg; settings = { ipc = "on"; splash = false; diff --git a/modules/nixos/boot/kernel/default.nix b/modules/nixos/boot/kernel/default.nix index 1a88f1e2..5f12485c 100644 --- a/modules/nixos/boot/kernel/default.nix +++ b/modules/nixos/boot/kernel/default.nix @@ -72,7 +72,10 @@ in { }; chaotic = mkIf (cfg.variant == "cachyos") { - scx.enable = true; + scx = { + enable = true; + scheduler = "scx_lavd"; + }; }; }; } diff --git a/modules/nixos/hardware/graphics/amd/default.nix b/modules/nixos/hardware/graphics/amd/default.nix index 1f3ab8e3..ec6bdd46 100644 --- a/modules/nixos/hardware/graphics/amd/default.nix +++ b/modules/nixos/hardware/graphics/amd/default.nix @@ -12,11 +12,10 @@ in { enable = mkEnableOption "AMD graphics support"; packageSet = mkOption { - type = types.enum ["standard" "chaotic" "minimal"]; - default = "minimal"; + type = types.enum ["standard" "chaotic"]; + default = "standard"; description = '' Which set of AMD graphics packages to use: - - minimal: Only basic drivers and libraries - standard: Additional AMD-specific tools and utilities - chaotic: Chaotic Mesa git version with additional optimizations ''; @@ -26,35 +25,37 @@ in { config = mkIf cfg.enable (mkMerge [ { - # Base configuration that applies regardless of package set + # Base configuration hardware.graphics = { enable = true; enable32Bit = true; }; } + # Standard Package Set (mkIf (cfg.packageSet == "standard") { - hardware.graphics = { - extraPackages = with pkgs; [ - libva - vaapiVdpau - libvdpau-va-gl - amdvlk - vulkan-tools - ]; - extraPackages32 = with pkgs.pkgsi686Linux; [ - vaapiVdpau - libvdpau-va-gl - ]; - }; + hardware.graphics.extraPackages = with pkgs; [ + libva + vaapiVdpau + libvdpau-va-gl + vulkan-loader + vulkan-validation-layers + vulkan-extension-layer + ]; + hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ + vaapiVdpau + libvdpau-va-gl + ]; + environment.systemPackages = with pkgs; [ + vulkan-tools + wayland + wayland-protocols + ]; }) + # Chaotic Package Set (mkIf (cfg.packageSet == "chaotic") { chaotic = { - scx = { - enable = true; - scheduler = "scx_lavd"; - }; mesa-git = { enable = true; extraPackages = with pkgs; [ @@ -65,18 +66,14 @@ in { latencyflex-vulkan mesa_git mesa_git.opencl - vulkanPackages_latest.gfxreconstruct - vulkanPackages_latest.spirv-cross + vulkanPackages_latest.vulkan-loader + vulkanPackages_latest.vulkan-headers + vulkanPackages_latest.vulkan-validation-layers + vulkanPackages_latest.vulkan-extension-layer + vulkanPackages_latest.vulkan-utility-libraries + vulkanPackages_latest.vulkan-volk vulkanPackages_latest.spirv-headers vulkanPackages_latest.spirv-tools - vulkanPackages_latest.vulkan-extension-layer - vulkanPackages_latest.vulkan-headers - vulkanPackages_latest.vulkan-loader - vulkanPackages_latest.vulkan-tools - vulkanPackages_latest.vulkan-tools-lunarg - vulkanPackages_latest.vulkan-utility-libraries - vulkanPackages_latest.vulkan-validation-layers - vulkanPackages_latest.vulkan-volk ]; extraPackages32 = with pkgs.pkgsi686Linux; [ pkgs.mesa32_git @@ -88,6 +85,14 @@ in { ]; }; }; + environment.systemPackages = with pkgs; [ + vulkanPackages_latest.vulkan-tools + vulkanPackages_latest.vulkan-tools-lunarg + vulkanPackages_latest.gfxreconstruct + vulkanPackages_latest.spirv-cross + wayland-protocols_git + wayland_git + ]; }) ]); } diff --git a/modules/nixos/hardware/network/default.nix b/modules/nixos/hardware/network/default.nix index c1504707..d3d4656f 100644 --- a/modules/nixos/hardware/network/default.nix +++ b/modules/nixos/hardware/network/default.nix @@ -9,11 +9,6 @@ in { options = { nixos.hardware.network = { enable = mkEnableOption "Enable the custom networking module"; - hostName = mkOption { - type = types.str; - default = "default-hostname"; - description = "Hostname for the nixos."; - }; interfaces = mkOption { type = types.attrsOf (types.submodule { options = { @@ -53,7 +48,6 @@ in { networking = { networkmanager.enable = true; - inherit (cfg) hostName; nftables.enable = true; firewall = { enable = true; diff --git a/modules/nixos/programs/hyprland/default.nix b/modules/nixos/programs/hyprland/default.nix index 1150405d..7aa4599f 100644 --- a/modules/nixos/programs/hyprland/default.nix +++ b/modules/nixos/programs/hyprland/default.nix @@ -7,7 +7,7 @@ }: let inherit (lib) mkIf mkEnableOption; cfg = config.nixos.programs.hyprland; - hyprsysteminfoFlake = inputs.hyprsysteminfo.packages.${pkgs.system}.default; + # hyprsysteminfoFlake = inputs.hyprsysteminfo.packages.${pkgs.system}.default; in { options = { nixos.programs.hyprland.enable = mkEnableOption "Enables hyprland"; @@ -17,14 +17,14 @@ in { programs.hyprland = { enable = true; xwayland.enable = true; - package = inputs.hyprland.packages.${pkgs.system}.default; - portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + package = pkgs.hyprland; + portalPackage = pkgs.xdg-desktop-portal-hyprland; }; environment = { variables.NIXOS_OZONE_WL = "1"; systemPackages = [ - pkgs.hyprwayland-scanner - hyprsysteminfoFlake + # pkgs.hyprwayland-scanner + # hyprsysteminfoFlake ]; }; }; diff --git a/modules/nixos/programs/lutris/default.nix b/modules/nixos/programs/lutris/default.nix index 4040abdd..50a51b5e 100644 --- a/modules/nixos/programs/lutris/default.nix +++ b/modules/nixos/programs/lutris/default.nix @@ -14,8 +14,6 @@ in { environment.systemPackages = with pkgs; [ lutris bottles - wineWowPackages.waylandFull - wineWowPackages.stagingFull ]; }; } diff --git a/modules/nixos/programs/misc/default.nix b/modules/nixos/programs/misc/default.nix index e76f5384..1fca1b5d 100644 --- a/modules/nixos/programs/misc/default.nix +++ b/modules/nixos/programs/misc/default.nix @@ -27,6 +27,7 @@ in { (mkIf cfg.desktop.enable [ pkgs.protonup pkgs.winetricks + pkgs.wine ]) ]; }; diff --git a/modules/nixos/services/greetd/default.nix b/modules/nixos/services/greetd/default.nix index ad837be8..cbaea2d0 100644 --- a/modules/nixos/services/greetd/default.nix +++ b/modules/nixos/services/greetd/default.nix @@ -24,7 +24,7 @@ in { default = false; description = "Enables autologin for a specified user."; }; - autologin.user = mkOption { + user = mkOption { type = types.str; default = "cnst"; description = "The username to auto-login when autologin is enabled."; @@ -39,14 +39,14 @@ in { # Conditionally include initial_session if autologin is enabled (mkIf cfg.autologin.enable { initial_session = { - command = "${pkgs.hyprland}/bin/Hyprland"; - user = cfg.autologin.user; + command = "${lib.getExe config.programs.hyprland.package}"; + user = cfg.user; }; }) { default_session = { command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session --asterisks"; - user = "greeter"; + user = cfg.user; }; } ]; diff --git a/modules/nixos/services/xserver/default.nix b/modules/nixos/services/xserver/default.nix index f7bf6f46..44fa5169 100644 --- a/modules/nixos/services/xserver/default.nix +++ b/modules/nixos/services/xserver/default.nix @@ -22,6 +22,7 @@ in { }; config = { services.xserver = { + enable = true; videoDrivers = cfg.videoDrivers; xkb.layout = cfg.xkbLayout; }; diff --git a/modules/nixos/system/devpkgs/default.nix b/modules/nixos/system/devpkgs/default.nix index 4a61d8d1..fd6b27fa 100644 --- a/modules/nixos/system/devpkgs/default.nix +++ b/modules/nixos/system/devpkgs/default.nix @@ -34,7 +34,7 @@ in { clang-tools marksman pyright - nodePackages_latest.intelephense + # nodePackages_latest.intelephense # Formatters alejandra diff --git a/modules/nixos/system/xdg/default.nix b/modules/nixos/system/xdg/default.nix index fc06767c..3501f948 100644 --- a/modules/nixos/system/xdg/default.nix +++ b/modules/nixos/system/xdg/default.nix @@ -23,7 +23,7 @@ in { enable = true; xdgOpenUsePortal = cfg.xdgOpenUsePortal; config = { - common.default = "*"; + common.default = ["gtk"]; hyprland.default = ["hyprland" "gtk"]; }; extraPortals = [pkgs.xdg-desktop-portal-gtk]; diff --git a/users/cnst/default.nix b/users/cnst/default.nix index 3f5d92b2..efcb42d6 100644 --- a/users/cnst/default.nix +++ b/users/cnst/default.nix @@ -26,23 +26,21 @@ ]; sessionVariables = { - BROWSER = "firefox"; + BROWSER = "zen"; EDITOR = "hx"; TERM = "xterm-256color"; - STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/cnst/.steam/root/compatibilitytools.d"; # proton and steam compat + VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"; + STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/cnst/.steam/root/compatibilitytools.d"; QT_QPA_PLATFORM = "wayland"; - SDL_VIDEODRIVER = "wayland"; - XDG_SESSION_TYPE = "wayland"; }; }; - # disable manuals as nmd fails to build often manual = { html.enable = false; json.enable = false; manpages.enable = false; }; - # let HM manage itself when in standalone mode + programs.home-manager.enable = true; } diff --git a/users/cnst/modules.nix b/users/cnst/modules.nix index 12ecdc64..0fc81f9c 100644 --- a/users/cnst/modules.nix +++ b/users/cnst/modules.nix @@ -48,12 +48,7 @@ enable = true; }; hyprland = { - cnst = { - enable = true; - }; - toothpick = { - enable = false; - }; + enable = true; }; hyprlock = { enable = true; @@ -71,7 +66,7 @@ enable = true; }; neovim = { - enable = true; + enable = false; }; rofi = { enable = false; @@ -92,7 +87,7 @@ enable = false; }; yazi = { - enable = true; + enable = false; }; zathura = { enable = true; @@ -112,7 +107,7 @@ enable = true; }; copyq = { - enable = true; + enable = false; }; dconf = { settings = { diff --git a/users/toothpick/modules.nix b/users/toothpick/modules.nix index 09b4a1af..733c0859 100644 --- a/users/toothpick/modules.nix +++ b/users/toothpick/modules.nix @@ -39,12 +39,7 @@ enable = true; }; hyprland = { - cnst = { - enable = false; - }; - toothpick = { - enable = true; - }; + enable = true; }; hyprlock = { enable = true;