diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..e30cdfc --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,12 @@ +keys: + - &users: + - &glwbr age1cqrg22g9gzas55xna8wup9yaymd3vwsj07mdknhchmfezfsvqqeqx7qw7a + # - &glwbr F2958A358360AB1FD9ACAE112CEB532115AD1913 + - &hosts: + - &zion age1vq7z3ahkgj4k26ttuanmtkhc6a5ugn8e6qc7epfhgky4hthx8v9squ3zlu +creation_rules: + - path_regex: hosts/shared/secrets.(ya?ml|json)$ + key_groups: + - age: + - *glwbr + - *zion diff --git a/flake.lock b/flake.lock index b9499c0..dab0f7a 100644 --- a/flake.lock +++ b/flake.lock @@ -19,175 +19,177 @@ "type": "github" } }, - "agenix": { + "base16": { "inputs": { - "darwin": "darwin", - "home-manager": [ - "hm" - ], - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_2" + "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1712079060, - "narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=", - "owner": "ryantm", - "repo": "agenix", - "rev": "1381a759b205dff7a6818733118d02253340fd5e", + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", "type": "github" }, "original": { - "owner": "ryantm", - "repo": "agenix", + "owner": "SenchoPens", + "repo": "base16.nix", "type": "github" } }, - "ags": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, + "base16-fish": { + "flake": false, "locked": { - "lastModified": 1713301451, - "narHash": "sha256-LzYVqEukjOJjm4HGFe6rtHBiuJxAyPqd2MY1k5ci9QU=", - "owner": "Aylur", - "repo": "ags", - "rev": "33bcaf34d5277031ecb97047fb8ddd44abd8d80e", + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", "type": "github" }, "original": { - "owner": "Aylur", - "repo": "ags", + "owner": "tomyun", + "repo": "base16-fish", "type": "github" } }, - "anyrun": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": [ - "nixpkgs" - ] - }, + "base16-foot": { + "flake": false, "locked": { - "lastModified": 1713259062, - "narHash": "sha256-WTO84hUL8IlNuHDK2yOCeJ38EewFzGt5E0kzBjNWxa8=", - "owner": "Kirottu", - "repo": "anyrun", - "rev": "f9d30e34fa4ccb2797c6becec37e8bcff6585d39", + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "base16-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", "type": "github" }, "original": { - "owner": "Kirottu", - "repo": "anyrun", + "owner": "tinted-theming", + "repo": "base16-foot", "type": "github" } }, - "crane": { - "inputs": { - "nixpkgs": "nixpkgs_8" + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1696727917, + "narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb", + "type": "github" }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-kitty": { + "flake": false, "locked": { - "lastModified": 1712681629, - "narHash": "sha256-bMDXn4AkTXLCpoZbII6pDGoSeSe9gI87jxPsHRXgu/E=", - "owner": "ipetkov", - "repo": "crane", - "rev": "220387ac8e99cbee0ca4c95b621c4bc782b6a235", + "lastModified": 1665001328, + "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", + "owner": "kdrag0n", + "repo": "base16-kitty", + "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", "type": "github" }, "original": { - "owner": "ipetkov", - "repo": "crane", + "owner": "kdrag0n", + "repo": "base16-kitty", "type": "github" } }, - "cranix": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_9" + "base16-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "base16-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" }, + "original": { + "owner": "tinted-theming", + "repo": "base16-tmux", + "type": "github" + } + }, + "base16-vim": { + "flake": false, "locked": { - "lastModified": 1705985690, - "narHash": "sha256-O5l2+lryVuT8ByokNrpv+NJreFKTt1jIIwdNg4kHAxI=", - "owner": "Lemin-n", - "repo": "cranix", - "rev": "2af6b2e71577bb8836b10e28f3267f2c5342a8fd", + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", "type": "github" }, "original": { - "owner": "Lemin-n", - "repo": "cranix", - "rev": "2af6b2e71577bb8836b10e28f3267f2c5342a8fd", + "owner": "tinted-theming", + "repo": "base16-vim", "type": "github" } }, - "darwin": { + "devshell": { "inputs": { + "flake-utils": "flake-utils_2", "nixpkgs": [ - "agenix", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", + "owner": "numtide", + "repo": "devshell", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", "type": "github" }, "original": { - "owner": "lnl7", - "ref": "master", - "repo": "nix-darwin", + "owner": "numtide", + "repo": "devshell", "type": "github" } }, - "fenix": { + "disko": { "inputs": { - "nixpkgs": "nixpkgs_10", - "rust-analyzer-src": "rust-analyzer-src" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1712643814, - "narHash": "sha256-5ITUWXf8klUGMSVsI5sWYlkMi9F1Pnx/8SmKe2Oo4YQ=", + "lastModified": 1718846788, + "narHash": "sha256-9dtXYtEkmXoUJV+PGLqscqF7qTn4AIhAKpFWRFU2NYs=", "owner": "nix-community", - "repo": "fenix", - "rev": "6f702a6dc8db259225a2f34510c077fe33c1f52e", + "repo": "disko", + "rev": "e1174d991944a01eaaa04bc59c6281edca4c0e6e", "type": "github" }, "original": { "owner": "nix-community", - "repo": "fenix", + "repo": "disko", "type": "github" } }, - "firefox-addons": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ] - }, + "flake-compat": { "locked": { - "dir": "pkgs/firefox-addons", - "lastModified": 1713391754, - "narHash": "sha256-QLBgfsuz0scSkzfimFJmjiNgci/m+2G5auX200ZCXVY=", - "owner": "rycee", - "repo": "nur-expressions", - "rev": "e1c5b3afa99244cfd46d28ff24c7f40f4d03b7a9", - "type": "gitlab" + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" }, "original": { - "dir": "pkgs/firefox-addons", - "owner": "rycee", - "repo": "nur-expressions", - "type": "gitlab" + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat": { + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -203,14 +205,14 @@ "type": "github" } }, - "flake-compat_2": { + "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -222,16 +224,15 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "anyrun", "nixpkgs" ] }, "locked": { - "lastModified": 1696343447, - "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -243,15 +244,16 @@ "flake-parts_2": { "inputs": { "nixpkgs-lib": [ + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -279,12 +281,15 @@ } }, "flake-utils_2": { + "inputs": { + "systems": "systems_8" + }, "locked": { - "lastModified": 1629284811, - "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -295,7 +300,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_11" + "systems": "systems_9" }, "locked": { "lastModified": 1685518550, @@ -315,24 +320,6 @@ "inputs": { "systems": "systems_12" }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { - "inputs": { - "systems": "systems_13" - }, "locked": { "lastModified": 1710146030, "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", @@ -347,46 +334,54 @@ "type": "github" } }, - "flake-utils_6": { - "inputs": { - "systems": "systems_16" - }, + "fromYaml": { + "flake": false, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "SenchoPens", + "repo": "fromYaml", "type": "github" } }, - "fu": { + "git-hooks": { "inputs": { - "systems": "systems_3" + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, "gitignore": { "inputs": { "nixpkgs": [ - "pre-commit-hooks", + "nixvim", + "git-hooks", "nixpkgs" ] }, @@ -404,6 +399,23 @@ "type": "github" } }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "46.1", + "repo": "gnome-shell", + "type": "github" + } + }, "hm": { "inputs": { "nixpkgs": [ @@ -411,11 +423,53 @@ ] }, "locked": { - "lastModified": 1713391096, - "narHash": "sha256-5xkzsy+ILgQlmvDDipL5xqAehnjWBenAQXV4/NLg2dE=", + "lastModified": 1718788307, + "narHash": "sha256-SqiOz0sljM0GjyQEVinPXQxaGcbOXw5OgpCWGPgh/vo=", "owner": "nix-community", "repo": "home-manager", - "rev": "f46814ec7cbef9c2aef18ca1cbe89f2bb1e8c394", + "rev": "d7830d05421d0ced83a0f007900898bdcaf2a2ca", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1718526747, + "narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "type": "github" }, "original": { @@ -440,11 +494,11 @@ ] }, "locked": { - "lastModified": 1713214463, - "narHash": "sha256-zAOOjqHAbccCRgJSuvTCA0FNLqKswN63LgVo43R7pxw=", + "lastModified": 1718450675, + "narHash": "sha256-jpsns6buS4bK+1sF8sL8AaixAiCRjA+nldTKvcwmvUs=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "0a53b9957f0b17f1a0036b25198f569969ad43a0", + "rev": "66d5b46ff94efbfa6fa3d1d1b66735f1779c34a6", "type": "github" }, "original": { @@ -453,39 +507,18 @@ "type": "github" } }, - "hyprfocus": { - "inputs": { - "hyprland": [ - "hyprland" - ], - "nix-filter": "nix-filter" - }, - "locked": { - "lastModified": 1712965597, - "narHash": "sha256-QCmFRWM2dBEWvMtbSTpb5hQ830GdiEIDv70dydp969s=", - "owner": "pyt0xic", - "repo": "hyprfocus", - "rev": "0bf15a1492e8aaaaa4719b35b68dfbb7b806a31b", - "type": "github" - }, - "original": { - "owner": "pyt0xic", - "repo": "hyprfocus", - "type": "github" - } - }, "hypridle": { "inputs": { "hyprlang": "hyprlang", "nixpkgs": "nixpkgs_2", - "systems": "systems_5" + "systems": "systems_3" }, "locked": { - "lastModified": 1713335726, - "narHash": "sha256-znkNLAy3qRC4BNaA5AlcWNLyVsTBogN9pVqpkNqskSU=", + "lastModified": 1716309977, + "narHash": "sha256-4jDQIcMDSFOOMBxVTEiC6Ck1vdc0kAFvv+StxnnE59Q=", "owner": "hyprwm", "repo": "hypridle", - "rev": "eb916db19cffd20fc184fc3110a0a8f1860abf5c", + "rev": "cb169c4e06cec9b4349e3668427e729d22328a54", "type": "github" }, "original": { @@ -497,64 +530,48 @@ "hyprland": { "inputs": { "hyprcursor": "hyprcursor", - "hyprland-protocols": "hyprland-protocols", "hyprlang": "hyprlang_2", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_3", - "systems": "systems_6", - "wlroots": "wlroots", + "systems": "systems_4", "xdph": "xdph" }, "locked": { - "lastModified": 1713376910, - "narHash": "sha256-6cvw+CxacXe+l8/mZ1+ih21vLHvhIC+Erc7LQF0dyrQ=", - "owner": "hyprwm", - "repo": "Hyprland", - "rev": "82222342f10a7eff0ec9be972153e740d0f95213", - "type": "github" + "lastModified": 1718835324, + "narHash": "sha256-U5eKTPAXppfSIqKqMIgbyuTBy1gr2seSOUl8sUSR8FE=", + "ref": "refs/heads/main", + "rev": "fabc30df52ab5d2c369fc8acd4ff909a6ba3b8ac", + "revCount": 4870, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" }, "original": { - "owner": "hyprwm", - "repo": "Hyprland", - "type": "github" - } - }, - "hyprland-contrib": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712505318, - "narHash": "sha256-fzlBLhXUN6y7mzEtcGNRDXxFakBEfaj4Bmj5PuoCNaM=", - "owner": "hyprwm", - "repo": "contrib", - "rev": "5870244b592c22558b658dbaf94f9e41afb0316f", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "contrib", - "type": "github" + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" } }, "hyprland-protocols": { "inputs": { "nixpkgs": [ "hyprland", + "xdph", "nixpkgs" ], "systems": [ "hyprland", + "xdph", "systems" ] }, "locked": { - "lastModified": 1691753796, - "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "lastModified": 1714869498, + "narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "rev": "e06482e0e611130cd1929f75e8c1cf679e57d161", "type": "github" }, "original": { @@ -575,11 +592,11 @@ ] }, "locked": { - "lastModified": 1691753796, - "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "lastModified": 1714869498, + "narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "rev": "e06482e0e611130cd1929f75e8c1cf679e57d161", "type": "github" }, "original": { @@ -594,7 +611,7 @@ "hypridle", "nixpkgs" ], - "systems": "systems_4" + "systems": "systems_2" }, "locked": { "lastModified": 1713121246, @@ -612,6 +629,10 @@ }, "hyprlang_2": { "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -622,11 +643,11 @@ ] }, "locked": { - "lastModified": 1713121246, - "narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", + "lastModified": 1717881852, + "narHash": "sha256-XeeVoKHQgfKuXoP6q90sUqKyl7EYy3ol2dVZGM+Jj94=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", + "rev": "ec6938c66253429192274d612912649a0cfe4d28", "type": "github" }, "original": { @@ -637,18 +658,25 @@ }, "hyprlang_3": { "inputs": { + "hyprutils": [ + "hyprlock", + "hyprutils" + ], "nixpkgs": [ "hyprlock", "nixpkgs" ], - "systems": "systems_7" + "systems": [ + "hyprlock", + "systems" + ] }, "locked": { - "lastModified": 1713121246, - "narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", + "lastModified": 1717881852, + "narHash": "sha256-XeeVoKHQgfKuXoP6q90sUqKyl7EYy3ol2dVZGM+Jj94=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", + "rev": "ec6938c66253429192274d612912649a0cfe4d28", "type": "github" }, "original": { @@ -660,14 +688,14 @@ "hyprlang_4": { "inputs": { "nixpkgs": "nixpkgs_5", - "systems": "systems_9" + "systems": "systems_6" }, "locked": { - "lastModified": 1711250455, - "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", + "lastModified": 1713121246, + "narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", + "rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", "type": "github" }, "original": { @@ -678,18 +706,19 @@ }, "hyprlang_5": { "inputs": { + "hyprutils": "hyprutils_3", "nixpkgs": [ "xdg-portal-hyprland", "nixpkgs" ], - "systems": "systems_14" + "systems": "systems_10" }, "locked": { - "lastModified": 1713121246, - "narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", + "lastModified": 1717881852, + "narHash": "sha256-XeeVoKHQgfKuXoP6q90sUqKyl7EYy3ol2dVZGM+Jj94=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", + "rev": "ec6938c66253429192274d612912649a0cfe4d28", "type": "github" }, "original": { @@ -701,15 +730,16 @@ "hyprlock": { "inputs": { "hyprlang": "hyprlang_3", + "hyprutils": "hyprutils_2", "nixpkgs": "nixpkgs_4", - "systems": "systems_8" + "systems": "systems_5" }, "locked": { - "lastModified": 1713214544, - "narHash": "sha256-36qa6MOhCBd39YPC0FgapwGRHZXjstw8BQuKdFzwQ4k=", + "lastModified": 1717883389, + "narHash": "sha256-2A4Q56JFd3t9j3Xpa0kxw2fjv8nNqgNBOA34rRcLA8I=", "owner": "hyprwm", "repo": "hyprlock", - "rev": "2bce52f094c49109520ad37fc8f0d051acaace55", + "rev": "c5b8ad03d03ddbd2b0ff8615c2f6dba31374b6a8", "type": "github" }, "original": { @@ -722,14 +752,14 @@ "inputs": { "hyprlang": "hyprlang_4", "nixpkgs": "nixpkgs_6", - "systems": "systems_10" + "systems": "systems_7" }, "locked": { - "lastModified": 1712919696, - "narHash": "sha256-93zNQy4LGFP5h/GrQJctd8cPE0VdCDsWigTOx2effrE=", + "lastModified": 1717919427, + "narHash": "sha256-50HWM67p81v+dhvcOS0UFQiPGh8McUHs40UGqkz6s9I=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "02ee7ff3bbd9cba72f26be7b09dde4a89fc31c21", + "rev": "f4abf5902f3f0c51d2aab8a521f7c1b1b08afd64", "type": "github" }, "original": { @@ -738,155 +768,187 @@ "type": "github" } }, - "matugen": { + "hyprutils": { "inputs": { "nixpkgs": [ + "hyprland", "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1711657889, - "narHash": "sha256-4VX7Rt+ftEH8nwg59eT7TsvHYUf8/euUmwh/JLc4rLc=", - "owner": "InioX", - "repo": "matugen", - "rev": "566277529dadc2b149a8bd8b9859ea791ecdef26", + "lastModified": 1718804078, + "narHash": "sha256-CqRZne63BpYlPd/i8lXV0UInUt59oKogiwdVtBRHt60=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "4f1351295c55a8f51219b25aa4a6497a067989d0", "type": "github" }, "original": { - "owner": "InioX", - "repo": "matugen", + "owner": "hyprwm", + "repo": "hyprutils", "type": "github" } }, - "nix-filter": { + "hyprutils_2": { + "inputs": { + "nixpkgs": [ + "hyprlock", + "nixpkgs" + ], + "systems": [ + "hyprlock", + "systems" + ] + }, "locked": { - "lastModified": 1694857738, - "narHash": "sha256-bxxNyLHjhu0N8T3REINXQ2ZkJco0ABFPn6PIe2QUfqo=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "41fd48e00c22b4ced525af521ead8792402de0ea", + "lastModified": 1717881334, + "narHash": "sha256-a0inRgJhPL6v9v7RPM/rx1kbXdfe3xJA1c9z0ZkYnh4=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "0693f9398ab693d89c9a0aa3b3d062dd61b7a60e", "type": "github" }, "original": { - "owner": "numtide", - "repo": "nix-filter", + "owner": "hyprwm", + "repo": "hyprutils", "type": "github" } }, - "nix-index-db": { + "hyprutils_3": { "inputs": { "nixpkgs": [ + "xdg-portal-hyprland", + "hyprlang", "nixpkgs" + ], + "systems": [ + "xdg-portal-hyprland", + "hyprlang", + "systems" ] }, "locked": { - "lastModified": 1713067146, - "narHash": "sha256-9D20xjblGKEVRVCnM3qWhiizEa9i6OpK6xQJajwcwOQ=", - "owner": "Mic92", - "repo": "nix-index-database", - "rev": "93aed67288be60c9ef6133ba2f8de128f4ef265c", + "lastModified": 1717881334, + "narHash": "sha256-a0inRgJhPL6v9v7RPM/rx1kbXdfe3xJA1c9z0ZkYnh4=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "0693f9398ab693d89c9a0aa3b3d062dd61b7a60e", "type": "github" }, "original": { - "owner": "Mic92", - "repo": "nix-index-database", + "owner": "hyprwm", + "repo": "hyprutils", "type": "github" } }, - "nix-vscode-extensions": { + "hyprwayland-scanner": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils": [ - "fu" - ], "nixpkgs": [ + "hyprland", "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1713316726, - "narHash": "sha256-VIQkEgU1xUD4nEh7w3uL0xRsTYZdC7p5+v35G9wv8U0=", - "owner": "nix-community", - "repo": "nix-vscode-extensions", - "rev": "c1b75aedd50054ff43bb26ddb2702a2ac3475ea2", + "lastModified": 1718119275, + "narHash": "sha256-nqDYXATNkyGXVmNMkT19fT4sjtSPBDS1LLOxa3Fueo4=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "1419520d5f7f38d35e05504da5c1b38212a38525", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nix-vscode-extensions", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", "type": "github" } }, - "nixpkgs": { + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1705631326, - "narHash": "sha256-Ycbz1SWWoPLsrfoifMQsQ7bzoU9Da+V0BTn6AkReCzw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "959e8a2428503f2a6b0928e626d7955627a90ac6", + "lastModified": 1718662658, + "narHash": "sha256-AKG7BsqtVWDlefgzyKz7vjaKTLi4+bmTSBhowbQoZtM=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "29b3096a6e283d7e6779187244cb2a3942239fdf", "type": "github" }, "original": { - "owner": "nixos", - "repo": "nixpkgs", + "owner": "lnl7", + "repo": "nix-darwin", "type": "github" } }, - "nixpkgs-stable": { + "nix-index-db": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "lastModified": 1718507237, + "narHash": "sha256-xBEWCxWeRpWQggFFp8ugJCDa63cOJsVvx71R9F0Eowg=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "6af2c5e58c20311276f59d247341cafeebfcb6f4", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", + "owner": "Mic92", + "repo": "nix-index-database", "type": "github" } }, - "nixpkgs_10": { + "nixpkgs": { "locked": { - "lastModified": 1712439257, - "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "lastModified": 1705631326, + "narHash": "sha256-Ycbz1SWWoPLsrfoifMQsQ7bzoU9Da+V0BTn6AkReCzw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "rev": "959e8a2428503f2a6b0928e626d7955627a90ac6", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_11": { + "nixpkgs-stable": { "locked": { - "lastModified": 1712963716, - "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", + "lastModified": 1718478900, + "narHash": "sha256-v43N1gZLcGkhg3PdcrKUNIZ1L0FBzB2JqhIYEyKAHEs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", + "rev": "c884223af91820615a6146af1ae1fea25c107005", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "release-23.11", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_10": { "locked": { - "lastModified": 1701174899, - "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=", + "lastModified": 1716097317, + "narHash": "sha256-1UMrLtgzielG/Sop6gl6oTSM4pDt7rF9j9VuxhDWDlY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e", + "rev": "8535fb92661f37ff9f0da3007fbc942f7d134b41", "type": "github" }, "original": { @@ -914,11 +976,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1712963716, - "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", + "lastModified": 1718530797, + "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", + "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "type": "github" }, "original": { @@ -930,11 +992,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1712963716, - "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", + "lastModified": 1717602782, + "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", + "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", "type": "github" }, "original": { @@ -962,11 +1024,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1711163522, - "narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=", + "lastModified": 1712963716, + "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4", + "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", "type": "github" }, "original": { @@ -978,11 +1040,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1713248628, - "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", + "lastModified": 1718714799, + "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", + "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", "type": "github" }, "original": { @@ -994,11 +1056,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1712026416, - "narHash": "sha256-N/3VR/9e1NlN49p7kCiATiEY6Tzdo+CbrAG8kqCQKcI=", + "lastModified": 1714912032, + "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "080a4a27f206d07724b88da096e27ef63401a504", + "rev": "ee4a6e0f566fe5ec79968c57a9c2c3c25f2cf41d", "type": "github" }, "original": { @@ -1010,11 +1072,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1705677747, - "narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=", + "lastModified": 1718318537, + "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261", + "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", "type": "github" }, "original": { @@ -1024,76 +1086,53 @@ "type": "github" } }, - "pre-commit-hooks": { + "nixvim": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": [ - "fu" - ], - "gitignore": "gitignore", + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts_2", + "git-hooks": "git-hooks", + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1712897695, - "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", + "lastModified": 1718869672, + "narHash": "sha256-artyEBzWUsNXtYj7jBr816wRJj2Y3DYDHw6ECrQotX0=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "744dfea48bdd331e66b9e874822559fa6fae98af", "type": "github" }, "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", + "owner": "nix-community", + "repo": "nixvim", "type": "github" } }, "root": { "inputs": { "aesthetic-iosevka": "aesthetic-iosevka", - "agenix": "agenix", - "ags": "ags", - "anyrun": "anyrun", - "firefox-addons": "firefox-addons", - "flake-parts": "flake-parts_2", - "fu": "fu", + "disko": "disko", + "flake-parts": "flake-parts", "hm": "hm", - "hyprfocus": "hyprfocus", "hypridle": "hypridle", "hyprland": "hyprland", - "hyprland-contrib": "hyprland-contrib", "hyprlock": "hyprlock", "hyprpaper": "hyprpaper", - "matugen": "matugen", "nix-index-db": "nix-index-db", - "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs_7", - "pre-commit-hooks": "pre-commit-hooks", + "nixvim": "nixvim", + "sops-nix": "sops-nix", "spicetify-nix": "spicetify-nix", - "sss": "sss", + "stylix": "stylix", "xdg-portal-hyprland": "xdg-portal-hyprland", "yazi": "yazi" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1712554976, - "narHash": "sha256-ywwHmTVe46MS7mKwtYSMRYIwC7o22aHB6/FCrTfT0J8=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "7a8374c162c64c17e865b98aad282d16b16e96d6", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "rust-overlay": { "inputs": { "flake-utils": [ @@ -1106,11 +1145,11 @@ ] }, "locked": { - "lastModified": 1701224160, - "narHash": "sha256-qnMmxNMKmd6Soel0cfauyMJ+LzuZbvmiDQPSIuTbQ+M=", + "lastModified": 1716085073, + "narHash": "sha256-3+9gI93XxszWA2+9S2xZfws1QArPX/MC6nahOGpcMB4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "4a080e26d55eaedb95ab1bf8eeaeb84149c10f12", + "rev": "cfc8776011bd83508324115d353222475e1601c0", "type": "github" }, "original": { @@ -1119,6 +1158,27 @@ "type": "github" } }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1718506969, + "narHash": "sha256-Pm9I/BMQHbsucdWf6y9G3xBZh3TMlThGo4KBbeoeczg=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "797ce4c1f45a85df6dd3d9abdc53f2691bea9251", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, "spicetify-nix": { "inputs": { "flake-utils": "flake-utils_3", @@ -1127,11 +1187,11 @@ ] }, "locked": { - "lastModified": 1713380536, - "narHash": "sha256-A57ZhCPIk/MmsFgMeuYdbYNQ9FU9GEFGHuOIF8GWMAw=", + "lastModified": 1718822687, + "narHash": "sha256-5CmJXPaSwy2GJP4kAi4H1B+RNMn1yVGVGa2ZkxuB9nw=", "owner": "MichaelPachec0", "repo": "spicetify-nix", - "rev": "63844aeefcedf0582f1f74ac29bcb4294d256836", + "rev": "54a544c88ce6d6b52430ba8fef4dfc4cb2164aee", "type": "github" }, "original": { @@ -1140,27 +1200,31 @@ "type": "github" } }, - "sss": { + "stylix": { "inputs": { - "crane": "crane", - "cranix": "cranix", - "fenix": "fenix", - "flake-utils": "flake-utils_5", - "nixpkgs": [ - "nixpkgs" - ] + "base16": "base16", + "base16-fish": "base16-fish", + "base16-foot": "base16-foot", + "base16-helix": "base16-helix", + "base16-kitty": "base16-kitty", + "base16-tmux": "base16-tmux", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat_3", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1712720803, - "narHash": "sha256-ZcCfPnWE1hEPeVdlh4l4XsV4VAl10+xSsm5/9NPjXpc=", - "owner": "SergioRibera", - "repo": "sss", - "rev": "07671b5b115324d44f0a4f9672635d780c40a236", + "lastModified": 1719525570, + "narHash": "sha256-xSO/H67GAHEW0siD2PHoO/e97MbROL3r3s5SpF6A6Dc=", + "owner": "danth", + "repo": "stylix", + "rev": "1ff9d37d27377bfe8994c24a8d6c6c1734ffa116", "type": "github" }, "original": { - "owner": "SergioRibera", - "repo": "sss", + "owner": "danth", + "repo": "stylix", "type": "github" } }, @@ -1196,16 +1260,16 @@ }, "systems_11": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -1224,22 +1288,7 @@ "type": "github" } }, - "systems_13": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_14": { + "systems_2": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1254,7 +1303,7 @@ "type": "github" } }, - "systems_15": { + "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1269,51 +1318,6 @@ "type": "github" } }, - "systems_16": { - "locked": { - "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" - } - }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "systems_4": { "locked": { "lastModified": 1689347949, @@ -1376,48 +1380,52 @@ }, "systems_8": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, "systems_9": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, - "wlroots": { - "flake": false, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1713124002, - "narHash": "sha256-vPeZCY+sdiGsz4fl3AVVujfyZyQBz6+vZdkUE4hQ+HI=", - "owner": "hyprwm", - "repo": "wlroots-hyprland", - "rev": "611a4f24cd2384378f6e500253983107c6656c64", + "lastModified": 1718522839, + "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", "type": "github" }, "original": { - "owner": "hyprwm", - "repo": "wlroots-hyprland", - "rev": "611a4f24cd2384378f6e500253983107c6656c64", + "owner": "numtide", + "repo": "treefmt-nix", "type": "github" } }, @@ -1425,15 +1433,15 @@ "inputs": { "hyprland-protocols": "hyprland-protocols_2", "hyprlang": "hyprlang_5", - "nixpkgs": "nixpkgs_11", - "systems": "systems_15" + "nixpkgs": "nixpkgs_9", + "systems": "systems_11" }, "locked": { - "lastModified": 1713214484, - "narHash": "sha256-h1bSIsDuPk1FGgvTuSHJyiU2Glu7oAyoPMJutKZmLQ8=", + "lastModified": 1718619174, + "narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "bb44921534a9cee9635304fdb876c1b3ec3a8f61", + "rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623", "type": "github" }, "original": { @@ -1444,10 +1452,7 @@ }, "xdph": { "inputs": { - "hyprland-protocols": [ - "hyprland", - "hyprland-protocols" - ], + "hyprland-protocols": "hyprland-protocols", "hyprlang": [ "hyprland", "hyprlang" @@ -1462,11 +1467,11 @@ ] }, "locked": { - "lastModified": 1713214484, - "narHash": "sha256-h1bSIsDuPk1FGgvTuSHJyiU2Glu7oAyoPMJutKZmLQ8=", + "lastModified": 1718619174, + "narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "bb44921534a9cee9635304fdb876c1b3ec3a8f61", + "rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623", "type": "github" }, "original": { @@ -1477,16 +1482,16 @@ }, "yazi": { "inputs": { - "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_12", + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_10", "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1713598988, - "narHash": "sha256-pZvbOnxlBahjmoj5fjDpXB9mr2LH0z92krBluLTQULc=", + "lastModified": 1718866482, + "narHash": "sha256-DPjVD46lnSNWsn1X5tPHbhgolKBKukiC+rGRjbeVscY=", "owner": "sxyazi", "repo": "yazi", - "rev": "55da9e342c5d4de919bc3bd05a731fd2284e32da", + "rev": "0f84717a1b459d9c2dc24f8b0440bed6b9218d64", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6c98b1e..3d4418f 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,6 @@ ./lib ./modules ./pkgs - ./pre-commit-hooks.nix ]; perSystem = { @@ -28,9 +27,6 @@ ]; name = "dots"; DIRENV_LOG_FORMAT = ""; - shellHook = '' - ${config.pre-commit.installationScript} - ''; }; }; @@ -48,54 +44,28 @@ aesthetic-iosevka.url = "github:alphatechnolog/aesthetic-iosevka"; - agenix = { - url = "github:ryantm/agenix"; + sops-nix = { + url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.home-manager.follows = "hm"; }; - ags = { - url = "github:Aylur/ags"; + disko = { + url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; - anyrun = { - url = "github:Kirottu/anyrun"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - firefox-addons = { - url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - fu.url = "github:numtide/flake-utils"; - hm = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - hyprfocus = { - url = "github:pyt0xic/hyprfocus"; - inputs.hyprland.follows = "hyprland"; - }; - hypridle.url = "github:hyprwm/hypridle"; - - hyprland.url = "github:hyprwm/Hyprland"; - - hyprland-contrib = { - url = "github:hyprwm/contrib"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprlock.url = "github:hyprwm/hyprlock"; - hyprpaper.url = "github:hyprwm/hyprpaper"; - matugen = { - url = "github:InioX/matugen"; + nixvim = { + url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -104,27 +74,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nix-vscode-extensions = { - url = "github:nix-community/nix-vscode-extensions"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "fu"; - }; - - pre-commit-hooks = { - url = "github:cachix/pre-commit-hooks.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "fu"; - }; - spicetify-nix = { url = "github:MichaelPachec0/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - sss = { - url = "github:SergioRibera/sss/"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + stylix.url = "github:danth/stylix"; xdg-portal-hyprland.url = "github:hyprwm/xdg-desktop-portal-hyprland"; diff --git a/home/editors/default.nix b/home/editors/default.nix index 398f218..eef3419 100644 --- a/home/editors/default.nix +++ b/home/editors/default.nix @@ -1,6 +1,6 @@ _: { imports = [ ./neovim - ./vscode.nix + ./helix ]; } diff --git a/home/editors/helix/default.nix b/home/editors/helix/default.nix new file mode 100644 index 0000000..f355a18 --- /dev/null +++ b/home/editors/helix/default.nix @@ -0,0 +1,5 @@ +_: { + programs.helix = { + enable = false; + }; +} diff --git a/home/editors/neovim/autocmds.nix b/home/editors/neovim/autocmds.nix new file mode 100644 index 0000000..50e72e0 --- /dev/null +++ b/home/editors/neovim/autocmds.nix @@ -0,0 +1,12 @@ +_: { + programs.nixvim.autoCmd = [ + # Enable spellcheck for some filetypes + { + event = "FileType"; + pattern = [ + "markdown" + ]; + command = "setlocal spell spelllang=en,pt-br"; + } + ]; +} diff --git a/home/editors/neovim/default.nix b/home/editors/neovim/default.nix index eed7124..bc37c4f 100644 --- a/home/editors/neovim/default.nix +++ b/home/editors/neovim/default.nix @@ -1 +1,17 @@ -_: {} +{inputs, ...}: { + imports = [ + inputs.nixvim.homeManagerModules.nixvim + ./plugins + + ./autocmds.nix + ./options.nix + ./remap.nix + ]; + home.shellAliases.v = "nvim"; + programs.nixvim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; +} diff --git a/home/editors/neovim/options.nix b/home/editors/neovim/options.nix new file mode 100644 index 0000000..4bc2d2a --- /dev/null +++ b/home/editors/neovim/options.nix @@ -0,0 +1,84 @@ +_: { + programs.nixvim = { + globals = { + # Disable useless providers + loaded_perl_provider = 0; # Perl + loaded_python_provider = 0; # Python 2 + loaded_ruby_provider = 0; # Ruby + }; + + clipboard = { + providers.wl-copy.enable = true; + }; + + opts = { + # Colors + termguicolors = true; + + # Cursor and scrolling + colorcolumn = "120"; + cursorcolumn = false; + cursorline = false; + scrolloff = 8; + signcolumn = "yes"; + + # File management + backup = false; + fileencoding = "utf-8"; + swapfile = false; + undofile = true; + + # Folding + foldcolumn = "0"; + foldenable = true; + foldlevel = 99; + foldlevelstart = 99; + + # Indentation + autoindent = true; + expandtab = true; + shiftwidth = 4; + softtabstop = 4; + tabstop = 4; + + # Line numbers + number = true; + relativenumber = true; + + # Modeline + modeline = true; + modelines = 100; + + # Mouse control + mouse = "a"; + mousemodel = "extend"; + + # Performance settings + updatetime = 50; # faster completion (4000ms default) + + # Search settings + ignorecase = true; + inccommand = "split"; # Search and replace: preview changes in quickfix list + incsearch = true; + smartcase = true; + + # Spell checking + spell = false; + + # Split settings + splitbelow = true; + splitright = true; + + # Status line + laststatus = 3; + showmode = false; + cmdheight = 0; + + # Text width + textwidth = 0; + + # Text wrapping + wrap = false; + }; + }; +} diff --git a/home/editors/neovim/plugins/completion/cmp.nix b/home/editors/neovim/plugins/completion/cmp.nix new file mode 100644 index 0000000..3da805d --- /dev/null +++ b/home/editors/neovim/plugins/completion/cmp.nix @@ -0,0 +1,56 @@ +_: { + programs.nixvim = { + opts.completeopt = ["menu" "menuone" "noinsert"]; + + plugins = { + luasnip.enable = true; + + cmp = { + enable = true; + settings = { + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + + mapping = { + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.confirm({ select = true })"; + }; + + sources = [ + {name = "luasnip";} + {name = "nvim_lsp";} + {name = "path";} + { + name = "buffer"; + # Words from other open buffers can also be suggested. + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + } + ]; + + performance = { + debounce = 60; + fetching_timeout = 200; + max_view_entries = 30; + }; + + window = { + completion = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None"; + }; + documentation = { + border = "rounded"; + }; + }; + formatting = { + fields = ["kind" "abbr" "menu"]; + expandable_indicator = true; + }; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/completion/default.nix b/home/editors/neovim/plugins/completion/default.nix new file mode 100644 index 0000000..bbed285 --- /dev/null +++ b/home/editors/neovim/plugins/completion/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./cmp.nix + ./lspkind.nix + ./luasnip.nix + ]; +} diff --git a/home/editors/neovim/plugins/completion/lspkind.nix b/home/editors/neovim/plugins/completion/lspkind.nix new file mode 100644 index 0000000..fbfe06f --- /dev/null +++ b/home/editors/neovim/plugins/completion/lspkind.nix @@ -0,0 +1,54 @@ +_: { + programs.nixvim = { + plugins = { + lspkind = { + enable = true; + + symbolMap = { + Copilot = ""; + Text = "󰊄"; + Method = ""; + Function = "󰡱"; + Constructor = ""; + Field = ""; + Variable = "󱀍"; + Class = ""; + Interface = ""; + Module = "󰕳"; + Property = ""; + Unit = ""; + Value = ""; + Enum = ""; + Keyword = ""; + Snippet = ""; + Color = ""; + File = ""; + Reference = ""; + Folder = ""; + EnumMember = ""; + Constant = ""; + Struct = ""; + Event = ""; + Operator = ""; + TypeParameter = ""; + }; + + extraOptions = { + maxwidth = 50; + ellipsis_char = "..."; + }; + + cmp = { + enable = true; + menu = { + nvim_lsp = "[LSP]"; + nvim_lua = "[api]"; + path = "[path]"; + luasnip = "[snip]"; + buffer = "[buffer]"; + }; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/completion/luasnip.nix b/home/editors/neovim/plugins/completion/luasnip.nix new file mode 100644 index 0000000..88dfdf6 --- /dev/null +++ b/home/editors/neovim/plugins/completion/luasnip.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + programs.nixvim = { + plugins = { + luasnip = { + enable = true; + extraConfig = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/copilot.nix b/home/editors/neovim/plugins/copilot.nix new file mode 100644 index 0000000..699232b --- /dev/null +++ b/home/editors/neovim/plugins/copilot.nix @@ -0,0 +1,9 @@ +_: { + programs.nixvim = { + plugins = { + copilot-lua = { + enable = false; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/default.nix b/home/editors/neovim/plugins/default.nix new file mode 100644 index 0000000..9548cd4 --- /dev/null +++ b/home/editors/neovim/plugins/default.nix @@ -0,0 +1,12 @@ +_: { + imports = [ + ./completion + ./lsp + ./treesitter + ./ui + ./telescope + ./utils + + ./copilot.nix + ]; +} diff --git a/home/editors/neovim/plugins/lsp/conform.nix b/home/editors/neovim/plugins/lsp/conform.nix new file mode 100644 index 0000000..f22d58d --- /dev/null +++ b/home/editors/neovim/plugins/lsp/conform.nix @@ -0,0 +1,94 @@ +_: { + programs.nixvim = { + plugins.conform-nvim = { + enable = true; + notifyOnError = true; + formattersByFt = { + html = [["prettierd" "prettier"]]; + css = [["prettierd" "prettier"]]; + javascript = [["prettierd" "prettier"]]; + javascriptreact = [["prettierd" "prettier"]]; + typescript = [["prettierd" "prettier"]]; + typescriptreact = [["prettierd" "prettier"]]; + java = ["google-java-format"]; + python = ["black"]; + lua = ["stylua"]; + nix = ["alejandra"]; + markdown = [["prettierd" "prettier"]]; + rust = ["rustfmt"]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "uf"; + action = ":FormatToggle"; + options = { + desc = "Toggle Format"; + silent = true; + }; + } + { + mode = "n"; + key = "cf"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Buffer"; + }; + } + + { + mode = "v"; + key = "cF"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Lines"; + }; + } + ]; + + extraConfigLua = '' + local conform = require("conform") + local notify = require("notify") + + conform.setup({ + format_on_save = function(bufnr) + -- Disable with a global or buffer-local variable + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + return { timeout_ms = 500, lsp_fallback = true } + end, + }) + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + vim.api.nvim_create_user_command("FormatToggle", function(args) + local is_global = not args.bang + if is_global then + vim.g.disable_autoformat = not vim.g.disable_autoformat + if vim.g.disable_autoformat then + show_notification("Autoformat-on-save disabled globally", "info") + else + show_notification("Autoformat-on-save enabled globally", "info") + end + else + vim.b.disable_autoformat = not vim.b.disable_autoformat + if vim.b.disable_autoformat then + show_notification("Autoformat-on-save disabled for this buffer", "info") + else + show_notification("Autoformat-on-save enabled for this buffer", "info") + end + end + end, { + desc = "Toggle autoformat-on-save", + bang = true, + }) + ''; + }; +} diff --git a/home/editors/neovim/plugins/lsp/default.nix b/home/editors/neovim/plugins/lsp/default.nix new file mode 100644 index 0000000..06ae038 --- /dev/null +++ b/home/editors/neovim/plugins/lsp/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./conform.nix + ./fidget.nix + ./lsp.nix + ]; +} diff --git a/home/editors/neovim/plugins/lsp/fidget.nix b/home/editors/neovim/plugins/lsp/fidget.nix new file mode 100644 index 0000000..c7d7cb6 --- /dev/null +++ b/home/editors/neovim/plugins/lsp/fidget.nix @@ -0,0 +1,103 @@ +{ + programs.nixvim = { + plugins = { + fidget = { + enable = true; + logger = { + level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + floatPrecision = 0.01; # Limit the number of decimals displayed for floats + }; + progress = { + pollRate = 0; # How and when to poll for progress messages + suppressOnInsert = true; # Suppress new messages while in insert mode + ignoreDoneAlready = false; # Ignore new tasks that are already complete + ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message + clearOnDetach = + # Clear notification group when LSP server detaches + '' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + ''; + notificationGroup = + # How to get a progress message's notification group key + '' + function(msg) return msg.lsp_client.name end + ''; + ignore = []; # List of LSP servers to ignore + lsp = { + progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size + }; + display = { + renderLimit = 16; # How many LSP messages to show at once + doneTtl = 3; # How long a message should persist after completion + doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete + doneStyle = "Constant"; # Highlight group for completed LSP tasks + progressTtl = "math.huge"; # How long a message should persist when in progress + progressIcon = { + pattern = "dots"; + period = 1; + }; # Icon shown when LSP progress tasks are in progress + progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks + groupStyle = "Title"; # Highlight group for group name (LSP server name) + iconStyle = "Question"; # Highlight group for group icons + priority = 30; # Ordering priority for LSP notification group + skipHistory = true; # Whether progress notifications should be omitted from history + formatMessage = '' + require ("fidget.progress.display").default_format_message + ''; # How to format a progress message + formatAnnote = '' + function (msg) return msg.title end + ''; # How to format a progress annotation + formatGroupName = '' + function (group) return tostring (group) end + ''; # How to format a progress notification group's name + overrides = { + rust_analyzer = { + name = "rust-analyzer"; + }; + }; # Override options from the default notification config + }; + }; + notification = { + pollRate = 10; # How frequently to update and render notifications + filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + historySize = 128; # Number of removed messages to retain in history + overrideVimNotify = true; + redirect = '' + function(msg, level, opts) + if opts and opts.on_open then + return require("fidget.integration.nvim-notify").delegate(msg, level, opts) + end + end + ''; + configs = { + default = "require('fidget.notification').default_config"; + }; + + window = { + normalHl = "Comment"; + winblend = 0; + border = "none"; # none, single, double, rounded, solid, shadow + zindex = 45; + maxWidth = 0; + maxHeight = 0; + xPadding = 1; + yPadding = 0; + align = "bottom"; + relative = "editor"; + }; + view = { + stackUpwards = true; # Display notification items from bottom to top + iconSeparator = " "; # Separator between group name and icon + groupSeparator = "---"; # Separator between notification groups + groupSeparatorHl = + # Highlight group used for group separator + "Comment"; + }; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/lsp/lsp.nix b/home/editors/neovim/plugins/lsp/lsp.nix new file mode 100644 index 0000000..dd5390e --- /dev/null +++ b/home/editors/neovim/plugins/lsp/lsp.nix @@ -0,0 +1,41 @@ +_: { + programs.nixvim = { + plugins = { + lsp = { + enable = true; + + keymaps = { + silent = true; + }; + + servers = { + bashls.enable = true; + clangd.enable = true; + dockerls.enable = true; + elixirls.enable = true; + eslint.enable = true; + gopls.enable = true; + htmx.enable = true; + lua-ls = { + enable = true; + extraOptions = { + settings = { + Lua = { + completion = { + callSnippet = "Replace"; + }; + hint.enable = true; + telemetry.enabled = false; + }; + }; + }; + }; + intelephense.enable = true; + nil-ls.enable = true; + #tsserver.enable = true; + yamlls.enable = true; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/telescope/default.nix b/home/editors/neovim/plugins/telescope/default.nix new file mode 100644 index 0000000..340e7b3 --- /dev/null +++ b/home/editors/neovim/plugins/telescope/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./telescope.nix + ]; +} diff --git a/home/editors/neovim/plugins/telescope/telescope.nix b/home/editors/neovim/plugins/telescope/telescope.nix new file mode 100644 index 0000000..b1f79d7 --- /dev/null +++ b/home/editors/neovim/plugins/telescope/telescope.nix @@ -0,0 +1,55 @@ +_: { + programs.nixvim = { + plugins.telescope = { + enable = true; + + extensions = { + fzf-native.enable = true; + }; + + keymaps = { + "sf" = { + action = "find_files"; + options.desc = "[S]earch Project [F]iles"; + }; + + "sh" = { + action = "help_tags"; + options.desc = "[S]earch [H]elp Pages"; + }; + + "sD" = { + action = "diagnostics"; + options.desc = "[S]earch Workspace [D]iagnostics"; + }; + + "sb" = { + action = "buffers"; + options.desc = "[S]earch [B]uffers"; + }; + + "sg" = { + action = "git_files"; + options.desc = "[S]earch [G]it Project Files"; + }; + + "s." = { + action = "oldfiles"; + options.desc = "[S]earch Recent Files"; + }; + + "s/" = { + action = "live_grep"; + options.desc = "Grep (root dir)"; + }; + }; + + settings.defaults = { + file_ignore_patterns = [ + "^.git/" + ]; + set_env.COLORTERM = "truecolor"; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/treesitter/default.nix b/home/editors/neovim/plugins/treesitter/default.nix new file mode 100644 index 0000000..248d688 --- /dev/null +++ b/home/editors/neovim/plugins/treesitter/default.nix @@ -0,0 +1,11 @@ +_: { + imports = [ + ./treesitter.nix + + ./nvim-lint.nix + + # Typescript + ./ts-autotag.nix + ./typescript-tools-nvim.nix + ]; +} diff --git a/home/editors/neovim/plugins/treesitter/nvim-lint.nix b/home/editors/neovim/plugins/treesitter/nvim-lint.nix new file mode 100644 index 0000000..0fdb09c --- /dev/null +++ b/home/editors/neovim/plugins/treesitter/nvim-lint.nix @@ -0,0 +1,18 @@ +_: { + programs.nixvim = { + plugins = { + lint = { + enable = true; + lintersByFt = { + nix = ["statix"]; + lua = ["selene"]; + javascript = ["eslint_d"]; + javascriptreact = ["eslint_d"]; + typescript = ["eslint_d"]; + typescriptreact = ["eslint_d"]; + json = ["jsonlint"]; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/treesitter/treesitter.nix b/home/editors/neovim/plugins/treesitter/treesitter.nix new file mode 100644 index 0000000..ccb20c9 --- /dev/null +++ b/home/editors/neovim/plugins/treesitter/treesitter.nix @@ -0,0 +1,23 @@ +_: { + programs.nixvim = { + plugins = { + treesitter = { + enable = true; + folding = true; + indent = true; + nixvimInjections = true; + }; + + treesitter-refactor = { + enable = true; + highlightDefinitions = { + enable = true; + # Set to false if `updatetime` of ~100. + clearOnCursorMove = false; + }; + }; + + hmts.enable = true; + }; + }; +} diff --git a/home/editors/neovim/plugins/treesitter/ts-autotag.nix b/home/editors/neovim/plugins/treesitter/ts-autotag.nix new file mode 100644 index 0000000..6d30124 --- /dev/null +++ b/home/editors/neovim/plugins/treesitter/ts-autotag.nix @@ -0,0 +1,9 @@ +_: { + programs.nixvim = { + plugins = { + ts-autotag = { + enable = true; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/treesitter/typescript-tools-nvim.nix b/home/editors/neovim/plugins/treesitter/typescript-tools-nvim.nix new file mode 100644 index 0000000..6b06e01 --- /dev/null +++ b/home/editors/neovim/plugins/treesitter/typescript-tools-nvim.nix @@ -0,0 +1,51 @@ +_: { + programs.nixvim = { + plugins = { + typescript-tools = { + enable = false; + onAttach = '' + function(client, bufnr) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + + if vim.lsp.inlay_hint then + vim.lsp.inlay_hint(bufnr, true) + end + end + ''; + settings = { + tsserverFilePreferences = { + # Inlay Hints + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayVariableTypeHints = true; + includeInlayVariableTypeHintsWhenTypeMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayEnumMemberValueHints = true; + }; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "co"; + action = "TSToolsOrganizeImports"; + options = { + desc = "Organize Imports"; + }; + } + { + mode = "n"; + key = "cR"; + action = "TSToolsRemoveUnusedImports"; + options = { + desc = "Remove Unused Imports"; + }; + } + ]; + }; +} diff --git a/home/editors/neovim/plugins/ui/colorscheme.nix b/home/editors/neovim/plugins/ui/colorscheme.nix new file mode 100644 index 0000000..f99f3dd --- /dev/null +++ b/home/editors/neovim/plugins/ui/colorscheme.nix @@ -0,0 +1,16 @@ +_: { + programs.nixvim = { + colorschemes = { + rose-pine = { + enable = true; + settings = { + styles = { + italic = true; + bold = true; + transparency = false; + }; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/ui/default.nix b/home/editors/neovim/plugins/ui/default.nix new file mode 100644 index 0000000..efa3b77 --- /dev/null +++ b/home/editors/neovim/plugins/ui/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./colorscheme.nix + ./notify.nix + ]; +} diff --git a/home/editors/neovim/plugins/ui/notify.nix b/home/editors/neovim/plugins/ui/notify.nix new file mode 100644 index 0000000..e141ac0 --- /dev/null +++ b/home/editors/neovim/plugins/ui/notify.nix @@ -0,0 +1,46 @@ +_: { + programs.nixvim = { + plugins.notify = { + enable = true; + backgroundColour = "#000000"; + fps = 60; + render = "default"; + timeout = 500; + topDown = true; + }; + keymaps = [ + { + mode = "n"; + key = "un"; + action = '' + lua require("notify").dismiss({ silent = true, pending = true }) + ''; + options = { + desc = "Dismiss All Notifications"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + local filtered_message = { "No information available" } + + -- Override notify function to filter out messages + ---@diagnostic disable-next-line: duplicate-set-field + vim.notify = function(message, level, opts) + local merged_opts = vim.tbl_extend("force", { + on_open = function(win) + local buf = vim.api.nvim_win_get_buf(win) + vim.api.nvim_buf_set_option(buf, "filetype", "markdown") + end, + }, opts or {}) + + for _, msg in ipairs(filtered_message) do + if message == msg then + return + end + end + return notify(message, level, merged_opts) + end + ''; + }; +} diff --git a/home/editors/neovim/plugins/utils/default.nix b/home/editors/neovim/plugins/utils/default.nix new file mode 100644 index 0000000..4e34e48 --- /dev/null +++ b/home/editors/neovim/plugins/utils/default.nix @@ -0,0 +1,9 @@ +_: { + imports = [ + ./harpoon.nix + ./lualine.nix + ./neocord.nix + ./oil.nix + ./todo-comments.nix + ]; +} diff --git a/home/editors/neovim/plugins/utils/harpoon.nix b/home/editors/neovim/plugins/utils/harpoon.nix new file mode 100644 index 0000000..9fc94ce --- /dev/null +++ b/home/editors/neovim/plugins/utils/harpoon.nix @@ -0,0 +1,21 @@ +_: { + programs.nixvim = { + plugins = { + harpoon = { + enable = true; + enableTelescope = true; + keymapsSilent = true; + keymaps = { + addFile = "a"; + toggleQuickMenu = ""; + navFile = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + }; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/utils/lualine.nix b/home/editors/neovim/plugins/utils/lualine.nix new file mode 100644 index 0000000..eb45a7a --- /dev/null +++ b/home/editors/neovim/plugins/utils/lualine.nix @@ -0,0 +1,49 @@ +_: { + programs.nixvim = { + plugins = { + lualine = { + enable = true; + globalstatus = true; + + # +-------------------------------------------------+ + # | A | B | C X | Y | Z | + # +-------------------------------------------------+ + sections = { + lualine_a = ["mode"]; + lualine_b = ["branch" "diff"]; + lualine_c = ["filename"]; + + lualine_x = [ + "diagnostics" + + # Show active language server + { + name.__raw = '' + function() + local msg = "" + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end + ''; + icon = ""; + color.fg = "#ffffff"; + } + "encoding" + "fileformat" + "filetype" + ]; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/utils/neocord.nix b/home/editors/neovim/plugins/utils/neocord.nix new file mode 100644 index 0000000..29e6b50 --- /dev/null +++ b/home/editors/neovim/plugins/utils/neocord.nix @@ -0,0 +1,30 @@ +_: { + programs.nixvim = { + plugins = { + neocord = { + enable = false; + settings = { + auto_update = true; + blacklist = []; + debounce_timeout = 10; + editing_text = "Editing..."; + enable_line_number = true; + logo = "https://repository-images.githubusercontent.com/325421844/ecb73f47-cb89-4ee0-a0fd-9743c2f3569a"; + logo_tooltip = "NixVim"; + file_assets = null; + file_explorer_text = "Browsing..."; + git_commit_text = "Committing changes..."; + global_timer = true; + line_number_text = "Line %s out of %s"; + log_level = null; + main_image = "logo"; + plugin_manager_text = "Managing plugins..."; + reading_text = "Reading..."; + show_time = true; + terminal_text = "Using Terminal..."; + workspace_text = "Working on %s"; + }; + }; + }; + }; +} diff --git a/home/editors/neovim/plugins/utils/oil.nix b/home/editors/neovim/plugins/utils/oil.nix new file mode 100644 index 0000000..43b8690 --- /dev/null +++ b/home/editors/neovim/plugins/utils/oil.nix @@ -0,0 +1,56 @@ +_: { + programs.nixvim = { + plugins.oil = { + enable = true; + settings = { + useDefaultKeymaps = true; + deleteToTrash = true; + viewOptions = { + showHidden = true; + }; + preview = { + border = "rounded"; + }; + + float = { + padding = 2; + maxWidth = 0; + maxHeight = 0; + border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + winOptions = { + winblend = 0; + }; + }; + keymaps = { + "g?" = "actions.show_help"; + "" = "actions.select"; + "" = "actions.select_vsplit"; + "" = "actions.select_split"; + "" = "actions.select_tab"; + "" = "actions.preview"; + "" = "actions.close"; + "" = "actions.refresh"; + "-" = "actions.parent"; + "_" = "actions.open_cwd"; + "`" = "actions.cd"; + "~" = "actions.tcd"; + "gs" = "actions.change_sort"; + "gx" = "actions.open_external"; + "g." = "actions.toggle_hidden"; + "q" = "actions.close"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "pv"; + action = ":Oil --float"; + options = { + desc = "Open parent directory"; + silent = true; + }; + } + ]; + }; +} diff --git a/home/editors/neovim/plugins/utils/todo-comments.nix b/home/editors/neovim/plugins/utils/todo-comments.nix new file mode 100644 index 0000000..e20f74a --- /dev/null +++ b/home/editors/neovim/plugins/utils/todo-comments.nix @@ -0,0 +1,7 @@ +_: { + programs.nixvim = { + plugins = { + todo-comments.enable = true; + }; + }; +} diff --git a/home/editors/neovim/remap.nix b/home/editors/neovim/remap.nix new file mode 100644 index 0000000..abc48ee --- /dev/null +++ b/home/editors/neovim/remap.nix @@ -0,0 +1,80 @@ +{ + config, + lib, + ... +}: { + programs.nixvim = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; + + keymaps = let + # Normal mode key mappings + normal = + lib.mapAttrsToList (key: action: { + mode = "n"; + inherit action key; + }) + { + # Movement modifications with Alt key + "" = ":move-2"; + "" = ":move+"; + + # Project view + "pv" = "Ex"; + + # Search and replace the word under cursor + "s" = ":%s/\\<\\>//gI"; + + # Movement reminders + "" = ''echo "Use h to move!!"''; + "" = ''echo "Use l to move!!"''; + "" = ''echo "Use k to move!!""''; + "" = ''echo "Use j to move!!""''; + + # Center the view on next and previous searches + "" = "nzzzv"; + "" = "Nzzzv"; + + # Clipboard operations + "y" = "\"+y"; + "Y" = "\"+Y"; + + # Delete without yanking + "d" = "\"_d"; + + # Make the current file executable + "x" = "!chmod +x %"; + + # Disable the Q shortcut + "Q" = ""; + }; + + # Visual mode key mappings + visual = + lib.mapAttrsToList (key: action: { + mode = "v"; + inherit action key; + }) + { + # Indenting operations + ">" = ">gv"; + "<" = "" = ">gv"; + "" = "y" = "\"+y"; + "p" = "\"_dP"; + + # Move selected lines up and down + "K" = ":m '<-2gv=gv"; + "J" = ":m '>+1gv=gv"; + }; + in + config.nixvim.helpers.keymaps.mkKeymaps + {options.silent = true;} + (normal ++ visual); + }; +} diff --git a/home/editors/vscode.nix b/home/editors/vscode.nix deleted file mode 100644 index f622c3f..0000000 --- a/home/editors/vscode.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - programs.vscode = { - enable = true; - extensions = with pkgs.vscode-extensions; [ - dracula-theme.theme-dracula - vscodevim.vim - yzhang.markdown-all-in-one - ]; - }; -} diff --git a/home/home.nix b/home/home.nix index e68c274..bd31f1b 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,27 +1,16 @@ -{ - lib, - self, - inputs, - ... -}: { +{inputs, ...}: { imports = [ - # import folders first ./editors ./software ./services - ./specialisations.nix - inputs.matugen.nixosModules.default inputs.nix-index-db.hmModules.nix-index - inputs.hyprlock.homeManagerModules.default - inputs.hypridle.homeManagerModules.default - self.nixosModules.theme ]; home = { username = "glwbr"; homeDirectory = "/home/glwbr"; - stateVersion = "23.11"; + stateVersion = "24.05"; }; # disable manuals as nmd fails to build often @@ -33,10 +22,4 @@ # let HM manage itself when in standalone mode programs.home-manager.enable = true; - - nixpkgs.overlays = [ - (final: prev: { - lib = prev.lib // {colors = import "${self}/lib/colors" lib;}; - }) - ]; } diff --git a/home/services/ags/.gitignore b/home/services/ags/.gitignore deleted file mode 100644 index b78d65d..0000000 --- a/home/services/ags/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -style.css -style.css.map -types diff --git a/home/services/ags/config.js b/home/services/ags/config.js deleted file mode 100644 index c5a6cb2..0000000 --- a/home/services/ags/config.js +++ /dev/null @@ -1,53 +0,0 @@ -import { App, Audio, Notifications, Utils } from "./imports.js"; -import Bar from "./windows/bar/main.js"; -import Music from "./windows/music/main.js"; -import NotificationPopup from "./windows/notifications/popups.js"; -import Osd from "./windows/osd/main.js"; -import SystemMenu from "./windows/system-menu/main.js"; - -const scss = App.configDir + "/style.scss"; -const css = App.configDir + "/style.css"; - -Utils.exec(`sass ${scss} ${css}`); - -App.connect("config-parsed", () => print("config parsed")); - -App.config({ - style: css, - closeWindowDelay: { - "system-menu": 200, - }, -}); - -Notifications.popupTimeout = 5000; -Notifications.forceTimeout = false; -Notifications.cacheActions = true; -Audio.maxStreamVolume = 1; - -function reloadCss() { - console.log("scss change detected"); - Utils.exec(`sass ${scss} ${css}`); - App.resetCss(); - App.applyCss(css); -} - -Utils.monitorFile(`${App.configDir}/style`, reloadCss); - -/** - * @param {import("types/widgets/window.js").Window[]} windows - */ -function addWindows(windows) { - windows.forEach((win) => App.addWindow(win)); -} - -addWindows( - [ - Bar(), - Music(), - Osd(), - SystemMenu(), - NotificationPopup(), - ], -); - -export {}; diff --git a/home/services/ags/default.nix b/home/services/ags/default.nix deleted file mode 100644 index 1a23027..0000000 --- a/home/services/ags/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - inputs, - pkgs, - lib, - config, - ... -}: let - requiredDeps = with pkgs; [ - config.wayland.windowManager.hyprland.package - bash - coreutils - dart-sass - gawk - imagemagick - procps - ripgrep - util-linux - ]; - - guiDeps = with pkgs; [ - gnome.gnome-control-center - mission-center - overskride - wlogout - ]; - - dependencies = requiredDeps ++ guiDeps; - - cfg = config.programs.ags; -in { - imports = [ - inputs.ags.homeManagerModules.default - ]; - - programs.ags.enable = true; - - systemd.user.services.ags = { - Unit = { - Description = "Aylur's Gtk Shell"; - PartOf = [ - "tray.target" - "graphical-session.target" - ]; - }; - Service = { - Environment = "PATH=/run/wrappers/bin:${lib.makeBinPath dependencies}"; - ExecStart = "${cfg.package}/bin/ags"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; -} diff --git a/home/services/ags/dprint.json b/home/services/ags/dprint.json deleted file mode 100644 index 63483f6..0000000 --- a/home/services/ags/dprint.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "typescript": { - }, - "excludes": [ - "**/node_modules" - ], - "plugins": [ - "https://plugins.dprint.dev/typescript-0.88.10.wasm" - ] -} diff --git a/home/services/ags/imports.js b/home/services/ags/imports.js deleted file mode 100644 index f9603fb..0000000 --- a/home/services/ags/imports.js +++ /dev/null @@ -1,39 +0,0 @@ -// Required components -import GLib from "gi://GLib"; -import App from "resource:///com/github/Aylur/ags/app.js"; -import Service from "resource:///com/github/Aylur/ags/service.js"; -import * as Utils from "resource:///com/github/Aylur/ags/utils.js"; -import Variable from "resource:///com/github/Aylur/ags/variable.js"; -import Widget from "resource:///com/github/Aylur/ags/widget.js"; - -// Services -import Audio from "resource:///com/github/Aylur/ags/service/audio.js"; -import Battery from "resource:///com/github/Aylur/ags/service/battery.js"; -import Bluetooth from "resource:///com/github/Aylur/ags/service/bluetooth.js"; -import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js"; -import Mpris from "resource:///com/github/Aylur/ags/service/mpris.js"; -import Network from "resource:///com/github/Aylur/ags/service/network.js"; -import Notifications from "resource:///com/github/Aylur/ags/service/notifications.js"; -import PowerProfiles from "resource:///com/github/Aylur/ags/service/powerprofiles.js"; -import SystemTray from "resource:///com/github/Aylur/ags/service/systemtray.js"; - -import Icons from "./utils/icons.js"; - -export { - App, - Audio, - Battery, - Bluetooth, - GLib, - Hyprland, - Icons, - Mpris, - Network, - Notifications, - PowerProfiles, - Service, - SystemTray, - Utils, - Variable, - Widget, -}; diff --git a/home/services/ags/services/brightness.js b/home/services/ags/services/brightness.js deleted file mode 100644 index f21c002..0000000 --- a/home/services/ags/services/brightness.js +++ /dev/null @@ -1,79 +0,0 @@ -import { Service, Utils } from "../imports.js"; -import Gio from "gi://Gio"; -import GLib from "gi://GLib"; - -const clamp = (num, min, max) => Math.min(Math.max(num, min), max); - -class BrightnessService extends Service { - static { - Service.register( - this, - { "screen-changed": ["float"] }, - { "screen-value": ["float", "rw"] }, - ); - } - - #screenValue = 0; - - #interface = Utils.exec("sh -c 'ls -w1 /sys/class/backlight | head -1'"); - #path = `/sys/class/backlight/${this.#interface}`; - #brightness = `${this.#path}/brightness`; - - #max = Number(Utils.readFile(`${this.#path}/max_brightness`)); - - get screen_value() { - return this.#screenValue; - } - - set screen_value(percent) { - percent = clamp(percent, 0, 1); - this.#screenValue = percent; - - const file = Gio.File.new_for_path(this.#brightness); - const string = `${Math.round(percent * this.#max)}`; - - new Promise((resolve, _) => { - file.replace_contents_bytes_async( - new GLib.Bytes(new TextEncoder().encode(string)), - null, - false, - Gio.FileCreateFlags.NONE, - null, - (self, res) => { - try { - self.replace_contents_finish(res); - resolve(self); - } catch (error) { - print(error); - } - }, - ); - }); - } - - constructor() { - super(); - - this.#updateScreenValue(); - Utils.monitorFile(this.#brightness, () => this.#onChange()); - } - - #updateScreenValue() { - this.#screenValue = Number(Utils.readFile(this.#brightness)) / this.#max; - } - - #onChange() { - this.#updateScreenValue(); - - this.notify("screen-value"); - this.emit("screen-changed", this.#screenValue); - } - - connectWidget(widget, callback, event = "screen-changed") { - super.connectWidget(widget, callback, event); - } -} - -const service = new BrightnessService(); - -export default service; diff --git a/home/services/ags/services/osd.js b/home/services/ags/services/osd.js deleted file mode 100644 index 38d1ff8..0000000 --- a/home/services/ags/services/osd.js +++ /dev/null @@ -1,73 +0,0 @@ -import { Audio, Icons, Service, Utils } from "../imports.js"; -import { audioIcon, micIcon } from "../utils/audio.js"; -import Brightness from "./brightness.js"; - -class Indicator extends Service { - static { - Service.register(this, { - "popup": ["jsobject", "boolean"], - }); - } - - #delay = 1500; - #count = 0; - - popup(value, label, icon, showProgress = true) { - const props = { - value, - label, - icon, - showProgress, - }; - this.emit("popup", props, true); - this.#count++; - Utils.timeout(this.#delay, () => { - this.#count--; - - if (this.#count === 0) { - this.emit("popup", props, false); - } - }); - } - - bluetooth(addr) { - this.popup( - 0, - getBluetoothDevice(addr), - Icons.bluetooth.active, - false, - ); - } - - speaker() { - this.popup( - Audio.speaker?.volume ?? 0, - Audio.speaker?.description ?? "", - audioIcon(), - ); - } - - mic() { - this.popup( - Audio.microphone?.volume || 0, - Audio.microphone?.description || "", - micIcon(), - ); - } - - display() { - // brightness is async, so lets wait a bit - Utils.timeout(10, () => - this.popup( - Brightness.screenValue, - "Brightness", - Icons.brightness, - )); - } - - connect(event = "popup", callback) { - return super.connect(event, callback); - } -} - -export default new Indicator(); diff --git a/home/services/ags/style.scss b/home/services/ags/style.scss deleted file mode 100644 index 8a656e3..0000000 --- a/home/services/ags/style.scss +++ /dev/null @@ -1,13 +0,0 @@ -/* style aggregator */ - -/* setup */ -@import "style/prelude"; -@import "style/colors"; -@import "style/general"; - -/* modules & windows */ -@import "style/bar"; -@import "style/music"; -@import "style/osd"; -@import "style/system-menu"; -@import "style/notifications"; diff --git a/home/services/ags/style/bar.scss b/home/services/ags/style/bar.scss deleted file mode 100644 index 79b4b8d..0000000 --- a/home/services/ags/style/bar.scss +++ /dev/null @@ -1,129 +0,0 @@ -.bar { - background: $bar-bg; - min-height: 32px; - - .module { - margin: 0 0.5rem; - } -} - -/* workspaces */ -.bar .workspaces { - margin: 0.2rem 0.5rem; - - button { - background: rgba(0, 0, 0, 0.3); - border-radius: 2rem; - margin: 0.7rem 0.2rem; - min-width: 1rem; - transition: 100ms linear; - } - - .focused { - min-width: 2rem; - } - - .monitor0 { - background: $red; - } - .monitor1 { - background: $yellow; - } - .monitor2 { - background: $green; - } - .monitor3 { - background: $blue; - } -} - -/* music */ -.bar .music { - & > box { - @include animate; - border-radius: $round2; - margin: 0.4rem; - } - - &.active > box { - background: $surface; - } - - .cover { - background-size: cover; - background-position: center; - border-radius: 50%; - min-width: 2rem; - min-height: 2rem; - } -} - -/* tray */ -.tray button { - @include button; - background: none; - margin: 0.5rem 0; - - &:not(:last-child) { - margin-right: 0.3rem; - } - - &.active { - background: $surface; - } -} - -menu { - background: $tooltip-bg; - border-radius: $round; - - separator { - background-color: $surface; - } - - menuitem { - @include button; - border-radius: 0; - padding: 0.4rem 0.7rem; - - &:first-child { - border-radius: $round $round 0 0; - } - &:last-child { - border-radius: 0 0 $round $round; - } - &:only-child { - border-radius: $round; - } - } -} - -/* system-info */ -.bar .system-info { - margin: 0 0.2rem; - - & > box { - margin: 0 0.3rem; - } - - .type { - font-size: 0.55rem; - font-weight: 300; - } - - .value { - font-size: 0.8rem; - } -} - -.system-menu-toggler { - box { - @include animate; - margin: 0.4rem 0; - border-radius: $round2; - } - - &.active box { - background: $surface; - } -} diff --git a/home/services/ags/style/colors-dark.scss b/home/services/ags/style/colors-dark.scss deleted file mode 100644 index b924546..0000000 --- a/home/services/ags/style/colors-dark.scss +++ /dev/null @@ -1,32 +0,0 @@ -$red: #f38ba8; -$yellow: #f9e2af; -$green: #a6e3a1; -$blue: #89b4fa; - -$tooltip-bg: #000000; -$fg: #ffffff; -$bg: rgba(0, 0, 0, 0.5); -$bar-bg: rgba(0, 0, 0, 0.21); - -$surface: rgba(255, 255, 255, 0.15); -$overlay: rgba(255, 255, 255, 0.7); - -$accent: #9d5b7a; - -/* buttons */ -$button-enabled: $accent; -$button-enabled-hover: adjust_color($button-enabled, $lightness: -10%); - -$button-disabled: $surface; -$button-disabled-hover: adjust_color($button-disabled, $alpha: +0.1); - -* { - text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2); -} - -@mixin border { - // border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: - // inset 0 0 0 1px rgba(255, 255, 255, 0.1), - 0 3px 5px 1px rgba(0, 0, 0, 0.3); -} diff --git a/home/services/ags/style/colors-light.scss b/home/services/ags/style/colors-light.scss deleted file mode 100644 index 44abe71..0000000 --- a/home/services/ags/style/colors-light.scss +++ /dev/null @@ -1,32 +0,0 @@ -$red: #f38ba8; -$yellow: #f9e2af; -$green: #a6e3a1; -$blue: #89b4fa; - -$tooltip-bg: #ffffff; -$fg: #000000; -$bg: rgba(255, 255, 255, 0.5); -$bar-bg: rgba(255, 255, 255, 0.3); - -$surface: rgba(255, 255, 255, 0.3); -$overlay: rgba(0, 0, 0, 0.5); - -$accent: #ddbaef; - -/* buttons */ -$button-enabled: $accent; -$button-enabled-hover: adjust_color($button-enabled, $lightness: -10%); - -$button-disabled: $surface; -$button-disabled-hover: adjust_color($button-disabled, $alpha: +0.1); - -* { - text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2); -} - -@mixin border { - // border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: - // inset 0 0 0 1px rgba(255, 255, 255, 0.1), - 0 3px 5px 1px rgba(0, 0, 0, 0.3); -} diff --git a/home/services/ags/style/colors.scss b/home/services/ags/style/colors.scss deleted file mode 120000 index 4a5b069..0000000 --- a/home/services/ags/style/colors.scss +++ /dev/null @@ -1 +0,0 @@ -colors-dark.scss \ No newline at end of file diff --git a/home/services/ags/style/general.scss b/home/services/ags/style/general.scss deleted file mode 100644 index 0e0dff3..0000000 --- a/home/services/ags/style/general.scss +++ /dev/null @@ -1,100 +0,0 @@ -/* general styles */ - -$round: 8px; -$round2: calc($round * 2); -$margin: 0.4rem; -$padding: 0.4rem; -$border-width: 2px; -$scale: 0.5rem; - -@mixin animate { - transition: 200ms; -} - -* { - color: $fg; -} - -/* mixins */ -@mixin window-rounding { - border-radius: $round2; -} - -@mixin rounding { - border-radius: calc($round2 - $padding - $border-width); -} - -@mixin window-box { - @include rounding; - - background: $surface; - box-shadow: 0 1px 5px -5px rgba(0, 0, 0, 0.5); - margin: $margin; - padding: $padding; -} - -@mixin window { - @include border; - @include window-rounding; - - background: $bg; - margin: 5px 10px 15px; - padding: $padding; -} - -tooltip { - background: $tooltip-bg; - box-shadow: - inset 0 0 0 1px rgba(255, 255, 255, 0.1), - 0 0 rgba(0, 0, 0, 0.4); - border-radius: $round; -} - -/* scales & progress bars */ -scale, -progressbar { - trough { - background-color: $surface; - border-radius: $scale; - min-width: calc($scale * 10); - padding: 0 calc($scale / 2); - } - - highlight, - progress { - background: $overlay; - border-radius: $scale; - margin: 0 calc(0px - $scale / 2); - min-height: $scale; - } -} - -@mixin button-active { - @include animate; - background: $button-enabled; - border-radius: 5rem; - padding: 0.4rem; - - &:hover { - background: $button-enabled-hover; - } -} - -@mixin button { - @include animate; - background: $button-disabled; - border-radius: 5rem; - padding: 0.4rem; - - &:hover { - background: $button-disabled-hover; - } -} - -.button { - @include button-active; -} - -.button.disabled { - @include button; -} diff --git a/home/services/ags/style/music.scss b/home/services/ags/style/music.scss deleted file mode 100644 index fe43083..0000000 --- a/home/services/ags/style/music.scss +++ /dev/null @@ -1,54 +0,0 @@ -.music.window { - @include window; - - .cover { - background-position: center; - background-size: cover; - border-radius: $round; - box-shadow: 0 1px 2px -1px $bg; - margin: 0.4rem; - min-height: 13rem; - min-width: 13rem; - } -} - -.music.window .info { - margin: 0.5rem; - - label, - scale { - margin: 0.3rem 0; - } - - label.position, - label.length { - font-size: 0.8rem; - margin-bottom: 0; - } - - scale { - margin-top: 0; - margin-bottom: 0; - } - - .title { - font-size: 1.5rem; - font-weight: bold; - min-width: 14rem; - } -} - -.music.window .controls { - button { - margin: 0 0.2rem; - font-size: 1.5rem; - } -} - -.music.window .player-info { - margin-bottom: 0; - - .player-icon { - font-size: 1.2rem; - } -} diff --git a/home/services/ags/style/notifications.scss b/home/services/ags/style/notifications.scss deleted file mode 100644 index 6846db4..0000000 --- a/home/services/ags/style/notifications.scss +++ /dev/null @@ -1,57 +0,0 @@ -.notification { - @include window; - margin: 5px 5px 5px 10px; - - min-width: 25rem; - - border-radius: $round2; - background-color: $bg; - - &.critical { - border: 1px solid red; - } -} - -.notifications widget:last-child .notification { - margin-bottom: 15px; -} - -.notification .icon { - image { - font-size: 5rem; - margin: 0.5rem; - min-height: 5rem; - min-width: 5rem; - } - - > box { - border-radius: $round; - margin: 0.5rem; - min-height: 5rem; - min-width: 5rem; - } -} - -.notification .actions .action-button { - @include window-box; - @include animate; - padding: 0.5rem 0; - - &:hover { - background: $button-disabled-hover; - } -} - -.notification .text { - margin: 0.5rem; - - .title { - margin-bottom: 0.2rem; - font-weight: 500; - } - - .body { - color: rgba(255, 255, 255, 0.7); - font-weight: 500; - } -} diff --git a/home/services/ags/style/osd.scss b/home/services/ags/style/osd.scss deleted file mode 100644 index 6a88930..0000000 --- a/home/services/ags/style/osd.scss +++ /dev/null @@ -1,25 +0,0 @@ -.osd { - @include window; - border-radius: 3rem; - box-shadow: none; - margin-bottom: 5rem; - padding: 0.5rem; - - image { - font-size: 3rem; - margin: 0.5rem; - } - - box { - margin: 0.5rem; - } - - label { - margin: 0 0 0.5rem; - } - - progressbar trough { - margin: 0.5rem 0.5rem 0; - min-width: 10rem; - } -} diff --git a/home/services/ags/style/prelude.scss b/home/services/ags/style/prelude.scss deleted file mode 100644 index ae254b4..0000000 --- a/home/services/ags/style/prelude.scss +++ /dev/null @@ -1,5 +0,0 @@ -/* get rid of GTK theme's styles and set defaults */ -* { - all: unset; - font-family: Inter, Roboto, sans-serif; -} diff --git a/home/services/ags/style/system-menu.scss b/home/services/ags/style/system-menu.scss deleted file mode 100644 index d9d9115..0000000 --- a/home/services/ags/style/system-menu.scss +++ /dev/null @@ -1,75 +0,0 @@ -/* general */ -.system-menu { - @include window; - margin-top: 4px; - margin-right: 4px; - - & > box { - @include window-box; - } -} - -/* toggles */ -.system-menu .toggle { - min-width: 20rem; - &:not(:last-child) { - margin-bottom: 0.3rem; - } - - .button { - margin-right: 0.5rem; - } -} - -/* power profiles */ -.system-menu .power-profiles { - padding: 0; - - .current-profile { - padding: 0.3rem; - } - - image, - label { - margin: 0.3rem; - } - - .options { - padding: 0; - - widget { - @include button; - border-radius: 0; - - &:last-child { - border-radius: 0 0 $round $round; - } - - box { - padding: 0.3rem; - } - } - } -} - -/* sliders */ -.system-menu .sliders { - image { - margin: 0.3rem; - } - - scale { - margin: 0 0.5rem; - } -} - -.system-menu .battery-box { - image, - label { - margin: 0 0.3rem; - } - - .time { - color: rgba(255, 255, 255, 0.7); - } -} diff --git a/home/services/ags/tsconfig.json b/home/services/ags/tsconfig.json deleted file mode 100644 index 6860767..0000000 --- a/home/services/ags/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "ES2022", - "lib": [ - "ES2022" - ], - "allowJs": true, - "checkJs": true, - "strict": true, - "noImplicitAny": false, - "baseUrl": ".", - "typeRoots": [ - "./types" - ], - "skipLibCheck": true - } -} diff --git a/home/services/ags/utils/audio.js b/home/services/ags/utils/audio.js deleted file mode 100644 index df1921e..0000000 --- a/home/services/ags/utils/audio.js +++ /dev/null @@ -1,30 +0,0 @@ -import { Audio, Icons } from "../imports.js"; - -export const audioIcon = () => { - if (Audio.speaker?.stream.isMuted) return Icons.volume.muted; - - const vol = Audio.speaker?.volume * 100; - const icon = [ - [101, "overamplified"], - [67, "high"], - [34, "medium"], - [1, "low"], - [0, "muted"], - ].find(([threshold]) => threshold <= vol)[1]; - - return Icons.volume[icon]; -}; - -export const micIcon = () => { - if (Audio.microphone?.stream.isMuted) return Icons.microphone.muted; - - const vol = Audio.microphone?.volume * 100; - const icon = [ - [67, "high"], - [34, "medium"], - [1, "low"], - [0, "muted"], - ].find(([threshold]) => threshold <= vol)[1]; - - return Icons.microphone[icon]; -}; diff --git a/home/services/ags/utils/battery.js b/home/services/ags/utils/battery.js deleted file mode 100644 index a933564..0000000 --- a/home/services/ags/utils/battery.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Battery } from "../imports.js"; - -export const toTime = (time) => { - const MINUTE = 60; - const HOUR = MINUTE * 60; - - if (time > 24 * HOUR) return ""; - - const hours = Math.round(time / HOUR); - const minutes = Math.round((time - hours * HOUR) / MINUTE); - - const hoursDisplay = hours > 0 ? `${hours}h ` : ""; - const minutesDisplay = minutes > 0 ? `${minutes}m ` : ""; - - return `${hoursDisplay}${minutesDisplay}`; -}; - -export const batteryTime = () => { - return Battery.timeRemaining > 0 && toTime(Battery.timeRemaining) != "" - ? `${toTime(Battery.timeRemaining)}remaining` - : ""; -}; diff --git a/home/services/ags/utils/bluetooth.js b/home/services/ags/utils/bluetooth.js deleted file mode 100644 index df8236e..0000000 --- a/home/services/ags/utils/bluetooth.js +++ /dev/null @@ -1,27 +0,0 @@ -import { Bluetooth, Icons } from "../imports.js"; - -export const getBluetoothDevice = (addr) => - Bluetooth.getDevice(addr).alias ?? Bluetooth.getDevice(addr).name; - -export const getBluetoothIcon = (connected) => { - if (!Bluetooth.enabled) return Icons.bluetooth.disabled; - if (connected.length > 0) return Icons.bluetooth.active; - return Icons.bluetooth.disconnected; -}; - -export const getBluetoothText = (connected) => { - if (!Bluetooth.enabled) return "Bluetooth off"; - - if (connected.length > 0) { - const dev = Bluetooth.getDevice(connected[0].address); - let battery_str = ""; - - if (dev.battery_percentage > 0) { - battery_str += ` ${dev.battery_percentage}%`; - } - - return dev.name + battery_str; - } - - return "Bluetooth on"; -}; diff --git a/home/services/ags/utils/hyprland.js b/home/services/ags/utils/hyprland.js deleted file mode 100644 index 24e713d..0000000 --- a/home/services/ags/utils/hyprland.js +++ /dev/null @@ -1,106 +0,0 @@ -import { Hyprland } from "../imports.js"; - -export let DEFAULT_MONITOR; -const connID = Hyprland.connect("notify::workspaces", () => { - Hyprland.disconnect(connID); - - DEFAULT_MONITOR = { - name: Hyprland.monitors[0].name, - id: Hyprland.monitors[0].id, - }; -}); - -export const changeWorkspace = (ws) => Hyprland.messageAsync(`dispatch workspace ${ws}`); - -export const focusedSwitch = (self) => { - const id = Hyprland.active.workspace.id; - if (self.lastFocused == id) return; - - self.children[self.lastFocused - 1].toggleClassName("focused", false); - self.children[id - 1].toggleClassName("focused", true); - self.lastFocused = id; -}; - -export const added = (self, name) => { - if (!name) return; - const ws = Hyprland.workspaces.find((e) => e.name == name); - const id = ws?.id ?? Number(name); - const child = self.children[id - 1]; - - child.monitor = { - name: ws?.monitor ?? DEFAULT_MONITOR.name, - id: ws?.monitorID ?? DEFAULT_MONITOR.id, - }; - - child.active = true; - child.toggleClassName(`monitor${child.monitor.id}`, true); - - // if this id is bigger than the last biggest id, visibilise all other ws before it - if (id > self.biggestId) { - for (let i = self.biggestId; i <= id; i++) { - self.children[i - 1].visible = true; - } - self.biggestId = id; - } -}; - -const makeInvisible = (self, id) => { - if (id <= 1) return; - - const child = self.children[id - 1]; - if (child.active) { - self.biggestId = id; - return; - } - - child.visible = false; - makeInvisible(self, id - 1); -}; - -export const removed = (self, name) => { - if (!name) return; - - const id = Number(name); - const child = self.children[id - 1]; - - child.toggleClassName(`monitor${child.monitor.id}`, false); - child.active = false; - - // if this id is the biggest id, unvisibilise it and all other inactives until the next active before it - if (id == self.biggestId) { - makeInvisible(self, id); - } -}; - -export const moveWorkspace = (self, data) => { - const [id, name] = data.split(","); - - const child = self.children[id - 1]; - - // remove previous monitor class - child.toggleClassName(`monitor${child.monitor.id}`, false); - - // add new monitor and class - const monitor = Hyprland.monitors.find((e) => e.name == name); - - child.monitor = { - name, - id: monitor?.id ?? DEFAULT_MONITOR.id, - }; - - print(`child ${id}: monitor ${name} ${child.monitor.id}`); - child.toggleClassName(`monitor${child.monitor.id}`, true); -}; - -export const sortWorkspaces = () => { - return Hyprland.workspaces - .sort((x, y) => { - return x.id - y.id; - }) - .filter((x) => { - return x.name.indexOf("special") == -1; - }); -}; - -export const getLastWorkspaceId = () => sortWorkspaces().slice(-1)[0].id; -export const workspaceActive = (id) => sortWorkspaces().some((e) => e.id == id); diff --git a/home/services/ags/utils/icons.js b/home/services/ags/utils/icons.js deleted file mode 100644 index 92ce7db..0000000 --- a/home/services/ags/utils/icons.js +++ /dev/null @@ -1,35 +0,0 @@ -export default { - bluetooth: { - active: "bluetooth-active-symbolic", - disabled: "bluetooth-disabled-symbolic", - disconnected: "bluetooth-disconnected-symbolic", - }, - - brightness: "display-brightness-symbolic", - - media: { - play: "media-playback-start-symbolic", - pause: "media-playback-pause-symbolic", - next: "media-skip-forward-symbolic", - previous: "media-skip-backward-symbolic", - - player: "multimedia-player-symbolic", - }, - - volume: { - muted: "audio-volume-muted-symbolic", - low: "audio-volume-low-symbolic", - medium: "audio-volume-medium-symbolic", - high: "audio-volume-high-symbolic", - overamplified: "audio-volume-overamplified-symbolic", - }, - - microphone: { - muted: "microphone-sensitivity-muted-symbolic", - low: "microphone-sensitivity-low-symbolic", - medium: "microphone-sensitivity-medium-symbolic", - high: "microphone-sensitivity-high-symbolic", - }, - - powerButton: "system-shutdown-symbolic", -}; diff --git a/home/services/ags/utils/mpris.js b/home/services/ags/utils/mpris.js deleted file mode 100644 index e5ab1af..0000000 --- a/home/services/ags/utils/mpris.js +++ /dev/null @@ -1,47 +0,0 @@ -import { Icons, Utils } from "../imports.js"; -import GLib from "gi://GLib"; - -export const findPlayer = (players) => { - // try to get the first active player - const activePlayer = players.find((p) => p.playBackStatus == "Playing"); - if (activePlayer != null) return activePlayer; - - // otherwise get the first "working" player - for (const p of players) { - if (p.title != "undefined") return p; - } -}; - -export const mprisStateIcon = (status) => { - const state = status == "Playing" ? "pause" : "play"; - return Icons.media[state]; -}; - -export const MEDIA_CACHE_PATH = Utils.CACHE_DIR + "/media"; -export const blurredPath = MEDIA_CACHE_PATH + "/blurred"; - -export const generateBackground = (cover_path) => { - const url = cover_path; - if (!url) return ""; - - const makeBg = (bg) => `background: center/cover url('${bg}')`; - - const blurred = blurredPath + - url.substring(MEDIA_CACHE_PATH.length); - - if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) { - return makeBg(blurred); - } - - Utils.ensureDirectory(blurredPath); - Utils.exec(`convert ${url} -blur 0x22 ${blurred}`); - - return makeBg(blurred); -}; - -export function lengthStr(length) { - const min = Math.floor(length / 60); - const sec = Math.floor(length % 60); - const sec0 = sec < 10 ? "0" : ""; - return `${min}:${sec0}${sec}`; -} diff --git a/home/services/ags/utils/net.js b/home/services/ags/utils/net.js deleted file mode 100644 index e397f36..0000000 --- a/home/services/ags/utils/net.js +++ /dev/null @@ -1,27 +0,0 @@ -import { Network } from "../imports.js"; - -export const getNetIcon = (conn) => { - if (conn == "none") return ""; - if (Network.primary == "wired") return "network-wired"; - - return Network.wifi.icon_name; -}; - -export const getNetText = () => { - // no connection - if (Network.connectivity == "none") return "No connection"; - - // wired - if (Network.primary == "wired") return "Wired"; - - // wifi - const wifi = Network.wifi; - switch (wifi.internet) { - case "connected": - return wifi.ssid; - case "connecting": - return "Connecting"; - case "disconnected": - return "Disconnected"; - } -}; diff --git a/home/services/ags/utils/popup_window.js b/home/services/ags/utils/popup_window.js deleted file mode 100644 index e3d235b..0000000 --- a/home/services/ags/utils/popup_window.js +++ /dev/null @@ -1,50 +0,0 @@ -import App from "resource:///com/github/Aylur/ags/app.js"; -import { Widget } from "../imports.js"; -const { Box, Revealer, Window } = Widget; - -export default ( - { - name, - child, - revealerSetup = null, - transition = "crossfade", - transitionDuration = 200, - ...props - }, -) => { - const window = Window({ - name, - popup: false, - focusable: false, - visible: false, - ...props, - - setup: (self) => self.getChild = () => child, - - child: Box({ - css: ` - min-height: 1px; - min-width: 1px; - padding: 1px; - `, - child: Revealer({ - transition, - transitionDuration, - child: child, - - setup: revealerSetup ?? ((self) => - self - .hook( - App, - (self, currentName, visible) => { - if (currentName === name) { - self.reveal_child = visible; - } - }, - )), - }), - }), - }); - - return window; -}; diff --git a/home/services/ags/windows/bar/main.js b/home/services/ags/windows/bar/main.js deleted file mode 100644 index 081356f..0000000 --- a/home/services/ags/windows/bar/main.js +++ /dev/null @@ -1,77 +0,0 @@ -import { App, Widget } from "../../imports.js"; -import Battery from "./modules/battery.js"; -import Bluetooth from "./modules/bluetooth.js"; -import Date from "./modules/date.js"; -import Music from "./modules/music.js"; -import Net from "./modules/net.js"; -import CpuRam from "./modules/cpu_ram.js"; -import Tray from "./modules/tray.js"; -import Workspaces from "./modules/workspaces.js"; - -const SystemInfo = () => - Widget.EventBox({ - className: "system-menu-toggler", - onPrimaryClick: () => App.toggleWindow("system-menu"), - - child: Widget.Box({ - children: [ - Net(), - Bluetooth(), - Battery(), - ], - }), - }) - .hook( - App, - (self, window, visible) => { - if (window === "system-menu") { - self.toggleClassName("active", visible); - } - }, - ); - -const Start = () => - Widget.Box({ - hexpand: true, - hpack: "start", - children: [ - Workspaces(), - // Indicators - ], - }); - -const Center = () => - Widget.Box({ - children: [ - Music(), - ], - }); - -const End = () => - Widget.Box({ - hexpand: true, - hpack: "end", - - children: [ - Tray(), - CpuRam(), - SystemInfo(), - Date(), - ], - }); - -export default () => - Widget.Window({ - monitor: 0, - name: `bar`, - anchor: ["top", "left", "right"], - exclusivity: "exclusive", - - child: Widget.CenterBox({ - className: "bar", - - startWidget: Start(), - centerWidget: Center(), - endWidget: End(), - }), - }); diff --git a/home/services/ags/windows/bar/modules/battery.js b/home/services/ags/windows/bar/modules/battery.js deleted file mode 100644 index 5dba54e..0000000 --- a/home/services/ags/windows/bar/modules/battery.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Battery, Widget } from "../../../imports.js"; - -export default () => - Widget.Icon({ className: "battery module" }) - .bind("icon", Battery, "icon-name") - .bind("tooltip-text", Battery, "percent", (p) => `Battery on ${p}%`); diff --git a/home/services/ags/windows/bar/modules/bluetooth.js b/home/services/ags/windows/bar/modules/bluetooth.js deleted file mode 100644 index b47b891..0000000 --- a/home/services/ags/windows/bar/modules/bluetooth.js +++ /dev/null @@ -1,10 +0,0 @@ -import { Bluetooth, Widget } from "../../../imports.js"; -import { - getBluetoothIcon, - getBluetoothText, -} from "../../../utils/bluetooth.js"; - -export default () => - Widget.Icon({ className: "bluetooth module" }) - .bind("icon", Bluetooth, "connected-devices", getBluetoothIcon) - .bind("tooltip-text", Bluetooth, "connected-devices", getBluetoothText); diff --git a/home/services/ags/windows/bar/modules/cpu_ram.js b/home/services/ags/windows/bar/modules/cpu_ram.js deleted file mode 100644 index 1b96075..0000000 --- a/home/services/ags/windows/bar/modules/cpu_ram.js +++ /dev/null @@ -1,78 +0,0 @@ -import { Utils, Widget } from "../../../imports.js"; - -const Indicator = (props) => - Widget.Box({ - vertical: true, - vexpand: true, - vpack: "center", - - children: [ - Widget.Label({ - className: "type", - label: props.type, - }), - Widget.Label({ className: "value" }) - .poll(2000, props.poll), - ], - }).poll(2000, props.boxpoll); - -const cpu = { - type: "CPU", - - poll: (self) => - Utils.execAsync([ - "sh", - "-c", - `top -bn1 | rg '%Cpu' | tail -1 | awk '{print 100-$8}'`, - ]) - .then((r) => (self.label = Math.round(Number(r)) + "%")) - .catch((err) => print(err)), - - boxpoll: (self) => - Utils.execAsync([ - "sh", - "-c", - "lscpu --parse=MHZ", - ]) - .then((r) => { - const mhz = r.split("\n").slice(4); - const freq = mhz.reduce((acc, e) => acc + Number(e), 0) / mhz.length; - self.tooltipText = Math.round(freq) + " MHz"; - }) - .catch((err) => print(err)), -}; - -const ram = { - type: "MEM", - poll: (self) => - Utils.execAsync([ - "sh", - "-c", - `free | tail -2 | head -1 | awk '{print $3/$2*100}'`, - ]) - .then((r) => (self.label = Math.round(Number(r)) + "%")) - .catch((err) => print(err)), - - boxpoll: (self) => - Utils.execAsync([ - "sh", - "-c", - "free --si -h | tail -2 | head -1 | awk '{print $3}'", - ]) - .then((r) => self.tooltipText = r) - .catch((err) => print(err)), -}; - -export default () => - Widget.EventBox({ - onPrimaryClick: () => Utils.execAsync(["missioncenter"]), - - child: Widget.Box({ - className: "system-info module", - - children: [ - Indicator(cpu), - Indicator(ram), - ], - }), - }); diff --git a/home/services/ags/windows/bar/modules/date.js b/home/services/ags/windows/bar/modules/date.js deleted file mode 100644 index 60d19e4..0000000 --- a/home/services/ags/windows/bar/modules/date.js +++ /dev/null @@ -1,13 +0,0 @@ -import { Utils, Widget } from "../../../imports.js"; - -export default () => - Widget.EventBox({ - child: Widget.Label({ className: "date module" }) - .poll( - 1000, - (self) => - Utils.execAsync(["date", "+%a %b %d %H:%M"]).then((r) => - self.label = r - ), - ), - }); diff --git a/home/services/ags/windows/bar/modules/music.js b/home/services/ags/windows/bar/modules/music.js deleted file mode 100644 index 69dd682..0000000 --- a/home/services/ags/windows/bar/modules/music.js +++ /dev/null @@ -1,48 +0,0 @@ -import { Mpris, Widget } from "../../../imports.js"; -import App from "resource:///com/github/Aylur/ags/app.js"; -import { findPlayer } from "../../../utils/mpris.js"; - -const Cover = (player) => - Widget.Box({ className: "cover" }) - .bind( - "css", - player, - "cover-path", - (cover) => `background-image: url('${cover ?? ""}');`, - ); - -const Title = (player) => - Widget.Label({ className: "title module" }) - .bind( - "label", - player, - "track-title", - (title) => (title ?? "") == "Unknown title" ? "" : title, - ); - -export const MusicBox = (player) => - Widget.Box({ - children: [ - Cover(player), - Title(player), - ], - }); - -export default () => - Widget.EventBox({ - className: "music", - onPrimaryClick: () => App.toggleWindow("music"), - }) - .hook( - App, - (self, window, visible) => { - if (window === "music") { - self.toggleClassName("active", visible); - } - }, - ) - .bind("visible", Mpris, "players", (p) => p.length > 0) - .bind("child", Mpris, "players", (players) => { - if (players.length == 0) return Widget.Box(); - return MusicBox(findPlayer(players)); - }); diff --git a/home/services/ags/windows/bar/modules/net.js b/home/services/ags/windows/bar/modules/net.js deleted file mode 100644 index 89f19e1..0000000 --- a/home/services/ags/windows/bar/modules/net.js +++ /dev/null @@ -1,17 +0,0 @@ -import { Network, Widget } from "../../../imports.js"; -import { getNetIcon, getNetText } from "../../../utils/net.js"; - -export default () => - Widget.Icon({ className: "net module" }) - .bind( - "icon", - Network, - "connectivity", - getNetIcon, - ) - .bind( - "tooltip-text", - Network, - "connectivity", - getNetText, - ); diff --git a/home/services/ags/windows/bar/modules/tray.js b/home/services/ags/windows/bar/modules/tray.js deleted file mode 100644 index f0f5dec..0000000 --- a/home/services/ags/windows/bar/modules/tray.js +++ /dev/null @@ -1,43 +0,0 @@ -import { SystemTray, Widget } from "../../../imports.js"; -import Gdk from "gi://Gdk?version=3.0"; - -const Item = (item) => - Widget.Button({ - child: Widget.Icon().bind("icon", item, "icon"), - - onPrimaryClick: (_, ev) => { - try { - item.activate(ev); - } catch (err) { - print(err); - } - }, - - setup: (self) => { - const id = item.menu?.connect("popped-up", (menu) => { - self.toggleClassName("active"); - menu.connect("notify::visible", (menu) => { - self.toggleClassName("active", menu.visible); - }); - menu.disconnect(id); - }); - - if (id) { - self.connect("destroy", () => item.menu?.disconnect(id)); - } - - self.bind("tooltip-markup", item, "tooltip-markup"); - }, - - onSecondaryClick: (btn) => - item.menu?.popup_at_widget( - btn, - Gdk.Gravity.SOUTH, - Gdk.Gravity.NORTH, - null, - ), - }); - -export default () => - Widget.Box({ className: "tray module" }) - .bind("children", SystemTray, "items", (items) => items.map(Item)); diff --git a/home/services/ags/windows/bar/modules/workspaces.js b/home/services/ags/windows/bar/modules/workspaces.js deleted file mode 100644 index a68e135..0000000 --- a/home/services/ags/windows/bar/modules/workspaces.js +++ /dev/null @@ -1,68 +0,0 @@ -import { Hyprland, Widget } from "../../../imports.js"; -import { - added, - changeWorkspace, - DEFAULT_MONITOR, - focusedSwitch, - getLastWorkspaceId, - moveWorkspace, - removed, - workspaceActive, -} from "../../../utils/hyprland.js"; - -globalThis.hyprland = Hyprland; - -const makeWorkspaces = () => - [...Array(10)].map((_, i) => { - const id = i + 1; - - return Widget.Button({ - onPrimaryClick: () => changeWorkspace(id), - - visible: getLastWorkspaceId() >= id, - - setup: (self) => { - const ws = Hyprland.getWorkspace(id); - self.id = id; - self.active = workspaceActive(id); - self.monitor = DEFAULT_MONITOR; - - if (self.active) { - self.monitor = { - name: ws?.monitor ?? DEFAULT_MONITOR.name, - id: ws?.monitorID ?? DEFAULT_MONITOR.id, - }; - self.toggleClassName(`monitor${self.monitor.id}`, true); - } - }, - }); - }); - -export default () => - Widget.EventBox({ - onScrollUp: () => changeWorkspace("+1"), - onScrollDown: () => changeWorkspace("-1"), - - child: Widget.Box({ - className: "workspaces module", - - // The Hyprland service is ready later than ags is done parsing the config, - // so only build the widget when we receive a signal from it. - setup: (self) => { - const connID = Hyprland.connect("notify::workspaces", () => { - Hyprland.disconnect(connID); - - self.children = makeWorkspaces(); - self.lastFocused = Hyprland.active.workspace.id; - self.biggestId = getLastWorkspaceId(); - self - .hook(Hyprland.active.workspace, focusedSwitch) - .hook(Hyprland, added, "workspace-added") - .hook(Hyprland, removed, "workspace-removed") - .hook(Hyprland, (self, name, data) => { - if (name === "moveworkspace") moveWorkspace(self, data); - }, "event"); - }); - }, - }), - }); diff --git a/home/services/ags/windows/music/controls.js b/home/services/ags/windows/music/controls.js deleted file mode 100644 index 10d20cd..0000000 --- a/home/services/ags/windows/music/controls.js +++ /dev/null @@ -1,29 +0,0 @@ -import { Icons, Widget } from "../../imports.js"; -import { mprisStateIcon } from "../../utils/mpris.js"; - -export default (player) => - Widget.CenterBox({ - className: "controls", - hpack: "center", - - startWidget: Widget.Button({ - onClicked: () => player.previous(), - child: Widget.Icon(Icons.media.previous), - }), - - centerWidget: Widget.Button({ - onClicked: () => player.playPause(), - - child: Widget.Icon().bind( - "icon", - player, - "play-back-status", - mprisStateIcon, - ), - }), - - endWidget: Widget.Button({ - onClicked: () => player.next(), - child: Widget.Icon(Icons.media.next), - }), - }); diff --git a/home/services/ags/windows/music/cover.js b/home/services/ags/windows/music/cover.js deleted file mode 100644 index 800b81f..0000000 --- a/home/services/ags/windows/music/cover.js +++ /dev/null @@ -1,10 +0,0 @@ -import { Widget } from "../../imports.js"; - -export default (player) => - Widget.Box({ className: "cover" }) - .bind( - "css", - player, - "cover-path", - (cover) => `background-image: url('${cover ?? ""}')`, - ); diff --git a/home/services/ags/windows/music/main.js b/home/services/ags/windows/music/main.js deleted file mode 100644 index b4d74b9..0000000 --- a/home/services/ags/windows/music/main.js +++ /dev/null @@ -1,58 +0,0 @@ -import { Mpris, Widget } from "../../imports.js"; -import { findPlayer, generateBackground } from "../../utils/mpris.js"; -import PopupWindow from "../../utils/popup_window.js"; - -import Cover from "./cover.js"; -import { Artists, Title } from "./title_artists.js"; -import TimeInfo from "./time_info.js"; -import Controls from "./controls.js"; -import PlayerInfo from "./player_info.js"; - -const Info = (player) => - Widget.Box({ - className: "info", - vertical: true, - vexpand: false, - hexpand: false, - homogeneous: true, - - children: [ - PlayerInfo(player), - Title(player), - Artists(player), - Controls(player), - TimeInfo(player), - ], - }); - -const MusicBox = (player) => - Widget.Box({ - className: "music window", - children: [ - Cover(player), - Info(player), - ], - }) - .bind( - "css", - player, - "cover-path", - generateBackground, - ); - -export default () => - PopupWindow({ - monitor: 0, - anchor: ["top"], - name: "music", - child: Widget.Box(), - }) - .bind( - "child", - Mpris, - "players", - (players) => { - if (players.length == 0) return Widget.Box(); - return MusicBox(findPlayer(players)); - }, - ); diff --git a/home/services/ags/windows/music/player_info.js b/home/services/ags/windows/music/player_info.js deleted file mode 100644 index d30f9df..0000000 --- a/home/services/ags/windows/music/player_info.js +++ /dev/null @@ -1,27 +0,0 @@ -import { Icons, Utils, Widget } from "../../imports.js"; - -export default (player) => - Widget.Box({ - className: "player-info", - vexpand: true, - vpack: "start", - - children: [ - Widget.Icon({ - hexpand: true, - hpack: "end", - className: "player-icon", - tooltipText: player.identity ?? "", - }) - .bind( - "icon", - player, - "entry", - (entry) => { - // the Spotify icon is called spotify-client - if (entry == "spotify") entry = "spotify-client"; - return Utils.lookUpIcon(entry ?? "") ? entry : Icons.media.player; - }, - ), - ], - }); diff --git a/home/services/ags/windows/music/time_info.js b/home/services/ags/windows/music/time_info.js deleted file mode 100644 index 5936551..0000000 --- a/home/services/ags/windows/music/time_info.js +++ /dev/null @@ -1,73 +0,0 @@ -import { Widget } from "../../imports.js"; -import { lengthStr } from "../../utils/mpris.js"; - -export const PositionLabel = (player) => - Widget.Label({ - className: "position", - hexpand: true, - xalign: 0, - - setup: (self) => { - const update = (_, time) => { - player.length > 0 - ? self.label = lengthStr(time || player.position) - : self.visible = !!player; - }; - - self - .hook(player, update, "position") - .poll(1000, update); - }, - }); - -export const LengthLabel = (player) => - Widget.Label({ - className: "length", - hexpand: true, - xalign: 1, - }) - .bind("visible", player, "length", (length) => length > 0) - .bind("label", player, "length", (length) => lengthStr(length)); - -export const Position = (player) => - Widget.Slider({ - className: "position", - draw_value: false, - - onChange: ({ value }) => player.position = player.length * value, - - setup: (self) => { - const update = () => { - if (self.dragging) return; - - self.visible = player.length > 0; - - if (player.length > 0) { - self.value = player.position / player.length; - } - }; - - self - .hook(player, update) - .hook(player, update, "position") - .poll(1000, update); - }, - }); - -export default (player) => - Widget.Box({ - vertical: true, - vexpand: true, - vpack: "end", - - children: [ - Widget.Box({ - hexpand: true, - children: [ - PositionLabel(player), - LengthLabel(player), - ], - }), - Position(player), - ], - }); diff --git a/home/services/ags/windows/music/title_artists.js b/home/services/ags/windows/music/title_artists.js deleted file mode 100644 index dd6c19b..0000000 --- a/home/services/ags/windows/music/title_artists.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Widget } from "../../imports.js"; - -export const Title = (player) => - Widget.Scrollable({ - className: "title", - vscroll: "never", - hscroll: "automatic", - - child: Widget.Label({ - className: "title", - label: "Nothing playing", - }) - .bind( - "label", - player, - "track-title", - (title) => title ?? "Nothing playing", - ), - }); - -export const Artists = (player) => - Widget.Scrollable({ - className: "artists", - vscroll: "never", - hscroll: "automatic", - - child: Widget.Label({ className: "artists" }) - .bind( - "label", - player, - "track-artists", - (artists) => artists.join(", ") ?? "", - ), - }); diff --git a/home/services/ags/windows/notifications/popups.js b/home/services/ags/windows/notifications/popups.js deleted file mode 100644 index 736d0cf..0000000 --- a/home/services/ags/windows/notifications/popups.js +++ /dev/null @@ -1,141 +0,0 @@ -import { Hyprland, Notifications, Utils, Widget } from "../../imports.js"; - -const closeAll = () => { - Notifications.popups.map(n => n.dismiss()); -}; - -/** @param {import("types/service/notifications").Notification} n */ -const NotificationIcon = ({ app_entry, app_icon, image }) => { - if (image) { - return Widget.Box({ - css: ` - background-image: url("${image}"); - background-size: contain; - background-repeat: no-repeat; - background-position: center; - `, - }); - } - - if (Utils.lookUpIcon(app_icon)) { - return Widget.Icon(app_icon); - } - - if (app_entry && Utils.lookUpIcon(app_entry)) { - return Widget.Icon(app_entry); - } - - return null; -}; - -/** @param {import('types/service/notifications').Notification} n */ -export const Notification = (n) => { - const icon = Widget.Box({ - vpack: "start", - class_name: "icon", - // @ts-ignore - setup: self => { - let icon = NotificationIcon(n); - if (icon !== null) { - self.child = icon; - } - }, - }); - - const title = Widget.Label({ - class_name: "title", - xalign: 0, - justification: "left", - hexpand: true, - max_width_chars: 24, - truncate: "end", - wrap: true, - label: n.summary, - use_markup: true, - }); - - const body = Widget.Label({ - class_name: "body", - hexpand: true, - use_markup: true, - xalign: 0, - justification: "left", - max_width_chars: 100, - wrap: true, - label: n.body, - }); - - const actions = Widget.Box({ - class_name: "actions", - children: n.actions.filter(({ id }) => id != "default").map(({ id, label }) => - Widget.Button({ - class_name: "action-button", - on_clicked: () => n.invoke(id), - hexpand: true, - child: Widget.Label(label), - }) - ), - }); - - return Widget.EventBox({ - on_primary_click: () => { - if (n.actions.length > 0) n.invoke(n.actions[0].id); - }, - on_middle_click: closeAll, - on_secondary_click: () => n.dismiss(), - child: Widget.Box({ - class_name: `notification ${n.urgency}`, - vertical: true, - - children: [ - Widget.Box({ - class_name: "info", - children: [ - icon, - Widget.Box({ - vertical: true, - class_name: "text", - vpack: "center", - - setup: self => { - if (n.body.length > 0) { - self.children = [title, body]; - } else { - self.children = [title]; - } - }, - }), - ], - }), - actions, - ], - }), - }); -}; - -let lastMonitor; -export const notificationPopup = () => - Widget.Window({ - name: "notifications", - anchor: ["top", "right"], - child: Widget.Box({ - css: "padding: 1px;", - class_name: "notifications", - vertical: true, - // @ts-ignore - children: Notifications.bind("popups").transform((popups) => { - return popups.map(Notification); - }), - }), - }) - .hook( - Hyprland.active, - (self) => { - // prevent useless resets - if (lastMonitor === Hyprland.active.monitor) return; - - self.monitor = Hyprland.active.monitor.id; - }, - ); - -export default notificationPopup; diff --git a/home/services/ags/windows/osd/main.js b/home/services/ags/windows/osd/main.js deleted file mode 100644 index d4b8977..0000000 --- a/home/services/ags/windows/osd/main.js +++ /dev/null @@ -1,97 +0,0 @@ -import App from "resource:///com/github/Aylur/ags/app.js"; -import { Audio, Hyprland, Widget } from "../../imports.js"; - -import Brightness from "../../services/brightness.js"; -import Indicators from "../../services/osd.js"; -import PopupWindow from "../../utils/popup_window.js"; - -// connections -Audio.connect("speaker-changed", () => - Audio.speaker.connect( - "changed", - () => { - if (!App.getWindow("system-menu")?.visible) { - Indicators.speaker(); - } - }, - )); -Audio.connect( - "microphone-changed", - () => Audio.microphone.connect("changed", () => Indicators.mic()), -); - -Brightness.connect("screen-changed", () => { - if (!App.getWindow("system-menu")?.visible) { - Indicators.display(); - } -}); - -let lastMonitor; - -const child = () => - Widget.Box({ - hexpand: true, - visible: false, - className: "osd", - - children: [ - Widget.Icon().hook( - Indicators, - (self, props) => self.icon = props?.icon ?? "", - ), - Widget.Box({ - hexpand: true, - vertical: true, - children: [ - Widget.Label({ - hexpand: false, - truncate: "end", - max_width_chars: 24, - }) - .hook( - Indicators, - (self, props) => self.label = props?.label ?? "", - ), - - Widget.ProgressBar({ - hexpand: true, - vertical: false, - }) - .hook( - Indicators, - (self, props) => { - self.value = props?.value ?? 0; - self.visible = props?.showProgress ?? false; - }, - ), - ], - }), - ], - }); - -export default () => - PopupWindow({ - name: "osd", - monitor: 0, - layer: "overlay", - child: child(), - click_through: true, - anchor: ["bottom"], - revealerSetup: (self) => - self - .hook(Indicators, (revealer, _, visible) => { - revealer.reveal_child = visible; - }), - }) - .hook( - Hyprland.active, - (self) => { - // prevent useless resets - if (lastMonitor === Hyprland.active.monitor) return; - - self.monitor = Hyprland.active.monitor.id; - }, - ) - .hook(Indicators, (win, _, visible) => { - win.visible = visible; - }); diff --git a/home/services/ags/windows/system-menu/battery_info.js b/home/services/ags/windows/system-menu/battery_info.js deleted file mode 100644 index 2bf8052..0000000 --- a/home/services/ags/windows/system-menu/battery_info.js +++ /dev/null @@ -1,65 +0,0 @@ -import { App, Battery, Icons, Utils, Widget } from "../../imports.js"; -import { batteryTime } from "../../utils/battery.js"; - -const batteryEnergy = () => { - return Battery.energyRate > 0.1 ? `${Battery.energyRate.toFixed(1)} W ` : ""; -}; - -const BatteryIcon = () => - Widget.Icon() - .bind("icon", Battery, "percent", () => Battery.iconName) - .bind("tooltip-text", Battery, "energy-rate", batteryEnergy); - -const BatteryPercent = () => - Widget.Label() - .bind( - "label", - Battery, - "percent", - (percent) => `${percent}%`, - ); - -const BatteryTime = () => - Widget.Label({ - className: "time", - vexpand: true, - vpack: "center", - }) - .bind("label", Battery, "charging", batteryTime) - .bind("label", Battery, "energy-rate", batteryTime); - -const BatteryBox = () => - Widget.Box({ - className: "battery-box", - visible: Battery.available, - - children: [ - BatteryIcon(), - BatteryPercent(), - BatteryTime(), - ], - }); - -const PowerButton = () => - Widget.Button({ - className: "button disabled", - hexpand: true, - hpack: "end", - - onPrimaryClick: () => { - App.toggleWindow("system-menu"); - Utils.exec("wlogout"); - }, - - child: Widget.Icon(Icons.powerButton), - }); - -export default () => - Widget.Box({ - className: "battery-info", - - children: [ - BatteryBox(), - PowerButton(), - ], - }); diff --git a/home/services/ags/windows/system-menu/main.js b/home/services/ags/windows/system-menu/main.js deleted file mode 100644 index 3dce37d..0000000 --- a/home/services/ags/windows/system-menu/main.js +++ /dev/null @@ -1,28 +0,0 @@ -import { Widget } from "../../imports.js"; -import PopupWindow from "../../utils/popup_window.js"; - -import Toggles from "./toggles.js"; -import PowerProfiles from "./powerprofiles.js"; -import Sliders from "./sliders.js"; -import BatteryInfo from "./battery_info.js"; - -const SystemMenuBox = () => - Widget.Box({ - className: "system-menu", - vertical: true, - - children: [ - Toggles(), - PowerProfiles(), - Sliders(), - BatteryInfo(), - ], - }); - -export default () => - PopupWindow({ - monitor: 0, - anchor: ["top", "right"], - name: "system-menu", - child: SystemMenuBox(), - }); diff --git a/home/services/ags/windows/system-menu/powerprofiles.js b/home/services/ags/windows/system-menu/powerprofiles.js deleted file mode 100644 index 92fb8dc..0000000 --- a/home/services/ags/windows/system-menu/powerprofiles.js +++ /dev/null @@ -1,86 +0,0 @@ -import { PowerProfiles, Variable, Widget } from "../../imports.js"; - -const showList = Variable(false); - -const Profile = (args) => - Widget.EventBox({ - onPrimaryClick: args.primaryClickAction, - hexpand: true, - child: Widget.Box({ - ...args.props ?? {}, - hexpand: true, - hpack: "start", - - children: [ - Widget.Icon({ - icon: args.icon ?? "", - setup: args.iconSetup, - }), - Widget.Label({ - label: args.label ?? "", - setup: args.labelSetup, - }), - ], - }), - }); - -const prettyName = (n) => - n.charAt(0).toUpperCase() + - n.substring(1).replace("-", " "); - -const makeProfiles = (profiles) => - profiles.map((e) => - Profile({ - primaryClickAction: () => { - PowerProfiles.activeProfile = e.Profile; - showList.value = false; - }, - icon: `power-profile-${e.Profile}-symbolic`, - label: prettyName(e.Profile), - }) - ); - -const ActiveProfile = () => - Profile({ - props: { - className: "current-profile", - }, - primaryClickAction: () => showList.value = !showList.value, - iconSetup: (self) => self.bind("icon", PowerProfiles, "icon-name"), - labelSetup: (self) => - self.bind("label", PowerProfiles, "active-profile", prettyName), - }); - -const ProfileRevealer = () => - Widget.Revealer({ - revealChild: false, - transition: "slide_down", - - child: Widget.Box({ - className: "options", - vertical: true, - }) - .bind( - "children", - PowerProfiles, - "profiles", - makeProfiles, - ), - }) - .bind("reveal-child", showList); - -export default () => - Widget.Box({ - className: "power-profiles", - vertical: true, - - children: [ - Widget.Box({ - vertical: true, - children: [ - ActiveProfile(), - ProfileRevealer(), - ], - }), - ], - }); diff --git a/home/services/ags/windows/system-menu/sliders.js b/home/services/ags/windows/system-menu/sliders.js deleted file mode 100644 index 175eaf8..0000000 --- a/home/services/ags/windows/system-menu/sliders.js +++ /dev/null @@ -1,77 +0,0 @@ -import { App, Audio, Icons, Utils, Widget } from "../../imports.js"; -import Brightness from "../../services/brightness.js"; -import { audioIcon } from "../../utils/audio.js"; - -const Slider = (args) => - Widget.Box({ - ...args.props ?? {}, - className: args.name, - - children: [ - Widget.Button({ - onPrimaryClick: args.icon.action ?? null, - child: Widget.Icon({ - icon: args.icon.icon ?? "", - setup: args.icon.setup, - }), - }), - Widget.Slider({ - drawValue: false, - hexpand: true, - setup: args.slider.setup, - onChange: args.slider.onChange ?? null, - }), - ], - }); - -const vol = () => { - return { - name: "volume", - icon: { - icon: "", - action: () => { - App.toggleWindow("system-menu"); - Utils.execAsync("pavucontrol"); - }, - setup: (self) => - self - .bind("icon", Audio.speaker, "volume", audioIcon) - .bind("icon", Audio.speaker.stream, "is-muted", audioIcon), - }, - slider: { - setup: (self) => self.bind("value", Audio.speaker, "volume"), - onChange: ({ value }) => Audio.speaker.volume = value, - }, - }; -}; - -const brightness = () => { - return { - name: "brightness", - icon: { - icon: Icons.brightness, - }, - slider: { - setup: (self) => self.bind("value", Brightness, "screen-value"), - onChange: ({ value }) => Brightness.screenValue = value, - }, - }; -}; - -export default () => - Widget.Box({ - className: "sliders", - vertical: true, - - // The Audio service is ready later than ags is done parsing the config, - // so only build the widget when we receive a signal from it. - setup: (self) => { - const connID = Audio.connect("notify::speaker", () => { - Audio.disconnect(connID); - self.children = [ - Slider(vol()), - Slider(brightness()), - ]; - }); - }, - }); diff --git a/home/services/ags/windows/system-menu/toggles.js b/home/services/ags/windows/system-menu/toggles.js deleted file mode 100644 index 69feb49..0000000 --- a/home/services/ags/windows/system-menu/toggles.js +++ /dev/null @@ -1,115 +0,0 @@ -import { App, Bluetooth, Network, Utils, Widget } from "../../imports.js"; - -import { getNetIcon, getNetText } from "../../utils/net.js"; -import { getBluetoothIcon, getBluetoothText } from "../../utils/bluetooth.js"; - -const Toggle = (args) => - Widget.Box({ - ...args.props ?? {}, - className: `toggle ${args.name}`, - hexpand: true, - hpack: "start", - - children: [ - Widget.Button({ - className: "button", - - child: Widget.Icon({ - setup: args.icon.setup, - }), - setup: args.icon.buttonSetup, - }), - Widget.Button({ - hexpand: true, - child: Widget.Label({ - hpack: "start", - setup: args.label.setup, - }), - setup: args.label.buttonSetup, - }), - ], - }); - -const net = { - name: "net", - icon: { - setup: (self) => - self - .bind("icon", Network, "connectivity", getNetIcon) - .bind("icon", Network.wifi, "icon-name", getNetIcon), - - buttonSetup: (self) => { - self.onPrimaryClick = () => Network.toggleWifi(); - self.hook( - Network, - (btn) => - btn.toggleClassName("disabled", Network.connectivity != "full"), - "notify::connectivity", - ); - }, - }, - label: { - setup: (self) => - self - .bind("label", Network, "connectivity", () => getNetText()) - .bind("label", Network.wifi, "ssid", () => getNetText()), - - buttonSetup: (self) => { - self.onPrimaryClick = () => { - App.toggleWindow("system-menu"); - Utils.execAsync([ - "sh", - "-c", - "XDG_CURRENT_DESKTOP=GNOME gnome-control-center", - ]); - }; - }, - }, -}; - -const bt = { - name: "bluetooth", - icon: { - setup: (self) => - self.bind( - "icon", - Bluetooth, - "connected-devices", - getBluetoothIcon, - ), - buttonSetup: (self) => { - self.onPrimaryClick = () => Bluetooth.toggle(); - self.hook( - Bluetooth, - (btn) => btn.toggleClassName("disabled", !Bluetooth.enabled), - "notify::enabled", - ); - }, - }, - label: { - setup: (self) => - self.bind( - "label", - Bluetooth, - "connected-devices", - getBluetoothText, - ), - buttonSetup: (self) => { - self.onPrimaryClick = () => { - App.toggleWindow("system-menu"); - Utils.execAsync("overskride"); - }; - }, - }, -}; - -export default () => - Widget.Box({ - className: "toggles", - vertical: true, - - children: [ - Toggle(net), - Toggle(bt), - ], - }); diff --git a/home/services/default.nix b/home/services/default.nix index 1af2f34..bc43fc9 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,6 +1,5 @@ _: { imports = [ - ./ags ./media ./system ./wayland diff --git a/home/services/system/default.nix b/home/services/system/default.nix index 5e300d0..d5f9b3f 100644 --- a/home/services/system/default.nix +++ b/home/services/system/default.nix @@ -3,7 +3,6 @@ ./dunst.nix ./polkit-agent.nix ./power-monitor.nix - ./screensht.nix ./udiskie.nix ]; } diff --git a/home/services/system/dunst.nix b/home/services/system/dunst.nix index de631dd..e20348b 100644 --- a/home/services/system/dunst.nix +++ b/home/services/system/dunst.nix @@ -1,22 +1,11 @@ -{ - config, - pkgs, - ... -}: { - # notification daemon - services.dunst = let - xcolors = pkgs.lib.colors.xcolors config.programs.matugen.theme.colors; - variant = config.theme.name; - c = xcolors.colors.${variant}; - in { +_: { + services.dunst = { enable = true; - inherit (config.gtk) iconTheme; settings = { global = { alignment = "center"; corner_radius = 16; follow = "mouse"; - font = "Inter 9"; format = "%s\\n%b"; frame_width = 1; offset = "5x5"; @@ -30,7 +19,6 @@ mouse_right_click = "close_current"; padding = 8; plain_text = "no"; - separator_color = "auto"; separator_height = 1; show_indicators = false; shrink = "no"; @@ -38,22 +26,6 @@ }; fullscreen_delay_everything = {fullscreen = "delay";}; - - urgency_critical = { - background = c.error_container; - foreground = c.on_error_container; - frame_color = c.error; - }; - urgency_low = { - background = c.secondary_container; - foreground = c.on_secondary_container; - frame_color = c.secondary; - }; - urgency_normal = { - background = c.primary_container; - foreground = c.on_primary_container; - frame_color = c.primary; - }; }; }; } diff --git a/home/services/system/screensht.nix b/home/services/system/screensht.nix deleted file mode 100644 index 69368e5..0000000 --- a/home/services/system/screensht.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - inputs, - pkgs, - ... -}: { - imports = [inputs.sss.nixosModules.home-manager]; - - programs.sss = { - enable = true; - - # General Config - general = let - xcolors = pkgs.lib.colors.xcolors config.programs.matugen.theme.colors; - variant = config.theme.name; - c = xcolors.colors.${variant}; - in { - author = " lonen"; - # copy = true; - colors = { - background = c.on_secondary_fixed; - author = c.secondary; - shadow = c.background; - }; - fonts = "LigaSFMono Nerd Font=11.0"; - radius = 8; - save-format = "webp"; - shadow = true; - shadow-image = true; - }; - }; -} diff --git a/home/services/wayland/default.nix b/home/services/wayland/default.nix index 7ec235e..c2a69f3 100644 --- a/home/services/wayland/default.nix +++ b/home/services/wayland/default.nix @@ -1,6 +1,5 @@ _: { imports = [ ./hypridle.nix - ./hyprpaper.nix ]; } diff --git a/home/services/wayland/hypridle.nix b/home/services/wayland/hypridle.nix index 90abd1a..894f264 100644 --- a/home/services/wayland/hypridle.nix +++ b/home/services/wayland/hypridle.nix @@ -15,14 +15,16 @@ in { # screen idle services.hypridle = { enable = true; - beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session"; - lockCmd = lib.getExe config.programs.hyprlock.package; + settings = { + beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session"; + lockCmd = lib.getExe config.programs.hyprlock.package; - listeners = [ - { - timeout = 1200; - onTimeout = suspendScript.outPath; - } - ]; + listeners = [ + { + timeout = 1200; + onTimeout = suspendScript.outPath; + } + ]; + }; }; } diff --git a/home/services/wayland/hyprpaper.nix b/home/services/wayland/hyprpaper.nix deleted file mode 100644 index 90f2619..0000000 --- a/home/services/wayland/hyprpaper.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - inputs, - lib, - config, - ... -}: { - xdg.configFile."hypr/hyprpaper.conf".text = '' - preload = ${config.theme.wallpaper} - wallpaper = , ${config.theme.wallpaper} - ''; - - systemd.user.services.hyprpaper = { - Unit = { - Description = "Hyprland wallpaper daemon"; - PartOf = ["graphical-session.target"]; - }; - Service = { - ExecStart = "${lib.getExe inputs.hyprpaper.packages.${pkgs.system}.default}"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; -} diff --git a/home/software/anyrun/default.nix b/home/software/anyrun/default.nix deleted file mode 100644 index 8809726..0000000 --- a/home/software/anyrun/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - pkgs, - inputs, - config, - ... -}: { - imports = [ - inputs.anyrun.homeManagerModules.default - ]; - - programs.anyrun = { - enable = true; - - config = { - plugins = with inputs.anyrun.packages.${pkgs.system}; [ - applications - randr - rink - shell - symbols - ]; - - width.fraction = 0.3; - y.absolute = 20; - hidePluginInfo = true; - closeOnClick = true; - }; - - extraCss = builtins.readFile (./. + "/style-${config.theme.name}.css"); - - extraConfigFiles."applications.ron".text = '' - Config( - desktop_actions: false, - max_entries: 5, - terminal: Some("foot"), - ) - ''; - }; -} diff --git a/home/software/anyrun/style-dark.css b/home/software/anyrun/style-dark.css deleted file mode 100644 index efa12b6..0000000 --- a/home/software/anyrun/style-dark.css +++ /dev/null @@ -1,68 +0,0 @@ -* { - all: unset; - font-size: 1.3rem; -} - -#window, -#match, -#entry, -#plugin, -#main { - background: transparent; -} - -#match.activatable { - border-radius: 16px; - padding: 0.3rem 0.9rem; - margin-top: 0.01rem; -} -#match.activatable:first-child { - margin-top: 0.7rem; -} -#match.activatable:last-child { - margin-bottom: 0.6rem; -} - -#plugin:hover #match.activatable { - border-radius: 10px; - padding: 0.3rem; - margin-top: 0.01rem; - margin-bottom: 0; -} - -#match:selected, -#match:hover, -#plugin:hover { - background: rgba(255, 255, 255, 0.1); -} - -#entry { - background: rgba(255, 255, 255, 0.05); - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 16px; - margin: 0.5rem; - padding: 0.3rem 1rem; -} - -list > #plugin { - border-radius: 16px; - margin: 0 0.3rem; -} -list > #plugin:first-child { - margin-top: 0.3rem; -} -list > #plugin:last-child { - margin-bottom: 0.3rem; -} -list > #plugin:hover { - padding: 0.6rem; -} - -box#main { - background: rgba(0, 0, 0, 0.5); - box-shadow: - inset 0 0 0 1px rgba(255, 255, 255, 0.1), - 0 0 0 1px rgba(0, 0, 0, 0.5); - border-radius: 24px; - padding: 0.3rem; -} diff --git a/home/software/anyrun/style-light.css b/home/software/anyrun/style-light.css deleted file mode 100644 index 2efc367..0000000 --- a/home/software/anyrun/style-light.css +++ /dev/null @@ -1,74 +0,0 @@ -* { - all: unset; - font-size: 1.3rem; - color: black; -} - -#window, -#match, -#entry, -#plugin, -#main { - background: transparent; -} - -#match.activatable { - border-radius: 16px; - padding: 0.3rem 0.9rem; - margin-top: 0.01rem; -} -#match.activatable:first-child { - margin-top: 0.7rem; -} -#match.activatable:last-child { - margin-bottom: 0.6rem; -} - -#plugin:hover #match.activatable { - border-radius: 10px; - padding: 0.3rem; - margin-top: 0.01rem; - margin-bottom: 0; -} - -#match:selected, -#match:hover, -#plugin:hover { - background: rgba(255, 255, 255, 0.3); -} - -#entry { - background: rgba(255, 255, 255, 0.3); - border: 1px solid rgba(0, 0, 0, 0.1); - border-radius: 16px; - margin: 0.5rem; - padding: 0.3rem 1rem; -} - -#match:selected, -#match:hover { - box-shadow: 0 1px 5px -5px rgba(0, 0, 0, 0.5); -} - -list > #plugin { - border-radius: 16px; - margin: 0 0.3rem; -} -list > #plugin:first-child { - margin-top: 0.3rem; -} -list > #plugin:last-child { - margin-bottom: 0.3rem; -} -list > #plugin:hover { - padding: 0.6rem; -} - -box#main { - background: rgba(255, 255, 255, 0.5); - box-shadow: - 0 0 0 1px rgba(0, 0, 0, 0.1), - inset 0 0 0 1px rgba(255, 255, 255, 0.1); - border-radius: 24px; - padding: 0.3rem; -} diff --git a/home/software/browsers/chrome.nix b/home/software/browsers/chrome/default.nix similarity index 100% rename from home/software/browsers/chrome.nix rename to home/software/browsers/chrome/default.nix diff --git a/home/software/browsers/chromium.nix b/home/software/browsers/chromium.nix deleted file mode 100644 index 8ae8905..0000000 --- a/home/software/browsers/chromium.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - programs.chromium = { - enable = true; - commandLineArgs = ["--enable-features=TouchpadOverscrollHistoryNavigation"]; - extensions = [ - {id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} - {id = "bkkmolkhemgaeaeggcmfbghljjjoofoh";} - ]; - }; -} diff --git a/home/software/browsers/default.nix b/home/software/browsers/default.nix index 5c174ee..e83f80e 100644 --- a/home/software/browsers/default.nix +++ b/home/software/browsers/default.nix @@ -1,7 +1,7 @@ _: { imports = [ - ./chrome.nix - ./chromium.nix - ./firefox.nix + ./chrome + ./firefox + ./qutebrowser ]; } diff --git a/home/software/browsers/firefox.nix b/home/software/browsers/firefox.nix deleted file mode 100644 index cbaeae8..0000000 --- a/home/software/browsers/firefox.nix +++ /dev/null @@ -1,259 +0,0 @@ -{ - pkgs, - inputs, - ... -}: { - programs.firefox = { - enable = true; - package = pkgs.wrapFirefox pkgs.firefox-devedition-unwrapped { - extraPolicies = { - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - DisableFirefoxAccounts = true; - PromptForDownloadLocation = true; - }; - }; - profiles.default = { - id = 0; - name = "dev-edition-default"; - extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ - ublock-origin - bitwarden - sponsorblock - sidebery - ]; - search.force = true; - search.engines = { - "Home Manager NixOs" = { - urls = [ - { - template = "https://mipmip.github.io/home-manager-option-search/"; - params = [ - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; - icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@hm"]; - }; - "Nix Packages" = { - urls = [ - { - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; - icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@np"]; - }; - "NixOS Wiki" = { - urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = ["@nw"]; - }; - Bing.metaData.hidden = true; - "Amazon.com".metaData.hidden = true; - "Wikipedia (en)".metaData.hidden = true; - "Google".metaData.alias = "@g"; - }; - settings = { - # GENERAL - "content.notify.interval" = 100000; - # GFX - "gfx.canvas.accelerated.cache-items" = 4096; - "gfx.canvas.accelerated.cache-size" = 512; - "gfx.content.skia-font-cache-size" = 20; - # DISK CACHE - "browser.cache.jsbc_compression_level" = 3; - # MEDIA CACHE - "media.memory_cache_max_size" = 65536; - "media.cache_readahead_limit" = 7200; - "media.cache_resume_treshold" = 3600; - # IMAGE CACHE - "image.mem.decode_bytes_at_a_time" = 32768; - # NETWORK - "network.buffer.cache.size" = 262144; - "network.buffer.cache.count" = 128; - "network.http.max-connections" = 1800; - "network.http.max-persistent-connections-per-server" = 10; - "network.http.max-urgent-start-excessive-connections-per-host" = 5; - "network.http.pacing.requests.enabled" = false; - "network.dnsCacheExpiration" = 3600; - "network.dns.max_high_priority_threads" = 8; - "network.ssl_tokens_cache_capacity" = 10240; - # SPECULATIVE LOADING - "network.dns.disablePrefetch" = true; - "network.prefetch-next" = false; - "network.predictor.enabled" = false; - # EXPERIMENTAL - "layout.css.grid-template-masonry-value.enabled" = true; - "dom.enable_web_task_scheduling" = true; - "layout.css.has-selector.enabled" = true; - "dom.security.sanitizer.enabled" = true; - # SECUREFOX - # TRACKING PROTECTION - "browser.contentblocking.category" = "strict"; - "urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com"; - "urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com"; - "network.cookie.sameSite.noneRequiresSecure" = true; - "browser.download.start_downloads_in_tmp_dir" = true; - "browser.helperApps.deleteTempFileOnExit" = true; - "browser.uitour.enabled" = false; - "privacy.globalprivacycontrol.enabled" = true; - "privacy.globalprivacycontrol.functionality.enabled" = true; - # OCSP & CERTS / HPKP - "security.OCSP.enabled" = 0; - "security.remote_settings.crlite_filters.enabled" = true; - "security.pki.crlite_mode" = 2; - # SSL / TLS - "security.ssl.treat_unsafe_negotiation_as_broken" = true; - "browser.xul.error_pages.expert_bad_cert" = true; - "security.tls.enable_0rtt_data" = false; - # DISK AVOIDANCE - "browser.privatebrowsing.forceMediaMemoryCache" = true; - "browser.sessionstore.interval" = 60000; - # SHUTDOWN & SANITIZING - "privacy.history.custom" = true; - # SEARCH / URL BAR - "browser.search.separatePrivateDefault.ui.enabled" = true; - "browser.urlbar.update2.engineAliasRefresh" = true; - "browser.search.suggest.enabled" = false; - "browser.urlbar.suggest.quicksuggest.sponsored" = false; - "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; - "browser.formfill.enable" = false; - "security.insecure_connection_text.enabled" = true; - "security.insecure_connection_text.pbmode.enabled" = true; - "network.IDN_show_punycode" = true; - # HTTPS-FIRST POLICY - "dom.security.https_first" = true; - # PASSWORDS - "signon.rememberSignons" = false; - "signon.formlessCapture.enabled" = false; - "signon.privateBrowsingCapture.enabled" = false; - "network.auth.subresource-http-auth-allow" = 1; - "editor.truncate_user_pastes" = false; - # ADDRESS + CREDIT CARD MANAGER - "extensions.formautofill.addresses.enabled" = false; - "extensions.formautofill.creditCards.enabled" = false; - # MIXED CONTENT + CROSS-SITE - "security.mixed_content.block_display_content" = true; - "security.mixed_content.upgrade_display_content" = true; - "security.mixed_content.upgrade_display_content.image" = true; - "pdfjs.enableScripting" = false; - "extensions.postDownloadThirdPartyPrompt" = false; - # HEADERS / REFERERS - "network.http.referer.XOriginTrimmingPolicy" = 2; - # CONTAINERS - "privacy.userContext.ui.enabled" = true; - # WEBRTC - "media.peerconnection.ice.proxy_only_if_behind_proxy" = true; - "media.peerconnection.ice.default_address_only" = true; - # SAFE BROWSING - "browser.safebrowsing.downloads.remote.enabled" = false; - # MOZILLA - "permissions.default.desktop-notification" = 2; - "permissions.default.geo" = 2; - "geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"; - "permissions.manager.defaultsUrl" = ""; - "webchannel.allowObject.urlWhitelist" = ""; - # TELEMETRY - "datareporting.policy.dataSubmissionEnabled" = false; - "datareporting.healthreport.uploadEnabled" = false; - "toolkit.telemetry.unified" = false; - "toolkit.telemetry.enabled" = false; - "toolkit.telemetry.server" = "data:,"; - "toolkit.telemetry.archive.enabled" = false; - "toolkit.telemetry.newProfilePing.enabled" = false; - "toolkit.telemetry.shutdownPingSender.enabled" = false; - "toolkit.telemetry.updatePing.enabled" = false; - "toolkit.telemetry.bhrPing.enabled" = false; - "toolkit.telemetry.firstShutdownPing.enabled" = false; - "toolkit.telemetry.coverage.opt-out" = true; - "toolkit.coverage.opt-out" = true; - "toolkit.coverage.endpoint.base" = ""; - "browser.ping-centre.telemetry" = false; - "browser.newtabpage.activity-stream.feeds.telemetry" = false; - "browser.newtabpage.activity-stream.telemetry" = false; - # EXPERIMENTS - "app.shield.optoutstudies.enabled" = false; - "app.normandy.enabled" = false; - "app.normandy.api_url" = ""; - # CRASH REPORTS - "breakpad.reportURL" = ""; - "browser.tabs.crashReporting.sendReport" = false; - "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; - # DETECTION - "captivedetect.canonicalURL" = ""; - "network.captive-portal-service.enabled" = false; - "network.connectivity-service.enabled" = false; - # PESKYFOX - # MOZILLA UI - "browser.privatebrowsing.vpnpromourl" = ""; - "extensions.getAddons.showPane" = false; - "extensions.htmlaboutaddons.recommendations.enabled" = false; - "browser.discovery.enabled" = false; - "browser.shell.checkDefaultBrowser" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; - "browser.preferences.moreFromMozilla" = false; - "browser.tabs.tabmanager.enabled" = false; - "browser.aboutConfig.showWarning" = false; - "browser.aboutwelcome.enabled" = false; - # THEME ADJUSTMENTS - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "browser.compactmode.show" = true; - "browser.display.focus_ring_on_anything" = true; - "browser.display.focus_ring_style" = 0; - "browser.display.focus_ring_width" = 0; - "layout.css.prefers-color-scheme.content-override" = 2; - "layout.css.devPixelsPerPx" = 1.35; - "browser.privateWindowSeparation.enabled" = false; # WINDOWS - # COOKIE BANNER HANDLING - "cookiebanners.service.mode" = 1; - "cookiebanners.service.mode.privateBrowsing" = 1; - "cookiebanners.service.enableGlobalRules" = true; - # FULLSCREEN NOTICE - "full-screen-api.transition-duration.enter" = "0 0"; - "full-screen-api.transition-duration.leave" = "0 0"; - "full-screen-api.warning.delay" = -1; - "full-screen-api.warning.timeout" = 0; - # URL BAR - "browser.urlbar.suggest.calculator" = true; - "browser.urlbar.unitConversion.enabled" = true; - "browser.urlbar.trending.featureGate" = false; - # NEW TAB PAGE - "browser.newtabpage.activity-stream.feeds.topsites" = false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - # POCKET - "extensions.pocket.enabled" = false; - # DOWNLOADS - "browser.download.useDownloadDir" = false; - "browser.download.always_ask_before_handling_new_types" = true; - "browser.download.manager.addToRecentDocs" = false; - # PDF - "browser.download.open_pdf_attachments_inline" = true; - # TAB BEHAVIOR - "browser.bookmarks.openInTabClosesMenu" = false; - "browser.menu.showViewImageInfo" = true; - "findbar.highlightAll" = true; - "layout.word_select.eat_space_to_next_word" = false; - - "intl.accept_languages" = "pt-BR, pt, en-US, en"; - }; - }; - }; -} diff --git a/home/software/browsers/firefox/default.nix b/home/software/browsers/firefox/default.nix new file mode 100644 index 0000000..1cd97eb --- /dev/null +++ b/home/software/browsers/firefox/default.nix @@ -0,0 +1,5 @@ +_: { + programs.firefox = { + enable = true; + }; +} diff --git a/home/software/browsers/qutebrowser/default.nix b/home/software/browsers/qutebrowser/default.nix new file mode 100644 index 0000000..1c8c92b --- /dev/null +++ b/home/software/browsers/qutebrowser/default.nix @@ -0,0 +1,35 @@ +{ + lib, + pkgs, + config, + ... +}: { + #xdg.mimeApps.defaultApplications = { + # "text/html" = ["org.qutebrowser.qutebrowser.desktop"]; + # "text/xml" = ["org.qutebrowser.qutebrowser.desktop"]; + # "x-scheme-handler/http" = ["org.qutebrowser.qutebrowser.desktop"]; + # "x-scheme-handler/https" = ["org.qutebrowser.qutebrowser.desktop"]; + # "x-scheme-handler/qute" = ["org.qutebrowser.qutebrowser.desktop"]; + #}; + + programs.qutebrowser = { + enable = true; + loadAutoconfig = true; + settings = { + downloads.open_dispatcher = "${lib.getExe pkgs.handlr-regex} open {}"; + editor.command = ["${lib.getExe pkgs.handlr-regex}" "open" "{file}"]; + tabs = { + show = "multiple"; + position = "left"; + indicator.width = 0; + }; + }; + extraConfig = '' + c.tabs.padding = {"bottom": 10, "left": 10, "right": 10, "top": 10} + ''; + }; + + xdg.configFile."qutebrowser/config.py".onChange = lib.mkForce '' + ${pkgs.procps}/bin/pkill -u $USER -HUP qutebrowser || true + ''; +} diff --git a/home/software/default.nix b/home/software/default.nix index 32e32b8..5ffd832 100644 --- a/home/software/default.nix +++ b/home/software/default.nix @@ -1,11 +1,6 @@ -{ - pkgs, - inputs, - ... -}: { +{pkgs, ...}: { imports = [ # import folders first - ./anyrun ./browsers ./media ./terminal @@ -22,7 +17,6 @@ # personalizations nixos-icons - inputs.matugen.packages.${pkgs.system}.default # misc catimg @@ -32,11 +26,25 @@ imagemagick jq pciutils + ueberzugpp xcolor # ags mission-center dart-sass overskride + + # Languages + cmake + gcc + gnumake + gnupatch + clang-tools + elixir + go + nodejs + nodePackages.npm + php + typescript ]; } diff --git a/home/software/gtk.nix b/home/software/gtk.nix index 1660278..aa923d6 100644 --- a/home/software/gtk.nix +++ b/home/software/gtk.nix @@ -3,21 +3,8 @@ config, ... }: { - home.pointerCursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Original-Classic"; - size = 28; - gtk.enable = true; - x11.enable = true; - }; - gtk = { enable = true; - font = { - name = "Inter"; - package = pkgs.google-fonts.override {fonts = ["Inter"];}; - size = 12; - }; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; @@ -26,12 +13,6 @@ package = pkgs.whitesur-icon-theme; }; - theme = { - name = "Colloid-Dark"; - package = pkgs.colloid-gtk-theme.override { - tweaks = ["rimless" "black" "float"]; - }; - }; gtk3 = { bookmarks = [ "file://${config.home.homeDirectory}/Documents" @@ -40,6 +21,7 @@ "file://${config.home.homeDirectory}/Pictures" "file://${config.home.homeDirectory}/Videos" ]; + extraConfig = { gtk-xft-antialias = 1; gtk-xft-hinting = 1; diff --git a/home/software/media/default.nix b/home/software/media/default.nix index 13abde9..85c3535 100644 --- a/home/software/media/default.nix +++ b/home/software/media/default.nix @@ -1,13 +1,9 @@ -{pkgs, ...}: { +_: { imports = [ - ./mpv.nix - ./rnnoise.nix - ./spicetify.nix - ]; - - home.packages = with pkgs; [ - # audio control - pavucontrol - pulsemixer + ./gimp + ./mpv + ./rnnoise + ./spotify + ./vlc ]; } diff --git a/home/software/media/gimp/default.nix b/home/software/media/gimp/default.nix new file mode 100644 index 0000000..322ba6e --- /dev/null +++ b/home/software/media/gimp/default.nix @@ -0,0 +1,3 @@ +{pkgs, ...}: { + home.packages = with pkgs; [gimp-with-plugins]; +} diff --git a/home/software/media/mpv.nix b/home/software/media/mpv/default.nix similarity index 67% rename from home/software/media/mpv.nix rename to home/software/media/mpv/default.nix index ef9e569..da41168 100644 --- a/home/software/media/mpv.nix +++ b/home/software/media/mpv/default.nix @@ -2,6 +2,6 @@ programs.mpv = { enable = true; defaultProfiles = ["gpu-hq"]; - scripts = [pkgs.mpvScripts.mpris]; + scripts = with pkgs; [mpvScripts.mpris]; }; } diff --git a/home/software/media/rnnoise.nix b/home/software/media/rnnoise/default.nix similarity index 90% rename from home/software/media/rnnoise.nix rename to home/software/media/rnnoise/default.nix index eb07414..6b44341 100644 --- a/home/software/media/rnnoise.nix +++ b/home/software/media/rnnoise/default.nix @@ -6,8 +6,8 @@ { "name" = "libpipewire-module-filter-chain"; "args" = { - "node.description" = "Noise Canceling source"; - "media.name" = "Noise Canceling source"; + "node.description" = "Noise Canceling Source"; + "media.name" = "Noise Canceling Source"; "filter.graph" = { "nodes" = [ { diff --git a/home/software/media/spicetify.nix b/home/software/media/spotify/default.nix similarity index 52% rename from home/software/media/spicetify.nix rename to home/software/media/spotify/default.nix index 18452ce..9b8dee6 100644 --- a/home/software/media/spicetify.nix +++ b/home/software/media/spotify/default.nix @@ -3,25 +3,19 @@ pkgs, config, ... -}: { - # themable spotify - imports = [ - inputs.spicetify-nix.homeManagerModule - ]; +}: let + variant = + if config.stylix.polarity == "light" + then "latte" + else "mocha"; + spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; +in { + imports = [inputs.spicetify-nix.homeManagerModule]; - programs.spicetify = let - spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; - variant = - if config.theme.name == "light" - then "latte" - else "mocha"; - in { + programs.spicetify = { enable = true; - theme = spicePkgs.themes.Catppuccin; - colorScheme = variant; - enabledExtensions = with spicePkgs.extensions; [ adblock fullAppDisplay diff --git a/home/software/media/vlc/default.nix b/home/software/media/vlc/default.nix new file mode 100644 index 0000000..c1f4b2c --- /dev/null +++ b/home/software/media/vlc/default.nix @@ -0,0 +1,3 @@ +{pkgs, ...}: { + home.packages = with pkgs; [vlc]; +} diff --git a/home/software/terminal/emulators/alacritty.nix b/home/software/terminal/emulators/alacritty.nix deleted file mode 100644 index b9dc356..0000000 --- a/home/software/terminal/emulators/alacritty.nix +++ /dev/null @@ -1,35 +0,0 @@ -{pkgs, ...}: { - programs.alacritty = { - enable = true; - settings = { - window = { - decorations = "none"; - dynamic_padding = true; - padding = { - x = 5; - y = 5; - }; - startup_mode = "Maximized"; - }; - - scrolling.history = 10000; - - font = { - normal.family = "LigaSFMono Nerd Font"; - bold.family = "LigaSFMono Nerd Font Bold"; - italic.family = "LigaSFMono Nerd Font Italic"; - size = 16; - }; - - colors.draw_bold_text_with_bright_colors = true; - window.opacity = 0.9; - - imports = [ - (pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/alacritty/3c808cbb4f9c87be43ba5241bc57373c793d2f17/catppuccin-mocha.yml"; - hash = "sha256-28Tvtf8A/rx40J9PKXH6NL3h/OKfn3TQT1K9G8iWCkM="; - }) - ]; - }; - }; -} diff --git a/home/software/terminal/emulators/alacritty/default.nix b/home/software/terminal/emulators/alacritty/default.nix new file mode 100644 index 0000000..9f1c336 --- /dev/null +++ b/home/software/terminal/emulators/alacritty/default.nix @@ -0,0 +1,43 @@ +{lib, ...}: { + programs.alacritty = { + enable = true; + + settings = { + colors.draw_bold_text_with_bright_colors = true; + + cursor = { + vi_mode_style = { + shape = "Beam"; + blinking = "Always"; + }; + }; + + font = lib.mkForce { + normal.family = "DejaVu Sans Mono"; + size = 14; + }; + + keyboard.bindings = [ + { + key = "Escape"; + mods = "Alt"; + action = "ToggleViMode"; + } + ]; + + env = { + TERM = "xterm-256color"; # Better color support in some apps + }; + + scrolling.history = 10000; + + window = { + decorations = "none"; + dynamic_padding = true; + padding.x = 2; + padding.y = 2; + startup_mode = "Maximized"; + }; + }; + }; +} diff --git a/home/software/terminal/emulators/default.nix b/home/software/terminal/emulators/default.nix index c45ef5c..6b9fcd4 100644 --- a/home/software/terminal/emulators/default.nix +++ b/home/software/terminal/emulators/default.nix @@ -1,7 +1,6 @@ _: { imports = [ - ./alacritty.nix - ./foot.nix - ./kitty.nix + ./alacritty + ./foot ]; } diff --git a/home/software/terminal/emulators/foot.nix b/home/software/terminal/emulators/foot.nix deleted file mode 100644 index d3b6d69..0000000 --- a/home/software/terminal/emulators/foot.nix +++ /dev/null @@ -1,85 +0,0 @@ -{config, ...}: let - colors = { - dark = { - foreground = "cdd6f4"; # Text - background = "1e1e2e"; # Base - regular0 = "45475a"; # Surface 1 - regular1 = "f38ba8"; # red - regular2 = "a6e3a1"; # green - regular3 = "f9e2af"; # yellow - regular4 = "89b4fa"; # blue - regular5 = "f5c2e7"; # maroon - regular6 = "94e2d5"; # teal - regular7 = "bac2de"; # Subtext 1 - bright0 = "585b70"; # Surface 2 - bright1 = "f38ba8"; # red - bright2 = "a6e3a1"; # green - bright3 = "f9e2af"; # yellow - bright4 = "89b4fa"; # blue - bright5 = "f5c2e7"; # maroon - bright6 = "94e2d5"; # teal - bright7 = "a6adc8"; # Subtext 0 - }; - - light = { - foreground = "4c4f69"; # Text - background = "eff1f5"; # Base - regular0 = "bcc0cc"; # Surface 1 - regular1 = "d20f39"; # red - regular2 = "40a02b"; # green - regular3 = "df8e1d"; # yellow - regular4 = "1e66f5"; # blue - regular5 = "e64553"; # maroon - regular6 = "179299"; # teal - regular7 = "5c5f77"; # Subtext 1 - bright0 = "acb0be"; # Surface 2 - bright1 = "d20f39"; # red - bright2 = "40a02b"; # green - bright3 = "df8e1d"; # yellow - bright4 = "1e66f5"; # blue - bright5 = "e64553"; # maroon - bright6 = "179299"; # teal - bright7 = "6c6f85"; # Subtext 0 - }; - }; -in { - programs.foot = { - enable = true; - - settings = { - main = { - font = "LigaSFMono Nerd Font:size=16:fontfeatures=calt:fontfeatures=dlig:fontfeatures=liga"; - box-drawings-uses-font-glyphs = "yes"; - dpi-aware = "yes"; - pad = "5x5center"; - notify = "notify-send -a \${app-id} -i \${app-id} \${title} \${body}"; - selection-target = "clipboard"; - }; - - scrollback = { - lines = 10000; - multiplier = 5; - indicator-position = "none"; - }; - - url = { - launch = "xdg-open \${url}"; - label-letters = "sadfjklewcmpgh"; - osc8-underline = "url-mode"; - protocols = "http, https, ftp, ftps, file"; - uri-characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+=\"'()[]"; - }; - - cursor = { - style = "beam"; - beam-thickness = 1; - }; - - colors = - { - alpha = 0.9; - } - // colors.${config.theme.name}; - }; - }; -} diff --git a/home/software/terminal/emulators/foot/default.nix b/home/software/terminal/emulators/foot/default.nix new file mode 100644 index 0000000..4a36246 --- /dev/null +++ b/home/software/terminal/emulators/foot/default.nix @@ -0,0 +1,37 @@ +{lib, ...}: { + programs.foot = { + enable = true; + + settings = { + main = { + font = lib.mkForce "DejaVu Sans Mono:size=14"; + font-size-adjustment = 1; + dpi-aware = "no"; + pad = "5x5center"; + notify = "notify-send -a \${app-id} -i \${app-id} \${title} \${body}"; + }; + + mouse.hide-when-typing = "yes"; + + scrollback = { + lines = 10000; + multiplier = 5; + indicator-position = "none"; + }; + + url = { + launch = "xdg-open \${url}"; + label-letters = "sadfjklewcmpgh"; + osc8-underline = "url-mode"; + protocols = "http, https, ftp, ftps, file"; + uri-characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+=\"'()[]"; + }; + + cursor = { + color = "191724 e0def4"; + style = "beam"; + beam-thickness = 1; + }; + }; + }; +} diff --git a/home/software/terminal/emulators/kitty.nix b/home/software/terminal/emulators/kitty.nix deleted file mode 100644 index 0a52fe4..0000000 --- a/home/software/terminal/emulators/kitty.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - programs.kitty = { - enable = true; - font = { - size = 16; - name = "LigaSFMono Nerd Font"; - }; - - settings = { - scrollback_lines = 10000; - placement_strategy = "center"; - - window_padding_width = 5; - - allow_remote_control = "yes"; - enable_audio_bell = "no"; - visual_bell_duration = "0.1"; - - copy_on_select = "clipboard"; - - selection_foreground = "none"; - selection_background = "none"; - - # colors - background_opacity = "0.9"; - }; - - theme = "Rosé Pine"; - }; -} diff --git a/home/software/terminal/starship.nix b/home/software/terminal/starship.nix index 0b72efd..9e5de9c 100644 --- a/home/software/terminal/starship.nix +++ b/home/software/terminal/starship.nix @@ -11,7 +11,7 @@ git_status = { deleted = "✗"; - modified = "✶"; + modified = "✶ "; staged = "✓"; stashed = "≡"; }; diff --git a/home/software/terminal/tools/bat.nix b/home/software/terminal/tools/bat.nix deleted file mode 100644 index d138afd..0000000 --- a/home/software/terminal/tools/bat.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - config, - pkgs, - ... -}: let - variant = - if config.theme.name == "light" - then "latte" - else "mocha"; -in { - programs.bat = { - enable = true; - config = { - pager = "less -FR"; - theme = "Catppuccin-${variant}"; - }; - themes = let - src = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; - hash = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; - }; - in { - Catppuccin-mocha = { - inherit src; - file = "Catppuccin-mocha.tmTheme"; - }; - Catppuccin-latte = { - inherit src; - file = "Catppuccin-latte.tmTheme"; - }; - }; - }; - - home.sessionVariables = { - MANPAGER = "sh -c 'col -bx | bat -l man -p'"; - MANROFFOPT = "-c"; - }; -} diff --git a/home/software/terminal/tools/bat/default.nix b/home/software/terminal/tools/bat/default.nix new file mode 100644 index 0000000..0ca3730 --- /dev/null +++ b/home/software/terminal/tools/bat/default.nix @@ -0,0 +1,13 @@ +_: { + programs.bat = { + enable = true; + config = { + pager = "less -FR"; + }; + }; + + home.sessionVariables = { + MANPAGER = "sh -c 'col -bx | bat -l man -p'"; + MANROFFOPT = "-c"; + }; +} diff --git a/home/software/terminal/tools/bottom.nix b/home/software/terminal/tools/bottom/default.nix similarity index 100% rename from home/software/terminal/tools/bottom.nix rename to home/software/terminal/tools/bottom/default.nix diff --git a/home/software/terminal/tools/default.nix b/home/software/terminal/tools/default.nix index 410838c..e3e35c4 100644 --- a/home/software/terminal/tools/default.nix +++ b/home/software/terminal/tools/default.nix @@ -1,19 +1,16 @@ {pkgs, ...}: { imports = [ - # import folders first - ./yazi - - ./bat.nix - ./bottom.nix - ./git.nix - ./gpg.nix - ./inlyne.nix - ./nix.nix - ./skim.nix - ./screenshot-area.nix - ./screenshot-full.nix + ./bat + ./bottom + ./git + ./gpg + ./inlyne + ./neofetch + ./nix + ./skim ./transient-services.nix - ./xdg.nix + ./xdg + ./yazi ]; home.packages = with pkgs; [ @@ -23,7 +20,6 @@ unrar # media - amberol viewnior yt-dlp @@ -33,7 +29,6 @@ # utils bottom - du-dust duf fd file diff --git a/home/software/terminal/tools/git.nix b/home/software/terminal/tools/git/dA.nix similarity index 100% rename from home/software/terminal/tools/git.nix rename to home/software/terminal/tools/git/dA.nix diff --git a/home/software/terminal/tools/git/default.nix b/home/software/terminal/tools/git/default.nix new file mode 100644 index 0000000..b078b2a --- /dev/null +++ b/home/software/terminal/tools/git/default.nix @@ -0,0 +1,79 @@ +{ + pkgs, + config, + ... +}: let + cfg = config.programs.git; + key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIo9GDELaZbOouKRTTRYurcL9XF3JflFI/+h3FBKgASL glauber.silva14@gmail.com"; +in { + home.packages = [pkgs.gh]; + + # enable scrolling in git diff + home.sessionVariables.DELTA_PAGER = "less -R"; + + programs.git = { + enable = true; + lfs.enable = true; + + userName = "Glauber Santana"; + userEmail = "glauber.silva14@gmail.com"; + + signing = { + key = "${config.home.homeDirectory}/.ssh/id_ed25519"; + signByDefault = false; + }; + + delta = { + enable = true; + options.${config.stylix.polarity} = true; + }; + + extraConfig = { + init.defaultBranch = "main"; + diff.colorMoved = "default"; + merge.conflictstyle = "diff3"; + core.editor = "nvim"; + push.default = "current"; + repack.usedeltabaseoffset = "true"; + pull.ff = "only"; + pull.rebase = true; + + # https://git-scm.com/book/en/v2/Git-Tools-Rerere + rerere = { + enabled = true; + autoupdate = true; + }; + + gpg = { + format = "ssh"; + ssh.allowedSignersFile = config.home.homeDirectory + "/" + config.xdg.configFile."git/allowed_signers".target; + }; + }; + + aliases = { + a = "add"; + b = "branch"; + c = "commit"; + ca = "commit --amend"; + cm = "commit -m"; + co = "checkout"; + d = "diff"; + ds = "diff --staged"; + p = "push"; + pf = "push --force-with-lease"; + pl = "pull"; + l = "log"; + r = "rebase"; + s = "status"; + forgor = "commit --amend --no-edit"; + graph = "log --all --decorate --graph --oneline"; + oops = "checkout --"; + }; + + ignores = ["*~" "*result*" ".direnv" "node_modules"]; + }; + + xdg.configFile."git/allowed_signers".text = '' + ${cfg.userEmail} namespaces="git" ${key} + ''; +} diff --git a/home/software/terminal/tools/gpg.nix b/home/software/terminal/tools/gpg/default.nix similarity index 100% rename from home/software/terminal/tools/gpg.nix rename to home/software/terminal/tools/gpg/default.nix diff --git a/home/software/terminal/tools/inlyne.nix b/home/software/terminal/tools/inlyne.nix deleted file mode 100644 index 90c5449..0000000 --- a/home/software/terminal/tools/inlyne.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - pkgs, - config, - ... -}: let - c = config.programs.matugen.theme.colors.colors.${config.theme.name}; - - mde = pkgs.writeShellScriptBin "mde" '' - if [ ! -f "$1" ]; then - touch "$1" - fi - - hx "$1" & - inlyne "$1" & - - wait - ''; -in { - home.packages = [pkgs.inlyne mde]; - home.file.".config/inlyne/inlyne.toml".text = '' - theme = "Dark" - - [dark-theme] - text-color = 0x${c.on_background} - background-color = 0x14171b - code-color = 0x${c.secondary} - quote-block-color = 0x${c.secondary} - link-color = 0x${c.inverse_primary} - # select-color = 0x${c.primary} - # code-highlighter = "" - - [font-options] - regular-font = "Lexend" - monospace-font = "Maple Mono SC NF" - ''; -} diff --git a/home/software/terminal/tools/inlyne/default.nix b/home/software/terminal/tools/inlyne/default.nix new file mode 100644 index 0000000..5eb9213 --- /dev/null +++ b/home/software/terminal/tools/inlyne/default.nix @@ -0,0 +1,32 @@ +{ + pkgs, + config, + ... +}: let + mde = pkgs.writeShellScriptBin "mde" '' + if [ ! -f "$1" ]; then + touch "$1" + fi + + hx "$1" & + inlyne "$1" & + + wait + ''; + inherit (config.stylix) fonts; + colors = config.stylix.base16Scheme; +in { + home.packages = [pkgs.inlyne mde]; + home.file.".config/inlyne/inlyne.toml".text = '' + theme = "Dark" + [dark-theme] + background-color = 0x${colors.base00} + text-color = 0x${colors.base0E} + code-color = 0x${colors.base0A} + quote-block-color = 0x${colors.base0C} + link-color = 0x${colors.base08} + [font-options] + regular-font = "${fonts.sansSerif.name}" + monospace-font = "${fonts.monospace.name}" + ''; +} diff --git a/home/software/terminal/tools/neofetch.nix b/home/software/terminal/tools/neofetch/default.nix similarity index 98% rename from home/software/terminal/tools/neofetch.nix rename to home/software/terminal/tools/neofetch/default.nix index eceb576..8428502 100644 --- a/home/software/terminal/tools/neofetch.nix +++ b/home/software/terminal/tools/neofetch/default.nix @@ -10,7 +10,7 @@ info "\e[33m󰍛 " memory info "\e[32m " term info "\e[35m " de - prin "" "github.com/sglauber" + prin "" "github.com/glwbr" prin "$(mypad) $(color 1)▂▂ $(color 2)▂▂ $(color 3)▂▂ $(color 4)▂▂ $(color 5)▂▂ $(color 6)▂▂ $(color 7)▂▂ " prin _____________________ } diff --git a/home/software/terminal/tools/nix.nix b/home/software/terminal/tools/nix/default.nix similarity index 75% rename from home/software/terminal/tools/nix.nix rename to home/software/terminal/tools/nix/default.nix index 8766219..9b2d287 100644 --- a/home/software/terminal/tools/nix.nix +++ b/home/software/terminal/tools/nix/default.nix @@ -1,15 +1,10 @@ -{ - pkgs, - self, - ... -}: +{pkgs, ...}: # nix tooling { home.packages = with pkgs; [ alejandra deadnix statix - self.packages.${pkgs.system}.repl ]; programs.direnv = { diff --git a/home/software/terminal/tools/screenshot-area.nix b/home/software/terminal/tools/screenshot-area.nix deleted file mode 100644 index 9d937e9..0000000 --- a/home/software/terminal/tools/screenshot-area.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - pkgs, - config, - ... -}: let - screenshot-area = pkgs.writeShellScriptBin "screenshot-area" '' - screenshot_dir="${config.xdg.userDirs.pictures}/Screenshots" - - if [ ! -d "$screenshot_dir" ]; then - mkdir -p "$screenshot_dir" - fi - - workspaces=$(hyprctl monitors -j | jq -r 'map(.activeWorkspace.id)') - windows=$(hyprctl clients -j | jq -r --argjson workspaces "$workspaces" 'map(select([.workspace.id] | inside($workspaces)))') - - selected_area=$(echo "$windows" | jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | slurp) - - if [ -z "$selected_area" ]; then - notify-send "Error" "Screenshot Failed." - exit 1 - fi - - filename="$(date +%F-%H-%M-%S)-Screenshot.webp" - file_path="$screenshot_dir/$filename" - - sss --area "$selected_area" -o raw > "$file_path" - cat "$file_path" | wl-copy - - notify-send "Screenshot" "Screenshot Taken: $filename" -i "$file_path" - ''; -in { - home.packages = [screenshot-area]; -} diff --git a/home/software/terminal/tools/screenshot-full.nix b/home/software/terminal/tools/screenshot-full.nix deleted file mode 100644 index fb58087..0000000 --- a/home/software/terminal/tools/screenshot-full.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - pkgs, - config, - ... -}: let - screenshot-full = pkgs.writeShellScriptBin "screenshot-full" '' - screenshot_dir="${config.xdg.userDirs.pictures}/Screenshots" - - if [ ! -d "$screenshot_dir" ]; then - mkdir -p "$screenshot_dir" - fi - - screen_id=$(hyprctl monitors -j | jq -r ".[] | select(.focused == true) | .name") - - if [ -z "$screen_id" ]; then - notify-send "Error" "Screenshot Failed" - exit 1 - fi - - filename="$(date +%F-%H-%M-%S)-Screenshot.webp" - file_path="$screenshot_dir/$filename" - - sss --screen-id "$screen_id" -o raw >"$file_path" - cat "$file_path" | wl-copy - notify-send "Screenshot" "Screenshot Taken: $filename" -i "$file_path" - ''; -in { - home.packages = [screenshot-full]; -} diff --git a/home/software/terminal/tools/skim.nix b/home/software/terminal/tools/skim/default.nix similarity index 100% rename from home/software/terminal/tools/skim.nix rename to home/software/terminal/tools/skim/default.nix diff --git a/home/software/terminal/tools/xdg.nix b/home/software/terminal/tools/xdg/default.nix similarity index 100% rename from home/software/terminal/tools/xdg.nix rename to home/software/terminal/tools/xdg/default.nix diff --git a/home/software/terminal/tools/yazi/default.nix b/home/software/terminal/tools/yazi/default.nix index 020bbe0..40cf54f 100644 --- a/home/software/terminal/tools/yazi/default.nix +++ b/home/software/terminal/tools/yazi/default.nix @@ -10,7 +10,7 @@ ./theme/status.nix ]; - # general file info + # General file info home.packages = [pkgs.exiftool]; # yazi file manager @@ -21,25 +21,5 @@ enableBashIntegration = config.programs.bash.enable; enableZshIntegration = config.programs.zsh.enable; - - settings = { - manager = { - layout = [1 4 3]; - sort_by = "alphabetical"; - sort_sensitive = true; - sort_reverse = false; - sort_dir_first = true; - linemode = "none"; - show_hidden = false; - show_symlink = true; - }; - - preview = { - tab_size = 2; - max_width = 600; - max_height = 900; - cache_dir = "${config.xdg.cacheHome}"; - }; - }; }; } diff --git a/home/software/terminal/tools/yazi/theme/manager.nix b/home/software/terminal/tools/yazi/theme/manager.nix index 53e67a7..faec4b1 100644 --- a/home/software/terminal/tools/yazi/theme/manager.nix +++ b/home/software/terminal/tools/yazi/theme/manager.nix @@ -1,63 +1,45 @@ -{ - programs.yazi.theme.manager = { - cwd = {fg = "cyan";}; - - # Hovered - hovered = { - fg = "black"; - bg = "lightblue"; - }; - - preview_hovered = { - fg = "black"; - bg = "lightblue"; - }; - - # Find - find_keyword = { - fg = "yellow"; - italic = true; - }; - find_position = { - fg = "magenta"; - bg = "reset"; - italic = true; - }; - - # Marker - marker_selected = { - fg = "lightgreen"; - # bg = "lightgreen"; +{config, ...}: { + programs.yazi = { + settings = { + manager = { + layout = [1 4 3]; + sort_by = "alphabetical"; + sort_sensitive = true; + sort_reverse = false; + sort_dir_first = true; + linemode = "none"; + show_hidden = false; + show_symlink = true; + }; + + preview = { + tab_size = 2; + max_width = 600; + max_height = 900; + cache_dir = "${config.xdg.cacheHome}"; + }; + + theme.manager = { + # Find + find_keyword = { + italic = true; + }; + + find_position = { + bg = "reset"; + italic = true; + }; + + # Tab + tab_width = 1; + + # Border; + border_symbol = "│"; + + # Offset; + folder_offset = [1 0 1 0]; + preview_offset = [1 1 1 1]; + }; }; - marker_copied = { - fg = "lightyellow"; - # bg = "lightyellow"; - }; - marker_cut = { - fg = "lightred"; - # bg = "lightred"; - }; - - # Tab - tab_active = { - fg = "black"; - bg = "lightblue"; - }; - tab_inactive = { - fg = "white"; - bg = "darkgray"; - }; - tab_width = 1; - - # Border; - border_symbol = "│"; - border_style = {fg = "gray";}; - - # Offset; - folder_offset = [1 0 1 0]; - preview_offset = [1 1 1 1]; - - # Highlighting; - syntect_theme = ""; }; } diff --git a/home/software/terminal/tools/yazi/theme/status.nix b/home/software/terminal/tools/yazi/theme/status.nix index 7a47aa9..d95a9e3 100644 --- a/home/software/terminal/tools/yazi/theme/status.nix +++ b/home/software/terminal/tools/yazi/theme/status.nix @@ -1,45 +1,24 @@ -{ +_: { programs.yazi.theme.status = { separator_open = ""; separator_close = ""; - separator_style = { - fg = "darkgray"; - bg = "darkgray"; - }; # Mode; mode_normal = { - fg = "black"; - bg = "lightblue"; bold = true; }; + mode_select = { - fg = "black"; - bg = "lightgreen"; bold = true; }; + mode_unset = { - fg = "black"; - bg = "lightmagenta"; bold = true; }; # Progress; - progress_label = {bold = true;}; - progress_normal = { - fg = "blue"; - bg = "black"; - }; - progress_error = { - fg = "red"; - bg = "black"; + progress_label = { + bold = true; }; - - # Permissions; - permissions_t = {fg = "blue";}; - permissions_r = {fg = "lightyellow";}; - permissions_w = {fg = "lightred";}; - permissions_x = {fg = "lightgreen";}; - permissions_s = {fg = "darkgray";}; }; } diff --git a/home/software/utilities/default.nix b/home/software/utilities/default.nix index b8f4645..883fd73 100644 --- a/home/software/utilities/default.nix +++ b/home/software/utilities/default.nix @@ -1,9 +1,7 @@ -{pkgs, ...}: { +_: { imports = [ - ./zathura.nix - ]; - - home.packages = with pkgs; [ - obsidian + ./obsidian + ./rofi + ./zathura ]; } diff --git a/home/software/utilities/obsidian/default.nix b/home/software/utilities/obsidian/default.nix new file mode 100644 index 0000000..ff50805 --- /dev/null +++ b/home/software/utilities/obsidian/default.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + obsidian + ]; +} diff --git a/home/software/utilities/rofi/default.nix b/home/software/utilities/rofi/default.nix new file mode 100644 index 0000000..6895040 --- /dev/null +++ b/home/software/utilities/rofi/default.nix @@ -0,0 +1,120 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (pkgs) rofi-wayland; + inherit (lib) mkForce; + inherit (config.lib.formats.rasi) mkLiteral; + #inherit (config.lib.stylix.colors) base00 base05; +in { + programs.rofi = { + enable = true; + cycle = false; + + package = rofi-wayland; + + extraConfig = { + modi = "drun,filebrowser"; + font = "Noto Sans CJK JP 12"; + show-icons = true; + disable-history = true; + hover-select = true; + bw = 0; + display-drun = ""; + display-window = ""; + display-combi = ""; + icon-theme = "Fluent-dark"; + terminal = "kitty"; + drun-match-fields = "name"; + drun-display-format = "{name}"; + me-select-entry = ""; + me-accept-entry = "MousePrimary"; + }; + + # Based on Newman Sánchez's Launchpad theme + theme = mkForce { + "*" = { + font = "Noto Sans CJK JP Bold 12"; + background-color = mkLiteral "transparent"; + #foreground = mkLiteral "#${base05}"; + #text-color = mkLiteral "#${base05}"; + padding = mkLiteral "0px"; + margin = mkLiteral "0px"; + }; + + window = { + fullscreen = true; + padding = mkLiteral "1em"; + #background-color = mkLiteral "#${base00}dd"; + }; + + mainbox = { + padding = mkLiteral "8px"; + }; + + inputbar = { + #background-color = mkLiteral "#${base05}20"; + + margin = mkLiteral "0px calc( 50% - 230px )"; + padding = mkLiteral "4px 8px"; + spacing = mkLiteral "8px"; + + border = mkLiteral "1px"; + border-radius = mkLiteral "2px"; + #border-color = mkLiteral "#${base05}40"; + + children = map mkLiteral ["icon-search" "entry"]; + }; + + prompt = { + enabled = false; + }; + + icon-search = { + expand = false; + filename = "search"; + vertical-align = mkLiteral "0.5"; + }; + + entry = { + placeholder = "Search"; + #placeholder-color = mkLiteral "#${base05}20"; + }; + + listview = { + margin = mkLiteral "48px calc( 50% - 720px )"; + margin-bottom = mkLiteral "0px"; + spacing = mkLiteral "48px"; + columns = 6; + fixed-columns = true; + }; + + "element, element-text, element-icon" = { + cursor = mkLiteral "pointer"; + }; + + element = { + padding = mkLiteral "8px"; + spacing = mkLiteral "4px"; + + orientation = mkLiteral "vertical"; + border-radius = mkLiteral "12px"; + }; + + "element selected" = { + #background-color = mkLiteral "#${base05}33"; + }; + + element-icon = { + size = mkLiteral "5.75em"; + horizontal-align = mkLiteral "0.5"; + }; + + element-text = { + horizontal-align = mkLiteral "0.5"; + }; + }; + }; +} diff --git a/home/software/utilities/zathura.nix b/home/software/utilities/zathura.nix deleted file mode 100644 index 88dcbd8..0000000 --- a/home/software/utilities/zathura.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - pkgs, - config, - ... -}: { - programs.zathura = { - enable = true; - options = { - recolor-lightcolor = "rgba(0,0,0,0)"; - default-bg = "rgba(0,0,0,0.7)"; - - font = "Inter 12"; - selection-notification = true; - - selection-clipboard = "clipboard"; - adjust-open = "best-fit"; - pages-per-row = "1"; - scroll-page-aware = "true"; - scroll-full-overlap = "0.01"; - scroll-step = "100"; - zoom-min = "10"; - }; - - extraConfig = - "include catppuccin-" - + ( - if config.theme.name == "light" - then "latte" - else "mocha" - ); - }; - - xdg.configFile = { - "zathura/catppuccin-latte".source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-latte"; - hash = "sha256-h1USn+8HvCJuVlpeVQyzSniv56R/QgWyhhRjNm9bCfY="; - }; - "zathura/catppuccin-mocha".source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha"; - hash = "sha256-POxMpm77Pd0qywy/jYzZBXF/uAKHSQ0hwtXD4wl8S2Q="; - }; - }; -} diff --git a/home/software/utilities/zathura/default.nix b/home/software/utilities/zathura/default.nix new file mode 100644 index 0000000..6900a8b --- /dev/null +++ b/home/software/utilities/zathura/default.nix @@ -0,0 +1,17 @@ +_: { + programs.zathura = { + enable = true; + options = { + selection-notification = true; + + selection-clipboard = "clipboard"; + adjust-open = "best-fit"; + pages-per-row = "1"; + scroll-page-aware = "true"; + scroll-full-overlap = "0.01"; + scroll-step = "100"; + zoom-min = "10"; + database = "sqlite"; + }; + }; +} diff --git a/home/software/wayland/hyprland/binds.nix b/home/software/wayland/hyprland/binds.nix index fb4d026..3e02e11 100644 --- a/home/software/wayland/hyprland/binds.nix +++ b/home/software/wayland/hyprland/binds.nix @@ -48,7 +48,8 @@ in { # utility # terminal - "$mod, Return, exec, run-as-service foot" + "$mod SHIFT, Return, exec, run-as-service foot" + "$mod, Return, exec, alacritty" # logout menu "$mod, Escape, exec, wlogout -p layer-shell" # lock screen diff --git a/home/software/wayland/hyprland/default.nix b/home/software/wayland/hyprland/default.nix index 9e4c85c..dcd1209 100644 --- a/home/software/wayland/hyprland/default.nix +++ b/home/software/wayland/hyprland/default.nix @@ -5,20 +5,22 @@ }: { imports = [ inputs.hyprland.homeManagerModules.default + ./plugins + ./binds.nix - ./plugins.nix ./rules.nix ./settings.nix ]; home = { packages = with pkgs; [ - seatd + grimblast jaq + seatd xorg.xprop - inputs.hyprland-contrib.packages.${pkgs.system}.grimblast xwaylandvideobridge ]; + file = { ".config/hypr/scripts/colorpicker" = { source = ./scripts/colorpicker; diff --git a/home/software/wayland/hyprland/plugins.nix b/home/software/wayland/hyprland/plugins.nix deleted file mode 100644 index 51e5fac..0000000 --- a/home/software/wayland/hyprland/plugins.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - inputs, - pkgs, - ... -}: let - hyprfocus = inputs.hyprfocus.packages.${pkgs.system}.default; -in { - wayland.windowManager.hyprland = { - plugins = [hyprfocus]; - settings = { - plugin.hyprfocus = { - enabled = false; - - animate_floating = true; - focus_animation = "flash"; - - bezier = [ - "realsmooth, 0.28,0.9,0.1,1.05" - ]; - - flash = { - flash_opacity = 0.9; - in_bezier = "realsmooth"; - in_speed = 0.5; - - out_bezier = "realsmooth"; - out_speed = 3; - }; - }; - }; - }; -} diff --git a/home/software/wayland/hyprland/plugins/default.nix b/home/software/wayland/hyprland/plugins/default.nix new file mode 100644 index 0000000..eed7124 --- /dev/null +++ b/home/software/wayland/hyprland/plugins/default.nix @@ -0,0 +1 @@ +_: {} diff --git a/home/software/wayland/hyprland/settings.nix b/home/software/wayland/hyprland/settings.nix index a8f6b83..00c436f 100644 --- a/home/software/wayland/hyprland/settings.nix +++ b/home/software/wayland/hyprland/settings.nix @@ -1,7 +1,5 @@ {config, ...}: let - variant = config.theme.name; - c = config.programs.matugen.theme.colors.colors.${variant}; - pointer = config.home.pointerCursor; + pointer = config.stylix.cursor; in { wayland.windowManager.hyprland.settings = { "$mod" = "SUPER"; @@ -10,7 +8,7 @@ in { ]; exec-once = [ - # set cursor for HL itself + # Set cursor for Hyprland itself "hyprctl setcursor ${pointer.name} ${toString pointer.size}" "systemctl --user start clight" "hyprlock" @@ -21,13 +19,11 @@ in { general = { gaps_in = 4; gaps_out = 8; - border_size = 1; - "col.inactive_border" = "0xff908caa"; - "col.active_border" = "0xffebbcba 0xffeb6f92 0xffc4a7e7 45deg"; + border_size = 2; monitor = [ - "HDMI-A-1, 1920x1080@60, 0x0, 1" - "eDP-1, 1920x1080@60, 1920x0, 1.25" + "HDMI-A-1, 2560x1440@60, 0x0, 1" + "eDP-1, 1920x1080@60, 2560x0, 1" ]; allow_tearing = true; @@ -53,7 +49,6 @@ in { shadow_offset = "0 2"; shadow_range = 20; shadow_render_power = 3; - "col.shadow" = "rgba(00000055)"; }; animations = { @@ -71,7 +66,7 @@ in { "windowsMove, 1, 2.5, easeinoutsine, slide" "border, 1, 2, default" - # fading + # Fading "fadeIn, 1, 3, easeOutCubic" "fadeOut, 1, 3, easeOutCubic" "fadeSwitch, 1, 5, easeOutCirc" @@ -95,11 +90,11 @@ in { kb_variant = ",intl"; kb_options = "caps:swapescape,grp:alt_space_toggle"; - # type really fast - #repeat_delay = 140; - #repeat_rate = 30; + # Type really fast + repeat_delay = 170; + repeat_rate = 30; - # focus change on cursor move + # Focus change on cursor move follow_mouse = true; accel_profile = "flat"; touchpad = { @@ -109,28 +104,27 @@ in { }; dwindle = { - # keep floating dimentions while tiling + # Keep floating dimentions while tiling pseudotile = true; preserve_split = true; }; master = { - new_is_master = true; + new_status = "master"; }; misc = { - # disable auto polling for config file changes + # Disable auto polling for config file changes disable_autoreload = true; force_default_wallpaper = 0; - # disable dragging animation + # Disable dragging animation animate_mouse_windowdragging = false; - # disable variable refresh rate + # Disable variable refresh rate vrr = false; - # we do, in fact, want direct scanout no_direct_scanout = false; enable_swallow = true; @@ -140,7 +134,7 @@ in { disable_hyprland_logo = true; }; - # touchpad gestures + # Touchpad gestures gestures = { workspace_swipe = true; workspace_swipe_forever = true; diff --git a/home/software/wayland/hyprlock.nix b/home/software/wayland/hyprlock.nix index e25e701..8cb852e 100644 --- a/home/software/wayland/hyprlock.nix +++ b/home/software/wayland/hyprlock.nix @@ -1,64 +1,63 @@ {config, ...}: let - variant = config.theme.name; - c = config.programs.matugen.theme.colors.colors.${variant}; - - font_family = "LigaSFMono Nerd Font"; + colors = config.stylix.base16Scheme; + inherit (config.stylix) fonts image; in { programs.hyprlock = { enable = true; - - general = { - disable_loading_bar = true; - hide_cursor = false; - no_fade_in = true; + settings = { + general = { + disable_loading_bar = true; + hide_cursor = false; + no_fade_in = true; + }; + + background = [ + { + monitor = ""; + path = image; + blur_passes = 3; + blur_size = 6; + noise = 0.1; + contrast = 1.1; + brightness = 1.2; + } + ]; + + input-field = [ + { + monitor = "HDMI-A-1"; + # width, height + size = "300, 50"; + + outline_thickness = 2; + outer_color = "rgb(${colors.base0D})"; + inner_color = "rgb(${colors.base07})"; + font_color = "rgb(${colors.base05})"; + + fade_on_empty = false; + placeholder_text = '' + Password... + ''; + + dots_spacing = 0.3; + dots_center = true; + } + ]; + + label = [ + { + monitor = ""; + text = "$TIME"; + font_family = fonts.sansSerif.name; + font_size = 50; + color = "rgb(${config.stylix.base16Scheme.base0D})"; + # x, y + position = "0, 80"; + + valign = "center"; + halign = "center"; + } + ]; }; - - backgrounds = [ - { - monitor = ""; - path = "${config.home.homeDirectory}/Pictures/Wallpapers/leaves.png"; - } - ]; - - input-fields = [ - { - monitor = "HDMI-A-1"; - - size = { - width = 300; - height = 50; - }; - - outline_thickness = 2; - - outer_color = "rgb(${c.primary})"; - inner_color = "rgb(${c.on_primary_container})"; - font_color = "rgb(${c.primary_container})"; - - fade_on_empty = false; - placeholder_text = ''Password...''; - - dots_spacing = 0.3; - dots_center = true; - } - ]; - - labels = [ - { - monitor = ""; - text = "$TIME"; - inherit font_family; - font_size = 50; - color = "rgb(${c.primary})"; - - position = { - x = 0; - y = 80; - }; - - valign = "center"; - halign = "center"; - } - ]; }; } diff --git a/home/specialisations.nix b/home/specialisations.nix deleted file mode 100644 index 5d58129..0000000 --- a/home/specialisations.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: { - # light/dark specialisations - specialisation = let - colorschemePath = "/org/gnome/desktop/interface/color-scheme"; - dconf = "${pkgs.dconf}/bin/dconf"; - - dconfDark = lib.hm.dag.entryAfter ["dconfSettings"] '' - ${dconf} write ${colorschemePath} "'prefer-dark'" - ''; - dconfLight = lib.hm.dag.entryAfter ["dconfSettings"] '' - ${dconf} write ${colorschemePath} "'prefer-light'" - ''; - in { - light.configuration = { - theme.name = "light"; - home.activation = {inherit dconfLight;}; - }; - dark.configuration = { - theme.name = "dark"; - home.activation = {inherit dconfDark;}; - }; - }; - - theme = { - wallpaper = builtins.fetchurl { - url = "https://i.imgur.com/jsRNfwg.jpg"; - sha256 = "sha256:1khgkwcnz1lyd810hcvz54hs9l5hlnk5blwf63298cgqn9rivyz0"; - }; - }; - - programs.matugen = { - enable = false; - inherit (config.theme) wallpaper; - }; -} diff --git a/hosts/default.nix b/hosts/default.nix index 26477cf..2f030a5 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -4,32 +4,34 @@ homeImports, ... }: { - flake.nixosConfigurations = let - # shorten paths - inherit (inputs.nixpkgs.lib) nixosSystem; - mod = "${self}/system"; + flake = { + nixosConfigurations = let + # shorten paths + inherit (inputs.nixpkgs.lib) nixosSystem; + mod = "${self}/system"; - # get the basic config to build on top of - inherit (import "${self}/system") desktop laptop; + # get the basic config to build on top of + inherit (import "${self}/system") desktop laptop; - # get these into the module system - specialArgs = {inherit inputs self;}; - in { - zion = nixosSystem { - inherit specialArgs; - modules = - desktop - ++ laptop - ++ [ - ./zion - { - home-manager = { - users.glwbr.imports = homeImports."glwbr@zion"; - extraSpecialArgs = specialArgs; - }; - } - inputs.agenix.nixosModules.default - ]; + # get these into the module system + specialArgs = {inherit inputs self;}; + in { + zion = nixosSystem { + inherit specialArgs; + modules = + desktop + ++ laptop + ++ [ + ./zion + { + home-manager = { + users.glwbr.imports = homeImports."glwbr@zion"; + extraSpecialArgs = specialArgs; + }; + } + # inputs.sops-nix.nixosModules.sops + ]; + }; }; }; } diff --git a/hosts/shared/core/sops/default.nix b/hosts/shared/core/sops/default.nix new file mode 100644 index 0000000..fb02c0f --- /dev/null +++ b/hosts/shared/core/sops/default.nix @@ -0,0 +1,17 @@ +{ + inputs, + config, + pkgs, + ... +}: let + isEd25519 = k: k.type == "ed25519"; + getKeyPath = k: k.path; + keys = builtins.filter isEd25519 config.services.openssh.hostKeys; +in { + imports = [inputs.sops-nix.nixosModules.sops]; + + sops = { + defaultSopsFile = ../../secrets.yaml; + age.sshKeyPaths = map getKeyPath keys; + }; +} diff --git a/system/services/pipewire.nix b/hosts/shared/optional/services/pipewire/default.nix similarity index 89% rename from system/services/pipewire.nix rename to hosts/shared/optional/services/pipewire/default.nix index 01e17ec..628b58f 100644 --- a/system/services/pipewire.nix +++ b/hosts/shared/optional/services/pipewire/default.nix @@ -3,6 +3,11 @@ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + pavucontrol + pulsemixer + ]; + services.pipewire = { enable = true; alsa.enable = true; diff --git a/hosts/shared/secrets.yaml b/hosts/shared/secrets.yaml new file mode 100644 index 0000000..9d46f76 --- /dev/null +++ b/hosts/shared/secrets.yaml @@ -0,0 +1,32 @@ +glwbr-password: ENC[AES256_GCM,data:oUdg+cEL3zxa7hs5wZOqZMLq8DB6oDTJaFmTIKEUkqgnP+Zm6is1cE0xqNajjwn07C1rsJIAzZaZISOMe8FJ7FTFjtllLomotQ==,iv:FTyWf9nfxVL5Df52WzEzcvmen4q6dNe3gl2ZS9oNhVI=,tag:qqgR7H7ErpsKqll5kBqfug==,type:str] +anacl-password: ENC[AES256_GCM,data:xmGkzlN2nAVqsJ2JDSksufAPbqiu9Ey/srgDqdfyYF6MfSBAJYi52XK4H6zT/M693V+n1t7HuQRUCY1PQomUjkR3w2jXmlW6PA==,iv:mc4jLfVLafdCFweASV8Yg0lVXXg4/xREqtBVbVxjGUE=,tag:7+rT5PU/SB/CSvkKJ27o7w==,type:str] +wireless: ENC[AES256_GCM,data:+7ro24CtNvPzOOQdKn2FKg14S6w1QXy+wjTQxDyNjphMJ0hRxf8YbKrGat9fgWZUcempbu4S3I6OV8uQfRc57DQgvoE5uftn42FvurTtEXcYHTaJjAoeWBbWcA1b/w6SWPr7ESW2xRG80THL4/Q/Tr3qd6gNFMM8DHpDzYV7Is4c3Hs7v2UMm7vo4Lb1dBcIvANQr30kUemzWQ2DefraL3umbBXSyFtOpJ7sXPWpGnlfCXcVFeK4NMFQmxqZDHmdhyoPB1ij1JDvntGDHqxCRhbXL/A0X9lKqFIFxQ==,iv:+k9TA4goHLtDHhcOr4yEEDOGyfq00f+kBQpF+b7r+hk=,tag:sQ9hrH2kC+af5cyv01wX+A==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1cqrg22g9gzas55xna8wup9yaymd3vwsj07mdknhchmfezfsvqqeqx7qw7a + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnMC9OMjJKOHlKN2krM01m + bU9NWlc2amlZa1lidWw2SFRCdStvWXI3N1FJCkRaUkRTTkdncWFKVHZ1Uis5OW0r + Y2tyRUJkbFRFTFdNekxNSWIzOTJaUGsKLS0tIGJ3ZmpXVWpxVWNmTElsNGIvRHJR + clBNV21VUStmVVpsMHpPekhLdnhWMUkK5lWeB+ILRWVO2HVBA4XjBir4vzcaCpyd + ufgsmrhTwqIO6NT5njM5N7L3xyZH3P61MmZX4uZl7iz4GmOUz9tB5g== + -----END AGE ENCRYPTED FILE----- + - recipient: age1vq7z3ahkgj4k26ttuanmtkhc6a5ugn8e6qc7epfhgky4hthx8v9squ3zlu + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3WXltUG1Yd01UMlBHYnFV + a1hoM2xpa3RSUmhXTGptUmlzSzFHK09LSnd3Ci92aFliNTBocjU0QU1FSHZnUnpH + RVA0bW1oMmZNL25RRW1HL0hMM1FVR3MKLS0tIEJDazkvRmRxZGNXTGJkeXUwajRm + VmYwVk82OWxIL29mVnVWYUpJeXlMc28KzwFTV/z55MLyx2JYDD+l/Zzy4ThZAt84 + NXVFRW5Tt43e+d3T/nofSASiUd4VNyqJft/WR3+W7krNSu5k7mSwRw== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-06-18T05:39:10Z" + mac: ENC[AES256_GCM,data:o0X1ZTMebucG+6S8Hp1a0m1fef3BwHphEFmMNH53E2MEzMOP3f8eyJIsBmjj7620e6k9F6pzDuFLp0FDZ1F2bBx+XQ2Rd63UMHQwM0MEOOxzO8n+aQEsCszTTXwMz2zvYAdRoPXTb78GDFT4RY3kx1y5WdBWbpDRE5ye9UuQeNM=,iv:8uS29lz1i7QBUIvCf1ke+eytKsRyaKx8ILEKZhGcWeI=,tag:1SGWs+rG/AfoTpHvY8cMhw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.8.1 diff --git a/hosts/zion/default.nix b/hosts/zion/default.nix index c605f84..62cf25f 100644 --- a/hosts/zion/default.nix +++ b/hosts/zion/default.nix @@ -1,8 +1,19 @@ -_: { - imports = [./hardware-configuration.nix ./powersave.nix]; +{inputs, ...}: { + imports = [ + ./disko.nix + ./hardware.nix + ./powersave.nix + ./stylix.nix + + ../shared/core/sops + ../shared/optional/services/pipewire + + # Move this to flake modules inputs + inputs.disko.nixosModules.disko + ]; boot = { - # load modules on boot + # Load modules on boot kernelModules = ["v4l2loopback"]; kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"]; }; diff --git a/hosts/zion/disko.nix b/hosts/zion/disko.nix new file mode 100755 index 0000000..22cca51 --- /dev/null +++ b/hosts/zion/disko.nix @@ -0,0 +1,68 @@ +_: { + disko.devices = { + disk = { + vda = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + settings = { + allowDiscards = true; + }; + # additionalKeyFiles = []; + content = { + type = "btrfs"; + extraArgs = ["-L" "nixos" "-f"]; # Override existing partition + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = ["compress=zstd"]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "/persist" = { + mountpoint = "/persist"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "/log" = { + mountpoint = "/var/log"; + mountOptions = ["compress=zstd" "noatime"]; + }; + "/swap" = { + mountpoint = "/swap"; + swap.swapfile.size = "16G"; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/zion/hardware-configuration.nix b/hosts/zion/hardware-configuration.nix deleted file mode 100644 index c7a2eda..0000000 --- a/hosts/zion/hardware-configuration.nix +++ /dev/null @@ -1,42 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/97d8b441-42f5-4609-8c8c-05ec4315a0e8"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/E1AD-6788"; - fsType = "vfat"; - }; - - swapDevices = []; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/zion/hardware.nix b/hosts/zion/hardware.nix new file mode 100644 index 0000000..607af89 --- /dev/null +++ b/hosts/zion/hardware.nix @@ -0,0 +1,26 @@ +{ + lib, + pkgs, + config, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd = { + availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc"]; + kernelModules = []; + }; + + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + }; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/zion/stylix.nix b/hosts/zion/stylix.nix new file mode 100644 index 0000000..d453c14 --- /dev/null +++ b/hosts/zion/stylix.nix @@ -0,0 +1,83 @@ +{ + pkgs, + inputs, + ... +}: { + imports = [ + inputs.stylix.nixosModules.stylix + ]; + + stylix = { + enable = true; + autoEnable = true; + + base16Scheme = { + base00 = "191724"; + base01 = "1f1d2e"; + base02 = "26233a"; + base03 = "6e6a86"; + base04 = "908caa"; + base05 = "e0def4"; + base06 = "e0def4"; + base07 = "524f67"; + base08 = "eb6f92"; + base09 = "f6c177"; + base0A = "ebbcba"; + base0B = "31748f"; + base0C = "9ccfd8"; + base0D = "c4a7e7"; + base0E = "f6c177"; + base0F = "524f67"; + }; + + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 26; + }; + + fonts = { + monospace = { + package = with pkgs; nerdfonts.override {fonts = ["MartianMono"];}; + name = "MartianMono Nerd Font"; + }; + + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; + + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + + sizes = { + applications = 10; + terminal = 14; + desktop = 10; + popups = 11; + }; + }; + + # Global wallpaper definition + image = pkgs.fetchurl { + url = "https://i.imgur.com/5WKwB1q.jpg"; + sha256 = "sha256-7WAxbUsr6X5RaEc2UMbJVRNOuZ3gCO7StJ056bZykxQ="; + }; + + opacity = { + applications = 1.0; + terminal = 1.0; + desktop = 1.0; + popups = 1.0; + }; + + polarity = "dark"; # "light" or "either" + }; +} diff --git a/lib/colors/default.nix b/lib/colors/default.nix deleted file mode 100644 index bf782ed..0000000 --- a/lib/colors/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -lib: -with lib; rec { - # color-related functions - - # convert rrggbb hex to #rrggbb - x = c: "#${c}"; - - # convert rrggbb hex to rgba(r, g, b, a) css - rgba = c: let - r = toString (hexToDec (__substring 0 2 c)); - g = toString (hexToDec (__substring 2 2 c)); - b = toString (hexToDec (__substring 4 2 c)); - res = "rgba(${r}, ${g}, ${b}, .5)"; - in - res; - - # general stuff - - # functions copied from https://gist.github.com/corpix/f761c82c9d6fdbc1b3846b37e1020e11 - # convert a hex value to an integer - hexToDec = v: let - hexToInt = { - "0" = 0; - "1" = 1; - "2" = 2; - "3" = 3; - "4" = 4; - "5" = 5; - "6" = 6; - "7" = 7; - "8" = 8; - "9" = 9; - "a" = 10; - "b" = 11; - "c" = 12; - "d" = 13; - "e" = 14; - "f" = 15; - "A" = 10; - "B" = 11; - "C" = 12; - "D" = 13; - "E" = 14; - "F" = 15; - }; - chars = stringToCharacters v; - charsLen = length chars; - in - foldl - (a: v: a + v) - 0 - (imap0 - (k: v: hexToInt."${v}" * (pow 16 (charsLen - k - 1))) - chars); - - pow = let - pow' = base: exponent: value: - # FIXME: It will silently overflow on values > 2**62 :( - # The value will become negative or zero in this case - if exponent == 0 - then 1 - else if exponent <= 1 - then value - else (pow' base (exponent - 1) (value * base)); - in - base: exponent: pow' base exponent base; - - # #RRGGBB - xcolors = colors: lib.mapAttrsRecursive (_: x) colors; - # rgba(,,,) colors (css) - rgbaColors = colors: lib.mapAttrsRecursive (_: rgba) colors; -} diff --git a/lib/default.nix b/lib/default.nix index bc693f9..eed7124 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,5 +1 @@ -{lib, ...}: { - _module.args = { - colors = import ./colors lib; - }; -} +_: {} diff --git a/lib/helpers.nix b/lib/helpers.nix new file mode 100644 index 0000000..37bf3fd --- /dev/null +++ b/lib/helpers.nix @@ -0,0 +1,57 @@ +{ + inputs, + outputs, + stateVersion, + ... +}: { + # Helper function for generating home-manager configs + mkHome = { + hostname, + username, + desktop ? null, + platform ? "x86_64-linux", + }: + inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.${platform}; + extraSpecialArgs = { + inherit inputs outputs desktop hostname platform username stateVersion; + }; + modules = [../home-manager]; + }; + + # Helper function for generating host configs + mkHost = { + hostname, + username, + desktop ? null, + platform ? "x86_64-linux", + }: + inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs outputs desktop hostname platform username stateVersion; + }; + # If the hostname starts with "iso-", generate an ISO image + modules = let + isISO = + if (builtins.substring 0 4 hostname == "iso-") + then true + else false; + cd-dvd = + if (desktop == null) + then inputs.nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + else inputs.nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares.nix"; + in + [ + ../nixos + ] + ++ (inputs.nixpkgs.lib.optionals isISO [cd-dvd]); + }; + + forAllSystems = inputs.nixpkgs.lib.genAttrs [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; +} diff --git a/lib/repl.nix b/lib/repl.nix deleted file mode 100644 index 7f14583..0000000 --- a/lib/repl.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - flakePath ? null, - hostnamePath ? "/etc/hostname", - registryPath ? /etc/nix/registry.json, -}: let - inherit (builtins) getFlake head match currentSystem readFile pathExists filter fromJSON; - - selfFlake = - if pathExists registryPath - then filter (it: it.from.id == "self") (fromJSON (readFile registryPath)).flakes - else []; - - flakePath' = - toString - ( - if flakePath != null - then flakePath - else if selfFlake != [] - then (head selfFlake).to.path - else "/etc/nixos" - ); - - flake = - if pathExists flakePath' - then getFlake flakePath' - else {}; - hostname = - if pathExists hostnamePath - then head (match "([a-zA-Z0-9\\-]+)\n" (readFile hostnamePath)) - else ""; - - nixpkgsFromInputsPath = flake.inputs.nixpkgs.outPath or ""; - nixpkgs = - flake.pkgs.${currentSystem}.nixpkgs - or ( - if nixpkgsFromInputsPath != "" - then import nixpkgsFromInputsPath {} - else {} - ); - - nixpkgsOutput = removeAttrs (nixpkgs // nixpkgs.lib or {}) ["options" "config"]; -in - {inherit flake;} - // flake - // builtins - // (flake.nixosConfigurations or {}) - // flake.nixosConfigurations.${hostname} or {} - // nixpkgsOutput - // {getFlake = path: getFlake (toString path);} diff --git a/lib/theme/colors.nix b/lib/theme/colors.nix deleted file mode 100644 index 877c371..0000000 --- a/lib/theme/colors.nix +++ /dev/null @@ -1,42 +0,0 @@ -rec { - background = "14171b"; - foreground = "dee1e6"; - darker = "0f1215"; - comment = "767b82"; - cursorline = "181c21"; - - # Black - color0 = "1c2128"; - color8 = "242a32"; - - # Red - color1 = "f3818b"; - color9 = "ee7a84"; - - # Green - color2 = "77d18b"; - color10 = "68cd7f"; - - # Yellow - color3 = "ecb083"; - color11 = "eeaa77"; - - # Blue - color4 = "97ade5"; - color12 = "8fa7e6"; - - # Magenta - color5 = "b99ada"; - color13 = "b994df"; - - # Cyan - color6 = "68c495"; - color14 = "5dbb8b"; - - # White - color7 = "ced1d6"; - color15 = "c0c3c7"; - - bg = background; - fg = foreground; -} diff --git a/lib/theme/default.nix b/lib/theme/default.nix deleted file mode 100644 index 771ebcc..0000000 --- a/lib/theme/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - colorlib, - lib, -}: rec { - colors = import ./colors.nix; - # #RRGGBB - xcolors = lib.mapAttrs (_: colorlib.x) colors; - # rgba(,,,) colors (css) - rgbaColors = lib.mapAttrs (_: colorlib.rgba) colors; - - browser = "brave"; - - launcher = "anyrun"; - - terminal = { - font = "Maple Mono SC NF"; - name = "wezterm"; - exec = "start"; # command used to execute programs - opacity = 0.9; - size = 10; - }; - - # TODO: Change this later - wallpaper = builtins.fetchurl { - url = "https://i.imgur.com/5WKwB1q.jpg"; - sha256 = "sha256:054kfavfjfcxnk9fw270knwlw4smr7350dj7d18pxs9b9dnk2q7d"; - }; -} diff --git a/modules/default.nix b/modules/default.nix index 47af602..0ced50d 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,5 +1,3 @@ -{ - flake.nixosModules = { - theme = import ./theme; - }; +_: { + flake.nixosModules = {}; } diff --git a/modules/theme/default.nix b/modules/theme/default.nix deleted file mode 100644 index ac93d57..0000000 --- a/modules/theme/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{lib, ...}: { - options.theme = { - name = lib.mkOption { - description = '' - Name of the theme to use throughout the system. - - This option can be used as a simple "light/dark" switch that does nothing by itself, - or it can be used by a more elaborate module/theme manager that can switch entire - programs' themes based on this option. - ''; - type = lib.types.str; - example = lib.literalExample "catppuccin-latte"; - default = "dark"; - }; - - wallpaper = lib.mkOption { - description = '' - Location of the wallpaper to use throughout the system. - ''; - type = lib.types.path; - example = lib.literalExample "./wallpaper.png"; - }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 89f0ad8..f450ae8 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,8 +3,6 @@ perSystem = {pkgs, ...}: { packages = { - # instant repl with automatic flake loading - repl = pkgs.callPackage ./repl {}; wl-ocr = pkgs.callPackage ./wl-ocr {}; # SanFrancisco fonts diff --git a/pkgs/repl/default.nix b/pkgs/repl/default.nix deleted file mode 100644 index 4eb6caf..0000000 --- a/pkgs/repl/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - coreutils, - gnused, - writeShellScriptBin, -}: let - repl = ../../lib/repl.nix; - example = command: desc: "\\n\\u001b[33m ${command}\\u001b[0m - ${desc}"; -in - writeShellScriptBin "repl" '' - case "$1" in - "-h"|"--help"|"help") - printf "%b\n\e[4mUsage\e[0m: \ - ${example "repl" "Loads system flake if available."} \ - ${example "repl /path/to/flake.nix" "Loads specified flake."}\n" - ;; - *) - if [ -z "$1" ]; then - nix repl ${repl} - else - nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') ${repl} - fi - ;; - esac - '' diff --git a/pre-commit-hooks.nix b/pre-commit-hooks.nix deleted file mode 100644 index fcd5653..0000000 --- a/pre-commit-hooks.nix +++ /dev/null @@ -1,15 +0,0 @@ -{inputs, ...}: { - imports = [inputs.pre-commit-hooks.flakeModule]; - - perSystem.pre-commit = { - settings.excludes = ["flake.lock"]; - - settings.hooks = { - alejandra.enable = true; - prettier = { - enable = true; - excludes = [".js" ".md" ".ts"]; - }; - }; - }; -} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..1a20a81 --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ +{pkgs ? import {}, ...}: { + default = pkgs.mkShell { + NIX_CONFIG = "extra-experimental-features = nix-command flakes ca-derivations"; + nativeBuildInputs = with pkgs; [ + nix + home-manager + git + ripgrep + + age + gnupg + sops + ssh-to-age + ]; + }; +} diff --git a/system/core/boot.nix b/system/core/boot.nix index 00405db..10ed337 100644 --- a/system/core/boot.nix +++ b/system/core/boot.nix @@ -10,7 +10,6 @@ loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; - efi.efiSysMountPoint = "/boot"; timeout = 3; }; diff --git a/system/core/default.nix b/system/core/default.nix index 250913b..350ef4a 100644 --- a/system/core/default.nix +++ b/system/core/default.nix @@ -1,6 +1,4 @@ -{lib, ...}: -# default configuration shared by all hosts -{ +{lib, ...}: { imports = [ ./boot.nix ./locale.nix @@ -8,12 +6,6 @@ ./users.nix ]; - # don't touch this - system.stateVersion = lib.mkDefault "23.11"; - - # compresses half the ram for use as swap - zramSwap = { - enable = true; - algorithm = "zstd"; - }; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = lib.mkDefault "24.05"; } diff --git a/system/core/security.nix b/system/core/security.nix index ade3883..4a7ecb9 100644 --- a/system/core/security.nix +++ b/system/core/security.nix @@ -47,7 +47,9 @@ _: { # allow wayland lockers to unlock the screen pam.services.hyprlock.text = "auth include login"; - # pipewire + # !TODO: movve this to pipewiere namespace rtkit.enable = true; + + sudo.wheelNeedsPassword = false; }; } diff --git a/system/core/users.nix b/system/core/users.nix index 19a2ea6..2721201 100644 --- a/system/core/users.nix +++ b/system/core/users.nix @@ -1,16 +1,40 @@ -{pkgs, ...}: { +{ + pkgs, + config, + lib, + ... +}: let + ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; +in { + sops.secrets.glwbr-password = { + sopsFile = ../../hosts/shared/secrets.yaml; + neededForUsers = true; + }; + + users.mutableUsers = false; users.users.glwbr = { - isNormalUser = true; description = "Glauber Santana"; + isNormalUser = true; shell = pkgs.zsh; - initialPassword = "notasecret"; - extraGroups = [ - "audio" - "docker" - "networkmanager" - "video" - "wheel" - ]; - packages = with pkgs; [neovim]; + extraGroups = + [ + "wheel" + "video" + "audio" + ] + ++ ifTheyExist [ + "adbusers" + "network" + "networkmanager" + "wireshark" + "docker" + "podman" + "git" + "libvirtd" + ]; + + hashedPasswordFile = config.sops.secrets.glwbr-password.path; + # openssh.authorizedKeys.keys = []; + packages = [pkgs.home-manager]; }; } diff --git a/system/hardware/network.nix b/system/hardware/network.nix index a523201..60bb680 100644 --- a/system/hardware/network.nix +++ b/system/hardware/network.nix @@ -1,13 +1,33 @@ -{lib, ...}: { - networking = { - networkmanager = { +{config, ...}: { + sops.secrets.wireless = { + sopsFile = ../../hosts/shared/secrets.yaml; + neededForUsers = true; + }; + + networking.wireless = { + enable = true; + fallbackToWPA2 = false; + environmentFile = config.sops.secrets.wireless.path; + networks = { + "UAIFAI" = { + pskRaw = "@UAIFAI@"; + }; + + "UAIFAI_5G" = { + pskRaw = "@UAIFAI5G@"; + }; + }; + + # Imperative + allowAuxiliaryImperativeNetworks = true; + userControlled = { enable = true; - wifi.powersave = false; + group = "network"; }; - enableIPv6 = false; - dhcpcd.wait = "background"; - dhcpcd.extraConfig = "noarp"; + extraConfig = '' + update_config=1 + ''; }; services = { @@ -16,4 +36,9 @@ settings.UseDns = true; }; }; + + # Ensure group exists + users.groups.network = {}; + + systemd.services.wpa_supplicant.preStart = "touch /etc/wpa_supplicant.conf"; } diff --git a/system/nix/substituters.nix b/system/nix/substituters.nix index cb29365..50a9042 100644 --- a/system/nix/substituters.nix +++ b/system/nix/substituters.nix @@ -2,18 +2,18 @@ nix.settings = { substituters = [ "https://cache.nixos.org?priority=10" - "https://anyrun.cachix.org" "https://fufexan.cachix.org" "https://hyprland.cachix.org" "https://nix-community.cachix.org" + "https://yazi.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" ]; }; } diff --git a/system/programs/fonts.nix b/system/programs/fonts.nix index e956774..fd6e0cb 100644 --- a/system/programs/fonts.nix +++ b/system/programs/fonts.nix @@ -22,7 +22,7 @@ inputs.self.packages.${pkgs.system}.SF-Pro # nerdfonts - (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly" "JetBrainsMono"];}) + (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly" "JetBrainsMono" "DejaVuSansMono"];}) ]; # causes more issues than it solves diff --git a/system/services/default.nix b/system/services/default.nix index 90e22b7..413d062 100644 --- a/system/services/default.nix +++ b/system/services/default.nix @@ -4,7 +4,6 @@ _: { ./backlight.nix ./gnome-services.nix ./greetd.nix - ./pipewire.nix ./power.nix ./samba.nix ];