diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..cc28114 --- /dev/null +++ b/README.md @@ -0,0 +1,111 @@ +# Wyrdgard + + + Nix Flakes Ready + + + Built With Snowfall + + +My all-inclusive nix flake to solve all my problems. + + +> [!WARNING] +> Do not just use this repo out of the box since it will not work for your setup (or at least it probably wont work) +> Feel free to copy any parts you find interesting or useful, but I would recommend building your flake up from scratch as it will allow for easier bughunting. + +![hyprlock_screenshot](./modules/nixos/desktop/addons/hyprlock/hyprlock_preview.png) + + +## Repository Overview + +- [homes](#homes) +- [lib](#lib) +- [modules](#modules) +- [overlays](#overlays) +- [secrets](#secrets) +- [shells](#shells) +- [systems](#systems) + +Starting your nix journey can be daunting and understanding how the whole ecosystem works takes some time. +For me starting with snowfall-lib was both a blessing and a curse, it took away so many problempoints by being easy, but it also hampered my learning because I never had to do things from scratch and sometimes translating a "normal" flake to a snowfall-lib setup was not trivial. +Luckily for me Jake (the creator of snowfall-lib) was so kind and helped me bugfix and learn how to solve my own Problems. + + +### homes + +The homes folder is home to all your homemanager configuration that is specific to that system (and user) and that system only. +If you want generic home manager configuration then look into [modules/home](modules/home/README.md). + +- home/system/user@hostname syntax + +I dont really use this besides for testing out some apps, most of the things get turned into generic modules so I can eventually reuse them later. + +For more extensive explainations checkout [snowfall-lib/homes](https://snowfall.org/guides/lib/homes/)! + +### lib + +- extending lib +- any things defined here can be accessed vial `inherit (lib.${namespace})` + +Mine is straight ripped from [here](https://github.com/jakehamilton/config/blob/main/lib/module/default.nix), as I have not found much use for this outside of these options, maybe at some point. + +For more extensive explainations checkout [snowfall-lib/lib](https://snowfall.org/guides/lib/library/)! + +### [modules](./modules/README.md) + +This is the most interesting section of the flake, here I (and other users of snowfall-lib) define the packages that are available to your configuration. +there are 3 main categories + +- nixos `general system packages` +- home `general homemanager packages` +- darwin `general mac packages (tho at this point in time I do not have a mac)` + +Most of my configuration happens in this section and this is also where the different snowfall-lib repos diverge, some aspects are still fairly close to Jakes as that is what I started with, but some areas are more mature and now more my own style. +For more concrete information abotu my system specific setup read [here](/modules/nixos/README.md). + +For more extensive explainations checkout [snowfall-lib/modules](https://snowfall.org/guides/lib/homes/)! + +### [overlays](./overlays/README.md) + +- overlays provided by this flake + +For more extensive explainations checkout [snowfall-lib/overlays](https://snowfall.org/guides/lib/overlays/)! + +### secrets + +- secrets used currently only one file + +> [!IMPORTANT] +> This uses [sops-nix](https://github.com/Mic92/sops-nix) to encrypt sensitive information you need in your flake, never have secrets or password unencrypted in your repo, not even if it is private + + +### [shells](./shells/README.md) + +This is also fairly interesting and a section I have not delved in too much, currently I only have a rust flake for [screeps-rust](https://github.com/Daholli/screeps-rust) in here. +I think thi sis great to have quick access to a out of the box dev shell, but generally you probably want a project specific flake. + +You can access these flakes either using `self#rust` or in my case `github:Daholli/nixos-config#rust`. + + +For more extensive explainations checkout [snowfall-lib/shells](https://snowfall.org/guides/lib/shells/)! + +### systems + +- all the systems that can be built with the flake +- systems/system/hostname syntax + +This is the heart piece of the flake, this is what is being targeted if you call `nixos-rebuild switch --flake .#` I try to only have very system specific config in here and try to cover all the other things in the [generic part of the flake](/modules/nixos/README.md). +If you want to start piecing together how my config works this is where you would start. + +For more extensive explainations checkout [snowfall-lib/systems](https://snowfall.org/guides/lib/systemns/)! + +
+
+ +## inspirations and thanks + +Most of this config draws inspiration from this config: +[https://github.com/jakehamilton/config](https://github.com/jakehamilton/config) + + diff --git a/flake.lock b/flake.lock index f40b388..9c65bb7 100644 --- a/flake.lock +++ b/flake.lock @@ -55,8 +55,7 @@ "devenv" ], "flake-compat": [ - "devenv", - "flake-compat" + "devenv" ], "git-hooks": [ "devenv", @@ -68,11 +67,11 @@ ] }, "locked": { - "lastModified": 1760971495, - "narHash": "sha256-IwnNtbNVrlZIHh7h4Wz6VP0Furxg9Hh0ycighvL5cZc=", + "lastModified": 1752264895, + "narHash": "sha256-1zBPE/PNAkPNUsOWFET4J0cjlvziH8DOekesDmjND+w=", "owner": "cachix", "repo": "cachix", - "rev": "c5bfd933d1033672f51a863c47303fc0e093c2d2", + "rev": "47053aef762f452e816e44eb9a23fbc3827b241a", "type": "github" }, "original": { @@ -87,11 +86,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1761553912, - "narHash": "sha256-3UOEQPBlZo9OixT9L1zoD67QheopTG8/EfRPGKyP9bg=", + "lastModified": 1760953099, + "narHash": "sha256-sOKx2YcHa+lWEvaEOIGqLN2WWk1Wf5z6KM02tdfhMtw=", "owner": "catppuccin", "repo": "nix", - "rev": "7b42c91911c143ae3ea32a79cc8582b5920f24e3", + "rev": "f5b21876888265d2fee7fb0640d1b66a1c1c6503", "type": "github" }, "original": { @@ -110,11 +109,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1761583935, - "narHash": "sha256-vJ0ylFdPPESUCBYZvEtVmVemSp4G0WH8CbVIkboHIJs=", + "lastModified": 1761156818, + "narHash": "sha256-IScY9PpnF48Q/Z17YG5/ZcYWiWOkY2zCKLqsx1CJESM=", "owner": "cachix", "repo": "devenv", - "rev": "b7e3b2aeb90ce37517fb8da09ceff8ab587a9fcf", + "rev": "949fc6dc8f36f38e1cceb1bf1673c4e995a6a766", "type": "github" }, "original": { @@ -131,11 +130,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1761547629, - "narHash": "sha256-4OH1CVm2PdjKRqEJ3RLfkQMDSBdn7VId6iyYCwKOK+U=", + "lastModified": 1761115517, + "narHash": "sha256-Fev/ag/c3Fp3JBwHfup3lpA5FlNXfkoshnQ7dssBgJ0=", "owner": "nix-community", "repo": "fenix", - "rev": "d82a7c64ea441e397914577c9a18f2867e5b364b", + "rev": "320433651636186ea32b387cff05d6bbfa30cea7", "type": "github" }, "original": { @@ -211,11 +210,11 @@ "flake-compat_5": { "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": { @@ -248,29 +247,11 @@ ] }, "locked": { - "lastModified": 1760948891, - "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1760948891, - "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", + "rev": "4524271976b625a4a605beefd893f270620fd751", "type": "github" }, "original": { @@ -280,6 +261,43 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils-plus": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1715533576, + "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_4" }, @@ -310,11 +328,11 @@ ] }, "locked": { - "lastModified": 1760663237, - "narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=", + "lastModified": 1758108966, + "narHash": "sha256-ytw7ROXaWZ7OfwHrQ9xvjpUWeGVm86pwnEd1QhzawIo=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37", + "rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b", "type": "github" }, "original": { @@ -324,34 +342,12 @@ } }, "git-hooks_2": { - "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1760663237, - "narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "git-hooks_3": { "inputs": { "flake-compat": [ "simple-nixos-mailserver", "flake-compat" ], - "gitignore": "gitignore_4", + "gitignore": "gitignore_3", "nixpkgs": [ "simple-nixos-mailserver", "nixpkgs" @@ -394,27 +390,6 @@ } }, "gitignore_2": { - "inputs": { - "nixpkgs": [ - "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" - } - }, - "gitignore_3": { "inputs": { "nixpkgs": [ "hyprland", @@ -436,7 +411,7 @@ "type": "github" } }, - "gitignore_4": { + "gitignore_3": { "inputs": { "nixpkgs": [ "simple-nixos-mailserver", @@ -458,7 +433,7 @@ "type": "github" } }, - "gitignore_5": { + "gitignore_4": { "inputs": { "nixpkgs": [ "zls", @@ -503,11 +478,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1761440613, - "narHash": "sha256-eQTH5iTkEQptZqVGyTPgpMYL7zj6QkI/uGo+1/PkAQY=", + "lastModified": 1761141169, + "narHash": "sha256-5IZjbTvP5dNTD8CbEYlNbicdGcbCN9SC9ksMm2ZEXH0=", "owner": "helix-editor", "repo": "helix", - "rev": "7c4ff9c39dbd3dd7d6e2cb3e26cb34212202bb1b", + "rev": "d79cce4e4bfc24dd204f1b294c899ed73f7e9453", "type": "github" }, "original": { @@ -523,11 +498,11 @@ ] }, "locked": { - "lastModified": 1761584077, - "narHash": "sha256-dISPEZahlfs5K6d58zR4akRRyogfE9P4WSyPPNT7HiE=", + "lastModified": 1761191301, + "narHash": "sha256-xsRL2Oyb4YRZZ1Tu4WzR2uFg1n931bH+PfLdFcqtLg8=", "owner": "nix-community", "repo": "home-manager", - "rev": "e82585308aef3d4cc2c36c7b6946051c8cdf24ef", + "rev": "4958aafe7b237dc1e857fb0c916efff72075048f", "type": "github" }, "original": { @@ -683,11 +658,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1761572054, - "narHash": "sha256-NuDXgcyWa9EfQZXs+7mXKTimzlxEdLV0kJR6gGcFU/8=", + "lastModified": 1761129162, + "narHash": "sha256-vJYlThaqdSYRKn1HcaMbkHeB95bXQwgG1ugrlSKQjHg=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "560c53d87dedf7df8185eb370cfbf3575826e85c", + "rev": "057695bc3f7de5e8841c15252fc51029590895e4", "type": "github" }, "original": { @@ -713,11 +688,11 @@ ] }, "locked": { - "lastModified": 1761249285, - "narHash": "sha256-70dEwL5p3CB/00ODs2RHWUKTyafB+PF4Ld7IEMuO+no=", + "lastModified": 1760659005, + "narHash": "sha256-wyS6tXYJuzbwckOeaCoRtT4qIG2UZ0YvSZx7EBNjTV0=", "owner": "hyprwm", "repo": "hyprland-plugins", - "rev": "81f6d1426537981fcbb921f8b5e470b1280ef8f3", + "rev": "a5a6f93d72d5fb37e78b98c756cfd8b340e71a19", "type": "github" }, "original": { @@ -1002,18 +977,37 @@ "type": "github" } }, - "import-tree": { + "libcamera-src": { + "flake": false, "locked": { - "lastModified": 1761120675, - "narHash": "sha256-TEbh9zISiQcU82VwVoEbmXHnSGlUxTwvjJA9g9ErSDA=", - "owner": "vic", - "repo": "import-tree", - "rev": "a037ed2a58fc0ebed9e93b9ef79b0646e648f719", + "lastModified": 1725630279, + "narHash": "sha256-KH30jmHfxXq4j2CL7kv18DYECJRp9ECuWNPnqPZajPA=", + "owner": "raspberrypi", + "repo": "libcamera", + "rev": "69a894c4adad524d3063dd027f5c4774485cf9db", "type": "github" }, "original": { - "owner": "vic", - "repo": "import-tree", + "owner": "raspberrypi", + "repo": "libcamera", + "rev": "69a894c4adad524d3063dd027f5c4774485cf9db", + "type": "github" + } + }, + "libpisp-src": { + "flake": false, + "locked": { + "lastModified": 1724944683, + "narHash": "sha256-Fo2UJmQHS855YSSKKmGrsQnJzXog1cdpkIOO72yYAM4=", + "owner": "raspberrypi", + "repo": "libpisp", + "rev": "28196ed6edcfeda88d23cc5f213d51aa6fa17bb3", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "v1.0.7", + "repo": "libpisp", "type": "github" } }, @@ -1037,70 +1031,6 @@ "type": "github" } }, - "niri": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": [] - }, - "locked": { - "lastModified": 1761460429, - "narHash": "sha256-pJeM23DGMD5AK4gdNaDM1qsIv87NYQJgEh2E8tRd7es=", - "owner": "YaLTeR", - "repo": "niri", - "rev": "e6f3c538da0c646bda43fcde7ef7dc3b771e0c8b", - "type": "github" - }, - "original": { - "owner": "YaLTeR", - "repo": "niri", - "type": "github" - } - }, - "niri-flake": { - "inputs": { - "niri-stable": [ - "niri" - ], - "niri-unstable": "niri-unstable", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable", - "xwayland-satellite-stable": "xwayland-satellite-stable", - "xwayland-satellite-unstable": "xwayland-satellite-unstable" - }, - "locked": { - "lastModified": 1761542689, - "narHash": "sha256-l4TQRcQyp6hoUVQL/R4UBHvYX9whHTntaz5NxHi0PH4=", - "owner": "sodiboo", - "repo": "niri-flake", - "rev": "75768e54ca2591bb0be17fa310992628e5efce2d", - "type": "github" - }, - "original": { - "owner": "sodiboo", - "repo": "niri-flake", - "type": "github" - } - }, - "niri-unstable": { - "flake": false, - "locked": { - "lastModified": 1761460429, - "narHash": "sha256-pJeM23DGMD5AK4gdNaDM1qsIv87NYQJgEh2E8tRd7es=", - "owner": "YaLTeR", - "repo": "niri", - "rev": "e6f3c538da0c646bda43fcde7ef7dc3b771e0c8b", - "type": "github" - }, - "original": { - "owner": "YaLTeR", - "repo": "niri", - "type": "github" - } - }, "nix": { "inputs": { "flake-compat": [ @@ -1148,11 +1078,11 @@ ] }, "locked": { - "lastModified": 1761554027, - "narHash": "sha256-LMnsUobJtqhNnHc9FAp4V/MPMb82+YiXnjbUreg/0n8=", + "lastModified": 1760948931, + "narHash": "sha256-guAocn26kDPdkl6tPXJt5pPaIIsrGI4taw+1U3+FM7E=", "owner": "Mic92", "repo": "nix-ld", - "rev": "e7d1eba1d561ada0bdb1177ff5d7ce2f8447e974", + "rev": "a48b2dc9a256bcef9182f0f92c481de975302b1e", "type": "github" }, "original": { @@ -1178,17 +1108,17 @@ }, "nixos-wsl": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_3", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1761563673, - "narHash": "sha256-d+1TpVAmRjcNBfjZsh2yQSdwUfN7Xgz1blJ185g73+A=", + "lastModified": 1760536587, + "narHash": "sha256-wfWqt+igns/VazjPLkyb4Z/wpn4v+XIjUeI3xY/1ENg=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "a518cf710e5ebb935518dc7ac98e07e7ee5014c3", + "rev": "f98ee1de1fa36eca63c67b600f5d617e184e82ea", "type": "github" }, "original": { @@ -1245,33 +1175,18 @@ "type": "github" } }, - "nixpkgs-lib": { + "nixpkgs-master": { "locked": { - "lastModified": 1754788789, - "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1761468971, - "narHash": "sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8=", - "owner": "NixOS", + "lastModified": 1761197992, + "narHash": "sha256-Y27P0bnZGZY0Bw44+YtRTzbL7fBrLbzvpyDs/wJrCmI=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "78e34d1667d32d8a0ffc3eba4591ff256e80576e", + "rev": "43db7111c69a9cbd9a08c88567fd6bbf9631f137", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-25.05", + "owner": "nixos", + "ref": "master", "repo": "nixpkgs", "type": "github" } @@ -1294,11 +1209,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1761373498, - "narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=", + "lastModified": 1761114652, + "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce", + "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", "type": "github" }, "original": { @@ -1310,11 +1225,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1761313199, - "narHash": "sha256-wCIACXbNtXAlwvQUo1Ed++loFALPjYUA3dpcUJiXO44=", + "lastModified": 1758532697, + "narHash": "sha256-bhop0bR3u7DCw9/PtLCwr7GwEWDlBSxHp+eVQhCW9t4=", "owner": "cachix", "repo": "devenv-nixpkgs", - "rev": "d1c30452ebecfc55185ae6d1c983c09da0c274ff", + "rev": "207a4cb0e1253c7658c6736becc6eb9cace1f25f", "type": "github" }, "original": { @@ -1326,11 +1241,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1761373498, - "narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=", + "lastModified": 1761114652, + "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce", + "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", "type": "github" }, "original": { @@ -1373,22 +1288,6 @@ } }, "nixpkgs_6": { - "locked": { - "lastModified": 1761236834, - "narHash": "sha256-+pthv6hrL5VLW2UqPdISGuLiUZ6SnAXdd2DdUE+fV2Q=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d5faa84122bc0a1fd5d378492efce4e289f8eac1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { "locked": { "lastModified": 1755615617, "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", @@ -1406,8 +1305,8 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_3", - "gitignore": "gitignore_3", + "flake-compat": "flake-compat_2", + "gitignore": "gitignore_2", "nixpkgs": [ "hyprland", "nixpkgs" @@ -1427,13 +1326,42 @@ "type": "github" } }, + "raspberry-pi-nix": { + "inputs": { + "libcamera-src": "libcamera-src", + "libpisp-src": "libpisp-src", + "nixpkgs": [ + "nixpkgs" + ], + "rpi-bluez-firmware-src": "rpi-bluez-firmware-src", + "rpi-firmware-nonfree-src": "rpi-firmware-nonfree-src", + "rpi-firmware-src": "rpi-firmware-src", + "rpi-linux-6_10_12-src": "rpi-linux-6_10_12-src", + "rpi-linux-6_6_67-src": "rpi-linux-6_6_67-src", + "rpi-linux-stable-src": "rpi-linux-stable-src", + "rpicam-apps-src": "rpicam-apps-src", + "u-boot-src": "u-boot-src" + }, + "locked": { + "lastModified": 1738212544, + "narHash": "sha256-7gcdeZO0iQ6hxhZlhdENJGfFoZE1g5sZ/9STQTi+q9Q=", + "owner": "JamieMagee", + "repo": "raspberry-pi-nix", + "rev": "25118248489e047a7da43a21409b457aa2af315e", + "type": "github" + }, + "original": { + "owner": "JamieMagee", + "repo": "raspberry-pi-nix", + "rev": "25118248489e047a7da43a21409b457aa2af315e", + "type": "github" + } + }, "root": { "inputs": { "catppuccin": "catppuccin", "devenv": "devenv", "fenix": "fenix", - "flake-parts": "flake-parts_2", - "git-hooks": "git-hooks_2", "gpg-base-conf": "gpg-base-conf", "helix": "helix", "home-manager": "home-manager", @@ -1441,34 +1369,152 @@ "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", "hyprlock": "hyprlock", - "import-tree": "import-tree", "nh-flake": "nh-flake", - "niri": "niri", - "niri-flake": "niri-flake", "nix-ld": "nix-ld", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_3", "nixpkgs-latest-factorio": "nixpkgs-latest-factorio", + "nixpkgs-master": "nixpkgs-master", "nixpkgs-tuya-vacuum": "nixpkgs-tuya-vacuum", "nixpkgs-unstable": "nixpkgs-unstable", + "raspberry-pi-nix": "raspberry-pi-nix", "simple-nixos-mailserver": "simple-nixos-mailserver", + "snowfall-lib": "snowfall-lib", "sops-nix": "sops-nix", - "systems": "systems_3", - "treefmt-nix": "treefmt-nix", + "tuya-vaccum-maps": "tuya-vaccum-maps", "zen-browser": "zen-browser", "zig-overlay": "zig-overlay", "zls": "zls" } }, + "rpi-bluez-firmware-src": { + "flake": false, + "locked": { + "lastModified": 1708969706, + "narHash": "sha256-KakKnOBeWxh0exu44beZ7cbr5ni4RA9vkWYb9sGMb8Q=", + "owner": "RPi-Distro", + "repo": "bluez-firmware", + "rev": "78d6a07730e2d20c035899521ab67726dc028e1c", + "type": "github" + }, + "original": { + "owner": "RPi-Distro", + "ref": "bookworm", + "repo": "bluez-firmware", + "type": "github" + } + }, + "rpi-firmware-nonfree-src": { + "flake": false, + "locked": { + "lastModified": 1723266537, + "narHash": "sha256-T7eTKXqY9cxEMdab8Snda4CEOrEihy5uOhA6Fy+Mhnw=", + "owner": "RPi-Distro", + "repo": "firmware-nonfree", + "rev": "4b356e134e8333d073bd3802d767a825adec3807", + "type": "github" + }, + "original": { + "owner": "RPi-Distro", + "ref": "bookworm", + "repo": "firmware-nonfree", + "type": "github" + } + }, + "rpi-firmware-src": { + "flake": false, + "locked": { + "lastModified": 1728405098, + "narHash": "sha256-4gnK0KbqFnjBmWia9Jt2gveVWftmHrprpwBqYVqE/k0=", + "owner": "raspberrypi", + "repo": "firmware", + "rev": "7bbb5f80d20a2335066a8781459c9f33e5eebc64", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "1.20241008", + "repo": "firmware", + "type": "github" + } + }, + "rpi-linux-6_10_12-src": { + "flake": false, + "locked": { + "lastModified": 1728305462, + "narHash": "sha256-LtvNmGD1D5YYv+C9xxxddAeHw69o3OX/H9M7F663L74=", + "owner": "raspberrypi", + "repo": "linux", + "rev": "26ee50d56618c2d98100b1bc672fd201aed4d00f", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "rpi-6.10.y", + "repo": "linux", + "type": "github" + } + }, + "rpi-linux-6_6_67-src": { + "flake": false, + "locked": { + "lastModified": 1734790986, + "narHash": "sha256-q9swM2TmmuzbUuQnbLZk5PseKWD7/SNPwtth6bpGIqE=", + "owner": "raspberrypi", + "repo": "linux", + "rev": "811ff707533bcd67cdcd368bbd46223082009b12", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "rpi-6.6.y", + "repo": "linux", + "type": "github" + } + }, + "rpi-linux-stable-src": { + "flake": false, + "locked": { + "lastModified": 1728403745, + "narHash": "sha256-phCxkuO+jUGZkfzSrBq6yErQeO2Td+inIGHxctXbD5U=", + "owner": "raspberrypi", + "repo": "linux", + "rev": "5aeecea9f4a45248bcf564dec924965e066a7bfd", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "stable_20241008", + "repo": "linux", + "type": "github" + } + }, + "rpicam-apps-src": { + "flake": false, + "locked": { + "lastModified": 1727515047, + "narHash": "sha256-qCYGrcibOeGztxf+sd44lD6VAOGoUNwRqZDdAmcTa/U=", + "owner": "raspberrypi", + "repo": "rpicam-apps", + "rev": "a8ccf9f3cd9df49875dfb834a2b490d41d226031", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "v1.5.2", + "repo": "rpicam-apps", + "type": "github" + } + }, "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1761500479, - "narHash": "sha256-syeBTCCU96qPJHcVpwHeCwmPCiLTDHHgYQYhpZ0iwLo=", + "lastModified": 1761077270, + "narHash": "sha256-O1uTuvI/rUlubJ8AXKyzh1WSWV3qCZX0huTFUvWLN4E=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "049767e6faa84b2d1a951d8f227e6ebd99d728a2", + "rev": "39990a923c8bca38f5bd29dc4c96e20ee7808d5d", "type": "github" }, "original": { @@ -1502,8 +1548,8 @@ "simple-nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat_5", - "git-hooks": "git-hooks_3", + "flake-compat": "flake-compat_4", + "git-hooks": "git-hooks_2", "nixpkgs": "nixpkgs_4", "nixpkgs-25_05": "nixpkgs-25_05" }, @@ -1521,6 +1567,28 @@ "type": "gitlab" } }, + "snowfall-lib": { + "inputs": { + "flake-compat": "flake-compat_5", + "flake-utils-plus": "flake-utils-plus", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736130495, + "narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=", + "owner": "snowfallorg", + "repo": "lib", + "rev": "02d941739f98a09e81f3d2d9b3ab08918958beac", + "type": "github" + }, + "original": { + "owner": "snowfallorg", + "repo": "lib", + "type": "github" + } + }, "sops-nix": { "inputs": { "nixpkgs": "nixpkgs_5" @@ -1571,16 +1639,16 @@ }, "systems_3": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1599,24 +1667,35 @@ "type": "github" } }, - "treefmt-nix": { - "inputs": { - "nixpkgs": "nixpkgs_6" - }, + "tuya-vaccum-maps": { + "flake": false, "locked": { - "lastModified": 1761311587, - "narHash": "sha256-Msq86cR5SjozQGCnC6H8C+0cD4rnx91BPltZ9KK613Y=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "2eddae033e4e74bf581c2d1dfa101f9033dbd2dc", + "lastModified": 1752975474, + "narHash": "sha256-MTCOspRIjDKJkMPgwoKgTRtcc6rgJRGxDBwfMD/QZ7g=", + "owner": "jaidenlabelle", + "repo": "tuya-vacuum-maps", + "rev": "c8a96ff1afa62d6cec448f3b7cf6b869a50b20eb", "type": "github" }, "original": { - "owner": "numtide", - "repo": "treefmt-nix", + "owner": "jaidenlabelle", + "repo": "tuya-vacuum-maps", "type": "github" } }, + "u-boot-src": { + "flake": false, + "locked": { + "lastModified": 1719857238, + "narHash": "sha256-mJ2TBy0Y5ZtcGFgtU5RKr0UDUp5FWzojbFb+o/ebRJU=", + "type": "tarball", + "url": "https://ftp.denx.de/pub/u-boot/u-boot-2024.07.tar.bz2" + }, + "original": { + "type": "tarball", + "url": "https://ftp.denx.de/pub/u-boot/u-boot-2024.07.tar.bz2" + } + }, "xdph": { "inputs": { "hyprland-protocols": [ @@ -1658,50 +1737,17 @@ "type": "github" } }, - "xwayland-satellite-stable": { - "flake": false, - "locked": { - "lastModified": 1755491097, - "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "rev": "388d291e82ffbc73be18169d39470f340707edaa", - "type": "github" - }, - "original": { - "owner": "Supreeeme", - "ref": "v0.7", - "repo": "xwayland-satellite", - "type": "github" - } - }, - "xwayland-satellite-unstable": { - "flake": false, - "locked": { - "lastModified": 1761422250, - "narHash": "sha256-+pN8VAh8OVUSj8zPoI8QfC93JMIKPaAOABrbeeiO/Hk=", - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "rev": "2dd40ecfe882c1659e0e46c761974702c7ab5fde", - "type": "github" - }, - "original": { - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "type": "github" - } - }, "zen-browser": { "inputs": { "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1761535208, - "narHash": "sha256-E1PobJMiFmVUX2YdqYk/MpKb0LXavOYvlg8DCBBzlHc=", + "lastModified": 1761180075, + "narHash": "sha256-V4WLeUQ4gCGZiVihlXWBOZ/1FNcL0jM4zgTY1haJLvY=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "79a94872a3e6993a051c4e22a2dcb02c1d088acf", + "rev": "771a2604606905d8c0ffe3b818dc2cc5bd1405d8", "type": "github" }, "original": { @@ -1713,7 +1759,7 @@ "zig-overlay": { "inputs": { "flake-compat": "flake-compat_6", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -1734,7 +1780,7 @@ }, "zls": { "inputs": { - "gitignore": "gitignore_5", + "gitignore": "gitignore_4", "nixpkgs": [ "nixpkgs" ], @@ -1743,11 +1789,11 @@ ] }, "locked": { - "lastModified": 1761562676, - "narHash": "sha256-yREsDfqZ7JIC2hxQm94DQfNCyhm/KPdxWd3IVJ6zJ2s=", + "lastModified": 1760550770, + "narHash": "sha256-MIz62mvGfANGn4pPQV1DVocZPb2JTzyi1xDFYKzZOvc=", "owner": "zigtools", "repo": "zls", - "rev": "67177e3d64b8ab0f358303ee6ed4bac4654e2fdb", + "rev": "f486e884f479dd816f1c57a4be7f445f3d3b279c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4f704c1..3b86b98 100644 --- a/flake.nix +++ b/flake.nix @@ -1,26 +1,17 @@ { - description = "All encompassing flake"; - - nixConfig = { - allow-import-from-derivation = true; - }; - - outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); + description = "NixOs Config"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - systems.url = "github:nix-systems/default-linux"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - import-tree.url = "github:vic/import-tree"; - treefmt-nix.url = "github:numtide/treefmt-nix"; - + nixpkgs-master.url = "github:nixos/nixpkgs/master"; nixpkgs-latest-factorio.url = "github:Daholli/nixpkgs/e880129391be2f558d6c205cfd931be338b3b707"; nixpkgs-tuya-vacuum.url = "github:Daholli/nixpkgs/84b34e39e7a0879367189f34401191f6a0364bcf"; home-manager = { url = "github:nix-community/home-manager/master"; + # url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -62,21 +53,10 @@ }; ### - # Niri - niri = { - url = "github:YaLTeR/niri"; - inputs = { - nixpkgs.follows = "nixpkgs"; - rust-overlay.follows = ""; - }; - }; - - niri-flake = { - url = "github:sodiboo/niri-flake"; - inputs = { - niri-stable.follows = "niri"; - nixpkgs.follows = "nixpkgs"; - }; + # Snowfall dependencies + snowfall-lib = { + url = "github:snowfallorg/lib"; + inputs.nixpkgs.follows = "nixpkgs"; }; helix = { @@ -95,16 +75,25 @@ ## temporary zen-browser.url = "github:0xc000022070/zen-browser-flake"; - simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; - catppuccin.url = "github:catppuccin/nix"; - - ################ - ## inputs for dev shells - git-hooks = { - url = "github:cachix/git-hooks.nix"; + raspberry-pi-nix = { + url = "github:JamieMagee/raspberry-pi-nix/25118248489e047a7da43a21409b457aa2af315e"; inputs.nixpkgs.follows = "nixpkgs"; }; + simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; + catppuccin.url = "github:catppuccin/nix"; + + ############### + # homeassitant + + tuya-vaccum-maps = { + url = "github:jaidenlabelle/tuya-vacuum-maps"; + flake = false; + }; + + ################ + ## inputs for dev shells + # devenv = { url = "github:cachix/devenv"; # inputs.nixpkgs.follows = "nixpkgs"; @@ -129,4 +118,68 @@ }; }; + outputs = + inputs: + let + lib = inputs.snowfall-lib.mkLib { + inherit inputs; + src = ./.; + + snowfall = { + meta = { + name = "wyrdgard"; + title = "Wyrdgard"; + }; + + namespace = "wyrdgard"; + }; + }; + in + lib.mkFlake { + channels-config = { + allowUnfree = true; + }; + + outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; }; + + overlays = with inputs; [ + devenv.overlays.default + ]; + + homes.modules = with inputs; [ + sops-nix.homeManagerModules.sops + catppuccin.homeModules.catppuccin + ]; + + systems.modules.nixos = with inputs; [ + home-manager.nixosModules.home-manager + nix-ld.nixosModules.nix-ld + sops-nix.nixosModules.sops + + catppuccin.nixosModules.catppuccin + ]; + + systems.hosts.nixberry.modules = with inputs; [ + raspberry-pi-nix.nixosModules.raspberry-pi + raspberry-pi-nix.nixosModules.sd-image + ]; + + systems.hosts.loptland.modules = with inputs; [ + simple-nixos-mailserver.nixosModules.default + ]; + + systems.hosts.wsl.modules = with inputs; [ nixos-wsl.nixosModules.default ]; + } + // rec { + self = inputs.self; + + hydraJobs = { + # hosts = lib.mapAttrs (_: cfg: cfg.config.system.build.toplevel) ( + # lib.filterAttrs (name: cfg: name != "nixberry") self.outputs.nixosConfigurations + # ); + hosts = lib.mapAttrs (_: cfg: cfg.config.system.build.toplevel) self.outputs.nixosConfigurations; + packages = self.packages; + shells = lib.filterAttrs (name: shell: name == "x86_64-linux") self.devShells; + }; + }; } diff --git a/homes/aarch64-linux/cholli@nixberry/default.nix b/homes/aarch64-linux/cholli@nixberry/default.nix new file mode 100644 index 0000000..5f2a75c --- /dev/null +++ b/homes/aarch64-linux/cholli@nixberry/default.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + config, + osConfig ? { }, + format ? "unknown", + ... +}: +with lib.wyrdgard; +{ + wyrdgard = { + apps = { + kitty = enabled; + }; + + tools = { + direnv = enabled; + }; + }; + + home.stateVersion = "24.11"; +} diff --git a/homes/x86_64-linux/cholli@loptland/default.nix b/homes/x86_64-linux/cholli@loptland/default.nix new file mode 100644 index 0000000..694b9c7 --- /dev/null +++ b/homes/x86_64-linux/cholli@loptland/default.nix @@ -0,0 +1,20 @@ +{ + lib, + pkgs, + config, + osConfig ? { }, + format ? "unknown", + ... +}: +with lib.wyrdgard; +{ + wyrdgard = { + apps = { + kitty = enabled; + }; + + tools = { + direnv = enabled; + }; + }; +} diff --git a/homes/x86_64-linux/cholli@tmp/default.nix b/homes/x86_64-linux/cholli@tmp/default.nix new file mode 100644 index 0000000..cd0e3bb --- /dev/null +++ b/homes/x86_64-linux/cholli@tmp/default.nix @@ -0,0 +1,291 @@ +{ + lib, + pkgs, + config, + namespace, + osConfig ? { }, + format ? "unknown", + ... +}: +with lib.${namespace}; +{ + wyrdgard = { + apps = { + kitty = enabled; + }; + + tools = { + direnv = enabled; + }; + }; + + services.easyeffects = { + enable = true; + preset = "jtrv-preset"; + extraPresets = { + jtrv-preset = { + input = { + blocklist = [ + + ]; + "compressor#0" = { + attack = 5; + boost-amount = 6; + boost-threshold = -72; + bypass = false; + dry = -100; + hpf-frequency = 10; + hpf-mode = "off"; + input-gain = 0; + knee = -6; + lpf-frequency = 20000; + lpf-mode = "off"; + makeup = 0; + mode = "Downward"; + output-gain = 0; + ratio = 4; + release = 75; + release-threshold = -40; + sidechain = { + lookahead = 0; + mode = "RMS"; + preamp = 0; + reactivity = 10; + source = "Middle"; + stereo-split-source = "Left/Right"; + type = "Feed-forward"; + }; + stereo-split = false; + threshold = -20; + wet = 0; + }; + "deesser#0" = { + bypass = false; + detection = "RMS"; + f1-freq = 3000.0; + f1-level = -6.0; + f2-freq = 5000.0; + f2-level = -6.0; + f2-q = 1.5000000000000004; + input-gain = 0.0; + laxity = 15; + makeup = 0; + mode = "Wide"; + output-gain = 0; + ratio = 5; + sc-listen = false; + threshold = -20; + }; + "equalizer#0" = { + balance = 0; + bypass = false; + input-gain = 0; + left = { + band0 = { + frequency = 50; + gain = 3; + mode = "RLC (BT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-pass"; + width = 4; + }; + band1 = { + frequency = 90; + gain = 3; + mode = "RLC (MT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Lo-shelf"; + width = 4; + }; + band2 = { + frequency = 425; + gain = -2; + mode = "BWC (MT)"; + mute = false; + q = 0.9999999999999998; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band3 = { + frequency = 3500; + gain = 3; + mode = "BWC (BT)"; + mute = false; + q = 0.7; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band4 = { + frequency = 9000; + gain = 2; + mode = "LRX (MT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-shelf"; + width = 4; + }; + }; + mode = "IIR"; + num-bands = 5; + output-gain = 0; + pitch-left = 0; + pitch-right = 0; + right = { + band0 = { + frequency = 50; + gain = 3; + mode = "RLC (BT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-pass"; + width = 4; + }; + band1 = { + frequency = 90; + gain = 3; + mode = "RLC (MT)"; + mute = false; + q = 0.9999999999999998; + slope = "x1"; + solo = false; + type = "Lo-shelf"; + width = 4; + }; + band2 = { + frequency = 425; + gain = -2; + mode = "BWC (MT)"; + mute = false; + q = 0.7; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band3 = { + frequency = 3500; + gain = 3; + mode = "BWC (BT)"; + mute = false; + q = 0.7; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band4 = { + frequency = 9000; + gain = 2; + mode = "LRX (MT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-shelf"; + width = 4; + }; + }; + split-channels = false; + }; + "gate#0" = { + attack = 1; + bypass = false; + curve-threshold = -50; + curve-zone = -2; + dry = -100; + hpf-frequency = 10; + hpf-mode = "off"; + hysteresis = true; + hysteresis-threshold = -3; + hysteresis-zone = -1; + input-gain = 0; + lpf-frequency = 20000; + lpf-mode = "off"; + makeup = 1; + output-gain = 0; + reduction = -15; + release = 200; + sidechain = { + input = "Internal"; + lookahead = 0; + mode = "RMS"; + preamp = 0; + reactivity = 10; + source = "Middle"; + stereo-split-source = "Left/Right"; + }; + stereo-split = false; + wet = -1; + }; + "limiter#0" = { + alr = false; + alr-attack = 5; + alr-knee = 0; + alr-release = 50; + attack = 1; + bypass = false; + dithering = "16bit"; + external-sidechain = false; + gain-boost = true; + input-gain = 0; + lookahead = 5; + mode = "Herm Wide"; + output-gain = 0; + oversampling = "Half x2(2L)"; + release = 5; + sidechain-preamp = 0; + stereo-link = 100; + threshold = -1; + }; + plugins_order = [ + "rnnoise#0" + "gate#0" + "deesser#0" + "compressor#0" + "equalizer#0" + "speex#0" + "limiter#0" + ]; + "rnnoise#0" = { + bypass = false; + enable-vad = false; + input-gain = 0; + model-path = ""; + output-gain = 0; + release = 20; + vad-thres = 50; + wet = 0; + }; + "speex#0" = { + bypass = false; + enable-agc = false; + enable-denoise = false; + enable-dereverb = false; + input-gain = 0; + noise-suppression = -70; + output-gain = 0; + vad = { + enable = true; + probability-continue = 90; + probability-start = 95; + }; + }; + }; + }; + }; + }; +} diff --git a/homes/x86_64-linux/cholli@wsl/default.nix b/homes/x86_64-linux/cholli@wsl/default.nix new file mode 100644 index 0000000..5c51eb5 --- /dev/null +++ b/homes/x86_64-linux/cholli@wsl/default.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + config, + osConfig ? { }, + format ? "unknown", + ... +}: +with lib.wyrdgard; +{ + wyrdgard = { + apps = { + kitty = enabled; + }; + + tools = { + direnv = enabled; + }; + }; + + home.packages = with pkgs; [ diebahn ]; +} diff --git a/homes/x86_64-linux/cholli@yggdrasil/default.nix b/homes/x86_64-linux/cholli@yggdrasil/default.nix new file mode 100644 index 0000000..cd0e3bb --- /dev/null +++ b/homes/x86_64-linux/cholli@yggdrasil/default.nix @@ -0,0 +1,291 @@ +{ + lib, + pkgs, + config, + namespace, + osConfig ? { }, + format ? "unknown", + ... +}: +with lib.${namespace}; +{ + wyrdgard = { + apps = { + kitty = enabled; + }; + + tools = { + direnv = enabled; + }; + }; + + services.easyeffects = { + enable = true; + preset = "jtrv-preset"; + extraPresets = { + jtrv-preset = { + input = { + blocklist = [ + + ]; + "compressor#0" = { + attack = 5; + boost-amount = 6; + boost-threshold = -72; + bypass = false; + dry = -100; + hpf-frequency = 10; + hpf-mode = "off"; + input-gain = 0; + knee = -6; + lpf-frequency = 20000; + lpf-mode = "off"; + makeup = 0; + mode = "Downward"; + output-gain = 0; + ratio = 4; + release = 75; + release-threshold = -40; + sidechain = { + lookahead = 0; + mode = "RMS"; + preamp = 0; + reactivity = 10; + source = "Middle"; + stereo-split-source = "Left/Right"; + type = "Feed-forward"; + }; + stereo-split = false; + threshold = -20; + wet = 0; + }; + "deesser#0" = { + bypass = false; + detection = "RMS"; + f1-freq = 3000.0; + f1-level = -6.0; + f2-freq = 5000.0; + f2-level = -6.0; + f2-q = 1.5000000000000004; + input-gain = 0.0; + laxity = 15; + makeup = 0; + mode = "Wide"; + output-gain = 0; + ratio = 5; + sc-listen = false; + threshold = -20; + }; + "equalizer#0" = { + balance = 0; + bypass = false; + input-gain = 0; + left = { + band0 = { + frequency = 50; + gain = 3; + mode = "RLC (BT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-pass"; + width = 4; + }; + band1 = { + frequency = 90; + gain = 3; + mode = "RLC (MT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Lo-shelf"; + width = 4; + }; + band2 = { + frequency = 425; + gain = -2; + mode = "BWC (MT)"; + mute = false; + q = 0.9999999999999998; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band3 = { + frequency = 3500; + gain = 3; + mode = "BWC (BT)"; + mute = false; + q = 0.7; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band4 = { + frequency = 9000; + gain = 2; + mode = "LRX (MT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-shelf"; + width = 4; + }; + }; + mode = "IIR"; + num-bands = 5; + output-gain = 0; + pitch-left = 0; + pitch-right = 0; + right = { + band0 = { + frequency = 50; + gain = 3; + mode = "RLC (BT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-pass"; + width = 4; + }; + band1 = { + frequency = 90; + gain = 3; + mode = "RLC (MT)"; + mute = false; + q = 0.9999999999999998; + slope = "x1"; + solo = false; + type = "Lo-shelf"; + width = 4; + }; + band2 = { + frequency = 425; + gain = -2; + mode = "BWC (MT)"; + mute = false; + q = 0.7; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band3 = { + frequency = 3500; + gain = 3; + mode = "BWC (BT)"; + mute = false; + q = 0.7; + slope = "x2"; + solo = false; + type = "Bell"; + width = 4; + }; + band4 = { + frequency = 9000; + gain = 2; + mode = "LRX (MT)"; + mute = false; + q = 0.7; + slope = "x1"; + solo = false; + type = "Hi-shelf"; + width = 4; + }; + }; + split-channels = false; + }; + "gate#0" = { + attack = 1; + bypass = false; + curve-threshold = -50; + curve-zone = -2; + dry = -100; + hpf-frequency = 10; + hpf-mode = "off"; + hysteresis = true; + hysteresis-threshold = -3; + hysteresis-zone = -1; + input-gain = 0; + lpf-frequency = 20000; + lpf-mode = "off"; + makeup = 1; + output-gain = 0; + reduction = -15; + release = 200; + sidechain = { + input = "Internal"; + lookahead = 0; + mode = "RMS"; + preamp = 0; + reactivity = 10; + source = "Middle"; + stereo-split-source = "Left/Right"; + }; + stereo-split = false; + wet = -1; + }; + "limiter#0" = { + alr = false; + alr-attack = 5; + alr-knee = 0; + alr-release = 50; + attack = 1; + bypass = false; + dithering = "16bit"; + external-sidechain = false; + gain-boost = true; + input-gain = 0; + lookahead = 5; + mode = "Herm Wide"; + output-gain = 0; + oversampling = "Half x2(2L)"; + release = 5; + sidechain-preamp = 0; + stereo-link = 100; + threshold = -1; + }; + plugins_order = [ + "rnnoise#0" + "gate#0" + "deesser#0" + "compressor#0" + "equalizer#0" + "speex#0" + "limiter#0" + ]; + "rnnoise#0" = { + bypass = false; + enable-vad = false; + input-gain = 0; + model-path = ""; + output-gain = 0; + release = 20; + vad-thres = 50; + wet = 0; + }; + "speex#0" = { + bypass = false; + enable-agc = false; + enable-denoise = false; + enable-dereverb = false; + input-gain = 0; + noise-suppression = -70; + output-gain = 0; + vad = { + enable = true; + probability-continue = 90; + probability-start = 95; + }; + }; + }; + }; + }; + }; +} diff --git a/lib/module/default.nix b/lib/module/default.nix new file mode 100644 index 0000000..14333a9 --- /dev/null +++ b/lib/module/default.nix @@ -0,0 +1,63 @@ +{ lib, ... }: +with lib; +rec { + ## Create a NixOS module option. + ## + ## ```nix + ## lib.mkOpt nixpkgs.lib.types.str "My default" "Description of my option." + ## ``` + ## + #@ Type -> Any -> String + mkOpt = + type: default: description: + mkOption { inherit type default description; }; + + ## Create a NixOS module option without a description. + ## + ## ```nix + ## lib.mkOpt' nixpkgs.lib.types.str "My default" + ## ``` + ## + #@ Type -> Any -> String + mkOpt' = type: default: mkOpt type default null; + + ## Create a boolean NixOS module option. + ## + ## ```nix + ## lib.mkBoolOpt true "Description of my option." + ## ``` + ## + #@ Type -> Any -> String + mkBoolOpt = mkOpt types.bool; + + ## Create a boolean NixOS module option without a description. + ## + ## ```nix + ## lib.mkBoolOpt true + ## ``` + ## + #@ Type -> Any -> String + mkBoolOpt' = mkOpt' types.bool; + + enabled = { + ## Quickly enable an option. + ## + ## ```nix + ## services.nginx = enabled; + ## ``` + ## + #@ true + enable = true; + }; + + disabled = { + ## Quickly disable an option. + ## + ## ```nix + ## services.nginx = enabled; + ## ``` + ## + #@ false + enable = false; + }; +} diff --git a/modules/README.md b/modules/README.md new file mode 100644 index 0000000..e67034e --- /dev/null +++ b/modules/README.md @@ -0,0 +1,14 @@ +## Modules Part of the Flake + +## [nixos](./nixos/README.md) + +All the system configuration should go in here + +## [home](./home/README.md) + +All the home-manager configuration should go in here + +## [darwin](./darwin/README.md) + +> [!NOTE] +> I currently do not own a mac so I have not set up a mac specific configuration diff --git a/modules/apps/1password.nix b/modules/apps/1password.nix deleted file mode 100644 index f519112..0000000 --- a/modules/apps/1password.nix +++ /dev/null @@ -1,30 +0,0 @@ -topLevel: { - flake.modules = { - nixos._1password = - { ... }: - { - programs = { - _1password.enable = true; - _1password-gui = { - enable = true; - polkitPolicyOwners = [ topLevel.config.flake.meta.users.cholli.username ]; - }; - }; - }; - - homeManager.cholli = - { lib, osConfig, ... }: - { - home.file = lib.mkIf osConfig.programs._1password.enable { - ".ssh/config".text = '' - Host * - ForwardAgent yes - IdentityAgent /home/cholli/.1password/agent.sock - - Host loptland - Hostname christophhollizeck.dev - ''; - }; - }; - }; -} diff --git a/modules/base/fish.nix b/modules/base/fish.nix deleted file mode 100644 index 07424dc..0000000 --- a/modules/base/fish.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - flake.modules = { - nixos.base = - { pkgs, ... }: - { - environment.systemPackages = with pkgs; [ - fastfetch - - fd - tree - ripgrep - fzf - eza - - #optional - pciutils - usbutils - btop - - zip - unzip - nettools - ]; - }; - - homeManager.base = - { lib, pkgs, ... }: - { - catppuccin.fish.enable = true; - - programs = { - fish = { - enable = true; - shellInit = '' - set -x LESS_TERMCAP_mb \e'[01;32m' - set -x LESS_TERMCAP_md \e'[01;32m' - set -x LESS_TERMCAP_me \e'[0m' - set -x LESS_TERMCAP_se \e'[0m' - set -x LESS_TERMCAP_so \e'[01;47;34m' - set -x LESS_TERMCAP_ue \e'[0m' - set -x LESS_TERMCAP_us \e'[01;36m' - set -x LESS -R - set -x GROFF_NO_SGR 1 - ''; - shellAliases = { - vim = "hx"; - ls = "eza -lah --icons --git"; - lss = "ls --total-size"; - lt = "ls -T --git-ignore"; - }; - functions = { - checkHash = "nix hash to-sri --type sha256 $(nix-prefetch-url --unpack $argv)"; - deployNixberry = "nixos-rebuild switch --flake .#nixberry --target-host nixberry --sudo --ask-sudo-password"; - deployLoptland = "nixos-rebuild switch --flake .#loptland --target-host christophhollizeck.dev --sudo --ask-sudo-password"; - checkPR = ''cd /home/cholli/projects/nixpkgs && ${lib.getExe pkgs.nixpkgs-review} pr $argv --post-result --systems "x86_64-linux aarch64-linux"''; - }; - plugins = with pkgs.fishPlugins; [ - { - name = "forgit"; - src = forgit.src; - } - ]; - }; - - zoxide = { - enable = true; - options = [ "--cmd cd" ]; - }; - - }; - }; - }; -} diff --git a/modules/base/git.nix b/modules/base/git.nix deleted file mode 100644 index 4917fce..0000000 --- a/modules/base/git.nix +++ /dev/null @@ -1,129 +0,0 @@ -topLevel: { - flake.modules = { - nixos.base = - { pkgs, ... }: - { - environment.systemPackages = with pkgs; [ - git - ]; - - }; - - homeManager.cholli = - { - config, - lib, - ... - }: - let - username = topLevel.config.flake.meta.users.cholli.username; - in - { - programs.git = { - enable = true; - lfs.enable = true; - signing = { - key = topLevel.config.flake.meta.users.cholli.key; - signByDefault = true; - }; - ignores = [ - ".direnv/" - ".devenv/" - "result" - ]; - - settings = { - user = { - name = topLevel.config.flake.meta.users.cholli.name; - email = topLevel.config.flake.meta.users.cholli.email; - }; - core = { - fsmonitor = true; - }; - init = { - defaultBranch = "main"; - }; - pull = { - rebase = true; - }; - push = { - autoSetupRemote = true; - }; - rebase = { - autoStash = true; - }; - safe = { - directory = "/home/${username}/projects/config"; - }; - maintenance = { - repo = [ - "home/${username}/projects/nixpkgs" - "home/${username}/projects/config" - ]; - strategy = "incremental"; - }; - lfs."https://git.christophhollizeck.dev/Daholli/nixos-config.git/info/lfs".locksverify = true; - }; - }; - - systemd.user = { - services."git-maintenance@" = { - Unit = { - Description = "Optimize Git repositories data"; - }; - Service = { - Type = "oneshot"; - ExecStart = ''"${lib.getExe config.programs.git.package}" --exec-path="${lib.getBin config.programs.git.package}/bin" -c credential.interactive=false -c core.askPass=true for-each-repo --config=maintenance.repo maintenance run --schedule=%i''; - LockPersonality = "yes"; - MemoryDenyWriteExecute = "yes"; - NoNewPrivileges = "yes"; - RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_VSOCK"; - RestrictNamespaces = "yes"; - RestrictRealtime = "yes"; - RestrictSUIDSGID = "yes"; - SystemCallArchitectures = "native"; - SystemCallFilter = "@system-service"; - }; - }; - timers = { - "git-maintenance@hourly" = { - Unit = { - Description = "Optimize Git repositories data"; - }; - Timer = { - OnCalendar = "*-*-* *:00:00"; - Persistent = true; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; - "git-maintenance@daily" = { - Unit = { - Description = "Optimize Git repositories data"; - }; - Timer = { - OnCalendar = "*-*-* 20:00:00"; - Persistent = true; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; - "git-maintenance@weekly" = { - Unit = { - Description = "Optimize Git repositories data"; - }; - Timer = { - OnCalendar = "Sun *-*-* 20:00:00"; - Persistent = true; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; - }; - }; - }; - }; -} diff --git a/modules/base/home.nix b/modules/base/home.nix deleted file mode 100644 index 3daf24f..0000000 --- a/modules/base/home.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - flake.modules = { - nixos.base = { - nixpkgs.config.allowUnFree = true; - home-manager = { - backupFileExtension = "bak"; - useUserPackages = true; - useGlobalPkgs = true; - }; - }; - - homeManager.base = { - programs.home-manager.enable = true; - - services = { - home-manager.autoExpire = { - enable = true; - frequency = "weekly"; - store.cleanup = true; - }; - }; - }; - }; -} diff --git a/modules/base/kitty.nix b/modules/base/kitty.nix deleted file mode 100644 index 810b609..0000000 --- a/modules/base/kitty.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - flake.modules = { - homeManager.cholli = - { pkgs, ... }: - { - catppuccin.kitty.enable = true; - - home.packages = [ - pkgs.kitty - pkgs.xfce.thunar - ]; - home.sessionVariables.TERMINAL = "kitty"; - - home.file.".config/Thunar/uca.xml".text = '' - - - - kitty - Open Kitty here - - 1726095927116900-1 - ${pkgs.kitty}/bin/kitty %f - Example for a custom action - - * - - - - - ''; - - programs.kitty = { - enable = true; - # themeFile = "tokyo_night_night"; - font = { - name = "FiraCode Nerd Font"; - size = 15; - }; - shellIntegration.enableFishIntegration = true; - settings = { - "background_opacity" = "0.90"; - "shell" = "fish"; - "confirm_os_window_close" = "0"; - }; - }; - - }; - }; -} diff --git a/modules/base/network/default.nix b/modules/base/network/default.nix deleted file mode 100644 index 9e31b67..0000000 --- a/modules/base/network/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - flake.modules.nixos.base = - { hostConfig, ... }: - { - networking = { - hostName = hostConfig.name; - - networkmanager = { - enable = true; - }; - }; - - # systemd = { - # services.NetworkManager-wait-online.enable = false; - # network.wait-online.enable = false; - # }; - - services.resolved = { - enable = true; - }; - }; -} diff --git a/modules/base/starship.nix b/modules/base/starship.nix deleted file mode 100644 index 0a0b38e..0000000 --- a/modules/base/starship.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - flake.modules.homeManager.cholli = - { ... }: - { - catppuccin.starship.enable = false; - programs = { - starship = { - enable = true; - enableTransience = true; - settings = { - character = { - error_symbol = "[ ](bold red)"; - }; - time = { - disabled = false; - time_format = "%T"; - utc_time_offset = "+2"; - }; - username = { - style_user = "#00de00"; - style_root = "red"; - format = "[$user]($style) "; - disabled = false; - show_always = true; - }; - hostname = { - ssh_only = false; - format = "@ [$hostname](bold yellow) "; - disabled = false; - }; - directory = { - home_symbol = "󰋞 ~"; - read_only_style = "197"; - read_only = "  "; - format = "at [$path]($style)[$read_only]($read_only_style) "; - }; - git_metrics = { - disabled = false; - added_style = "bold blue"; - format = "[+$added]($added_style)/[-$deleted]($deleted_style) "; - }; - git_status = { - format = "([$all_status$ahead_behind]($style) )"; - ahead = "[↑$count](bold green)"; - behind = "[↓$count](bold red)"; - diverged = "[↕↓$ahead_count↑$behind_count](red)"; - deleted = "[✘$count](red) "; - modified = "[!$count](yellow) "; - staged = "[+$count](green) "; - renamed = "[➜$count](green) "; - untracked = "[?$count](blue) "; - }; - }; - }; - }; - }; -} diff --git a/modules/base/system/default.nix b/modules/base/system/default.nix deleted file mode 100644 index dd2c164..0000000 --- a/modules/base/system/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ - flake.modules = - let - stateVersion = "25.05"; - in - { - homeManager.base = - { - config, - inputs, - ... - }: - { - imports = [ - inputs.sops-nix.homeManagerModules.sops - inputs.catppuccin.homeModules.catppuccin - ]; - - home = { - inherit stateVersion; - }; - }; - - nixos.base = - { - config, - inputs, - pkgs, - ... - }: - { - imports = [ - inputs.sops-nix.nixosModules.sops - inputs.catppuccin.nixosModules.catppuccin - ]; - - environment.systemPackages = with pkgs; [ - sops - age - ssh-to-age - ]; - - services.gnome.gnome-keyring.enable = true; - - services.dbus.packages = [ - pkgs.gnome-keyring - pkgs.gcr - ]; - - sops = { - defaultSopsFile = ../../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - - # age.keyFile = "/home/cholli/.config/sops/age/keys.txt"; - age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - }; - - system = { - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://search.nixos.org/options?&show=system.stateVersion&from=0&size=50&sort=relevance&type=packages&query=stateVersion). - inherit stateVersion; - }; - }; - }; -} diff --git a/modules/base/system/fonts.nix b/modules/base/system/fonts.nix deleted file mode 100644 index 2ac798c..0000000 --- a/modules/base/system/fonts.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - - flake.modules.nixos.base = - { pkgs, ... }: - { - environment.variables = { - # Enable icons in tooling since we have nerdfonts. - LOG_ICONS = "true"; - }; - - fonts.packages = with pkgs; [ - font-awesome - powerline-fonts - powerline-symbols - nerd-fonts.code-new-roman - nerd-fonts.fira-code - nerd-fonts.symbols-only - fira - ]; - - }; -} diff --git a/modules/base/system/gpg.nix b/modules/base/system/gpg.nix deleted file mode 100644 index 30898a7..0000000 --- a/modules/base/system/gpg.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - flake.modules = { - nixos.base = - { pkgs, ... }: - let - - reload-yubikey = pkgs.writeShellScriptBin "reload-yubikey" '' - ${pkgs.gnupg}/bin/gpg-connect-agent "scd serialno" "learn --force" /bye - ''; - in - { - services.pcscd.enable = true; - services.udev.packages = with pkgs; [ yubikey-personalization ]; - - environment.systemPackages = with pkgs; [ - cryptsetup - paperkey - gnupg - pinentry-curses - pinentry-qt - - yubikey-manager - yubioath-flutter - reload-yubikey - ]; - - programs = { - ssh.startAgent = false; - - gnupg.agent = { - enable = true; - enableSSHSupport = true; - enableExtraSocket = true; - }; - }; - - }; - - homeManager.base = - { inputs, pkgs, ... }: - let - gpgConf = "${inputs.gpg-base-conf}/gpg.conf"; - - gpgAgentConf = '' - enable-ssh-support - default-cache-ttl 60 - max-cache-ttl 120 - pinentry-program ${pkgs.pinentry-qt}/bin/pinentry-qt - ''; - in - { - home.file = { - ".gnupg/.keep".text = ""; - - ".gnupg/gpg.conf".source = gpgConf; - ".gnupg/gpg-agent.conf".text = gpgAgentConf; - ".gnupg/scdeamon.conf".text = "disable-ccid"; - }; - }; - }; -} diff --git a/modules/base/system/locale.nix b/modules/base/system/locale.nix deleted file mode 100644 index fc43f59..0000000 --- a/modules/base/system/locale.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - flake.modules.nixos.base = - { lib, ... }: - { - time.timeZone = "Europe/Berlin"; - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LANG = "en_US.UTF-8"; - LC_ALL = "en_US.UTF-8"; - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - - console = { - keyMap = lib.mkForce "us"; - useXkbConfig = true; - }; - }; -} diff --git a/modules/base/system/nixdaemon.nix b/modules/base/system/nixdaemon.nix deleted file mode 100644 index 8eb56a9..0000000 --- a/modules/base/system/nixdaemon.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - flake.modules.nixos.base = - { - config, - inputs, - lib, - pkgs, - ... - }: - let - username = "cholli"; - in - { - environment.systemPackages = with pkgs; [ - nixfmt-rfc-style - nix-prefetch-git - - nix-index - nix-output-monitor - ]; - - programs.nh = { - enable = true; - package = inputs.nh-flake.packages.${pkgs.system}.nh; - flake = "/home/${username}/projects/config"; - }; - - nix = { - settings = - let - users = [ - "root" - username - ] - ++ lib.optional (builtins.hasAttr "native" config.services.gitea-actions-runner) "gitea-runner" - ++ lib.optional config.services.hydra.enable "hydra hydra-www hydra-evaluator hydra-queue-runner"; - in - { - experimental-features = "nix-command flakes"; - http-connections = 50; - warn-dirty = false; - log-lines = 50; - sandbox = "relaxed"; - auto-optimise-store = true; - trusted-users = users; - allowed-users = users; - allowed-uris = "github: https://github.com/ git+https://github.com/ gitlab: https://gitlab.com/ git+https://gitlab.com/"; - } - // (lib.optionalAttrs config.programs.direnv.enable { - keep-outputs = true; - keep-derivations = true; - }); - - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - }; - }; -} diff --git a/modules/desktop/addons/app-runner.nix b/modules/desktop/addons/app-runner.nix deleted file mode 100644 index 072ef30..0000000 --- a/modules/desktop/addons/app-runner.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - flake.modules.homeManager.desktop = - { pkgs, ... }: - { - home.packages = with pkgs; [ - fuzzel - ]; - }; -} diff --git a/modules/desktop/addons/hyprlock.nix b/modules/desktop/addons/hyprlock.nix deleted file mode 100644 index 3ceb547..0000000 --- a/modules/desktop/addons/hyprlock.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ - flake.modules = { - nixos.desktop = - { pkgs, ... }: - let - hyprlock-blur = pkgs.writeShellScriptBin "hyprlock-blur" '' - ${pkgs.grim}/bin/grim -o DP-1 -l 0 /tmp/screenshot1.png & - ${pkgs.grim}/bin/grim -o HDMI-A-1 -l 0 /tmp/screenshot2.png & - wait && - hyprlock - ''; - in - { - security.pam.services.hyprlock = { - allowNullPassword = false; - startSession = false; - text = '' - auth include login - account include login - ''; - }; - - environment.systemPackages = [ hyprlock-blur ]; - - }; - - homeManager.cholli = - { inputs, pkgs, ... }: - let - hyprlock-package = inputs.hyprlock.packages.${pkgs.system}.hyprlock; - in - { - programs.hyprlock = { - enable = true; - package = hyprlock-package; - settings = { - # inspiration from https://github.com/justinmdickey/publicdots/blob/main/.config/hypr/hyprlock.conf - background = [ - { - monitor = "DP-1"; - path = "/tmp/screenshot1.png"; - - blur_passes = 1; # 0 disables blurring - blur_size = 7; - noise = 1.17e-2; - } - { - monitor = "HDMI-A-1"; - path = "/tmp/screenshot2.png"; - - blur_passes = 2; # 0 disables blurring - blur_size = 7; - noise = 1.17e-2; - } - ]; - - label = [ - { - monitor = "DP-1"; - text = "$TIME"; - color = "rgba(242, 243, 244, 0.75)"; - font_size = 95; - font_family = "JetBrains Mono"; - position = "0, 300"; - halign = "center"; - valign = "center"; - } - { - - monitor = "DP-1"; - text = ''cmd[update:1000] echo $(date +"%A, %B %d")''; - color = "rgba(242, 243, 244, 0.75)"; - font_size = 22; - font_family = "JetBrains Mono"; - position = "0, 200"; - halign = "center"; - valign = "center"; - - } - ]; - - image = { - monitor = "DP-1"; - path = "/home/cholli/Pictures/profile.png"; - - position = "0, 50"; - halign = "center"; - valign = "center"; - }; - - input-field = { - monitor = "DP-1"; - size = "200,50"; - outline_thickness = 2; - dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8 - dots_spacing = 0.35; # Scale of dots' absolute size, 0.0 - 1.0 - dots_center = true; - outer_color = "rgba(0, 0, 0, 0)"; - inner_color = "rgba(0, 0, 0, 0.2)"; - font_color = "rgb(111, 45, 104)"; - fade_on_empty = false; - rounding = -1; - check_color = "rgb(30, 107, 204)"; - placeholder_text = ''Input Password...''; - hide_input = false; - position = "0, -100"; - halign = "center"; - valign = "center"; - }; - - general = { - auth_method = "pam"; - }; - }; - }; - }; - }; -} diff --git a/modules/desktop/addons/hyprpanel.nix b/modules/desktop/addons/hyprpanel.nix deleted file mode 100644 index ef6e5c5..0000000 --- a/modules/desktop/addons/hyprpanel.nix +++ /dev/null @@ -1,494 +0,0 @@ -{ - flake.modules.homeManager.cholli = - { - lib, - osConfig, - pkgs, - ... - }: - { - config = lib.mkIf osConfig.programs.hyprland.enable { - wayland.windowManager.hyprland.settings.exec-once = [ - "${pkgs.hyprpanel}/bin/hyprpanel" - ]; - - programs.hyprpanel = { - enable = true; - settings = { - menus.dashboard.powermenu.avatar.image = "/home/cholli/Pictures/profile.png"; - - bar = { - launcher.autoDetectIcon = true; - workspaces = { - show_icons = false; - show_numbered = true; - }; - layouts = { - "0" = { - "left" = [ - "dashboard" - "workspaces" - ]; - "middle" = [ - "windowtitle" - ]; - "right" = [ - "volume" - "bluetooth" - "cputemp" - "cpu" - "ram" - "systray" - "clock" - "notifications" - ]; - }; - "1" = { - "left" = [ - "workspaces" - ]; - "right" = [ - "clock" - ]; - }; - }; - customModules = { - ram = { - icon = " "; - labelType = "used/total"; - }; - cpu = { - icon = " "; - leftClick = "kitty --hold btop"; - }; - cpuTemp = { - sensor = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp3_input"; - unit = "metric"; - showUnit = true; - - }; - }; - clock.format = "%a %b %d %H:%M:%S"; - notifications = { - show_total = true; - hideCountWhenZero = false; - }; - }; - - layouts = { - "0" = { - left = [ - "dashboard" - "workspaces" - ]; - middle = [ "windowtitle" ]; - right = [ - "volume" - "bluetooth" - "cputemp" - "cpu" - "ram" - "systray" - "clock" - "notifications" - ]; - }; - "1" = { - left = [ "workspaces" ]; - right = [ "clock" ]; - }; - }; - theme = { - bar = { - floating = true; - background = "#11111b"; - border.color = "#b4befe"; - buttons = { - background = "#242438"; - battery.background = "#242438"; - battery.border = "#f9e2af"; - battery.icon = "#242438"; - battery.icon_background = "#f9e2af"; - battery.text = "#f9e2af"; - bluetooth.background = "#242438"; - bluetooth.border = "#89dceb"; - bluetooth.icon = "#1e1e2e"; - bluetooth.icon_background = "#89dbeb"; - bluetooth.text = "#89dceb"; - borderColor = "#b4befe"; - clock.background = "#242438"; - clock.border = "#f5c2e7"; - clock.icon = "#232338"; - clock.icon_background = "#f5c2e7"; - clock.text = "#f5c2e7"; - dashboard.background = "#f9e2af"; - dashboard.border = "#f9e2af"; - dashboard.icon = "#1e1e2e"; - hover = "#45475a"; - icon = "#242438"; - icon_background = "#b4befe"; - media.background = "#242438"; - media.border = "#b4befe"; - media.icon = "#1e1e2e"; - media.icon_background = "#b4befe"; - media.text = "#b4befe"; - modules.cava.background = "#242438"; - modules.cava.border = "#94e2d5"; - modules.cava.icon = "#242438"; - modules.cava.icon_background = "#94e2d5"; - modules.cava.text = "#94e2d5"; - modules.cpu.background = "#242438"; - modules.cpu.border = "#f38ba8"; - modules.cpu.icon = "#181825"; - modules.cpu.icon_background = "#f38ba8"; - modules.cpu.text = "#f38ba8"; - modules.hypridle.background = "#242438"; - modules.hypridle.border = "#f5c2e7"; - modules.hypridle.icon = "#242438"; - modules.hypridle.icon_background = "#f5c2e7"; - modules.hypridle.text = "#f5c2e7"; - modules.hyprsunset.background = "#242438"; - modules.hyprsunset.border = "#fab387"; - modules.hyprsunset.icon = "#242438"; - modules.hyprsunset.icon_background = "#fab387"; - modules.hyprsunset.text = "#fab387"; - modules.kbLayout.background = "#242438"; - modules.kbLayout.border = "#89dceb"; - modules.kbLayout.icon = "#181825"; - modules.kbLayout.icon_background = "#89dceb"; - modules.kbLayout.text = "#89dceb"; - modules.microphone.background = "#242438"; - modules.microphone.border = "#a6e3a1"; - modules.microphone.icon = "#242438"; - modules.microphone.icon_background = "#a6e3a1"; - modules.microphone.text = "#a6e3a1"; - modules.netstat.background = "#242438"; - modules.netstat.border = "#a6e3a1"; - modules.netstat.icon = "#181825"; - modules.netstat.icon_background = "#a6e3a1"; - modules.netstat.text = "#a6e3a1"; - modules.power.background = "#242438"; - modules.power.border = "#f38ba8"; - modules.power.icon = "#181825"; - modules.power.icon_background = "#f38ba8"; - modules.ram.background = "#242438"; - modules.ram.border = "#f9e2af"; - modules.ram.icon = "#181825"; - modules.ram.icon_background = "#f9e2af"; - modules.ram.text = "#f9e2af"; - modules.storage.background = "#242438"; - modules.storage.border = "#f5c2e7"; - modules.storage.icon = "#181825"; - modules.storage.icon_background = "#f5c2e7"; - modules.storage.text = "#f5c2e7"; - modules.submap.background = "#242438"; - modules.submap.border = "#94e2d5"; - modules.submap.icon = "#181825"; - modules.submap.icon_background = "#94e2d5"; - modules.submap.text = "#94e2d5"; - modules.updates.background = "#242438"; - modules.updates.border = "#cba6f7"; - modules.updates.icon = "#181825"; - modules.updates.icon_background = "#cba6f7"; - modules.updates.text = "#cba6f7"; - modules.weather.background = "#242438"; - modules.weather.border = "#b4befe"; - modules.weather.icon = "#242438"; - modules.weather.icon_background = "#b4befe"; - modules.weather.text = "#b4befe"; - modules.worldclock.background = "#242438"; - modules.worldclock.border = "#f5c2e7"; - modules.worldclock.icon = "#242438"; - modules.worldclock.icon_background = "#f5c2e7"; - modules.worldclock.text = "#f5c2e7"; - network.background = "#242438"; - network.border = "#cba6f7"; - network.icon = "#242438"; - network.icon_background = "#caa6f7"; - network.text = "#cba6f7"; - notifications.background = "#242438"; - notifications.border = "#b4befe"; - notifications.icon = "#1e1e2e"; - notifications.icon_background = "#b4befe"; - notifications.total = "#b4befe"; - style = "split"; - systray.background = "#242438"; - systray.border = "#b4befe"; - systray.customIcon = "#cdd6f4"; - text = "#b4befe"; - volume.background = "#242438"; - volume.border = "#eba0ac"; - volume.icon = "#242438"; - volume.icon_background = "#eba0ac"; - volume.text = "#eba0ac"; - windowtitle.background = "#242438"; - windowtitle.border = "#f5c2e7"; - windowtitle.icon = "#1e1e2e"; - windowtitle.icon_background = "#f5c2e7"; - windowtitle.text = "#f5c2e7"; - workspaces.active = "#f5c2e7"; - workspaces.available = "#89dceb"; - workspaces.background = "#242438"; - workspaces.border = "#f5c2e7"; - workspaces.hover = "#f5c2e7"; - workspaces.numbered_active_highlighted_text_color = "#181825"; - workspaces.numbered_active_underline_color = "#f5c2e7"; - workspaces.occupied = "#f2cdcd"; - y_margins = "0.2em"; - }; - menus = { - background = "#11111b"; - border.color = "#313244"; - buttons.active = "#f5c2e6"; - buttons.default = "#b4befe"; - buttons.disabled = "#585b71"; - buttons.text = "#181824"; - cards = "#1e1e2e"; - check_radio_button.active = "#b4beff"; - check_radio_button.background = "#45475a"; - dimtext = "#585b70"; - dropdownmenu.background = "#11111b"; - dropdownmenu.divider = "#1e1e2e"; - dropdownmenu.text = "#cdd6f4"; - feinttext = "#313244"; - iconbuttons.active = "#b4beff"; - iconbuttons.passive = "#cdd6f3"; - icons.active = "#b4befe"; - icons.passive = "#585b70"; - label = "#b4befe"; - listitems.active = "#b4befd"; - listitems.passive = "#cdd6f4"; - menu = { - battery.background.color = "#11111b"; - battery.border.color = "#313244"; - battery.card.color = "#1e1e2e"; - battery.icons.active = "#f9e2af"; - battery.icons.passive = "#9399b2"; - battery.label.color = "#f9e2af"; - battery.listitems.active = "#f9e2af"; - battery.listitems.passive = "#cdd6f3"; - battery.slider.background = "#585b71"; - battery.slider.backgroundhover = "#45475a"; - battery.slider.primary = "#f9e2af"; - battery.slider.puck = "#6c7086"; - battery.text = "#cdd6f4"; - bluetooth.background.color = "#11111b"; - bluetooth.border.color = "#313244"; - bluetooth.card.color = "#1e1e2e"; - bluetooth.iconbutton.active = "#89dceb"; - bluetooth.iconbutton.passive = "#cdd6f4"; - bluetooth.icons.active = "#89dceb"; - bluetooth.icons.passive = "#9399b2"; - bluetooth.label.color = "#89dceb"; - bluetooth.listitems.active = "#89dcea"; - bluetooth.listitems.passive = "#cdd6f4"; - bluetooth.scroller.color = "#89dceb"; - bluetooth.status = "#6c7086"; - bluetooth.switch.disabled = "#313245"; - bluetooth.switch.enabled = "#89dceb"; - bluetooth.switch.puck = "#454759"; - bluetooth.switch_divider = "#45475a"; - bluetooth.text = "#cdd6f4"; - clock.background.color = "#11111b"; - clock.border.color = "#313244"; - clock.calendar.contextdays = "#585b70"; - clock.calendar.currentday = "#f5c2e7"; - clock.calendar.days = "#cdd6f4"; - clock.calendar.paginator = "#f5c2e6"; - clock.calendar.weekdays = "#f5c2e7"; - clock.calendar.yearmonth = "#94e2d5"; - clock.card.color = "#1e1e2e"; - clock.text = "#cdd6f4"; - clock.time.time = "#f5c2e7"; - clock.time.timeperiod = "#94e2d5"; - clock.weather.hourly.icon = "#f5c2e7"; - clock.weather.hourly.temperature = "#f5c2e7"; - clock.weather.hourly.time = "#f5c2e7"; - clock.weather.icon = "#f5c2e7"; - clock.weather.stats = "#f5c2e7"; - clock.weather.status = "#94e2d5"; - clock.weather.temperature = "#cdd6f4"; - clock.weather.thermometer.cold = "#89b4fa"; - clock.weather.thermometer.extremelycold = "#89dceb"; - clock.weather.thermometer.extremelyhot = "#f38ba8"; - clock.weather.thermometer.hot = "#fab387"; - clock.weather.thermometer.moderate = "#b4befe"; - dashboard.background.color = "#11111b"; - dashboard.border.color = "#313244"; - dashboard.card.color = "#1e1e2e"; - dashboard.controls.bluetooth.background = "#89dceb"; - dashboard.controls.bluetooth.text = "#181824"; - dashboard.controls.disabled = "#585b70"; - dashboard.controls.input.background = "#f5c2e7"; - dashboard.controls.input.text = "#181824"; - dashboard.controls.notifications.background = "#f9e2af"; - dashboard.controls.notifications.text = "#181824"; - dashboard.controls.volume.background = "#eba0ac"; - dashboard.controls.volume.text = "#181824"; - dashboard.controls.wifi.background = "#cba6f7"; - dashboard.controls.wifi.text = "#181824"; - dashboard.directories.left.bottom.color = "#eba0ac"; - dashboard.directories.left.middle.color = "#f9e2af"; - dashboard.directories.left.top.color = "#f5c2e7"; - dashboard.directories.right.bottom.color = "#b4befe"; - dashboard.directories.right.middle.color = "#cba6f7"; - dashboard.directories.right.top.color = "#94e2d5"; - dashboard.monitors.bar_background = "#45475a"; - dashboard.monitors.cpu.bar = "#eba0ad"; - dashboard.monitors.cpu.icon = "#eba0ac"; - dashboard.monitors.cpu.label = "#eba0ac"; - dashboard.monitors.disk.bar = "#f5c2e8"; - dashboard.monitors.disk.icon = "#f5c2e7"; - dashboard.monitors.disk.label = "#f5c2e7"; - dashboard.monitors.gpu.bar = "#a6e3a2"; - dashboard.monitors.gpu.icon = "#a6e3a1"; - dashboard.monitors.gpu.label = "#a6e3a1"; - dashboard.monitors.ram.bar = "#f9e2ae"; - dashboard.monitors.ram.icon = "#f9e2af"; - dashboard.monitors.ram.label = "#f9e2af"; - dashboard.powermenu.confirmation.background = "#11111b"; - dashboard.powermenu.confirmation.body = "#cdd6f4"; - dashboard.powermenu.confirmation.border = "#313244"; - dashboard.powermenu.confirmation.button_text = "#11111a"; - dashboard.powermenu.confirmation.card = "#1e1e2e"; - dashboard.powermenu.confirmation.confirm = "#a6e3a1"; - dashboard.powermenu.confirmation.deny = "#f38ba8"; - dashboard.powermenu.confirmation.label = "#b4befe"; - dashboard.powermenu.logout = "#a6e3a1"; - dashboard.powermenu.restart = "#fab387"; - dashboard.powermenu.shutdown = "#f38ba8"; - dashboard.powermenu.sleep = "#89dceb"; - dashboard.profile.name = "#f5c2e7"; - dashboard.shortcuts.background = "#b4befe"; - dashboard.shortcuts.recording = "#a6e3a1"; - dashboard.shortcuts.text = "#181824"; - media.album = "#f5c2e8"; - media.artist = "#94e2d6"; - media.background.color = "#11111b"; - media.border.color = "#313244"; - media.buttons.background = "#b4beff"; - media.buttons.enabled = "#94e2d4"; - media.buttons.inactive = "#585b70"; - media.buttons.text = "#11111b"; - media.card.color = "#1e1e2e"; - media.slider.background = "#585b71"; - media.slider.backgroundhover = "#45475a"; - media.slider.primary = "#f5c2e7"; - media.slider.puck = "#6c7086"; - media.song = "#b4beff"; - media.timestamp = "#cdd6f4"; - network.background.color = "#11111b"; - network.border.color = "#313244"; - network.card.color = "#1e1e2e"; - network.iconbuttons.active = "#cba6f7"; - network.iconbuttons.passive = "#cdd6f4"; - network.icons.active = "#cba6f7"; - network.icons.passive = "#9399b2"; - network.label.color = "#cba6f7"; - network.listitems.active = "#cba6f6"; - network.listitems.passive = "#cdd6f4"; - network.scroller.color = "#cba6f7"; - network.status.color = "#6c7086"; - network.switch.disabled = "#313245"; - network.switch.enabled = "#cba6f7"; - network.switch.puck = "#454759"; - network.text = "#cdd6f4"; - notifications.background = "#11111b"; - notifications.border = "#313244"; - notifications.card = "#1e1e2e"; - notifications.clear = "#f38ba8"; - notifications.label = "#b4befe"; - notifications.no_notifications_label = "#313244"; - notifications.pager.background = "#11111b"; - notifications.pager.button = "#b4befe"; - notifications.pager.label = "#9399b2"; - notifications.scrollbar.color = "#b4befe"; - notifications.switch.disabled = "#313245"; - notifications.switch.enabled = "#b4befe"; - notifications.switch.puck = "#454759"; - notifications.switch_divider = "#45475a"; - power.background.color = "#11111b"; - power.border.color = "#313244"; - power.buttons.logout.background = "#1e1e2e"; - power.buttons.logout.icon = "#181824"; - power.buttons.logout.icon_background = "#a6e3a1"; - power.buttons.logout.text = "#a6e3a1"; - power.buttons.restart.background = "#1e1e2e"; - power.buttons.restart.icon = "#181824"; - power.buttons.restart.icon_background = "#fab387"; - power.buttons.restart.text = "#fab387"; - power.buttons.shutdown.background = "#1e1e2e"; - power.buttons.shutdown.icon = "#181824"; - power.buttons.shutdown.icon_background = "#f38ba7"; - power.buttons.shutdown.text = "#f38ba8"; - power.buttons.sleep.background = "#1e1e2e"; - power.buttons.sleep.icon = "#181824"; - power.buttons.sleep.icon_background = "#89dceb"; - power.buttons.sleep.text = "#89dceb"; - systray.dropdownmenu.background = "#11111b"; - systray.dropdownmenu.divider = "#1e1e2e"; - systray.dropdownmenu.text = "#cdd6f4"; - volume.audio_slider.background = "#585b71"; - volume.audio_slider.backgroundhover = "#45475a"; - volume.audio_slider.primary = "#eba0ac"; - volume.audio_slider.puck = "#585b70"; - volume.background.color = "#11111b"; - volume.border.color = "#313244"; - volume.card.color = "#1e1e2e"; - volume.iconbutton.active = "#eba0ac"; - volume.iconbutton.passive = "#cdd6f4"; - volume.icons.active = "#eba0ac"; - volume.icons.passive = "#9399b2"; - volume.input_slider.background = "#585b71"; - volume.input_slider.backgroundhover = "#45475a"; - volume.input_slider.primary = "#eba0ac"; - volume.input_slider.puck = "#585b70"; - volume.label.color = "#eba0ac"; - volume.listitems.active = "#eba0ab"; - volume.listitems.passive = "#cdd6f4"; - volume.text = "#cdd6f4"; - }; - popover.background = "#181824"; - popover.border = "#181824"; - popover.text = "#b4befe"; - progressbar.background = "#45475a"; - progressbar.foreground = "#b4befe"; - slider.background = "#585b71"; - slider.backgroundhover = "#45475a"; - slider.primary = "#b4befe"; - slider.puck = "#6c7086"; - switch.disabled = "#313245"; - switch.enabled = "#b4befe"; - switch.puck = "#454759"; - text = "#cdd6f4"; - tooltip.background = "#11111b"; - tooltip.text = "#cdd6f4"; - }; - outer_spacing = "0.0em"; - transparent = true; - - }; - notification.actions.background = "#b4befd"; - notification.actions.text = "#181825"; - notification.background = "#181826"; - notification.border = "#313243"; - notification.close_button.background = "#f38ba7"; - notification.close_button.label = "#11111b"; - notification.label = "#b4befe"; - notification.labelicon = "#b4befe"; - notification.text = "#cdd6f4"; - notification.time = "#7f849b"; - osd.bar_color = "#b4beff"; - osd.bar_container = "#11111b"; - osd.bar_empty_color = "#313244"; - osd.bar_overflow_color = "#f38ba7"; - osd.icon = "#11111b"; - osd.icon_container = "#b4beff"; - osd.label = "#b4beff"; - - }; - }; - }; - }; - }; -} diff --git a/modules/desktop/addons/waybar.nix b/modules/desktop/addons/waybar.nix deleted file mode 100644 index 0db3279..0000000 --- a/modules/desktop/addons/waybar.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix deleted file mode 100644 index 7e053f0..0000000 --- a/modules/desktop/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - flake.modules = { - nixos.desktop = - { - config, - inputs, - lib, - pkgs, - ... - }: - let - zenbrowser = inputs.zen-browser.packages."${pkgs.system}".default; - in - - { - environment = { - systemPackages = [ - zenbrowser - ]; - - sessionVariables = { - DEFAULT_BROWSER = "${zenbrowser}/bin/zen-beta"; - BROWSER = "zen-beta"; - }; - - etc = lib.mkIf config.programs._1password.enable { - "1password/custom_allowed_browsers" = { - text = '' - zen - ''; - mode = "0755"; - }; - }; - }; - }; - - homeManager.cholli = - { pkgs, osConfig, ... }: - { - dconf = { - settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; - }; - - gtk = { - enable = true; - theme = { - name = "Adwaita-dark"; - package = pkgs.gnome-themes-extra; - }; - }; - - # qt = { - # enable = true; - # platformTheme.name = "gnome"; - # style.name = "adwaita-dark"; - # }; - - systemd.user.sessionVariables = osConfig.home-manager.users.cholli.home.sessionVariables; - - }; - }; -} diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix deleted file mode 100644 index a0d81f3..0000000 --- a/modules/desktop/niri.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - flake.modules.nixos.niri = { ... }: { }; -} diff --git a/modules/dev/devenv.nix b/modules/dev/devenv.nix deleted file mode 100644 index edca6dc..0000000 --- a/modules/dev/devenv.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - flake.modules.nixos.dev = - { inputs, pkgs, ... }: - { - environment.systemPackages = [ - inputs.devenv.packages.${pkgs.system}.devenv - ]; - }; -} diff --git a/modules/dev/direnv.nix b/modules/dev/direnv.nix deleted file mode 100644 index 9e1189b..0000000 --- a/modules/dev/direnv.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - flake.modules = { - nixos.dev = - { ... }: - { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; - homeManager.dev = - { ... }: - { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; - }; -} diff --git a/modules/dev/gh.nix b/modules/dev/gh.nix deleted file mode 100644 index a6dcb1e..0000000 --- a/modules/dev/gh.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - flake.modules = { - homeManager.dev = - { pkgs, ... }: - { - programs = { - gh-dash = { - enable = true; - settings = { - prSections = [ - { - title = "To review"; - filters = "repo:NixOS/nixpkgs is:open draft:false status:success"; - } - { - title = "1st contribution"; - filters = ''repo:NixOS/nixpkgs is:open draft:false label:"12. first-time contribution"''; - } - { - title = "1st approval"; - filters = ''repo:NixOS/nixpkgs is:open draft:false status:success label:"12.approvals: 1"''; - } - { - title = "From r-ryantm only"; - filters = ''repo:NixOS/nixpkgs is:open draft:false status:success base:master -label:"1.severity: mass-rebuild" -label:"1.severity: mass-darwin-rebuild" author:r-ryantm''; - } - { - title = "My PRs"; - filters = "is:open author:@me"; - } - { - title = "Needs my review"; - filters = "is:open review-requested:@me"; - } - { - title = "Involved"; - filters = "is:open involves:@me -author:@me"; - } - ]; - defaults = { - prsLimit = 25; - issuesLimit = 10; - view = "prs"; - preview = { - open = false; - width = 100; - }; - refetchIntervalMinutes = 10; - }; - theme.ui.table.showSeparator = false; - }; - }; - - gh = { - enable = true; - extensions = [ - pkgs.gh-dash - pkgs.gh-copilot - ]; - }; - }; - }; - }; -} diff --git a/modules/flake-parts/flake-parts.nix b/modules/flake-parts/flake-parts.nix deleted file mode 100644 index 691ae5c..0000000 --- a/modules/flake-parts/flake-parts.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ inputs, ... }: -{ - imports = [ - inputs.flake-parts.flakeModules.modules - ]; -} diff --git a/modules/flake-parts/formatter.nix b/modules/flake-parts/formatter.nix deleted file mode 100644 index b503808..0000000 --- a/modules/flake-parts/formatter.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - inputs, - lib, - ... -}: -{ - imports = [ - inputs.treefmt-nix.flakeModule - inputs.git-hooks.flakeModule - ]; - - perSystem = - { self', ... }: - { - treefmt = { - projectRootFile = "flake.nix"; - programs = { - deadnix.enable = true; - jsonfmt.enable = true; - nixfmt.enable = true; - prettier.enable = true; - shfmt.enable = true; - statix.enable = true; - yamlfmt.enable = true; - }; - settings = { - on-unmatched = "fatal"; - global.excludes = [ - "*.envrc" - ".editorconfig" - "*.directory" - "*.face" - "*.fish" - "*.png" - "*.toml" - "*.svg" - "*.xml" - "*/.gitignore" - "_to_migrate/*" - "LICENSE" - ]; - }; - }; - - pre-commit.settings.hooks.nix-fmt = { - enable = true; - entry = lib.getExe self'.formatter; - }; - }; -} diff --git a/modules/flake-parts/host-machines.nix b/modules/flake-parts/host-machines.nix deleted file mode 100644 index 61e80e4..0000000 --- a/modules/flake-parts/host-machines.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - inputs, - lib, - config, - ... -}: -let - prefix = "hosts/"; - collectHostsModules = modules: lib.filterAttrs (name: _: lib.hasPrefix prefix name) modules; -in -{ - flake.nixosConfigurations = lib.pipe (collectHostsModules config.flake.modules.nixos) [ - (lib.mapAttrs' ( - name: module: - let - specialArgs = { - inherit inputs; - hostConfig = module // { - name = lib.removePrefix prefix name; - }; - }; - in - { - name = lib.removePrefix prefix name; - value = inputs.nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = module.imports ++ [ - inputs.home-manager.nixosModules.home-manager - { - home-manager.extraSpecialArgs = specialArgs; - } - ]; - }; - } - )) - ]; -} diff --git a/modules/games/communication.nix b/modules/games/communication.nix deleted file mode 100644 index 3ef9199..0000000 --- a/modules/games/communication.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - flake.modules.nixos.games = - { pkgs, ... }: - { - environment.systemPackages = with pkgs; [ - discord - teamspeak6-client - ]; - - programs.obs-studio = { - enable = true; - plugins = with pkgs.obs-studio-plugins; [ - wlrobs - obs-move-transition - ]; - }; - }; -} diff --git a/modules/games/steam.nix b/modules/games/steam.nix deleted file mode 100644 index 019b105..0000000 --- a/modules/games/steam.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - flake.modules.nixos.games = - { pkgs, ... }: - { - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - extraCompatPackages = with pkgs; [ proton-ge-bin ]; - }; - - environment.systemPackages = with pkgs; [ - protontricks - ]; - }; -} diff --git a/modules/games/various-games.nix b/modules/games/various-games.nix deleted file mode 100644 index 7f542e7..0000000 --- a/modules/games/various-games.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - flake.modules.nixos.games = - { pkgs, ... }: - { - environment.systemPackages = with pkgs; [ - prismlauncher - starsector - ]; - }; -} diff --git a/modules/home/README.md b/modules/home/README.md new file mode 100644 index 0000000..2d7c118 --- /dev/null +++ b/modules/home/README.md @@ -0,0 +1 @@ +# Home-manager configuration diff --git a/modules/home/apps/cli-apps/fish/default.nix b/modules/home/apps/cli-apps/fish/default.nix new file mode 100644 index 0000000..3d897ec --- /dev/null +++ b/modules/home/apps/cli-apps/fish/default.nix @@ -0,0 +1,65 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +with lib.${namespace}; +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + cfg = config.${namespace}.apps.cli-apps.fish; +in +{ + options.${namespace}.apps.cli-apps.fish = { + enable = mkBoolOpt true "Whether or not to enable the fish shell"; + }; + + config = mkIf cfg.enable { + catppuccin.fish.enable = true; + + programs = { + fish = { + enable = true; + shellInit = '' + zoxide init fish | source + direnv hook fish | source + + set -x LESS_TERMCAP_mb \e'[01;32m' + set -x LESS_TERMCAP_md \e'[01;32m' + set -x LESS_TERMCAP_me \e'[0m' + set -x LESS_TERMCAP_se \e'[0m' + set -x LESS_TERMCAP_so \e'[01;47;34m' + set -x LESS_TERMCAP_ue \e'[0m' + set -x LESS_TERMCAP_us \e'[01;36m' + set -x LESS -R + set -x GROFF_NO_SGR 1 + ''; + shellAliases = { + vim = "hx"; + ls = "eza -lah --icons --git"; + lss = "ls --total-size"; + }; + functions = { + checkHash = "nix hash to-sri --type sha256 $(nix-prefetch-url --unpack $argv)"; + deployNixberry = "nixos-rebuild switch --flake .#nixberry --target-host nixberry --sudo --ask-sudo-password"; + deployLoptland = "nixos-rebuild switch --flake .#loptland --target-host christophhollizeck.dev --sudo --ask-sudo-password"; + checkPR = ''cd /home/cholli/projects/nixpkgs && ${lib.getExe pkgs.nixpkgs-review} pr $argv --post-result --systems "x86_64-linux aarch64-linux"''; + }; + plugins = with pkgs.fishPlugins; [ + { + name = "forgit"; + src = forgit.src; + } + ]; + }; + + zoxide = { + enable = true; + options = [ "--cmd cd" ]; + }; + }; + }; +} diff --git a/modules/home/apps/cli-apps/home-manager/default.nix b/modules/home/apps/cli-apps/home-manager/default.nix new file mode 100644 index 0000000..6829d25 --- /dev/null +++ b/modules/home/apps/cli-apps/home-manager/default.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt enabled; + cfg = config.${namespace}.apps.cli-apps.home-manager; +in +{ + options.${namespace}.apps.cli-apps.home-manager = { + enable = mkBoolOpt true "Enable home-manager"; + }; + + config = mkIf cfg.enable { programs.home-manager = enabled; }; +} diff --git a/modules/home/apps/cli-apps/starship/default.nix b/modules/home/apps/cli-apps/starship/default.nix new file mode 100644 index 0000000..1763226 --- /dev/null +++ b/modules/home/apps/cli-apps/starship/default.nix @@ -0,0 +1,75 @@ +{ + config, + lib, + namespace, + options, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + cfg = config.${namespace}.apps.cli-apps.starship; +in +{ + options.${namespace}.apps.cli-apps.starship = { + enable = mkBoolOpt true "Whether or not to enable starship shell"; + }; + + config = mkIf cfg.enable { + catppuccin.starship.enable = false; + programs = { + fish.shellInit = " + starship init fish | source + "; + + starship = { + enable = true; + enableTransience = true; + settings = { + character = { + error_symbol = "[ ](bold red)"; + }; + time = { + disabled = false; + time_format = "%T"; + utc_time_offset = "+2"; + }; + username = { + style_user = "#00de00"; + style_root = "red"; + format = "[$user]($style) "; + disabled = false; + show_always = true; + }; + hostname = { + ssh_only = false; + format = "@ [$hostname](bold yellow) "; + disabled = false; + }; + directory = { + home_symbol = "󰋞 ~"; + read_only_style = "197"; + read_only = "  "; + format = "at [$path]($style)[$read_only]($read_only_style) "; + }; + git_metrics = { + disabled = false; + added_style = "bold blue"; + format = "[+$added]($added_style)/[-$deleted]($deleted_style) "; + }; + git_status = { + format = "([$all_status$ahead_behind]($style) )"; + ahead = "[↑$count](bold green)"; + behind = "[↓$count](bold red)"; + diverged = "[↕↓$ahead_count↑$behind_count](red)"; + deleted = "[✘$count](red) "; + modified = "[!$count](yellow) "; + staged = "[+$count](green) "; + renamed = "[➜$count](green) "; + untracked = "[?$count](blue) "; + }; + }; + }; + }; + }; +} diff --git a/modules/home/apps/graphviz/default.nix b/modules/home/apps/graphviz/default.nix new file mode 100644 index 0000000..9d355e0 --- /dev/null +++ b/modules/home/apps/graphviz/default.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + cfg = config.${namespace}.apps.graphviz; +in +{ + options.${namespace}.apps.graphviz = { + enable = mkBoolOpt true "Whether or not you want to install graphviz"; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ graphviz ]; + + home.shellAliases = { + nixsize = "nix-du -n=50 | dot -Tsvg > ~/Pictures/store.svg"; + }; + }; +} diff --git a/modules/home/apps/kitty/default.nix b/modules/home/apps/kitty/default.nix new file mode 100644 index 0000000..f7cb071 --- /dev/null +++ b/modules/home/apps/kitty/default.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.apps.kitty; +in +{ + options.${namespace}.apps.kitty = { + enable = mkEnableOption "Kitty"; + }; + + config = mkIf cfg.enable { + home.packages = [ pkgs.kitty ]; + + home.sessionVariables.TERMINAL = "kitty"; + + catppuccin.kitty.enable = true; + + # TODO: move this to a thunar specific module + home.file.".config/Thunar/uca.xml".text = '' + + + + kitty + Open Kitty here + + 1726095927116900-1 + ${pkgs.kitty}/bin/kitty %f + Example for a custom action + + * + + + + + ''; + + programs.kitty = { + enable = true; + # themeFile = "tokyo_night_night"; + font = { + name = "FiraCode Nerd Font"; + size = 15; + }; + shellIntegration.enableFishIntegration = true; + settings = { + "background_opacity" = "0.90"; + "shell" = "fish"; + "confirm_os_window_close" = "0"; + }; + }; + }; +} diff --git a/modules/home/tools/direnv/default.nix b/modules/home/tools/direnv/default.nix new file mode 100644 index 0000000..08c87de --- /dev/null +++ b/modules/home/tools/direnv/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + namespace, + options, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt enabled; + cfg = config.${namespace}.tools.direnv; +in +{ + options.${namespace}.tools.direnv = { + enable = mkBoolOpt false "Whether or not to enable direnv."; + }; + + config = mkIf cfg.enable { + programs.direnv = { + enable = true; + nix-direnv = enabled; + }; + }; +} diff --git a/modules/home/tools/git/default.nix b/modules/home/tools/git/default.nix new file mode 100644 index 0000000..e4c3f5a --- /dev/null +++ b/modules/home/tools/git/default.nix @@ -0,0 +1,124 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib.${namespace}; +let + inherit (lib) mkIf types; + cfg = config.${namespace}.tools.git; + user = config.${namespace}.user; +in +{ + options.${namespace}.tools.git = { + enable = mkBoolOpt true "Enable Git (Default true)"; + userName = mkOpt types.str user.fullName "The name to configure git with."; + userEmail = mkOpt types.str user.email "The email to configure git with."; + signingKey = mkOpt types.str "ACCFA2DB47795D9E" "The pub key to sign commits with."; + signByDefault = mkOpt types.bool true "Whether to sign commits by default."; + }; + + config = mkIf cfg.enable { + systemd.user = { + services."git-maintenance@" = { + Unit = { + Description = "Optimize Git repositories data"; + }; + Service = { + Type = "oneshot"; + ExecStart = ''"${lib.getExe config.programs.git.package}" --exec-path="${lib.getBin config.programs.git.package}/bin" -c credential.interactive=false -c core.askPass=true for-each-repo --config=maintenance.repo maintenance run --schedule=%i''; + LockPersonality = "yes"; + MemoryDenyWriteExecute = "yes"; + NoNewPrivileges = "yes"; + RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_VSOCK"; + RestrictNamespaces = "yes"; + RestrictRealtime = "yes"; + RestrictSUIDSGID = "yes"; + SystemCallArchitectures = "native"; + SystemCallFilter = "@system-service"; + }; + }; + timers = { + "git-maintenance@hourly" = { + Unit = { + Description = "Optimize Git repositories data"; + }; + Timer = { + OnCalendar = "*-*-* *:00:00"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; + "git-maintenance@daily" = { + Unit = { + Description = "Optimize Git repositories data"; + }; + Timer = { + OnCalendar = "*-*-* 20:00:00"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; + "git-maintenance@weekly" = { + Unit = { + Description = "Optimize Git repositories data"; + }; + Timer = { + OnCalendar = "Sun *-*-* 20:00:00"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; + }; + }; + + programs.git = { + enable = true; + lfs = enabled; + signing = { + key = cfg.signingKey; + inherit (cfg) signByDefault; + }; + settings = { + user = { + name = cfg.userName; + email = cfg.userEmail; + }; + core = { + fsmonitor = true; + }; + init = { + defaultBranch = "main"; + }; + pull = { + rebase = true; + }; + push = { + autoSetupRemote = true; + }; + rebase = { + autoStash = true; + }; + safe = { + directory = "${user.home}/projects/config"; + }; + maintenance = { + repo = [ + "${user.home}/projects/nixpkgs" + "${user.home}/projects/config" + ]; + strategy = "incremental"; + }; + lfs."https://git.christophhollizeck.dev/Daholli/nixos-config.git/info/lfs".locksverify = true; + }; + }; + }; +} diff --git a/modules/home/user/default.nix b/modules/home/user/default.nix new file mode 100644 index 0000000..b383b5a --- /dev/null +++ b/modules/home/user/default.nix @@ -0,0 +1,51 @@ +{ + lib, + config, + namespace, + ... +}: +let + inherit (lib) + types + mkIf + mkDefault + mkMerge + ; + inherit (lib.${namespace}) mkOpt; + + cfg = config.${namespace}.user; + + home-directory = if cfg.name == null then null else "/home/${cfg.name}"; +in +{ + options.${namespace}.user = { + enable = mkOpt types.bool true "Whether to configure the user account."; + name = mkOpt (types.nullOr types.str) (config.snowfallorg.user.name or "cholli" + ) "The user account."; + + fullName = mkOpt types.str "Christoph Hollizeck" "The full name of the user."; + email = mkOpt types.str "christoph.hollizeck@hey.com" "The email of the user."; + + home = mkOpt (types.nullOr types.str) home-directory "The user's home directory."; + }; + + config = mkIf cfg.enable (mkMerge [ + { + assertions = [ + { + assertion = cfg.name != null; + message = "${namespace}.user.name must be set"; + } + { + assertion = cfg.home != null; + message = "${namespace}.user.home must be set"; + } + ]; + + home = { + username = mkDefault cfg.name; + homeDirectory = mkDefault cfg.home; + }; + } + ]); +} diff --git a/modules/hosts/yggdrasil/default.nix b/modules/hosts/yggdrasil/default.nix deleted file mode 100644 index d08d755..0000000 --- a/modules/hosts/yggdrasil/default.nix +++ /dev/null @@ -1,149 +0,0 @@ -{ - config, - ... -}: -let -in -{ - flake.modules.nixos."hosts/yggdrasil" = - { lib, pkgs, ... }: - { - nixpkgs.config.allowUnfree = true; - - environment.systemPackages = with pkgs; [ - teamviewer - teams-for-linux - - pyfa - obsidian - diebahn - - path-of-building - ]; - - services.teamviewer.enable = true; - environment.pathsToLink = [ "/libexec" ]; - - programs.ssh.extraConfig = '' - AddressFamily inet - ''; - - imports = - with config.flake.modules.nixos; - [ - # System modules - base - dev - desktop - games - - # hardware - audio - bluetooth - amdgpu - - # dektops - hyprland - - # apps - _1password - - # Users - cholli - ] - ++ [ - { - home-manager.users.cholli = { - imports = with config.flake.modules.homeManager; [ - base - dev - - # Activate all user based config - cholli - ]; - }; - } - - ]; - - nix = { - distributedBuilds = true; - settings.builders-use-substitutes = true; - buildMachines = [ - { - hostName = "nixberry"; - sshUser = "remotebuild"; - sshKey = "/root/.ssh/remotebuild"; - systems = [ "aarch64-linux" ]; - protocol = "ssh-ng"; - - supportedFeatures = [ - "nixos-test" - "big-parallel" - "kvm" - ]; - } - ]; - }; - - boot = { - kernelPackages = pkgs.linuxPackages_latest; - - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - initrd.availableKernelModules = [ - "nvme" - "ahci" - "xhci_pci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - kernelModules = [ "kvm-amd" ]; - - }; - - services.fstrim.enable = true; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/b1a956f4-91d5-456e-a92b-be505bb719bd"; - fsType = "ext4"; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/B4D4-8BA0"; - fsType = "vfat"; - options = [ - "fmask=0077" - "dmask=0077" - ]; - }; - - "/storage" = { - device = "/dev/disk/by-uuid/c3c1dec1-7716-4c37-a3f2-bb60f9af84fd"; - fsType = "ext4"; - }; - - "/var/lib/bluetooth" = { - device = "/persist/var/lib/bluetooth"; - options = [ - "bind" - "noauto" - "x-systemd.automount" - ]; - noCheck = true; - }; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/4bec00ec-e9eb-4034-836a-ecf15e0bb40e"; } - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = true; - }; -} diff --git a/modules/nixos/README.md b/modules/nixos/README.md new file mode 100644 index 0000000..2bb0624 --- /dev/null +++ b/modules/nixos/README.md @@ -0,0 +1,50 @@ +# System configuration + +## apps + +These contain specialized configurations some simple some more complex to enable programs and everything around them. +This section also has a subsection `cli-apps` which is exclusively for apps that live in your terminal. + +## [archetypes](./archetypes/README.md) + +This section contains configurations that enable whole system types at once, check out the more in depth Readme in that section + +Planned archetypes are: +- gaming (this is mostly fleshed out since I use it on my main machine) +- wsl +- pi +- minimal-server +- github runner? + + +## [desktop](./desktop/README.md) + +This section contains everything related to GUI. +currently I am using Hyprland, but I was using more or less out of the box KDE for a long time and was very happy with it. +It also has a `addons` section where I plan to put all configurations for things of the hyprland ecosystem and bars such as waybar / ags (in the future). + +## security + +This has some of the configuration you need for your system to run properly, gpg has the yubikey configuration, the keyring is well a keyring, so that your computer can access the TPM, and also [sops-nix](https://github.com/Mic92/sops-nix) which I would recommend to setup for critical information. + +## services + +This section is fairly empty, but will be filled up when I start with the server configs. + +## [submodules](./submodules/README.md) + +This is the smaller archetypes section, just to combine some aspects that are never used alone into one package, such as the basic one that activates all the mandatory things I don't want to write out every time. + +## system + +This section is home to all of the low level system related configuration, it contains sections for your hardware, keyboard layouts what boot attributes to set, and which fonts to install. + +## tools + +This section could also be part of the cli-apps section but I want to have more system critical things here e.g Git and direnv both amazing tools that deserve a special spot in this config. + +## user + +Here you define the user, or I guess users if you have more people using this system, I will think about multi user systems when I need to :D + + diff --git a/modules/nixos/apps/_1password/default.nix b/modules/nixos/apps/_1password/default.nix new file mode 100644 index 0000000..e3c5a13 --- /dev/null +++ b/modules/nixos/apps/_1password/default.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + + cfg = config.${namespace}.apps._1password; + username = config.${namespace}.user.name; +in +{ + + options.${namespace}.apps._1password = { + enable = mkBoolOpt true "Enable 1Password"; + }; + + config = mkIf cfg.enable { + programs = { + _1password.enable = true; + _1password-gui = { + enable = true; + polkitPolicyOwners = [ username ]; + }; + }; + + ${namespace}.home.file.".ssh/config".text = '' + Host * + ForwardAgent yes + IdentityAgent /home/${username}/.1password/agent.sock + + Host loptland + Hostname christophhollizeck.dev + ''; + }; +} diff --git a/modules/base/system/helix.nix b/modules/nixos/apps/cli-apps/helix/default.nix similarity index 82% rename from modules/base/system/helix.nix rename to modules/nixos/apps/cli-apps/helix/default.nix index 1d801b1..dd95e19 100644 --- a/modules/base/system/helix.nix +++ b/modules/nixos/apps/cli-apps/helix/default.nix @@ -1,29 +1,40 @@ { - flake.modules = { - nixos.base = - { - inputs, - pkgs, - ... - }: - let - helix-pkg = inputs.helix.packages.${pkgs.system}.default; - in - { - environment = { - systemPackages = [ - helix-pkg - ]; - }; + config, + inputs, + lib, + namespace, + pkgs, + system, + ... +}: +let + inherit (lib) mkIf mkEnableOption mkOption; + cfg = config.${namespace}.apps.cli-apps.helix; - }; + cachix-url = "https://helix.cachix.org"; + cachix-key = "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="; - homeManager.cholli = - { inputs, pkgs, ... }: - let - helix-pkg = inputs.helix.packages.${pkgs.system}.default; - in - { + helix-pkg = inputs.helix.packages.${system}.default; +in +{ + options.${namespace}.apps.cli-apps.helix = { + enable = mkEnableOption "Whether to enable helix or not"; + pkg = mkOption { + type = lib.types.package; + default = helix-pkg; + description = "Which helix pacakge to use"; + }; + }; + + config = mkIf cfg.enable { + environment = { + systemPackages = [ + cfg.pkg + ]; + }; + + ${namespace} = { + home.extraOptions = { home.file.".config/helix/ignore".text = '' .idea/ !**/appsettings.json @@ -150,6 +161,10 @@ }; }; }; - }; + nix.extra-substituters.${cachix-url} = { + key = cachix-key; + }; + }; + }; } diff --git a/modules/nixos/apps/cli-apps/nixvim/default.nix b/modules/nixos/apps/cli-apps/nixvim/default.nix new file mode 100644 index 0000000..7f27cdc --- /dev/null +++ b/modules/nixos/apps/cli-apps/nixvim/default.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + cfg = config.${namespace}.apps.cli-apps.nixvim; +in +{ + options.${namespace}.apps.cli-apps.nixvim = { + enable = mkBoolOpt false "Whether to enable nixvim or not (Default true)"; + }; + + config = mkIf cfg.enable { + environment = { + systemPackages = with pkgs; [ + less + nvim-pkg + ]; + variables = { + EDITOR = "nvim"; + SUDOEDITOR = "nvim"; + PAGER = "less"; + MANPAGER = "less"; + }; + }; + + ${namespace}.home = { + extraOptions = { + # Use Neovim for Git diffs. + programs.fish.shellAliases.vimdiff = "nvim -d"; + }; + }; + }; +} diff --git a/modules/nixos/apps/discord/default.nix b/modules/nixos/apps/discord/default.nix new file mode 100644 index 0000000..eb1f2ae --- /dev/null +++ b/modules/nixos/apps/discord/default.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + namespace, + pkgs, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.apps.discord; +in +{ + options.${namespace}.apps.discord = with types; { + enable = mkBoolOpt false "Whether or not to enable basic configuration"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + discord + vesktop + ]; + }; +} diff --git a/modules/nixos/apps/obs-studio/default.nix b/modules/nixos/apps/obs-studio/default.nix new file mode 100644 index 0000000..71387bf --- /dev/null +++ b/modules/nixos/apps/obs-studio/default.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.apps.obs-studio; +in +{ + options.${namespace}.apps.obs-studio = with types; { + enable = mkBoolOpt false "Whether or not to enable obs-studio"; + }; + + config = mkIf cfg.enable { + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-move-transition + ]; + }; + + }; +} diff --git a/modules/nixos/apps/starsector/default.nix b/modules/nixos/apps/starsector/default.nix new file mode 100644 index 0000000..4cab34d --- /dev/null +++ b/modules/nixos/apps/starsector/default.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.apps.starsector; +in +{ + options.${namespace}.apps.starsector = { + enable = mkEnableOption "Whether or not to enable the game starsector."; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + starsector + ]; + }; +} diff --git a/modules/nixos/apps/steam/default.nix b/modules/nixos/apps/steam/default.nix new file mode 100644 index 0000000..7db3981 --- /dev/null +++ b/modules/nixos/apps/steam/default.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.apps.steam; +in +{ + options.${namespace}.apps.steam = { + enable = mkEnableOption "Whether or not to enable support for Steam."; + }; + + config = mkIf cfg.enable { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + extraCompatPackages = with pkgs; [ proton-ge-bin ]; + }; + + environment.systemPackages = with pkgs; [ + protontricks + ]; + }; +} diff --git a/modules/nixos/apps/teamspeak/default.nix b/modules/nixos/apps/teamspeak/default.nix new file mode 100644 index 0000000..9a6056c --- /dev/null +++ b/modules/nixos/apps/teamspeak/default.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.apps.teamspeak; +in +{ + options.${namespace}.apps.teamspeak = with types; { + enable = mkBoolOpt false "Whether or not to enable basic configuration"; + }; + + config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ teamspeak6-client ]; }; +} diff --git a/modules/nixos/apps/vivaldi/default.nix b/modules/nixos/apps/vivaldi/default.nix new file mode 100644 index 0000000..6a730ef --- /dev/null +++ b/modules/nixos/apps/vivaldi/default.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + namespace, + pkgs, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.apps.vivaldi; +in +{ + options.${namespace}.apps.vivaldi = with types; { + enable = mkBoolOpt false "Whether or not to enable vivaldi browser"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + vivaldi + vivaldi-ffmpeg-codecs + qt5.qtwayland + ]; + + environment.etc = { + "1password/custom_allowed_browsers" = { + text = '' + vivaldi-bin + ''; + mode = "0755"; + }; + }; + + # environment.sessionVariables.NIXOS_OZONE_WL = "1"; + }; +} diff --git a/modules/nixos/apps/zen-browser/default.nix b/modules/nixos/apps/zen-browser/default.nix new file mode 100644 index 0000000..35f4905 --- /dev/null +++ b/modules/nixos/apps/zen-browser/default.nix @@ -0,0 +1,40 @@ +{ + config, + inputs, + lib, + namespace, + system, + ... +}: + +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.apps.zen-browser; + + zenbrowser = inputs.zen-browser.packages."${system}".default; +in +{ + options.${namespace}.apps.zen-browser = { + enable = mkEnableOption "Whether or not to enable zen browser"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ + zenbrowser + ]; + + environment.sessionVariables = { + DEFAULT_BROWSER = "${zenbrowser}/bin/zen-beta"; + BROWSER = "zen-beta"; + }; + + environment.etc = { + "1password/custom_allowed_browsers" = { + text = '' + zen + ''; + mode = "0755"; + }; + }; + }; +} diff --git a/modules/nixos/archetypes/README.md b/modules/nixos/archetypes/README.md new file mode 100644 index 0000000..95cdca7 --- /dev/null +++ b/modules/nixos/archetypes/README.md @@ -0,0 +1,22 @@ +# Archetypes + +## Gaming + +This archetype installs Steam and the Prismlauncher, a graphical user interface (KDE) and some other basic functionality. +I want to look into also setting up some factorio configs declarative later. Maybe setup Lutris to allow for some other games aswell. +Currently Steam with proton is working amazingly. + +## Workstation + +Mainly for Office or daily stuff, libre Office, Pdf readers and the likes come to mind. + +## Server + +I want to try setting up a DIY NAS at home using nix and maybe a rasberry pie but there is no real concrete plan for now. + +## Pi / Homeassistant + +> [!WARNING] +> WIP + + diff --git a/modules/nixos/archetypes/gaming/default.nix b/modules/nixos/archetypes/gaming/default.nix new file mode 100644 index 0000000..be26cb8 --- /dev/null +++ b/modules/nixos/archetypes/gaming/default.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + namespace, + pkgs, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.archetypes.gaming; +in +{ + options.${namespace}.archetypes.gaming = with types; { + enable = mkBoolOpt false "Whether or not to enable the gaming archetype."; + }; + + config = mkIf cfg.enable { + ${namespace} = { + submodules = { + basics = enabled; + games = enabled; + socials = enabled; + }; + + system.hardware = { + audio = enabled; + }; + + apps = { + zen-browser = enabled; + }; + }; + }; +} diff --git a/modules/nixos/desktop/README.md b/modules/nixos/desktop/README.md new file mode 100644 index 0000000..e137354 --- /dev/null +++ b/modules/nixos/desktop/README.md @@ -0,0 +1,5 @@ +# Desktop Configurations + +Here I have all of my desktop-/windowmanager configuration and their erspective configurable addons. + +For now this is mostly reserved for [Hyprland](https://hyprland.org/). diff --git a/modules/desktop/addons/hypridle.nix b/modules/nixos/desktop/addons/hypridle/default.nix similarity index 64% rename from modules/desktop/addons/hypridle.nix rename to modules/nixos/desktop/addons/hypridle/default.nix index 7d7121c..7b93adb 100644 --- a/modules/desktop/addons/hypridle.nix +++ b/modules/nixos/desktop/addons/hypridle/default.nix @@ -1,7 +1,21 @@ { - flake.modules.homeManager.cholli = - { ... }: - { + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.desktop.addons.hypridle; +in +{ + options.${namespace}.desktop.addons.hypridle = { + enable = mkEnableOption "Enable HyprIdle"; + }; + + config = mkIf cfg.enable { + ${namespace}.home.extraOptions = { services.hypridle = { enable = true; settings = { @@ -25,4 +39,5 @@ }; }; }; + }; } diff --git a/modules/nixos/desktop/addons/hyprlock/default.nix b/modules/nixos/desktop/addons/hyprlock/default.nix new file mode 100644 index 0000000..65f1273 --- /dev/null +++ b/modules/nixos/desktop/addons/hyprlock/default.nix @@ -0,0 +1,136 @@ +{ + config, + inputs, + lib, + namespace, + pkgs, + system, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + + hyprlock-package = inputs.hyprlock.packages.${system}.hyprlock; + + hyprlock-blur = pkgs.writeShellScriptBin "hyprlock-blur" '' + ${pkgs.grim}/bin/grim -o DP-1 -l 0 /tmp/screenshot1.png & + ${pkgs.grim}/bin/grim -o HDMI-A-1 -l 0 /tmp/screenshot2.png & + wait && + hyprlock + ''; + + cfg = config.${namespace}.desktop.addons.hyprlock; + + username = config.${namespace}.user.name; +in +{ + options.${namespace}.desktop.addons.hyprlock = { + enable = mkEnableOption "Enable Hyprlock"; + }; + + config = mkIf cfg.enable { + security.pam.services.hyprlock = { + allowNullPassword = false; + startSession = false; + text = '' + auth include login + account include login + ''; + }; + + environment.systemPackages = [ hyprlock-blur ]; + + ${namespace}.desktop.hyprland.settings = { + bind = [ + "$mod CTRL, l, exec, hyprlock-blur" + ]; + }; + + snowfallorg.users.${username}.home.config = { + + programs.hyprlock = { + enable = true; + package = hyprlock-package; + settings = { + # inspiration from https://github.com/justinmdickey/publicdots/blob/main/.config/hypr/hyprlock.conf + background = [ + { + monitor = "DP-1"; + path = "/tmp/screenshot1.png"; + + blur_passes = 1; # 0 disables blurring + blur_size = 7; + noise = 1.17e-2; + } + { + monitor = "HDMI-A-1"; + path = "/tmp/screenshot2.png"; + + blur_passes = 2; # 0 disables blurring + blur_size = 7; + noise = 1.17e-2; + } + ]; + + label = [ + { + monitor = "DP-1"; + text = "$TIME"; + color = "rgba(242, 243, 244, 0.75)"; + font_size = 95; + font_family = "JetBrains Mono"; + position = "0, 300"; + halign = "center"; + valign = "center"; + } + { + + monitor = "DP-1"; + text = ''cmd[update:1000] echo $(date +"%A, %B %d")''; + color = "rgba(242, 243, 244, 0.75)"; + font_size = 22; + font_family = "JetBrains Mono"; + position = "0, 200"; + halign = "center"; + valign = "center"; + + } + ]; + + image = { + monitor = "DP-1"; + path = "/home/${username}/Pictures/profile.png"; + + position = "0, 50"; + halign = "center"; + valign = "center"; + }; + + input-field = { + monitor = "DP-1"; + size = "200,50"; + outline_thickness = 2; + dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.35; # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true; + outer_color = "rgba(0, 0, 0, 0)"; + inner_color = "rgba(0, 0, 0, 0.2)"; + font_color = "rgb(111, 45, 104)"; + fade_on_empty = false; + rounding = -1; + check_color = "rgb(30, 107, 204)"; + placeholder_text = ''Input Password...''; + hide_input = false; + position = "0, -100"; + halign = "center"; + valign = "center"; + }; + + general = { + auth_method = "pam"; + }; + }; + }; + }; + }; +} diff --git a/modules/nixos/desktop/addons/hyprlock/hyprlock_preview.png b/modules/nixos/desktop/addons/hyprlock/hyprlock_preview.png new file mode 100644 index 0000000..be9c212 Binary files /dev/null and b/modules/nixos/desktop/addons/hyprlock/hyprlock_preview.png differ diff --git a/modules/nixos/desktop/addons/hyprpanel/default.nix b/modules/nixos/desktop/addons/hyprpanel/default.nix new file mode 100644 index 0000000..f28f84b --- /dev/null +++ b/modules/nixos/desktop/addons/hyprpanel/default.nix @@ -0,0 +1,510 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) + mkIf + mkEnableOption + ; + + cfg = config.${namespace}.desktop.addons.hyprpanel; + username = config.${namespace}.user.name; + +in +{ + options.${namespace}.desktop.addons.hyprpanel = { + enable = mkEnableOption "Enable HyprIdle"; + }; + + config = mkIf cfg.enable { + + snowfallorg.users.${username}.home.config = { + wayland.windowManager.hyprland.settings.exec-once = [ + "${pkgs.hyprpanel}/bin/hyprpanel" + ]; + + programs.hyprpanel = { + enable = true; + settings = { + menus.dashboard.powermenu.avatar.image = "/home/cholli/Pictures/profile.png"; + + bar = { + launcher.autoDetectIcon = true; + workspaces = { + show_icons = false; + show_numbered = true; + }; + layouts = { + "0" = { + "left" = [ + "dashboard" + "workspaces" + ]; + "middle" = [ + "windowtitle" + ]; + "right" = [ + "volume" + "bluetooth" + "cputemp" + "cpu" + "ram" + "systray" + "clock" + "notifications" + ]; + }; + "1" = { + "left" = [ + "workspaces" + ]; + "right" = [ + "clock" + ]; + }; + }; + customModules = { + ram = { + icon = " "; + labelType = "used/total"; + }; + cpu = { + icon = " "; + leftClick = "kitty --hold btop"; + }; + cpuTemp = { + sensor = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp3_input"; + unit = "metric"; + showUnit = true; + + }; + }; + clock.format = "%a %b %d %H:%M:%S"; + notifications = { + show_total = true; + hideCountWhenZero = false; + }; + }; + + layouts = { + "0" = { + left = [ + "dashboard" + "workspaces" + ]; + middle = [ "windowtitle" ]; + right = [ + "volume" + "bluetooth" + "cputemp" + "cpu" + "ram" + "systray" + "clock" + "notifications" + ]; + }; + "1" = { + left = [ "workspaces" ]; + right = [ "clock" ]; + }; + }; + theme = { + bar = { + floating = true; + background = "#11111b"; + border.color = "#b4befe"; + buttons = { + background = "#242438"; + battery.background = "#242438"; + battery.border = "#f9e2af"; + battery.icon = "#242438"; + battery.icon_background = "#f9e2af"; + battery.text = "#f9e2af"; + bluetooth.background = "#242438"; + bluetooth.border = "#89dceb"; + bluetooth.icon = "#1e1e2e"; + bluetooth.icon_background = "#89dbeb"; + bluetooth.text = "#89dceb"; + borderColor = "#b4befe"; + clock.background = "#242438"; + clock.border = "#f5c2e7"; + clock.icon = "#232338"; + clock.icon_background = "#f5c2e7"; + clock.text = "#f5c2e7"; + dashboard.background = "#f9e2af"; + dashboard.border = "#f9e2af"; + dashboard.icon = "#1e1e2e"; + hover = "#45475a"; + icon = "#242438"; + icon_background = "#b4befe"; + media.background = "#242438"; + media.border = "#b4befe"; + media.icon = "#1e1e2e"; + media.icon_background = "#b4befe"; + media.text = "#b4befe"; + modules.cava.background = "#242438"; + modules.cava.border = "#94e2d5"; + modules.cava.icon = "#242438"; + modules.cava.icon_background = "#94e2d5"; + modules.cava.text = "#94e2d5"; + modules.cpu.background = "#242438"; + modules.cpu.border = "#f38ba8"; + modules.cpu.icon = "#181825"; + modules.cpu.icon_background = "#f38ba8"; + modules.cpu.text = "#f38ba8"; + modules.hypridle.background = "#242438"; + modules.hypridle.border = "#f5c2e7"; + modules.hypridle.icon = "#242438"; + modules.hypridle.icon_background = "#f5c2e7"; + modules.hypridle.text = "#f5c2e7"; + modules.hyprsunset.background = "#242438"; + modules.hyprsunset.border = "#fab387"; + modules.hyprsunset.icon = "#242438"; + modules.hyprsunset.icon_background = "#fab387"; + modules.hyprsunset.text = "#fab387"; + modules.kbLayout.background = "#242438"; + modules.kbLayout.border = "#89dceb"; + modules.kbLayout.icon = "#181825"; + modules.kbLayout.icon_background = "#89dceb"; + modules.kbLayout.text = "#89dceb"; + modules.microphone.background = "#242438"; + modules.microphone.border = "#a6e3a1"; + modules.microphone.icon = "#242438"; + modules.microphone.icon_background = "#a6e3a1"; + modules.microphone.text = "#a6e3a1"; + modules.netstat.background = "#242438"; + modules.netstat.border = "#a6e3a1"; + modules.netstat.icon = "#181825"; + modules.netstat.icon_background = "#a6e3a1"; + modules.netstat.text = "#a6e3a1"; + modules.power.background = "#242438"; + modules.power.border = "#f38ba8"; + modules.power.icon = "#181825"; + modules.power.icon_background = "#f38ba8"; + modules.ram.background = "#242438"; + modules.ram.border = "#f9e2af"; + modules.ram.icon = "#181825"; + modules.ram.icon_background = "#f9e2af"; + modules.ram.text = "#f9e2af"; + modules.storage.background = "#242438"; + modules.storage.border = "#f5c2e7"; + modules.storage.icon = "#181825"; + modules.storage.icon_background = "#f5c2e7"; + modules.storage.text = "#f5c2e7"; + modules.submap.background = "#242438"; + modules.submap.border = "#94e2d5"; + modules.submap.icon = "#181825"; + modules.submap.icon_background = "#94e2d5"; + modules.submap.text = "#94e2d5"; + modules.updates.background = "#242438"; + modules.updates.border = "#cba6f7"; + modules.updates.icon = "#181825"; + modules.updates.icon_background = "#cba6f7"; + modules.updates.text = "#cba6f7"; + modules.weather.background = "#242438"; + modules.weather.border = "#b4befe"; + modules.weather.icon = "#242438"; + modules.weather.icon_background = "#b4befe"; + modules.weather.text = "#b4befe"; + modules.worldclock.background = "#242438"; + modules.worldclock.border = "#f5c2e7"; + modules.worldclock.icon = "#242438"; + modules.worldclock.icon_background = "#f5c2e7"; + modules.worldclock.text = "#f5c2e7"; + network.background = "#242438"; + network.border = "#cba6f7"; + network.icon = "#242438"; + network.icon_background = "#caa6f7"; + network.text = "#cba6f7"; + notifications.background = "#242438"; + notifications.border = "#b4befe"; + notifications.icon = "#1e1e2e"; + notifications.icon_background = "#b4befe"; + notifications.total = "#b4befe"; + style = "split"; + systray.background = "#242438"; + systray.border = "#b4befe"; + systray.customIcon = "#cdd6f4"; + text = "#b4befe"; + volume.background = "#242438"; + volume.border = "#eba0ac"; + volume.icon = "#242438"; + volume.icon_background = "#eba0ac"; + volume.text = "#eba0ac"; + windowtitle.background = "#242438"; + windowtitle.border = "#f5c2e7"; + windowtitle.icon = "#1e1e2e"; + windowtitle.icon_background = "#f5c2e7"; + windowtitle.text = "#f5c2e7"; + workspaces.active = "#f5c2e7"; + workspaces.available = "#89dceb"; + workspaces.background = "#242438"; + workspaces.border = "#f5c2e7"; + workspaces.hover = "#f5c2e7"; + workspaces.numbered_active_highlighted_text_color = "#181825"; + workspaces.numbered_active_underline_color = "#f5c2e7"; + workspaces.occupied = "#f2cdcd"; + y_margins = "0.2em"; + }; + menus = { + background = "#11111b"; + border.color = "#313244"; + buttons.active = "#f5c2e6"; + buttons.default = "#b4befe"; + buttons.disabled = "#585b71"; + buttons.text = "#181824"; + cards = "#1e1e2e"; + check_radio_button.active = "#b4beff"; + check_radio_button.background = "#45475a"; + dimtext = "#585b70"; + dropdownmenu.background = "#11111b"; + dropdownmenu.divider = "#1e1e2e"; + dropdownmenu.text = "#cdd6f4"; + feinttext = "#313244"; + iconbuttons.active = "#b4beff"; + iconbuttons.passive = "#cdd6f3"; + icons.active = "#b4befe"; + icons.passive = "#585b70"; + label = "#b4befe"; + listitems.active = "#b4befd"; + listitems.passive = "#cdd6f4"; + menu = { + battery.background.color = "#11111b"; + battery.border.color = "#313244"; + battery.card.color = "#1e1e2e"; + battery.icons.active = "#f9e2af"; + battery.icons.passive = "#9399b2"; + battery.label.color = "#f9e2af"; + battery.listitems.active = "#f9e2af"; + battery.listitems.passive = "#cdd6f3"; + battery.slider.background = "#585b71"; + battery.slider.backgroundhover = "#45475a"; + battery.slider.primary = "#f9e2af"; + battery.slider.puck = "#6c7086"; + battery.text = "#cdd6f4"; + bluetooth.background.color = "#11111b"; + bluetooth.border.color = "#313244"; + bluetooth.card.color = "#1e1e2e"; + bluetooth.iconbutton.active = "#89dceb"; + bluetooth.iconbutton.passive = "#cdd6f4"; + bluetooth.icons.active = "#89dceb"; + bluetooth.icons.passive = "#9399b2"; + bluetooth.label.color = "#89dceb"; + bluetooth.listitems.active = "#89dcea"; + bluetooth.listitems.passive = "#cdd6f4"; + bluetooth.scroller.color = "#89dceb"; + bluetooth.status = "#6c7086"; + bluetooth.switch.disabled = "#313245"; + bluetooth.switch.enabled = "#89dceb"; + bluetooth.switch.puck = "#454759"; + bluetooth.switch_divider = "#45475a"; + bluetooth.text = "#cdd6f4"; + clock.background.color = "#11111b"; + clock.border.color = "#313244"; + clock.calendar.contextdays = "#585b70"; + clock.calendar.currentday = "#f5c2e7"; + clock.calendar.days = "#cdd6f4"; + clock.calendar.paginator = "#f5c2e6"; + clock.calendar.weekdays = "#f5c2e7"; + clock.calendar.yearmonth = "#94e2d5"; + clock.card.color = "#1e1e2e"; + clock.text = "#cdd6f4"; + clock.time.time = "#f5c2e7"; + clock.time.timeperiod = "#94e2d5"; + clock.weather.hourly.icon = "#f5c2e7"; + clock.weather.hourly.temperature = "#f5c2e7"; + clock.weather.hourly.time = "#f5c2e7"; + clock.weather.icon = "#f5c2e7"; + clock.weather.stats = "#f5c2e7"; + clock.weather.status = "#94e2d5"; + clock.weather.temperature = "#cdd6f4"; + clock.weather.thermometer.cold = "#89b4fa"; + clock.weather.thermometer.extremelycold = "#89dceb"; + clock.weather.thermometer.extremelyhot = "#f38ba8"; + clock.weather.thermometer.hot = "#fab387"; + clock.weather.thermometer.moderate = "#b4befe"; + dashboard.background.color = "#11111b"; + dashboard.border.color = "#313244"; + dashboard.card.color = "#1e1e2e"; + dashboard.controls.bluetooth.background = "#89dceb"; + dashboard.controls.bluetooth.text = "#181824"; + dashboard.controls.disabled = "#585b70"; + dashboard.controls.input.background = "#f5c2e7"; + dashboard.controls.input.text = "#181824"; + dashboard.controls.notifications.background = "#f9e2af"; + dashboard.controls.notifications.text = "#181824"; + dashboard.controls.volume.background = "#eba0ac"; + dashboard.controls.volume.text = "#181824"; + dashboard.controls.wifi.background = "#cba6f7"; + dashboard.controls.wifi.text = "#181824"; + dashboard.directories.left.bottom.color = "#eba0ac"; + dashboard.directories.left.middle.color = "#f9e2af"; + dashboard.directories.left.top.color = "#f5c2e7"; + dashboard.directories.right.bottom.color = "#b4befe"; + dashboard.directories.right.middle.color = "#cba6f7"; + dashboard.directories.right.top.color = "#94e2d5"; + dashboard.monitors.bar_background = "#45475a"; + dashboard.monitors.cpu.bar = "#eba0ad"; + dashboard.monitors.cpu.icon = "#eba0ac"; + dashboard.monitors.cpu.label = "#eba0ac"; + dashboard.monitors.disk.bar = "#f5c2e8"; + dashboard.monitors.disk.icon = "#f5c2e7"; + dashboard.monitors.disk.label = "#f5c2e7"; + dashboard.monitors.gpu.bar = "#a6e3a2"; + dashboard.monitors.gpu.icon = "#a6e3a1"; + dashboard.monitors.gpu.label = "#a6e3a1"; + dashboard.monitors.ram.bar = "#f9e2ae"; + dashboard.monitors.ram.icon = "#f9e2af"; + dashboard.monitors.ram.label = "#f9e2af"; + dashboard.powermenu.confirmation.background = "#11111b"; + dashboard.powermenu.confirmation.body = "#cdd6f4"; + dashboard.powermenu.confirmation.border = "#313244"; + dashboard.powermenu.confirmation.button_text = "#11111a"; + dashboard.powermenu.confirmation.card = "#1e1e2e"; + dashboard.powermenu.confirmation.confirm = "#a6e3a1"; + dashboard.powermenu.confirmation.deny = "#f38ba8"; + dashboard.powermenu.confirmation.label = "#b4befe"; + dashboard.powermenu.logout = "#a6e3a1"; + dashboard.powermenu.restart = "#fab387"; + dashboard.powermenu.shutdown = "#f38ba8"; + dashboard.powermenu.sleep = "#89dceb"; + dashboard.profile.name = "#f5c2e7"; + dashboard.shortcuts.background = "#b4befe"; + dashboard.shortcuts.recording = "#a6e3a1"; + dashboard.shortcuts.text = "#181824"; + media.album = "#f5c2e8"; + media.artist = "#94e2d6"; + media.background.color = "#11111b"; + media.border.color = "#313244"; + media.buttons.background = "#b4beff"; + media.buttons.enabled = "#94e2d4"; + media.buttons.inactive = "#585b70"; + media.buttons.text = "#11111b"; + media.card.color = "#1e1e2e"; + media.slider.background = "#585b71"; + media.slider.backgroundhover = "#45475a"; + media.slider.primary = "#f5c2e7"; + media.slider.puck = "#6c7086"; + media.song = "#b4beff"; + media.timestamp = "#cdd6f4"; + network.background.color = "#11111b"; + network.border.color = "#313244"; + network.card.color = "#1e1e2e"; + network.iconbuttons.active = "#cba6f7"; + network.iconbuttons.passive = "#cdd6f4"; + network.icons.active = "#cba6f7"; + network.icons.passive = "#9399b2"; + network.label.color = "#cba6f7"; + network.listitems.active = "#cba6f6"; + network.listitems.passive = "#cdd6f4"; + network.scroller.color = "#cba6f7"; + network.status.color = "#6c7086"; + network.switch.disabled = "#313245"; + network.switch.enabled = "#cba6f7"; + network.switch.puck = "#454759"; + network.text = "#cdd6f4"; + notifications.background = "#11111b"; + notifications.border = "#313244"; + notifications.card = "#1e1e2e"; + notifications.clear = "#f38ba8"; + notifications.label = "#b4befe"; + notifications.no_notifications_label = "#313244"; + notifications.pager.background = "#11111b"; + notifications.pager.button = "#b4befe"; + notifications.pager.label = "#9399b2"; + notifications.scrollbar.color = "#b4befe"; + notifications.switch.disabled = "#313245"; + notifications.switch.enabled = "#b4befe"; + notifications.switch.puck = "#454759"; + notifications.switch_divider = "#45475a"; + power.background.color = "#11111b"; + power.border.color = "#313244"; + power.buttons.logout.background = "#1e1e2e"; + power.buttons.logout.icon = "#181824"; + power.buttons.logout.icon_background = "#a6e3a1"; + power.buttons.logout.text = "#a6e3a1"; + power.buttons.restart.background = "#1e1e2e"; + power.buttons.restart.icon = "#181824"; + power.buttons.restart.icon_background = "#fab387"; + power.buttons.restart.text = "#fab387"; + power.buttons.shutdown.background = "#1e1e2e"; + power.buttons.shutdown.icon = "#181824"; + power.buttons.shutdown.icon_background = "#f38ba7"; + power.buttons.shutdown.text = "#f38ba8"; + power.buttons.sleep.background = "#1e1e2e"; + power.buttons.sleep.icon = "#181824"; + power.buttons.sleep.icon_background = "#89dceb"; + power.buttons.sleep.text = "#89dceb"; + systray.dropdownmenu.background = "#11111b"; + systray.dropdownmenu.divider = "#1e1e2e"; + systray.dropdownmenu.text = "#cdd6f4"; + volume.audio_slider.background = "#585b71"; + volume.audio_slider.backgroundhover = "#45475a"; + volume.audio_slider.primary = "#eba0ac"; + volume.audio_slider.puck = "#585b70"; + volume.background.color = "#11111b"; + volume.border.color = "#313244"; + volume.card.color = "#1e1e2e"; + volume.iconbutton.active = "#eba0ac"; + volume.iconbutton.passive = "#cdd6f4"; + volume.icons.active = "#eba0ac"; + volume.icons.passive = "#9399b2"; + volume.input_slider.background = "#585b71"; + volume.input_slider.backgroundhover = "#45475a"; + volume.input_slider.primary = "#eba0ac"; + volume.input_slider.puck = "#585b70"; + volume.label.color = "#eba0ac"; + volume.listitems.active = "#eba0ab"; + volume.listitems.passive = "#cdd6f4"; + volume.text = "#cdd6f4"; + }; + popover.background = "#181824"; + popover.border = "#181824"; + popover.text = "#b4befe"; + progressbar.background = "#45475a"; + progressbar.foreground = "#b4befe"; + slider.background = "#585b71"; + slider.backgroundhover = "#45475a"; + slider.primary = "#b4befe"; + slider.puck = "#6c7086"; + switch.disabled = "#313245"; + switch.enabled = "#b4befe"; + switch.puck = "#454759"; + text = "#cdd6f4"; + tooltip.background = "#11111b"; + tooltip.text = "#cdd6f4"; + }; + outer_spacing = "0.0em"; + transparent = true; + + }; + notification.actions.background = "#b4befd"; + notification.actions.text = "#181825"; + notification.background = "#181826"; + notification.border = "#313243"; + notification.close_button.background = "#f38ba7"; + notification.close_button.label = "#11111b"; + notification.label = "#b4befe"; + notification.labelicon = "#b4befe"; + notification.text = "#cdd6f4"; + notification.time = "#7f849b"; + osd.bar_color = "#b4beff"; + osd.bar_container = "#11111b"; + osd.bar_empty_color = "#313244"; + osd.bar_overflow_color = "#f38ba7"; + osd.icon = "#11111b"; + osd.icon_container = "#b4beff"; + osd.label = "#b4beff"; + + }; + }; + }; + }; + + }; +} diff --git a/modules/desktop/addons/hyprpaper.nix b/modules/nixos/desktop/addons/hyprpaper/default.nix similarity index 53% rename from modules/desktop/addons/hyprpaper.nix rename to modules/nixos/desktop/addons/hyprpaper/default.nix index 737eef8..5a7c2a9 100644 --- a/modules/desktop/addons/hyprpaper.nix +++ b/modules/nixos/desktop/addons/hyprpaper/default.nix @@ -1,10 +1,24 @@ { - flake.modules.homeManager.cholli = - { ... }: - let - picture-path = "/home/cholli/Pictures/firewatch.jpg"; - in - { + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.desktop.addons.hyprpaper; + + username = config.${namespace}.user.name; + picture-path = "/home/${username}/Pictures/firewatch.jpg"; +in +{ + options.${namespace}.desktop.addons.hyprpaper = { + enable = mkEnableOption "Enable Hyprpaper"; + }; + + config = mkIf cfg.enable { + snowfallorg.users.${username}.home.config = { home.file = { # https://www.reddit.com/r/WidescreenWallpaper/comments/13hib3t/purple_firewatch_3840x1620/ "Pictures/firewatch.jpg".source = ./firewatch.jpg; @@ -21,6 +35,7 @@ wallpaper = "DP-1,${picture-path}"; }; }; - }; + + }; } diff --git a/modules/desktop/addons/firewatch.jpg b/modules/nixos/desktop/addons/hyprpaper/firewatch.jpg similarity index 100% rename from modules/desktop/addons/firewatch.jpg rename to modules/nixos/desktop/addons/hyprpaper/firewatch.jpg diff --git a/modules/nixos/desktop/addons/rofi/config.rasi b/modules/nixos/desktop/addons/rofi/config.rasi new file mode 100644 index 0000000..285b224 --- /dev/null +++ b/modules/nixos/desktop/addons/rofi/config.rasi @@ -0,0 +1,134 @@ +/*Dracula theme based on the Purple official rofi theme*/ +/* https://github.com/dracula/rofi/tree/main */ + +configuration { + show-icons: true; + display-drun: ""; + disable-history: false; +} + +* { + font: "Jetbrains Mono 12"; + foreground: #f8f8f2; + background-color: #282a36; + active-background: #6272a4; + urgent-background: #ff5555; + urgent-foreground: #282a36; + selected-background: @active-background; + selected-urgent-background: @urgent-background; + selected-active-background: @active-background; + separatorcolor: @active-background; + bordercolor: @active-background; +} + +#window { + background-color: @background-color; + border: 3; + border-radius: 6; + border-color: @bordercolor; + padding: 15; +} +#mainbox { + border: 0; + padding: 0; +} +#message { + border: 0px; + border-color: @separatorcolor; + padding: 1px; +} +#textbox { + text-color: @foreground; +} +#listview { + fixed-height: 0; + border: 0px; + border-color: @bordercolor; + spacing: 2px ; + scrollbar: false; + padding: 2px 0px 0px ; +} +#element { + border: 0; + padding: 3px ; +} +#element.normal.normal { + background-color: @background-color; + text-color: @foreground; +} +#element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +#element.normal.active { + background-color: @active-background; + text-color: @foreground; +} +#element.selected.normal { + background-color: @selected-background; + text-color: @foreground; +} +#element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @foreground; +} +#element.selected.active { + background-color: @selected-active-background; + text-color: @foreground; +} +#element.alternate.normal { + background-color: @background-color; + text-color: @foreground; +} +#element.alternate.urgent { + background-color: @urgent-background; + text-color: @foreground; +} +#element.alternate.active { + background-color: @active-background; + text-color: @foreground; +} +#scrollbar { + width: 2px ; + border: 0; + handle-width: 8px ; + padding: 0; +} +#sidebar { + border: 2px dash 0px 0px ; + border-color: @separatorcolor; +} +#button.selected { + background-color: @selected-background; + text-color: @foreground; +} +#inputbar { + spacing: 0; + text-color: @foreground; + padding: 1px ; +} +#case-indicator { + spacing: 0; + text-color: @foreground; +} +#entry { + spacing: 0; + text-color: @foreground; +} +#prompt { + spacing: 0; + text-color: @foreground; +} +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ">"; + margin: 0px 0.3em 0em 0em ; + text-color: @foreground; +} +element-text, element-icon { + background-color: inherit; + text-color: inherit; +} diff --git a/modules/nixos/desktop/addons/rofi/default.nix b/modules/nixos/desktop/addons/rofi/default.nix new file mode 100644 index 0000000..482dea8 --- /dev/null +++ b/modules/nixos/desktop/addons/rofi/default.nix @@ -0,0 +1,35 @@ +{ + config, + namespace, + options, + pkgs, + lib, + ... +}: +let + cfg = config.${namespace}.desktop.addons.rofi; + + inherit (lib) + mkIf + mkEnableOption + mkOption + types + ; +in +{ + options.${namespace}.desktop.addons.rofi = { + enable = mkEnableOption "Rofi"; + package = mkOption { + type = types.package; + default = pkgs.rofi; + description = "The package to use for Rofi"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + ${namespace}.home.file = { + ".config/rofi/config.rasi".source = ./config.rasi; + }; + }; +} diff --git a/modules/nixos/desktop/addons/waybar/config.jsonc b/modules/nixos/desktop/addons/waybar/config.jsonc new file mode 100644 index 0000000..6a998e9 --- /dev/null +++ b/modules/nixos/desktop/addons/waybar/config.jsonc @@ -0,0 +1,194 @@ +{ + "layer": "top", + "height": 42, + "position": "top", + "mod": "dock", + "margin-left": 10, + "margin-right": 10, + "margin-top": 7, + "margin-bottom": 0, + "exclusive": true, + "passthrough": false, + "gtk-layer-shell": true, + "reload_style_on_change": true, + "modules-left": [ + "custom/smallspacer", + "hyprland/workspaces", + "custom/spacer" + ], + "modules-center": [ + "custom/padd", + "custom/l_end", + "custom/r_end", + "hyprland/window", + "custom/padd" + ], + "modules-right": [ + "custom/padd", + "custom/l_end", + "tray", + "custom/smallspacer", + "pulseaudio", + "pulseaudio/slider", + "memory", + "cpu", + "clock", + "custom/padd" + ], + "custom/smallspacer": { + "format": " " + }, + "memory": { + "interval": 1, + "rotate": 270, + "format": "{icon}", + "format-icons": [ + "󰝦", + "󰪞", + "󰪟", + "󰪠", + "󰪡", + "󰪢", + "󰪣", + "󰪤", + "󰪥" + ], + "max-length": 10 + }, + "cpu": { + "interval": 1, + "format": "{icon}", + "rotate": 270, + "format-icons": [ + "󰝦", + "󰪞", + "󰪟", + "󰪠", + "󰪡", + "󰪢", + "󰪣", + "󰪤", + "󰪥" + ] + }, + "tray": { + "icon-size": 18, + "rotate": 0, + "spacing": 3 + }, + "hyprland/window": { + "format": "{initialTitle}", + "max-length": 120, + "separate-outputs": true, + "icon": false, + "icon-size": 18 + }, + "custom/spacer": { + "format": "|" + }, + "hyprland/workspaces": { + "format": "{icon}", + "format-icons": { + "default": "", + "active": "" + } + }, + "wlr/workspaces": { + "persistent-workspaces": { + "1": [ + "DP-2" + ], + "2": [ + "HDMI-A-1" + ], + "3": [ + "DP-2" + ], + "4": [ + "HDMI-A-1" + ] + } + }, + "idle_inhibitor": { + "format": "{icon}", + "rotate": 0, + "format-icons": { + "activated": "󰥔", + "deactivated": "" + } + }, + "clock": { + "format": "{:%H:%M}", + "rotate": 0, + "tooltip-format": "{calendar}", + "calendar": { + "mode": "month", + "mode-mon-col": 3, + "on-scroll": 1, + "on-click-right": "mode", + "format": { + "months": "{}", + "weekdays": "{}", + "today": "{}" + } + } + }, + "pulseaudio": { + "format": " {icon}", + "rotate": 0, + "tooltip-format": "{icon} {desc} // {volume}%", + "scroll-step": 5, + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "default": [ + "", + "", + "" + ] + } + }, + "custom/l_end": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "custom/r_end": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "custom/sl_end": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "custom/sr_end": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "custom/rl_end": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "custom/rr_end": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "custom/padd": { + "format": " ", + "interval": "once", + "tooltip": false + }, + "pulseaudio/slider": { + "min": 5, + "max": 100, + "rotate": 0, + "device": "pulseaudio", + "scroll-step": 1 + } +} \ No newline at end of file diff --git a/modules/nixos/desktop/addons/waybar/default.nix b/modules/nixos/desktop/addons/waybar/default.nix new file mode 100644 index 0000000..e9f868a --- /dev/null +++ b/modules/nixos/desktop/addons/waybar/default.nix @@ -0,0 +1,47 @@ +{ + lib, + config, + options, + pkgs, + namespace, + ... +}: +let + cfg = config.${namespace}.desktop.addons.waybar; + + inherit (lib) + mkEnableOption + mkOption + mkIf + types + ; + inherit (lib.${namespace}) enabled; +in +{ + options.${namespace}.desktop.addons.waybar = { + enable = mkEnableOption "Waybar"; + package = mkOption { + type = types.package; + default = pkgs.waybar; + description = "The package to use for Waybar"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + + services.upower = enabled; + fonts.packages = with pkgs; [ + cascadia-code + jetbrains-mono + maple-mono-NF + material-design-icons + noto-fonts-cjk-sans + ]; + + ${namespace}.home.file = { + ".config/waybar/config.jsonc".source = ./config.jsonc; + ".config/waybar/style.css".source = ./style.css; + }; + }; +} diff --git a/modules/nixos/desktop/addons/waybar/style.css b/modules/nixos/desktop/addons/waybar/style.css new file mode 100644 index 0000000..2c72b19 --- /dev/null +++ b/modules/nixos/desktop/addons/waybar/style.css @@ -0,0 +1,240 @@ +* { + font-family: "JetBrains Mono Nerd Font"; + font-weight: bold; + font-size: 16px; +} + +window#waybar { + background: #0F0F17; + border-radius: 12px; + border: 3px solid rgba(255, 255, 255, 0.1); +} + +tooltip { + background: #171717; + color: #A1BDCE; + font-size: 13px; + border-radius: 7px; + border: 2px solid #101a24; +} + +#workspaces { + margin-left: 2px; +} + +#workspaces button { + color: #86aaec; + margin-left: 2px; + background-color: transparent; +} + +#workspaces button.hover { + background-color: transparent; +} + +#workspaces button.active { + color: #c296eb; + background-color: transparent; +} + +#taskbar button { + box-shadow: none; + text-shadow: none; + font-size: 4px; + padding: 0px; + border-radius: 9px; + margin-bottom: 3px; + margin-left: 0px; + padding-left: 3px; + padding-right: 3px; + margin-right: 0px; + color: @wb-color; + animation: tb_normal 20s ease-in-out 1; +} + +#taskbar button.active { + background: @wb-act-bg; + color: @wb-act-color; + margin-left: 3px; + padding-left: 12px; + padding-right: 12px; + margin-right: 3px; + animation: tb_active 20s ease-in-out 1; + transition: all 0.4s cubic-bezier(.55, -0.68, .48, 1.682); + min-height: 9px; +} + +#taskbar button:hover { + background: @wb-hvr-bg; + color: @wb-hvr-color; + animation: tb_hover 20s ease-in-out 1; + transition: all 0.3s cubic-bezier(.55, -0.68, .48, 1.682); +} + +#tray menu * { + min-height: 16px; + font-weight: bold; + font-size: 13px; + color: #9488e3; +} + +#tray menu separator { + min-height: 10px +} + + +#custom-spacer { + opacity: 0.0; +} + +#custom-smallspacer { + opacity: 0.0; +} + +#bluetooth { + color: #E6E7E7; + background: #161320; + opacity: 1; + margin: 4px 0px 4px 0px; + padding-left: 4px; + padding-right: 4px; + +} + +#clock { + color: #A1BDCE; + font-size: 15px; + font-weight: 900; + font-family: "JetBrains Mono Nerd Font"; + background: rgba(23, 23, 23, 0.0); + opacity: 1; + margin: 3px 0px 0px 0px; + padding-left: 10px; + padding-right: 10px; + border: none; + +} + +#pulseaudio { + font-weight: normal; + font-size: 20px; + color: #6F8FDB; + background: rgba(22, 19, 32, 0.0); + opacity: 1; + margin: 0px 0px 0px 0px; + padding-left: 3px; + padding-right: 3px; +} + +#cpu { + font-weight: normal; + font-size: 24px; + color: #915CAF; +} + +#memory { + font-weight: normal; + font-size: 24px; + color: #E4C9AF; +} + +@keyframes blink { + to { + color: #4a4a4a; + } +} + +#tray, +#window { + color: #A1BDCE; + font-family: "Martian Mono"; +} + +#custom-l_end, +#custom-r_end, +#custom-sl_end, +#custom-sr_end, +#custom-rl_end, +#upower#headset, +#upower { + color: #a6d189; +} + +#custom-rr_end { + font-weight: normal; + color: #E8EDF0; + background: rgba(23, 23, 23, 0.0); + opacity: 1; + margin: 0px 0px 0px 0px; + padding-left: 4px; + padding-right: 4px; + ; + +} + +#pulseaudio-slider slider { + background: #A1BDCE; + background-color: transparent; + box-shadow: none; + margin-right: 7px; +} + +#pulseaudio-slider trough { + margin-top: -3px; + min-width: 90px; + min-height: 10px; + margin-bottom: -4px; + border-radius: 8px; + background: #343434; +} + +#pulseaudio-slider highlight { + border-radius: 8px; + background-color: #2096C0; +} + +#taskbar { + padding: 1px; +} + +#custom-r_end { + border-radius: 0px 7px 7px 0px; + margin-right: 1px; + padding-right: 3px; +} + +#custom-l_end { + border-radius: 7px 0px 0px 7px; + margin-left: 1px; + padding-left: 3px; +} + +#custom-sr_end { + border-radius: 0px; + margin-right: 1px; + padding-right: 3px; +} + +#custom-sl_end { + border-radius: 0px; + margin-left: 1px; + padding-left: 3px; +} + +#custom-rr_end { + border-radius: 0px 7px 7px 0px; + margin-right: 1px; + padding-right: 3px; +} + +#custom-rl_end { + border-radius: 7px 0px 0px 7px; + margin-left: 1px; + padding-left: 3px; +} + +#custom-expand { + min-width: 25px; + color: #A1BDCE; + font-size: 16px; +} \ No newline at end of file diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix new file mode 100644 index 0000000..e87e97f --- /dev/null +++ b/modules/nixos/desktop/default.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + user = config.${namespace}.user.name; + + cfg = config.${namespace}.desktop.hyprland; +in +{ + options.${namespace}.desktop = { + enable = mkEnableOption "Whether to enable desktop theming"; + }; + + config = mkIf cfg.enable { + ${namespace}.home.extraOptions = { + + dconf = { + settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; + }; + + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + }; + + systemd.user.sessionVariables = config.home-manager.users.${user}.home.sessionVariables; + }; + + qt = { + enable = true; + platformTheme = "gnome"; + style = "adwaita-dark"; + }; + }; +} diff --git a/modules/desktop/hyprland.nix b/modules/nixos/desktop/hyprland/default.nix similarity index 56% rename from modules/desktop/hyprland.nix rename to modules/nixos/desktop/hyprland/default.nix index 501d408..3bcf28a 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/nixos/desktop/hyprland/default.nix @@ -1,180 +1,219 @@ { - flake.modules = { - nixos.hyprland = - { - config, - inputs, - pkgs, - ... - }: - let - hyprland-package = inputs.hyprland.packages.${pkgs.system}.hyprland; + config, + inputs, + lib, + pkgs, + system, + namespace, + ... +}: +with lib.${namespace}; +let + inherit (lib) + mkIf + mkEnableOption + mkOption + mkMerge + types + ; + cfg = config.${namespace}.desktop.hyprland; - focus-1password = pkgs.writeShellScriptBin "focus-or-open-1pass" '' - running=$(hyprctl -j clients | jq -r '.[] | select(.class == "1password") | .workspace.id') + cachix-url = "https://hyprland.cachix.org"; + cachix-key = "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="; - if [[ $running != "" ]]; then - hyprctl dispatch workspace $running - else - # always open on w/space 4 - hyprctl dispatch workspace 9 - ELECTRON_OZONE_PLATFORM_HINT=x11 1password& - fi - ''; - in - { - environment.systemPackages = - with pkgs; - [ - # Auth Agent - hyprpolkitagent + hyprland-package = inputs.hyprland.packages.${system}.hyprland; - # Notification daemon - libnotify + focus-1password = pkgs.writeShellScriptBin "focus-or-open-1pass" '' + running=$(hyprctl -j clients | jq -r '.[] | select(.class == "1password") | .workspace.id') - # Wayland Utilities - wlr-randr + if [[ $running != "" ]]; then + hyprctl dispatch workspace $running + else + # always open on w/space 4 + hyprctl dispatch workspace 9 + ELECTRON_OZONE_PLATFORM_HINT=x11 1password& + fi + ''; - # Clipboard Stuff - wl-clipboard - xclip - clipnotify - # clipsync + # clipsync = pkgs.writeShellScriptBin "clipsync" '' + # insert() { + # # Read all the piped input into variable. + # value=$(cat) + # wValue="$(wl-paste)" + # xValue="$(xclip -o -selection clipboard)" - # Screenshot Utility - grimblast + # notify() { + # notify-send -u low -c clipboard "$1" "$value" + # } - # File Manager - xfce.thunar + # if [ "$value" != "$wValue" ]; then + # notify "Wayland" + # echo -n "$value" | wl-copy + # fi - # clean sddm theme - elegant-sddm + # if [ "$value" != "$xValue" ]; then + # notify "X11" + # echo -n "$value" | xclip -selection clipboard + # fi + # } - # json cli parser for bash script to focus 1password - jq + # watch() { + # # Wayland -> X11 + # wl-paste --type text --watch clipsync insert & - hyprpanel + # # X11 -> Wayland + # while clipnotify; do + # xclip -o -selection clipboard | clipsync insert + # done & + # } - ##### - xdg-dbus-proxy - ] - ++ lib.optional config.programs._1password.enable focus-1password; + # kill() { + # pkill wl-paste + # pkill clipnotify + # pkill xclip + # pkill clipsync + # } + # "$@" + # ''; - programs = { +in +{ + options.${namespace}.desktop.hyprland = { + enable = mkEnableOption "Whether to enable hyprland"; + settings = mkOption { + type = types.attrs; + default = { }; + description = "Additional Hyprland settings to apply."; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + # Auth Agent + hyprpolkitagent + + # Notification daemon + libnotify + + # Wayland Utilities + wlr-randr + + # Clipboard Stuff + wl-clipboard + xclip + clipnotify + # clipsync + + # Screenshot Utility + grimblast + + # File Manager + xfce.thunar + + # clean sddm theme + elegant-sddm + + # json cli parser for bash script to focus 1password + jq + focus-1password + + hyprpanel + + ##### + xdg-dbus-proxy + ]; + + programs = { + hyprland = { + enable = true; + package = hyprland-package; + portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; + withUWSM = true; + }; + }; + + xdg = { + autostart.enable = true; + portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal + pkgs.xdg-desktop-portal-gtk + ]; + xdgOpenUsePortal = true; + + config = { + common = { + default = [ "*" ]; + "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; + }; hyprland = { - enable = true; - package = hyprland-package; - portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - withUWSM = true; - }; - }; - - xdg = { - autostart.enable = true; - portal = { - enable = true; - extraPortals = [ - pkgs.xdg-desktop-portal - pkgs.xdg-desktop-portal-gtk + default = [ + "hyprland" + "gtk" ]; - xdgOpenUsePortal = true; - - config = { - common = { - default = [ "*" ]; - "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; - }; - hyprland = { - default = [ - "hyprland" - "gtk" - ]; - "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; - "org.freedesktop.impl.portal.OpenURI" = [ "gtk" ]; - }; - }; + "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; + "org.freedesktop.impl.portal.OpenURI" = [ "gtk" ]; }; }; + }; + }; - security.pam.services.gdm.enableGnomeKeyring = true; - services.displayManager.gdm = { - enable = true; - wayland = true; + services.displayManager.gdm = { + enable = true; + wayland = true; + }; + + ${namespace} = { + desktop = { + enable = true; + addons = { + rofi = { + enable = true; + package = pkgs.rofi-unwrapped; + }; + hypridle = enabled; + hyprlock = enabled; + hyprpanel = enabled; + hyprpaper = enabled; }; - - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; # Hint electron apps to use wayland - ELECTRON_OZONE_PLATFORM_HINT = "auto"; - - XDG_SESSION_TYPE = "wayland"; - - QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - QT_QPA_PLATFORM = "wayland;xcb"; - }; - }; - homeManager.cholli = - { - inputs, - lib, - pkgs, - osConfig, - ... - }: - let - hyprland-package = inputs.hyprland.packages.${pkgs.system}.hyprland; - in - { - config = lib.mkIf osConfig.programs.hyprland.enable { - wayland.windowManager.hyprland = { - enable = true; - package = hyprland-package; - plugins = [ inputs.hy3.packages.${pkgs.system}.hy3 ]; - systemd.variables = [ "--all" ]; - settings = { + nix.extra-substituters.${cachix-url} = { + key = cachix-key; + }; + + home.extraOptions = { + wayland.windowManager.hyprland = { + enable = true; + package = hyprland-package; + plugins = [ inputs.hy3.packages.${system}.hy3 ]; + systemd.variables = [ "--all" ]; + settings = mkMerge [ + { "$mod" = "SUPER"; exec-once = [ "systemctl --user start hyprpolkitagent" - "[workspace 1 silent] zen-beta" "[workspace 2 silent] steam" - "[workspace 7 silent] obsidian" "[workspace 8 silent] discord" "[workspace 9 silent] ELECTRON_OZONE_PLATFORM_HINT=x11 1password" # fix for promts not showing up anymore - "${pkgs.xorg.xhost}/bin/xhost +" + "[workspace 1 silent] zen-beta" - "${lib.getExe pkgs.xorg.xrandr} --output DP-1 --primary" + "${pkgs.xorg.xhost}/bin/xhost +" ]; windowrulev2 = [ - #steam is a bit wierd, since it opens in multiple phases, so just move the last window to the workspace + #stean is a bit wierd, since it opens in multiple phases, so just move the last window to the workspace "workspace 2 silent, class:^(steam)$, title:^(Steam)" - "workspace 7 silent, class:^(com.obsproject.Studio)$" - "workspace 8 silent, class:^(steam)$, title:^(Friends List)" - "workspace 8 silent, class:^(discord)$, title:^(Discord)" - ]; - - monitor = lib.mkIf (osConfig.networking.hostName == "yggdrasil") [ - #Ultrawide - "DP-1,3440x1440@144, 0x0, 1" - #Vertical - "HDMI-A-1, 1920x1080@144, auto-right, 1, transform, 1" - ]; - - workspace = lib.mkIf (osConfig.networking.hostName == "yggdrasil") [ - "1, monitor:DP-1" - "2, monitor:DP-1" - "3, monitor:DP-1" - "4, monitor:DP-1" - "5, monitor:DP-1" - "6, monitor:DP-1" - "7, monitor:HDMI-A-1" - "8, monitor:HDMI-A-1" - "9, monitor:HDMI-A-1" + # make xwaylandvideobridge window invisible + "opacity 0.0 override, class:^(xwaylandvideobridge)$" + "noanim, class:^(xwaylandvideobridge)$" + "noinitialfocus, class:^(xwaylandvideobridge)$" + "maxsize 1 1, class:^(xwaylandvideobridge)$" + "noblur, class:^(xwaylandvideobridge)$" ]; general = { @@ -241,7 +280,6 @@ "$mod SHIFT, R, exec, hyprctl reload" "$mod SHIFT, Q, killactive," "$mod SHIFT, E, exec, pkill Hyprland" - "$mod CTRL, l, exec, hyprlock-blur" "$mod, F, fullscreen," "$mod, G, togglegroup," @@ -337,9 +375,24 @@ }; }; }; - }; - }; + } + cfg.settings + ]; + }; + }; + }; + + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; # Hint electron apps to use wayland + ELECTRON_OZONE_PLATFORM_HINT = "auto"; + + XDG_SESSION_TYPE = "wayland"; + + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + }; }; } diff --git a/modules/nixos/desktop/kde/default.nix b/modules/nixos/desktop/kde/default.nix new file mode 100644 index 0000000..9f5cf35 --- /dev/null +++ b/modules/nixos/desktop/kde/default.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.desktop.kde; +in +{ + options.${namespace}.desktop.kde = with types; { + enable = mkEnableOption "Whether to enable a kde plasma6"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + xdg-utils + kdePackages.qtbase + ]; + + services = { + xserver = enabled; + desktopManager.plasma6 = enabled; + }; + }; +} diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix new file mode 100644 index 0000000..3aa9b52 --- /dev/null +++ b/modules/nixos/home/default.nix @@ -0,0 +1,38 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.home; +in +{ + options.${namespace}.home = with types; { + file = mkOpt attrs { } (mdDoc "A set of files to be managed by home-manager's `home.file`."); + configFile = mkOpt attrs { } ( + mdDoc "A set of files to be managed by home-manager's `xdg.configFile`." + ); + extraOptions = mkOpt attrs { } "Options to pass directly to home-manager."; + }; + + config = { + snowfallorg.users.${config.${namespace}.user.name}.home.config = mkMerge [ + { + home.stateVersion = config.system.stateVersion; + home.file = mkAliasDefinitions options.${namespace}.home.file; + xdg.enable = true; + xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile; + } + config.${namespace}.home.extraOptions + ]; + + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + }; + }; +} diff --git a/modules/nixos/nix/default.nix b/modules/nixos/nix/default.nix new file mode 100644 index 0000000..f4dfe29 --- /dev/null +++ b/modules/nixos/nix/default.nix @@ -0,0 +1,107 @@ +{ + config, + inputs, + lib, + namespace, + pkgs, + system, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.nix; + + substituters-submodule = types.submodule ( + { name, ... }: + { + options = with types; { + key = mkOpt (nullOr str) null "The trusted public key for this substituter."; + }; + } + ); +in +{ + options.${namespace}.nix = with types; { + enable = mkBoolOpt true "Whether or not to manage nix configuration."; + package = mkOpt package pkgs.lix "Which nix package to use."; + + default-substituter = { + url = mkOpt str "https://cache.nixos.org" "The url for the substituter."; + key = + mkOpt str "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "The trusted public key for the substituter."; + }; + + extra-substituters = mkOpt (attrsOf substituters-submodule) { } "Extra substituters to configure."; + }; + + config = mkIf cfg.enable { + assertions = mapAttrsToList (name: value: { + assertion = value.key != null; + message = "plusultra.nix.extra-substituters.${name}.key must be set"; + }) cfg.extra-substituters; + + environment.systemPackages = with pkgs; [ + nixfmt-rfc-style + nix-prefetch-git + nix-du + + nix-weather + nix-index + nix-output-monitor + ]; + + programs.nh = { + enable = true; + package = inputs.nh-flake.packages.${system}.nh; + flake = "/home/cholli/projects/config"; + }; + + nix = + let + users = [ + "root" + config.${namespace}.user.name + "gitea-runner" + ] ++ optional config.services.hydra.enable "hydra hydra-www hydra-evaluator hydra-queue-runner"; + in + { + package = cfg.package; + + settings = + { + experimental-features = "nix-command flakes"; + http-connections = 50; + warn-dirty = false; + log-lines = 50; + sandbox = "relaxed"; + auto-optimise-store = true; + trusted-users = users; + allowed-users = users; + allowed-uris = "github: https://github.com/ git+https://github.com/ gitlab: https://gitlab.com/ git+https://gitlab.com/"; + substituters = [ + cfg.default-substituter.url + ] ++ (mapAttrsToList (name: value: name) cfg.extra-substituters); + trusted-public-keys = [ + cfg.default-substituter.key + ] ++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters); + } + // (lib.optionalAttrs config.${namespace}.tools.direnv.enable { + keep-outputs = true; + keep-derivations = true; + }); + + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + + # flake-utils-plus + generateRegistryFromInputs = true; + generateNixPathFromInputs = true; + linkInputs = true; + }; + }; +} diff --git a/modules/nixos/security/acme/default.nix b/modules/nixos/security/acme/default.nix new file mode 100644 index 0000000..3a32ffa --- /dev/null +++ b/modules/nixos/security/acme/default.nix @@ -0,0 +1,75 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.security.acme; +in +{ + options.${namespace}.security.acme = with lib.types; { + enable = mkEnableOption "Enable sops (Default true)"; + email = mkOpt str config.${namespace}.user.email "The email to use."; + sopsFile = mkOption { + type = lib.types.path; + default = lib.snowfall.fs.get-file "secrets/secrets.yaml"; + description = "SecretFile"; + }; + domainname = mkOpt str "christophhollizeck.dev" "domainname to use"; + staging = mkOpt bool false "Use staging server for testing or not"; + }; + + config = mkIf cfg.enable { + sops = { + secrets = { + "netcup/customer_number" = { + inherit (cfg) sopsFile; + }; + + "netcup/api/key" = { + inherit (cfg) sopsFile; + }; + + "netcup/api/password" = { + inherit (cfg) sopsFile; + }; + }; + + templates = { + "netcup.env" = { + content = '' + NETCUP_CUSTOMER_NUMBER=${config.sops.placeholder."netcup/customer_number"} + NETCUP_API_KEY=${config.sops.placeholder."netcup/api/key"} + NETCUP_API_PASSWORD=${config.sops.placeholder."netcup/api/password"} + NETCUP_PROPAGATION_TIMEOUT=1200 + ''; + }; + }; + + }; + + security.acme = { + acceptTerms = true; + defaults = { + inherit (cfg) email; + + group = mkIf config.services.nginx.enable "nginx"; + reloadServices = optional config.services.nginx.enable "nginx.service"; + + dnsProvider = "netcup"; + environmentFile = config.sops.templates."netcup.env".path; + }; + + certs."${cfg.domainname}" = { + server = mkIf cfg.staging "https://acme-staging-v02.api.letsencrypt.org/directory"; + dnsResolver = "1.1.1.1:53"; + extraDomainNames = [ "*.${cfg.domainname}" ]; + }; + }; + + }; +} diff --git a/modules/nixos/security/gpg/default.nix b/modules/nixos/security/gpg/default.nix new file mode 100644 index 0000000..5d64f49 --- /dev/null +++ b/modules/nixos/security/gpg/default.nix @@ -0,0 +1,70 @@ +{ + config, + inputs, + lib, + namespace, + options, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.security.gpg; + + gpgConf = "${inputs.gpg-base-conf}/gpg.conf"; + + gpgAgentConf = '' + enable-ssh-support + default-cache-ttl 60 + max-cache-ttl 120 + pinentry-program ${pkgs.pinentry-qt}/bin/pinentry-qt + ''; + + reload-yubikey = pkgs.writeShellScriptBin "reload-yubikey" '' + ${pkgs.gnupg}/bin/gpg-connect-agent "scd serialno" "learn --force" /bye + ''; +in +{ + options.${namespace}.security.gpg = with types; { + enable = mkBoolOpt false "Wether or not to enable GPG."; + agentTimeout = mkOpt int 5 "The amount of time to wait before continuing with shell init."; + }; + + config = mkIf cfg.enable { + services.pcscd.enable = true; + services.udev.packages = with pkgs; [ yubikey-personalization ]; + + environment.systemPackages = with pkgs; [ + cryptsetup + paperkey + gnupg + pinentry-curses + pinentry-qt + + yubikey-manager + yubioath-flutter + reload-yubikey + ]; + + programs = { + ssh.startAgent = false; + + gnupg.agent = { + enable = true; + enableSSHSupport = true; + enableExtraSocket = true; + }; + }; + + ${namespace} = { + home.file = { + ".gnupg/.keep".text = ""; + + ".gnupg/gpg.conf".source = gpgConf; + ".gnupg/gpg-agent.conf".text = gpgAgentConf; + ".gnupg/scdeamon.conf".text = "disable-ccid"; + }; + }; + }; +} diff --git a/modules/nixos/security/keyring/default.nix b/modules/nixos/security/keyring/default.nix new file mode 100644 index 0000000..5f864b3 --- /dev/null +++ b/modules/nixos/security/keyring/default.nix @@ -0,0 +1,30 @@ +{ + options, + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + cfg = config.${namespace}.security.keyring; +in +{ + options.${namespace}.security.keyring = { + enable = mkBoolOpt true "Whether to enable gnome keyring."; + }; + + config = mkIf cfg.enable { + services.gnome.gnome-keyring.enable = true; + security.pam.services.gdm.enableGnomeKeyring = true; + + services.dbus.packages = [ + pkgs.gnome-keyring + pkgs.gcr + ]; + + environment.systemPackages = [ pkgs.seahorse ]; + }; +} diff --git a/modules/nixos/security/sops/default.nix b/modules/nixos/security/sops/default.nix new file mode 100644 index 0000000..5362604 --- /dev/null +++ b/modules/nixos/security/sops/default.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.security.sops; +in +{ + options.${namespace}.security.sops = with types; { + enable = mkBoolOpt true "Enable sops (Default true)"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + sops + age + ssh-to-age + ]; + + sops = { + defaultSopsFile = lib.snowfall.fs.get-file "secrets/secrets.yaml"; + defaultSopsFormat = "yaml"; + + # age.keyFile = "/home/cholli/.config/sops/age/keys.txt"; + age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + }; + }; +} diff --git a/modules/nixos/security/syncthing/default.nix b/modules/nixos/security/syncthing/default.nix new file mode 100644 index 0000000..1b1ccf8 --- /dev/null +++ b/modules/nixos/security/syncthing/default.nix @@ -0,0 +1,56 @@ +{ + config, + lib, + namespace, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.security.syncthing; + user = config.${namespace}.user; +in +{ + options.${namespace}.security.syncthing = with types; { + enable = mkEnableOption "Enable Syncthing"; + }; + + config = mkIf cfg.enable { + services.syncthing = { + enable = true; + user = user.name; + dataDir = "/home/" + user.name + "/Documents"; + configDir = "/home/" + user.name + "/Documents/.config/syncthing"; + settings = { + folders = { + "Documents" = { + # Name of folder in Syncthing, also the folder ID + path = "/home/" + user.name + "/Documents"; # Which folder to add to Syncthing + }; + "Pictures" = { + path = "/home/" + user.name + "/Pictures"; + }; + "7vfj7-k83xj" = { + path = "/home/" + user.name + "/WhatsApp Documents"; + }; + }; + gui = { + theme = "black"; + }; + }; + }; + + # Syncthing ports: 8384 for remote access to GUI + # 22000 TCP and/or UDP for sync traffic + # 21027/UDP for discovery + # source: https://docs.syncthing.net/users/firewall.html + networking.firewall.allowedTCPPorts = [ + 8384 + 22000 + ]; + networking.firewall.allowedUDPPorts = [ + 22000 + 21027 + ]; + }; +} diff --git a/modules/nixos/services/factorio-server/default.nix b/modules/nixos/services/factorio-server/default.nix new file mode 100644 index 0000000..1a79690 --- /dev/null +++ b/modules/nixos/services/factorio-server/default.nix @@ -0,0 +1,79 @@ +{ + lib, + config, + namespace, + pkgs, + ... +}: +with lib.${namespace}; +let + cfg = config.${namespace}.services.factorio-server; + inherit (lib) mkIf mkOption mkEnableOption; +in +{ + options.${namespace}.services.factorio-server = { + enable = mkEnableOption "Enable Factorio Headless Server"; + sopsFile = mkOption { + type = lib.types.path; + default = lib.snowfall.fs.get-file "secrets/secrets.yaml"; + description = "SecretFile"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ pkgs.factorio-headless ]; + sops = { + secrets = { + "factorio/token" = { + restartUnits = [ "factorio.service" ]; + inherit (cfg) sopsFile; + }; + "factorio/username" = { + restartUnits = [ "factorio.service" ]; + inherit (cfg) sopsFile; + }; + "factorio/game_password" = { + restartUnits = [ "factorio.service" ]; + inherit (cfg) sopsFile; + }; + }; + templates."extraSettingsFile.json".content = '' + { + "name": "Pyanodons Holli", + "description": "Trying to run a factorio-headless-server on my nix system", + "tags": ["vanilla"], + "max_players": 10, + "game_password": "${config.sops.placeholder."factorio/game_password"}", + "allow_commands": "admins-only", + "autosave_slots": 5, + "ignore_player_limit_for_returning_players": true, + "username" : "${config.sops.placeholder."factorio/username"}", + "token": "${config.sops.placeholder."factorio/token"}" + } + ''; + templates."extraSettingsFile.json".mode = "0444"; + }; + + systemd.tmpfiles.rules = [ + "Z /var/lib/factorio/mods 770 65400 65400 - -" + "Z /var/lib/factorio/saves 770 65400 65400 - -" + ]; + + services.factorio = { + enable = true; + openFirewall = true; + public = true; + lan = true; + nonBlockingSaving = true; + autosave-interval = 5; + saveName = "Pyanodons"; + loadLatestSave = true; + admins = [ + "daholli" + "galbrain" + "geigeabc" + ]; + extraSettingsFile = config.sops.templates."extraSettingsFile.json".path; + }; + }; +} diff --git a/modules/nixos/services/gitea-runner/default.nix b/modules/nixos/services/gitea-runner/default.nix new file mode 100644 index 0000000..b1491be --- /dev/null +++ b/modules/nixos/services/gitea-runner/default.nix @@ -0,0 +1,182 @@ +{ + lib, + config, + namespace, + pkgs, + ... +}: +with lib.${namespace}; +let + cfg = config.${namespace}.services.gitea-runner; + inherit (lib) mkIf mkOption mkEnableOption; + inherit (lib.types) + attrsOf + package + path + submodule + str + ; +in +{ + options.${namespace}.services.gitea-runner = { + enable = mkEnableOption "Enable gitea/forgejo runner"; + git-url = mkOption { + type = str; + default = "https://git.christophhollizeck.dev"; + }; + sopsFile = mkOption { + type = path; + default = lib.snowfall.fs.get-file "secrets/secrets.yaml"; + description = "SecretFile"; + }; + runner-package = mkOption { + type = package; + default = pkgs.forgejo-actions-runner; + description = "Which runner to use Gitea/Forgjo"; + }; + ## taken from nixos/modules/services/continuous-integration/gitea-actions-runner.nix + runner-instances = mkOption { + default = { }; + description = '' + Gitea Actions Runner instances. + ''; + type = attrsOf (submodule { + options = { + enable = mkEnableOption "Gitea Actions Runner instance"; + name = mkOption { + type = str; + example = literalExpression "config.networking.hostName"; + description = '' + The name identifying the runner instance towards the Gitea/Forgejo instance. + ''; + }; + url = mkOption { + type = str; + example = "https://forge.example.com"; + description = '' + Base URL of your Gitea/Forgejo instance. + ''; + }; + tokenFile = mkOption { + type = nullOr (either str path); + default = null; + description = '' + Path to an environment file, containing the `TOKEN` environment + variable, that holds a token to register at the configured + Gitea/Forgejo instance. + ''; + }; + labels = mkOption { + type = listOf str; + example = literalExpression '' + [ + # provide a debian base with nodejs for actions + "debian-latest:docker://node:18-bullseye" + # fake the ubuntu name, because node provides no ubuntu builds + "ubuntu-latest:docker://node:18-bullseye" + # provide native execution on the host + #"native:host" + ] + ''; + description = '' + Labels used to map jobs to their runtime environment. Changing these + labels currently requires a new registration token. + + Many common actions require bash, git and nodejs, as well as a filesystem + that follows the filesystem hierarchy standard. + ''; + }; + settings = mkOption { + description = '' + Configuration for `act_runner daemon`. + See https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml for an example configuration + ''; + + type = types.submodule { + freeformType = settingsFormat.type; + }; + + default = { }; + }; + + hostPackages = mkOption { + type = listOf package; + default = with pkgs; [ + bash + coreutils + curl + gawk + gitMinimal + gnused + nodejs + wget + ]; + defaultText = literalExpression '' + with pkgs; [ + bash + coreutils + curl + gawk + gitMinimal + gnused + nodejs + wget + ] + ''; + description = '' + List of packages, that are available to actions, when the runner is configured + with a host execution label. + ''; + }; + }; + }); + }; + }; + + config = mkIf cfg.enable { + sops = { + secrets = { + "forgejo/runner/token" = { + inherit (cfg) sopsFile; + }; + }; + }; + + services.gitea-actions-runner = { + package = cfg.runner-package; + instances = { + native = { + enable = true; + name = "monolith"; + url = cfg.git-url; + tokenFile = config.sops.secrets."forgejo/runner/token".path; + labels = [ + "native:host" + ]; + hostPackages = with pkgs; [ + bash + coreutils + curl + gawk + gitMinimal + gnused + nodejs + wget + lix + ]; + settings = { + log.level = "info"; + runner = { + capacity = 1; + timeout = "3h"; + shutdown_timeout = "5s"; + fetch_timeout = "10s"; + fetch_inteval = "5s"; + }; + }; + }; + } // cfg.runner-instances; + }; + + }; +} diff --git a/modules/nixos/services/hydra/default.nix b/modules/nixos/services/hydra/default.nix new file mode 100644 index 0000000..ba7884d --- /dev/null +++ b/modules/nixos/services/hydra/default.nix @@ -0,0 +1,40 @@ +{ + lib, + config, + namespace, + ... +}: +let + cfg = config.${namespace}.services.hydra; + inherit (lib) mkIf mkOption mkEnableOption; +in +{ + options.${namespace}.services.hydra = { + enable = mkEnableOption "Enable Hydra CI"; + httpPort = mkOption { + type = lib.types.int; + default = 2000; + description = "The path to host the http server on, relevant for nginx forwarding"; + }; + + enableCache = mkEnableOption "Enable cache using nix-server"; + }; + + config = mkIf cfg.enable { + services.nix-serve = mkIf cfg.enableCache { + enable = true; + secretKeyFile = "/var/cache-priv-key.pem"; + }; + + services.hydra = { + enable = true; + hydraURL = "http://localhost:${toString cfg.httpPort}"; + port = cfg.httpPort; + notificationSender = "hydra@localhost"; + useSubstitutes = true; + extraConfig = '' + allow-import-from-derivation = 1 + ''; + }; + }; +} diff --git a/modules/nixos/services/openssh/default.nix b/modules/nixos/services/openssh/default.nix new file mode 100644 index 0000000..4ec9816 --- /dev/null +++ b/modules/nixos/services/openssh/default.nix @@ -0,0 +1,29 @@ +{ + lib, + config, + namespace, + ... +}: +let + cfg = config.${namespace}.services.openssh; + inherit (lib) mkIf mkEnableOption; +in +{ + options.${namespace}.services.openssh = { + enable = mkEnableOption "Enable SSH"; + }; + + config = mkIf cfg.enable { + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; + + services.fail2ban = { + enable = true; + }; + }; +} diff --git a/modules/nixos/services/remotebuild/default.nix b/modules/nixos/services/remotebuild/default.nix new file mode 100644 index 0000000..fed0c23 --- /dev/null +++ b/modules/nixos/services/remotebuild/default.nix @@ -0,0 +1,52 @@ +{ + lib, + config, + namespace, + ... +}: +let + cfg = config.${namespace}.services.remotebuild; + inherit (lib) mkIf mkEnableOption; +in +{ + options.${namespace}.services.remotebuild = { + enable = mkEnableOption "Enable remotebuild"; + }; + + config = mkIf cfg.enable { + users.users.remotebuild = { + isNormalUser = true; + createHome = false; + group = "remotebuild"; + + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil" + ]; + }; + + users.groups.remotebuild = { }; + + nix = { + nrBuildUsers = 64; + settings = { + trusted-users = [ "remotebuild" ]; + + min-free = 10 * 1024 * 1024; + max-free = 200 * 1024 * 1024; + + max-jobs = "auto"; + cores = 0; + }; + + daemonIOSchedClass = lib.mkDefault "idle"; + daemonCPUSchedPolicy = lib.mkDefault "idle"; + }; + + systemd.services.nix-daemon.serviceConfig = { + MemoryAccounting = true; + MemoryMax = "90%"; + OOMScoreAdjust = 500; + Slice = "-.slice"; + }; + }; +} diff --git a/modules/nixos/submodules/README.md b/modules/nixos/submodules/README.md new file mode 100644 index 0000000..9880062 --- /dev/null +++ b/modules/nixos/submodules/README.md @@ -0,0 +1,19 @@ +# Submodule Configurations + +This is mostly just to make Archetypes configurations look a bit neater and make bitesized collections of programs used in tandem + +## basics + +Every setup will want this. It handles are the things that you need anyways. + +## basics wsl + +Just [basics](#basics) without the boot stuff mostly because wsl is a bit special there. + +## games + +Stuff related to gaming + +## socials + +If was more active on social media I would have stuff to put here, for now this is just ways to talk to other people e.g discord diff --git a/modules/nixos/submodules/basics-wsl/default.nix b/modules/nixos/submodules/basics-wsl/default.nix new file mode 100644 index 0000000..4963ea5 --- /dev/null +++ b/modules/nixos/submodules/basics-wsl/default.nix @@ -0,0 +1,70 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt enabled; + cfg = config.${namespace}.submodules.basics-wsl; +in +{ + options.${namespace}.submodules.basics-wsl = { + enable = mkBoolOpt false "Whether or not to enable basic configuration."; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + fastfetch + + fd + tree + ripgrep + fzf + eza + + wslu + wsl-open + + zip + unzip + ]; + + ${namespace} = { + nix = { + enable = true; + + extra-substituters = { + "https://cache.lix.systems" = { + key = "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="; + }; + "https://nix-community.cachix.org" = { + key = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; + }; + "https://nixcache.christophhollizeck.dev" = { + key = "christophhollizeck.dev:7pPAvm9xqFQB8FDApVNL6Tii1Jsv+Sj/LjEIkdeGhbA="; + }; + }; + }; + + apps.cli-apps.helix = enabled; + + tools = { + git = enabled; + }; + + system.hardware = { + networking = enabled; + }; + + system = { + fonts = enabled; + locale = enabled; + time = enabled; + xkb = enabled; + }; + }; + }; +} diff --git a/modules/nixos/submodules/basics/default.nix b/modules/nixos/submodules/basics/default.nix new file mode 100644 index 0000000..0878820 --- /dev/null +++ b/modules/nixos/submodules/basics/default.nix @@ -0,0 +1,73 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.submodules.basics; +in +{ + options.${namespace}.submodules.basics = with types; { + enable = mkEnableOption "Whether or not to enable basic configuration."; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + fastfetch + + fd + tree + ripgrep + fzf + eza + + #optional + pciutils + usbutils + btop + + zip + unzip + ]; + + ${namespace} = { + nix = { + enable = true; + extra-substituters = { + "https://cache.lix.systems" = { + key = "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="; + }; + "https://nix-community.cachix.org" = { + key = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; + }; + "https://nixcache.christophhollizeck.dev" = { + key = "christophhollizeck.dev:7pPAvm9xqFQB8FDApVNL6Tii1Jsv+Sj/LjEIkdeGhbA="; + }; + }; + }; + + apps.cli-apps.helix = enabled; + + tools = { + git = enabled; + }; + + system.hardware = { + networking = enabled; + }; + + system = { + boot = enabled; + fonts = enabled; + locale = enabled; + time = enabled; + xkb = enabled; + }; + }; + }; +} diff --git a/modules/nixos/submodules/games/EVE_bottles.yml b/modules/nixos/submodules/games/EVE_bottles.yml new file mode 100644 index 0000000..26cf599 --- /dev/null +++ b/modules/nixos/submodules/games/EVE_bottles.yml @@ -0,0 +1,84 @@ +Arch: win64 +CompatData: '' +Creation_Date: '2024-11-12 18:24:45.924771' +Custom_Path: false +DLL_Overrides: {} +DXVK: dxvk-2.4.1 +Environment: Custom +Environment_Variables: {} +External_Programs: + b8ae3872-d1d4-435f-ba7f-1cd829b4da81: + executable: eve-online-latest+Setup.exe + folder: /home/cholli/Downloads + id: b8ae3872-d1d4-435f-ba7f-1cd829b4da81 + name: eve-online-latest+Setup + path: /home/cholli/Downloads/eve-online-latest+Setup.exe +Installed_Dependencies: +- dotnet40 +- dotnet48 +- vcredist2022 +Language: sys +LatencyFleX: latencyflex-v0.1.1 +NVAPI: dxvk-nvapi-v0.7.1 +Name: EVE +Parameters: + custom_dpi: 96 + decorated: true + discrete_gpu: false + dxvk: true + dxvk_nvapi: false + fixme_logs: false + fsr: false + fsr_quality_mode: none + fsr_sharpening_strength: 2 + fullscreen_capture: false + gamemode: false + gamescope: false + gamescope_borderless: false + gamescope_fps: 0 + gamescope_fps_no_focus: 0 + gamescope_fullscreen: true + gamescope_game_height: 0 + gamescope_game_width: 0 + gamescope_scaling: false + gamescope_window_height: 0 + gamescope_window_width: 0 + latencyflex: false + mangohud: false + mouse_warp: true + obsvkc: false + pulseaudio_latency: false + renderer: gl + sandbox: false + sync: wine + take_focus: false + use_be_runtime: true + use_eac_runtime: true + use_runtime: false + use_steam_runtime: false + versioning_automatic: false + versioning_compression: false + versioning_exclusion_patterns: false + virtual_desktop: false + virtual_desktop_res: 1280x720 + vkbasalt: false + vkd3d: true + vmtouch: false + vmtouch_cache_cwd: false +Path: EVE +Runner: caffe-9.7 +RunnerPath: '' +Sandbox: + share_net: false + share_sound: false +State: 0 +Uninstallers: {} +Update_Date: '2024-11-12 18:36:11.134986' +VKD3D: vkd3d-proton-2.13 +Versioning: false +Versioning_Exclusion_Patterns: [] +Windows: win10 +WorkingDir: /storage/home/bottles +data: {} +run_in_terminal: false +session_arguments: '' diff --git a/modules/nixos/submodules/games/default.nix b/modules/nixos/submodules/games/default.nix new file mode 100644 index 0000000..6f98066 --- /dev/null +++ b/modules/nixos/submodules/games/default.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.submodules.games; +in +{ + options.${namespace}.submodules.games = with types; { + enable = mkBoolOpt false "Whether or not you want to enable steam and other games"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ prismlauncher ]; + + ${namespace} = { + apps = { + steam = enabled; + }; + }; + }; +} diff --git a/modules/nixos/submodules/socials/default.nix b/modules/nixos/submodules/socials/default.nix new file mode 100644 index 0000000..e6bd256 --- /dev/null +++ b/modules/nixos/submodules/socials/default.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + namespace, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.submodules.socials; +in +{ + options.${namespace}.submodules.socials = with types; { + enable = mkBoolOpt false "Whether to enable social apps"; + }; + + config = mkIf cfg.enable { + ${namespace} = { + apps = { + discord = enabled; + teamspeak = enabled; + }; + }; + }; +} diff --git a/modules/nixos/system/autoUpgrade/default.nix b/modules/nixos/system/autoUpgrade/default.nix new file mode 100644 index 0000000..203601c --- /dev/null +++ b/modules/nixos/system/autoUpgrade/default.nix @@ -0,0 +1,33 @@ +{ + config, + inputs, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.autoUpgrade; +in +{ + options.${namespace}.system.autoUpgrade = with types; { + enable = mkEnableOption "Enable auto-upgrade"; + time = mkOpt str "02:00" "Time to run auto-upgrade"; + }; + + config = mkIf cfg.enable { + system.autoUpgrade = { + enable = true; + flake = inputs.self.outPath; + flags = [ + "--update-input" + "nixpkgs" + "--print-build-logs" + ]; + dates = cfg.time; + randomizedDelaySec = "45min"; + }; + }; +} diff --git a/modules/nixos/system/boot/default.nix b/modules/nixos/system/boot/default.nix new file mode 100644 index 0000000..53759a1 --- /dev/null +++ b/modules/nixos/system/boot/default.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.boot; +in +{ + options.${namespace}.system.boot = with types; { + enable = mkBoolOpt false "Whether or not to enable booting."; + }; + + config = mkIf cfg.enable { + boot = { + kernelPackages = pkgs.linuxPackages_latest; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; + + services.fstrim = enabled; + }; +} diff --git a/modules/nixos/system/fonts/default.nix b/modules/nixos/system/fonts/default.nix new file mode 100644 index 0000000..181e4b2 --- /dev/null +++ b/modules/nixos/system/fonts/default.nix @@ -0,0 +1,41 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.fonts; +in +{ + options.${namespace}.system.fonts = with types; { + enable = mkBoolOpt false "Whether or not to manage fonts."; + fonts = mkOpt (listOf package) [ ] "Custom font packages to install."; + }; + + config = mkIf cfg.enable { + environment.variables = { + # Enable icons in tooling since we have nerdfonts. + LOG_ICONS = "true"; + }; + + environment.systemPackages = with pkgs; [ font-manager ]; + + fonts.packages = + with pkgs; + [ + font-awesome + powerline-fonts + powerline-symbols + nerd-fonts.code-new-roman + nerd-fonts.fira-code + nerd-fonts.symbols-only + fira + ] + ++ cfg.fonts; + }; +} diff --git a/modules/nixos/system/hardware/audio/default.nix b/modules/nixos/system/hardware/audio/default.nix new file mode 100644 index 0000000..5be469e --- /dev/null +++ b/modules/nixos/system/hardware/audio/default.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.hardware.audio; +in +{ + options.${namespace}.system.hardware.audio = with types; { + enable = mkBoolOpt false "Whether or not to enable audio"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + pavucontrol + easyeffects + ]; + + services.pulseaudio = disabled; + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + + wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' + wireplumber.settings = { + bluetooth.autoswitch-to-headset-profile = false + } + '') + (pkgs.writeTextDir "share/wireplumber/policy.lua.d/11-bluetooth-policy.conf" '' + bluetooth_policy.policy["media-role.use-headset-profile"] = false + '') + ]; + }; + }; +} diff --git a/modules/nixos/system/hardware/bluetooth/default.nix b/modules/nixos/system/hardware/bluetooth/default.nix new file mode 100644 index 0000000..c513227 --- /dev/null +++ b/modules/nixos/system/hardware/bluetooth/default.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + namespace, + pkgs, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.hardware.bluetooth; +in +{ + options.${namespace}.system.hardware.bluetooth = with types; { + enable = mkBoolOpt false "Whether or not to enable bluetooth"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ kdePackages.bluez-qt ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + Experimental = true; + KernelExperimental = true; + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; + + fileSystems."/var/lib/bluetooth" = { + device = "/persist/var/lib/bluetooth"; + options = [ + "bind" + "noauto" + "x-systemd.automount" + ]; + noCheck = true; + }; + + # https://github.com/NixOS/nixpkgs/issues/170573 + }; +} diff --git a/modules/nixos/system/hardware/gpu/amd/default.nix b/modules/nixos/system/hardware/gpu/amd/default.nix new file mode 100644 index 0000000..aaae23b --- /dev/null +++ b/modules/nixos/system/hardware/gpu/amd/default.nix @@ -0,0 +1,29 @@ +{ + lib, + config, + pkgs, + namespace, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.system.hardware.gpu.amd; +in +{ + options.${namespace}.system.hardware.gpu.amd = { + enable = mkEnableOption "Enable AMD GPU"; + }; + + config = mkIf cfg.enable { + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + environment = { + variables = { + AMD_VULKAN_ICD = "RADV"; + }; + }; + }; +} diff --git a/modules/nixos/system/hardware/gpu/nvidia/default.nix b/modules/nixos/system/hardware/gpu/nvidia/default.nix new file mode 100644 index 0000000..2f790f6 --- /dev/null +++ b/modules/nixos/system/hardware/gpu/nvidia/default.nix @@ -0,0 +1,47 @@ +{ + lib, + config, + pkgs, + namespace, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.system.hardware.gpu.nvidia; +in +{ + options.${namespace}.system.hardware.gpu.nvidia = { + enable = mkEnableOption "Enable Nvidia GPU"; + }; + + config = mkIf cfg.enable { + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = [ + pkgs.nvidia-vaapi-driver + ]; + }; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; # stable, beta + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + boot.kernelParams = [ + "nvidia.NVreg_PreserveVideoMemoryAllocations=1" + "nvidia_drm.fbdev=1" + ]; + + environment.sessionVariables = { + GBM_BACKEND = "nvidia-drm"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + LIBVA_DRIVER_NAME = "nvidia"; + NVD_BACKEND = "direct"; + }; + }; +} diff --git a/modules/nixos/system/hardware/networking/default.nix b/modules/nixos/system/hardware/networking/default.nix new file mode 100644 index 0000000..73a2cea --- /dev/null +++ b/modules/nixos/system/hardware/networking/default.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.hardware.networking; +in +{ + options.${namespace}.system.hardware.networking = with types; { + enable = mkBoolOpt false "Whether or not to enable networking"; + }; + + config = mkIf cfg.enable { networking.networkmanager.enable = true; }; +} diff --git a/modules/nixos/system/locale/default.nix b/modules/nixos/system/locale/default.nix new file mode 100644 index 0000000..c52b33c --- /dev/null +++ b/modules/nixos/system/locale/default.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.locale; +in +{ + options.${namespace}.system.locale = with types; { + enable = mkBoolOpt false "Whether or not to manage locale settings."; + }; + + config = mkIf cfg.enable { + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LANG = "en_US.UTF-8"; + LC_ALL = "en_US.UTF-8"; + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + console = { + keyMap = mkForce "us"; + }; + }; +} diff --git a/modules/nixos/system/time/default.nix b/modules/nixos/system/time/default.nix new file mode 100644 index 0000000..2cf112d --- /dev/null +++ b/modules/nixos/system/time/default.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.time; +in +{ + options.${namespace}.system.time = with types; { + enable = mkBoolOpt false "Whether or not to configure timezone information."; + }; + + config = mkIf cfg.enable { time.timeZone = "Europe/Berlin"; }; +} diff --git a/modules/nixos/system/xkb/default.nix b/modules/nixos/system/xkb/default.nix new file mode 100644 index 0000000..11044d8 --- /dev/null +++ b/modules/nixos/system/xkb/default.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.system.xkb; +in +{ + options.${namespace}.system.xkb = with types; { + enable = mkBoolOpt false "Whether or not to configure xkb."; + }; + + config = mkIf cfg.enable { + console.useXkbConfig = true; + services.xserver = { + xkb.layout = "us"; + xkb.variant = ""; + xkb.options = "caps:escape"; + }; + }; +} diff --git a/modules/nixos/tools/devenv/default.nix b/modules/nixos/tools/devenv/default.nix new file mode 100644 index 0000000..1db757f --- /dev/null +++ b/modules/nixos/tools/devenv/default.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.tools.devenv; +in +{ + options.${namespace}.tools.devenv = { + enable = mkEnableOption "Whether or not to enable direnv."; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ + pkgs.devenv + ]; + }; +} diff --git a/modules/nixos/tools/direnv/default.nix b/modules/nixos/tools/direnv/default.nix new file mode 100644 index 0000000..7ef6fdf --- /dev/null +++ b/modules/nixos/tools/direnv/default.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + namespace, + options, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.tools.direnv; +in +{ + options.${namespace}.tools.direnv = with types; { + enable = mkBoolOpt false "Whether or not to enable direnv."; + }; + + config = mkIf cfg.enable { + ${namespace}.home.extraOptions = { + programs.direnv = { + enable = true; + nix-direnv = enabled; + }; + }; + }; +} diff --git a/modules/nixos/tools/git/default.nix b/modules/nixos/tools/git/default.nix new file mode 100644 index 0000000..dce536d --- /dev/null +++ b/modules/nixos/tools/git/default.nix @@ -0,0 +1,60 @@ +{ + config, + lib, + namespace, + options, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.tools.git; + user = config.${namespace}.user; +in +{ + options.${namespace}.tools.git = with types; { + enable = mkBoolOpt true "Wether or not to enable git (Default enabled)"; + userName = mkOpt types.str user.fullName "The name to use git with"; + userEmail = mkOpt types.str user.email "The email to use git with"; + signingKey = mkOpt types.str "ACCFA2DB47795D9E" "The key ID to sign commits with."; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + git + gitAndTools.gh + # gitbutler + ]; + + ${namespace}.home.extraOptions = { + programs.git = { + enable = true; + inherit (cfg) userName userEmail; + lfs.enable = true; + signing = { + key = cfg.signingKey; + signByDefault = true; + }; + extraConfig = { + init = { + defaultBranch = "main"; + }; + pull = { + rebase = true; + }; + push = { + autoSetupRemote = true; + }; + rebase = { + autoStash = true; + }; + safe = { + directory = "${config.users.users.${user.name}.home}/projects/config"; + }; + lfs."https://git.christophhollizeck.dev/Daholli/nixos-config.git/info/lfs".locksverify = true; + }; + }; + }; + }; +} diff --git a/modules/nixos/user/default.nix b/modules/nixos/user/default.nix new file mode 100644 index 0000000..4614d03 --- /dev/null +++ b/modules/nixos/user/default.nix @@ -0,0 +1,77 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +with lib; +with lib.${namespace}; +let + cfg = config.${namespace}.user; + defaultIconFileName = "profile.png"; +in +{ + options.${namespace}.user = with types; { + name = mkOpt str "cholli" "The name to use for the user account."; + fullName = mkOpt str "Christoph Hollizeck" "The full name of the user."; + email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user."; + initialPassword = mkOpt str "asdf" "The initial password to use when the user is first created."; + icon = mkOpt (nullOr path) ./${defaultIconFileName} "The profile picture to use for the user."; + extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned."; + extraOptions = mkOpt attrs { } (mdDoc "Extra options passed to `users.users.`."); + trustedPublicKeys = mkOption { + default = [ ]; + type = nullOr (listOf str); + description = "Trusted public keys for this user for the machine"; + }; + }; + + config = { + environment.systemPackages = [ ]; + + # remove default nix alias + environment.shellAliases = { + l = null; + ls = null; + ll = null; + }; + + programs.fish = enabled; + users.defaultUserShell = pkgs.fish; + + ${namespace}.home = { + file = { + "Desktop/.keep".text = ""; + "Documents/.keep".text = ""; + "Downloads/.keep".text = ""; + "Music/.keep".text = ""; + "Pictures/.keep".text = ""; + "Videos/.keep".text = ""; + "projects/.keep".text = ""; + ".face".source = cfg.icon; + "Pictures/${defaultIconFileName}".source = cfg.icon; + }; + }; + + users.users.${cfg.name} = { + isNormalUser = true; + + inherit (cfg) name initialPassword; + + home = "/home/${cfg.name}"; + group = "users"; + + # Arbitrary user ID to use for the user. Since I only + # have a single user on my machines this won't ever collide. + # However, if you add multiple users you'll need to change this + # so each user has their own unique uid (or leave it out for the + # system to select). + uid = 1000; + + openssh.authorizedKeys.keys = cfg.trustedPublicKeys; + + extraGroups = [ "steamcmd" ] ++ cfg.extraGroups; + } // cfg.extraOptions; + }; +} diff --git a/modules/users/cholli/profile.png b/modules/nixos/user/profile.png similarity index 100% rename from modules/users/cholli/profile.png rename to modules/nixos/user/profile.png diff --git a/modules/server/acme.nix b/modules/server/acme.nix deleted file mode 100644 index 23b47fa..0000000 --- a/modules/server/acme.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - flake.modules.nixos.server = - { - config, - lib, - ... - }: - let - sopsFile = ../../secrets/secrets-loptland.yaml; - domainname = "christophhollizeck.dev"; - in - { - sops = { - secrets = { - "netcup/customer_number" = { - inherit sopsFile; - }; - - "netcup/api/key" = { - inherit sopsFile; - }; - - "netcup/api/password" = { - inherit sopsFile; - }; - }; - - templates = { - "netcup.env" = { - content = '' - NETCUP_CUSTOMER_NUMBER=${config.sops.placeholder."netcup/customer_number"} - NETCUP_API_KEY=${config.sops.placeholder."netcup/api/key"} - NETCUP_API_PASSWORD=${config.sops.placeholder."netcup/api/password"} - NETCUP_PROPAGATION_TIMEOUT=1200 - ''; - }; - }; - - }; - - security.acme = { - acceptTerms = true; - defaults = { - inherit (config.flake.meta.users.cholli) email; - - group = lib.optional config.services.nginx.enable "nginx"; - reloadServices = lib.optional config.services.nginx.enable "nginx.service"; - - dnsProvider = "netcup"; - environmentFile = config.sops.templates."netcup.env".path; - }; - - certs."${domainname}" = { - dnsResolver = "1.1.1.1:53"; - extraDomainNames = [ "*.${domainname}" ]; - }; - }; - - }; -} diff --git a/modules/server/factorio-server.nix b/modules/server/factorio-server.nix deleted file mode 100644 index 3339e4a..0000000 --- a/modules/server/factorio-server.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - flake.modules.nixos.factorio-server = - { config, ... }: - let - sopsFile = ../../secrets/secrets-loptland.yaml; - in - { - sops = { - secrets = { - "factorio/token" = { - restartUnits = [ "factorio.service" ]; - inherit sopsFile; - }; - "factorio/username" = { - restartUnits = [ "factorio.service" ]; - inherit sopsFile; - }; - "factorio/game_password" = { - restartUnits = [ "factorio.service" ]; - inherit sopsFile; - }; - }; - templates."extraSettingsFile.json".content = '' - { - "name": "Pyanodons Holli", - "description": "Trying to run a factorio-headless-server on my nix system", - "tags": ["vanilla"], - "max_players": 10, - "game_password": "${config.sops.placeholder."factorio/game_password"}", - "allow_commands": "admins-only", - "autosave_slots": 5, - "ignore_player_limit_for_returning_players": true, - "username" : "${config.sops.placeholder."factorio/username"}", - "token": "${config.sops.placeholder."factorio/token"}" - } - ''; - templates."extraSettingsFile.json".mode = "0444"; - }; - - systemd.tmpfiles.rules = [ - "Z /var/lib/factorio/mods 770 65400 65400 - -" - "Z /var/lib/factorio/saves 770 65400 65400 - -" - ]; - - services.factorio = { - enable = true; - openFirewall = true; - public = true; - lan = true; - nonBlockingSaving = true; - autosave-interval = 5; - saveName = "Pyanodons"; - loadLatestSave = true; - admins = [ - "daholli" - "galbrain" - "geigeabc" - ]; - extraSettingsFile = config.sops.templates."extraSettingsFile.json".path; - }; - - }; -} diff --git a/modules/server/hydra.nix b/modules/server/hydra.nix deleted file mode 100644 index 97d0f3e..0000000 --- a/modules/server/hydra.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - flake.modules.nixos.hydra = - { ... }: - let - httpPort = 2000; - in - { - services.nix-serve = { - enable = true; - secretKeyFile = "/var/cache-priv-key.pem"; - }; - - services.hydra = { - enable = true; - hydraURL = "http://localhost:${toString httpPort}"; - port = httpPort; - notificationSender = "hydra@localhost"; - useSubstitutes = true; - extraConfig = '' - allow-import-from-derivation = 1 - ''; - }; - - }; -} diff --git a/modules/server/remotebuild.nix b/modules/server/remotebuild.nix deleted file mode 100644 index 03b8148..0000000 --- a/modules/server/remotebuild.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - flake.modules.nixos.server = - { lib, ... }: - { - users.users.remotebuild = { - isNormalUser = true; - createHome = false; - group = "remotebuild"; - - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil" - ]; - }; - - users.groups.remotebuild = { }; - - nix = { - nrBuildUsers = 64; - settings = { - trusted-users = [ "remotebuild" ]; - - min-free = 10 * 1024 * 1024; - max-free = 200 * 1024 * 1024; - - max-jobs = "auto"; - cores = 0; - }; - - daemonIOSchedClass = lib.mkDefault "idle"; - daemonCPUSchedPolicy = lib.mkDefault "idle"; - }; - - systemd.services.nix-daemon.serviceConfig = { - MemoryAccounting = true; - MemoryMax = "90%"; - OOMScoreAdjust = 500; - Slice = "-.slice"; - }; - - }; -} diff --git a/modules/server/ssh.nix b/modules/server/ssh.nix deleted file mode 100644 index f604f82..0000000 --- a/modules/server/ssh.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - flake.modules.nixos.server = - { ... }: - { - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - - services.fail2ban = { - enable = true; - }; - }; -} diff --git a/modules/systems/amdgpu.nix b/modules/systems/amdgpu.nix deleted file mode 100644 index 440a580..0000000 --- a/modules/systems/amdgpu.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - flake.modules.nixos.amdgpu = - { ... }: - { - hardware.graphics = { - enable = true; - enable32Bit = true; - }; - - environment = { - variables = { - AMD_VULKAN_ICD = "RADV"; - }; - }; - }; -} diff --git a/modules/systems/audio.nix b/modules/systems/audio.nix deleted file mode 100644 index 3712a11..0000000 --- a/modules/systems/audio.nix +++ /dev/null @@ -1,307 +0,0 @@ -{ - flake.modules = { - nixos.audio = - { pkgs, ... }: - { - environment.systemPackages = with pkgs; [ - pavucontrol - easyeffects - ]; - - services.pulseaudio.enable = false; - security.rtkit.enable = true; - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - - wireplumber.configPackages = [ - (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' - wireplumber.settings = { - bluetooth.autoswitch-to-headset-profile = false - } - '') - (pkgs.writeTextDir "share/wireplumber/policy.lua.d/11-bluetooth-policy.conf" '' - bluetooth_policy.policy["media-role.use-headset-profile"] = false - '') - ]; - }; - }; - - homeManager.cholli = - { lib, osConfig, ... }: - { - services.easyeffects = lib.mkIf osConfig.services.pipewire.enable { - enable = true; - preset = "jtrv-preset"; - extraPresets = { - jtrv-preset = { - input = { - blocklist = [ - - ]; - "compressor#0" = { - attack = 5; - boost-amount = 6; - boost-threshold = -72; - bypass = false; - dry = -100; - hpf-frequency = 10; - hpf-mode = "off"; - input-gain = 0; - knee = -6; - lpf-frequency = 20000; - lpf-mode = "off"; - makeup = 0; - mode = "Downward"; - output-gain = 0; - ratio = 4; - release = 75; - release-threshold = -40; - sidechain = { - lookahead = 0; - mode = "RMS"; - preamp = 0; - reactivity = 10; - source = "Middle"; - stereo-split-source = "Left/Right"; - type = "Feed-forward"; - }; - stereo-split = false; - threshold = -20; - wet = 0; - }; - "deesser#0" = { - bypass = false; - detection = "RMS"; - f1-freq = 3000.0; - f1-level = -6.0; - f2-freq = 5000.0; - f2-level = -6.0; - f2-q = 1.5000000000000004; - input-gain = 0.0; - laxity = 15; - makeup = 0; - mode = "Wide"; - output-gain = 0; - ratio = 5; - sc-listen = false; - threshold = -20; - }; - "equalizer#0" = { - balance = 0; - bypass = false; - input-gain = 0; - left = { - band0 = { - frequency = 50; - gain = 3; - mode = "RLC (BT)"; - mute = false; - q = 0.7; - slope = "x1"; - solo = false; - type = "Hi-pass"; - width = 4; - }; - band1 = { - frequency = 90; - gain = 3; - mode = "RLC (MT)"; - mute = false; - q = 0.7; - slope = "x1"; - solo = false; - type = "Lo-shelf"; - width = 4; - }; - band2 = { - frequency = 425; - gain = -2; - mode = "BWC (MT)"; - mute = false; - q = 0.9999999999999998; - slope = "x2"; - solo = false; - type = "Bell"; - width = 4; - }; - band3 = { - frequency = 3500; - gain = 3; - mode = "BWC (BT)"; - mute = false; - q = 0.7; - slope = "x2"; - solo = false; - type = "Bell"; - width = 4; - }; - band4 = { - frequency = 9000; - gain = 2; - mode = "LRX (MT)"; - mute = false; - q = 0.7; - slope = "x1"; - solo = false; - type = "Hi-shelf"; - width = 4; - }; - }; - mode = "IIR"; - num-bands = 5; - output-gain = 0; - pitch-left = 0; - pitch-right = 0; - right = { - band0 = { - frequency = 50; - gain = 3; - mode = "RLC (BT)"; - mute = false; - q = 0.7; - slope = "x1"; - solo = false; - type = "Hi-pass"; - width = 4; - }; - band1 = { - frequency = 90; - gain = 3; - mode = "RLC (MT)"; - mute = false; - q = 0.9999999999999998; - slope = "x1"; - solo = false; - type = "Lo-shelf"; - width = 4; - }; - band2 = { - frequency = 425; - gain = -2; - mode = "BWC (MT)"; - mute = false; - q = 0.7; - slope = "x2"; - solo = false; - type = "Bell"; - width = 4; - }; - band3 = { - frequency = 3500; - gain = 3; - mode = "BWC (BT)"; - mute = false; - q = 0.7; - slope = "x2"; - solo = false; - type = "Bell"; - width = 4; - }; - band4 = { - frequency = 9000; - gain = 2; - mode = "LRX (MT)"; - mute = false; - q = 0.7; - slope = "x1"; - solo = false; - type = "Hi-shelf"; - width = 4; - }; - }; - split-channels = false; - }; - "gate#0" = { - attack = 1; - bypass = false; - curve-threshold = -50; - curve-zone = -2; - dry = -100; - hpf-frequency = 10; - hpf-mode = "off"; - hysteresis = true; - hysteresis-threshold = -3; - hysteresis-zone = -1; - input-gain = 0; - lpf-frequency = 20000; - lpf-mode = "off"; - makeup = 1; - output-gain = 0; - reduction = -15; - release = 200; - sidechain = { - input = "Internal"; - lookahead = 0; - mode = "RMS"; - preamp = 0; - reactivity = 10; - source = "Middle"; - stereo-split-source = "Left/Right"; - }; - stereo-split = false; - wet = -1; - }; - "limiter#0" = { - alr = false; - alr-attack = 5; - alr-knee = 0; - alr-release = 50; - attack = 1; - bypass = false; - dithering = "16bit"; - external-sidechain = false; - gain-boost = true; - input-gain = 0; - lookahead = 5; - mode = "Herm Wide"; - output-gain = 0; - oversampling = "Half x2(2L)"; - release = 5; - sidechain-preamp = 0; - stereo-link = 100; - threshold = -1; - }; - plugins_order = [ - "rnnoise#0" - "gate#0" - "deesser#0" - "compressor#0" - "equalizer#0" - "speex#0" - "limiter#0" - ]; - "rnnoise#0" = { - bypass = false; - enable-vad = false; - input-gain = 0; - model-path = ""; - output-gain = 0; - release = 20; - vad-thres = 50; - wet = 0; - }; - "speex#0" = { - bypass = false; - enable-agc = false; - enable-denoise = false; - enable-dereverb = false; - input-gain = 0; - noise-suppression = -70; - output-gain = 0; - vad = { - enable = true; - probability-continue = 90; - probability-start = 95; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/modules/systems/bluetooth.nix b/modules/systems/bluetooth.nix deleted file mode 100644 index 223a5ca..0000000 --- a/modules/systems/bluetooth.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - flake.modules.nixos.bluetooth = - { ... }: - { - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - settings = { - General = { - Experimental = true; - KernelExperimental = true; - Enable = "Source,Sink,Media,Socket"; - }; - }; - }; - - }; -} diff --git a/modules/systems/default.nix b/modules/systems/default.nix deleted file mode 100644 index a4cad88..0000000 --- a/modules/systems/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - inputs, - ... -}: -{ - systems = import inputs.systems; -} diff --git a/modules/users/cholli/default.nix b/modules/users/cholli/default.nix deleted file mode 100644 index c98b79e..0000000 --- a/modules/users/cholli/default.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - config, - ... -}: -{ - flake = { - meta.users = { - cholli = { - email = "christoph.hollizeck@hey.com"; - name = "Christoph Hollizeck"; - username = "cholli"; - - key = "ACCFA2DB47795D9E"; - - authorizedKeys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFrDiO5+vMfD5MimkzN32iw3MnSMLZ0mHvOrHVVmLD0" - ]; - - }; - }; - - modules = { - nixos.cholli = - { pkgs, ... }: - { - programs.fish.enable = true; - - users.users.cholli = { - description = config.flake.meta.users.cholli.name; - isNormalUser = true; - createHome = true; - extraGroups = [ - "audio" - "input" - "networkmanager" - "sound" - "tty" - "wheel" - ]; - shell = pkgs.fish; - # TODO: fix this with sops - initialPassword = "asdf"; - }; - - nix.settings.trusted-users = [ config.flake.meta.users.cholli.username ]; - - }; - - homeManager.cholli = - { ... }: - let - defaultIconFileName = "profile.png"; - in - { - home = { - file = { - "Desktop/.keep".text = ""; - "Documents/.keep".text = ""; - "Downloads/.keep".text = ""; - "Music/.keep".text = ""; - "Pictures/.keep".text = ""; - "Videos/.keep".text = ""; - "projects/.keep".text = ""; - ".face".source = ./${defaultIconFileName}; - "Pictures/${defaultIconFileName}".source = ./${defaultIconFileName}; - }; - }; - }; - }; - }; -} diff --git a/modules/users/root/default.nix b/modules/users/root/default.nix deleted file mode 100644 index 99696b7..0000000 --- a/modules/users/root/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - ... -}: -{ - flake = { - modules.nixos.root = - { pkgs, ... }: - { - programs.fish.enable = true; - - users.users.root = { - shell = pkgs.fish; - openssh.authorizedKeys.keys = config.flake.meta.users.cholli.authorizedKeys; - initialPassword = "asdf1234"; - }; - }; - }; -} diff --git a/overlays/README.md b/overlays/README.md new file mode 100644 index 0000000..c62a33e --- /dev/null +++ b/overlays/README.md @@ -0,0 +1,3 @@ +## Overlays provided by this flake + +Here I put all the overlays e.g compatability fixes for my systems which could also be accessed from outside using this flake, but for now these are not meant for outside use. diff --git a/overlays/factorio-headless/default.nix b/overlays/factorio-headless/default.nix new file mode 100644 index 0000000..98e4327 --- /dev/null +++ b/overlays/factorio-headless/default.nix @@ -0,0 +1,3 @@ +{ channels, ... }: + +final: prev: { inherit (channels.nixpkgs-latest-factorio) factorio-headless; } diff --git a/overlays/obsidian/default.nix b/overlays/obsidian/default.nix new file mode 100644 index 0000000..c405c68 --- /dev/null +++ b/overlays/obsidian/default.nix @@ -0,0 +1,15 @@ +{ ... }: + +final: prev: { + obsidian = prev.obsidian.overrideAttrs (oldAttrs: rec { + # Add arguments to the .desktop entry + desktopItem = oldAttrs.desktopItem.override (desktopitem: { + exec = "${desktopitem.exec} --disable-gpu "; + }); + + # Update the install script to use the new .desktop entry + installPhase = builtins.replaceStrings [ "${oldAttrs.desktopItem}" ] [ + "${desktopItem}" + ] oldAttrs.installPhase; + }); +} diff --git a/overlays/pathofbuilding/default.nix b/overlays/pathofbuilding/default.nix new file mode 100644 index 0000000..9c49349 --- /dev/null +++ b/overlays/pathofbuilding/default.nix @@ -0,0 +1,8 @@ +{ ... }: +final: prev: { + path-of-building = prev.path-of-building.overrideAttrs (prevAttrs: { + postInstall = '' + wrapProgram $out/bin/pobfrontend --set QT_QPA_PLATFORM xcb + ''; + }); +} diff --git a/overlays/starsector/default.nix b/overlays/starsector/default.nix new file mode 100644 index 0000000..bf808a5 --- /dev/null +++ b/overlays/starsector/default.nix @@ -0,0 +1,8 @@ +{ ... }: +final: prev: { + starsector = prev.starsector.overrideAttrs (prevAttrs: { + postInstall = '' + wrapProgram $out/bin/starsector --set __GL_THREADED_OPTIMIZATIONS 0 + ''; + }); +} diff --git a/overlays/steam/default.nix b/overlays/steam/default.nix new file mode 100644 index 0000000..c517edf --- /dev/null +++ b/overlays/steam/default.nix @@ -0,0 +1,9 @@ +{ ... }: + +final: prev: { + steam = prev.steam.overrideAttrs (oldAttrs: { + commandLineArgs = '' + --disable-gpu-compositing + ''; + }); +} diff --git a/overlays/teams-for-linux/default.nix b/overlays/teams-for-linux/default.nix new file mode 100644 index 0000000..7bb7e2a --- /dev/null +++ b/overlays/teams-for-linux/default.nix @@ -0,0 +1,9 @@ +{ ... }: + +final: prev: { + teams-for-linux = prev.teams-for-linux.overrideAttrs (oldAttrs: { + commandLineArgs = '' + --disable-gpu-compositing + ''; + }); +} diff --git a/overlays/tuya-vacuum/default.nix b/overlays/tuya-vacuum/default.nix new file mode 100644 index 0000000..28c9db1 --- /dev/null +++ b/overlays/tuya-vacuum/default.nix @@ -0,0 +1,5 @@ +{ channels, ... }: + +final: prev: { + tuya-vacuum = channels.nixpkgs-tuya-vacuum.python3Packages.tuya-vacuum; +} diff --git a/overlays/vivaldi/default.nix b/overlays/vivaldi/default.nix new file mode 100644 index 0000000..c66518f --- /dev/null +++ b/overlays/vivaldi/default.nix @@ -0,0 +1,14 @@ +{ channels, ... }: + +final: prev: { + vivaldi = prev.vivaldi.overrideAttrs (oldAttrs: { + dontWrapQtApps = false; + nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ channels.unstable.kdePackages.wrapQtAppsHook ]; + commandLineArgs = '' + -enable-features=UseOzonePlatform + --ozone-platform=wayland + --ozone-platform-hint=auto + --enable-features=WaylandWindowDecorations + ''; + }); +} diff --git a/shells/README.md b/shells/README.md new file mode 100644 index 0000000..9afcded --- /dev/null +++ b/shells/README.md @@ -0,0 +1,11 @@ +## Shells provided by this flake + +## rust + +A very non specialized rust flake that provides rust and rust analyzer for use in a simple rust project, more complex flakes should be part of the respective repositories. + +## rust-screeps + +A shell for use in any project built upon [screeps-starter-rust](https://github.com/rustyscreeps/screeps-starter-rust). + + diff --git a/shells/java/default.nix b/shells/java/default.nix new file mode 100644 index 0000000..34e27d5 --- /dev/null +++ b/shells/java/default.nix @@ -0,0 +1,16 @@ +{ + pkgs, + mkShell, + ... +}: +mkShell { + # Create your shell + nativeBuildInputs = with pkgs; [ + jdt-language-server + zulu8 + zulu21 + jetbrains.idea-community + maven + ant + ]; +} diff --git a/shells/rust-screeps/default.nix b/shells/rust-screeps/default.nix new file mode 100644 index 0000000..39b3846 --- /dev/null +++ b/shells/rust-screeps/default.nix @@ -0,0 +1,35 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # You also have access to your flake's inputs. + inputs, + + # The namespace used for your flake, defaulting to "internal" if not set. + namespace, + + # All other arguments come from NixPkgs. You can use `pkgs` to pull shells or helpers + # programmatically or you may add the named attributes as arguments here. + pkgs, + mkShell, + system, + ... +}: +let + fenix = + with inputs.fenix.packages.${system}; + combine [ + latest.toolchain + targets.wasm32-unknown-unknown.latest.rust-std + ]; +in +mkShell { + # Create your shell + nativeBuildInputs = [ + fenix + pkgs.llvmPackages.bintools + pkgs.wasm-pack + ]; + + CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; +} diff --git a/shells/rust/default.nix b/shells/rust/default.nix new file mode 100644 index 0000000..960de8f --- /dev/null +++ b/shells/rust/default.nix @@ -0,0 +1,26 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # You also have access to your flake's inputs. + inputs, + + # The namespace used for your flake, defaulting to "internal" if not set. + namespace, + + # All other arguments come from NixPkgs. You can use `pkgs` to pull shells or helpers + # programmatically or you may add the named attributes as arguments here. + pkgs, + mkShell, + system, + ... +}: +let + fenix = inputs.fenix.packages.${system}.latest.toolchain; +in +mkShell { + # Create your shell + nativeBuildInputs = [ + fenix + ]; +} diff --git a/shells/zig/default.nix b/shells/zig/default.nix new file mode 100644 index 0000000..5ab64d0 --- /dev/null +++ b/shells/zig/default.nix @@ -0,0 +1,27 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # You also have access to your flake's inputs. + inputs, + + # The namespace used for your flake, defaulting to "internal" if not set. + namespace, + + # All other arguments come from NixPkgs. You can use `pkgs` to pull shells or helpers + # programmatically or you may add the named attributes as arguments here. + pkgs, + mkShell, + system, + ... +}: +let + +in +mkShell { + # Create your shell + nativeBuildInputs = [ + inputs.zig-overlay.packages.${system}.master + inputs.zls.packages.${system}.zls + ]; +} diff --git a/systems/aarch64-linux/nixberry/default.nix b/systems/aarch64-linux/nixberry/default.nix new file mode 100644 index 0000000..9703cef --- /dev/null +++ b/systems/aarch64-linux/nixberry/default.nix @@ -0,0 +1,266 @@ +{ + config, + inputs, + lib, + namespace, + pkgs, + system, + ... +}: + +with lib.${namespace}; +let + inherit (lib) mkForce; + + ipAddress = "192.168.178.2"; + sopsFile = lib.snowfall.fs.get-file "secrets/secrets-nixberry.yaml"; + +in +{ + nixpkgs.hostPlatform = { + system = "aarch64-linux"; + }; + + services.tailscale = { + enable = true; + useRoutingFeatures = "server"; + }; + + networking = { + interfaces.end0 = { + ipv4.addresses = [ + { + address = ipAddress; + prefixLength = 24; + } + ]; + useDHCP = true; + }; + interfaces.wlan0 = { + ipv4.addresses = [ + { + address = "192.168.178.3"; + prefixLength = 24; + } + ]; + useDHCP = true; + }; + defaultGateway = { + address = "192.168.178.1"; + interface = "wlan0"; + }; + + wireless = { + enable = true; + networks = { + "Slow Internet" = { + pskRaw = "521b6d766b27276c29c7b6bec5b495b1c52bf88b0682277e65b37dc649b630de"; + }; + }; + }; + firewall = { + allowedTCPPorts = [ + 443 + 53 + 80 + ]; + allowedUDPPorts = [ + 53 + ]; + }; + }; + + services.adguardhome = { + enable = true; + host = ipAddress; + port = 80; + + settings = { + http = { + address = "0.0.0.0:80"; + }; + dns = { + ratelimit = 0; + bind_hosts = [ "0.0.0.0" ]; + upstream_dns = [ + "1.1.1.1" + "1.0.0.1" + "8.8.8.8" + "8.8.4.4" + ]; + }; + filtering = { + protection_enabled = true; + filtering_enabled = true; + }; + + filters = + map + (url: { + enabled = true; + url = url; + }) + [ + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt" # AdGuard Dns filter + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_59.txt" # AdGuard Dns PopupHosts filter + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_9.txt" # The Big List of Hacked Malware Web Sites + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_11.txt" # malicious url blocklist + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_18.txt" # Phishing + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_24.txt" + "https://adguardteam.github.io/HostlistsRegistry/assets/filter_47.txt" + ]; + + statistics = { + enabled = true; + interval = "8760h"; + }; + }; + }; + + systemd.tmpfiles.rules = [ + # "C+ /var/lib/hass/custom_components/tuya_vacuum_maps - - - - ${inputs.tuya-vaccum-maps}/custom_components/tuya_vacuum_maps" + # "Z /var/lib/hass/custom_components 770 hass hass - -" + "f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass" + ]; + + services.home-assistant = { + enable = true; + configWritable = true; + extraComponents = [ + "default_config" + "analytics" + "shopping_list" + "fritzbox" + "met" + "esphome" + "rpi_power" + "tuya" + ]; + + customComponents = with pkgs.home-assistant-custom-components; [ + smartthinq-sensors + sleep_as_android + ]; + + extraPackages = + python3Packages: with python3Packages; [ + ical + ]; + + customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ + mushroom + bubble-card + clock-weather-card + vacuum-card + ]; + + config = { + homeassistant = { + latitude = 49.4; + longitude = 8.6; + temperature_unit = "C"; + unit_system = "metric"; + + external_url = "https://ha.christophhollizeck.dev"; + internal_url = "http://192.168.178.2:8123"; + }; + + default_config = ""; + + mobile_app = ""; + recorder = ""; + + lovelace = { + # mode = "yaml"; + resources = [ + { + url = "/local/nixos-lovelace-modules/vacuum-card.js"; + type = "module"; + } + { + url = "/local/nixos-lovelace-modules/bubble-card.js"; + type = "module"; + } + { + url = "/local/nixos-lovelace-modules/clock-weather-card.js"; + type = "module"; + } + { + url = "/local/nixos-lovelace-modules/mushroom.js"; + type = "module"; + } + ]; + }; + + http = { + use_x_forwarded_for = true; + trusted_proxies = [ + "100.86.250.97" # loptland tailscale + ]; + }; + }; + openFirewall = true; + }; + + # Pi specific stuff + raspberry-pi-nix = { + board = "bcm2712"; + # kernel-build-system = "x86_64-linux"; + }; + + hardware = { + raspberry-pi = { + config = { + all = { + base-dt-params = { + BOOT_UART = { + value = 1; + enable = true; + }; + uart_2ndstage = { + value = 1; + enable = true; + }; + }; + dt-overlays = { + disable-bt = { + enable = true; + params = { }; + }; + }; + }; + }; + }; + }; + + ${namespace} = { + submodules.basics = enabled; + + services = { + openssh = enabled; + remotebuild = enabled; + }; + + apps.cli-apps.helix.pkg = pkgs.helix; + + system = { + # cachemiss for webkit gtk + hardware.networking.enable = mkForce false; + + # rasberry pi uses alternative boot settings + boot.enable = mkForce false; + }; + + user.trustedPublicKeys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFrDiO5+vMfD5MimkzN32iw3MnSMLZ0mHvOrHVVmLD0" + ]; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/systems/x86_64-linux/loptland/default.nix b/systems/x86_64-linux/loptland/default.nix new file mode 100644 index 0000000..805687d --- /dev/null +++ b/systems/x86_64-linux/loptland/default.nix @@ -0,0 +1,231 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) enabled; + + domainName = "christophhollizeck.dev"; + forgejoPort = 3000; + hydraPort = 2000; + + cfg.enableAcme = true; + + sopsFile = lib.snowfall.fs.get-file "secrets/secrets-loptland.yaml"; +in +{ + imports = [ ./hardware.nix ]; + + environment.systemPackages = [ ]; + + services.qemuGuest.enable = true; + + sops = { + secrets = { + "forgejo/db/password" = { + inherit sopsFile; + }; + "forgejo/mail/password" = { + inherit sopsFile; + }; + "forgejo/mail/passwordHash" = { + inherit sopsFile; + }; + }; + }; + + services.nginx = { + enable = true; + recommendedProxySettings = true; + + virtualHosts = { + "git.${domainName}" = { + forceSSL = cfg.enableAcme; + useACMEHost = mkIf cfg.enableAcme domainName; + + locations."/" = { + extraConfig = '' + client_max_body_size 200M; + ''; + proxyPass = "http://localhost:${toString forgejoPort}/"; + }; + }; + + "hydra.${domainName}" = mkIf config.${namespace}.services.hydra.enable { + forceSSL = cfg.enableAcme; + useACMEHost = mkIf cfg.enableAcme domainName; + + locations."/" = { + proxyPass = "http://localhost:${toString hydraPort}/"; + }; + }; + + "ha.${domainName}" = { + forceSSL = cfg.enableAcme; + useACMEHost = mkIf cfg.enableAcme domainName; + + locations."/" = { + # tailscale ip + extraConfig = '' + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + ''; + proxyPass = "http://100.86.23.74:8123"; + }; + }; + + "nixcache.${domainName}" = mkIf config.${namespace}.services.hydra.enableCache { + forceSSL = cfg.enableAcme; + useACMEHost = mkIf cfg.enableAcme domainName; + + locations."/" = { + proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; + }; + }; + + "_" = { + forceSSL = cfg.enableAcme; + useACMEHost = mkIf cfg.enableAcme domainName; + + locations."/" = { + proxyPass = "https://${domainName}"; + }; + }; + }; + }; + + services.forgejo = { + enable = true; + database.type = "postgres"; + lfs.enable = true; + database = { + passwordFile = config.sops.secrets."forgejo/db/password".path; + }; + + settings = { + server = { + DOMAIN = "git.${domainName}"; + ROOT_URL = "https://git.${domainName}"; + HTTP_PORT = forgejoPort; + }; + + mailer = { + ENABLED = true; + PROTOCOL = "smtps"; + FROM = "no-reply@${domainName}"; + SMTP_ADDR = "mail.${domainName}"; + USER = "forgejo@${domainName}"; + }; + + service.DISABLE_REGISTRATION = true; + }; + + secrets = { + mailer.PASSWD = config.sops.secrets."forgejo/mail/password".path; + }; + }; + + mailserver = { + enable = true; + fqdn = "mail.${domainName}"; + domains = [ domainName ]; + + loginAccounts = { + "forgejo@${domainName}" = { + hashedPasswordFile = config.sops.secrets."forgejo/mail/passwordHash".path; + aliases = [ "no-reply@${domainName}" ]; + }; + }; + + certificateScheme = "acme-nginx"; + stateVersion = 3; + }; + + nix = { + distributedBuilds = true; + + extraOptions = '' + builders-use-substitutes = true + ''; + + buildMachines = [ + { + hostName = "localhost"; + protocol = null; + system = "x86_64-linux"; + + supportedFeatures = [ + "kvm" + "nixos-test" + "big-parallel" + "benchmark" + ]; + } + { + hostName = "100.86.23.74"; + sshUser = "remotebuild"; + sshKey = "/root/.ssh/remotebuild"; + systems = [ "aarch64-linux" ]; + protocol = "ssh"; + + supportedFeatures = [ + "nixos-test" + "big-parallel" + "kvm" + ]; + } + ]; + }; + + services.tailscale = { + enable = true; + useRoutingFeatures = "client"; + }; + + networking.firewall.allowedTCPPorts = [ + forgejoPort + 80 + 443 + ]; + + ${namespace} = { + submodules = { + basics = enabled; + }; + + services = { + factorio-server = { + enable = true; + inherit sopsFile; + }; + openssh = enabled; + hydra = { + enable = true; + httpPort = hydraPort; + enableCache = true; + }; + gitea-runner = { + enable = true; + inherit sopsFile; + }; + }; + + security = { + acme = { + enable = cfg.enableAcme; + inherit sopsFile; + }; + }; + + user.trustedPublicKeys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFrDiO5+vMfD5MimkzN32iw3MnSMLZ0mHvOrHVVmLD0" # yggdrasil + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII4Pr7p0jizrvIl0UhcvrmL5SHRQQQWIcHLAnRFyUZS6" # Phone + ]; + }; + + system.stateVersion = "24.11"; +} diff --git a/systems/x86_64-linux/loptland/hardware.nix b/systems/x86_64-linux/loptland/hardware.nix new file mode 100644 index 0000000..6f1c5cb --- /dev/null +++ b/systems/x86_64-linux/loptland/hardware.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/26b098dd-0a15-49c5-9998-75f43d17eb26"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/30AB-7309"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/b9bcb425-cb1c-40a1-89bb-d7fe6b421834"; } ]; + + networking.useDHCP = lib.mkDefault true; +} diff --git a/systems/x86_64-linux/wsl/default.nix b/systems/x86_64-linux/wsl/default.nix new file mode 100644 index 0000000..8b12117 --- /dev/null +++ b/systems/x86_64-linux/wsl/default.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; +with lib.wyrdgard; +{ + wsl = { + enable = true; + defaultUser = config.wyrdgard.user.name; + + usbip = { + enable = true; + autoAttach = [ "3-1" ]; + }; + }; + + wyrdgard = { + submodules.basics-wsl = enabled; + + security = { + gpg = enabled; + sops = enabled; + }; + }; + + programs.dconf.enable = true; + + system.stateVersion = "24.11"; +} diff --git a/systems/x86_64-linux/yggdrasil/default.nix b/systems/x86_64-linux/yggdrasil/default.nix new file mode 100644 index 0000000..4f3c5fd --- /dev/null +++ b/systems/x86_64-linux/yggdrasil/default.nix @@ -0,0 +1,100 @@ +{ + inputs, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib.${namespace}) enabled disabled; +in +{ + imports = [ + ./hardware.nix + ./hyprland_config.nix + ]; + + environment.systemPackages = with pkgs; [ + path-of-building + teams-for-linux + obsidian + zed-editor + + # eve + bottles + pyfa + + # misc + diebahn + + nixpkgs-review + teamviewer + ]; + + services.teamviewer.enable = true; + + environment.pathsToLink = [ "/libexec" ]; + + virtualisation.waydroid = enabled; + + programs.ssh.extraConfig = '' + AddressFamily inet + ''; + home-manager = { + backupFileExtension = "bak"; + }; + + nix = { + distributedBuilds = true; + settings.builders-use-substitutes = true; + buildMachines = [ + { + hostName = "nixberry"; + sshUser = "remotebuild"; + sshKey = "/root/.ssh/remotebuild"; + systems = [ "aarch64-linux" ]; + protocol = "ssh-ng"; + + supportedFeatures = [ + "nixos-test" + "big-parallel" + "kvm" + ]; + } + ]; + }; + + ${namespace} = { + archetypes = { + gaming.enable = true; + }; + + apps = { + _1password = enabled; + obs-studio = enabled; + cli-apps.helix = enabled; + starsector = enabled; + }; + + desktop.hyprland = { + enable = true; + }; + + services = { + factorio-server = disabled; + }; + + tools.devenv = enabled; + + system = { + hardware = { + bluetooth = enabled; + gpu.amd = enabled; + }; + }; + + security.gpg = enabled; + }; + + system.stateVersion = "23.11"; +} diff --git a/systems/x86_64-linux/yggdrasil/hardware.nix b/systems/x86_64-linux/yggdrasil/hardware.nix new file mode 100644 index 0000000..7133352 --- /dev/null +++ b/systems/x86_64-linux/yggdrasil/hardware.nix @@ -0,0 +1,70 @@ +# 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, + inputs, + pkgs, + modulesPath, + ... +}: +let + inherit (inputs) nixos-hardware; +in +{ + imports = with nixos-hardware.nixosModules; [ + (modulesPath + "/installer/scan/not-detected.nix") + common-cpu-amd + common-pc + common-pc-ssd + ]; + + boot = { + initrd.availableKernelModules = [ + "nvme" + "ahci" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + kernelModules = [ "kvm-amd" ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/b1a956f4-91d5-456e-a92b-be505bb719bd"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/B4D4-8BA0"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + "/storage" = { + device = "/dev/disk/by-uuid/c3c1dec1-7716-4c37-a3f2-bb60f9af84fd"; + fsType = "ext4"; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/4bec00ec-e9eb-4034-836a-ecf15e0bb40e"; } + ]; + + # 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.enp14s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/systems/x86_64-linux/yggdrasil/hyprland_config.nix b/systems/x86_64-linux/yggdrasil/hyprland_config.nix new file mode 100644 index 0000000..fdeb16e --- /dev/null +++ b/systems/x86_64-linux/yggdrasil/hyprland_config.nix @@ -0,0 +1,48 @@ +{ + lib, + namespace, + pkgs, + ... +}: +let +in +{ + ${namespace}.desktop.hyprland.settings = { + monitor = [ + #Ultrawide + "DP-1,3440x1440@144, 0x0, 1" + #Vertical + "HDMI-A-1, 1920x1080@144, auto-right, 1, transform, 1" + # nividia kernel issues + "Unknown-1, disable" + ]; + + cursor = { + no_hardware_cursors = true; + }; + + exec-once = [ + "[workspace 7 silent] obsidian" + + "${lib.getExe pkgs.xorg.xrandr} --output DP-1 --primary" + ]; + + workspace = [ + "1, monitor:DP-1" + "2, monitor:DP-1" + "3, monitor:DP-1" + "4, monitor:DP-1" + "5, monitor:DP-1" + "6, monitor:DP-1" + "7, monitor:HDMI-A-1" + "8, monitor:HDMI-A-1" + "9, monitor:HDMI-A-1" + ]; + + windowrulev2 = [ + "workspace 8 silent, class:^(steam)$, title:^(Friends List)" + "workspace 8 silent, class:^(discord)$, title:^(Discord)" + "workspace 7 silent, class:^(com.obsproject.Studio)$" + ]; + }; +}