From 6970b8c7d2e78e100408cd44c6f0de23f5bd3d5d Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Tue, 23 May 2023 18:11:30 +0200 Subject: [PATCH] feat(nix): extend wayland with sway setup --- flake.lock | 352 ++++++++++++++---- flake.nix | 24 +- .../configuration/graphical-fullblown.nix | 31 +- .../profiles/experimental-desktop.nix | 10 +- nix/home-manager/profiles/gnome-desktop.nix | 1 + nix/home-manager/profiles/sway-desktop.nix | 164 ++++++-- nix/home-manager/profiles/wayland-desktop.nix | 46 ++- nix/home-manager/programs/gpg-agent.nix | 6 +- nix/home-manager/programs/radicale.nix | 17 +- nix/home-manager/programs/salut.nix | 17 + nix/home-manager/programs/waybar.nix | 259 ++++--------- nix/home-manager/programs/zsh.nix | 2 +- nix/modules/flake-parts/perSystem/default.nix | 2 +- nix/os/cachix.nix | 4 +- nix/os/cachix/nixpkgs-wayland.nix | 6 +- nix/os/devices/elias-e525/configuration.nix | 1 + nix/os/devices/justyna-p300/configuration.nix | 1 + nix/os/devices/steveej-pa600/pkg.nix | 1 - nix/os/devices/steveej-t14/configuration.nix | 1 + nix/os/devices/steveej-t14/default.nix | 11 +- nix/os/devices/steveej-t14/flake.lock | 25 +- nix/os/devices/steveej-t14/flake.nix | 1 + nix/os/devices/steveej-t14/pkg.nix | 179 +++++---- nix/os/devices/steveej-t14/system.nix | 10 +- nix/os/profiles/common/pkg.nix | 3 +- nix/os/profiles/graphical-gnome-xorg.nix | 106 ++++++ nix/os/profiles/graphical/system.nix | 103 +---- 27 files changed, 867 insertions(+), 516 deletions(-) diff --git a/flake.lock b/flake.lock index c92896f..2c0e97f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "aphorme_launcher": { "flake": false, "locked": { - "lastModified": 1682579667, - "narHash": "sha256-TTGneJdTpHoDA2rZczKQ77+XByZGBz/NRqY21AMP+BQ=", + "lastModified": 1683977169, + "narHash": "sha256-juRiokIk5x+eGJm+QuCdFPUjEggDmscpy2Ip7pU9KI4=", "owner": "Iaphetes", "repo": "aphorme_launcher", - "rev": "182077d5b438301f9a8522649605dc1b736d9677", + "rev": "211bc27de061b61e3119a7966cff09f4b8c3a1fe", "type": "github" }, "original": { @@ -27,11 +27,11 @@ "stable": "stable" }, "locked": { - "lastModified": 1682202576, - "narHash": "sha256-vcTEEEHKx4PTfY80bUmZMwXRy0cTDJCkULHhqe1HJS8=", + "lastModified": 1684127527, + "narHash": "sha256-tAzgb2jgmRaX9HETry38h2OvBf9YkHEH1fFvIJQV9A0=", "owner": "zhaofengli", "repo": "colmena", - "rev": "089431737e283ed3e402a7dff578cb442444c431", + "rev": "caf33af7d854c8d9b88a8f3dae7adb1c24c1407b", "type": "github" }, "original": { @@ -50,11 +50,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1681680516, - "narHash": "sha256-EB8Adaeg4zgcYDJn9sR6UMjN/OHdIiMMK19+3LmmXQY=", + "lastModified": 1684468982, + "narHash": "sha256-EoC1N5sFdmjuAP3UOkyQujSOT6EdcXTnRw8hPjJkEgc=", "owner": "ipetkov", "repo": "crane", - "rev": "54b63c8eae4c50172cb50b612946ff1d2bc1c75c", + "rev": "99de890b6ef4b4aab031582125b6056b792a4a30", "type": "github" }, "original": { @@ -71,11 +71,11 @@ ] }, "locked": { - "lastModified": 1674131019, - "narHash": "sha256-NmbeqCEM9GwwlYPNmu4aWZX3nfBJuMvaJ7T7QzWd8MM=", + "lastModified": 1684003056, + "narHash": "sha256-zl11zyRNKzAW7YLvTkxmFjSBqxZbEvfwZqNCT91ELfU=", "owner": "nix-community", "repo": "disko", - "rev": "e1eba38e8ea3ee6ca8ffef57668d4a37fff19ca4", + "rev": "8f95856432e091e5ac56fea2df81e905ddd02d27", "type": "github" }, "original": { @@ -93,11 +93,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1682576562, - "narHash": "sha256-JsSF/hf/i/2IURKXt6tt58o6/JFk2RvCMxGbUHRd97M=", + "lastModified": 1684650006, + "narHash": "sha256-cIWPr9nCddVu3DITyHBNWy9tBbfc86u+BxPEnRWslMM=", "owner": "nix-community", "repo": "fenix", - "rev": "e5fcb848257ba1c4f4f0615bfadaeddf0f851ad5", + "rev": "fb17fb7db07709d2aca1efc1000fb1cf60b00b4e", "type": "github" }, "original": { @@ -138,16 +138,31 @@ "type": "github" } }, + "flake-compat_3": { + "locked": { + "lastModified": 1680531544, + "narHash": "sha256-8qbiDTYb1kGaDADRXTItpcMKQ1TeQVkuof6oEwHUvVA=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "95e78dc12268c5e4878621845c511077f3798729", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1680392223, - "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "lastModified": 1683560683, + "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "rev": "006c75898cf814ef9497252b022e91c946ba8e17", "type": "github" }, "original": { @@ -164,11 +179,33 @@ ] }, "locked": { - "lastModified": 1673362319, - "narHash": "sha256-Pjp45Vnj7S/b3BRpZEVfdu8sqqA6nvVjvYu59okhOyI=", + "lastModified": 1683560683, + "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "82c16f1682cf50c01cb0280b38a1eed202b3fe9f", + "rev": "006c75898cf814ef9497252b022e91c946ba8e17", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1680392223, + "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", "type": "github" }, "original": { @@ -193,12 +230,15 @@ } }, "flake-utils_2": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "owner": "numtide", "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { @@ -208,6 +248,24 @@ } }, "flake-utils_3": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -253,14 +311,33 @@ "type": "github" } }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1681214977, + "narHash": "sha256-pBaG4iKzF/YJQA06f87IZokB15Z13DYd6zsT/wlbWfI=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "19d70ca7a81956bd01a768297b84798f301e150f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, "magmawm": { "flake": false, "locked": { - "lastModified": 1684598861, - "narHash": "sha256-yya0fLFie9RjZ+97dcwIFidAApX2XpVn9GokzTnUlyE=", + "lastModified": 1684662176, + "narHash": "sha256-jgTAHe4JYAHjm6araJlPJZoLlnz6q/Y21bKrx/kBetk=", "owner": "MagmaWM", "repo": "MagmaWM", - "rev": "c8dc4bac3b5acf870c28896de333033eedc80397", + "rev": "e228ed1ff6b6c6181a8b05e1c4e0d74f2634e14b", "type": "github" }, "original": { @@ -269,13 +346,32 @@ "type": "github" } }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1682480188, + "narHash": "sha256-4LG8Vl/fLWsJg+QAb5/PvZTdLtPFsYFxuGDfEAR5szA=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "73ee1712faeb5db609fc9f991e2dc1de265acff5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, "nixos-2211": { "locked": { - "lastModified": 1674463419, - "narHash": "sha256-5PIilc8vqmz7jMwpr+pqCz07L+q0eR2vdwNEUkRxwE8=", + "lastModified": 1684141842, + "narHash": "sha256-sbdzOwBDcyzz/Dr1ztdF+tElMyM/cgx+4XxVgz+NLRM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6eb2af1b88814ca90e6a33761ff71ffd6c360839", + "rev": "2eb0795720849ae19c068e39b17362d3ebcd585c", "type": "github" }, "original": { @@ -289,6 +385,7 @@ "inputs": { "disko": "disko", "flake-parts": "flake-parts_2", + "nixos-2211": "nixos-2211", "nixos-images": "nixos-images", "nixpkgs": [ "nixpkgs" @@ -296,11 +393,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1680727722, - "narHash": "sha256-X360Gt8odtbTItWCM2aJ39YKqEXThuXka1hNmkjojxc=", + "lastModified": 1684473129, + "narHash": "sha256-Nmqas06HVswtASU0kwY4tD/dOtKgMIo7OlJaIGrHYwA=", "owner": "numtide", "repo": "nixos-anywhere", - "rev": "7563cf5863ca03a3b92f555e8baf959a1242b88a", + "rev": "0586b4da4f58f0d02d94fceb06fa7e15d8d03fff", "type": "github" }, "original": { @@ -312,15 +409,21 @@ }, "nixos-images": { "inputs": { - "nixos-2211": "nixos-2211", - "nixos-unstable": "nixos-unstable" + "nixos-2211": [ + "nixos-anywhere", + "nixos-2211" + ], + "nixos-unstable": [ + "nixos-anywhere", + "nixpkgs" + ] }, "locked": { - "lastModified": 1674574673, - "narHash": "sha256-Bttq9LGgSaqjC7nn8AHRbuKYqe2foDK+0EXWTn9tZQw=", + "lastModified": 1684151031, + "narHash": "sha256-6bBOxHIRCn4WQBsjsnaLL7bwcHuCLQj1Xd3gnmbZ9LQ=", "owner": "nix-community", "repo": "nixos-images", - "rev": "b9b667b8b4a8d0c379b39c46408a8a5832195609", + "rev": "3758c6481cd8ad9571c0401fc634eda05a86489b", "type": "github" }, "original": { @@ -329,29 +432,13 @@ "type": "github" } }, - "nixos-unstable": { - "locked": { - "lastModified": 1674365217, - "narHash": "sha256-lL3qUbAr/tnt/xGk1MTc8xuOTKqErqubYha4vhjA4+g=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6c582bdf390948a6be049e81ecbab81bb160a5d3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1682493015, - "narHash": "sha256-KiMOAe8u83QDF40Z25kWMkZbqr9U+mvjvEJy5Qvw0nw=", + "lastModified": 1684580438, + "narHash": "sha256-LUPswmDn6fXP3lEBJFA2Id8PkcYDgzUilevWackYVvQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "60c0f762658916a4a5b5a36b3e06486f8301daf4", + "rev": "7dc71aef32e8faf065cb171700792cf8a65c152d", "type": "github" }, "original": { @@ -364,11 +451,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1680213900, - "narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e3652e0735fbec227f342712f180f4f21f0594f2", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", "type": "github" }, "original": { @@ -379,6 +466,74 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1681001314, + "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat_3", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1684595659, + "narHash": "sha256-B1NtPXWF3Xax1FDeMRYyUDr2e30blTiXLKaUSpegq0E=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "031ace86d48def582fb8f7e098dc9a94fc25c3f7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1681347147, + "narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1a9d9175ecc48ecd033062fa09b1834d13ae9c69", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1684570954, + "narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "ofi-pass": { "flake": false, "locked": { @@ -407,18 +562,20 @@ "magmawm": "magmawm", "nixos-anywhere": "nixos-anywhere", "nixpkgs": "nixpkgs", + "nixpkgs-wayland": "nixpkgs-wayland", "ofi-pass": "ofi-pass", + "salut": "salut", "yofi": "yofi" } }, "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1682502267, - "narHash": "sha256-S1Rk8+lW6GqnfVDyxR7ctJaGRglvhm/DWCeDD3J3ut8=", + "lastModified": 1684616122, + "narHash": "sha256-PLQN+e93BC1Yiqt4QNCj3cJ4mHtsO7Xlgn0VprgxiX4=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "797c2f1dde0905afa24f567160ed23ba2bc79a81", + "rev": "a04d8456be1d289c814846178cc1ff63b4fc297b", "type": "github" }, "original": { @@ -440,11 +597,11 @@ ] }, "locked": { - "lastModified": 1680488274, - "narHash": "sha256-0vYMrZDdokVmPQQXtFpnqA2wEgCCUXf5a3dDuDVshn0=", + "lastModified": 1683080331, + "narHash": "sha256-nGDvJ1DAxZIwdn6ww8IFwzoHb2rqBP4wv/65Wt5vflk=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "7ec2ff598a172c6e8584457167575b3a1a5d80d8", + "rev": "d59c3fa0cba8336e115b376c2d9e91053aa59e56", "type": "github" }, "original": { @@ -453,6 +610,22 @@ "type": "github" } }, + "salut": { + "flake": false, + "locked": { + "lastModified": 1671283721, + "narHash": "sha256-W0lhhImSXtYJDeMbxyEioYu/Bh7ZclwR1/5DzNbxM8o=", + "owner": "snakedye", + "repo": "salut", + "rev": "aa57c4d190812908a9c32cd49cff14390c6dfdcb", + "type": "gitlab" + }, + "original": { + "owner": "snakedye", + "repo": "salut", + "type": "gitlab" + } + }, "stable": { "locked": { "lastModified": 1669735802, @@ -469,13 +642,49 @@ "type": "github" } }, - "treefmt-nix": { + "systems": { "locked": { - "lastModified": 1674297056, - "narHash": "sha256-IheUucTSpBsZ3JhAnrx2RWXf0Z5ekNGiW6ojct3FcZo=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixos-anywhere", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1684070360, + "narHash": "sha256-WaXr9ayqjp0R2+j9MrE1Ufdujw0vEA0o1G/0CrTt4Ns=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "c117283f7482b99a89de0d6ae4b77318ad283294", + "rev": "27107cf3dfdc3c809d2477954d92fc2cc68b4401", "type": "github" }, "original": { @@ -486,7 +695,7 @@ }, "yofi": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixpkgs" ] @@ -501,6 +710,7 @@ }, "original": { "owner": "l4l", + "ref": "master", "repo": "yofi", "type": "github" } diff --git a/flake.nix b/flake.nix index a2f0e94..b87ced2 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,8 @@ nixos-anywhere.url = github:numtide/nixos-anywhere/main; nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; + colmena = { url = "github:zhaofengli/colmena"; inputs.nixpkgs.follows = "nixpkgs"; @@ -28,8 +30,9 @@ url = "github:Iaphetes/aphorme_launcher/main"; flake = false; }; + yofi = { - url = "github:l4l/yofi"; + url = "github:l4l/yofi/master"; flake = true; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -48,6 +51,11 @@ url = "github:MagmaWM/MagmaWM"; flake = false; }; + + salut = { + url = "gitlab:snakedye/salut"; + flake = false; + }; }; outputs = inputs @ { @@ -71,6 +79,8 @@ system = builtins.elemAt systems 0; }; } + # FIXME: this doesn't seem to work to apply overlays into a node's nixpkgs import + # try this instead: https://github.com/zhaofengli/colmena/issues/60#issuecomment-1510496861 (builtins.map (nodeName: import ./nix/os/devices/${nodeName} { repoFlake = self; @@ -114,7 +124,6 @@ # date = "1.60.0"; # } ); - in { dcpj4110dwDriver = dcpj4110dw.driver; dcpj4110dwCupswrapper = dcpj4110dw.cupswrapper; @@ -137,6 +146,17 @@ inherit craneLib; src = inputs.magmawm; }; + + salut = craneLib.buildPackage { + src = inputs.salut; + nativeBuildInputs = [ + pkgs.pkg-config + ]; + buildInputs = [ + pkgs.libxkbcommon + pkgs.fontconfig + ]; + }; }; formatter = pkgs.alejandra; diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index f54319f..02cf511 100644 --- a/nix/home-manager/configuration/graphical-fullblown.nix +++ b/nix/home-manager/configuration/graphical-fullblown.nix @@ -1,5 +1,4 @@ { - inputs, pkgs, config, # these come in via home-manager.extraSpecialArgs and are specific to each node @@ -18,13 +17,11 @@ in { # ../profiles/gnome-desktop.nix ../profiles/sway-desktop.nix - ../profiles/experimental-desktop.ni + # ../profiles/experimental-desktop.nix ../programs/redshift.nix - ../programs/espanso.nix ../programs/gpg-agent.nix - ../programs/radicale.nix ../programs/firefox.nix ../programs/chromium.nix @@ -33,6 +30,10 @@ in { ../programs/neovim.nix ../programs/pass.nix ../programs/vscode + + # TODO: broken since nixos-23.05 + # ../programs/radicale.nix + # ../programs/espanso.nix ]; home.sessionVariables.HM_CONFIG = "graphical-fullblown"; @@ -47,7 +48,6 @@ in { }; }; - home.packages = [] ++ (with pkgs; [ @@ -79,7 +79,6 @@ in { # Archive Managers sshfs-fuse - xarchive p7zip zip unzip @@ -92,16 +91,15 @@ in { yubikey-manager-qt yubikey-personalization yubikey-personalization-gui - gnome.gnome-keyring - # gnome.seahorse + + # gnome.gnome-keyring + gcr gnome.seahorse # Language Support hunspellDicts.en-us hunspellDicts.de-de # Messaging/Communication - signal-desktop - pkgsUnstable.session-desktop # pidgin hexchat schildichat-desktop @@ -111,11 +109,13 @@ in { # pkgsUnstable.jitsi-meet-electron thunderbird evolution # gnome4.glib_networking - kotatogram-desktop - zoom-us + + # FIXME: depends on insecure openssl 1.1.1t + # kotatogram-desktop + thunderbird - gnome.cheese - pkgsMaster.discord + # gnome.cheese + pkgsUnstable.discord # Virtualization # virtmanager @@ -181,7 +181,8 @@ in { # Document Processing and Management mendeley evince - (pkgsUnstable.logseq.override (_: {electron = pkgs.electron_20;})) + pkgsUnstable.logseq + # (pkgsUnstable.logseq.override (_: {electron = pkgs.electron_20;})) # File Synchronzation dropbox diff --git a/nix/home-manager/profiles/experimental-desktop.nix b/nix/home-manager/profiles/experimental-desktop.nix index 5747366..96daa60 100644 --- a/nix/home-manager/profiles/experimental-desktop.nix +++ b/nix/home-manager/profiles/experimental-desktop.nix @@ -12,17 +12,9 @@ in { ../profiles/wayland-desktop.nix ]; - home.packages = with pkgs; [ + home.packages = [ # experimental WMs packages'.jay packages'.magmawm - - # swayidle - # swaylock - - # # fonts - # noto-fonts - # font-awesome - # noto-fonts-emoji ]; } diff --git a/nix/home-manager/profiles/gnome-desktop.nix b/nix/home-manager/profiles/gnome-desktop.nix index 9a15c0d..5ad7113 100644 --- a/nix/home-manager/profiles/gnome-desktop.nix +++ b/nix/home-manager/profiles/gnome-desktop.nix @@ -13,6 +13,7 @@ in { gnome-keyring.enable = false; blueman-applet.enable = true; flameshot.enable = true; + pasystray.enable = true; }; # TODO: remove this comment once i'm sure everything works diff --git a/nix/home-manager/profiles/sway-desktop.nix b/nix/home-manager/profiles/sway-desktop.nix index 92d1593..b37e995 100644 --- a/nix/home-manager/profiles/sway-desktop.nix +++ b/nix/home-manager/profiles/sway-desktop.nix @@ -2,38 +2,139 @@ pkgs, config, lib, + packages', ... }: let inherit (import ../lib.nix {}) mkSimpleTrayService; + + lockCmd = "${pkgs.swaylock}/bin/swaylock -efF --color '#000000'"; + displayOffCmd = "${pkgs.sway}/bin/swaymsg 'output * power off'"; + displayOnCmd = "${pkgs.sway}/bin/swaymsg 'output * power on'"; + swapOutputWorkspaces = ../../../scripts/sway-swapoutputworkspaces.sh; + in { imports = [ ../profiles/wayland-desktop.nix + ../programs/waybar.nix + ../programs/salut.nix ]; - home.packages = with pkgs; [ - swayidle - swaylock + services = { + blueman-applet.enable = true; + flameshot.enable = true; + }; + + home.packages = [ + pkgs.swayidle + pkgs.swaylock + + packages'.yofi + pkgs.fuzzel + + # required by any bar that has a tray plugin + pkgs.libappindicator-gtk3 + + + ## themes + pkgs.gnome.adwaita-icon-theme + pkgs.hicolor-icon-theme + pkgs.gnome-icon-theme + + + ## fonts + pkgs.dejavu_fonts # just a basic good fond + pkgs.font-awesome_5 # needed by i3status-rust + pkgs.nerdfonts + pkgs.font-awesome + pkgs.roboto + pkgs.ttf_bitstream_vera + + # from the wiki + pkgs.noto-fonts + pkgs.noto-fonts-cjk + pkgs.noto-fonts-cjk-sans + pkgs.noto-fonts-cjk-serif + pkgs.noto-fonts-emoji + pkgs.noto-fonts-emoji-blob-bin + pkgs.noto-fonts-extra + pkgs.noto-fonts-lgc-plus + + pkgs.liberation_ttf + pkgs.fira-code + pkgs.fira-code-symbols + pkgs.mplus-outline-fonts.githubRelease + pkgs.dina-font + pkgs.monoid + pkgs.hermit + + # by colemickens + pkgs.gelasio # metric-compatible with Georgia + pkgs.powerline-symbols + pkgs.iosevka-comfy.comfy-fixed + - # fonts - noto-fonts - font-awesome - noto-fonts-emoji ]; wayland.windowManager.sway = { enable = true; systemdIntegration = true; + xwayland = false; config = let modifier = "Mod4"; + inherit (config.wayland.windowManager.sway.config) left right up down; in { inherit modifier; + bars = []; + + input = { + "type:keyboard" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + xkb_options = "nodeadkeys"; + }; + + "type:touchpad" = { + natural_scroll = "enabled"; + }; + }; keybindings = lib.mkOptionDefault { - "${modifier}+Ctrl+l" = "exec ${pkgs.swaylock}/bin/swaylock -fF"; - "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + # as of 2023-05-21 the `!!` arg parsing mode was broken for me on yofi + # "${modifier}+d" = "exec ${packages'.yofi}/bin/yofi binapps"; + "${modifier}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel"; + + # only 1-9 exist on the default config + "${modifier}+0" = "workspace number 0"; + "${modifier}+Shift+0" = "move container to workspace number 0"; + + # move workspace to output + "${modifier}+Control+Shift+${left}" = "move workspace to output left"; + "${modifier}+Control+Shift+${right}" = "move workspace to output right"; + "${modifier}+Control+Shift+${up}" = "move workspace to output up"; + "${modifier}+Control+Shift+${down}" = "move workspace to output down"; + # move workspace to output with arrow keys + "${modifier}+Control+Shift+Left" = "move workspace to output left"; + "${modifier}+Control+Shift+Right" = "move workspace to output right"; + "${modifier}+Control+Shift+Up" = "move workspace to output up"; + "${modifier}+Control+Shift+Down" = "move workspace to output down"; + + "${modifier}+Shift+e" = "exec swaymsg exit"; + "${modifier}+q" = "kill"; + "${modifier}+x" = "exec ${swapOutputWorkspaces}"; + + "${modifier}+Ctrl+l" = "exec ${lockCmd}"; + + "--locked XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; + + "XF86AudioRaiseVolume" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5"; + "XF86AudioLowerVolume" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5"; + "--locked XF86AudioMute" = "exec ${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute"; + + # TODO: screenshot util, flameshot doesn't work in the packaged version + "Print" = "exec ${pkgs.flameshot}/bin/flameshot gui"; }; terminal = "alacritty"; @@ -41,44 +142,33 @@ in { # Launch Firefox on start # {command = "firefox";} # {command = "gnome-keyring --replace"} + {command = "systemctl --user restart waybar";} ]; - - fonts = { - names = [ "Noto Sans" "Font Awesome 5 Free" ]; - style = "Heavy"; - size = 10.0; + colors.focused = lib.mkOptionDefault { + childBorder = lib.mkForce "#ffa500"; }; - - #fonts = { - # names = [ "DejaVu Sans Mono" "FontAwesome5Free" ]; - # style = "Bold Semi-Condensed"; - # size = 11.0; - #}; - - colors.focused = { - childBorder = "#ffa500"; - - # border = "#ffa500"; - - # TODO: refer to the defaults for these - border = "#4c7899"; - background = "#285577"; - text = "#ffffff"; - indicator = "#2e9ef4"; - }; - - window = { - border = 4; - }; + window.border = 4; }; }; services.swayidle = { enable = true; timeouts = [ - { timeout = 60 * 5; command = "${pkgs.swaylock}/bin/swaylock -fF"; } + { timeout = 10; command = "if ${pkgs.procps}/bin/pgrep -x swaylock; then ${displayOffCmd}; fi"; resumeCommand = displayOnCmd; } + { timeout = 60 * 5; command = lockCmd; } + { timeout = 60 * 6; command = displayOffCmd; resumeCommand = displayOnCmd; } + ]; + events = [ + { event = "before-sleep"; + command = builtins.concatStringsSep "; " [ + lockCmd + "${pkgs.playerctl}/bin/playerctl pause" + ]; + } + { event = "after-resume"; command = displayOnCmd; } + { event = "lock"; command = lockCmd; } ]; }; } diff --git a/nix/home-manager/profiles/wayland-desktop.nix b/nix/home-manager/profiles/wayland-desktop.nix index 1eaeb9b..836296e 100644 --- a/nix/home-manager/profiles/wayland-desktop.nix +++ b/nix/home-manager/profiles/wayland-desktop.nix @@ -1,19 +1,34 @@ { pkgs, config, + lib, + repoFlake, + nodeFlake, ... }: let inherit (import ../lib.nix {}) mkSimpleTrayService; + + nixpkgs-2211 = nodeFlake.inputs.nixpkgs-2211.legacyPackages.${pkgs.system}; + nixpkgs-wayland' = repoFlake.inputs.nixpkgs-wayland.packages.${pkgs.system}; + + wayprompt = nixpkgs-wayland'.wayprompt; in { - services.gpg-agent.pinentryFlavor = "gtk2"; fonts.fontconfig.enable = true; + # services.gpg-agent.pinentryFlavor = lib.mkForce null; + # services.gpg-agent.extraConfig = '' + # pinentry-program "${wayprompt}/bin/pinentry-wayprompt" + # ''; + home.packages = with pkgs; [ wlr-randr wayout wl-clipboard wmctrl + wayprompt + nixpkgs-wayland'.shotman + # identifies key input syms wev @@ -25,6 +40,35 @@ in { pasystray qt5.qtwayland qt6.qtwayland + + # probably required by flameshot + # xdg-desktop-portal xdg-desktop-portal-wlr + # grim + + (signal-desktop.overrideAttrs (old: { + preFixup = old.preFixup + '' + gappsWrapperArgs+=( + --add-flags "--enable-features=UseOzonePlatform" + --add-flags "--ozone-platform=wayland" + ) + ''; + })) + + ((pkgs.session-desktop.override (old: { + inherit (nixpkgs-2211) appimageTools; + })) + .overrideAttrs(old: { + nativeBuildInputs = old.nativeBuildInputs ++ [ + pkgs.wrapGAppsHook + ]; + + preFixup = (old.preFixup or "") + '' + gappsWrapperArgs+=( + --add-flags "--enable-features=UseOzonePlatform" + --add-flags "--ozone-platform=wayland" + ) + ''; + })) ]; home.sessionVariables = { diff --git a/nix/home-manager/programs/gpg-agent.nix b/nix/home-manager/programs/gpg-agent.nix index 0c793a1..7ab523e 100644 --- a/nix/home-manager/programs/gpg-agent.nix +++ b/nix/home-manager/programs/gpg-agent.nix @@ -1,4 +1,8 @@ -{lib, ...}: { +{lib, pkgs, ...}: { + home.packages = [ + pkgs.gcr + ]; + programs.gpg.enable = true; services.gpg-agent = { enable = true; diff --git a/nix/home-manager/programs/radicale.nix b/nix/home-manager/programs/radicale.nix index d9bfb0a..88608da 100644 --- a/nix/home-manager/programs/radicale.nix +++ b/nix/home-manager/programs/radicale.nix @@ -14,6 +14,11 @@ inherit pname version; hash = "sha256-Mukjzjumv9VL+A0maU0K/SliWrgeRjAeiEdN5a83G0I="; }; + + propagatedBuildInputs = [ + pkgs.libxcrypt-legacy + ]; + }; radicale-storage-decsync = pkgs.python3Packages.buildPythonPackage rec { pname = "radicale_storage_decsync"; @@ -24,7 +29,17 @@ hash = "sha256-X+0MT5o2PjsKxca5EDI+rYyQDmUtbRoELDr6e4YXKCg="; }; - buildInputs = [pkgs.radicale]; + buildInputs = [ + pkgs.radicale + pkgs.libxcrypt-legacy + pkgs.libxcrypt + ]; + + nativeCheckInputs = [ + pkgs.libxcrypt-legacy + pkgs.libxcrypt + ]; + propagatedBuildInputs = [libdecsync pkgs.python3Packages.setuptools]; }; radicale-decsync = pkgs.radicale.overrideAttrs (old: { diff --git a/nix/home-manager/programs/salut.nix b/nix/home-manager/programs/salut.nix index e69de29..767949b 100644 --- a/nix/home-manager/programs/salut.nix +++ b/nix/home-manager/programs/salut.nix @@ -0,0 +1,17 @@ +{ + pkgs, + config, + lib, + packages', + ... +}: { + home.packages = [ + packages'.salut + ]; + + home.file.".config/salut/config.ini" = { + enable = true; + text = '' + ''; + }; +} diff --git a/nix/home-manager/programs/waybar.nix b/nix/home-manager/programs/waybar.nix index 350f4e6..132f945 100644 --- a/nix/home-manager/programs/waybar.nix +++ b/nix/home-manager/programs/waybar.nix @@ -1,196 +1,81 @@ -{ pkgs, config, inputs, ... }: +{ pkgs, config, repoFlake, ... }: -let - rogScript = pkgs.writeShellScript "waybar-rog.sh" '' - set -euo pipefail - val="$(${pkgs.asusctl}/bin/asusctl profile -p)" - if [[ "''${val}" == *"Performance"* ]]; then - echo $'{"text": "rog prf"}'; - elif [[ "''${val}" == *"Balanced"* ]]; then - echo $'{"text": "rog bal"}'; - elif [[ "''${val}" == *"Quiet"* ]]; then - echo $'{"text": "rog qui"}'; - fi - ''; - - pppScript = pkgs.writeShellScript "waybar-ppp.sh" '' - set -euo pipefail - val="$(${pkgs.power-profiles-daemon}/bin/powerprofilesctl get)" - if [[ "''${val}" == "performance" ]]; then - echo $'{"text": "ppp prf"}'; - elif [[ "''${val}" == "balanced" ]]; then - echo $'{"text": "ppp bal"}'; - elif [[ "''${val}" == "power-saver" ]]; then - echo $'{"text": "ppp pwr"}'; - fi - ''; - extraModules = if config.networking.hostName != "zeph" then { } else { - "custom/rog" = { - exec = "${rogScript}"; - return-type = "json"; - interval = 10; - }; - "custom/ppp" = { - exec = "${pppScript}"; - return-type = "json"; - interval = 10; - }; - }; - # # jobpath = "/run/user/1000/srht/jobs"; - # # jobs = { - # # "niche" = "niche"; - # # "n-w" = "nixpkgs-wayland"; - # # "f-f-n" = "flake-firefox-nightly"; - # # }; - - # # suffix = pkgs.lib.mapAttrsToList (k: v: '' - # # status="$("${pkgs.jq}/bin/jq" -r '[.results[] | select(.tags=="${v}" and .status!="running" and .status!="cancelled")][0] | .status' "${jobpath}/data")" - # # echo "{\"text\":\"''${status}\", \"class\":\"srht-''${status}\"}" > "${jobpath}/${v}-json" - # # '') jobs; - - # # jobsScript = pkgs.writeShellScriptBin "jobs.sh" (pkgs.lib.concatStrings ( - # # ['' - # # TOKEN=$(cat ${config.sops.secrets."srht-pat".path}) - # # BUILD_HOST="https://builds.sr.ht" - # # "${pkgs.coreutils}/bin/mkdir" -p "${jobpath}" - # # "${pkgs.curl}/bin/curl" \ - # # -H "Authorization:token ''${TOKEN}" \ - # # -H "Content-Type: application/json" -X GET \ - # # "''${BUILD_HOST}/api/jobs" > "${jobpath}/data" - # # ''] ++ suffix )); - # networktoggle = pkgs.writeShellScriptBin "networktoggle.sh" '' - # if ip link | grep wlan; then - # sudo ${pkgs.util-linux}/bin/rfkill toggle wlan - # sudo ${pkgs.systemd}/bin/networkctl reconfigure wlan0 - # ${pkgs.libnotify}/bin/notify-send "toggled wlan0" - # else - # ${pkgs.libnotify}/bin/notify-send "no wlan to toggle" - # fi - # ''; -in { - config = { - # sops.secrets."srht-pat" = { - # owner = "cole"; - # group = "cole"; - # }; + programs.waybar = { + enable = true; + package = repoFlake.inputs.nixpkgs-wayland.outputs.packages.${pkgs.stdenv.hostPlatform.system}.waybar; + # style = pkgs.lib.readFile ./waybar.css; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "bottom"; + height = 30; + output = ["*"]; + # output = [ + # "eDP-1" + # "DP-*" + # ]; - home-manager.users.cole = { pkgs, ... }: { - # systemd.user.services."srht-jobs-status" = { - # Unit.Description = "check srht-jobs status"; - # Service = { - # Type = "oneshot"; - # ExecStart = "${jobsScript}/bin/jobs.sh"; - # }; - # }; - # systemd.user.timers."srht-jobs-status" = { - # Unit.Description = "check srht jobs status"; - # Timer = { OnBootSec = "1m"; OnUnitInactiveSec = "1m"; Unit = "srht-jobs-status.service"; }; - # Install.WantedBy = [ "default.target" ]; - # # { - # # wantedBy = [ "timers.target" ]; - # # partOf = [ "srht-${repo}.service" ]; - # # timerConfig.OnCalendar = "hourly"; - # # } - # }; - home.packages = [ pkgs.libappindicator-gtk3 ]; - programs.waybar = { - enable = true; - package = inputs.nixpkgs-wayland.outputs.packages.${pkgs.stdenv.hostPlatform.system}.waybar; - style = pkgs.lib.readFile ./waybar.css; - systemd.enable = true; - settings = [{ - # ipc = true; - layer = "top"; - # position = "top"; - modules-left = [ - "sway/mode" - "sway/workspaces" - ]; - modules-center = [ - "wlr/workspaces" - ]; - modules-right = [ - # "keyboard-state" - # "idle_inhibitor" - "pulseaudio" - "backlight" - "tray" - ] - ++ (builtins.attrNames extraModules) - ++ [ - "cpu" - "memory" - "network" - "temperature" - "battery" - "clock" - "clock#date" - ]; + modules-left = [ + "sway/workspaces" + "sway/mode" + # "wlr/taskbar" + ]; - modules = ({ - "sway/workspaces" = { - all-outputs = true; - disable-scroll-wraparound = true; - #enable-bar-scroll = true; - }; - "sway/mode" = { tooltip = false; }; + "sway/workspaces" = { + disable-scroll = true; + all-outputs = false; + }; + modules-center = [ + "sway/window" + # "custom/hello-from-waybar" + ]; - # # TODO: - # keyboard-state = { - # "numlock" = true; - # "capslock" = true; - # "format" = "{name} {icon}"; - # "format-icons" = { - # "locked" = "+"; - # "unlocked" = "-"; - # }; - # }; - "wlr/taskbar" = { }; - temperature = { - format = "tmp {temperatureC}"; - }; - idle_inhibitor = { - format = "iil {icon}"; - format-icons = { - activated = "[x]"; - deactivated = "[ ]"; - }; - }; - pulseaudio = { - format = "vol {volume}"; - on-click-middle = "${pkgs.sway}/bin/swaymsg exec \"${pkgs.pavucontrol}/bin/pavucontrol\""; - }; - network = { - format-wifi = "net {signalStrength}"; - format-ethernet = "eth"; - }; - cpu.interval = 2; - cpu.format = "cpu {usage}"; - memory.format = "mem {}"; - backlight = { - format = "nit {percent}"; - on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl set 2%+"; - on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl set 2%-"; - }; - tray.spacing = 10; - # battery - clock = { - format = "{:%d %b %Y}"; - }; - "clock#date" = { - format = "{:%H:%M %p}"; - }; - battery = { - format = "bat {}"; - states = { - warning = 25; - critical = 15; - }; - }; - } // extraModules); - }]; + modules-right = [ + "tray" + + "cpu" + "memory" + "temperature" + "custom/fan" + "battery" + "pulseaudio" + "clock" + "clock#date" + ]; + + tray.spacing = 10; + + cpu.format = " {}%"; + memory.format = " {}%"; + "temperature" = { + hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input"; + format = " {temperatureC} °C"; + }; + "custom/fan" = { + + format = "  {} rpm "; + exec = "${pkgs.lm_sensors}/bin/sensors | ${pkgs.gawk}/bin/awk '/fan1:/ {print $2}'"; + interval = 5; + }; + battery.format = "🔋 {}%"; + pulseaudio = { + format = "🔉 {volume}%"; + # on-click-middle = ''${pkgs.sway}/bin/swaymsg exec "${pkgs.pavucontrol}/bin/pavucontrol"''; + }; + "clock#date".format = "{:%d %b %Y}"; + clock.format = "{:%H:%M %p}"; + + # "custom/hello-from-waybar" = { + # format = "hello {}"; + # max-length = 40; + # interval = "once"; + # exec = pkgs.writeShellScript "hello-from-waybar" '' + # echo "from within waybar" + # ''; + # }; }; }; }; diff --git a/nix/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index 0e1528f..6f8eaee 100644 --- a/nix/home-manager/programs/zsh.nix +++ b/nix/home-manager/programs/zsh.nix @@ -74,7 +74,7 @@ in { # don't cd into directories when executed unsetopt AUTO_CD - export NIX_PATH="${pkgs.path}" + export NIX_PATH="nixpkgs=${pkgs.path}" # print lines without termination setopt PROMPT_CR diff --git a/nix/modules/flake-parts/perSystem/default.nix b/nix/modules/flake-parts/perSystem/default.nix index 1339db8..a752173 100644 --- a/nix/modules/flake-parts/perSystem/default.nix +++ b/nix/modules/flake-parts/perSystem/default.nix @@ -23,7 +23,7 @@ pip virtualenv cffi - pyopenssl + # pyopenssl urllib3 # mistune (insecure) sympy diff --git a/nix/os/cachix.nix b/nix/os/cachix.nix index cce90a3..332fc55 100644 --- a/nix/os/cachix.nix +++ b/nix/os/cachix.nix @@ -9,6 +9,6 @@ let imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); in { inherit imports; - nix.binaryCaches = ["https://cache.nixos.org/"]; + nix.settings.substituters = ["https://cache.nixos.org/"]; } - \ No newline at end of file + diff --git a/nix/os/cachix/nixpkgs-wayland.nix b/nix/os/cachix/nixpkgs-wayland.nix index aa9f600..e370450 100644 --- a/nix/os/cachix/nixpkgs-wayland.nix +++ b/nix/os/cachix/nixpkgs-wayland.nix @@ -1,12 +1,12 @@ { nix = { - binaryCaches = [ + settings.substituters = [ "https://nixpkgs-wayland.cachix.org" ]; - binaryCachePublicKeys = [ + settings.trusted-public-keys = [ "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" ]; }; } - \ No newline at end of file + diff --git a/nix/os/devices/elias-e525/configuration.nix b/nix/os/devices/elias-e525/configuration.nix index 37f4c61..8974207 100644 --- a/nix/os/devices/elias-e525/configuration.nix +++ b/nix/os/devices/elias-e525/configuration.nix @@ -2,6 +2,7 @@ imports = [ ../../profiles/common/configuration.nix ../../profiles/graphical/configuration.nix + ../../profiles/graphical-gnome-xorg.nix ../../modules/opinionatedDisk.nix ./system.nix diff --git a/nix/os/devices/justyna-p300/configuration.nix b/nix/os/devices/justyna-p300/configuration.nix index 44f116d..f2cb3f7 100644 --- a/nix/os/devices/justyna-p300/configuration.nix +++ b/nix/os/devices/justyna-p300/configuration.nix @@ -2,6 +2,7 @@ imports = [ ../../profiles/common/configuration.nix ../../profiles/graphical/configuration.nix + ../../profiles/graphical-gnome-xorg.nix ./system.nix ./hw.nix diff --git a/nix/os/devices/steveej-pa600/pkg.nix b/nix/os/devices/steveej-pa600/pkg.nix index 9897dc2..1db742a 100644 --- a/nix/os/devices/steveej-pa600/pkg.nix +++ b/nix/os/devices/steveej-pa600/pkg.nix @@ -10,6 +10,5 @@ home-manager.users.steveej = import ../../../home-manager/configuration/graphical-fullblown.nix { inherit pkgs; }; - services.teamviewer.enable = true; system.stateVersion = "20.09"; } diff --git a/nix/os/devices/steveej-t14/configuration.nix b/nix/os/devices/steveej-t14/configuration.nix index d710849..8a2785c 100644 --- a/nix/os/devices/steveej-t14/configuration.nix +++ b/nix/os/devices/steveej-t14/configuration.nix @@ -3,6 +3,7 @@ ../../profiles/common/configuration.nix ../../profiles/graphical/configuration.nix ../../modules/opinionatedDisk.nix + ../../cachix.nix ./system.nix ./hw.nix diff --git a/nix/os/devices/steveej-t14/default.nix b/nix/os/devices/steveej-t14/default.nix index fb517e4..be964d0 100644 --- a/nix/os/devices/steveej-t14/default.nix +++ b/nix/os/devices/steveej-t14/default.nix @@ -5,18 +5,25 @@ nodeFlake = repoFlake.inputs.get-flake ./.; in { meta.nodeSpecialArgs.${nodeName} = { - inherit nodeName nodeFlake; + inherit repoFlake nodeName nodeFlake; packages' = repoFlake.packages.${system}; }; meta.nodeNixpkgs.${nodeName} = import nodeFlake.inputs.nixpkgs.outPath { inherit system; + overlays = [ + (final: prev: { + # FIXME: why are these not effective in for the configuration.nix below? + xdg-desktop-portal-wlr' = repoFlake.inputs.nixpkgs-wayland.packages.${system}.xdg-desktop-portal-wlr; + xdg-desktop-portal-wlr-gtk' = repoFlake.inputs.nixpkgs-wayland.packages.${system}.xdg-desktop-portal-wlr-gtk; + }) + ]; }; ${nodeName} = { deployment.targetHost = nodeName; deployment.replaceUnknownProfiles = false; - # deployment.allowLocalDeployment = true; + deployment.allowLocalDeployment = true; imports = [ (repoFlake + "/nix/os/devices/${nodeName}/configuration.nix") diff --git a/nix/os/devices/steveej-t14/flake.lock b/nix/os/devices/steveej-t14/flake.lock index 549ce7a..f6146d9 100644 --- a/nix/os/devices/steveej-t14/flake.lock +++ b/nix/os/devices/steveej-t14/flake.lock @@ -37,13 +37,29 @@ "type": "github" } }, - "nixpkgs-master": { + "nixpkgs-2211": { "locked": { - "lastModified": 1684756366, - "narHash": "sha256-aua/NybNHOJdZ0whu2qRfFOFqgjVUZ65D4xg3i3nZS0=", + "lastModified": 1684580438, + "narHash": "sha256-LUPswmDn6fXP3lEBJFA2Id8PkcYDgzUilevWackYVvQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e8d32cbe6678eb66f8def22cce43422c4b64957f", + "rev": "7dc71aef32e8faf065cb171700792cf8a65c152d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-master": { + "locked": { + "lastModified": 1684758073, + "narHash": "sha256-LFm53sqiZoWRMNPjIDhqJvXgCcdsmMw7rbSZFhLRuJw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f491fc656a0b48c40e0312d559380d4ad46c4447", "type": "github" }, "original": { @@ -73,6 +89,7 @@ "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", + "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-master": "nixpkgs-master", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/nix/os/devices/steveej-t14/flake.nix b/nix/os/devices/steveej-t14/flake.nix index afa9ddd..4a0905c 100644 --- a/nix/os/devices/steveej-t14/flake.nix +++ b/nix/os/devices/steveej-t14/flake.nix @@ -1,4 +1,5 @@ { + inputs.nixpkgs-2211.url = "github:nixos/nixpkgs/nixos-22.11"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small"; inputs.nixpkgs-master.url = "github:nixos/nixpkgs/master"; diff --git a/nix/os/devices/steveej-t14/pkg.nix b/nix/os/devices/steveej-t14/pkg.nix index ab5da65..b52eff3 100644 --- a/nix/os/devices/steveej-t14/pkg.nix +++ b/nix/os/devices/steveej-t14/pkg.nix @@ -1,4 +1,4 @@ -{pkgs, lib, ...}: { +{pkgs, lib, repoFlake, nodeFlake, ...}: { home-manager.users.steveej = _: { imports = [ ../../../home-manager/configuration/graphical-fullblown.nix @@ -11,89 +11,122 @@ ]; }; -# TODO: delegate graphical session to home-manager config (mostly) - -# FIXME: move this to home-manager entirely -# programs.sway.enable = true; -# programs.sway.package = null; - -services.xserver = { - enable = lib.mkForce false; - - desktopManager = { - gnome.enable = lib.mkForce false; - xterm.enable = lib.mkForce false; - - # FIXME: gnome should be moved to user session - # gnome.enable = true; - # xterm.enable = true; - }; - - displayManager = { - # gdm.enable = lib.mkForce false; - - # FIXME: does the home-manager session have an explicit name? - # defaultSession = "xterm"; - - # autoLogin = { - # enable = true; - # user = "steveej"; - # }; - - # session = [ - # { - # manage = "desktop"; - # name = "xsession"; - # start = ""; - # } - # ]; - }; -}; - -services.greetd = - let - # exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" - swayConfig = pkgs.writeText "greetd-sway-config" '' - # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. - exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK; ${pkgs.greetd.regreet}/bin/regreet; swaymsg exit" - bindsym Mod4+shift+e exec swaynag \ - -t warning \ - -m 'What do you want to do?' \ - -b 'Poweroff' 'systemctl poweroff' \ - -b 'Reboot' 'systemctl reboot' - ''; - in { - enable = true; - settings = { - vt = 1; - default_session = { - command = "${pkgs.sway}/bin/sway --config ${swayConfig}"; + # TODO: fix the following errors with regreet + # + # Failed to create /var/empty/.cache for shader cache (Operation not permitted)---disabling. + # amdgpu: amdgpu_cs_ctx_create2 failed. (-13) + # Failed to create /var/empty/.cache for shader cache (Operation not permitted)---disabling. + # ERROR: Couldn't create log file '/var/log/regreet/log': Permission denied (os error 13) + # 2023-05-22T10:31:42.52900769+02:00 WARN regreet::tomlutils: Missing TOML file: /var/cache/regreet/cache.toml + # 2023-05-22T10:31:42.52902325+02:00 WARN regreet::tomlutils: Missing TOML file: /etc/greetd/regreet.toml + # + # (regreet:505614): Gtk-WARNING **: 10:31:42.532: Theme parser warning: :6:17-18: Empty declaration + # Failed to create /var/empty/.cache for shader cache (Operation not permitted)---disabling. + services.greetd = + let + # exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" + swayConfig = pkgs.writeText "greetd-sway-config" '' + # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. + exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK; ${pkgs.greetd.regreet}/bin/regreet; swaymsg exit" + bindsym Mod4+shift+e exec swaynag \ + -t warning \ + -m 'What do you want to do?' \ + -b 'Poweroff' 'systemctl poweroff' \ + -b 'Reboot' 'systemctl reboot' + ''; + in { + enable = false; + settings = { + vt = 1; + default_session = { + command = "${pkgs.sway}/bin/sway --config ${swayConfig}"; + }; }; }; - }; environment.etc."greetd/environments".text = '' sway - jay ''; + # fonts = let + # prefs.font = rec { + # size = 13; + # default = sans; + + # sans = { family = "Noto Sans"; package = pkgs.noto-fonts; }; + # serif = { family = "Noto Serif"; package = pkgs.noto-fonts; }; + # # monospace = { family = "Iosevka Fixed"; package = pkgs.iosevka-bin; }; + # monospace = { family = "Iosevka Comfy Fixed"; package = pkgs.iosevka-comfy.comfy-fixed; }; + # # monospace = { family = "Go Mono"; package = pkgs.go-font; }; + # # monospace = { family = "Jetbrains Mono"; package = pkgs.jetbrains-mono; }; + # fallback = { family = "Font Awesome 5 Free"; package = pkgs.font-awesome; }; + # emoji = { family = "Noto Color Emoji"; package = pkgs.noto-fonts-emoji; }; + # + # allPackages = (map (p: p.package) + # [ + # default + # sans + # serif + # monospace + # fallback + # emoji + # ]) ++ + # (with pkgs; [ + # liberation_ttf # free corefonts-metric-compatible replacement + # ttf_bitstream_vera + # gelasio # metric-compatible with Georgia + # powerline-symbols + # ]); + # }; + # in { + # # fonts = prefs.font.allPackages; + + # # fontconfig = { + # # enable = true; + # # defaultFonts = { + # # serif = [ prefs.font.serif.family ]; + # # sansSerif = [ prefs.font.sans.family ]; + # # monospace = [ prefs.font.monospace.family ]; + # # emoji = [ prefs.font.emoji.family ]; + # # }; + # # }; + # }; + + security.pam.services.getty.enableGnomeKeyring = true; + services.gnome.gnome-keyring.enable = true; + + # rtkit is optional but recommended + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + }; + # required by swaywm security.polkit.enable = true; - security.pam.services.swaylock = { }; - services.teamviewer.enable = false; - system.stateVersion = "20.09"; + # test these on https://mozilla.github.io/webrtc-landing/gum_test.html + xdg.portal = { + enable = true; + # FIXME: `true` breaks xdg-open from alacritty: + # $ xdg-open "https://github.com/" + # Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop + xdgOpenUsePortal = false; + extraPortals = [ + pkgs.xdg-desktop-portal-wlr + pkgs.xdg-desktop-portal-gtk + # repoFlake.inputs.nixpkgs-wayland.packages.${pkgs.system}.xdg-desktop-portal-wlr + # (pkgs.xdg-desktop-portal-gtk.override (_: { + # buildPortalsInGnome = false; + # })) + ]; + }; - # TODO: move this into home-manager - environment.systemPackages = with pkgs.gnomeExtensions; [ - pop-shell - vitals - soft-brightness - - # TODO: currently not compatible - # window-switcher-current-workspace-first - # mmod-panel - ]; + system.stateVersion = "23.05"; } diff --git a/nix/os/devices/steveej-t14/system.nix b/nix/os/devices/steveej-t14/system.nix index 16b6421..5f7fbf8 100644 --- a/nix/os/devices/steveej-t14/system.nix +++ b/nix/os/devices/steveej-t14/system.nix @@ -7,19 +7,19 @@ }: let passwords = import ../../../variables/passwords.crypt.nix; in { - nix = { - binaryCaches = [ + nix.settings = { + substituters = [ "https://holochain-ci.cachix.org" # "https://cache.holo.host/" ]; - binaryCachePublicKeys = [ + trusted-public-keys = [ "holochain-ci.cachix.org-1:5IUSkZc0aoRS53rfkvH9Kid40NpyjwCMCzwRTXy+QN8=" # "cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE=" # "cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ=" ]; - settings.extra-experimental-features = ["impure-derivations"]; - settings.system-features = ["recursive-nix"]; + extra-experimental-features = ["impure-derivations"]; + system-features = ["recursive-nix"]; }; networking.bridges."virbr1".interfaces = []; diff --git a/nix/os/profiles/common/pkg.nix b/nix/os/profiles/common/pkg.nix index 5810dcc..7a726eb 100644 --- a/nix/os/profiles/common/pkg.nix +++ b/nix/os/profiles/common/pkg.nix @@ -1,7 +1,7 @@ { - flake, pkgs, # these come in via nodeSpecialArgs and are expected to be defined for every node + repoFlake, nodeFlake, packages', ... @@ -19,6 +19,7 @@ # hence, opt for passing the arguments selectively instead home-manager.extraSpecialArgs = { inherit + repoFlake packages' nodeFlake ; diff --git a/nix/os/profiles/graphical-gnome-xorg.nix b/nix/os/profiles/graphical-gnome-xorg.nix index e69de29..8cf3c58 100644 --- a/nix/os/profiles/graphical-gnome-xorg.nix +++ b/nix/os/profiles/graphical-gnome-xorg.nix @@ -0,0 +1,106 @@ +{ + pkgs, + lib, + ... +}: { + services.xserver = { + enable = true; + libinput.enable = true; + libinput.touchpad.naturalScrolling = true; + + videoDrivers = [ + "qxl" + "modesetting" + "ati" + "cirrus" + "intel" + "vesa" + "vmware" + "modesetting" + ]; + layout = "us"; + xkbVariant = "altgr-intl"; + xkbOptions = "nodeadkeys"; + + desktopManager = { + # FIXME: gnome should be moved to user session + gnome.enable = true; + + xterm.enable = true; + plasma5.enable = false; + }; + + displayManager = { + gdm.enable = true; + gdm.wayland = true; + }; + }; + + + # gnome, most of it is disabled and ideally it could live entirely in the user's home config + programs.gpaste.enable = false; + programs.gnome-terminal.enable = false; + # programs.gnome-documents.enable = false; + programs.gnome-disks.enable = false; + + # TODO: fully delegate graphical session to home-manager config + services.gnome = { + gnome-online-miners.enable = lib.mkForce false; + games.enable = false; + gnome-remote-desktop.enable = false; + gnome-user-share.enable = false; + rygel.enable = false; + sushi.enable = false; + tracker.enable = false; + tracker-miners.enable = false; + + gnome-browser-connector.enable = false; + gnome-initial-setup.enable = false; + + # FIXME: gnome should be moved to home config + gnome-settings-daemon.enable = true; + core-os-services.enable = true; + at-spi2-core.enable = true; + evolution-data-server.enable = true; + gnome-online-accounts.enable = true; + gnome-keyring.enable = lib.mkForce false; + }; + + # FIXME: gnome should be moved to user session + services.gvfs.enable = true; + programs.seahorse.enable = true; + programs.dconf.enable = true; + + environment.gnome.excludePackages = + (with pkgs; [ + orca + gnome-photos + gnome-tour + ]) + ++ (with pkgs.gnome; [ + cheese # webcam tool + gnome-music + gnome-terminal + gedit # text editor + epiphany # web browser + geary # email reader + evince # document viewer + gnome-characters + totem # video player + tali # poker game + iagno # go game + hitori # sudoku game + atomix # puzzle game + ]); + + hardware.pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + support32Bit = true; + }; + + services.dbus.packages = with pkgs; [dconf]; + + # More Services + environment.systemPackages = [pkgs.gnome.adwaita-icon-theme pkgs.gnomeExtensions.appindicator]; +} diff --git a/nix/os/profiles/graphical/system.nix b/nix/os/profiles/graphical/system.nix index 14d1f3c..72c13c1 100644 --- a/nix/os/profiles/graphical/system.nix +++ b/nix/os/profiles/graphical/system.nix @@ -18,111 +18,16 @@ services.resolved.enable = true; + # hardware related services services.illum.enable = true; services.pcscd.enable = false; - hardware = { - bluetooth.enable = true; - pulseaudio = { - enable = true; - package = pkgs.pulseaudioFull; - support32Bit = true; - }; - }; + hardware.opengl.enable = true; + hardware.bluetooth.enable = true; # required for running blueman-applet in user sessions - services.dbus.packages = with pkgs; [blueman dconf]; + services.dbus.packages = with pkgs; [blueman]; services.blueman.enable = true; - services.xserver = { - enable = true; - libinput.enable = true; - libinput.touchpad.naturalScrolling = true; - - videoDrivers = [ - "qxl" - "modesetting" - "ati" - "cirrus" - "intel" - "vesa" - "vmware" - "modesetting" - ]; - layout = "us"; - xkbVariant = "altgr-intl"; - xkbOptions = "nodeadkeys"; - - desktopManager = { - # FIXME: gnome should be moved to user session - gnome.enable = true; - - xterm.enable = true; - plasma5.enable = false; - }; - - displayManager = { - gdm.enable = true; - gdm.wayland = true; - }; - }; - - # gnome, most of it is disabled and ideally it could live entirely in the user's home config - programs.gpaste.enable = false; - programs.gnome-terminal.enable = false; - # programs.gnome-documents.enable = false; - programs.gnome-disks.enable = false; - - services.gnome = { - gnome-online-miners.enable = lib.mkForce false; - games.enable = false; - gnome-remote-desktop.enable = false; - gnome-user-share.enable = false; - rygel.enable = false; - sushi.enable = false; - tracker.enable = false; - tracker-miners.enable = false; - - gnome-browser-connector.enable = false; - gnome-initial-setup.enable = false; - - # FIXME: gnome should be moved to home config - gnome-settings-daemon.enable = true; - core-os-services.enable = true; - at-spi2-core.enable = true; - evolution-data-server.enable = true; - gnome-online-accounts.enable = true; - gnome-keyring.enable = lib.mkForce false; - }; - - # FIXME: gnome should be moved to user session - services.gvfs.enable = true; - programs.seahorse.enable = true; - programs.dconf.enable = true; - - environment.gnome.excludePackages = - (with pkgs; [ - orca - gnome-photos - gnome-tour - ]) - ++ (with pkgs.gnome; [ - cheese # webcam tool - gnome-music - gnome-terminal - gedit # text editor - epiphany # web browser - geary # email reader - evince # document viewer - gnome-characters - totem # video player - tali # poker game - iagno # go game - hitori # sudoku game - atomix # puzzle game - ]); - - # More Services - environment.systemPackages = [pkgs.gnome.adwaita-icon-theme pkgs.gnomeExtensions.appindicator]; services.udev.packages = [pkgs.libu2f-host pkgs.yubikey-personalization pkgs.android-udev-rules]; services.udev.extraRules = '' # OnePlusOne