From b22e6ccc9197f1b9cc0073fb059b9882736efbb4 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Thu, 16 Jan 2025 21:26:48 +0100 Subject: [PATCH] try hyprland instead --- flake.lock | 967 +++++++++++++++++- flake.nix | 17 +- hosts/spectre-x360-2018/default.nix | 2 +- modules/home-manager/backup.nix | 34 +- .../home-manager/hyprland-customization.nix | 57 ++ modules/nixos/hyprland.nix | 35 + modules/nixos/nvidia.nix | 15 +- users/remy.nix | 45 +- utils/binary-cache.nix | 3 + variable.nix | 25 + 10 files changed, 1147 insertions(+), 53 deletions(-) create mode 100644 modules/home-manager/hyprland-customization.nix create mode 100644 modules/nixos/hyprland.nix create mode 100644 variable.nix diff --git a/flake.lock b/flake.lock index dd3dff6..f7159c9 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,173 @@ { "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736102453, + "narHash": "sha256-5qb4kb7Xbt8jJFL/oDqOor9Z2+E+A+ql3PiyDvsfWZ0=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "4846091641f3be0ad7542086d52769bb7932bde6", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "aquamarine_2": { + "inputs": { + "hyprutils": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906446, + "narHash": "sha256-6OWluVE2A8xi+8V3jN9KA72RCgJjYdyyuLBUjxZ2q2U=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "eecb74dc79bb6752a2a507e6edee3042390a6091", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "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": [ + "walker", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "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": [ + "hyprland-virtual-desktops", + "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" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -21,6 +189,504 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906540, + "narHash": "sha256-vQ/L9hZFezC0LquLo4TWXkyniWtYBlFHAKIsDc7PYJE=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "69270ba8f057d55b0e6c2dca0e165d652856e613", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprcursor_2": { + "inputs": { + "hyprlang": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906540, + "narHash": "sha256-vQ/L9hZFezC0LquLo4TWXkyniWtYBlFHAKIsDc7PYJE=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "69270ba8f057d55b0e6c2dca0e165d652856e613", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736115290, + "narHash": "sha256-Jcn6yAzfUMcxy3tN/iZRbi/QgrYm7XLyVRl9g/nbUl4=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "52202272d89da32a9f866c0d10305a5e3d954c50", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprgraphics_2": { + "inputs": { + "hyprutils": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "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": 1736771168, + "narHash": "sha256-8TaiwQorn5etYxUtyUYPJBkWuzfoULHSwGDEf+cOhh4=", + "owner": "horriblename", + "repo": "hyprgrass", + "rev": "d324904d70e8c9710bcf772227f364262baf3820", + "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", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1737038559, + "narHash": "sha256-irqN8zKwpQ0NFxEvV/wQRdopClwkyZXCQoF7mgX/Uss=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "0dc7367a7006cc3cc877d52bf34c4998144bff84", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1735774328, + "narHash": "sha256-vIRwLS9w+N99EU1aJ+XNOU6mJTxrUBa31i1r82l0V7s=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "e3b6af97ddcfaafbda8e2828c719a5af84f662cb", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-protocols_2": { + "inputs": { + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "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" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736114838, + "narHash": "sha256-FxbuGQExtN37ToWYnGmO6weOYN6WPHN/RAqbr7gNPek=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "6997fe382dcf396704227d2b98ffdd5066da6959", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprland-qtutils_2": { + "inputs": { + "hyprutils": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "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" + } + }, + "hyprland-virtual-desktops": { + "inputs": { + "hyprland": "hyprland_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1734967974, + "narHash": "sha256-7wKaTYpeLoPnjgDoRxQwW1qb+DKJoIbIXVcTZzfHSik=", + "owner": "levnikmyskin", + "repo": "hyprland-virtual-desktops", + "rev": "e4469b8f0b0cea850876f42f0ae91c5994705c4d", + "type": "github" + }, + "original": { + "owner": "levnikmyskin", + "repo": "hyprland-virtual-desktops", + "type": "github" + } + }, + "hyprland_2": { + "inputs": { + "aquamarine": "aquamarine_2", + "hyprcursor": "hyprcursor_2", + "hyprgraphics": "hyprgraphics_2", + "hyprland-protocols": "hyprland-protocols_2", + "hyprland-qtutils": "hyprland-qtutils_2", + "hyprlang": "hyprlang_2", + "hyprutils": "hyprutils_2", + "hyprwayland-scanner": "hyprwayland-scanner_2", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks_2", + "systems": "systems_2", + "xdph": "xdph_2" + }, + "locked": { + "lastModified": 1737136603, + "narHash": "sha256-fUY5Rr3ct03bynJdbMF6dorXkSZdUzZQ/YF3sRsrAxM=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "b65f8a87232c13697f0469fb7dfa31ff4f14af22", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "ref": "main", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1735393019, + "narHash": "sha256-NPpqA8rtmDLsEmZOmz+qR67zsB6Y503Jnv+nSFLKJZ8=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "55608efdaa387af7bfdc0eddb404c409958efa43", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_2": { + "inputs": { + "hyprutils": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906259, + "narHash": "sha256-P79t/7HbACO4/PuJBroGpTptvCWJtXTv+gWsF+sM6MI=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "0404833ea18d543df44df935ebf1b497310eb046", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736164519, + "narHash": "sha256-1LimBKvDpBbeX+qW7T240WEyw+DBVpDotZB4JYm8Aps=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "3c895da64b0eb19870142196fa48c07090b441c4", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprutils_2": { + "inputs": { + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734796073, + "narHash": "sha256-TnuKsa8OHrSJEmHm3TLGOWbPNA1gRjmZLsRzKrCqOsg=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "c3331116ebd0b71df5ae8c6efe9a7f94148b03bf", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1735493474, + "narHash": "sha256-fktzv4NaqKm94VAkAoVqO/nqQlw+X0/tJJNAeCSfzK4=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "de913476b59ee88685fdc018e77b8f6637a2ae0b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "hyprwayland-scanner_2": { + "inputs": { + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734793513, + "narHash": "sha256-rrrHcXapXJvGFqX+L/Bb0182L25jofAZ0fm1FInvrTQ=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "4d7367b6eee87397e2dbca2e78078dd0a4ef4c61", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nix-flatpak": { "locked": { "lastModified": 1711997201, @@ -39,16 +705,32 @@ }, "nixpkgs": { "locked": { - "lastModified": 1736549401, - "narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=", - "owner": "nixos", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-24.11", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } @@ -69,12 +751,281 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1736549401, + "narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1720957393, + "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735882644, + "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore_2", + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1734797603, + "narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", + "hyprgrass": "hyprgrass", + "hyprland": "hyprland", + "hyprland-virtual-desktops": "hyprland-virtual-desktops", "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs": "nixpkgs_4", + "nixpkgs-unstable": "nixpkgs-unstable", + "walker": "walker" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "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" + } + }, + "walker": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_5", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1737092107, + "narHash": "sha256-p1+wUOOLZoeyBanKVN5XNI2kLaBTVVfErs9AR1fg0Xc=", + "owner": "abenz1267", + "repo": "walker", + "rev": "712445d0738e713d23cdbf7dbad07c3e7ae4484e", + "type": "github" + }, + "original": { + "owner": "abenz1267", + "repo": "walker", + "type": "github" + } + }, + "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": 1734907020, + "narHash": "sha256-p6HxwpRKVl1KIiY5xrJdjcEeK3pbmc///UOyV6QER+w=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "d7f18dda5e511749fa1511185db3536208fb1a63", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "xdph_2": { + "inputs": { + "hyprland-protocols": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland-virtual-desktops", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland-virtual-desktops", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-virtual-desktops", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734907020, + "narHash": "sha256-p6HxwpRKVl1KIiY5xrJdjcEeK3pbmc///UOyV6QER+w=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "d7f18dda5e511749fa1511185db3536208fb1a63", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 86f9762..673fa68 100644 --- a/flake.nix +++ b/flake.nix @@ -9,13 +9,26 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; # Managing flatpak apps nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; - + # hyprland and plugins + hyprland.url = "github:hyprwm/Hyprland"; + # hyprland-plugins = { + # url = "github:hyprwm/hyprland-plugins"; + # inputs.hyprland.follows = "hyprland"; + # }; + hyprgrass = { + url = "github:horriblename/hyprgrass"; + inputs.hyprland.follows = "hyprland"; # IMPORTANT + }; + hyprland-virtual-desktops.url = "github:levnikmyskin/hyprland-virtual-desktops"; + walker.url = "github:abenz1267/walker"; }; outputs = { self, nixpkgs, home-manager, + hyprgrass, + hyprland-virtual-desktops, ... } @ inputs: { @@ -30,10 +43,12 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.remy.imports = [ ./users/remy.nix inputs.nix-flatpak.homeManagerModules.nix-flatpak + inputs.walker.homeManagerModules.default ]; } ]; diff --git a/hosts/spectre-x360-2018/default.nix b/hosts/spectre-x360-2018/default.nix index 5a887b2..05cac3b 100644 --- a/hosts/spectre-x360-2018/default.nix +++ b/hosts/spectre-x360-2018/default.nix @@ -5,7 +5,7 @@ ./configuration.nix ./hardware-configuration.nix ../../modules/nixos/flatpak.nix - ../../modules/nixos/gdm.nix + ../../modules/nixos/hyprland.nix ../../modules/nixos/monitoring.nix ../../modules/nixos/nvidia.nix ../../modules/nixos/pipewire.nix diff --git a/modules/home-manager/backup.nix b/modules/home-manager/backup.nix index fb1d7ab..dfebe68 100644 --- a/modules/home-manager/backup.nix +++ b/modules/home-manager/backup.nix @@ -1,17 +1,25 @@ {pkgs, ...}: { - # Add a udev rule that launches a backup using restic when a specific USB device (the backup drive) is plugged in + # Add a udev rule that launches a backup using restic when a specific USB device (the backup drive) is plugged in - environment.systemPackages = with pkgs; [ - restic - ]; - services.udev.packages = [ - (pkgs.writeTextFile { - name = "bakc"; - text = '' - SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", ATTRS{idProduct}=="1969", MODE="0666", TAG+="uaccess", SYMLINK+="stm32_dfu", GROUP="plugdev" - ''; - destination = "/etc/udev/rules.d/50-zsa.rules"; - }) - ]; + environment.systemPackages = with pkgs; [ + restic + ]; + + # the udev rule: + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_LABEL}=="backup-restic", TAG+="systemd", ENV{SYSTEMD_WANTS}="backup-restic.service" + ''; + + # the systemd service: + systemd.services.backup-restic = { + description = "Backup using restic (triggered when USB drive is plugged in)"; + after = [ "local-fs.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + # TODO: adapt command + ExecStart = "${pkgs.restic}/bin/restic backup /home/username"; + }; + }; } \ No newline at end of file diff --git a/modules/home-manager/hyprland-customization.nix b/modules/home-manager/hyprland-customization.nix new file mode 100644 index 0000000..8679d98 --- /dev/null +++ b/modules/home-manager/hyprland-customization.nix @@ -0,0 +1,57 @@ +{inputs, pkgs, ...}: +{ + programs.kitty.enable = true; + wayland.windowManager.hyprland = { + enable = true; + settings = { + "$mod" = "SUPER"; + bind = + [ + "$mod, F, exec, firefox" + "$mod, return, exec, walker" + "$mod_SHIFT, return, exec, kitty" + "$mod_SHIFT, q, kill" + "$mod, s, exec, code" + ]; + + # plugin.virtual-desktops = { + + # } + }; + + plugins = [ + # Touch gestures: https://github.com/horriblename/hyprgrass + inputs.hyprgrass.packages.${pkgs.system}.default + # Virtual desktops: https://github.com/levnikmyskin/hyprland-virtual-desktops + # inputs.hyprland-virtual-desktops.packages.${pkgs.system}.virtual-desktops + ]; + }; + + programs.walker = { + enable = true; + runAsService = true; + + # All options from the config.json can be used here. + config = { + search.placeholder = "Example"; + ui.fullscreen = true; + list = { + height = 200; + }; + websearch.prefix = "?"; + switcher.prefix = "/"; + }; + + # If this is not set the default styling is used. + # style = '' + # * { + # color: #dcd7ba; + # } + # ''; + }; + + # # Set waybar config + # ".config/waybar/config".text = '' + # '' + +} diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix new file mode 100644 index 0000000..47553ad --- /dev/null +++ b/modules/nixos/hyprland.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + programs.uwsm.enable = true; + + programs.hyprland = { + enable = true; + xwayland.enable = false; + withUWSM = true; + }; + + # launch hyprland on login + # systemd.services.hyprland = { + # description = "Hyprland"; + # wantedBy = [ "graphical.target" ]; + # after = [ "display-manager.service" ]; + # serviceConfig = { + # Type = "simple"; + # ExecStart = "${pkgs.hyprland}/bin/hyprland"; + # Restart = "always"; + # RestartSec = "5"; + # User = config.var.username; + # }; + # }; + + environment.systemPackages = with pkgs; [ + waybar + ]; + + +} diff --git a/modules/nixos/nvidia.nix b/modules/nixos/nvidia.nix index e9b8a44..b0d0635 100644 --- a/modules/nixos/nvidia.nix +++ b/modules/nixos/nvidia.nix @@ -17,19 +17,18 @@ enable = true; }; hardware.nvidia = { - prime = { - nvidiaBusId = "PCI:1:0:0"; - intelBusId = "PCI:0:2:0"; - - }; + # prime = { + # nvidiaBusId = "PCI:1:0:0"; + # intelBusId = "PCI:0:2:0"; + # }; modesetting.enable = true; - powerManagement.enable = false; + powerManagement.enable = true; powerManagement.finegrained = false; open = false; nvidiaSettings = false; package = config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "565.77"; # latest + version = "565.77"; sha256_64bit = "sha256-CnqnQsRrzzTXZpgkAtF7PbH9s7wbiTRNcM0SPByzFHw="; sha256_aarch64 = "sha256-LSAYUnhfnK3rcuPe1dixOwAujSof19kNOfdRHE7bToE="; openSha256 = "sha256-Fxo0t61KQDs71YA8u7arY+503wkAc1foaa51vi2Pl5I="; @@ -37,7 +36,7 @@ persistencedSha256 = "sha256-wnDjC099D8d9NJSp9D0CbsL+vfHXyJFYYgU3CwcqKww="; }; }; - + # overwrite the blacklists set previously boot.extraModprobeConfig = ""; boot.blacklistedKernelModules = []; services.udev.extraRules = ""; diff --git a/users/remy.nix b/users/remy.nix index 6592b1b..0da3267 100644 --- a/users/remy.nix +++ b/users/remy.nix @@ -6,7 +6,8 @@ with lib.hm.gvariant; ../modules/home-manager/code.nix ../modules/home-manager/fish.nix ../modules/home-manager/flatpaks.nix - ../modules/home-manager/gnome-shell-customization.nix + ../modules/home-manager/hyprland-customization.nix + # ../modules/home-manager/gnome-shell-customization.nix ../modules/home-manager/keepassxc.nix ../modules/home-manager/obsidian.nix ../modules/home-manager/owncloud-client.nix @@ -32,28 +33,28 @@ with lib.hm.gvariant; }; - ## Gnome keyboard and mouse settings - dconf.settings = { - # set the keyboard layout to german - "org/gnome/desktop/input-sources" = { - current = mkUint32 0; - sources = [ (mkTuple [ "xkb" "de" ]) (mkTuple [ "xkb" "ch" ]) (mkTuple [ "xkb" "us" ]) ]; - xkb-options = [ "lv3:ralt_switch" ]; - }; + # ## Gnome keyboard and mouse settings + # dconf.settings = { + # # set the keyboard layout to german + # "org/gnome/desktop/input-sources" = { + # current = mkUint32 0; + # sources = [ (mkTuple [ "xkb" "de" ]) (mkTuple [ "xkb" "ch" ]) (mkTuple [ "xkb" "us" ]) ]; + # xkb-options = [ "lv3:ralt_switch" ]; + # }; - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; + # "org/gnome/desktop/peripherals/keyboard" = { + # numlock-state = true; + # }; - "org/gnome/desktop/peripherals/mouse" = { - natural-scroll = false; - speed = 0.20851063829787231; - }; + # "org/gnome/desktop/peripherals/mouse" = { + # natural-scroll = false; + # speed = 0.20851063829787231; + # }; - "org/gnome/desktop/peripherals/touchpad" = { - tap-to-click = true; - two-finger-scrolling-enabled = true; - speed = 0.16872427983539096; - }; - }; + # "org/gnome/desktop/peripherals/touchpad" = { + # tap-to-click = true; + # two-finger-scrolling-enabled = true; + # speed = 0.16872427983539096; + # }; + # }; } diff --git a/utils/binary-cache.nix b/utils/binary-cache.nix index 9fc2778..70e9e0d 100644 --- a/utils/binary-cache.nix +++ b/utils/binary-cache.nix @@ -11,12 +11,15 @@ # also add mirrors? # "https://mirrors.ustc.edu.cn/nix-channels/store" "https://cache.nixos.org" + "https://hyprland.cachix.org" ]; trusted-public-keys = [ # the default public key of cache.nixos.org, it's built-in, no need to add it here "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + builders-use-substitutes = true; }; } diff --git a/variable.nix b/variable.nix new file mode 100644 index 0000000..71858cf --- /dev/null +++ b/variable.nix @@ -0,0 +1,25 @@ +{ config, ... }: +{ + config.var = { + hostname = "garnix"; + username = "remy"; + configDirectory = "/home/" + config.var.username + + "/.config/nixos"; # The path of the nixos configuration directory + + keyboardLayout = "de"; + + location = "Berlin"; + timeZone = "Europe/Berlin"; + defaultLocale = "en_US.UTF-8"; + extraLocale = "de_DE.UTF-8"; + + git = { + username = "Hadi"; + email = "112569860+anotherhadi@users.noreply.github.com"; + }; + + autoUpgrade = false; + autoGarbageCollector = true; + + }; +} \ No newline at end of file