diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index da8c15f..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -flake.lock binary diff --git a/.sops.yaml b/.sops.yaml deleted file mode 100644 index 7aa3d88..0000000 --- a/.sops.yaml +++ /dev/null @@ -1,28 +0,0 @@ -keys: - - &lelgenio-gpg 0FECE8316E74BA6F44EFC21A2F8F21CE8721456B - - &lelgenio-ssh age1zrgu7w8059xydagm60phnffghvfe9h2ca58cx8qwagqpyfuvs9fqw79c8h - - &monolith-ssh age1ecyynwv93lfu7crjjp8l47defv07quzfzaktwurpep7jc9eha5pscg7lrw - - &phantom-ssh age1m4mqcd2kmuhfr8a22rvh02c68jkakhdfmuqgtusuv0czk4jvna7sz79p3y - -creation_rules: - - path_regex: secrets/[^/]+\.(yaml|json|env|ini)$ - key_groups: - - pgp: - - *lelgenio-gpg - age: - - *lelgenio-ssh - - *monolith-ssh - - path_regex: secrets/monolith/[^/]+\.(yaml|json|env|ini)$ - key_groups: - - pgp: - - *lelgenio-gpg - age: - - *lelgenio-ssh - - *monolith-ssh - - path_regex: secrets/phantom/[^/]+\.(yaml|json|env|ini)$ - key_groups: - - pgp: - - *lelgenio-gpg - age: - - *lelgenio-ssh - - *phantom-ssh diff --git a/flake.lock b/flake.lock index 6e77084..03069d6 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1747575206, - "narHash": "sha256-NwmAFuDUO/PFcgaGGr4j3ozG9Pe5hZ/ogitWhY+D81k=", + "lastModified": 1718371084, + "narHash": "sha256-abpBi61mg0g+lFFU0zY4C6oP6fBwPzbHPKBGw676xsA=", "owner": "ryantm", "repo": "agenix", - "rev": "4835b1dc898959d8547a871ef484930675cb47f1", + "rev": "3a56735779db467538fb2e577eda28a9daacaca6", "type": "github" }, "original": { @@ -57,38 +57,6 @@ "type": "gitlab" } }, - "catboy-spinner": { - "flake": false, - "locked": { - "lastModified": 1728098748, - "narHash": "sha256-FHM/a+wqctmg1LXf/XB6TcXowL0Wzbq1kSCGVnxGgL8=", - "ref": "refs/heads/main", - "rev": "c6fc11b0900826508f6a766c65cf92e0c7c4eab9", - "revCount": 4, - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/catboy-spinner" - }, - "original": { - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/catboy-spinner" - } - }, - "contador-da-viagem": { - "flake": false, - "locked": { - "lastModified": 1742610036, - "narHash": "sha256-sY1iheemazmIVJAnoFtut6cN7HX/C5OMDY54UrmCoqE=", - "ref": "refs/heads/main", - "rev": "efe5ac4a16de7f78824ac89dc987ef635afa5267", - "revCount": 4, - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/contador-da-viagem" - }, - "original": { - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/contador-da-viagem" - } - }, "crane": { "inputs": { "flake-compat": "flake-compat", @@ -114,27 +82,6 @@ } }, "crane_2": { - "inputs": { - "nixpkgs": [ - "made-you-look", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1718730147, - "narHash": "sha256-QmD6B6FYpuoCqu6ZuPJH896ItNquDkn0ulQlOn4ykN8=", - "owner": "ipetkov", - "repo": "crane", - "rev": "32c21c29b034d0a93fdb2379d6fabc40fc3d0e6c", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "crane_3": { "inputs": { "nixpkgs": [ "warthunder-leak-counter", @@ -163,11 +110,11 @@ ] }, "locked": { - "lastModified": 1744478979, - "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", "type": "github" }, "original": { @@ -182,7 +129,9 @@ "advisory-db": "advisory-db", "crane": "crane", "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1693509848, @@ -202,7 +151,9 @@ "inputs": { "fenix": "fenix", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1659395338, @@ -225,11 +176,11 @@ ] }, "locked": { - "lastModified": 1749436314, - "narHash": "sha256-CqmqU5FRg5AadtIkxwu8ulDSOSoIisUMZRLlcED3Q5w=", + "lastModified": 1719451710, + "narHash": "sha256-h+bFEQHQ46pBkEsOXbxmmY6QNPPGrgpDbNlHtAKG49M=", "owner": "nix-community", "repo": "disko", - "rev": "dfa4d1b9c39c0342ef133795127a3af14598017a", + "rev": "8767dbf5d723b1b6834f4d09b217da7c31580d58", "type": "github" }, "original": { @@ -238,20 +189,40 @@ "type": "github" } }, + "dzgui": { + "flake": false, + "locked": { + "lastModified": 1702780245, + "narHash": "sha256-cdW5LN2Q7eYW8xIqKPQfeYPd7e6VdJGaoA9NMHesCrE=", + "owner": "aclist", + "repo": "dztui", + "rev": "28323f3edb8fa747dc559d1939ccdd7729e4e3a1", + "type": "github" + }, + "original": { + "owner": "aclist", + "repo": "dztui", + "type": "github" + } + }, "dzgui-nix": { "inputs": { - "nixpkgs": "nixpkgs_3" + "dzgui": "dzgui", + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1749410315, - "narHash": "sha256-5H8MuMMSq1WnQcvb1FiDNkKP+uyeZ8HX5GRTMfEOyLI=", + "lastModified": 1702850463, + "narHash": "sha256-qR/c/GjsLUzrCyHN/Q9nnClduf6OqTg26S1AFYKPzxA=", "owner": "lelgenio", "repo": "dzgui-nix", - "rev": "49adbb1edfb3c25b0cd8256d35673394386065e7", + "rev": "2ed6515b27d8186b9fedfe1dcaf861f07e796a0d", "type": "github" }, "original": { "owner": "lelgenio", + "ref": "dzgui-4.1.0", "repo": "dzgui-nix", "type": "github" } @@ -295,13 +266,43 @@ } }, "flake-compat_2": { + "locked": { + "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": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1747046372, - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -328,6 +329,24 @@ "type": "github" } }, + "flake-utils-plus": { + "inputs": { + "flake-utils": "flake-utils_4" + }, + "locked": { + "lastModified": 1696331477, + "narHash": "sha256-YkbRa/1wQWdWkVJ01JvV+75KIdM37UErqKgTf0L54Fk=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "bfc53579db89de750b25b0c5e7af299e0c06d7d3", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" + } + }, "flake-utils_2": { "inputs": { "systems": "systems_3" @@ -363,14 +382,14 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -381,7 +400,7 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems_5" + "systems": "systems_7" }, "locked": { "lastModified": 1681202837, @@ -399,7 +418,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_6" + "systems": "systems_8" }, "locked": { "lastModified": 1681202837, @@ -417,7 +436,7 @@ }, "flake-utils_7": { "inputs": { - "systems": "systems_7" + "systems": "systems_9" }, "locked": { "lastModified": 1710146030, @@ -433,70 +452,6 @@ "type": "github" } }, - "git-hooks": { - "inputs": { - "flake-compat": [ - "nixos-mailserver", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "nixos-mailserver", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1742649964, - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "nixos-mailserver", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "hello-fonts": { - "flake": false, - "locked": { - "lastModified": 1728232065, - "narHash": "sha256-1DUW1YqZALPFxBM7HYcNZiCZQvMqUiJ1m04NU4IIe3I=", - "ref": "refs/heads/main", - "rev": "10f7485fea930bb45e97fbda0cd68f199a7e8f59", - "revCount": 1, - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/hello-fonts" - }, - "original": { - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/hello-fonts" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -504,40 +459,20 @@ ] }, "locked": { - "lastModified": 1749154018, - "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", + "lastModified": 1718530513, + "narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=", "owner": "nix-community", "repo": "home-manager", - "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", + "rev": "a1fddf0967c33754271761d91a3d921772b30d0e", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } }, - "made-you-look": { - "inputs": { - "crane": "crane_2", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_4" - }, - "locked": { - "lastModified": 1728159958, - "narHash": "sha256-r/h/ch70KfOQ8moftDhHagu3WajglaqU+hrEzUtTM1Y=", - "ref": "refs/heads/main", - "rev": "96e978aa2f414d4b92b78e7ae975d7ff7db95a91", - "revCount": 3, - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/made-you-look" - }, - "original": { - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/made-you-look" - } - }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -545,11 +480,11 @@ ] }, "locked": { - "lastModified": 1749355504, - "narHash": "sha256-L17CdJMD+/FCBOHjREQLXbe2VUnc3rjffenBbu2Kwpc=", + "lastModified": 1719111455, + "narHash": "sha256-rnIxHx+fLpydjMQsbpZ21kblUr/lMqSaAtMA4+qMMEE=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "40a6e15e44b11fbf8f2b1df9d64dbfc117625e94", + "rev": "4293f532d0107dfb7e6f8b34a0421dc8111320e6", "type": "github" }, "original": { @@ -558,187 +493,118 @@ "type": "github" } }, + "nix-software-center": { + "inputs": { + "nixos-appstream-data": "nixos-appstream-data", + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1714856183, + "narHash": "sha256-Ue7xV+rZqImux4DDj3VMla4LIH2g8VeXbTJwgvX7wOo=", + "owner": "vlinkz", + "repo": "nix-software-center", + "rev": "b9e0f53536e1e94e7d8c3cda3c6866b3f9d01386", + "type": "github" + }, + "original": { + "owner": "vlinkz", + "repo": "nix-software-center", + "type": "github" + } + }, + "nixos-appstream-data": { + "inputs": { + "flake-utils": [ + "nix-software-center", + "utils" + ], + "nixpkgs": [ + "nix-software-center", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712858390, + "narHash": "sha256-XE7gr+zU3N4SHPAhsgk8cVAFp1iBg+Lxxp3y4dUF1vE=", + "owner": "korfuri", + "repo": "nixos-appstream-data", + "rev": "0465d42a4433faa63b7a5eb0b8d397937c9fc13a", + "type": "github" + }, + "original": { + "owner": "korfuri", + "ref": "flake", + "repo": "nixos-appstream-data", + "type": "github" + } + }, + "nixos-conf-editor": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": [ + "nixpkgs" + ], + "snowfall-lib": "snowfall-lib" + }, + "locked": { + "lastModified": 1707338010, + "narHash": "sha256-UtLeZzDdk96sLTRcWsGrkWCslNUDytrGe0VmOTB/iig=", + "owner": "vlinkz", + "repo": "nixos-conf-editor", + "rev": "27b5e92f580f794c690093503869aab242f075ab", + "type": "github" + }, + "original": { + "owner": "vlinkz", + "repo": "nixos-conf-editor", + "type": "github" + } + }, "nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat_2", - "git-hooks": "git-hooks", + "flake-compat": "flake-compat_4", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-25_05": "nixpkgs-25_05" + "nixpkgs-24_05": [ + "nixpkgs" + ], + "utils": "utils_2" }, "locked": { - "lastModified": 1747965231, - "narHash": "sha256-BW3ktviEhfCN/z3+kEyzpDKAI8qFTwO7+S0NVA0C90o=", + "lastModified": 1718084203, + "narHash": "sha256-Cx1xoVfSMv1XDLgKg08CUd1EoTYWB45VmB9XIQzhmzI=", "owner": "simple-nixos-mailserver", "repo": "nixos-mailserver", - "rev": "53007af63fade28853408370c4c600a63dd97f41", + "rev": "29916981e7b3b5782dc5085ad18490113f8ff63b", "type": "gitlab" }, "original": { "owner": "simple-nixos-mailserver", - "ref": "nixos-25.05", + "ref": "nixos-24.05", "repo": "nixos-mailserver", "type": "gitlab" } }, "nixpkgs": { "locked": { - "lastModified": 1684425776, - "narHash": "sha256-eXzSIXkzXa9EecoDF9xCsoim0vd++8dvYU7QOuQMO8A=", + "lastModified": 1719253556, + "narHash": "sha256-A/76RFUVxZ/7Y8+OMVL1Lc8LRhBxZ8ZE2bpMnvZ1VpY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8dc174d8b768893172eb3e52008f10f48dfbd5cf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-25_05": { - "locked": { - "lastModified": 1747610100, - "narHash": "sha256-rpR5ZPMkWzcnCcYYo3lScqfuzEw5Uyfh+R0EKZfroAc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ca49c4304acf0973078db0a9d200fd2bae75676d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1749285348, - "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "rev": "fc07dc3bdf2956ddd64f24612ea7fc894933eb2e", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-unstable", + "ref": "nixos-24.05", "type": "indirect" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1659219666, - "narHash": "sha256-pzYr5fokQPHv7CmUXioOhhzDy/XyWOIXP4LZvv/T7Mk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7b9be38c7250b22d829ab6effdee90d5e40c6e5c", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1732812356, - "narHash": "sha256-LNcgjOLArRlx2W6XSi0yc0xwLjrK3KF9LxAMqUgFDgw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "581d7e4d23b91daf2afa0005a5d3d01d6a8884fe", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixpkgs-unstable", - "type": "indirect" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1719010183, - "narHash": "sha256-8HMWaqpyjbVeEsmy/A2H6VFtW/Wr71vkPLnpTiAXu+8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0f620ca71fa69abb411a6c78739a9b171a0a95a6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1749727998, - "narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-25.05", - "type": "indirect" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1747958103, - "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { - "locked": { - "lastModified": 1719010183, - "narHash": "sha256-8HMWaqpyjbVeEsmy/A2H6VFtW/Wr71vkPLnpTiAXu+8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0f620ca71fa69abb411a6c78739a9b171a0a95a6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_8": { - "locked": { - "lastModified": 1714091391, - "narHash": "sha256-68n3GBvlm1MIeJXadPzQ3v8Y9sIW3zmv8gI5w5sliC8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4c86138ce486d601d956a165e2f7a0fc029a03c1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "plymouth-themes": { "flake": false, "locked": { @@ -758,11 +624,11 @@ "ranger-icons": { "flake": false, "locked": { - "lastModified": 1749128401, - "narHash": "sha256-qvWqKVS4C5OO6bgETBlVDwcv4eamGlCUltjsBU3gAbA=", + "lastModified": 1713564482, + "narHash": "sha256-sijO9leDXgnjgcVlh5fKYalhjOupwFMRyH0xh2g/rEQ=", "owner": "alexanderjeurissen", "repo": "ranger_devicons", - "rev": "1bcaff0366a9d345313dc5af14002cfdcddabb82", + "rev": "a8d626485ca83719e1d8d5e32289cd96a097c861", "type": "github" }, "original": { @@ -774,29 +640,21 @@ "root": { "inputs": { "agenix": "agenix", - "catboy-spinner": "catboy-spinner", - "contador-da-viagem": "contador-da-viagem", "demoji": "demoji", "dhist": "dhist", "disko": "disko", "dzgui-nix": "dzgui-nix", - "hello-fonts": "hello-fonts", "home-manager": "home-manager", - "made-you-look": "made-you-look", "nix-index-database": "nix-index-database", + "nix-software-center": "nix-software-center", + "nixos-conf-editor": "nixos-conf-editor", "nixos-mailserver": "nixos-mailserver", - "nixpkgs": "nixpkgs_5", - "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs": "nixpkgs", "plymouth-themes": "plymouth-themes", "ranger-icons": "ranger-icons", - "sops-nix": "sops-nix", "tlauncher": "tlauncher", - "tomater": "tomater", - "treefmt-nix": "treefmt-nix", - "vpsadminos": "vpsadminos", "warthunder-leak-counter": "warthunder-leak-counter", - "wl-crosshair": "wl-crosshair", - "youre-wrong": "youre-wrong" + "wl-crosshair": "wl-crosshair" } }, "rust-analyzer-src": { @@ -843,23 +701,26 @@ "type": "github" } }, - "sops-nix": { + "snowfall-lib": { "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils-plus": "flake-utils-plus", "nixpkgs": [ + "nixos-conf-editor", "nixpkgs" ] }, "locked": { - "lastModified": 1749592509, - "narHash": "sha256-VunQzfZFA+Y6x3wYi2UE4DEQ8qKoAZZCnZPUlSoqC+A=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "50754dfaa0e24e313c626900d44ef431f3210138", + "lastModified": 1696432959, + "narHash": "sha256-oJQZv2MYyJaVyVJY5IeevzqpGvMGKu5pZcCCJvb+xjc=", + "owner": "snowfallorg", + "repo": "lib", + "rev": "92803a029b5314d4436a8d9311d8707b71d9f0b6", "type": "github" }, "original": { - "owner": "Mic92", - "repo": "sops-nix", + "owner": "snowfallorg", + "repo": "lib", "type": "github" } }, @@ -968,6 +829,36 @@ "type": "github" } }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tlauncher": { "inputs": { "flake-utils": "flake-utils_5", @@ -976,11 +867,11 @@ ] }, "locked": { - "lastModified": 1734044605, - "narHash": "sha256-CeCYv3JFJIySSf2eX9ceEOF1FqNGeJnzEuO5f+OvioQ=", + "lastModified": 1684504342, + "narHash": "sha256-rJ0eH7BuPizvXPc+LjVtovse4gWEuxP2WiyNdXjPNL4=", "ref": "refs/heads/main", - "rev": "6a68f2cda0aa2fbb399a4c43b445e8c1a2df0634", - "revCount": 4, + "rev": "add4df7220bd0b85177a1938c02b60c966c5eb71", + "revCount": 3, "type": "git", "url": "https://git.lelgenio.xyz/lelgenio/tlauncher-nix" }, @@ -989,60 +880,49 @@ "url": "https://git.lelgenio.xyz/lelgenio/tlauncher-nix" } }, - "tomater": { - "flake": false, - "locked": { - "lastModified": 1728089744, - "narHash": "sha256-WOz/qUKyao7lM2qcwqqcJDw4jI8mUJL6kNUNm0sxPKk=", - "ref": "refs/heads/main", - "rev": "efff561c745514a7874e3f5de95307a74efc7df9", - "revCount": 1, - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/tomater" - }, - "original": { - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/tomater" - } - }, - "treefmt-nix": { + "utils": { "inputs": { - "nixpkgs": "nixpkgs_6" + "systems": "systems_4" }, "locked": { - "lastModified": 1749194973, - "narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=", + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", "owner": "numtide", - "repo": "treefmt-nix", - "rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", "type": "github" }, "original": { "owner": "numtide", - "repo": "treefmt-nix", + "repo": "flake-utils", "type": "github" } }, - "vpsadminos": { + "utils_2": { + "inputs": { + "systems": "systems_6" + }, "locked": { - "lastModified": 1749716966, - "narHash": "sha256-aF+YOXv07qI7Q267gqapUcAsoQkI3+EcmZczatq6wkg=", - "owner": "vpsfreecz", - "repo": "vpsadminos", - "rev": "2d991bb5109350801a381bff097809b76ee962f5", + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", "type": "github" }, "original": { - "owner": "vpsfreecz", - "repo": "vpsadminos", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, "warthunder-leak-counter": { "inputs": { - "crane": "crane_3", + "crane": "crane_2", "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_7" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1719076817, @@ -1061,7 +941,9 @@ "wl-crosshair": { "inputs": { "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_8" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1715216838, @@ -1076,22 +958,6 @@ "repo": "wl-crosshair", "type": "github" } - }, - "youre-wrong": { - "flake": false, - "locked": { - "lastModified": 1728228087, - "narHash": "sha256-W40rQbQAo3lGrKlfenSA8JaGwZMSx/X4lP71enQtK7Y=", - "ref": "refs/heads/main", - "rev": "64e7876233e99ad7223cae29688374a1c1ff569a", - "revCount": 2, - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/youre-wrong" - }, - "original": { - "type": "git", - "url": "https://git.lelgenio.com/lelgenio/youre-wrong" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 0818b6a..21caeb9 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +1,10 @@ { description = "My system config"; inputs = { - nixpkgs.url = "nixpkgs/nixos-25.05"; - nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; - - home-manager.url = "github:nix-community/home-manager/release-25.05"; + nixpkgs.url = "nixpkgs/nixos-24.05"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - vpsadminos.url = "github:vpsfreecz/vpsadminos"; - nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; @@ -26,55 +22,51 @@ inputs.home-manager.follows = "home-manager"; }; - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nixos-mailserver = { - url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.05"; + url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs-24_05.follows = "nixpkgs"; }; - dzgui-nix.url = "github:lelgenio/dzgui-nix"; + dzgui-nix = { + url = "github:lelgenio/dzgui-nix/dzgui-4.1.0"; + inputs.nixpkgs.follows = "nixpkgs"; + }; tlauncher = { url = "git+https://git.lelgenio.xyz/lelgenio/tlauncher-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - disko = { - url = "github:nix-community/disko"; + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; + + # my stuff + dhist = { + url = "github:lelgenio/dhist"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + demoji = { + url = "github:lelgenio/demoji"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + wl-crosshair = { + url = "github:lelgenio/wl-crosshair"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + warthunder-leak-counter = { + url = "git+https://git.lelgenio.com/lelgenio/warthunder-leak-counter"; inputs.nixpkgs.follows = "nixpkgs"; }; - treefmt-nix.url = "github:numtide/treefmt-nix"; - - # my stuff - dhist.url = "github:lelgenio/dhist"; - demoji.url = "github:lelgenio/demoji"; - wl-crosshair.url = "github:lelgenio/wl-crosshair"; - warthunder-leak-counter.url = "git+https://git.lelgenio.com/lelgenio/warthunder-leak-counter"; - made-you-look.url = "git+https://git.lelgenio.com/lelgenio/made-you-look"; - contador-da-viagem = { - url = "git+https://git.lelgenio.com/lelgenio/contador-da-viagem"; - flake = false; + # gnome stuff + nixos-conf-editor = { + url = "github:vlinkz/nixos-conf-editor"; + inputs.nixpkgs.follows = "nixpkgs"; }; - catboy-spinner = { - url = "git+https://git.lelgenio.com/lelgenio/catboy-spinner"; - flake = false; - }; - tomater = { - url = "git+https://git.lelgenio.com/lelgenio/tomater"; - flake = false; - }; - youre-wrong = { - url = "git+https://git.lelgenio.com/lelgenio/youre-wrong"; - flake = false; - }; - hello-fonts = { - url = "git+https://git.lelgenio.com/lelgenio/hello-fonts"; - flake = false; + nix-software-center = { + url = "github:vlinkz/nix-software-center"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = @@ -105,33 +97,24 @@ { nixpkgs.pkgs = pkgs; } ./system/configuration.nix ./system/secrets.nix - ./system/sops.nix ./system/greetd.nix { login-manager.greetd.enable = desktop == "sway"; } inputs.agenix.nixosModules.default - inputs.sops-nix.nixosModules.default + inputs.dzgui-nix.nixosModules.default inputs.home-manager.nixosModules.home-manager inputs.disko.nixosModules.disko - ( - { config, ... }: - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.lelgenio = { - my = config.my; - imports = [ - ./user/home.nix - ]; - }; - home-manager.backupFileExtension = "bkp"; - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - home-manager.extraSpecialArgs = { - inherit inputs; - }; - } - ) + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.lelgenio = import ./user/home.nix; + home-manager.backupFileExtension = "bkp"; + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + home-manager.extraSpecialArgs = { + inherit inputs; + }; + } ] ++ lib.optional (desktop == "gnome") ./system/gnome.nix ++ lib.optional (desktop == "kde") ./system/kde.nix; @@ -152,12 +135,21 @@ ./system/monolith-gitlab-runner.nix ./system/monolith-forgejo-runner.nix ./system/nix-serve.nix + ./system/steam.nix + ] ++ common_modules; + }; + rainbow = lib.nixosSystem { + inherit system specialArgs; + modules = [ + ./hosts/rainbow + ./system/rainbow-gitlab-runner.nix ] ++ common_modules; }; double-rainbow = lib.nixosSystem { inherit system specialArgs; modules = [ ./hosts/double-rainbow.nix + ./system/rainbow-gitlab-runner.nix ] ++ common_modules; }; pixie = lib.nixosSystem { @@ -168,16 +160,14 @@ ++ [ { packages.media-packages.enable = lib.mkOverride 0 false; + programs.steam.enable = lib.mkOverride 0 false; services.flatpak.enable = lib.mkOverride 0 false; } ]; }; phantom = lib.nixosSystem { inherit system specialArgs; - modules = [ - { nixpkgs.pkgs = pkgs; } - ./hosts/phantom - ]; + modules = [ ./hosts/phantom ]; }; }; @@ -194,7 +184,6 @@ packages.${system} = pkgs // packages; - # formatter.${system} = pkgs.nixfmt-rfc-style; - formatter.${system} = (inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix).config.build.wrapper; + formatter.${system} = pkgs.nixfmt-rfc-style; }; } diff --git a/hosts/double-rainbow.nix b/hosts/double-rainbow.nix index 2270198..e33b612 100644 --- a/hosts/double-rainbow.nix +++ b/hosts/double-rainbow.nix @@ -19,8 +19,6 @@ in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - my.nix-ld.enable = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" @@ -39,15 +37,14 @@ in options = [ "subvol=@" ] ++ btrfs_options ++ btrfs_ssd; }; - boot.initrd.luks.devices."luks-d6573cf8-25f0-4ffc-8046-ac3a4db1e964".device = - "/dev/disk/by-uuid/d6573cf8-25f0-4ffc-8046-ac3a4db1e964"; + boot.initrd.luks.devices."luks-d6573cf8-25f0-4ffc-8046-ac3a4db1e964".device = "/dev/disk/by-uuid/d6573cf8-25f0-4ffc-8046-ac3a4db1e964"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/97EB-7DB5"; fsType = "vfat"; }; - swapDevices = [ { device = "/swapfile"; } ]; + swapDevices = [ ]; services.udev.extraRules = '' # Force all disks to use mq-deadline scheduler diff --git a/hosts/monolith/amdgpu.nix b/hosts/monolith/amdgpu.nix deleted file mode 100644 index 2554500..0000000 --- a/hosts/monolith/amdgpu.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs, lib, ... }: -let - undervoltGpu = pkgs.writeShellScript "undervolt-gpu" '' - set -xe - cd $1 - echo "manual" > power_dpm_force_performance_level - echo "1" > pp_power_profile_mode - test -e pp_od_clk_voltage - echo "vo -120" > pp_od_clk_voltage - echo "c" > pp_od_clk_voltage - ''; -in -{ - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelParams = [ - "video=DP-1:1920x1080@144" - ]; - - systemd.services.amd-fan-control = { - script = '' - ${lib.getExe pkgs.amd-fan-control} /sys/class/drm/card1/device 60 90 0 80 - ''; - serviceConfig = { - Restart = "always"; - RestartSec = 10; - }; - wantedBy = [ "multi-user.target" ]; - }; - - hardware.graphics.enable32Bit = true; - - hardware.graphics.extraPackages = with pkgs; [ - libva - ]; - - services.udev.extraRules = '' - ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device" - ''; -} diff --git a/hosts/monolith/default.nix b/hosts/monolith/default.nix index 753047a..4dcc8b7 100644 --- a/hosts/monolith/default.nix +++ b/hosts/monolith/default.nix @@ -23,8 +23,6 @@ in imports = [ (modulesPath + "/installer/scan/not-detected.nix") ./partition.nix - ./amdgpu.nix - ./factorio-server.nix ]; boot.initrd.availableKernelModules = [ "nvme" @@ -35,29 +33,47 @@ in "sd_mod" ]; - hardware.opentabletdriver = { - enable = true; - # TODO: remove this once otd gets updated - package = pkgs.unstable.opentabletdriver; - }; - - my.gaming.enable = true; - my.nix-ld.enable = true; + hardware.opentabletdriver.enable = true; boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; - boot.initrd.kernelModules = [ "amdgpu" ]; boot.kernelModules = [ "kvm-amd" "amdgpu" "zenpower" ]; - + boot.kernelParams = [ + "amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug + "video=DP-1:1920x1080@144" + ]; systemd.sleep.extraConfig = '' HibernateDelaySec=30s SuspendState=mem ''; + hardware.opengl.driSupport = true; + # # For 32 bit applications + hardware.opengl.driSupport32Bit = true; + + hardware.opengl.extraPackages = with pkgs; [ + libva + libvdpau + vaapiVdpau + rocm-opencl-icd + rocm-opencl-runtime + rocmPackages.rocm-smi + ]; + + boot.kernelPackages = pkgs.linuxPackages_6_1; + + programs.corectrl = { + enable = true; + gpuOverclock = { + enable = true; + ppfeaturemask = "0xffffffff"; + }; + }; + fileSystems."/mnt/old" = { device = "/dev/disk/by-label/BTRFS_ROOT"; fsType = "btrfs"; @@ -120,11 +136,11 @@ in "nofail" ] ++ btrfs_options; }; - fileSystems."/home/lelgenio/.local/mount/old" = { - device = "/dev/disk/by-label/BTRFS_ROOT"; - fsType = "btrfs"; - options = [ "nofail" ] ++ btrfs_options ++ btrfs_ssd; - }; + # fileSystems."/home/lelgenio/.local/mount/bigboy" = { + # device = "/dev/disk/by-label/BTRFS_BIGBOY"; + # fsType = "btrfs"; + # options = [ "nofail" ] ++ btrfs_options ++ btrfs_ssd; + # }; # 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 @@ -136,15 +152,13 @@ in hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; networking.hostName = "monolith"; # Define your hostname. - virtualisation.virtualbox.host.enable = true; - services.udev.extraRules = '' # Fix broken suspend with Logitech USB dongle # `lsusb | grep Logitech` will return "vendor:product" ACTION=="add" SUBSYSTEM=="usb" ATTR{idVendor}=="046d" ATTR{idProduct}=="c547" ATTR{power/wakeup}="disabled" # Force all disks to use mq-deadline scheduler # For some reason "noop" is used by default which is kinda bad when io is saturated - ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ATTR{../queue/scheduler}="kyber" + ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ATTR{../queue/scheduler}="mq-deadline" ''; boot.tmp = { diff --git a/hosts/monolith/factorio-server.nix b/hosts/monolith/factorio-server.nix deleted file mode 100644 index 9648de3..0000000 --- a/hosts/monolith/factorio-server.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - services.factorio = { - enable = true; - package = pkgs.factorio-headless; # I override this in ./pkgs - public = true; - lan = true; - openFirewall = true; - admins = [ "lelgenio" ]; - extraSettingsFile = config.age.secrets.factorio-settings.path; - }; - - systemd.services.factorio = { - after = [ "network-online.target" ]; - wants = [ "network-online.target" ]; - }; - - systemd.services.factorio-backup-save = { - description = "Backup factorio saves"; - script = '' - FILENAME="space-age-$(date --iso=seconds | tr ':' '_').zip" - ${lib.getExe pkgs.rsync} \ - -av \ - --chown=lelgenio \ - /var/lib/factorio/saves/default.zip \ - ~lelgenio/Documentos/GameSaves/factorio_saves/$FILENAME - ''; - serviceConfig.Type = "oneshot"; - wantedBy = [ "multi-user.target" ]; - }; - - systemd.timers.factorio-backup-save = { - timerConfig = { - OnCalendar = "*-*-* 18:00:00"; - Persistent = true; - Unit = "factorio-backup-save.service"; - }; - wantedBy = [ "timers.target" ]; - }; - - age.secrets.factorio-settings = { - file = ../../secrets/factorio-settings.age; - mode = "777"; - }; -} diff --git a/hosts/phantom/davi.nix b/hosts/phantom/davi.nix deleted file mode 100644 index 876aee7..0000000 --- a/hosts/phantom/davi.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: -{ - users.users.davikiwi = { - isNormalUser = true; - description = "Davi"; - hashedPassword = "$y$j9T$0e/rczjOVCy7PuwC3pG0V/$gTHZhfO4wQSlFvbDyfghbCnGI2uDI0a52zSrQ/yOA5A"; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGgZDBnj+gVMHqoNvjpx2T/HqnxUDbLPshu+t7301gXd Davi@DESKTOP-EVHFGJ9" - ]; - extraGroups = [ "docker" ]; - packages = with pkgs; [ - (pkgs.python3.withPackages (python-pkgs: [ - python-pkgs.pip - python-pkgs.wheel - ])) - ]; - }; - - services.nginx.virtualHosts."davikiwi.lelgenio.com" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:24618"; - }; - }; -} diff --git a/hosts/phantom/default.nix b/hosts/phantom/default.nix index 1b0d3cb..db8a0bf 100644 --- a/hosts/phantom/default.nix +++ b/hosts/phantom/default.nix @@ -2,20 +2,15 @@ config, pkgs, inputs, - lib, ... }: { imports = [ - inputs.vpsadminos.nixosConfigurations.container + ./vpsadminos.nix inputs.agenix.nixosModules.default - inputs.sops-nix.nixosModules.default - - ../../system/sops.nix ../../system/nix.nix ./hardware-config.nix ./mastodon.nix - ./lemmy.nix ./nextcloud.nix ./nginx.nix ./syncthing.nix @@ -23,9 +18,7 @@ ./writefreely.nix ./email.nix ./forgejo.nix - ./invidious.nix - ./davi.nix - ./goofs.nix + ./warthunder-leak-counter.nix ]; networking.hostName = "phantom"; @@ -53,7 +46,7 @@ # Set your time zone. time.timeZone = "America/Sao_Paulo"; # Select internationalisation properties. - i18n.defaultLocale = "pt_BR.UTF-8"; + i18n.defaultLocale = "pt_BR.utf8"; boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576; @@ -61,27 +54,6 @@ identityPaths = [ "/root/.ssh/id_rsa" ]; }; - sops = { - secrets.hello = { }; - defaultSopsFile = lib.mkForce ../../secrets/phantom/default.yaml; - }; - - environment.etc."teste-sops" = { - text = config.sops.secrets.hello.path; - }; - - virtualisation.docker = { - enable = true; - daemon.settings = { - # needed by bitbucket runner ??? - log-driver = "json-file"; - log-opts = { - max-size = "10m"; - max-file = "3"; - }; - }; - }; - nix.settings = { cores = 1; max-jobs = 1; diff --git a/hosts/phantom/email.nix b/hosts/phantom/email.nix index 105113b..1951629 100644 --- a/hosts/phantom/email.nix +++ b/hosts/phantom/email.nix @@ -36,8 +36,6 @@ hashedPassword = "$2b$05$DcA9xMdvHqqQMZw2.zybI.vfKsQAJtaQ/JB.t9AHu6psstWq97m2C"; }; }; - - enableManageSieve = true; }; # Prefer ipv4 and use main ipv6 to avoid reverse DNS issues @@ -54,7 +52,7 @@ $config['smtp_host'] = "tls://${config.mailserver.fqdn}:587"; $config['smtp_user'] = "%u"; $config['smtp_pass'] = "%p"; - $config['plugins'] = [ "carddav", "archive", "managesieve" ]; + $config['plugins'] = [ "carddav", "archive" ]; ''; }; } diff --git a/hosts/phantom/forgejo.nix b/hosts/phantom/forgejo.nix index dbb63d3..eefb003 100644 --- a/hosts/phantom/forgejo.nix +++ b/hosts/phantom/forgejo.nix @@ -13,6 +13,9 @@ in virtualHosts.${cfg.settings.server.DOMAIN} = { forceSSL = true; enableACME = true; + extraConfig = '' + client_max_body_size 512M; + ''; locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}"; }; }; @@ -27,9 +30,6 @@ in ENABLED = true; DEFAULT_ACTIONS_URL = "github"; }; - repository = { - ENABLE_PUSH_CREATE_USER = true; - }; server = { DOMAIN = "git.lelgenio.com"; HTTP_PORT = 3000; @@ -37,7 +37,7 @@ in }; mailer = { ENABLED = true; - SMTP_ADDR = "lelgenio.com"; + SMTP_ADDR = "mail.lelgenio.com"; FROM = "noreply@git.lelgenio.com"; USER = "noreply@git.lelgenio.com"; }; diff --git a/hosts/phantom/goofs.nix b/hosts/phantom/goofs.nix deleted file mode 100644 index dfb5736..0000000 --- a/hosts/phantom/goofs.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ inputs, config, ... }: -{ - imports = [ - inputs.warthunder-leak-counter.nixosModules.default - inputs.made-you-look.nixosModules.default - ]; - - services.warthunder-leak-counter.enable = true; - services.nginx.virtualHosts."warthunder-leak-counter.lelgenio.com" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:${toString config.services.warthunder-leak-counter.port}"; - }; - }; - - services.made-you-look.enable = true; - services.nginx.virtualHosts."coolest-thing-ever.lelgenio.com" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:${toString config.services.made-you-look.port}"; - }; - }; - - services.nginx.virtualHosts."catboy-spinner.lelgenio.com" = { - enableACME = true; - forceSSL = true; - root = inputs.catboy-spinner; - }; - services.nginx.virtualHosts."tomater.lelgenio.com" = { - enableACME = true; - forceSSL = true; - root = inputs.tomater; - }; - services.nginx.virtualHosts."youre-wrong.lelgenio.com" = { - enableACME = true; - forceSSL = true; - root = inputs.youre-wrong; - }; - services.nginx.virtualHosts."hello-fonts.lelgenio.com" = { - enableACME = true; - forceSSL = true; - root = inputs.hello-fonts; - }; - services.nginx.virtualHosts."contador-da-viagem.lelgenio.com" = { - enableACME = true; - forceSSL = true; - root = inputs.contador-da-viagem; - }; -} diff --git a/hosts/phantom/hardware-config.nix b/hosts/phantom/hardware-config.nix index 7eebde8..683a684 100644 --- a/hosts/phantom/hardware-config.nix +++ b/hosts/phantom/hardware-config.nix @@ -1,15 +1,10 @@ { - fileSystems."/var/lib/syncthing-data" = { - device = "172.16.130.7:/nas/5749/syncthinng_data"; - fsType = "nfs"; - options = [ "nofail" ]; - }; - fileSystems."/var/lib/mastodon" = { - device = "172.16.131.19:/nas/5749/mastodon"; - fsType = "nfs"; - options = [ "nofail" ]; - }; - + config, + pkgs, + inputs, + ... +}: +{ swapDevices = [ { device = "/swap/swapfile"; diff --git a/hosts/phantom/invidious.nix b/hosts/phantom/invidious.nix deleted file mode 100644 index 60c1dca..0000000 --- a/hosts/phantom/invidious.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - inputs, - pkgs, - config, - ... -}: -{ - # Replace with unstable, since 24.05 does not have sig-helper - disabledModules = [ "services/web-apps/invidious.nix" ]; - imports = [ (inputs.nixpkgs-unstable + "/nixos/modules/services/web-apps/invidious.nix") ]; - - services.invidious = { - enable = true; - domain = "invidious.lelgenio.com"; - nginx.enable = true; - port = 10601; - http3-ytproxy.enable = true; - sig-helper = { - enable = true; - package = pkgs.unstable.inv-sig-helper; - }; - # { - # "visitor_data": "...", - # "po_token": "..." - # } - extraSettingsFile = config.age.secrets.phantom-invidious-settings.path; - settings = { - force_resolve = "ipv6"; - db = { - user = "invidious"; - dbname = "invidious"; - }; - }; - }; - - age.secrets.phantom-invidious-settings = { - file = ../../secrets/phantom-invidious-settings.age; - mode = "666"; - }; -} diff --git a/hosts/phantom/lemmy.nix b/hosts/phantom/lemmy.nix deleted file mode 100644 index 0e6ee1a..0000000 --- a/hosts/phantom/lemmy.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: -{ - services.lemmy = { - enable = true; - settings = { - hostname = "lemmy.lelgenio.com"; - }; - database.createLocally = true; - nginx.enable = true; - }; - - services.pict-rs.package = pkgs.pict-rs; - - services.nginx.virtualHosts."lemmy.lelgenio.com" = { - enableACME = true; - forceSSL = true; - }; -} diff --git a/hosts/phantom/nextcloud.nix b/hosts/phantom/nextcloud.nix index 28d76a1..88f0b02 100644 --- a/hosts/phantom/nextcloud.nix +++ b/hosts/phantom/nextcloud.nix @@ -1,16 +1,16 @@ { config, pkgs, + inputs, ... }: { services.nextcloud = { enable = true; - package = pkgs.nextcloud30; + package = pkgs.nextcloud29; hostName = "cloud.lelgenio.com"; https = true; config = { - dbtype = "sqlite"; # TODO: move to single postgres db adminpassFile = config.age.secrets.phantom-nextcloud.path; }; }; diff --git a/hosts/phantom/nginx.nix b/hosts/phantom/nginx.nix index bfff32c..0153fa6 100644 --- a/hosts/phantom/nginx.nix +++ b/hosts/phantom/nginx.nix @@ -11,7 +11,6 @@ recommendedTlsSettings = true; recommendedOptimisation = true; recommendedGzipSettings = true; - clientMaxBodySize = "512M"; }; # Redirect *lelgenio.xyz -> *lelgenio.com diff --git a/hosts/phantom/users.nix b/hosts/phantom/users.nix index a881f50..6291321 100644 --- a/hosts/phantom/users.nix +++ b/hosts/phantom/users.nix @@ -40,7 +40,6 @@ ]; initialHashedPassword = "$y$j9T$E3aBBSSq0Gma8hZD9L7ov0$iCGDW4fqrXWfHO0qodBYYgMFA9CpIraoklHcPbJJrM3"; }; - security.sudo.wheelNeedsPassword = false; programs.fish.enable = true; diff --git a/hosts/phantom/vpsadminos.nix b/hosts/phantom/vpsadminos.nix new file mode 100644 index 0000000..8102fbb --- /dev/null +++ b/hosts/phantom/vpsadminos.nix @@ -0,0 +1,76 @@ +# This file provides compatibility for NixOS to run in a container on vpsAdminOS +# hosts. +# +# If you're experiencing issues, try updating this file to the latest version +# from vpsAdminOS repository: +# +# https://github.com/vpsfreecz/vpsadminos/blob/staging/os/lib/nixos-container/vpsadminos.nix + +{ + config, + pkgs, + lib, + ... +}: +with lib; +let + nameservers = [ + "1.1.1.1" + "2606:4700:4700::1111" + ]; +in +{ + networking.nameservers = mkDefault nameservers; + services.resolved = mkDefault { fallbackDns = nameservers; }; + networking.dhcpcd.extraConfig = "noipv4ll"; + + systemd.services.systemd-sysctl.enable = false; + systemd.services.systemd-oomd.enable = false; + systemd.sockets."systemd-journald-audit".enable = false; + systemd.mounts = [ + { + where = "/sys/kernel/debug"; + enable = false; + } + ]; + systemd.services.rpc-gssd.enable = false; + + # Due to our restrictions in /sys, the default systemd-udev-trigger fails + # on accessing PCI devices, etc. Override it to match only network devices. + # In addition, boot.isContainer prevents systemd-udev-trigger.service from + # being enabled at all, so add it explicitly. + systemd.additionalUpstreamSystemUnits = [ "systemd-udev-trigger.service" ]; + systemd.services.systemd-udev-trigger.serviceConfig.ExecStart = [ + "" + "-udevadm trigger --subsystem-match=net --action=add" + ]; + + boot.isContainer = true; + boot.enableContainers = mkDefault true; + boot.loader.initScript.enable = true; + boot.specialFileSystems."/run/keys".fsType = mkForce "tmpfs"; + boot.systemdExecutable = mkDefault "/run/current-system/systemd/lib/systemd/systemd systemd.unified_cgroup_hierarchy=0"; + + # Overrides for + documentation.enable = mkOverride 500 true; + documentation.nixos.enable = mkOverride 500 true; + networking.useHostResolvConf = mkOverride 500 false; + services.openssh.startWhenNeeded = mkOverride 500 false; + + # Bring up the network, /ifcfg.{add,del} are supplied by the vpsAdminOS host + systemd.services.networking-setup = { + description = "Load network configuration provided by the vpsAdminOS host"; + before = [ "network.target" ]; + wantedBy = [ "network.target" ]; + after = [ "network-pre.target" ]; + path = [ pkgs.iproute2 ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${pkgs.bash}/bin/bash /ifcfg.add"; + ExecStop = "${pkgs.bash}/bin/bash /ifcfg.del"; + }; + unitConfig.ConditionPathExists = "/ifcfg.add"; + restartIfChanged = false; + }; +} diff --git a/hosts/phantom/warthunder-leak-counter.nix b/hosts/phantom/warthunder-leak-counter.nix new file mode 100644 index 0000000..acdbc0b --- /dev/null +++ b/hosts/phantom/warthunder-leak-counter.nix @@ -0,0 +1,19 @@ +{ + inputs, + pkgs, + config, + ... +}: +{ + imports = [ inputs.warthunder-leak-counter.nixosModules.default ]; + + services.warthunder-leak-counter.enable = true; + + services.nginx.virtualHosts."warthunder-leak-counter.lelgenio.com" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.warthunder-leak-counter.port}"; + }; + }; +} diff --git a/hosts/rainbow/default.nix b/hosts/rainbow/default.nix new file mode 100644 index 0000000..b977ee6 --- /dev/null +++ b/hosts/rainbow/default.nix @@ -0,0 +1,85 @@ +# 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, + ... +}: +let + btrfs_options = [ + "compress=zstd:3" + "noatime" + "x-systemd.device-timeout=0" + ]; + btrfs_ssd = [ + "ssd" + "discard=async" + ]; +in +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ "i915" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/BTRFS_ROOT"; + fsType = "btrfs"; + options = [ "subvol=@nixos" ] ++ btrfs_options ++ btrfs_ssd; + }; + + boot.initrd.luks.devices = { + "main" = { + bypassWorkqueues = true; + device = "/dev/disk/by-label/CRYPT_ROOT"; + }; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-label/BTRFS_ROOT"; + fsType = "btrfs"; + options = [ "subvol=@home" ] ++ btrfs_options ++ btrfs_ssd; + }; + + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/DC3B-5753"; + fsType = "vfat"; + }; + + fileSystems."/swap" = { + device = "/dev/disk/by-label/BTRFS_ROOT"; + fsType = "btrfs"; + options = [ "subvol=@swap" ] ++ btrfs_ssd; + }; + + swapDevices = [ + { + device = "/swap/swapfile"; + size = (1024 * 8); + } + ]; + + # 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.enp1s0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + networking.hostName = "rainbow"; # Define your hostname. +} diff --git a/overlays/default.nix b/overlays/default.nix index a032271..2ac2ae1 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -2,7 +2,6 @@ rec { all = [ scripts - unstable themes new-packages patches @@ -12,10 +11,6 @@ rec { scripts = (import ../scripts); - unstable = final: prev: { - unstable = import inputs.nixpkgs-unstable { inherit (final) system config; }; - }; - themes = ( final: prev: { papirus_red = (final.papirus-icon-theme.override { color = "red"; }); @@ -28,6 +23,14 @@ rec { ]; } ); + nerdfonts_fira_hack = ( + final.nerdfonts.override { + fonts = [ + "FiraCode" + "Hack" + ]; + } + ); } ); diff --git a/pkgs/blade-formatter/default.nix b/pkgs/blade-formatter/default.nix new file mode 100644 index 0000000..f824066 --- /dev/null +++ b/pkgs/blade-formatter/default.nix @@ -0,0 +1,64 @@ +{ + lib, + mkYarnPackage, + fetchFromGitHub, + fetchYarnDeps, + testers, + writeText, + runCommand, + blade-formatter, +}: + +mkYarnPackage rec { + pname = "blade-formatter"; + version = "1.38.2"; + + src = fetchFromGitHub { + owner = "shufo"; + repo = pname; + rev = "v${version}"; + hash = "sha256-JvILLw7Yp4g/dSsYtZ2ylmlXfS9t+2KADlBrYOJWTpg="; + }; + + packageJSON = ./package.json; + offlineCache = fetchYarnDeps { + yarnLock = "${src}/yarn.lock"; + hash = "sha256-UFDxw3fYMzSUhZw+TCEh/dN7OioKI75LzKSnEwGPKDA="; + }; + + postBuild = "yarn build"; + + passthru.tests = { + version = testers.testVersion { + package = blade-formatter; + command = "blade-formatter --version"; + }; + + simple = testers.testEqualContents { + assertion = "blade-formatter formats a basic blade file"; + expected = writeText "expected" '' + @if (true) + Hello world! + @endif + ''; + actual = + runCommand "actual" + { + nativeBuildInputs = [ blade-formatter ]; + base = writeText "base" '' + @if( true ) Hello world! @endif + ''; + } + '' + blade-formatter $base > $out + ''; + }; + }; + + meta = with lib; { + description = "Laravel Blade template formatter"; + homepage = "https://github.com/shufo/blade-formatter"; + license = licenses.mit; + maintainers = with maintainers; [ lelgenio ]; + }; +} diff --git a/pkgs/blade-formatter/package.json b/pkgs/blade-formatter/package.json new file mode 100755 index 0000000..b43fa5c --- /dev/null +++ b/pkgs/blade-formatter/package.json @@ -0,0 +1,120 @@ +{ + "name": "blade-formatter", + "engines": { + "node": ">= 14.0.0" + }, + "keywords": [ + "php", + "formatter", + "laravel" + ], + "version": "1.38.2", + "description": "An opinionated blade template formatter for Laravel", + "main": "./dist/bundle.cjs", + "types": "./dist/types/main.d.ts", + "type": "module", + "exports": { + ".": { + "import": "./dist/bundle.js", + "require": "./dist/bundle.cjs", + "default": "./dist/bundle.js" + }, + "./*": "./*" + }, + "scripts": { + "build": "cross-env NODE_ENV=production node esbuild.js && cross-env NODE_ENV=production ESM_BUILD=true node esbuild.js", + "prepublish": "tsc src/main.ts --declaration --emitDeclarationOnly --outDir ./dist/types || true", + "watch": "node esbuild.js", + "test": "yarn run build && node --experimental-vm-modules node_modules/.bin/jest", + "lint": "eslint src -c .eslintrc.json --ext ts", + "fix": "prettier {src,__tests__}/**/*.ts --write", + "check_formatted": "prettier **/*.ts -c", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", + "prepare": "husky install", + "bin": "cross-env ./bin/blade-formatter.cjs" + }, + "bin": { + "blade-formatter": "bin/blade-formatter.cjs" + }, + "author": "Shuhei Hayashibara", + "license": "MIT", + "dependencies": { + "@prettier/plugin-php": "^0.19.7", + "@shufo/tailwindcss-class-sorter": "3.0.1", + "aigle": "^1.14.1", + "ajv": "^8.9.0", + "chalk": "^4.1.0", + "concat-stream": "^2.0.0", + "detect-indent": "^6.0.0", + "find-config": "^1.0.0", + "glob": "^8.0.1", + "html-attribute-sorter": "^0.4.3", + "ignore": "^5.1.8", + "js-beautify": "^1.14.8", + "lodash": "^4.17.19", + "php-parser": "3.1.5", + "prettier": "^2.2.0", + "tailwindcss": "^3.1.8", + "vscode-oniguruma": "1.7.0", + "vscode-textmate": "^7.0.1", + "xregexp": "^5.0.1", + "yargs": "^17.3.1" + }, + "devDependencies": { + "@babel/core": "^7.6.4", + "@babel/plugin-transform-modules-commonjs": "^7.16.5", + "@babel/preset-env": "^7.13.12", + "@babel/preset-typescript": "^7.16.5", + "@types/concat-stream": "^2.0.0", + "@types/find-config": "^1.0.1", + "@types/fs-extra": "^11.0.0", + "@types/glob": "^8.0.0", + "@types/jest": "^29.0.0", + "@types/js-beautify": "^1.13.3", + "@types/lodash": "^4.14.178", + "@types/mocha": "^10.0.0", + "@types/node": "^18.0.0", + "@types/xregexp": "^4.4.0", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "app-root-path": "^3.0.0", + "babel-jest": "^29.0.0", + "codecov": "^3.8.3", + "cross-env": "^7.0.3", + "esbuild": "^0.19.0", + "esbuild-node-externals": "^1.4.1", + "eslint": "^8.5.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.0.0", + "eslint-config-prettier": "^9.0.0", + "eslint-import-resolver-typescript": "^3.0.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-jest": "^26.0.0", + "eslint-plugin-prettier": "^5.0.0", + "fs-extra": "^11.0.0", + "husky": "^8.0.0", + "jest": "^29.0.0", + "lint-staged": ">=10", + "source-map-loader": "^4.0.0", + "ts-jest": "^29.0.0", + "ts-loader": "^9.2.6", + "ts-migrate": "^0.1.27", + "ts-node": "^10.4.0", + "typescript": "^5.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/shufo/blade-formatter.git" + }, + "files": [ + "dist", + "src", + "bin", + "wasm", + "syntaxes", + "CHANGELOG.md" + ], + "lint-staged": { + "*.ts": "yarn run fix" + } +} diff --git a/pkgs/default.nix b/pkgs/default.nix index b702886..73134c7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,13 +2,11 @@ # You can build them using 'nix build .#example' or (legacy) 'nix-build -A example' { pkgs, inputs }: -rec { +{ + blade-formatter = pkgs.callPackage ./blade-formatter { }; cargo-checkmate = pkgs.callPackage ./cargo-checkmate.nix { }; lipsum = pkgs.callPackage ./lipsum.nix { }; emmet-cli = pkgs.callPackage ./emmet-cli.nix { }; material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { }; gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { }; - factorio-headless = pkgs.callPackage ./factorio-headless { - inherit (pkgs.unstable) factorio-headless; - }; } diff --git a/pkgs/factorio-headless/default.nix b/pkgs/factorio-headless/default.nix deleted file mode 100644 index 8d81f1d..0000000 --- a/pkgs/factorio-headless/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ factorio-headless, pkgs }: - -factorio-headless.overrideAttrs (_: rec { - version = "2.0.47"; - src = pkgs.fetchurl { - name = "factorio_headless_x64-${version}.tar.xz"; - url = "https://www.factorio.com/get-download/${version}/headless/linux64"; - hash = "sha256-8PMgx3YWpHlCJ+tjenC1VxCPMUGkYzJ2WTIgp2j0miY="; - }; -}) diff --git a/pkgs/factorio-headless/update.sh b/pkgs/factorio-headless/update.sh deleted file mode 100755 index 2f57612..0000000 --- a/pkgs/factorio-headless/update.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -xe - -cd "$(dirname $0)" - -current_version="$(rg '^.*?version\s*=\s*"(.+)".*?$' --replace '$1' ./default.nix)" -current_hash="$(rg '^.*?hash\s*=\s*"(.+)".*?$' --replace '$1' ./default.nix)" - -new_version="$(curl https://factorio.com/api/latest-releases | jq -r .stable.headless)" -new_hash="$(nix-hash --to-sri --type sha256 $(nix-prefetch-url --type sha256 https://www.factorio.com/get-download/${new_version}/headless/linux64))" - -sd --fixed-strings "$current_version" "$new_version" ./default.nix -sd --fixed-strings "$current_hash" "$new_hash" ./default.nix diff --git a/pkgs/gnome-pass-search-provider.nix b/pkgs/gnome-pass-search-provider.nix index ab2e94a..e149505 100644 --- a/pkgs/gnome-pass-search-provider.nix +++ b/pkgs/gnome-pass-search-provider.nix @@ -5,6 +5,7 @@ wrapGAppsHook, gtk3, gobject-introspection, + gnome, }: let diff --git a/scripts/_diffr b/scripts/_diffr old mode 100755 new mode 100644 diff --git a/scripts/_docker-block-external-connections b/scripts/_docker-block-external-connections deleted file mode 100755 index f22bc4f..0000000 --- a/scripts/_docker-block-external-connections +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -# Create the DOCKER-USER chain if it doesn't exist -iptables -N DOCKER-USER || true - -# Flush existing rules in the DOCKER-USER chain -iptables -F DOCKER-USER - -# Get all external network interfaces -interfaces=$( - ip -o -f inet addr show | - awk '{print $2}' | - grep -E '^(enp|eth|wlan|wlp)' | - sort -u -) - -for iface in $interfaces; do - # Allow traffic from LAN - iptables -A DOCKER-USER -i "$iface" -s 127.0.0.1 -j ACCEPT - iptables -A DOCKER-USER -i "$iface" -s 10.0.0.0/8 -j ACCEPT - iptables -A DOCKER-USER -i "$iface" -s 192.168.0.0/16 -j ACCEPT - - # Allow established and related connections - iptables -A DOCKER-USER -i "$iface" -m state --state RELATED,ESTABLISHED -j ACCEPT - - # Drop all other traffic - iptables -A DOCKER-USER -i "$iface" -j DROP - - echo "iptables rules have been set up for interface: $iface" -done - -# Return to the previous chain -iptables -A DOCKER-USER -j RETURN diff --git a/scripts/_sway_idle_toggle b/scripts/_sway_idle_toggle old mode 100755 new mode 100644 diff --git a/scripts/amd-fan-control b/scripts/amd-fan-control deleted file mode 100755 index 5b0d7a9..0000000 --- a/scripts/amd-fan-control +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -set -e - -DEVICE="$1" # eg: /sys/class/drm/card1/device -HWMON=$(echo "$DEVICE"/hwmon/hwmon*) - -exit() { - echo "Setting controll to auto" >&2 - echo 2 > "$HWMON/pwm1_enable" -} - -trap exit EXIT INT - -bail() { - echo "Error: $@" >&2 - echo "Exiting..." >&2 - exit 1 -} - -if ! [ -d "$HWMON" ]; then - bail "Invalid HWMON" -fi - -TEMP_INPUT="$HWMON/temp2_input" - -if ! [ -f $TEMP_INPUT ]; then - bail "Invalid TEMP_INPUT" -fi - -TEMP_MIN="$2" -TEMP_MAX="$3" - -if [ -z "$TEMP_MIN" ];then - bail "No minimum temperature provided" -fi - -if [ -z "$TEMP_MAX" ];then - bail "No maximum temperature provided" -fi - -PWM_MIN_PCT="$4" -PWM_MAX_PCT="$5" - -if [ -z "$PWM_MIN_PCT" ];then - bail "No minimum fan speed % not provided" -fi - -if [ -z "$PWM_MAX_PCT" ];then - bail "No maximum fan speed % not provided" -fi - -PWM_MIN="$(( $PWM_MIN_PCT * 255 / 100))" -PWM_MAX="$(( $PWM_MAX_PCT * 255 / 100))" - -echo "Running..." >&2 - -echo "TEMP_MIN=$TEMP_MIN°C" -echo "TEMP_MAX=$TEMP_MAX°C" -echo "FAN_MIN=$PWM_MIN_PCT%" -echo "FAN_MAX=$PWM_MAX_PCT%" - -echo 1 > "$HWMON/pwm1_enable" - -PREV=0 - -while true; do - TEMPERATURE_RAW=$(cat "$TEMP_INPUT") - TEMPERATURE="$(( $TEMPERATURE_RAW / 1000 ))" - # Remap from a number between 60_000..90_000 to 0..255 - PWM=$(( ($TEMPERATURE - $TEMP_MIN) * $PWM_MAX / ($TEMP_MAX - $TEMP_MIN) )) - - if [ "$PWM" -gt $PWM_MAX ]; then - PWM=$PWM_MAX - elif [ "$PWM" -lt $PWM_MIN ]; then - PWM=$PWM_MIN - fi - - AVG="$(( ($PWM * 20 + $PREV * 80) / 100 ))" - - echo "$AVG" - - echo "$AVG" > "$HWMON/pwm1" - PREV="$AVG" - sleep .1s -done diff --git a/scripts/auto_connect_gamepad b/scripts/auto_connect_gamepad new file mode 100755 index 0000000..6ff45b7 --- /dev/null +++ b/scripts/auto_connect_gamepad @@ -0,0 +1,27 @@ +#!/bin/sh + +list_paired_controllers() { + bluetoothctl devices Paired | grep -i 'controller' | cut -d' ' -f2 +} + +count_connected_controllers() { + bluetoothctl devices Connected | grep -i 'controller' | wc -l +} + +try_to_connect_to_all_controllers() { + list_paired_controllers | while read paired_controller; do + echo "Trying to connect to controller $paired_controller" + bluetoothctl connect "$paired_controller" + done +} + +while true; do + echo "looping" + if test "$(count_connected_controllers)" -ne 0 ; then + echo "there is a controller connected, not attempting to connect to any other" + sleep 10s + continue + fi + sleep 1s + try_to_connect_to_all_controllers +done diff --git a/scripts/bmenu b/scripts/bmenu old mode 100755 new mode 100644 index 8abad08..c793269 --- a/scripts/bmenu +++ b/scripts/bmenu @@ -8,10 +8,13 @@ if test "$argv[1]" = "run" test -n "$argv[2]" && set t "$argv[2]" || set t "terminal" + test -n "$i3SOCK" && set wrapper 'i3-msg exec --' + test -n "$SWAYSOCK" && set wrapper 'swaymsg exec --' + exec j4-dmenu-desktop \ --dmenu="bmenu start -p Iniciar:" \ --term "$t" \ - --i3-ipc \ + --wrapper="$wrapper" \ --no-generic end diff --git a/scripts/br b/scripts/br old mode 100755 new mode 100644 diff --git a/scripts/controller-battery b/scripts/controller-battery deleted file mode 100755 index b8ed4f2..0000000 --- a/scripts/controller-battery +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -set -e - -CONTROLLER=$(find /sys/class/power_supply -maxdepth 1 -name '*controller*' || true) - -if test -z "$CONTROLLER"; then - echo - exit 0 -fi - -CAPACITY=$(cat "$CONTROLLER/capacity") - -echo -n '󰊴' - -if test "$CAPACITY" -ge 90; then - echo '󰁹' -elif test "$CAPACITY" -ge 90; then - echo '󰂂' -elif test "$CAPACITY" -ge 80; then - echo '󰂁' -elif test "$CAPACITY" -ge 70; then - echo '󰂀' -elif test "$CAPACITY" -ge 60; then - echo '󰁿' -elif test "$CAPACITY" -ge 50; then - echo '󰁾' -elif test "$CAPACITY" -ge 40; then - echo '󰁽' -elif test "$CAPACITY" -ge 30; then - echo '󰁼' -elif test "$CAPACITY" -ge 20; then - echo '󰁻' -elif test "$CAPACITY" -ge 10; then - echo '󰁺' -else - echo '󰂎' -fi diff --git a/scripts/default.nix b/scripts/default.nix index 9b0b728..72f9cc6 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -1,33 +1,34 @@ ( final: prev: + with prev; let - lib = prev.lib; - - importScript = (_: path: import (path) { inherit (final) pkgs lib; }); - wrapScript = + import_script = (_: path: import (path) { inherit pkgs lib; }); + create_script = ( name: text: runtimeInputs: - final.runCommand name - { - nativeBuildInputs = [ final.makeWrapper ]; - meta.mainProgram = name; - } - '' - mkdir -p $out/bin - cp ${text} $out/bin/${name} - wrapProgram $out/bin/${name} \ - --suffix PATH : ${lib.makeBinPath runtimeInputs} - ''; - createScripts = lib.mapAttrs (name: deps: wrapScript name ./${name} deps); + let + script_body = pkgs.writeTextFile { + inherit name; + executable = true; + text = '' + ${builtins.readFile text} + ''; + }; + in + (pkgs.writeShellApplication { + inherit name runtimeInputs; + text = ''exec ${script_body} "$@"''; + checkPhase = ""; + }) + ); + create_scripts = lib.mapAttrs (name: deps: create_script name ./${name} deps); - myPass = final.pass.withExtensions (ex: with ex; [ pass-otp ]); + pass = pkgs.pass.withExtensions (ex: with ex; [ pass-otp ]); in - with final; - createScripts { - amd-fan-control = [ bash ]; + create_scripts { br = [ ]; bmenu = [ - bemenu - dhist + final.bemenu + final.dhist fish j4-dmenu-desktop jq @@ -43,21 +44,21 @@ fish ]; _diffr = [ diffr ]; - _thunar-terminal = [ terminal ]; - _sway_idle_toggle = [ swayidle ]; + _thunar-terminal = [ final.terminal ]; + _sway_idle_toggle = [ final.swayidle ]; kak-pager = [ fish - _diffr + final._diffr ]; - kak-man-pager = [ kak-pager ]; + kak-man-pager = [ final.kak-pager ]; helix-pager = [ fish - _diffr + final._diffr ]; - helix-man-pager = [ helix-pager ]; + helix-man-pager = [ final.helix-pager ]; musmenu = [ mpc-cli - wdmenu + final.wdmenu trash-cli xdg-user-dirs libnotify @@ -70,13 +71,11 @@ pass-export = [ pass2csv gnupg - sd ]; wpass = [ - wdmenu - ripgrep + final.wdmenu fd - myPass + pass sd wl-clipboard wtype @@ -97,7 +96,7 @@ pulse_sink = [ pulseaudio pamixer - wdmenu + final.wdmenu ]; color_picker = [ grim @@ -109,13 +108,13 @@ dzadd = [ procps libnotify - wdmenu + final.wdmenu jq mpv pqiv python3Packages.deemix mpc-cli - mpdDup + final.mpdDup ]; mpdDup = [ mpc-cli @@ -126,27 +125,14 @@ zbar wl-clipboard ]; - git_clean_remote_deleted = [ - git + auto_connect_gamepad = [ + bluez + coreutils gnugrep - gawk - findutils - ]; - pint-fmt = [ ]; - powerplay-led-idle = [ - bash - libinput - libratbag - ]; - controller-battery = [ ]; - _docker-block-external-connections = [ - iptables - gawk - gnugrep - iproute2 ]; + vrr-fullscreen = [ ]; } - // lib.mapAttrs importScript { + // lib.mapAttrs import_script { wdmenu = ./wdmenu.nix; wlauncher = ./wlauncher.nix; _gpg-unlock = ./_gpg-unlock.nix; diff --git a/scripts/git_clean_remote_deleted b/scripts/git_clean_remote_deleted deleted file mode 100755 index 99bc93d..0000000 --- a/scripts/git_clean_remote_deleted +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -git branch -vv \ -| grep ': gone]' \ -| awk '{print $1}' \ -| xargs git branch -D diff --git a/scripts/helix-pager b/scripts/helix-pager old mode 100755 new mode 100644 diff --git a/scripts/kak-pager b/scripts/kak-pager old mode 100755 new mode 100644 diff --git a/scripts/pass-export b/scripts/pass-export index 27596fc..658f803 100755 --- a/scripts/pass-export +++ b/scripts/pass-export @@ -8,6 +8,3 @@ pass2csv "$PASSWORD_STORE_DIR" "$HOME/passwords.csv" \ -f User '(user|login)(:\s*)?' \ -f TOTP 'otpauth(:)?' \ -f URL 'url(:\s*)?' - -# Fix TOTP format for keepass -sd '"//totp/.*?secret=(.*?)(&.*?)?"' '"$1"' "$HOME/passwords.csv" \ No newline at end of file diff --git a/scripts/pint-fmt b/scripts/pint-fmt deleted file mode 100755 index 4d84c88..0000000 --- a/scripts/pint-fmt +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -file="$(mktemp)" -cat - >"$file" -./vendor/bin/pint --quiet "$file" -cat "$file" -rm "$file" diff --git a/scripts/playerctl-status b/scripts/playerctl-status old mode 100755 new mode 100644 diff --git a/scripts/powerplay-led-idle b/scripts/powerplay-led-idle deleted file mode 100755 index 888abde..0000000 --- a/scripts/powerplay-led-idle +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Constants -SECONDS_UNTIL_FADE=$(( 1 * 60)) -SECONDS_UNTIL_OFF=$(( 6 * 60)) - -COLOR_ON=ff0000 -COLOR_FADE=880000 -COLOR_OFF=000000 - -# Logging - -if [[ "$1" = "debug" ]]; then - echo "Running with debugging" >&2 - DEBUG="true" - - SECONDS_UNTIL_FADE=$(( 3 )) - SECONDS_UNTIL_OFF=$(( 5 )) -fi - -log() { - if [[ "$DEBUG" = "true" ]]; then - echo "$@" >&2 - fi -} - -# Implementation - -main() { - CURRENT_STATE="UNKNOWN" - LAST_POINTER_MOTION="$(date +%s)" - - if [ "$(ratbagctl list | wc -l)" -ne 1 ]; then - echo "Not exactly one device found, exiting..." - exit 1 - fi - - DEVICE="$(ratbagctl list | cut -d: -f1)" - - while true; do - while read line; do - LAST_POINTER_MOTION="$(date +%s)" - break - done < <( - timeout 5s \ - libinput debug-events \ - | grep POINTER_MOTION - ) - TIME_SINCE_LAST=$(( "$(date +%s)" - "$LAST_POINTER_MOTION" )) - log "Last pointer motion was $TIME_SINCE_LAST seconds ago" - if [ "$TIME_SINCE_LAST" -gt "$SECONDS_UNTIL_OFF" ]; then - setState OFF "$COLOR_OFF" - elif [ "$TIME_SINCE_LAST" -gt "$SECONDS_UNTIL_FADE" ]; then - setState FADE "$COLOR_FADE" - else - setState ON "$COLOR_ON" - fi - done -} - -setState() { - STATE="$1" - COLOR="$2" - MODE="$3" - - if [[ "$STATE" = "$CURRENT_STATE" ]]; then - log "Already in $STATE state" - return - fi - log "Changing state to $STATE" - CURRENT_STATE="$STATE" - - ratbagctl "$DEVICE" led 0 set mode on - ratbagctl "$DEVICE" led 0 set color "$COLOR" -} - -main diff --git a/scripts/pulse_sink b/scripts/pulse_sink old mode 100755 new mode 100644 diff --git a/scripts/screenshotsh b/scripts/screenshotsh old mode 100755 new mode 100644 diff --git a/scripts/showkeys b/scripts/showkeys old mode 100755 new mode 100644 diff --git a/scripts/terminal b/scripts/terminal old mode 100755 new mode 100644 diff --git a/scripts/vrr-fullscreen b/scripts/vrr-fullscreen new file mode 100755 index 0000000..8413923 --- /dev/null +++ b/scripts/vrr-fullscreen @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# List of supported outputs for VRR +output_vrr_whitelist=( + "DP-1" + "DP-2" +) + +# Toggle VRR for fullscreened apps in prespecified displays to avoid stutters while in desktop +swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do + window_event=$(echo ${window_json} | jq -r '.change') + + # Process only focus change and fullscreen toggle + if [[ $window_event = "focus" || $window_event = "fullscreen_mode" ]]; then + output_json=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused == true)') + output_name=$(echo ${output_json} | jq -r '.name') + + # Use only VRR in whitelisted outputs + if [[ ${output_vrr_whitelist[*]} =~ ${output_name} ]]; then + output_vrr_status=$(echo ${output_json} | jq -r '.adaptive_sync_status') + window_fullscreen_status=$(echo ${window_json} | jq -r '.container.fullscreen_mode') + + # Only update output if nesseccary to avoid flickering + [[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]] && swaymsg output "${output_name}" adaptive_sync 1 + [[ $output_vrr_status = "enabled" && $window_fullscreen_status = "0" ]] && swaymsg output "${output_name}" adaptive_sync 0 + fi + fi +done diff --git a/scripts/wl-copy-file b/scripts/wl-copy-file old mode 100755 new mode 100644 diff --git a/scripts/wpass b/scripts/wpass old mode 100755 new mode 100644 index 52bcdff..97e4671 --- a/scripts/wpass +++ b/scripts/wpass @@ -29,7 +29,7 @@ main() { test -n "$entry" || exit 0 - username=`pass show "$entry" 2>/dev/null | rg -m1 '(login|user|email): (.*)' -r '$2'` + username=`pass show "$entry" 2>/dev/null | perl -ne 'print $2 if /^(login|user|email): (.*)/'` password=`pass show "$entry" 2>/dev/null | head -n 1` otp=`pass otp "$entry" 2>/dev/null` || true diff --git a/secrets/factorio-settings.age b/secrets/factorio-settings.age deleted file mode 100644 index 77eb8bd..0000000 Binary files a/secrets/factorio-settings.age and /dev/null differ diff --git a/secrets/monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age b/secrets/monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age index 60c5c70..9f9e0e3 100644 Binary files a/secrets/monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age and b/secrets/monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age differ diff --git a/secrets/monolith/default.yaml b/secrets/monolith/default.yaml deleted file mode 100644 index 0dbc4ae..0000000 --- a/secrets/monolith/default.yaml +++ /dev/null @@ -1,47 +0,0 @@ -forgejo-runners: - git.lelgenio.com-default: ENC[AES256_GCM,data:sEfpBZvgQUkyXPWY4RI0RPJWUbsYK/RGqiYJ5wDSVY9a0EYenyt96QYq6815evq2iQ==,iv:rSWnCOdhfKH4TM9R0/IParYd9laYhWxR+iUhgkVvqfc=,tag:mBcSH/oGDMBgBScvCdn3Zg==,type:str] -gitlab-runners: - thoreb-telemetria-nix: ENC[AES256_GCM,data:zrZvG4be08ulpo7itbrprKK5csCMLvzZjrszfMw1XiJP0FyRTUd9nHgHpbAzbjj2KyT7kKngoZAyengvaTEhkT9sUi1pdGnvajAH8BDDOD0g4LJIHFl4,iv:3bSsTzU7gHx+MchuPg9kmb5xEDugmGPje8Jw74NpRJI=,tag:zffRr77lWbyLt7o/mywb5A==,type:str] - thoreb-itinerario-nix: ENC[AES256_GCM,data:UdAAD0V895sFoEYR56sCG2LlpZugJ0K/nwkTygzWOnbTSmBRAcIQ8qVFPZGw+K+XMSLiCyio6Jp7k8AYP0K1VYm+6aEP3OkqR9FCLQTJgXo=,iv:UGUby50BYkn13OzItk6zZmxc5+SnbZZa4bebQHIow2A=,tag:LjDg3deWwdH2T71EtPo6jA==,type:str] - docker-images-token: ENC[AES256_GCM,data:GGB/KSkjdAyhFKEspAh91ItbqEDf7K/LZSGSn+Jp7SxRfXpDzHIiMD8XJ9PTkGLeQGN4ug1i2nTYPS7d/P5OALWDU+1NPiV9nPdG0w7GERfu4g==,iv:6roabdOKX9xFMf0hWlECd73+943R+hFLos0e2dOpzns=,tag:LrASFc4DtN7aQ+3oOW/p/w==,type:str] - wopus-gitlab-nix: ENC[AES256_GCM,data:asE7J0d58x9VfQFWc07f5T4s5NZ+/VqMQo66EX93J0LbJ4iI5YjvrrIE4pSI1e4Nz/SRQhltaJ0DfSH0+qgjD4wnAONPRi3UlFbSdGWS2bwwRtWe+Nci2krrUFxV2i/ZVE3CwCkNe4mqtII=,iv:gKrD/LhzI+jnDnX6CdxoHfjpiRdrsuRYJF9rTc8SffM=,tag:TczDGSU3gdKmERjBJ7tP/A==,type:str] -sops: - age: - - recipient: age1zrgu7w8059xydagm60phnffghvfe9h2ca58cx8qwagqpyfuvs9fqw79c8h - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBlaFFtOHRBNjZqOXJOV1Bk - SXRhZTdNWklKaTZST2JhU3VFLzBGSWY0QlMwCldwS1hhMDEyZDAxWUlRRXZtTWts - Ti9IOUR2OFdGYkJ4cFRsV0lkbWJvb1EKLS0tIEJUS1ZCZ1M4ZUs5cDhiam5JaEk1 - U1VjNFprNHZWeDhwU3owRXh0MlBFYkUKHPgxz9/w3+JEtOljfyWBPSshfFlVWVys - f15yxlAeWIZVEGqoau7DegVdZiYYIJR2dFBXV1RkKbAwLrbUxAQidg== - -----END AGE ENCRYPTED FILE----- - - recipient: age1ecyynwv93lfu7crjjp8l47defv07quzfzaktwurpep7jc9eha5pscg7lrw - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5OWk0cTJ4d25Qd0hrdkFD - a2Fzd1lrMDREclkvRmxUSjFpYXZvRGs2Rm13Cm5aRVZDWE5ZUVR1K2hkZkdKWjYw - K3lKNndBNGFveGVGVWplaHA0MVlYUG8KLS0tIFlVeXhCTGJGUm1HK2RCSFg1RnI3 - aFVxcDFhaGdYekRWRVFIWnRsZndtZFkKgsvxOFHOcO306Z9FkucA1fDOpZA8N1/h - jYmIgcKTFgWoSCvux67lK30jFsYp7sm5z6WxxDYsGcoQ/+pxoUX2jQ== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-06-24T11:51:22Z" - mac: ENC[AES256_GCM,data:onyjWlFsH/9YGSi2nGsPmZjhE4nFVQ5Jiwfi4s9KC7NetKD7Reyz2JY6i3YuZspBn3Jvbq8nOKVPGzttMAG+IrqQEv6+MxrCOEnJZXZcqocDNg7dACOXmJB5iwpFVdKscesTH2SScf7Pl/q6l9KOFjFuaZeBB7dlxHVA5zzCVOU=,iv:lEbxg2HfxU6ikgWSpUNAGIfgaz7DnZjXnLWcmsvt0A4=,tag:/Ag37QuJj9Xy/u20Nhy05Q==,type:str] - pgp: - - created_at: "2025-03-07T22:49:16Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hQEMAzy6JxafzLr5AQgAjwQqdeESOfrOuCjfjALdoy3AnNYC+slusdlra58CoRu6 - YFDAivwPHJBRiuVy43Lo7SWnKXMKvLOry589GBY3JGjNV5U1cPWBhMlTubYZmZWl - iel8Bvw4IF5JksMIvLFdDgexLN7wETzzZP9S8750BCgpSrncrw1k/dUedhv5HUjo - N10x6BPjPSmgolA8uxsISHLAUrKcQoeaWvcZFU1ofKywq08HgIySphy6z3Gmv3Qs - 86saZp1rFm5+qHkrDRgL6Oe3Xx30jVkzn9MHPWzZCDPCEvYGJgXX34NGzbX+/nd3 - JB9XkT2YTFi4BLhdHY3EE7e9//PJc5G9RVDZyAF1e9JeAXH2yR5blXbogoy+VMnS - Yn74Uvs+fnYFTDOiuequro5i0uAyxtrCx8fdfwjuh+9SC5p3N2cBv2eT7zLQwQHi - czHlwxmpi/dMB/u83fR4FzuCUt98VXiezIC4yGn25g== - =Yqqx - -----END PGP MESSAGE----- - fp: 0FECE8316E74BA6F44EFC21A2F8F21CE8721456B - unencrypted_suffix: _unencrypted - version: 3.10.2 diff --git a/secrets/phantom-invidious-settings.age b/secrets/phantom-invidious-settings.age deleted file mode 100644 index 6ca9077..0000000 --- a/secrets/phantom-invidious-settings.age +++ /dev/null @@ -1,16 +0,0 @@ -age-encryption.org/v1 --> ssh-rsa BwwxHg -iTcgtxF1IxopbtF+aw7V8IQfH7tWiMk9lE/eWlVHVjeaRvER5W6Y3xZNOFCjtbqY -VwEyV6ibfZ4GJt1jRu2icEH/AnLUJFFGQnxu/K/rtoZ3tqSIk9WCBv3aPo4oZRiU -uaaxi2gD8qo1RLyl/Ij7Djw4i/isUOO1EON5sgx1d39k6qUD4Mak0DSU4EtGdTsr -OaxDAc0kAxhxZQOUH/QlKa0HLonaFcy1LHqvttOcw3UZuZnaYfZiPlcqe3USS9cm -96aIC5cS9pHr4JFrqRYvfpla2TY5jlCB/xBGw3KjGEIQoBPXSsJZA6BCMZyp00++ -tdfS2aomt9HFmb1wZDS0jWAxkVF6nXXBbolFVih+58h0nYLljtHIQ3SizRoXY459 -x3JE9NReHp2OO3SlIeO03Kv8YMBvj7nSSd1C1PMpu+hJ/eCXi1WQxD6QY+40muk6 -KhqE3PZ8BCY2b+VpywUF5gVH28mo3jscqAzhf2dZ3SQlzldI+hFyKPxTdAqkfUOH - ---- cinb+wzjVfTkpfm1CtFIFaepwoQVCj1MquB5rAC45Ew - -6 -ZCHS0 7 EX* qb=OwuP ǖѳ/mv2Vī -xv[̂A~evd0ni1қQ"@ٹ{Kp:ϵusB(Xr[QVgT@*B .hE鲟뒭zlz|k`l88McchZ` ?yeo+M-:/**cZD2&Ǣ e*Hn"~+|ua(6J \ No newline at end of file diff --git a/secrets/phantom/default.yaml b/secrets/phantom/default.yaml deleted file mode 100644 index 962c6ba..0000000 --- a/secrets/phantom/default.yaml +++ /dev/null @@ -1,54 +0,0 @@ -hello: ENC[AES256_GCM,data:UJAAdOL7wzQ1LduTyW+XK2NtXyw/u/Yz28Bmd7OoBe41FVLKwVfvdI1nAwYuNQ==,iv:7kPT2HF5T498bUJ9hUlz5Ez/jn1g7YIUVbJOTW/CHhQ=,tag:KJhJPg8AStyW4roEbEUJ2g==,type:str] -example_key: ENC[AES256_GCM,data:DcLN+C1BQ6WZg5fRiA==,iv:JC3GTWn4a4RekAHdOQB3YV5+eGa4cUK1JjyTPe8eNHY=,tag:W9CV4rsgHuXyqpWpUxlIQg==,type:str] -#ENC[AES256_GCM,data:RjdYJNz6qGfbsU/AiBeLlQ==,iv:LjRzSjBXp44cGSqUUfRDNLC9cW4Vd7lfsqDWINt31VA=,tag:NzVm1h9CVKE2XXt300aR/g==,type:comment] -example_array: - - ENC[AES256_GCM,data:K9j/t8MDibYO8Frhu1M=,iv:YnrxRnJJwTH6DJC6Bv/d1NUnX2ZPFwsjoji7L1Z+d7s=,tag:Dm7xCUlnjKdXHCuk8lwY8w==,type:str] - - ENC[AES256_GCM,data:0g6ACJzEHBtukwQYYTY=,iv:xLBJWfOYkX7Y28N01CX2+d5QOr9VGAhInH6pa1hNSGE=,tag:tCkCigo4yhi6YKVMe3Z3lQ==,type:str] -example_number: ENC[AES256_GCM,data:R+/m/QVBH9/3DA==,iv:FumBUj97ICrRQmyh5fg8Gu9Lba9oITD1pdsr1I/PCf0=,tag:hguw1gpPI3w64fG1WLnJqA==,type:float] -example_booleans: - - ENC[AES256_GCM,data:VvI5ag==,iv:koMzyWcua75sK19vuk65oywCD61lMyH3xUwue8LTqy4=,tag:2ym1M0FTwevLm7wefTUWAw==,type:bool] - - ENC[AES256_GCM,data:lFEC/S8=,iv:cJWbnmseP/AqJzyORM+VI5y7rK8axVeh7EXoLP7mT/Q=,tag:BaS5HyecokdLCq+LzQxGkg==,type:bool] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1zrgu7w8059xydagm60phnffghvfe9h2ca58cx8qwagqpyfuvs9fqw79c8h - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBpSXhsMHQvb0NyUXRkRDE3 - TjVjb2orQktDMGs4U2JUS3hWdmtMdnhuYnhBCi9VU1RVblZPaW14VGxMcjM0N20z - R1pOdUJZc1ZGcjBsTnNaZGhleVR6L1kKLS0tIE5vQkFhVXd0R3ZQSzZkNmVqN1Vj - NERXdlJhVHF0NWpNT29CNlRid2NYMVUKxg7kbP6dOZDUz0uxdC45DZCAa6GQTQ1x - nIb7lvPW4xFIb0bOZuvc7cAbHjf4So+8zvA0MM4mkTmIDpnwGD5Clg== - -----END AGE ENCRYPTED FILE----- - - recipient: age1m4mqcd2kmuhfr8a22rvh02c68jkakhdfmuqgtusuv0czk4jvna7sz79p3y - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBrcTJGVmZUenNwYVNjRFlU - VXNBeDdpVFVtSTN5TG9VN0Q1WjRFbjlHd0Z3CjFsU1BsNkZ1a1ZkY2lva3lBUWZ3 - YUpqeEo0Tys1bDk0TEpwQTJ2U29kbjgKLS0tIFJDYWpNemY4NXZ0MkM0YWNldDBE - RU1HSUhldHpzeURaUWQvcjBCQ3pMY2cKYL87Njs4e68zu5AXKNF/hxiB3HduS8wz - o0kmGI58DZx17+Cdipw0ab9a9wiu9C9Fn+LaiCcdM/ESXtS79RzdbQ== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-03-05T22:27:18Z" - mac: ENC[AES256_GCM,data:WSopSnWZ+uOllywd7difaZtJcfxkL7eIf9Kr3GajZKO0+rP6pEHIS+5AbXZy6oKRlCLUPecY/WXFvk3//akpvvXHbf6Jp4fQ/YSuTcYKRQupbDBpOXSlc33QyRl6oEyiMOjxMxa2N2tmq8dmA0NbF9wSDMa5a4eNDoiL5T/sUZ8=,iv:QqbVRApzFF6q24rk8KfKuthj656nEczD9Si4INj+N9A=,tag:tMRNYo+u/jIQ6iX3KqKJdA==,type:str] - pgp: - - created_at: "2025-03-07T22:49:19Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hQEMAzy6JxafzLr5AQf/Zw+EB0lFpbul4KmHL3ndbhQCHzhkMgG6vEyj7EpjHQxE - nwf9kRrTcRh9YdrgR+5PFRnFJ8+L+gZhk+V/GaEPcEUyskOX/YGTSp1u6pXKGEem - TGojrIx0WwcmeCZUn+qCehbC7ZU64NDDmb7VeWnRkMbboU6UVooHUub88VsbnYw2 - XXtXh4G8isrbyAKzUyypnJnEVbKlVqPOL67BYczjyBqMYc1JVLmBy6nP+sv6q/yo - QyDzlunmZtu52dwAL0L6wJF+novLr4W9cso4K5UVv2sp5M8gucuiY2obiB3vNfgO - q9GZTlMWnyDGflM1w+tzpZ/Ke+sM4dSy3cXpZd+MFNJeAaBJ1owjolb4tPUXlt+W - cJ+SFLWxzH8MsPb+Hfxrt8PPCcv67uch/k50PLYs/V/EM59+mgEJe5LY4rMbUSFw - REGL3LA6Cnkl2bUeHlfG7XlztHd/ehmZM2RPKof+Qw== - =htZl - -----END PGP MESSAGE----- - fp: 0FECE8316E74BA6F44EFC21A2F8F21CE8721456B - unencrypted_suffix: _unencrypted - version: 3.9.4-unstable diff --git a/secrets/rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age b/secrets/rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age index 03118e3..a1015ad 100644 Binary files a/secrets/rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age and b/secrets/rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 6504054..368b837 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -2,6 +2,9 @@ let main_ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxR/w+38b2lX90yNBqhq3mUmkn1WGu6GAPhN1tVp2ZjYRJNV/+5gWCnTtOWYtDx35HmK/spQ2Qy8X9ttkzORa24fysNx1Iqn/TiXhD7eIJjbGPnrOpIKTkW5/uB3SD/P5NBSa06//BaqJU4sBlG79hoXRpod052hQtdpTVDiMCIV+iboWPKqopmJJfWdBtVnHXs9rep0htPRExxGslImFk7Z6xjcaHyCpIQZPlOGf+sGsmUU7jRqzvZFV8ucIdbnAlMHrU4pepNFhuraESyZVTa/bi9sw0iozXp5Q5+5thMebEslmT1Z771kI4sieDy+O4r8c0Sx2/VY1UAzcpq1faggc3YB01MTh+tiEC6xdMvZLrQGL1NBWjHleMyL53GU5ERluC0vXJF3Hv3BGGBDfXWbrEm5n06DHr2apRVJGC0LwiQ7Woud1X4V4X1pKSusxCVMjT2lmcOwV6YhKhB2sowJc1OdMx4+tL0UWE+YKSZgBHfolwk6ml0F4EO9nnUHc= lelgenio@i15"; in { + "rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age".publicKeys = [ + main_ssh_public_key + ]; "monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age".publicKeys = [ main_ssh_public_key ]; @@ -9,11 +12,9 @@ in "monolith-forgejo-runner-token.age".publicKeys = [ main_ssh_public_key ]; "lelgenio-cachix.age".publicKeys = [ main_ssh_public_key ]; "monolith-nix-serve-privkey.age".publicKeys = [ main_ssh_public_key ]; - "factorio-settings.age".publicKeys = [ main_ssh_public_key ]; "phantom-nextcloud.age".publicKeys = [ main_ssh_public_key ]; "phantom-writefreely.age".publicKeys = [ main_ssh_public_key ]; "phantom-renawiki.age".publicKeys = [ main_ssh_public_key ]; "phantom-forgejo-mailer-password.age".publicKeys = [ main_ssh_public_key ]; "phantom-mastodon-mailer-password.age".publicKeys = [ main_ssh_public_key ]; - "phantom-invidious-settings.age".publicKeys = [ main_ssh_public_key ]; } diff --git a/secrets/test.yaml b/secrets/test.yaml deleted file mode 100644 index 0f9b6e7..0000000 --- a/secrets/test.yaml +++ /dev/null @@ -1,55 +0,0 @@ -hello: ENC[AES256_GCM,data:ADXdQUkrnh9lDrsHyInYsPBo21u/mIAH47KhGQsxuz5OshT6CoK+89CILEi9tQ==,iv:b/rnM77z69+pVO3kxQZxI2YzTCRiBwwO5fhcwCB2/CI=,tag:A0FOXIfgIkJawV3QhlJPWQ==,type:str] -example_key: ENC[AES256_GCM,data:gXXl6hhdYNLC1Grmyw==,iv:miSL7Wdewd5zs4A86/r8OW6gK+PGZJ+gaqZRHHxvZos=,tag:Ty+IaoXdMSEThNPRjwhqTA==,type:str] -#ENC[AES256_GCM,data:FLhydTaiOqLRFk+ZrgGx9Q==,iv:TqhX2ylJKFQjdOpmwCER1+gRe4iR+I0hkVkNnYH4ESo=,tag:1BSk9TKqTma4MVUMswwmog==,type:comment] -example_array: - - ENC[AES256_GCM,data:1sIEL3xGDAygUKoodBA=,iv:1DumVv8vDvhT/K0jXM1vHdrFTE7dIxqqjS8CIpWdnc8=,tag:WSs+3a816zVOaGCTElxgFQ==,type:str] - - ENC[AES256_GCM,data:tFi1czQnVgX/nlWrJrs=,iv:isH65ldilVe3EjsKNP/dOKgtWZtHQPw364fPHBI+LEw=,tag:Ka5ywriFptKg3+lIHPEIyA==,type:str] -example_number: ENC[AES256_GCM,data:sxSM8a9oAp+u6g==,iv:KRLfIxZuBsnK+QE4mqm3pyhJmE7Fsd4ykJA++KrOnEQ=,tag:F5EkVUzw06ulr5jZvlTJdg==,type:float] -example_booleans: - - ENC[AES256_GCM,data:PDts2Q==,iv:qtfKg5gmUw2aERJe3gfT15Pk7mWocXwKdJhAzSic1o0=,tag:gn1sWsgt9ihYF8bHAkAQwQ==,type:bool] - - ENC[AES256_GCM,data:o9as7T0=,iv:YXyTB2X9PmTsOd37+BAp2xnT/+Yzyajcn5y1GE1O5rE=,tag:hyXA43jpyAbgH2hg1ivloQ==,type:bool] -sops: - shamir_threshold: 1 - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1zrgu7w8059xydagm60phnffghvfe9h2ca58cx8qwagqpyfuvs9fqw79c8h - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvUURIQmZvSVp3aXlFT0RR - VHVBR0drN2JyV1hNUk5sakxGRXl6SEJuOUUwClQ1Q1lRZTR5R3Z4dlZyb29OaTNW - UVcwV3h6UlhtZkg2aFhrUUtIT0tQRmsKLS0tIDlnckhHWXRKcmRwTGUzdHZxWEVh - a3ZSWk0wNm1raXdMYXdKY1hDd2dZWUEK+IFU/9vsHu70XbSJ7sKqFncrZO3NAH8/ - X/XF1VUmIuDfQZYJsDa4HaXe52xvDWTw3/4frG9HutEI2NcvvRpxlw== - -----END AGE ENCRYPTED FILE----- - - recipient: age1ecyynwv93lfu7crjjp8l47defv07quzfzaktwurpep7jc9eha5pscg7lrw - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNRGxFWXJVcDZOdzVxaFJG - LzdhN3JKaFhPOVBlblRPNWpDdERPaWhDNkM0CmcvUGxNQ09tNTJndWZTdjFia2pl - RnNWQ0ZKSFhEN0FNbVZlKzlFUlh5QTgKLS0tIFkwc1pJajlyOGNHSTdaM3FQZWFK - NUJpRDlLNXlGOTNBbVRTU0ZMVkhqdUUK1koXmGDGTKoNx1wp4c9EknY9LQ5a7dQP - Zx6OzvtpsxL6KGjH7BeNNcm2zOR4YqnklLq09UsPHElz2upJQzECAQ== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-03-07T22:49:01Z" - mac: ENC[AES256_GCM,data:yma+7wtzVjCzlLOVpqiicjQ9YN1ttzoh8CpcAtjdtVl6gu7/3FXUKYyAWJd+1NUUpK7vN435gOq9/nsig0FRrn0Hgq0+cjFUGS6+6+SPmL97eFvti89gCOeIFhPvBnJQYJLiyVkUcBek4xW+vnt6UgrTy+sD9AT3KHdBlfu3pzY=,iv:ioswFO5KDAL3Bv7MI8V0aWXXxZZIz1M1PyMUbIMnCRI=,tag:5fUBtqz9J2qvY4fUT2ueoQ==,type:str] - pgp: - - created_at: "2025-03-07T22:49:20Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hQEMAzy6JxafzLr5AQf/Xok7aBMNT6W3LV2Ekx/ccxEZaZ0aVNKHE9aFTz5kBSpu - cXVohu5mEgeXr++HbrsCI821/gfchQ1yzVSLJsSrmZdJ586c3a7pWx2Eo4pcngmy - vb5UWtTBNogABnLz4iTjVQYLjZeNcNhkzW6s3m9PiaX3AvJP9irPcmwIyYpzd9pt - hngnBsdTis52fmvZ6+wOuMyTZU0Iksknom1De8xqgR5ZuO0Vitt19RGbpVhx96AC - t1CUkb5WMFTdpbCFORa/ta9Z7UcKxXTAPsfPkPVG9DnHQ1jSmsJWPDQZxoIJLHuH - SVV+qfRGndOo9fjExCInX6I5wBlrHrdpGtL7VLczV9JeAXYlMJwH63eOyi8hxxtr - KfTJEIALC25uFhoK8bmr30yVZe7thUPMXfht+R5dlHne7+FcBb4k7YLpeN/M40me - CSKk+9YaG7gQIdrfvEXlHSPCPppcKev6ZUspHewhmQ== - =IMON - -----END PGP MESSAGE----- - fp: 0FECE8316E74BA6F44EFC21A2F8F21CE8721456B - unencrypted_suffix: _unencrypted - version: 3.9.4 diff --git a/settings/default.nix b/settings/default.nix index 1cf90df..2a2ca08 100644 --- a/settings/default.nix +++ b/settings/default.nix @@ -1,18 +1,6 @@ { lib, ... }: { options = { - my = { - themes = lib.mkOption { }; - key = lib.mkOption { }; - theme = lib.mkOption { }; - accent = lib.mkOption { }; - font = lib.mkOption { }; - username = lib.mkOption { type = lib.types.str; }; - mail = lib.mkOption { }; - dmenu = lib.mkOption { type = lib.types.str; }; - desktop = lib.mkOption { type = lib.types.str; }; - browser = lib.mkOption { type = lib.types.str; }; - editor = lib.mkOption { type = lib.types.str; }; - }; + my = lib.mkOption { }; }; } diff --git a/switch b/switch index d341e87..65782ae 100755 --- a/switch +++ b/switch @@ -1,25 +1,13 @@ #!/usr/bin/env bash -set -euo pipefail - nix fmt git --no-pager diff -run() { +sudo nice ionice \ nixos-rebuild \ - switch \ - --use-remote-sudo \ - --print-build-logs \ - --flake .# \ - "$@" -} - -if which nom >/dev/null; then - run --verbose \ - --log-format internal-json \ - "$@" \ - |& nom --json -else - run "$@" -fi + switch \ + --verbose \ + --print-build-logs \ + --flake .# \ + $@ diff --git a/system/android.nix b/system/android.nix deleted file mode 100644 index 3cce4af..0000000 --- a/system/android.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - options.my.android.enable = lib.mkEnableOption { }; - - config = lib.mkIf config.my.android.enable { - # Open kde connect ports - programs.kdeconnect.enable = true; - - programs.adb.enable = true; - services.udev.packages = [ pkgs.android-udev-rules ]; - }; -} diff --git a/system/bluetooth.nix b/system/bluetooth.nix index a5d00c0..1bcea1f 100644 --- a/system/bluetooth.nix +++ b/system/bluetooth.nix @@ -6,7 +6,7 @@ settings = { General = { DiscoverableTimeout = 0; - Discoverable = true; + # Discoverable = true; AlwaysPairable = true; }; Policy = { diff --git a/system/boot.nix b/system/boot.nix index 3e0151d..fa1ed8d 100644 --- a/system/boot.nix +++ b/system/boot.nix @@ -2,6 +2,7 @@ config, pkgs, lib, + inputs, ... }: { diff --git a/system/cachix.nix b/system/cachix.nix new file mode 100644 index 0000000..7ff9b29 --- /dev/null +++ b/system/cachix.nix @@ -0,0 +1,18 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + services.cachix-watch-store = { + enable = true; + cacheName = "lelgenio"; + cachixTokenFile = config.age.secrets.lelgenio-cachix.path; + }; + systemd.services.cachix-watch-store-agent = { + serviceConfig.TimeoutStopSec = 3; + # If we don't do this, cachix tends to timeout + serviceConfig.KillMode = lib.mkForce "control-group"; + }; +} diff --git a/system/configuration.nix b/system/configuration.nix index 2380d22..6661e40 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -1,11 +1,16 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ pkgs, config, ... }: +{ + config, + pkgs, + inputs, + ... +}: { imports = [ - ./android.nix - ./gaming.nix + ./gamemode.nix + ./cachix.nix ./media-packages.nix ./boot.nix ./thunar.nix @@ -13,32 +18,31 @@ ./fonts.nix ./sound.nix ./bluetooth.nix - ./mouse.nix ./locale.nix ./users.nix ./containers.nix - ./nix-ld.nix ./network.nix ../settings ]; - my = import ../user/variables.nix // { - android.enable = true; - media-packages.enable = true; - containers.enable = true; - }; + my = import ../user/variables.nix; zramSwap.enable = true; + programs.adb.enable = true; + services.udev.packages = [ pkgs.android-udev-rules ]; + # Enable touchpad support (enabled default in most desktopManager). services.libinput.enable = true; + packages.media-packages.enable = true; environment.systemPackages = with pkgs; [ pavucontrol glib # gsettings usbutils - adwaita-icon-theme # default gnome cursors + # dracula-theme # gtk theme + gnome3.adwaita-icon-theme # default gnome cursors ]; services.geoclue2.enable = true; diff --git a/system/containers.nix b/system/containers.nix index ddd3e38..19698e5 100644 --- a/system/containers.nix +++ b/system/containers.nix @@ -1,40 +1,20 @@ +{ pkgs, ... }: { - pkgs, - lib, - config, - ... -}: -{ - options.my.containers.enable = lib.mkEnableOption { }; + services.flatpak.enable = true; - config = lib.mkIf config.my.containers.enable { - services.flatpak.enable = true; - programs.appimage.enable = true; - - virtualisation.docker = { + virtualisation.docker = { + enable = true; + autoPrune = { enable = true; - autoPrune = { - enable = true; - dates = "monthly"; - flags = [ - "--all" - "--volumes" - ]; - }; - daemon.settings = { - # needed by bitbucket runner ??? - log-driver = "json-file"; - log-opts = { - max-size = "10m"; - max-file = "3"; - }; - }; + dates = "monthly"; + flags = [ + "--all" + "--volumes" + ]; }; - - networking.firewall.extraCommands = lib.getExe pkgs._docker-block-external-connections; - - programs.extra-container.enable = true; - - programs.firejail.enable = true; }; + + programs.extra-container.enable = true; + + programs.firejail.enable = true; } diff --git a/system/fonts.nix b/system/fonts.nix index 73aa8f7..d8bff5a 100644 --- a/system/fonts.nix +++ b/system/fonts.nix @@ -3,9 +3,8 @@ fonts.enableDefaultPackages = true; fonts.packages = with pkgs; [ noto-fonts - noto-fonts-cjk-sans + noto-fonts-cjk noto-fonts-emoji - nerd-fonts.fira-code - nerd-fonts.hack + nerdfonts_fira_hack ]; } diff --git a/system/gamemode.nix b/system/gamemode.nix new file mode 100644 index 0000000..92207cd --- /dev/null +++ b/system/gamemode.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + programs.gamemode.enable = true; + programs.gamemode.enableRenice = true; + programs.gamemode.settings = { + general = { + renice = 10; + }; + + # Warning: GPU optimisations have the potential to damage hardware + gpu = { + apply_gpu_optimisations = "accept-responsibility"; + gpu_device = 0; + amd_performance_level = "high"; + }; + + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; + }; + }; +} diff --git a/system/gaming.nix b/system/gaming.nix deleted file mode 100644 index e79353e..0000000 --- a/system/gaming.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - config, - pkgs, - lib, - inputs, - ... -}: -{ - options.my.gaming.enable = lib.mkEnableOption { }; - - config = lib.mkIf config.my.gaming.enable { - programs.steam.enable = true; - programs.steam.extraPackages = - config.fonts.packages - ++ (with pkgs; [ - capitaine-cursors - bibata-cursors - mangohud - xdg-user-dirs - gamescope - - # gamescope compatibility?? - xorg.libXcursor - xorg.libXi - xorg.libXinerama - xorg.libXScrnSaver - libpng - libpulseaudio - libvorbis - stdenv.cc.cc.lib - libkrb5 - keyutils - ]); - - environment.systemPackages = with pkgs; [ - protontricks - bottles - inputs.dzgui-nix.packages.${pkgs.system}.default - ]; - - programs.gamemode = { - enable = true; - enableRenice = true; - settings = { - general = { - renice = 10; - }; - - # Warning: GPU optimisations have the potential to damage hardware - gpu = { - apply_gpu_optimisations = "accept-responsibility"; - gpu_device = 0; - amd_performance_level = "high"; - }; - - custom = { - start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; - end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; - }; - }; - }; - - programs.corectrl = { - enable = true; - gpuOverclock = { - enable = true; - ppfeaturemask = "0xffffffff"; - }; - }; - }; -} diff --git a/system/gitlab-runner.nix b/system/gitlab-runner.nix index 8db526f..335bc5a 100644 --- a/system/gitlab-runner.nix +++ b/system/gitlab-runner.nix @@ -1,55 +1,52 @@ { pkgs, lib, ... }: -let - installNixScript = pkgs.writeScriptBin "install-nix" '' - mkdir -p -m 0755 /nix/var/log/nix/drvs - mkdir -p -m 0755 /nix/var/nix/gcroots - mkdir -p -m 0755 /nix/var/nix/profiles - mkdir -p -m 0755 /nix/var/nix/temproots - mkdir -p -m 0755 /nix/var/nix/userpool - mkdir -p -m 1777 /nix/var/nix/gcroots/per-user - mkdir -p -m 1777 /nix/var/nix/profiles/per-user - mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root - mkdir -p -m 0700 "$HOME/.nix-defexpr" - - . ${pkgs.nix}/etc/profile.d/nix.sh - - ${pkgs.nix}/bin/nix-env -i ${ - lib.concatStringsSep " " ( - with pkgs; - [ - nix - cacert - git - openssh - docker - ] - ) - } - ''; -in { - mkNixRunner = authenticationTokenConfigFile: { - # File should contain at least these two variables: - # `CI_SERVER_URL` - # `REGISTRATION_TOKEN` - inherit authenticationTokenConfigFile; # 2 - dockerImage = "alpine:3.18.2"; - dockerVolumes = [ - "/etc/nix/nix.conf:/etc/nix/nix.conf:ro" - "/nix/store:/nix/store:ro" - "/nix/var/nix/db:/nix/var/nix/db:ro" - "/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro" - "/tmp:/tmp" - "/var/run/docker.sock:/var/run/docker.sock" - "/var/lib/docker/containers:/var/lib/docker/containers" - ]; - dockerDisableCache = true; - preBuildScript = "\". ${lib.getExe installNixScript}\""; - environmentVariables = { - ENV = "/etc/profile"; - USER = "root"; - NIX_REMOTE = "daemon"; - NIX_SSL_CERT_FILE = "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"; + mkNixRunner = + registrationConfigFile: with lib; rec { + # File should contain at least these two variables: + # `CI_SERVER_URL` + # `REGISTRATION_TOKEN` + inherit registrationConfigFile; # 2 + dockerImage = "alpine:3.18.2"; + dockerAllowedImages = [ dockerImage ]; + dockerVolumes = [ + "/etc/nix/nix.conf:/etc/nix/nix.conf:ro" + "/nix/store:/nix/store:ro" + "/nix/var/nix/db:/nix/var/nix/db:ro" + "/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro" + ]; + dockerDisableCache = true; + preBuildScript = pkgs.writeScript "setup-container" '' + mkdir -p -m 0755 /nix/var/log/nix/drvs + mkdir -p -m 0755 /nix/var/nix/gcroots + mkdir -p -m 0755 /nix/var/nix/profiles + mkdir -p -m 0755 /nix/var/nix/temproots + mkdir -p -m 0755 /nix/var/nix/userpool + mkdir -p -m 1777 /nix/var/nix/gcroots/per-user + mkdir -p -m 1777 /nix/var/nix/profiles/per-user + mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root + mkdir -p -m 0700 "$HOME/.nix-defexpr" + + . ${pkgs.nix}/etc/profile.d/nix.sh + + ${pkgs.nix}/bin/nix-env -i ${ + concatStringsSep " " ( + with pkgs; + [ + nix + cacert + git + openssh + ] + ) + } + ''; + environmentVariables = { + ENV = "/etc/profile"; + USER = "root"; + NIX_REMOTE = "daemon"; + PATH = "/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin"; + NIX_SSL_CERT_FILE = "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"; + }; + tagList = [ "nix" ]; }; - }; } diff --git a/system/locale.nix b/system/locale.nix index e2c7e81..07e7175 100644 --- a/system/locale.nix +++ b/system/locale.nix @@ -2,7 +2,7 @@ { time.timeZone = "America/Sao_Paulo"; environment.variables.TZ = config.time.timeZone; - i18n.defaultLocale = "pt_BR.UTF-8"; + i18n.defaultLocale = "pt_BR.utf8"; # Configure keymap in X11 services.xserver.xkb = { diff --git a/system/media-packages.nix b/system/media-packages.nix index dec98a2..818b78b 100644 --- a/system/media-packages.nix +++ b/system/media-packages.nix @@ -5,10 +5,10 @@ ... }: let - cfg = config.my.media-packages; + cfg = config.packages.media-packages; in { - options.my.media-packages = { + options.packages.media-packages = { enable = lib.mkEnableOption "media packages"; }; config = lib.mkIf cfg.enable { @@ -23,7 +23,6 @@ in gimp inkscape krita - kdePackages.breeze kdePackages.kdenlive pitivi blender-hip diff --git a/system/monolith-gitlab-runner.nix b/system/monolith-gitlab-runner.nix index 6f1f7b3..8e419d1 100644 --- a/system/monolith-gitlab-runner.nix +++ b/system/monolith-gitlab-runner.nix @@ -1,6 +1,7 @@ { config, pkgs, + lib, ... }: let @@ -11,38 +12,25 @@ in virtualisation.docker.enable = true; services.gitlab-runner = { enable = true; - settings.concurrent = 12; + settings.concurrent = 4; services = { + # ci_test = { + # registrationConfigFile = "/srv/gitlab-runner/env/ci_test"; + # dockerImage = "debian"; + # dockerPrivileged = true; + # }; + thoreb_builder = { + registrationConfigFile = + config.age.secrets.monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.path; + dockerImage = "debian"; + dockerPrivileged = true; + }; + # runner for building in docker via host's nix-daemon # nix store will be readable in runner, might be insecure - thoreb-telemetria-nix = mkNixRunner config.sops.secrets."gitlab-runners/thoreb-telemetria-nix".path; - thoreb-itinerario-nix = mkNixRunner config.sops.secrets."gitlab-runners/thoreb-itinerario-nix".path; - - wopus-gitlab-nix = mkNixRunner config.sops.secrets."gitlab-runners/wopus-gitlab-nix".path; - - default = { - # File should contain at least these two variables: - # `CI_SERVER_URL` - # `CI_SERVER_TOKEN` - authenticationTokenConfigFile = config.sops.secrets."gitlab-runners/docker-images-token".path; - dockerImage = "debian:stable"; - }; + thoreb-telemetria-nix = mkNixRunner config.age.secrets.gitlab-runner-thoreb-telemetria-registrationConfigFile.path; + thoreb-itinerario-nix = mkNixRunner config.age.secrets.monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.path; }; }; systemd.services.gitlab-runner.serviceConfig.Nice = 10; - - sops.secrets = { - "gitlab-runners/thoreb-telemetria-nix" = { - sopsFile = ../secrets/monolith/default.yaml; - }; - "gitlab-runners/thoreb-itinerario-nix" = { - sopsFile = ../secrets/monolith/default.yaml; - }; - "gitlab-runners/docker-images-token" = { - sopsFile = ../secrets/monolith/default.yaml; - }; - "gitlab-runners/wopus-gitlab-nix" = { - sopsFile = ../secrets/monolith/default.yaml; - }; - }; } diff --git a/system/mouse.nix b/system/mouse.nix deleted file mode 100644 index b5d5b16..0000000 --- a/system/mouse.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - # Allow configuring Logitech Peripherals - services.ratbagd.enable = true; - - # Sway does not undersand high resolution scroll wheels - # I don't need this, so I disable it - environment.etc."libinput/local-overrides.quirks".text = '' - [Logitech G502 X PLUS] - MatchUdevType=mouse - MatchBus=usb - MatchVendor=0x046D - MatchProduct=0x4099 - AttrEventCode=-REL_WHEEL_HI_RES - ''; -} diff --git a/system/network.nix b/system/network.nix index e280ff5..aee7518 100644 --- a/system/network.nix +++ b/system/network.nix @@ -6,14 +6,11 @@ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Enable networking networking.networkmanager.enable = true; - - networking.firewall = { - enable = true; - logRefusedConnections = false; - }; + # Open kde connect ports + programs.kdeconnect.enable = true; # Enable CUPS to print documents. - services.printing.enable = true; + # services.printing.enable = true; security.rtkit.enable = true; services.openssh = { @@ -25,13 +22,4 @@ KbdInteractiveAuthentication = false; }; }; - - # Workaround for nm-wait-online hanging?? - # Ref: https://github.com/NixOS/nixpkgs/issues/180175 - systemd.services.NetworkManager-wait-online = { - serviceConfig.ExecStart = [ - "" - "${pkgs.networkmanager}/bin/nm-online -q" - ]; - }; } diff --git a/system/nix-ld.nix b/system/nix-ld.nix deleted file mode 100644 index 33afa69..0000000 --- a/system/nix-ld.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -{ - options.my.nix-ld.enable = lib.mkEnableOption { }; - - config = lib.mkIf (config.my.nix-ld.enable) { - programs.nix-ld = { - enable = true; - libraries = - with pkgs; - # run appimages + linux games natively - [ fuse ] - ++ (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) - ++ (appimageTools.defaultFhsEnvArgs.targetPkgs pkgs); - }; - }; -} diff --git a/system/nix.nix b/system/nix.nix index 482bb93..c91e362 100644 --- a/system/nix.nix +++ b/system/nix.nix @@ -44,7 +44,7 @@ in ]; }; extraOptions = '' - experimental-features = nix-command flakes + experimental-features = nix-command flakes repl-flake ''; }; } diff --git a/system/rainbow-gitlab-runner.nix b/system/rainbow-gitlab-runner.nix new file mode 100644 index 0000000..aa177de --- /dev/null +++ b/system/rainbow-gitlab-runner.nix @@ -0,0 +1,34 @@ +{ + config, + pkgs, + lib, + ... +}: +let + inherit (pkgs.callPackage ./gitlab-runner.nix { }) mkNixRunner; +in +{ + boot.kernel.sysctl."net.ipv4.ip_forward" = true; + virtualisation.docker.enable = true; + services.gitlab-runner = { + enable = true; + settings.concurrent = 1; + services = { + # ci_test = { + # registrationConfigFile = "/srv/gitlab-runner/env/ci_test"; + # dockerImage = "debian"; + # dockerPrivileged = true; + # }; + thoreb_builder = { + registrationConfigFile = + config.age.secrets.rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.path; + dockerImage = "debian"; + dockerPrivileged = true; + }; + + thoreb-telemetria-nix = mkNixRunner config.age.secrets.gitlab-runner-thoreb-telemetria-registrationConfigFile.path; + thoreb-itinerario-nix = mkNixRunner config.age.secrets.rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.path; + }; + }; + systemd.services.gitlab-runner.serviceConfig.Nice = 10; +} diff --git a/system/secrets.nix b/system/secrets.nix index 588dfe4..ca11fb4 100644 --- a/system/secrets.nix +++ b/system/secrets.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { age = { identityPaths = [ "/root/.ssh/id_rsa" ]; @@ -6,6 +6,7 @@ secrets.monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.file = ../secrets/monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age; secrets.gitlab-runner-thoreb-telemetria-registrationConfigFile.file = ../secrets/gitlab-runner-thoreb-telemetria-registrationConfigFile.age; secrets.monolith-forgejo-runner-token.file = ../secrets/monolith-forgejo-runner-token.age; + secrets.rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.file = ../secrets/rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age; secrets.monolith-nix-serve-privkey.file = ../secrets/monolith-nix-serve-privkey.age; secrets.phantom-forgejo-mailer-password.file = ../secrets/phantom-forgejo-mailer-password.age; }; diff --git a/system/sops.nix b/system/sops.nix deleted file mode 100644 index d868153..0000000 --- a/system/sops.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - sops - gnupg - ]; - - sops = { - defaultSopsFile = ../secrets/test.yaml; - age.sshKeyPaths = [ - "/etc/ssh/ssh_host_ed25519_key" - "/home/lelgenio/.ssh/id_ed25519" - ]; - }; -} diff --git a/system/sound.nix b/system/sound.nix index 40dd701..8ef55ab 100644 --- a/system/sound.nix +++ b/system/sound.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { - services.pulseaudio.enable = false; + sound.enable = true; + hardware.pulseaudio.enable = false; services.pipewire = { enable = true; wireplumber.enable = true; diff --git a/system/steam.nix b/system/steam.nix new file mode 100644 index 0000000..ddc33c8 --- /dev/null +++ b/system/steam.nix @@ -0,0 +1,33 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + programs.steam.enable = true; + programs.steam.package = pkgs.steam.override { + extraLibraries = + pkgs: + with config.hardware.opengl; + if pkgs.hostPlatform.is64bit then + [ package ] ++ extraPackages + else + [ package32 ] ++ extraPackages32; + + extraPkgs = + pkgs: with pkgs; [ + capitaine-cursors + bibata-cursors + mangohud + xdg-user-dirs + ]; + }; + environment.systemPackages = with pkgs; [ + protontricks + bottles + ]; + + programs.dzgui.enable = true; + programs.dzgui.package = inputs.dzgui-nix.packages.${pkgs.system}.default; +} diff --git a/treefmt.nix b/treefmt.nix deleted file mode 100644 index 6c86ca2..0000000 --- a/treefmt.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - projectRootFile = "flake.nix"; - programs.nixfmt.enable = true; - programs.nixfmt.package = pkgs.nixfmt-rfc-style; - - settings.on-unmatched = "debug"; -} diff --git a/user/alacritty.nix b/user/alacritty.nix index eaaa414..91b98c0 100644 --- a/user/alacritty.nix +++ b/user/alacritty.nix @@ -116,12 +116,6 @@ in mode = "Vi|~Search"; action = "SearchNext"; } - { - key = lib.toUpper key.next; - mods = "Shift"; - mode = "Vi|~Search"; - action = "SearchPrevious"; - } { key = "Up"; mods = "Control|Shift"; diff --git a/user/chat.nix b/user/chat.nix index b42f6fd..a68055f 100644 --- a/user/chat.nix +++ b/user/chat.nix @@ -9,15 +9,15 @@ wayland.windowManager.sway = { extraConfig = '' exec thunderbird - exec discordcanary + exec vesktop exec telegram-desktop ''; }; home.packages = with pkgs; [ tdesktop - discord-canary + vesktop thunderbird - element-desktop + element-desktop-wayland ]; } diff --git a/user/controller.nix b/user/controller.nix new file mode 100644 index 0000000..fe08a98 --- /dev/null +++ b/user/controller.nix @@ -0,0 +1,26 @@ +{ pkgs, lib, ... }: +{ + systemd.user.services = { + autoconnect-gamepad = { + Unit = { + Description = "Attempt to connect to game controllers"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = lib.getExe pkgs.auto_connect_gamepad; + }; + Install = { + WantedBy = [ "sway-session.target" ]; + }; + }; + }; + + xdg.desktopEntries = { + disconnect-controller = { + name = "Disconnect Controller"; + exec = "bluetoothctl disconnect 84:30:95:97:1A:79"; + terminal = false; + }; + }; +} diff --git a/user/dummy.nix b/user/dummy.nix deleted file mode 100644 index 91e66cc..0000000 --- a/user/dummy.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib, ... }: -{ - options.my = { - nix-ld.enable = lib.mkEnableOption { }; - android.enable = lib.mkEnableOption { }; - media-packages.enable = lib.mkEnableOption { }; - containers.enable = lib.mkEnableOption { }; - }; -} diff --git a/user/firefox.nix b/user/firefox.nix index d15e569..8518c3f 100644 --- a/user/firefox.nix +++ b/user/firefox.nix @@ -1,12 +1,13 @@ { config, pkgs, + lib, + font, ... }: let - inherit (config.my.theme) color; - - bugfixedFirefox = pkgs.firefox-devedition-unwrapped // { + inherit (config.my) desktop browser; + bugfixedFirefox = pkgs.firefox-esr-unwrapped // { requireSigning = false; allowAddonSideload = true; }; @@ -27,15 +28,15 @@ in url = "https://addons.mozilla.org/firefox/downloads/file/4202411/sponsorblock-5.4.29.xpi"; hash = "sha256-7Xqc8cyQNylMe5/dgDOx1f2QDVmz3JshDlTueu6AcSg="; }) - # (pkgs.fetchFirefoxAddon { - # name = "tree-style-tab"; - # url = "https://addons.mozilla.org/firefox/downloads/file/4197314/tree_style_tab-3.9.19.xpi"; - # hash = "sha256-u2f0elVPj5N/QXa+5hRJResPJAYwuT9z0s/0nwmFtVo="; - # }) + (pkgs.fetchFirefoxAddon { + name = "tree-style-tab"; + url = "https://addons.mozilla.org/firefox/downloads/file/4197314/tree_style_tab-3.9.19.xpi"; + hash = "sha256-u2f0elVPj5N/QXa+5hRJResPJAYwuT9z0s/0nwmFtVo="; + }) (pkgs.fetchFirefoxAddon { name = "ublock-origin"; - url = "https://addons.mozilla.org/firefox/downloads/file/4492375/ublock_origin-1.64.0.xpi"; - hash = "sha256-ueHIaL0awd78q/LgF3bRqQ7/ujSwf+aiE1DUXwIuDp8="; + url = "https://addons.mozilla.org/firefox/downloads/file/4198829/ublock_origin-1.54.0.xpi"; + hash = "sha256-l5cWCQgZFxD/CFhTa6bcKeytmSPDCyrW0+XjcddZ5E0="; }) (pkgs.fetchFirefoxAddon { name = "user_agent_string_switcher"; @@ -56,15 +57,20 @@ in }) (pkgs.fetchFirefoxAddon { name = "unhook"; - url = "https://addons.mozilla.org/firefox/downloads/file/4263531/youtube_recommended_videos-1.6.7.xpi"; - hash = "sha256-u21ouN9IyOzkTkFSeDz+QBp9psJ1F2Nmsvqp6nh0DRU="; + url = "https://addons.mozilla.org/firefox/downloads/file/4050795/youtube_recommended_videos-1.6.2.xpi"; + hash = "sha256-xMuglNassZb9WqjfEGg6WeuhMACRuYqQor+iX1dEdsE="; + }) + (pkgs.fetchFirefoxAddon { + name = "return_youtube_dislikes"; + url = "https://addons.mozilla.org/firefox/downloads/file/4208483/return_youtube_dislikes-3.0.0.14.xpi"; + hash = "sha256-oxqyNUmEa36rkqCU6S34NJBHtIu9gH8GnRKAg8Oyf2E="; }) - # (pkgs.fetchFirefoxAddon { - # name = "invidious_redirect"; - # url = "https://addons.mozilla.org/firefox/downloads/file/4292924/invidious_redirect_2-1.16.xpi"; - # hash = "sha256-ApCc+MNmW9Wd/5seV6npePQVEaszT/rhD9EB7HGiUb8="; - # }) + (pkgs.fetchFirefoxAddon { + name = "mastodon_simplified_federation"; + url = "https://addons.mozilla.org/firefox/downloads/file/4215691/mastodon_simplified_federation-2.2.xpi"; + hash = "sha256-4iU25chpjsdsMTPaa0yQOTWc9V9q1qFz6YV0lYtNjLA="; + }) (pkgs.fetchFirefoxAddon { name = "substitoot"; url = "https://addons.mozilla.org/firefox/downloads/file/4236602/substitoot-0.7.2.0.xpi"; @@ -85,17 +91,16 @@ in ]; }; profiles = { - dev-edition-default = { + main = { isDefault = true; search.force = true; - search.default = "ddg"; + search.default = "DuckDuckGo"; settings = { "devtools.theme" = "auto"; "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.tabs.inTitlebar" = if desktop == "sway" then 0 else 1; "sidebar.position_start" = false; # Move sidebar to the right - "browser.tabs.groups.enabled" = true; - # enable media RDD to allow gpu acceleration "media.rdd-ffmpeg.enabled" = true; "media.rdd-ffvpx.enabled" = true; @@ -107,11 +112,13 @@ in "media.rdd-vpx.enabled" = true; "media.rdd-wav.enabled" = true; - "media.av1.enabled" = true; + "media.av1.enabled" = false; "media.ffmpeg.vaapi-drm-display.enabled" = true; "media.ffmpeg.vaapi.enabled" = true; "media.ffvpx.enabled" = true; + "gfx.webrender.all" = true; + # Enable installing non signed extensions "extensions.langpacks.signatures.required" = false; "xpinstall.signatures.required" = false; @@ -122,22 +129,21 @@ in "devtools.chrome.enabled" = true; "devtools.debugger.remote-enabled" = true; }; - userChrome = '' - #sidebar-main { - background-color: ${color.bg}; - } - - #tabbrowser-tabbox { - outline-width: 0 !important; - } + userChrome = lib.mkIf (desktop == "sway") '' + #titlebar { display: none !important; } + #sidebar-header { display: none !important; } ''; }; }; }; wayland.windowManager.sway = { extraConfig = '' - exec firefox-devedition + exec firefox ''; }; + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + MOZ_DISABLE_RDD_SANDBOX = "1"; + }; }; } diff --git a/user/fish/default.nix b/user/fish/default.nix index 830d716..4d4fccf 100644 --- a/user/fish/default.nix +++ b/user/fish/default.nix @@ -6,12 +6,9 @@ }: let inherit (config.my) accent editor desktop; - cfg = config.my.fish; in { - options.my.fish.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { + config = { programs.fish = { enable = true; shellInit = '' @@ -39,6 +36,7 @@ in shellAliases = { rm = "trash"; tree = "eza -T"; + kys = "shutdown now"; }; shellAbbrs = { off = "shutdown now"; @@ -53,7 +51,7 @@ in c = "cargo"; # system sv = "sudo systemct"; - suv = "systemct --user"; + suv = "sudo systemct --user"; # docker abbrs d = "docker"; dc = "docker-compose"; diff --git a/user/fish/fish_prompt.fish b/user/fish/fish_prompt.fish index ec7774e..2cba6be 100644 --- a/user/fish/fish_prompt.fish +++ b/user/fish/fish_prompt.fish @@ -51,7 +51,6 @@ end function _fish_prompt_git_unpushed_branches timeout 5s git log \ --branches \ - --decorate-refs-exclude=refs/tags \ --simplify-by-decoration \ --not \ --remotes \ @@ -104,29 +103,29 @@ function fish_git_prompt _fish_prompt_warn "init" end - # if we have at least one commit - if git rev-parse HEAD -- &>/dev/null - # print a "↑" if ahead of origin - test 0 -ne (git log --oneline "$git_remote_branch"..HEAD -- | wc -l) - and set -f _git_sync_ahead '↑' + git rev-parse HEAD -- &>/dev/null + or return - # print a "↓" if behind of origin - test 0 -lt (git log --oneline HEAD.."$git_remote_branch" -- | wc -l) - and set -l _git_sync_behind '↓' + # print a "↑" if ahead of origin + test 0 -ne (git log --oneline "$git_remote_branch"..HEAD -- | wc -l) + and set -f _git_sync_ahead '↑' - if set -q _git_sync_ahead _git_sync_behind - _fish_prompt_normal '⇅' - else if set -q _git_sync_ahead - _fish_prompt_normal '↑' - else if set -q _git_sync_behind - _fish_prompt_normal '↓' - end + # print a "↓" if behind of origin + test 0 -lt (git log --oneline HEAD.."$git_remote_branch" -- | wc -l) + and set -l _git_sync_behind '↓' - if test -n "$git_log_unpushed" - and not string match -qr "$git_branch" "$git_log_unpushed" - _fish_prompt_normal '↻' - _fish_prompt_warn $git_log_unpushed[1] - end + if set -q _git_sync_ahead _git_sync_behind + _fish_prompt_normal '⇅' + else if set -q _git_sync_ahead + _fish_prompt_normal '↑' + else if set -q _git_sync_behind + _fish_prompt_normal '↓' + end + + if test -n "$git_log_unpushed" + and not string match -qr "$git_branch" "$git_log_unpushed" + _fish_prompt_normal '↻' + _fish_prompt_warn $git_log_unpushed[1] end ############################################################ diff --git a/user/fzf.nix b/user/fzf.nix index 468cae5..df16adb 100644 --- a/user/fzf.nix +++ b/user/fzf.nix @@ -2,10 +2,16 @@ config, pkgs, lib, + inputs, ... }: let - inherit (config.my) theme accent; + inherit (config.my) + key + theme + accent + font + ; inherit (theme) color; colors = { diff --git a/user/gaming.nix b/user/gaming.nix deleted file mode 100644 index 3e89361..0000000 --- a/user/gaming.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - cfg = config.my.gaming; -in -{ - options.my.gaming.enable = lib.mkEnableOption { }; - config = lib.mkIf cfg.enable { - my.mangohud.enable = true; - - home.packages = with pkgs; [ - # lutris-unwrapped - # steam # It's enabled in the system config - tlauncher - gamescope - glxinfo - vulkan-tools - ]; - }; -} diff --git a/user/git.nix b/user/git.nix index d411d35..94532f3 100644 --- a/user/git.nix +++ b/user/git.nix @@ -16,46 +16,17 @@ in user = { name = username; email = mail.personal.user; - signingkey = "2F8F21CE8721456B"; }; init.defaultBranch = "main"; - core = { - fsmonitor = true; - untrackedCache = true; - }; - commit = { - verbose = true; - gpgsign = true; - }; - fetch = { - prune = true; - pruneTags = true; - all = true; - }; - push = { - autoSetupRemote = true; - default = "simple"; - followTags = true; - }; + commit.verbose = true; + push.autoSetupRemote = true; pull.rebase = true; - tag.sort = "version:refname"; - merge.conflictStyle = "zdiff3"; - rerere = { - enabled = true; - autoupdate = true; - }; - branch.sort = "-committerdate"; - diff = { - algorithm = "histogram"; - colorMoved = "plain"; - mnemonicPrefix = true; - renames = true; - }; + merge.conflictStyle = "diff3"; + rerere.enabled = true; rebase = { abbreviateCommands = true; autoSquash = true; autoStash = true; - updateRefs = true; }; pager = { log = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager"; @@ -65,16 +36,8 @@ in alias = { graph = "log --graph --oneline --branches"; root = "rev-parse --show-toplevel"; - clean-deleted-remotes = "!" + (lib.getExe pkgs.git_clean_remote_deleted); }; }; }; - - home.packages = with pkgs; [ - git_clean_remote_deleted - - gh - glab - ]; }; } diff --git a/user/gnome.nix b/user/gnome.nix index 9a3562b..4924158 100644 --- a/user/gnome.nix +++ b/user/gnome.nix @@ -10,7 +10,7 @@ lib.mkIf (config.my.desktop == "gnome") { home.pointerCursor = { name = "Adwaita"; size = 24; - package = pkgs.adwaita-icon-theme; + package = pkgs.gnome.adwaita-icon-theme; gtk.enable = true; }; @@ -28,14 +28,16 @@ lib.mkIf (config.my.desktop == "gnome") { }; home.packages = with pkgs; [ + inputs.nixos-conf-editor.packages.${pkgs.system}.nixos-conf-editor + inputs.nix-software-center.packages.${pkgs.system}.nix-software-center + adw-gtk3 newsflash foliate amberol pitivi - keepassxc - menulibre + gnome-passwordsafe libsForQt5.qt5ct libsForQt5.qtstyleplugin-kvantum @@ -43,7 +45,11 @@ lib.mkIf (config.my.desktop == "gnome") { qt6Packages.qtstyleplugin-kvantum ]; - services.gpg-agent.pinentry.package = pkgs.pinentry-gnome; + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "qt5ct"; + }; + + services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3; xdg.defaultApplications = { enable = lib.mkForce false; diff --git a/user/helix.nix b/user/helix.nix index 15250b4..b711055 100644 --- a/user/helix.nix +++ b/user/helix.nix @@ -7,13 +7,9 @@ let inherit (config.my) accent theme editor; inherit (theme) color; - - cfg = config.my.helix; in { - options.my.helix.enable = lib.mkEnableOption "Enable helix config"; - - config = lib.mkIf cfg.enable { + config = { programs.helix = { enable = true; settings = { diff --git a/user/home-manager.nix b/user/home-manager.nix deleted file mode 100644 index 9c8452a..0000000 --- a/user/home-manager.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, lib, ... }: -{ - programs.home-manager.enable = true; - - systemd.user.services.home-manager-expire = { - Unit = { - Description = "Remove old home-manager generations"; - }; - Service = { - Type = "oneshot"; - ExecStart = pkgs.writeShellScript "home-manager-expire" '' - ${lib.getExe pkgs.home-manager} expire-generations 7d - ''; - }; - }; - systemd.user.timers.home-manager-expire = { - Unit = { - Description = "Remove old home-manager generations"; - }; - Timer = { - OnCalendar = "daily"; - Unit = "home-manager-expire.service"; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; -} diff --git a/user/home.nix b/user/home.nix index 1778052..30f556e 100644 --- a/user/home.nix +++ b/user/home.nix @@ -8,8 +8,7 @@ }: { imports = [ - ./dummy.nix - ./home-manager.nix + ./controller.nix ./waybar ./helix.nix ./kakoune @@ -23,7 +22,6 @@ ./rofi.nix ./mpv.nix ./mangohud.nix - ./gaming.nix ./pipewire.nix ./mimeapps.nix ./desktop-entries.nix @@ -36,7 +34,6 @@ ./pass.nix ./pqiv.nix ./zathura.nix - ./satty ./man.nix ./mpd.nix ./sway @@ -45,23 +42,21 @@ ./xdg-dirs.nix inputs.nix-index-database.hmModules.nix-index ../settings - ./powerplay-led-idle.nix - ./rm-target.nix ]; - my = import ./variables.nix // { - sway.enable = true; - pass.enable = true; - fish.enable = true; - }; + my = import ./variables.nix; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "lelgenio"; home.homeDirectory = "/home/lelgenio"; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; home.packages = with pkgs; [ - terminal + # home-manager + + terminal # see flake.nix pulse_sink pulseaudio @@ -82,22 +77,30 @@ comma # System monitors - (btop.override { rocmSupport = true; }) + (btop.override { cudaSupport = true; }) amdgpu_top inxi dmidecode + ncdu ## text manipulation sd ripgrep translate-shell lipsum - python3Packages.python-slugify par mate.engrampa # gnome.nautilus + ## games + # lutris-unwrapped + # steam # It's enabled in the system config + tlauncher + gamescope + glxinfo + vulkan-tools + ## Theming orchis_theme_compact papirus_red @@ -107,6 +110,7 @@ ## Network speedtest-cli nmap + httpie miniupnpc deluge nicotine-plus @@ -118,6 +122,7 @@ # rustup docker-compose + gnumake mariadb nodePackages.intelephense @@ -127,10 +132,8 @@ clang-tools # c/c++ lsp server rust-analyzer # rust analyzer - unstable.blade-formatter + blade-formatter nixfmt-rfc-style - - nix-output-monitor ]; fonts.fontconfig.enable = true; @@ -153,7 +156,7 @@ text-editor = lib.mkDefault "kak.desktop"; image-viewer = lib.mkDefault "pqiv.desktop"; video-player = lib.mkDefault "mpv.desktop"; - web-browser = lib.mkDefault "firefox-devedition.desktop"; + web-browser = lib.mkDefault "firefox.desktop"; document-viewer = lib.mkDefault "org.pwmt.zathura.desktop"; file-manager = lib.mkDefault "thunar.desktop"; archive-manager = "engrampa.desktop"; @@ -170,6 +173,30 @@ exec nicotine ''; + systemd.user.services.rm-target = { + Unit = { + Description = "Remove directories named 'target'"; + }; + Service = { + Type = "oneshot"; + ExecStart = pkgs.writeShellScript "rm-target" '' + sudo ${pkgs.fd}/bin/fd -td -u '^\.?target$' "$HOME" -x rm -vrf -- + ''; + }; + }; + systemd.user.timers.rm-target = { + Unit = { + Description = "Remove directories named 'target'"; + }; + Timer = { + OnCalendar = "weekly"; + Unit = "rm-target.service"; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; + # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards diff --git a/user/kakoune/colors.nix b/user/kakoune/colors.nix index a0917d4..e9b9d07 100644 --- a/user/kakoune/colors.nix +++ b/user/kakoune/colors.nix @@ -114,112 +114,3 @@ with colors; Hint = "blue"; } )) -+ '' - # Color palette - declare-option str red "red" - declare-option str mauve "magenta" - declare-option str maroon "rgb:ee99a0" - declare-option str pink "rgb:f5bde6" - declare-option str cyan "cyan" - declare-option str yellow "yellow" - declare-option str green "green" - declare-option str white "white" - declare-option str blue "blue" - declare-option str sky "rgb:91d7e3" - declare-option str lavender "rgb:b7bdf8" - declare-option str black1 "rgb:202020" - declare-option str black2 "rgb:272727" - declare-option str black3 "rgb:3a3a3a" - declare-option str orange ${orange} - declare-option str teal "rgb:8bd5ca" - declare-option str flamingo "rgb:f0c6c6" - declare-option str gray0 "rgb:606060" - declare-option str gray1 "rgb:737373" - declare-option str bright_red "%opt{red}+b" - declare-option str bright_green "%opt{green}+b" - declare-option str bright_yellow "%opt{yellow}+b" - declare-option str bright_blue "%opt{blue}+b" - declare-option str bright_cyan "%opt{cyan}+b" - declare-option str foreground %opt{white} - declare-option str background %opt{black2} - declare-option str overlay0 "rgb:878787" - declare-option str overlay1 "rgb:9a9a9a" - - # Tree-sitter () - set-face global ts_attribute "%opt{cyan}" - set-face global ts_comment "%opt{overlay0}+i" - set-face global ts_conceal "%opt{mauve}+i" - set-face global ts_constant "%opt{orange}" - set-face global ts_constant_builtin_boolean "%opt{sky}" - set-face global ts_constant_character "%opt{yellow}" - set-face global ts_constant_macro "%opt{mauve}" - set-face global ts_constructor "%opt{cyan}" - set-face global ts_diff_plus "%opt{green}" - set-face global ts_diff_minus "%opt{red}" - set-face global ts_diff_delta "%opt{blue}" - set-face global ts_diff_delta_moved "%opt{mauve}" - set-face global ts_error "%opt{red}+b" - set-face global ts_function "%opt{blue}" - set-face global ts_function_builtin "%opt{blue}+i" - set-face global ts_function_macro "%opt{mauve}" - set-face global ts_hint "%opt{blue}+b" - set-face global ts_info "%opt{green}+b" - set-face global ts_keyword "%opt{mauve}" - set-face global ts_keyword_conditional "%opt{mauve}+i" - set-face global ts_keyword_control_conditional "%opt{mauve}+i" - set-face global ts_keyword_control_directive "%opt{mauve}+i" - set-face global ts_keyword_control_import "%opt{mauve}+i" - set-face global ts_keyword_directive "%opt{mauve}+i" - set-face global ts_keyword_storage "%opt{mauve}" - set-face global ts_keyword_storage_modifier "%opt{mauve}" - set-face global ts_keyword_storage_modifier_mut "%opt{mauve}" - set-face global ts_keyword_storage_modifier_ref "%opt{teal}" - set-face global ts_label "%opt{cyan}+i" - set-face global ts_markup_bold "%opt{orange}+b" - set-face global ts_markup_heading "%opt{red}" - set-face global ts_markup_heading_1 "%opt{red}" - set-face global ts_markup_heading_2 "%opt{mauve}" - set-face global ts_markup_heading_3 "%opt{green}" - set-face global ts_markup_heading_4 "%opt{yellow}" - set-face global ts_markup_heading_5 "%opt{pink}" - set-face global ts_markup_heading_6 "%opt{teal}" - set-face global ts_markup_heading_marker "%opt{orange}+b" - set-face global ts_markup_italic "%opt{pink}+i" - set-face global ts_markup_list_checked "%opt{green}" - set-face global ts_markup_list_numbered "%opt{blue}+i" - set-face global ts_markup_list_unchecked "%opt{teal}" - set-face global ts_markup_list_unnumbered "%opt{mauve}" - set-face global ts_markup_link_label "%opt{blue}" - set-face global ts_markup_link_url "%opt{teal}+u" - set-face global ts_markup_link_uri "%opt{teal}+u" - set-face global ts_markup_link_text "%opt{blue}" - set-face global ts_markup_quote "%opt{gray1}" - set-face global ts_markup_raw "%opt{green}" - set-face global ts_markup_strikethrough "%opt{gray1}+s" - set-face global ts_namespace "%opt{blue}+i" - set-face global ts_operator "%opt{sky}" - set-face global ts_property "%opt{sky}" - set-face global ts_punctuation "%opt{overlay1}" - set-face global ts_punctuation_special "%opt{sky}" - set-face global ts_special "%opt{blue}" - set-face global ts_spell "%opt{mauve}" - set-face global ts_string "%opt{green}" - set-face global ts_string_regex "%opt{orange}" - set-face global ts_string_regexp "%opt{orange}" - set-face global ts_string_escape "%opt{mauve}" - set-face global ts_string_special "%opt{blue}" - set-face global ts_string_special_path "%opt{orange}" - set-face global ts_string_special_symbol "%opt{mauve}" - set-face global ts_string_symbol "%opt{red}" - set-face global ts_tag "%opt{mauve}" - set-face global ts_tag_error "%opt{red}" - set-face global ts_text "%opt{white}" - set-face global ts_text_title "%opt{mauve}" - set-face global ts_type "%opt{yellow}" - set-face global ts_type_enum_variant "%opt{flamingo}" - set-face global ts_variable "%opt{blue}" - set-face global ts_variable_builtin "%opt{red}" - set-face global ts_variable_other_member "%opt{teal}" - set-face global ts_variable_parameter "%opt{maroon}+i" - set-face global ts_warning "%opt{orange}+b" -'' diff --git a/user/kakoune/default.nix b/user/kakoune/default.nix index fa63e6b..ebb17f5 100644 --- a/user/kakoune/default.nix +++ b/user/kakoune/default.nix @@ -6,6 +6,7 @@ }: let inherit (config.my) + key dmenu editor theme @@ -16,7 +17,6 @@ let inherit (pkgs.kakouneUtils) buildKakounePlugin; in { - imports = [ ./kak-tree-sitter.nix ]; config = { programs.kakoune = { enable = true; @@ -82,9 +82,6 @@ in rev = "1cc6baeb14b773916eb9209469aa77b3cfa67a0a"; sha256 = "sha256-3PLxG9UtT0MMSibvTviXQIgTH3rApZ3WSbNCEH3c7HE="; }; - buildInputs = with pkgs; [ - python3Minimal - ]; }) ]; extraConfig = @@ -103,9 +100,6 @@ in ) ) + '' - try %{ - eval %sh{ kak-tree-sitter -vvvv -dks --init $kak_session } - } set global scrolloff 10,20 set global autoreload yes @@ -124,19 +118,16 @@ in home.file = { ".config/kak-lsp/kak-lsp.toml".source = ./kak-lsp.toml; }; - home.packages = with pkgs; [ terminal ranger bmenu kak-lsp - kak-tree-sitter kak-pager kak-man-pager emmet-cli nodePackages.prettier - pint-fmt aspell aspellDicts.en diff --git a/user/kakoune/filetypes.kak b/user/kakoune/filetypes.kak index b9d19f5..fd0b87c 100644 --- a/user/kakoune/filetypes.kak +++ b/user/kakoune/filetypes.kak @@ -15,16 +15,8 @@ hook global WinSetOption filetype=nix %{ set buffer formatcmd 'nixfmt' } -hook global BufCreate .*\.json %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" -} - -hook global BufCreate .*\.ya?ml %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" -} - hook global BufCreate .*\.html %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" + set buffer formatcmd 'prettier --parser html' } hook global BufCreate .*\.component\.html %{ @@ -38,28 +30,8 @@ hook global WinSetOption filetype=angular %[ add-highlighter buffer/angular ref html ] -hook global BufCreate .*\.php %{ - set buffer formatcmd 'pint-fmt' -} - hook global BufCreate .*\.js %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" -} - -hook global BufCreate .*\.jsx %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" -} - -hook global BufCreate .*\.ts %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" -} - -hook global BufCreate .*\.tsx %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" -} - -hook global BufCreate .*\.scss %{ - set buffer formatcmd "prettier --stdin-filepath=%val{buffile}" + set buffer formatcmd 'prettier --parser babel' } hook global BufCreate .*\.vue %{ diff --git a/user/kakoune/kak-lsp.toml b/user/kakoune/kak-lsp.toml index 9c195bd..b3a6c8e 100644 --- a/user/kakoune/kak-lsp.toml +++ b/user/kakoune/kak-lsp.toml @@ -104,19 +104,6 @@ files.exclude = [ "**/bower_components/**", "**/resources/views/**" ] -stubs = [ - "apache", "bcmath", "bz2", "calendar", "com_dotnet", "Core", "ctype", - "curl", "date", "dba", "dom", "enchant", "exif", "FFI", "fileinfo", "filter", - "fpm", "ftp", "gd", "gettext", "gmp", "hash", "iconv", "imagick", "imap", - "intl", "json", "ldap", "libxml", "mbstring", "meta", "mysqli", "oci8", - "odbc", "openssl", "pcntl", "pcre", "PDO", "pdo_ibm", "pdo_mysql", "pdo_pgsql", - "pdo_sqlite", "pgsql", "Phar", "posix", "pspell", "readline", "Reflection", - "session", "shmop", "SimpleXML", "snmp", "soap", "sockets", "sodium", - "SPL", "sqlite3", "standard", "superglobals", "sysvmsg", "sysvsem", "sysvshm", - "tidy", "tokenizer", "xml", "xmlreader", "xmlrpc", "xmlwriter", "xsl", - "Zend OPcache", "zip", "zlib", -] - [language_server.rust-analyzer] filetypes = ["rust"] diff --git a/user/kakoune/kak-tree-sitter.nix b/user/kakoune/kak-tree-sitter.nix deleted file mode 100644 index 59ab3e0..0000000 --- a/user/kakoune/kak-tree-sitter.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ pkgs, lib, ... }: -let - hx-src = pkgs.helix.src; - kts-src = pkgs.unstable.kak-tree-sitter-unwrapped.src; - inherit (pkgs) fetchFromGitHub; -in -with pkgs.tree-sitter-grammars; -{ - xdg.configFile."kak-tree-sitter/config.toml".text = - lib.foldlAttrs - ( - acc: name: vals: - acc - + '' - [language.${name}.grammar.source.local] - path = "${vals.parser}" - [language.${name}.grammar] - compile = "cc" - compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] - compile_flags = ["-O3"] - link = "cc" - link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"] - link_flags = ["-O3"] - [language.${name}.queries.source.local] - path = "${vals.queries}" - [language.${name}.queries] - path = "${vals.queries}" - '' - ) - "" - { - nix = { - parser = tree-sitter-nix + "/parser"; - queries = tree-sitter-nix + "/queries"; - }; - - scss = { - parser = tree-sitter-scss + "/parser"; - queries = tree-sitter-scss + "/queries"; - }; - css = { - parser = tree-sitter-css + "/parser"; - queries = tree-sitter-css + "/queries"; - }; - - javascript = { - parser = tree-sitter-javascript + "/parser"; - queries = tree-sitter-javascript + "/queries"; - }; - typescript = { - parser = - tree-sitter-typescript.overrideAttrs (old: { - src = fetchFromGitHub { - owner = "tree-sitter"; - repo = "tree-sitter-typescript"; - rev = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf"; - hash = "sha256-oZKit8kScXcOptmT2ckywL5JlAVe+wuwhuj6ThEI5OQ="; - }; - }) - + "/parser"; - queries = kts-src + "/runtime/queries/typescript"; - }; - }; -} diff --git a/user/mangohud.nix b/user/mangohud.nix index fa0c8ff..440b750 100644 --- a/user/mangohud.nix +++ b/user/mangohud.nix @@ -1,68 +1,80 @@ -{ config, lib, ... }: +{ + config, + pkgs, + lib, + font, + ... +}: let - cfg = config.my.mangohud; + inherit (config.my) + key + theme + color + accent + font + ; in { - options.my.mangohud.enable = lib.mkEnableOption { }; + config = { + programs.mangohud = { + enable = true; + enableSessionWide = true; + settings = { + full = true; + # histogram = true; + no_display = true; + fps_limit = "0,30,60,72,90,120,144,240,288,320"; + toggle_fps_limit = "Shift_R+F10"; + toggle_preset = "Control_R+F9"; + fps_metrics = "Control_R+F8"; - config.programs.mangohud = lib.mkIf cfg.enable { - enable = true; - enableSessionWide = true; - settings = { - full = true; - # histogram = true; - no_display = true; - fps_limit = "0,30,60,72,90,120,144,240,288,320"; - toggle_fps_limit = "Shift_R+F10"; - toggle_preset = "Control_R+F9"; - fps_metrics = "Control_R+F8"; + # legacy_layout = "false"; + # gpu_stats = true; + # gpu_temp = true; + # gpu_core_clock = true; + # gpu_mem_clock = true; + # gpu_power = true; + # gpu_load_change = true; + # gpu_load_value = "50,90"; + gpu_load_color = "FFFFFF,FFAA7F,CC0000"; + # gpu_text = "GPU"; + # cpu_stats = true; + # cpu_temp = true; + # cpu_power = true; + # cpu_mhz = true; + # cpu_load_change = true; + # core_load_change = true; + # cpu_load_value = "50,90"; + cpu_load_color = "FFFFFF,FFAA7F,CC0000"; + cpu_color = "2e97cb"; + # cpu_text = "CPU"; + # io_stats = true; + # io_read = true; + # io_write = true; + io_color = "a491d3"; + # swap = true; + # vram = true; + vram_color = "ad64c1"; + # ram = true; + ram_color = "c26693"; + # fps = true; + engine_color = "eb5b5b"; + gpu_color = "2e9762"; + wine_color = "eb5b5b"; + # frame_timing = "1"; + frametime_color = "00ff00"; + media_player_color = "ffffff"; + background_alpha = "0.8"; + font_size = "24"; - # legacy_layout = "false"; - # gpu_stats = true; - # gpu_temp = true; - # gpu_core_clock = true; - # gpu_mem_clock = true; - # gpu_power = true; - # gpu_load_change = true; - # gpu_load_value = "50,90"; - gpu_load_color = "FFFFFF,FFAA7F,CC0000"; - # gpu_text = "GPU"; - # cpu_stats = true; - # cpu_temp = true; - # cpu_power = true; - # cpu_mhz = true; - # cpu_load_change = true; - # core_load_change = true; - # cpu_load_value = "50,90"; - cpu_load_color = "FFFFFF,FFAA7F,CC0000"; - cpu_color = "2e97cb"; - # cpu_text = "CPU"; - # io_stats = true; - # io_read = true; - # io_write = true; - io_color = "a491d3"; - # swap = true; - # vram = true; - vram_color = "ad64c1"; - # ram = true; - ram_color = "c26693"; - # fps = true; - engine_color = "eb5b5b"; - gpu_color = "2e9762"; - wine_color = "eb5b5b"; - # frame_timing = "1"; - frametime_color = "00ff00"; - media_player_color = "ffffff"; - background_alpha = "0.8"; - font_size = "24"; - - background_color = "020202"; - position = "top-left"; - # text_color = "ffffff"; - round_corners = "10"; - toggle_hud = "Shift_R+F12"; - # toggle_logging = "Shift_L+F12"; - # output_folder = "/home/lelgenio"; + background_color = "020202"; + position = "top-left"; + # text_color = "ffffff"; + round_corners = "10"; + toggle_hud = "Shift_R+F12"; + # toggle_logging = "Shift_L+F12"; + # output_folder = "/home/lelgenio"; + }; }; }; } diff --git a/user/mpd.nix b/user/mpd.nix index b4bdad3..f4cca16 100644 --- a/user/mpd.nix +++ b/user/mpd.nix @@ -4,13 +4,8 @@ config, ... }: -let - cfg = config.my.mpd; -in { - options.my.mpd.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { + config = lib.mkIf (config.my.desktop != "gnome") { services.mpd = { enable = true; musicDirectory = config.home.homeDirectory + "/Música"; diff --git a/user/pass.nix b/user/pass.nix index c3b56c6..e1c5bb8 100644 --- a/user/pass.nix +++ b/user/pass.nix @@ -2,23 +2,14 @@ config, pkgs, lib, + inputs, ... }: -let - cfg = config.my.pass; -in { - options.my.pass.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { + config = { programs.password-store = { enable = true; - package = pkgs.pass.withExtensions ( - ex: with ex; [ - pass-otp - pass-import - ] - ); + package = pkgs.pass.withExtensions (ex: with ex; [ pass-otp ]); }; services = { pass-secret-service.enable = true; @@ -35,7 +26,6 @@ in _gpg-unlock qtpass readQrCode - pass-export ]; }; } diff --git a/user/powerplay-led-idle.nix b/user/powerplay-led-idle.nix deleted file mode 100644 index a34990e..0000000 --- a/user/powerplay-led-idle.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, lib, ... }: -{ - systemd.user.services.powerplay-led-idle = { - Unit = { - Description = "Autosuspend Powerplay mousepad led"; - PartOf = [ "graphical-session.target" ]; - After = [ "graphical-session.target" ]; - }; - Service = { - ExecStart = lib.getExe pkgs.powerplay-led-idle; - Restart = "on-failure"; - }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - }; -} diff --git a/user/ranger/rc.conf b/user/ranger/rc.conf index ad71849..3936f36 100644 --- a/user/ranger/rc.conf +++ b/user/ranger/rc.conf @@ -27,10 +27,10 @@ set confirm_on_delete multiple # Use non-default path for file preview script? # ranger ships with scope.sh, a script that calls external programs (see # README.md for dependencies) to preview images, archives, etc. -# set preview_script ~/.config/ranger/scope.sh +set preview_script ~/.config/ranger/scope.sh # Use the external preview script or display simple plain text or image previews? -# set use_preview_script true +set use_preview_script true # Automatically count files in the directory, even before entering them? set automatically_count_files true @@ -40,7 +40,7 @@ set automatically_count_files true set open_all_images true # Be aware of version control systems and display information. -set vcs_aware false +set vcs_aware true # State of the four backends git, hg, bzr, svn. The possible states are # disabled, local (only show local info), enabled (show local and remote diff --git a/user/rm-target.nix b/user/rm-target.nix deleted file mode 100644 index 93c6058..0000000 --- a/user/rm-target.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, lib, ... }: -{ - systemd.user.services.rm-target = { - Unit = { - Description = "Remove directories named 'target'"; - }; - Service = { - Type = "oneshot"; - ExecStart = pkgs.writeShellScript "rm-target" '' - sudo ${pkgs.fd}/bin/fd -td -u '^\.?target$' "$HOME" -x rm -vrf -- - ''; - }; - }; - systemd.user.timers.rm-target = { - Unit = { - Description = "Remove directories named 'target'"; - }; - Timer = { - OnCalendar = "weekly"; - Unit = "rm-target.service"; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; -} diff --git a/user/satty/config.toml b/user/satty/config.toml deleted file mode 100644 index 84075cb..0000000 --- a/user/satty/config.toml +++ /dev/null @@ -1,63 +0,0 @@ -[general] -# Start Satty in fullscreen mode -fullscreen = true -# Exit directly after copy/save action -early-exit = true -# Draw corners of rectangles round if the value is greater than 0 (0 disables rounded corners) -corner-roundness = 12 -# Select the tool on startup [possible values: pointer, crop, line, arrow, rectangle, text, marker, blur, brush] -initial-tool = "brush" -# Configure the command to be called on copy, for example `wl-copy` -copy-command = "wl-copy" -# Increase or decrease the size of the annotations -# annotation-size-factor = 2 -# Filename to use for saving action. Omit to disable saving to file. Might contain format specifiers: https://docs.rs/chrono/latest/chrono/format/strftime/index.html -# output-filename = "/tmp/test-%Y-%m-%d_%H:%M:%S.png" -# After copying the screenshot, save it to a file as well -# save-after-copy = false -# Hide toolbars by default -# default-hide-toolbars = false -# Experimental: whether window focus shows/hides toolbars. This does not affect initial state of toolbars, see default-hide-toolbars. -# focus-toggles-toolbars = false -# The primary highlighter to use, the other is accessible by holding CTRL at the start of a highlight [possible values: block, freehand] -primary-highlighter = "block" -# Disable notifications -disable-notifications = true -# Actions to trigger on right click (order is important) -# [possible values: save-to-clipboard, save-to-file, exit] -# actions-on-right-click = [] -# Actions to trigger on Enter key (order is important) -# [possible values: save-to-clipboard, save-to-file, exit] -# actions-on-enter = ["save-to-clipboard"] -# Actions to trigger on Escape key (order is important) -# [possible values: save-to-clipboard, save-to-file, exit] -# actions-on-escape = ["exit"] -# Action to perform when the Enter key is pressed [possible values: save-to-clipboard, save-to-file] -# Deprecated: use actions-on-enter instead -action-on-enter = "save-to-clipboard" -# Right click to copy -# Deprecated: use actions-on-right-click instead -# right-click-copy = false -# request no window decoration. Please note that the compositor has the final say in this. At this point. requires xdg-decoration-unstable-v1. -# no-window-decoration = true -# experimental feature: adjust history size for brush input smooting (0: disabled, default: 0, try e.g. 5 or 10) -# brush-smooth-history-size = 10 - -# Font to use for text annotations -[font] -family = "Roboto" -style = "Bold" - -# Custom colours for the colour palette -[color-palette] -# These will be shown in the toolbar for quick selection -palette = [ - "#ff0000", - "#00ffff", - "#a52a2a", - "#dc143c", - "#ff1493", - "#ffd700", - "#008000", -] - diff --git a/user/satty/default.nix b/user/satty/default.nix deleted file mode 100644 index 5709b77..0000000 --- a/user/satty/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -let - cfg = config.my.satty; -in -{ - options.my.satty.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { - xdg.configFile."satty/config.toml" = { - source = ./config.toml; - }; - - home.packages = with pkgs; [ - satty - ]; - }; -} diff --git a/user/ssh.nix b/user/ssh.nix index 4747bb4..60649ba 100644 --- a/user/ssh.nix +++ b/user/ssh.nix @@ -1,20 +1,26 @@ +{ + config, + pkgs, + lib, + ... +}: +let + inherit (config.my) username mail; +in { config = { - programs.ssh = { - enable = true; - matchBlocks = { - monolith = { - user = "lelgenio"; - hostname = "monolith.lelgenio.com"; - port = 9022; - }; - phantom = { - user = "root"; - hostname = "phantom.lelgenio.com"; - port = 9022; - }; + programs.ssh.enable = true; + programs.ssh.matchBlocks = { + monolith = { + user = "lelgenio"; + hostname = "monolith.lelgenio.com"; + port = 9022; + }; + phantom = { + user = "root"; + hostname = "phantom.lelgenio.com"; + port = 9022; }; - includes = [ "~/Wopus/.ssh.config" ]; }; }; } diff --git a/user/sway/default.nix b/user/sway/default.nix index 5fbd379..3e86994 100644 --- a/user/sway/default.nix +++ b/user/sway/default.nix @@ -5,10 +5,13 @@ ... }: let - inherit (config.my) accent font theme; + inherit (config.my) + key + accent + font + theme + ; inherit (theme) color; - - cfg = config.my.sway; in { imports = [ @@ -20,21 +23,11 @@ in ./swayidle.nix ./swaylock.nix ./theme.nix - ./gammastep.nix ]; - - options.my.sway.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { - my.mako.enable = true; - my.kanshi.enable = true; - my.swayidle.enable = true; - my.swaylock.enable = true; - my.mpd.enable = true; - my.zathura.enable = true; - my.satty.enable = true; - my.waybar.enable = true; - my.gammastep.enable = true; + config = lib.mkIf (config.my.desktop == "sway") { + services.mako.enable = true; + services.swayidle.enable = true; + services.kanshi.enable = true; wayland.windowManager.sway = { enable = true; @@ -43,7 +36,7 @@ in bars = [ ]; floating.modifier = "Mod4"; - terminal = lib.getExe pkgs.alacritty; + terminal = pkgs.alacritty.executable; window.titlebar = false; gaps = { @@ -76,7 +69,7 @@ in }; output = { "*" = { - adaptive_sync = "on"; + adaptive_sync = "off"; bg = "${theme.background} fill"; mode = "1920x1080@144.000Hz"; }; @@ -87,12 +80,6 @@ in }; # Ignore PS4 controller touchpad events input."1356:2508:Wireless_Controller_Touchpad".events = "disabled"; - - input."type:pointer" = { - accel_profile = "flat"; - pointer_accel = "0"; - }; - input."type:touchpad" = { # Disable While Typing dwt = "enabled"; @@ -116,27 +103,45 @@ in for_window [title=.*] inhibit_idle fullscreen exec swaymsg workspace 2 exec_always systemctl --user restart waybar.service + exec corectrl --minimize-systray ''; }; + services.gammastep = { + enable = true; + provider = "geoclue2"; + }; services.kdeconnect = { enable = true; indicator = true; }; - services.gpg-agent.pinentry.package = pkgs.pinentry-all; - - xdg.configFile."OpenTabletDriver/settings.json" = { - force = true; - source = ./open-tablet-driver.json; + systemd.user.services.vrr-fullscreen = { + Unit = { + Description = "Enable VRR for fullscreen windows"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = "${lib.getExe pkgs.vrr-fullscreen}"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "sway-session.target" ]; + }; }; + services.gpg-agent.pinentryPackage = pkgs.pinentry-all; + + xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json; + home.packages = with pkgs; [ mySway swaybg swaylock wdisplays + waybar dhist demoji bmenu @@ -156,8 +161,7 @@ in wl-crosshair grim - satty - xdg-user-dirs + swappy (tesseract5.override { enableLanguages = [ "eng" diff --git a/user/sway/gammastep.nix b/user/sway/gammastep.nix deleted file mode 100644 index a5b6917..0000000 --- a/user/sway/gammastep.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.my.gammastep; -in -{ - options.my.gammastep.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { - services.gammastep = { - enable = true; - dawnTime = "6:00-7:45"; - duskTime = "18:35-20:15"; - temperature = { - day = 6500; - night = 4500; - }; - }; - }; -} diff --git a/user/sway/kanshi.nix b/user/sway/kanshi.nix index 486a209..c0a584b 100644 --- a/user/sway/kanshi.nix +++ b/user/sway/kanshi.nix @@ -1,12 +1,20 @@ -{ config, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let - cfg = config.my.kanshi; + inherit (config.my) + key + accent + font + theme + ; + inherit (theme) color; in { - options.my.kanshi.enable = lib.mkEnableOption { }; - - config.services.kanshi = lib.mkIf cfg.enable { - enable = true; + services.kanshi = { settings = [ { profile = { diff --git a/user/sway/mako.nix b/user/sway/mako.nix index 6c78c9f..4f43734 100644 --- a/user/sway/mako.nix +++ b/user/sway/mako.nix @@ -6,68 +6,60 @@ }: let inherit (config.my) + key accent font theme ; inherit (theme) color; - - cfg = config.my.mako; in { - options.my.mako.enable = lib.mkEnableOption { }; + services.mako = { + borderSize = 2; + padding = "5"; + margin = "15"; + layer = "overlay"; - config = lib.mkIf cfg.enable { - services.mako = { - enable = true; + font = "${font.interface} ${toString font.size.small}"; + textColor = color.txt; - settings = { - border-size = 2; - padding = "5"; - margin = "15"; - layer = "overlay"; + backgroundColor = color.bg; + borderColor = accent.color; + progressColor = "over ${accent.color}88"; - font = "${font.interface} ${toString font.size.small}"; - text-color = color.txt; + defaultTimeout = 10000; - background-color = color.bg; - border-color = accent.color; - progress-color = "over ${accent.color}88"; + extraConfig = '' + [app-name=volumesh] + default-timeout=5000 + group-by=app-name + format=%s\n%b + ''; - default-timeout = 10000; + # # {{@@ header() @@}} + # # text - "app-name=volumesh" = { - "default-timeout" = "5000"; - "group-by" = "app-name"; - "format" = "%s\\n%b"; - }; - }; + # # features + # icons=1 + # markup=1 + # actions=1 + # default-timeout=10000 - # # {{@@ header() @@}} - # # text - - # # features - # icons=1 - # markup=1 - # actions=1 - # default-timeout=10000 - - # # position - # layer=overlay + # # position + # layer=overlay + }; + systemd.user.services.mako = lib.mkIf (config.services.mako.enable) { + Unit = { + Description = "Notification daemon"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; }; - systemd.user.services.mako = lib.mkIf (config.services.mako.enable) { - Unit = { - Description = "Notification daemon"; - PartOf = [ "graphical-session.target" ]; - After = [ "graphical-session.target" ]; - }; - Service = { - ExecStart = "${pkgs.mako}/bin/mako"; - Restart = "on-failure"; - }; - Install = { - WantedBy = [ "sway-session.target" ]; - }; + Service = { + ExecStart = "${pkgs.mako}/bin/mako"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "sway-session.target" ]; }; }; } diff --git a/user/sway/open-tablet-driver.json b/user/sway/open-tablet-driver.json index bf49af6..3b388a1 100644 --- a/user/sway/open-tablet-driver.json +++ b/user/sway/open-tablet-driver.json @@ -76,7 +76,7 @@ "Settings": [ { "Property": "Keys", - "Value": "Control+Shift+Z" + "Value": "Control+O" } ], "Enable": true @@ -111,4 +111,4 @@ "LockUsableAreaDisplay": true, "LockUsableAreaTablet": true, "Tools": [] -} \ No newline at end of file +} diff --git a/user/sway/sway-assigns.nix b/user/sway/sway-assigns.nix index 8f073c7..3822a22 100644 --- a/user/sway/sway-assigns.nix +++ b/user/sway/sway-assigns.nix @@ -44,8 +44,6 @@ in { title = "Discord"; } { class = "WebCord"; } { app_id = "WebCord"; } - { class = "vesktop"; } - { app_id = "vesktop"; } { class = "Element"; } { app_id = "Element"; } ]; @@ -58,6 +56,7 @@ in { app_id = "wdisplays"; } { app_id = "pavucontrol"; } { app_id = ".*[Hh]elvum.*"; } + { workspace = "9"; } ]; }; }; diff --git a/user/sway/sway-binds.nix b/user/sway/sway-binds.nix index ae71cf4..7b33cd0 100644 --- a/user/sway/sway-binds.nix +++ b/user/sway/sway-binds.nix @@ -166,14 +166,11 @@ let other_binds = { "${mod}+p" = "exec ${pkgs.wpass}/bin/wpass"; "${mod}+s" = "exec ${menu}"; - "${mod}+g" = - "exec ${pkgs.demoji}/bin/demoji --lang pt --fallback --copy -- ${pkgs.wdmenu}/bin/wdmenu"; + "${mod}+g" = "exec ${pkgs.demoji}/bin/demoji --lang pt --fallback --copy -- ${pkgs.wdmenu}/bin/wdmenu"; "${mod}+c" = "exec ${pkgs.color_picker}/bin/color_picker"; "${mod}+Return" = "exec ${terminal}"; "${mod}+Ctrl+Return" = "exec thunar"; - "${mod}+Shift+s" = '' - exec grim - | satty --filename - --output-filename "$(xdg-user-dir PICTURES)"/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png - ''; + "${mod}+Shift+s" = "exec grim - | swappy -f -"; "${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy"; "${mod}+k" = "exec showkeys"; "${mod}+Alt+x" = "exec pkill wl-crosshair || exec wl-crosshair"; diff --git a/user/sway/swayidle.nix b/user/sway/swayidle.nix index b6541f3..2c5384f 100644 --- a/user/sway/swayidle.nix +++ b/user/sway/swayidle.nix @@ -5,15 +5,18 @@ ... }: let - asScript = filename: text: toString (pkgs.writeShellScript filename text); + inherit (config.my) + key + accent + font + theme + ; + inherit (theme) color; - cfg = config.my.swayidle; + asScript = filename: text: toString (pkgs.writeShellScript filename text); in { - options.my.swayidle.enable = lib.mkEnableOption { }; - - config.services.swayidle = { - enable = cfg.enable; + services.swayidle = { timeouts = [ { timeout = 360; diff --git a/user/sway/swaylock.nix b/user/sway/swaylock.nix index ceb2e6b..e46b5d9 100644 --- a/user/sway/swaylock.nix +++ b/user/sway/swaylock.nix @@ -1,15 +1,21 @@ -{ config, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let - inherit (config.my) accent font theme; + inherit (config.my) + key + accent + font + theme + ; inherit (theme) color; - - cfg = config.my.swaylock; in { - options.my.swaylock.enable = lib.mkEnableOption { }; - - config.programs.swaylock.settings = lib.mkIf cfg.enable { - image = theme.backgroundPath; + programs.swaylock.settings = { + image = toString theme.background; font = font.interface; font-size = font.size.medium; indicator-thickness = 20; diff --git a/user/sway/theme.nix b/user/sway/theme.nix index 600f596..ca4ea76 100644 --- a/user/sway/theme.nix +++ b/user/sway/theme.nix @@ -48,14 +48,9 @@ lib.mkIf (desktop == "sway") { gtk3 = shared; } ); - - xdg.configFile."gtk-3.0/settings.ini".force = true; - xdg.configFile."gtk-4.0/settings.ini".force = true; - qt = { enable = true; - platformTheme.name = "gtk3"; - style.name = "kvantum"; + platformTheme.name = "qtct"; }; dconf.settings = { @@ -70,6 +65,21 @@ lib.mkIf (desktop == "sway") { }; }; + # fonts.fontconfig.enable = true; + xdg.configFile = { + "qt5ct/qt5ct.conf".text = '' + [Appearance] + # color_scheme_path=/nix/store/f07mk0vrm47jxw3y5v99hxncy0w4vcyq-qt5ct-1.5/share/qt5ct/colors/darker.conf + custom_palette=false + icon_theme=${icon_theme} + standard_dialogs=default + style=kvantum-dark + + # [Fonts] + # fixed=@Variant(\0\0\0@\0\0\0\x1c\0H\0\x61\0\x63\0k\0 \0N\0\x65\0r\0\x64\0 \0\x46\0o\0n\0t@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) + # general=@Variant(\0\0\0@\0\0\0\x1e\0L\0i\0\x62\0\x65\0r\0\x61\0t\0i\0o\0n\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) + ''; + }; services.xsettingsd = { enable = true; settings = { @@ -83,6 +93,11 @@ lib.mkIf (desktop == "sway") { }; home.packages = with pkgs; [ + libsForQt5.qt5ct + libsForQt5.qtstyleplugin-kvantum + qt6Packages.qt6ct + qt6Packages.qtstyleplugin-kvantum + pkgs.bibata-cursors pkgs.orchis_theme_compact pkgs.papirus_red @@ -92,6 +107,7 @@ lib.mkIf (desktop == "sway") { hack-font font-awesome_5 fira-code + nerdfonts_fira_hack material-wifi-icons ]; } diff --git a/user/thunar.nix b/user/thunar.nix index 26b90e9..2a9fe5b 100644 --- a/user/thunar.nix +++ b/user/thunar.nix @@ -10,12 +10,6 @@ }) ]; - wayland.windowManager.sway = { - extraConfig = '' - exec_always systemctl --user import-environment PATH - ''; - }; - xdg.configFile = { "Thunar/".source = ./thunar; }; diff --git a/user/variables.nix b/user/variables.nix index 65bc69a..cb35123 100644 --- a/user/variables.nix +++ b/user/variables.nix @@ -28,7 +28,6 @@ let cursor_theme = "Bibata-Modern-Classic"; background = ./backgrounds/nixos-dark-pattern.png; - backgroundPath = "~/.local/share/backgrounds/nixos-dark-pattern.png"; opacity = 95; opacityHex = "ee"; color = { @@ -60,7 +59,6 @@ let cursor_theme = "Bibata-Modern-Classic"; background = ./backgrounds/nixos-light-pattern.png; - backgroundPath = "~/.local/share/backgrounds/nixos-light-pattern.png"; opacity = 95; opacityHex = "ee"; color = { @@ -116,6 +114,6 @@ rec { dmenu = "bmenu"; desktop = "sway"; - browser = "firefox-devedition"; + browser = "firefox"; editor = "kakoune"; } diff --git a/user/vscode/default.nix b/user/vscode/default.nix index e9a97cb..a477666 100644 --- a/user/vscode/default.nix +++ b/user/vscode/default.nix @@ -3,8 +3,8 @@ programs.vscode = { enable = true; - package = pkgs.vscodium; - profiles.default.extensions = with pkgs.vscode-extensions; [ + package = pkgs.vscodium-fhs; + extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide github.github-vscode-theme rust-lang.rust-analyzer @@ -12,11 +12,8 @@ }; home.file = { - "${config.home.homeDirectory}/.config/VSCodium/User/keybindings.json".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/nixos-config/user/vscode/keybindings.json"; - "${config.home.homeDirectory}/.config/VSCodium/User/settings.json".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/nixos-config/user/vscode/settings.json"; - "${config.home.homeDirectory}/.config/VSCodium/product.json".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/nixos-config/user/vscode/product.json"; + "${config.home.homeDirectory}/.config/VSCodium/User/keybindings.json".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/nixos-config/user/vscode/keybindings.json"; + "${config.home.homeDirectory}/.config/VSCodium/User/settings.json".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/nixos-config/user/vscode/settings.json"; + "${config.home.homeDirectory}/.config/VSCodium/product.json".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/nixos-config/user/vscode/product.json"; }; } diff --git a/user/waybar/default.nix b/user/waybar/default.nix index 5af72bc..d2dc661 100644 --- a/user/waybar/default.nix +++ b/user/waybar/default.nix @@ -14,13 +14,9 @@ let font ; inherit (theme) color; - - cfg = config.my.waybar; in { - options.my.waybar.enable = lib.mkEnableOption { }; - - config = lib.mkIf cfg.enable { + config = { programs.waybar = { enable = true; systemd.enable = true; @@ -39,7 +35,6 @@ in "mpd" "custom/playerctl" "tray" - "custom/controller-battery" "custom/caffeine" "pulseaudio" (lib.optional (osConfig.services.vpn.enable or false) "custom/vpn") @@ -111,7 +106,7 @@ in }; clock = { interval = 60; - format = "{:L%H:%M %a %d/%m}"; + format = "{:%H:%M %a %d/%m}"; tooltip-format = "{calendar}"; calendar = { mode = "year"; @@ -142,8 +137,9 @@ in { format = "{stateIcon} {title} - {artist}"; format-paused = "{stateIcon}"; - format-stopped = ""; + format-stopped = "{stateIcon}"; state-icons = { + stopped = ""; paused = ""; playing = ""; }; @@ -162,12 +158,6 @@ in "sway/language" = { format = "{short} {variant}"; }; - "custom/controller-battery" = { - format = "{}"; - exec = lib.getExe pkgs.controller-battery; - interval = 1; - tooltip = false; - }; "custom/caffeine" = { format = "{}"; exec = "systemctl --user status swayidle > /dev/null && echo 󰒲 || echo 󰒳"; @@ -234,19 +224,23 @@ in }; } ]; - style = pkgs.replaceVars ./style.css { - accent_color = accent.color; + style = builtins.readFile ( + pkgs.substituteAll { + src = ./style.css; - color_bg = color.bg; - color_bg_dark = color.bg_dark; - color_bg_light = color.bg_light; - color_txt = color.txt; + accent_color = accent.color; - font_interface = font.interface; + color_bg = color.bg; + color_bg_dark = color.bg_dark; + color_bg_light = color.bg_light; + color_txt = color.txt; - font_size_big = "${toString font.size.big}px"; - font_size_medium = "${toString font.size.medium}px"; - }; + font_interface = font.interface; + + font_size_big = "${toString font.size.big}px"; + font_size_medium = "${toString font.size.medium}px"; + } + ); }; home.packages = with pkgs; [ waybar ]; }; diff --git a/user/waybar/style.css b/user/waybar/style.css index 36c6ebd..f9c0fb1 100644 --- a/user/waybar/style.css +++ b/user/waybar/style.css @@ -37,7 +37,6 @@ window#waybar.solo { #mpd, #custom-mpd, #custom-playerctl, -#custom-controller-battery, #tray, #clock, #network, diff --git a/user/xdg-dirs.nix b/user/xdg-dirs.nix index c4036c2..a9e1c9b 100644 --- a/user/xdg-dirs.nix +++ b/user/xdg-dirs.nix @@ -1,5 +1,8 @@ { config, + pkgs, + lib, + inputs, ... }: let @@ -21,4 +24,9 @@ in videos = "${HOME}/Vídeos"; }; }; + + home.sessionVariables = { + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; + }; } diff --git a/user/zathura.nix b/user/zathura.nix index ae8e003..70e1c23 100644 --- a/user/zathura.nix +++ b/user/zathura.nix @@ -1,4 +1,10 @@ -{ config, lib, ... }: +{ + config, + pkgs, + lib, + font, + ... +}: let inherit (config.my) key @@ -7,62 +13,56 @@ let theme ; inherit (theme) color; - - cfg = config.my.zathura; in { - options.my.zathura.enable = lib.mkEnableOption { }; + config = { + programs.zathura.enable = true; + programs.zathura.options = { + font = "${font.mono} ${toString font.size.small}"; + guioptions = "s"; - config = lib.mkIf cfg.enable { - programs.zathura = { - enable = true; - options = { - font = "${font.mono} ${toString font.size.small}"; - guioptions = "s"; + selection-clipboard = "clipboard"; - selection-clipboard = "clipboard"; + recolor = true; + # Turn images grayscale, so they don't look weird + recolor-keephue = false; + recolor-lightcolor = "rgba(0,0,0,0)"; + recolor-darkcolor = color.txt; - recolor = true; - # Turn images grayscale, so they don't look weird - recolor-keephue = false; - recolor-lightcolor = "rgba(0,0,0,0)"; - recolor-darkcolor = color.txt; + default-bg = color.bg_dark; - default-bg = color.bg_dark; + inputbar-bg = color.bg_dark; + inputbar-fg = color.txt; - inputbar-bg = color.bg_dark; - inputbar-fg = color.txt; + statusbar-bg = color.bg; + statusbar-fg = color.txt; - statusbar-bg = color.bg; - statusbar-fg = color.txt; + completion-bg = color.bg; + completion-fg = color.txt; - completion-bg = color.bg; - completion-fg = color.txt; + completion-group-bg = color.bg_dark; + completion-group-fg = color.txt; - completion-group-bg = color.bg_dark; - completion-group-fg = color.txt; + completion-highlight-bg = accent.color; + completion-highlight-fg = accent.fg; - completion-highlight-bg = accent.color; - completion-highlight-fg = accent.fg; - - index-active-bg = accent.color; - index-active-fg = accent.fg; - }; - mappings = { - "" = "toggle_statusbar"; - ${key.left} = "scroll left"; - ${key.down} = "scroll down"; - ${key.up} = "scroll up"; - ${key.right} = "scroll right"; - "[index] ${key.left}" = "navigate_index collapse"; - "[index] ${key.down}" = "navigate_index down"; - "[index] ${key.up}" = "navigate_index up"; - "[index] ${key.right}" = "navigate_index expand"; - ${lib.toUpper key.down} = "navigate next"; - ${lib.toUpper key.up} = "navigate previous"; - ${key.next} = "search forward"; - ${lib.toUpper key.next} = "search backward"; - }; + index-active-bg = accent.color; + index-active-fg = accent.fg; + }; + programs.zathura.mappings = { + "" = "toggle_statusbar"; + ${key.left} = "scroll left"; + ${key.down} = "scroll down"; + ${key.up} = "scroll up"; + ${key.right} = "scroll right"; + "[index] ${key.left}" = "navigate_index collapse"; + "[index] ${key.down}" = "navigate_index down"; + "[index] ${key.up}" = "navigate_index up"; + "[index] ${key.right}" = "navigate_index expand"; + ${lib.toUpper key.down} = "navigate next"; + ${lib.toUpper key.up} = "navigate previous"; + ${key.next} = "search forward"; + ${lib.toUpper key.next} = "search backward"; }; }; }