diff options
780 files changed, 21479 insertions, 17880 deletions
diff --git a/.editorconfig b/.editorconfig index bb0af45c..066942f6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # EditorConfig is awesome: https://EditorConfig.org # top-most EditorConfig file diff --git a/.envrc b/.envrc index 2f9f1a81..294de504 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1,13 @@ #!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + use flake diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e69de29b..00000000 --- a/.gitattributes +++ /dev/null diff --git a/.gitignore b/.gitignore index e75b469a..f18a8bd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + .direnv .ccls-cache diff --git a/.reuse/templates/default.jinja2 b/.reuse/templates/default.jinja2 new file mode 100644 index 00000000..17499ae1 --- /dev/null +++ b/.reuse/templates/default.jinja2 @@ -0,0 +1,31 @@ +{# +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +#} + +nixos-config - My current NixOS configuration + +{% for copyright_line in copyright_lines %} +{{ copyright_line }} +{% endfor %} +{% for contributor_line in contributor_lines %} +SPDX-FileContributor: {{ contributor_line }} +{% endfor %} +{% for expression in spdx_expressions %} +SPDX-License-Identifier: {{ expression }} +{% endfor %} + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{# + vim: ft=htmldjango +#} diff --git a/CHANGELOG.md b/CHANGELOG.md index efc29655..2a0ccb62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # Changelog All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. diff --git a/COPYING b/COPYING deleted file mode 100644 index f288702d..00000000 --- a/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<https://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt new file mode 100644 index 00000000..f6cdd22a --- /dev/null +++ b/LICENSES/GPL-3.0-or-later.txt @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/> + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>. + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/bootstrap/01_activate.sh b/bootstrap/01_activate.sh deleted file mode 100755 index 72d947c5..00000000 --- a/bootstrap/01_activate.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -. %SCRIPT_ENSURE_CONFIG_VARIABLES - -nix run github:nix-community/disko --experimental-features 'nix-command flakes' -- --flake "git+https://codeberg.org/soispha/nixos-config#$NIX_HOST" --mode mount - -msg "Finished mounting" - -case "$ACTIVATE_TO_SETUP" in -"yes") - nix run "git+https://codeberg.org/soispha/nixos-config#setup" --experimental-features 'nix-command flakes' - ;; -*) ;; -esac - -# vim: ft=sh diff --git a/bootstrap/01_install.sh b/bootstrap/01_install.sh deleted file mode 100755 index 25122568..00000000 --- a/bootstrap/01_install.sh +++ /dev/null @@ -1,82 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -INSTALL=y . %SCRIPT_ENSURE_CONFIG_VARIABLES - -msg "Important information:" -msg2 "Choose disk id is: $NIX_DISK" -warning "This information needs to be entered in the host configuration BEFORE rebuilding it. Otherwise you'll have to wait for a 1 h cooldown!" -info_applied=false -while [ "$info_applied" = false ]; do - readp "Have you updated your chosen host with the choose disk id? [N/y]: " result - # shellcheck disable=SC2154 - case $result in - [Yy]) - info_applied=true - ;; - *) - warning "You won't be able to boot, if you don't update it!" - ;; - esac -done - -msg "Started creating filesystem..." -nix run github:nix-community/disko --experimental-features 'nix-command flakes' -- --flake "git+https://codeberg.org/soispha/nixos-config#$NIX_HOST" --mode disko -msg "Finished mounting and generating btrfs subvolumes" - -msg "Creating swapfile..." -msg2 "$(btrfs filesystem mkswapfile --size "$(free -m | awk '{if (NR==2) {printf "%sm\n", $2 + 500}}')" /mnt/swap/swapfile)" -msg "Finished creating swapfile!" - -msg "Important information:" -msg2 "Swapfile UUID is: $(findmnt -no UUID -T /mnt/swap/swapfile)" -msg2 "Swapfile resume offset is: $(btrfs inspect-internal map-swapfile -r /mnt/swap/swapfile)" -warning "This information needs to be entered in the host configuration BEFORE rebuilding it. Otherwise the system won't boot!" - -info_applied=false -while [ "$info_applied" = false ]; do - readp "Have you updated your chosen host with this information? [N/y]: " result - case $result in - [Yy]) - info_applied=true - ;; - *) - warning "You won't be able to boot, if you don't update it!" - ;; - esac -done - -msg "Checking for incompatibilities..." -ssd_or_hdd="$(cat /sys/block/"$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DISK")" | tr -d '\n')"/queue/rotational)" -case "$ssd_or_hdd" in -0) - msg2 "You seem to use a ssd." - trim_support=$(lsblk --bytes --json --discard | jq --arg name "$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DISK")" | tr -d '\n')" '.blockdevices | .[] | select(.name == $name) | (.["disc-gran"] + .["disc-max"]) != 0') - case $trim_support in - "true") - msg2 "Yay, your ssd supports trim, go on and activate it" - ;; - "false") - msg2 "Nay, your ssd doesn't support trim" - ;; - *) - warning "Your ssd doesn't seem to exists, if this bothers you please open an issue." - ;; - esac - ;; -1) - msg2 "You seem to use a hdd there is nothing you have to do" - ;; -*) - warning "There is no indicator, which shows, which drive your are using.\n This means, that you have to check yourself, which optimizations you should activate." - ;; -esac - -case "$INSTALL_TO_SETUP" in -"yes") - nix run "git+https://codeberg.org/soispha/nixos-config#setup" --experimental-features 'nix-command flakes' - ;; -*) ;; -esac diff --git a/bootstrap/02_setup.sh b/bootstrap/02_setup.sh deleted file mode 100755 index e68b9a90..00000000 --- a/bootstrap/02_setup.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -. %SCRIPT_ENSURE_CONFIG_VARIABLES - -nixos-install --flake git+https://codeberg.org/soispha/nixos-config#"$NIX_HOST" --no-root-passwd - -# clone the git config -git clone https://codeberg.org/soispha/nixos-config.git /mnt/srv/etc/nixos - -# setup persistent home dir -mkdir --parents /mnt/srv/home -chown 1000:100 --recursive /mnt/srv/home -chmod 700 /mnt/srv/home - -case "$SETUP_TO_CONFIG_SETUP" in -"yes") - nix run "git+https://codeberg.org/soispha/nixos-config#config_setup" --experimental-features 'nix-command flakes' - ;; -*) ;; -esac diff --git a/bootstrap/03_config_setup.sh b/bootstrap/03_config_setup.sh deleted file mode 100755 index 349e8ebc..00000000 --- a/bootstrap/03_config_setup.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# clone packer.nvim to the needed dir, for the nvim install to work -git clone --depth 1 https://github.com/wbthomason/packer.nvim /mnt/srv/home/soispha/.local/share/nvim/site/pack/packer/start/packer.nvim - -nixos-enter --command 'nvim -c "PackerSync" -c "qall" -u "/mnt/srv/home/soispha/.config/nvim/init.lua" --headless' - -# vim: ft=sh diff --git a/bootstrap/99_ensure_config_variables.sh b/bootstrap/99_ensure_config_variables.sh deleted file mode 100755 index f0380f6b..00000000 --- a/bootstrap/99_ensure_config_variables.sh +++ /dev/null @@ -1,123 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -if ! [ "$NIX_ENVIRONMENT_VARIABLES_SET" ]; then - if ! [ "$NIX_HOST" ]; then - msg "Select a host:" - _hosts=$(mktmp) - curl https://codeberg.org/soispha/nixos-config/raw/branch/prime/flake/nixosConfigurations/default.nix 2>/dev/null | awk -F '"' '/hosts = /{for (i=2;i<NF;i+=2) {print $i}}' >"$_hosts" - - while ! grep "$host" "$_hosts" >/dev/null || [ "$(printf "%s" "$host" | wc -c)" -eq 0 ]; do - i=1 - while read -r host_read; do - printf "%4s) %s \n" "$i" "$host_read" - i=$((i + 1)) - done <"$_hosts" - printf "%4s) Exit\n" "q" - readp "Enter a option: " host - - [ "$host" = "q" ] && exit 1 - host=$(awk -v i="$host" '{if (NR==i) {print $0}}' "$_hosts") - if ! grep "$host" "$_hosts" >/dev/null || [ "$(printf "%s" "$host" | wc -c)" -eq 0 ]; then - warning "No host selected. Select a host to continue.\n" - fi - done - - export NIX_HOST="$host" - fi - if ! [ "$NIX_DISK" ] && [ "$INSTALL" ]; then - available_disks="$(mktmp)" - lsblk -J | jq '.[] | map(.name) | [foreach .[] as $item ({item: null, index: -1}; {$item, index: (.index + 1)})]' >"$available_disks" - - [ "$(jq '.[]' "$available_disks" | wc -l)" -eq 0 ] && die "No disks found" - msg "Select a disk to format:" - - i=9999 # nobody will have so many disks attached - - while ! jq -e --argjson i "$i" '.[$i]' "$available_disks" >/dev/null 2>&1; do - for _disk in $(jq -c '.[]' "$available_disks"); do - printf "%4s) %s \n" "$(echo "$_disk" | jq '.index')" "$(echo "$_disk" | jq '.item' | tr -d '"')" - done - printf "%4s) Exit\n" "q" - readp "Enter a option: " _disk - - if [ "$_disk" = "q" ]; then - exit 1 - else - i="$_disk" - fi - if jq -e --argjson i "$i" 'nth($i)' "$available_disks" >/dev/null 2>&1; then - _disk=$(mktmp) - jq -e --argjson i "$i" 'nth($i)' "$available_disks" >"$_disk" - else - warning "No disk selected. Select a disk to continue.\n" - fi - done - - warn "All data on disk $(jq '.item' "$_disk") will be deleted." - readp "Continue with this disk? [N/y]: " result - # shellcheck disable=SC2154 - case "$result" in - [Yy]) - msg "Great, continuing..." - _disk="$(jq '.item' "$_disk" | tr -d '"')" - _disk_serial="$(udevadm info --query=all --name="$_disk" | grep ID_SERIAL= | awk 'BEGIN{FS="="}{print $2}')" - case "$_disk" in - "nvme"*) - _nix_disk="nvme-$_disk_serial" - ;; - "sd"*) - _nix_disk="ata-$_disk_serial" - ;; - *) - die "Disk with name '$_disk' and serial '$_disk_serial' not yet supported!" - ;; - esac - export NIX_DISK="$_nix_disk" - ;; - *) - msg "Sure, keep your data" - exit 1 - ;; - esac - fi - - if ! [ "$ACTIVATE_TO_SETUP" ] && ! [ "$INSTALL" ]; then - readp "Do you want to continue with nixos-install after activation? [N/y]: " result - case $result in - [Yy]) - export ACTIVATE_TO_SETUP=yes - ;; - *) - export ACTIVATE_TO_SETUP=no - ;; - esac - fi - if ! [ "$INSTALL_TO_SETUP" ] && [ "$INSTALL" ]; then - readp "Do you want to continue with nixos-install after disk formatting? [N/y]: " result - case $result in - [Yy]) - export INSTALL_TO_SETUP=yes - ;; - *) - export INSTALL_TO_SETUP=no - ;; - esac - fi - if ! [ "$SETUP_TO_CONFIG_SETUP" ]; then - readp "Do you want to continue with the user configuration setup after setup? [N/y]: " result - case $result in - [Yy]) - export SETUP_TO_CONFIG_SETUP=yes - ;; - *) - export SETUP_TO_CONFIG_SETUP=no - ;; - esac - fi - export NIX_ENVIRONMENT_VARIABLES_SET="set" -fi - -# vim: ft=sh diff --git a/bootstrap/default.nix b/bootstrap/default.nix deleted file mode 100644 index c47df9da..00000000 --- a/bootstrap/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - pkgs, - sysLib, - ... -}: let - ensure_config_variables_dependencies = builtins.attrValues {inherit (pkgs) systemd jq dash gnugrep curl;}; - replacementStrings = {SCRIPT_ENSURE_CONFIG_VARIABLES = "${ensure_config_variables}/bin/ensure_config_variables";}; - activate = sysLib.writeShellScript { - dependencies = with pkgs; [jq gawk curl coreutils libuuid lix git] ++ ensure_config_variables_dependencies; - name = "activate"; - src = ./01_activate.sh; - inherit replacementStrings; - }; - install = sysLib.writeShellScript { - dependencies = with pkgs; [jq dash curl gawk btrfs-progs coreutils libuuid gptfdisk dosfstools toybox lix git] ++ ensure_config_variables_dependencies; - name = "install"; - src = ./01_install.sh; - inherit replacementStrings; - }; - setup = sysLib.writeShellScript { - dependencies = with pkgs; [dash gawk curl git lix gnugrep nixos-install-tools coreutils libuuid] ++ ensure_config_variables_dependencies; - name = "setup"; - src = ./02_setup.sh; - inherit replacementStrings; - }; - config_setup = sysLib.writeShellScript { - dependencies = builtins.attrValues {inherit (pkgs) git neovim;} ++ ensure_config_variables_dependencies; - name = "config_setup"; - src = ./03_config_setup.sh; - keepPath = true; - inherit replacementStrings; - }; - ensure_config_variables = sysLib.writeShellScript { - name = "ensure_config_variables"; - src = ./99_ensure_config_variables.sh; - wrap = false; - }; - output = {inherit activate install setup config_setup ensure_config_variables;}; -in - output diff --git a/build.sh b/build.sh index 3c3d387c..de4d536c 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,18 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + host="${1-tiamat}" +[ "$#" -gt 0 ] && shift 1 + root="$(git rev-parse --show-toplevel)" SYSTEM_OUT="$root/result-system" @@ -19,7 +31,7 @@ check() { } build_system() { - _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link)" + _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link "$@")" exit_val="$?" if [ "$exit_val" -ne 0 ]; then @@ -30,7 +42,7 @@ build_system() { fi } -system="$(build_system)" +system="$(build_system "$@")" [ "$system" = "1" ] && exit 1 check "$SYSTEM_OUT" diff --git a/cog.toml b/cog.toml index b42a613d..3941be5b 100644 --- a/cog.toml +++ b/cog.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + from_latest_tag = false tag_prefix = "v" ignore_merge_commits = false diff --git a/flake.lock b/flake.lock index c52bac02..1826361e 100644 --- a/flake.lock +++ b/flake.lock @@ -16,11 +16,11 @@ ] }, "locked": { - "lastModified": 1736955230, - "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", + "lastModified": 1750173260, + "narHash": "sha256-9P1FziAwl5+3edkfFcr5HeGtQUtrSdk/MksX39GieoA=", "owner": "ryantm", "repo": "agenix", - "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", + "rev": "531beac616433bac6f9e2a19feb8e99a22a66baf", "type": "github" }, "original": { @@ -57,11 +57,11 @@ }, "crane": { "locked": { - "lastModified": 1737689766, - "narHash": "sha256-ivVXYaYlShxYoKfSo5+y5930qMKKJ8CLcAoIBPQfJ6s=", + "lastModified": 1750266157, + "narHash": "sha256-tL42YoNg9y30u7zAqtoGDNdTyXTi8EALDeCB13FtbQA=", "owner": "ipetkov", "repo": "crane", - "rev": "6fe74265bbb6d016d663b1091f015e2976c4a527", + "rev": "e37c943371b73ed87faf33f7583860f81f1d5a48", "type": "github" }, "original": { @@ -77,11 +77,11 @@ ] }, "locked": { - "lastModified": 1735644329, - "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=", + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", "owner": "numtide", "repo": "devshell", - "rev": "f7795ede5b02664b57035b3b757876703e2c3eac", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", "type": "github" }, "original": { @@ -97,11 +97,11 @@ ] }, "locked": { - "lastModified": 1738148035, - "narHash": "sha256-KYOATYEwaKysL3HdHdS5kbQMXvzS4iPJzJrML+3TKAo=", + "lastModified": 1750680230, + "narHash": "sha256-kD88T/NqmcgfOBFAwphN30ccaUdj6K6+LG0XdM2w2LA=", "owner": "nix-community", "repo": "disko", - "rev": "18d0a984cc2bc82cf61df19523a34ad463aa7f54", + "rev": "8fd2d6c75009ac75f9a6fb18c33a239806778d01", "type": "github" }, "original": { @@ -113,11 +113,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -133,11 +133,11 @@ ] }, "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", "type": "github" }, "original": { @@ -166,32 +166,6 @@ "type": "github" } }, - "flake_version_update": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], - "systems": [ - "systems" - ] - }, - "locked": { - "lastModified": 1685288691, - "narHash": "sha256-oP6h34oJ8rm6KlUpyZrX+ww3hnoWny2ecrEXxkU7F3c=", - "ref": "refs/heads/prime", - "rev": "e9a97e01eca780bd16e1dbdbd8856b59558f4959", - "revCount": 5, - "type": "git", - "url": "https://codeberg.org/soispha/flake_version_update.git" - }, - "original": { - "type": "git", - "url": "https://codeberg.org/soispha/flake_version_update.git" - } - }, "git-hooks": { "inputs": { "flake-compat": [ @@ -205,11 +179,11 @@ ] }, "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", + "lastModified": 1750684550, + "narHash": "sha256-uLtw0iF9mQ94L831NOlQLPX9wm0qzd5yim3rcwACEoM=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "rev": "fae816c55a75675f30d18c9cbdecc13b970d95d4", "type": "github" }, "original": { @@ -265,11 +239,11 @@ ] }, "locked": { - "lastModified": 1738145391, - "narHash": "sha256-/9mfbWYN9HDQbKa2HdAe2T5e3FfY8e4eqc1FIvAyvLg=", + "lastModified": 1750730235, + "narHash": "sha256-rZErlxiV7ssvI8t7sPrKU+fRigNc2KvoKZG3gtUtK50=", "owner": "nix-community", "repo": "home-manager", - "rev": "1b4f2a48168b3d90e11365552d1e7e601a4be6b6", + "rev": "d07e9cceb4994ed64a22b9b36f8b76923e87ac38", "type": "github" }, "original": { @@ -306,16 +280,16 @@ ] }, "locked": { - "lastModified": 1729958008, - "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", + "lastModified": 1748294338, + "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", "owner": "NuschtOS", "repo": "ixx", - "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", + "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", "type": "github" }, "original": { "owner": "NuschtOS", - "ref": "v0.0.6", + "ref": "v0.0.8", "repo": "ixx", "type": "github" } @@ -358,11 +332,11 @@ }, "library": { "locked": { - "lastModified": 1738161079, - "narHash": "sha256-YDiu0DbtwOSo1GO3D9A0Q+dHzsYJ6pJ8ZYEkgmK1szI=", + "lastModified": 1738443114, + "narHash": "sha256-IV7n/l3rFoz5UuavrDv0a7IIOPne0jDQVmJAR8bve8U=", "ref": "prime", - "rev": "847a8167fe3b52c3b8e19017b31a97e12ad411ea", - "revCount": 16, + "rev": "65bf71bb6ef05ce684924a1dc248bb2e8e2869fb", + "revCount": 17, "type": "git", "url": "https://git.foss-syndicate.org/vhack.eu/nix-library" }, @@ -379,11 +353,11 @@ ] }, "locked": { - "lastModified": 1738033138, - "narHash": "sha256-qlIM8A3bdL9c6PexhpS+QyZLO9y/8a3V75HVyJgDE5Q=", + "lastModified": 1750618568, + "narHash": "sha256-w9EG5FOXrjXGfbqCcQg9x1lMnTwzNDW5BMXp8ddy15E=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "349a74c66c596ef97ee97b4d80a3ca61227b6120", + "rev": "1dd19f19e4b53a1fd2e8e738a08dd5fe635ec7e5", "type": "github" }, "original": { @@ -420,11 +394,11 @@ ] }, "locked": { - "lastModified": 1737861961, - "narHash": "sha256-LIRtMvAwLGb8pBoamzgEF67oKlNPz4LuXiRPVZf+TpE=", + "lastModified": 1750565152, + "narHash": "sha256-A6ZIoIgaPPkzIVxKuaxwEJicPOeTwC/MD9iuC3FVhDM=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "79b7b8eae3243fc5aa9aad34ba6b9bbb2266f523", + "rev": "78cd697acc2e492b4e92822a4913ffad279c20e6", "type": "github" }, "original": { @@ -433,50 +407,6 @@ "type": "github" } }, - "nixVim": { - "inputs": { - "devshell": [ - "devshell" - ], - "flake-compat": [ - "flake-compat" - ], - "flake-parts": [ - "flake-parts" - ], - "git-hooks": [ - "git-hooks" - ], - "home-manager": [ - "home-manager" - ], - "nix-darwin": [ - "nix-darwin" - ], - "nixpkgs": [ - "nixpkgs" - ], - "nuschtosSearch": [ - "nuschtosSearch" - ], - "treefmt-nix": [ - "treefmt-nix" - ] - }, - "locked": { - "lastModified": 1738170240, - "narHash": "sha256-4Sj34kjdmGVwwvCPOL4zztLOLMUv2jfvBDkvq6/KySc=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "e908e344f4cd7b3eb629b93e8af312888f3ee681", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, "nixos-generators": { "inputs": { "nixlib": [ @@ -487,11 +417,11 @@ ] }, "locked": { - "lastModified": 1737057290, - "narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=", + "lastModified": 1747663185, + "narHash": "sha256-Obh50J+O9jhUM/FgXtI3he/QRNiV9+J53+l+RlKSaAk=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453", + "rev": "ee07ba0d36c38e9915c55d2ac5a8fb0f05f2afcc", "type": "github" }, "original": { @@ -502,27 +432,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "lastModified": 1751160262, + "narHash": "sha256-Auc7fgqa3RErx5XslOeW4FVNBaE2RU4PMYKgA0Qwi7c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "rev": "3fd29d9d28e8536c827018bf5779488cfc2d8736", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-unstable-small", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-lib": { "locked": { - "lastModified": 1737853225, - "narHash": "sha256-ZqbbvE9MVNHxSObvAoqRExBsQpfz81u3Ry77agBJIyo=", + "lastModified": 1750555020, + "narHash": "sha256-/MjivcZIz8dyLOTFdJzS5Yazt2QCePQBh8uZooODaYw=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "31d08f4e55442d13eb8766b4d6852d9fb8292382", + "rev": "6fb7349157ee1bffd053b1fdd454aa74ff7b4aee", "type": "github" }, "original": { @@ -531,51 +461,48 @@ "type": "github" } }, - "nixpkgs-onlykey": { - "locked": { - "lastModified": 1711294706, - "narHash": "sha256-KhDQnSH2cZNiw8QUvcaTmz/xRR0TdsAGz1S5yvCSbls=", - "owner": "soispha", - "repo": "nixpkgs", - "rev": "16367bebf75f1beaa64dcda55ebcc2c87cb7cd34", - "type": "github" - }, - "original": { - "owner": "soispha", - "ref": "fix-onlykey-agent", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-stable": { "locked": { - "lastModified": 1738023785, - "narHash": "sha256-BPHmb3fUwdHkonHyHi1+x89eXB3kA1jffIpwPVJIVys=", + "lastModified": 1750622754, + "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2b4230bf03deb33103947e2528cac2ed516c5c89", + "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-tfc": { + "nixvim": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": [ + "nuschtosSearch" + ], + "systems": [ + "systems" + ] + }, "locked": { - "lastModified": 1723544577, - "narHash": "sha256-OclFNxcgAFCBQPSxCzy7mO/sB5TGzhe/JWmbUGVV7Lw=", - "owner": "soispha", - "repo": "nixpkgs", - "rev": "727bfcd1e1ffba0f4f58c9eea91087703025670a", + "lastModified": 1750751277, + "narHash": "sha256-wdUjRFiiHK8sDmntP1wLYZEqKgju8bGedwulu+myD6E=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "3843b6226193bd2c40de0aea1343065b1bf9d3e4", "type": "github" }, "original": { - "owner": "soispha", - "ref": "add-termfilechooser", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "nixvim", "type": "github" } }, @@ -590,11 +517,11 @@ ] }, "locked": { - "lastModified": 1737924095, - "narHash": "sha256-9RO/IlxiE7bpY7GYsdDMNB533PnDOBo9UvYyXXqlN4c=", + "lastModified": 1749730855, + "narHash": "sha256-L3x2nSlFkXkM6tQPLJP3oCBMIsRifhIDPMQQdHO5xWo=", "owner": "NuschtOS", "repo": "search", - "rev": "5efc9c966bb9bdad07a3c28667eac38b758c6f18", + "rev": "8dfe5879dd009ff4742b668d9c699bc4b9761742", "type": "github" }, "original": { @@ -620,11 +547,11 @@ ] }, "locked": { - "lastModified": 1736884309, - "narHash": "sha256-eiCqmKl0BIRiYk5/ZhZozwn4/7Km9CWTbc15Cv+VX5k=", + "lastModified": 1743690424, + "narHash": "sha256-cX98bUuKuihOaRp8dNV1Mq7u6/CQZWTPth2IJPATBXc=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "75d0515332b7ca269f6d7abfd2c44c47a7cbca7b", + "rev": "ce2369db77f45688172384bbeb962bc6c2ea6f94", "type": "github" }, "original": { @@ -646,11 +573,11 @@ ] }, "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", + "lastModified": 1750684550, + "narHash": "sha256-uLtw0iF9mQ94L831NOlQLPX9wm0qzd5yim3rcwACEoM=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "rev": "fae816c55a75675f30d18c9cbdecc13b970d95d4", "type": "github" }, "original": { @@ -675,11 +602,11 @@ ] }, "locked": { - "lastModified": 1735599473, - "narHash": "sha256-lKKA9AI7uk+G+OY4fX3EcnTWqq9pr7Vryxxrm4aiT28=", + "lastModified": 1738406121, + "narHash": "sha256-N3scpt+nwPbqzsRs4gjZpDiBivfPRQJ0D75bPeYhHME=", "ref": "prime", - "rev": "a91e8256a3adc1ab7ee94bfcea7198b51cfb6b37", - "revCount": 18, + "rev": "2b6889092e5839c8987e800f1d3d847dd5b50153", + "revCount": 19, "type": "git", "url": "https://git.foss-syndicate.org/bpeetz/qmk_layout.git" }, @@ -689,70 +616,6 @@ "url": "https://git.foss-syndicate.org/bpeetz/qmk_layout.git" } }, - "ragenix": { - "inputs": { - "agenix": [ - "agenix" - ], - "crane": [ - "crane" - ], - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1726755133, - "narHash": "sha256-03XIEjHeZEjHXctsXYUB+ZLQmM0WuhR6qWQjwekFk/M=", - "owner": "yaxitech", - "repo": "ragenix", - "rev": "687ee92114bce9c4724376cf6b21235abe880bfa", - "type": "github" - }, - "original": { - "owner": "yaxitech", - "repo": "ragenix", - "type": "github" - } - }, - "river_init_lesser": { - "inputs": { - "crane": [ - "crane" - ], - "flake-compat": [ - "flake-compat" - ], - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1683353540, - "narHash": "sha256-tOf9gfFzWjZxIF/2BAU64aH55xfic6SapKsFqVn6U/8=", - "ref": "refs/heads/prime", - "rev": "aedd2bf8863802443d7b6df94646c239d67b2796", - "revCount": 10, - "type": "git", - "url": "https://codeberg.org/soispha/river_keymap_init.git" - }, - "original": { - "type": "git", - "url": "https://codeberg.org/soispha/river_keymap_init.git" - } - }, "root": { "inputs": { "agenix": "agenix", @@ -763,7 +626,6 @@ "flake-compat": "flake-compat", "flake-parts": "flake-parts", "flake-utils": "flake-utils", - "flake_version_update": "flake_version_update", "git-hooks": "git-hooks", "gitignore": "gitignore", "haumea": "haumea", @@ -773,26 +635,20 @@ "library": "library", "nix-darwin": "nix-darwin", "nix-index-database": "nix-index-database", - "nixVim": "nixVim", "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs", "nixpkgs-lib": "nixpkgs-lib", - "nixpkgs-onlykey": "nixpkgs-onlykey", "nixpkgs-stable": "nixpkgs-stable", - "nixpkgs-tfc": "nixpkgs-tfc", + "nixvim": "nixvim", "nuschtosSearch": "nuschtosSearch", "poetry2nix": "poetry2nix", "pre-commit-hooks": "pre-commit-hooks", "qmk_firmware": "qmk_firmware", - "ragenix": "ragenix", - "river_init_lesser": "river_init_lesser", "rust-overlay": "rust-overlay", "serverphone": "serverphone", - "shell_library": "shell_library", "systems": "systems", "templates": "templates", - "treefmt-nix": "treefmt-nix", - "user_js": "user_js" + "treefmt-nix": "treefmt-nix" } }, "rust-overlay": { @@ -802,11 +658,11 @@ ] }, "locked": { - "lastModified": 1738117527, - "narHash": "sha256-GFviGfaezjGLFUlxdv3zyC7rSZvTXqwcG/YsF6MDkOw=", + "lastModified": 1750732748, + "narHash": "sha256-HR2b3RHsPeJm+Fb+1ui8nXibgniVj7hBNvUbXEyz0DU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6a3dc6ce4132bd57359214d986db376f2333c14d", + "rev": "4b4494b2ba7e8a8041b2e28320b2ee02c115c75f", "type": "github" }, "original": { @@ -850,35 +706,6 @@ "url": "https://codeberg.org/vhack.eu/serverphone.git" } }, - "shell_library": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "flake_version_update": [ - "flake_version_update" - ], - "nixpkgs": [ - "nixpkgs" - ], - "systems": [ - "systems" - ] - }, - "locked": { - "lastModified": 1710519017, - "narHash": "sha256-7C7onkhZiLwzrrf9XfzHEOjht9FmZfGABPbzE8XOYoI=", - "ref": "refs/heads/prime", - "rev": "24713f56f30e755553cac9497258ebc5d73036dc", - "revCount": 180, - "type": "git", - "url": "https://codeberg.org/soispha/shell_library.git" - }, - "original": { - "type": "git", - "url": "https://codeberg.org/soispha/shell_library.git" - } - }, "systems": { "locked": { "lastModified": 1680978846, @@ -930,11 +757,11 @@ ] }, "locked": { - "lastModified": 1738070913, - "narHash": "sha256-j6jC12vCFsTGDmY2u1H12lMr62fnclNjuCtAdF1a4Nk=", + "lastModified": 1749194973, + "narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "bebf27d00f7d10ba75332a0541ac43676985dea3", + "rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5", "type": "github" }, "original": { @@ -942,22 +769,6 @@ "repo": "treefmt-nix", "type": "github" } - }, - "user_js": { - "flake": false, - "locked": { - "lastModified": 1736708527, - "narHash": "sha256-/JQo2XnLF8qfSQKvjuFDtvzzz/QHO/dLBHJO4vLOXNk=", - "owner": "arkenfox", - "repo": "user.js", - "rev": "c25187332e19c633b956a6755a7971a6591d3e8d", - "type": "github" - }, - "original": { - "owner": "arkenfox", - "repo": "user.js", - "type": "github" - } } }, "root": "root", diff --git a/flake.lock.license b/flake.lock.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/flake.lock.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/flake.nix b/flake.nix index 7a4473cf..9c5a2963 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,22 @@ -# Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# nixos-config - My current NixOS configuration # +# Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> # SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { description = "A NixOS System Configuration"; inputs = { # base - nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; # open nixpkgs prs - # FIXME: Close these PRs <2024-09-07> - nixpkgs-tfc.url = "github:soispha/nixpkgs/add-termfilechooser"; - nixpkgs-onlykey.url = "github:soispha/nixpkgs/fix-onlykey-agent"; library = { url = "git+https://git.foss-syndicate.org/vhack.eu/nix-library?ref=prime"; @@ -115,14 +119,6 @@ nixpkgs.follows = "nixpkgs"; }; }; - flake_version_update = { - url = "git+https://codeberg.org/soispha/flake_version_update.git"; - inputs = { - systems.follows = "systems"; - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; # nixos modules home-manager = { @@ -137,18 +133,13 @@ nixpkgs.follows = "nixpkgs"; }; }; - nixVim = { + nixvim = { url = "github:nix-community/nixvim"; inputs = { - devshell.follows = "devshell"; - flake-compat.follows = "flake-compat"; flake-parts.follows = "flake-parts"; - git-hooks.follows = "git-hooks"; - home-manager.follows = "home-manager"; - nix-darwin.follows = "nix-darwin"; nixpkgs.follows = "nixpkgs"; - treefmt-nix.follows = "treefmt-nix"; nuschtosSearch.follows = "nuschtosSearch"; + systems.follows = "systems"; }; }; agenix = { @@ -160,16 +151,6 @@ systems.follows = "systems"; }; }; - ragenix = { - url = "github:yaxitech/ragenix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - agenix.follows = "agenix"; - flake-utils.follows = "flake-utils"; - rust-overlay.follows = "rust-overlay"; - crane.follows = "crane"; - }; - }; impermanence = { url = "github:nix-community/impermanence"; inputs = { @@ -198,7 +179,6 @@ inputs = { nixpkgs.follows = "nixpkgs-stable"; flake-compat.follows = "flake-compat"; - flake-utils.follows = "flake-utils"; flake-parts.follows = "flake-parts"; crane.follows = "crane"; rust-overlay.follows = "rust-overlay"; @@ -224,25 +204,6 @@ }; # my bins - shell_library = { - url = "git+https://codeberg.org/soispha/shell_library.git"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - systems.follows = "systems"; - flake_version_update.follows = "flake_version_update"; - }; - }; - river_init_lesser = { - url = "git+https://codeberg.org/soispha/river_keymap_init.git"; - inputs = { - nixpkgs.follows = "nixpkgs"; - crane.follows = "crane"; - flake-utils.follows = "flake-utils"; - rust-overlay.follows = "rust-overlay"; - flake-compat.follows = "flake-compat"; - }; - }; qmk_firmware = { url = "git+https://git.foss-syndicate.org/bpeetz/qmk_layout.git?ref=prime"; inputs = { @@ -254,10 +215,6 @@ }; # external resources - user_js = { - url = "github:arkenfox/user.js"; - flake = false; - }; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs = { @@ -271,82 +228,83 @@ self, nixpkgs, nixpkgs-stable, - nixpkgs-tfc, - nixpkgs-onlykey, library, # modules home-manager, nixos-generators, impermanence, agenix, - ragenix, serverphone, disko, lanzaboote, - nixVim, + nixvim, nix-index-database, # external dependencies - user_js, treefmt-nix, templates, # my binaries - shell_library, - river_init_lesser, qmk_firmware, ... }: let system = "x86_64-linux"; - sysLib = shell_library.lib.${system}; - inherit (library) nixLib; + packageSets = rec { + stable = nixpkgs-stable.legacyPackages.${system}; + unstable = nixpkgs.legacyPackages.${system}; - pkgsStable = nixpkgs-stable.legacyPackages.${system}; - pkgs = nixpkgs.legacyPackages.${system}; - myPkgs = import ./pkgs { - inherit sysLib pkgs nixLib; + soispha = import ./pkgs { + inherit libraries; + pkgs = unstable; + }; }; - nixpkgs_as_input = nixpkgs; - nixpkgs_open_prs = { - inherit - nixpkgs-tfc - nixpkgs-onlykey - ; + libraries = rec { + nix = packageSets.unstable.lib; + base = import ./lib {lib = nix;}; + extra = library.nixLib; }; - outputs = import ./flake { + modules = { inherit - # core - self - pkgs - pkgsStable - nixLib - myPkgs - system - sysLib - nixpkgs_as_input - nixpkgs_open_prs - # modules home-manager - nixVim + nixvim nixos-generators impermanence agenix - ragenix serverphone disko lanzaboote nix-index-database - # external dependencies + ; + }; + + externalDependencies = { + inherit treefmt-nix - user_js templates - # my binaries - shell_library - river_init_lesser + ; + }; + + externalBinaries = { + inherit qmk_firmware ; }; + + openPRsNixpkgs = {}; + + outputs = import ./flake { + inherit + self + system + openPRsNixpkgs + packageSets + libraries + modules + externalDependencies + externalBinaries + ; + }; in outputs; } diff --git a/flake/apps/default.nix b/flake/apps/default.nix deleted file mode 100644 index f1709c71..00000000 --- a/flake/apps/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - self, - system, - ... -}: { - install = { - type = "app"; - program = "${self.packages."${system}".install}/bin/install"; - }; - activate = { - type = "app"; - program = "${self.packages."${system}".activate}/bin/activate"; - }; - setup = { - type = "app"; - program = "${self.packages."${system}".setup}/bin/setup"; - }; - config_setup = { - type = "app"; - program = "${self.packages."${system}".config_setup}/bin/config_setup"; - }; - default = self.apps."${system}".activate; -} diff --git a/flake/default.nix b/flake/default.nix index be6d2b70..e80e6ead 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -1,83 +1,58 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - # core self, - pkgs, - pkgsStable, - nixLib, - myPkgs, system, - sysLib, - nixpkgs_as_input, - nixpkgs_open_prs, - # modules - home-manager, - nixVim, - nixos-generators, - impermanence, - agenix, - ragenix, - serverphone, - disko, - lanzaboote, - nix-index-database, - # external dependencies - user_js, - treefmt-nix, - templates, - # my binaries - shell_library, - river_init_lesser, - qmk_firmware, + openPRsNixpkgs, + packageSets, + libraries, + modules, + externalDependencies, + externalBinaries, }: let - treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; + # Unpack common stuff. + nixLib = libraries.extra; + pkgs = packageSets.unstable; - nixosConfigurations = import ./nixosConfigurations { + treefmtEval = import ./treefmt.nix { + inherit (externalDependencies) treefmt-nix; + inherit pkgs; + }; + + nixosConfigurations = import ../hosts { inherit self - pkgsStable - myPkgs system - nixpkgs_as_input - nixpkgs_open_prs - # my things - shell_library - sysLib - nixLib - templates - # modules - home-manager - nixVim - nixos-generators - impermanence - agenix - ragenix - serverphone - disko - lanzaboote - nix-index-database - # bins - river_init_lesser - qmk_firmware - # external - user_js + openPRsNixpkgs + packageSets + libraries + modules + externalDependencies + externalBinaries ; }; tests = import ../tests { - inherit pkgs nixpkgs_as_input myPkgs sysLib nixLib; + inherit pkgs nixLib openPRsNixpkgs system; + myPkgs = packageSets.soispha; inherit (pkgs) lib; extraModules = { - termfilechooser = "${nixpkgs_open_prs.nixpkgs-tfc}/nixos/modules/config/xdg/portals/termfilechooser.nix"; - nixvim = { - homeManagerModule = nixVim.homeManagerModules.nixvim; + homeManagerModule = modules.nixVim.homeManagerModules.nixvim; }; - agenix = agenix.nixosModules.default; - disko = disko.nixosModules.default; - serverphone = serverphone.nixosModules.default; - inherit (home-manager.nixosModules) home-manager; - inherit (impermanence.nixosModules) impermanence; - inherit (lanzaboote.nixosModules) lanzaboote; + agenix = modules.agenix.nixosModules.default; + disko = modules.disko.nixosModules.default; + serverphone = modules.serverphone.nixosModules.default; + inherit (modules.home-manager.nixosModules) home-manager; + inherit (modules.impermanence.nixosModules) impermanence; + inherit (modules.lanzaboote.nixosModules) lanzaboote; }; }; in { @@ -96,22 +71,15 @@ in { packages."${system}" = import ./packages { inherit - nixos-generators pkgs - pkgsStable - myPkgs - sysLib - system - nixVim self - shell_library ; - inherit (pkgs) lib; + myPkgs = packageSets.soispha; }; formatter."${system}" = treefmtEval.config.build.wrapper; - apps."${system}" = import ./apps {inherit self system;}; + baseLib."${system}" = libraries.base; devShells."${system}" = { default = pkgs.mkShell { @@ -122,9 +90,10 @@ in { # other pkgs.cocogitto pkgs.git-bug + pkgs.reuse # secrets - ragenix.packages."${system}".default + pkgs.ragenix pkgs.rage # shell @@ -136,11 +105,7 @@ in { # nix pkgs.alejandra - - # update - myPkgs.generate_moz_extension # needed for the firefox extension update script - myPkgs.lf-make-map # needed to generate the lf cd mappings - myPkgs.update-vim-plugins + pkgs.deadnix ]; }; }; diff --git a/flake/nixosConfigurations/common.nix b/flake/nixosConfigurations/common.nix deleted file mode 100644 index b8601c75..00000000 --- a/flake/nixosConfigurations/common.nix +++ /dev/null @@ -1,122 +0,0 @@ -# This file contains common configuration applied to every host. -# It should only `enable` options defined in the `modules/by-name` directory. -{ - config, - pkgs, - ... -}: { - soispha = { - boot.enable = true; - cleanup.enable = true; - documentation.enable = true; - - fonts = { - enable = true; - enableEmoji = true; - }; - - home-manager.enable = true; - impermanence = { - enable = true; - - directories = [ - "/etc/nixos" - "/var/log" - "/var/lib/systemd" - "/var/lib/nixos" - ]; - }; - polkit.enable = true; - power.enable = true; - - services = { - adb = { - enable = true; - user = "soispha"; - }; - fwupd.enable = true; - mpd = { - enable = true; - directories = let - data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd"; - in { - inherit data; - playlists = "${data}/playlists"; - runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd"; - music = config.home-manager.users.soispha.programs.beets.settings.directory; - }; - mpc = { - enable = true; - beetsPkg = config.home-manager.users.soispha.programs.beets.package; - }; - }; - ollama.enable = false; - postgresql.enable = false; - printing.enable = true; - scanning.enable = true; - snapper.enable = true; - steam.enable = false; - systemDiff.enable = true; - unison = { - enable = true; - - foreign.userName = "soispha"; - dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; - userSourceDir = "/srv/home/soispha"; - pathsToIgnore = let - extractTarget = attr: "~/${attr.target}"; - homeManagerSymlinks = - builtins.map extractTarget - (builtins.attrValues - config.home-manager.users.soispha.home.file); - in - [ - # already synchronized by the taskserver - "~/.local/share/task" - - # Should not be synchronized - "~/.local/share/unison" - - # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> ) - "~/media/music" - ] - ++ homeManagerSymlinks; - - pathsToSync = [ - "~/.local/state/mpv" - "~/.local/state/nvim" - "~/.local/share" - "~/.local/.Trash-1000" - - "~/.mozilla/.Trash-1000" - "~/.mozilla/firefox" - - "~/media" - "~/school" - "~/repos" - ]; - }; - }; - - programs = { - nvim = { - enable = true; - shell = pkgs.zsh; - }; - atuin.enable = true; - git.enable = true; - imv.enable = true; - less.enable = true; - lf.enable = true; - river.enable = true; - taskwarrior.enable = true; - yambar.enable = true; - yt.enable = true; - zathura.enable = true; - zsh.enable = true; - }; - - sound.enable = true; - version.enable = true; - }; -} diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix deleted file mode 100644 index b0a02580..00000000 --- a/flake/nixosConfigurations/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - self, - system, - pkgsStable, - myPkgs, - nixpkgs_as_input, - nixpkgs_open_prs, - # my things - shell_library, - sysLib, - nixLib, - templates, - # modules - home-manager, - nixVim, - nixos-generators, - impermanence, - agenix, - ragenix, - serverphone, - disko, - lanzaboote, - nix-index-database, - # bins - river_init_lesser, - qmk_firmware, - # external - user_js, -}: let - modules = [ - "${nixpkgs_open_prs.nixpkgs-tfc}/nixos/modules/config/xdg/portals/termfilechooser.nix" - - agenix.nixosModules.default - disko.nixosModules.default - home-manager.nixosModules.home-manager - impermanence.nixosModules.impermanence - lanzaboote.nixosModules.lanzaboote - serverphone.nixosModules.default - - ../../modules - ./common.nix - ]; - - specialArgs = { - inherit - # extra package sources - nixpkgs_open_prs - pkgsStable - myPkgs - shell_library - sysLib - nixLib - # extra information - system - # modules - impermanence - nix-index-database - nixVim - # nix registry - nixpkgs_as_input - self - templates - # bins - # TODO: Integrate these into `pkgs/by-name` <2024-05-22> - river_init_lesser - qmk_firmware - serverphone - # external deps - user_js - ; - }; - - generateHost = name: { - name = "${name}"; - value = nixpkgs_as_input.lib.nixosSystem { - inherit specialArgs; - modules = - [ - ../../hosts/${name} - ] - ++ modules; - }; - }; - - # FIXME: These need to stay in this position for the install script - hosts = ["tiamat" "apzu"]; - inactiveHosts = ["mammun" "lahmu"]; - - generatedHosts = builtins.listToAttrs (builtins.map generateHost hosts); -in - generatedHosts diff --git a/flake/packages/default.nix b/flake/packages/default.nix index a8fc2d64..9c67eda3 100644 --- a/flake/packages/default.nix +++ b/flake/packages/default.nix @@ -1,17 +1,19 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - self, - nixos-generators, pkgs, + self, myPkgs, - pkgsStable, - sysLib, - nixVim, - system, - shell_library, ... }: let inherit (pkgs) lib; - output = import ../../bootstrap {inherit pkgs sysLib;}; run_test_description = pkgs.callPackage ../../tests/infrastructure/run.nix {}; @@ -23,7 +25,10 @@ # NOTE: This is copied from `nixvim`, and could be achieved by setting # `config.wrapRc` to `true`. But I have yet to find a way to set this in this # context, but not in the general context. <2024-11-09> - wrapped = config.build.package.override (prev: { + # NOTE: I'm not sure why we need `nvimPackage` instead of just the `package` + # attribute here, but the bare `package` attribute does not provide a `override` + # function. <2025-02-02> + wrapped = config.build.nvimPackage.override (prev: { wrapperArgs = ( if lib.isString prev.wrapperArgs @@ -64,8 +69,6 @@ value) myPkgs ))); - - firefox = (import ../../modules/home.legacy/conf/firefox/scripts) {inherit pkgs sysLib;}; in { # install-iso = nixos-generators.nixosGenerate { @@ -77,8 +80,6 @@ in # format = "install-iso"; # }; - update_shell_lib = shell_library.packages."${system}".update_shell_library; - # gpg-iso = nixos-generators.nixosGenerate { # system = "x86_64-linux"; # specialArgs = defaultSpecialArgs; @@ -92,7 +93,5 @@ in nvim = nvim.tiamat; inherit run_test_description; } - // output // output_neovim - // firefox // myPkgsFlat diff --git a/flake/treefmt.nix b/flake/treefmt.nix index e2c6aeae..703a85e8 100644 --- a/flake/treefmt.nix +++ b/flake/treefmt.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { treefmt-nix, pkgs, diff --git a/hosts/_unmaintained/isimud/command-line.html b/hosts/_unmaintained/isimud/command-line.html deleted file mode 100644 index 4534001e..00000000 --- a/hosts/_unmaintained/isimud/command-line.html +++ /dev/null @@ -1,1491 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta name="viewport" content="width=device-width, initial-scale=1"> -<meta name="description" content="The OnlyKey Command-Line Utility is a command line interface to OnlyKey."> -<meta name="keywords" content="OnlyKeyCommand linePython, OnlyKey, Command line"> -<title>OnlyKey Command-Line Utility | Docs</title> -<link rel="stylesheet" href="css/syntax.css"> - -<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> -<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">--> -<link rel="stylesheet" href="css/modern-business.css"> -<!-- Latest compiled and minified CSS --> -<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -<link rel="stylesheet" href="css/customstyles.css"> -<link rel="stylesheet" href="css/boxshadowproperties.css"> -<!-- most color styles are extracted out to here --> -<link rel="stylesheet" href="css/theme-blue.css"> - -<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> - -<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> -<script src="js/jquery.navgoco.min.js"></script> - - -<!-- Latest compiled and minified JavaScript --> -<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> -<!-- Anchor.js --> -<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.0/anchor.min.js"></script> -<script src="js/toc.js"></script> -<script src="js/customscripts.js"></script> - -<link rel="shortcut icon" href="images/favicon.ico"> - -<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> -<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> -<!--[if lt IE 9]> -<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> -<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> -<![endif]--> - -<link rel="alternate" type="application/rss+xml" title="trustcrypto.github.io" href="https://docs.onlykey.io/feed.xml"> - - <script> - $(document).ready(function() { - // Initialize navgoco with default options - $("#mysidebar").navgoco({ - caretHtml: '', - accordion: true, - openClass: 'active', // open - save: false, // leave false or nav highlighting doesn't work right - cookie: { - name: 'navgoco', - expires: false, - path: '/' - }, - slide: { - duration: 400, - easing: 'swing' - } - }); - - $("#collapseAll").click(function(e) { - e.preventDefault(); - $("#mysidebar").navgoco('toggle', false); - }); - - $("#expandAll").click(function(e) { - e.preventDefault(); - $("#mysidebar").navgoco('toggle', true); - }); - - }); - - </script> - <script> - $(function () { - $('[data-toggle="tooltip"]').tooltip() - }) - </script> - <script> - $(document).ready(function() { - $("#tg-sb-link").click(function() { - $("#tg-sb-sidebar").toggle(); - $("#tg-sb-content").toggleClass('col-md-9'); - $("#tg-sb-content").toggleClass('col-md-12'); - $("#tg-sb-icon").toggleClass('fa-toggle-on'); - $("#tg-sb-icon").toggleClass('fa-toggle-off'); - }); - }); - </script> - - -</head> -<body> -<!-- Navigation --> -<nav class="navbar navbar-inverse navbar-static-top"> - <div class="container topnavlinks"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> Docs</span></a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - <!-- toggle sidebar button --> - <li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li> - <!-- entries without drop-downs appear here --> - - - - - - - - <li><a href="https://onlykey.io" target="_blank" rel="noopener">Purchase OnlyKey</a></li> - - - - <li><a href="https://docs.crp.to/index.html" target="_blank" rel="noopener">Get Started</a></li> - - - - <!-- entries with drop-downs appear here --> - <!-- conditional logic to control which topnav appears for the audience defined in the configuration file.--> - - - <!--comment out this block if you want to hide search--> - <li> - <!--start search--> - <div id="search-demo-container"> - <input type="text" id="search-input" placeholder="search..."> - <ul id="results-container"></ul> - </div> - <script src="js/jekyll-search.js" type="text/javascript"></script> - <script type="text/javascript"> - SimpleJekyllSearch.init({ - searchInput: document.getElementById('search-input'), - resultsContainer: document.getElementById('results-container'), - dataSource: 'search.json', - searchResultTemplate: '<li><a href="{url}" title="OnlyKey Command-Line Utility">{title}</a></li>', - noResultsText: 'No results found.', - limit: 10, - fuzzy: true, - }) - </script> - <!--end search--> - </li> - </ul> - </div> - </div> - <!-- /.container --> -</nav> - -<!-- Page Content --> -<div class="container"> - <div id="main"> - <!-- Content Row --> - <div class="row"> - - - <!-- Sidebar Column --> - <div class="col-md-3" id="tg-sb-sidebar"> - - -<ul id="mysidebar" class="nav"> - <li class="sidebarTitle">OnlyKey Documentation </li> - - - - <li> - <a title="General Information" href="#">General Information</a> - <ul> - - - - <li><a title="Get Started" href="index.html">Get Started</a></li> - - - - - - - <li><a title="FAQs" href="faq.html">FAQs</a></li> - - - - - - - <li><a title="About Security" href="security.html">About Security</a></li> - - - - - </ul> - </li> - - - - <li> - <a title="OnlyKey User's Guide" href="#">OnlyKey User's Guide</a> - <ul> - - - - <li><a title="Unpacking OnlyKey" href="usersguide.html#unpacking">Unpacking OnlyKey</a></li> - - - - - - - <li><a title="Setting up OnlyKey" href="usersguide.html#initial-setup">Setting up OnlyKey</a></li> - - - - - - - <li><a title="Reset OnlyKey (Factory Default)" href="usersguide.html#reset-default">Reset OnlyKey (Factory Default)</a></li> - - - - - - - <li><a title="Configure Basic Login Info" href="usersguide.html#all-about-slots">Configure Basic Login Info</a></li> - - - - - - - <li><a title="OnlyKey On-The-Go" href="usersguide.html#otg">OnlyKey On-The-Go</a></li> - - - - - - - <li><a title="Configure Two Factor Authentication (2FA)" href="usersguide.html#two-factor-authentication-2fa">Configure Two Factor Authentication (2FA)</a></li> - - - - - - - <li><a title="Google Authenticator (TOTP)" href="usersguide.html#google-authenticator-totp">Google Authenticator (TOTP)</a></li> - - - - - - - <li><a title="Yubico® One-Time Password" href="usersguide.html#Yubico-one-time-password">Yubico® One-Time Password</a></li> - - - - - - - <li><a title="Security Key (FIDO2 / U2F)" href="usersguide.html#universal-2nd-factor-u2f">Security Key (FIDO2 / U2F)</a></li> - - - - - - - <li><a title="Using With A Software Password Manager" href="usersguide.html#using-onlykey-with-a-software-password-manager">Using With A Software Password Manager</a></li> - - - - - - - <li><a title="OpenPGP Encryption (Files / Messages)" href="usersguide.html#openpgp">OpenPGP Encryption (Files / Messages)</a></li> - - - - - - - <li><a title="Preferences" href="usersguide.html#preferences">Preferences</a></li> - - - - - - - <li><a title="About Encryption Keys" href="usersguide.html#encryption-keys">About Encryption Keys</a></li> - - - - - - - <li><a title="Generating Keys" href="importpgp.html#generating-keys">Generating Keys</a></li> - - - - - - - <li><a title="Loading Keys" href="importpgp.html#loading-keys">Loading Keys</a></li> - - - - - - - <li><a title="Secure Encrypted Backup Anywhere" href="usersguide.html#secure-encrypted-backup-anywhere">Secure Encrypted Backup Anywhere</a></li> - - - - - - - <li><a title="Restore From Backup" href="usersguide.html#restore-from-backup">Restore From Backup</a></li> - - - - - - - <li><a title="Loading OnlyKey Firmware" href="usersguide.html#loading-onlykey-firmware">Loading OnlyKey Firmware</a></li> - - - - - - - <li><a title="Troubleshooting" href="usersguide.html#troubleshooting">Troubleshooting</a></li> - - - - - - - <li><a title="Change your PIN" href="usersguide.html#pin-change">Change your PIN</a></li> - - - - - - - <li><a title="Additional Information" href="usersguide.html#web-links">Additional Information</a></li> - - - - - </ul> - </li> - - - - <li> - <a title="OnlyKey DUO User's Guide" href="#">OnlyKey DUO User's Guide</a> - <ul> - - - - <li><a title="Unpacking OnlyKey DUO" href="duousersguide.html#unpacking">Unpacking OnlyKey DUO</a></li> - - - - - - - <li><a title="Setting up OnlyKey DUO" href="duousersguide.html#initial-setup">Setting up OnlyKey DUO</a></li> - - - - - - - <li><a title="Reset OnlyKey (Factory Default)" href="duousersguide.html#reset-default">Reset OnlyKey (Factory Default)</a></li> - - - - - - - <li><a title="Configure Basic Login Info" href="duousersguide.html#all-about-slots">Configure Basic Login Info</a></li> - - - - - - - <li><a title="On-The-Go" href="duousersguide.html#otg">On-The-Go</a></li> - - - - - - - <li><a title="Configure Two Factor Authentication (2FA)" href="duousersguide.html#two-factor-authentication-2fa">Configure Two Factor Authentication (2FA)</a></li> - - - - - - - <li><a title="Google Authenticator (TOTP)" href="duousersguide.html#google-authenticator-totp">Google Authenticator (TOTP)</a></li> - - - - - - - <li><a title="Yubico® One-Time Password" href="duousersguide.html#Yubico-one-time-password">Yubico® One-Time Password</a></li> - - - - - - - <li><a title="Security Key (FIDO2 / U2F)" href="duousersguide.html#universal-2nd-factor-u2f">Security Key (FIDO2 / U2F)</a></li> - - - - - - - <li><a title="Using With A Software Password Manager" href="duousersguide.html#using-onlykey-with-a-software-password-manager">Using With A Software Password Manager</a></li> - - - - - - - <li><a title="OpenPGP Encryption (Files / Messages)" href="duousersguide.html#openpgp">OpenPGP Encryption (Files / Messages)</a></li> - - - - - - - <li><a title="Preferences" href="duousersguide.html#preferences">Preferences</a></li> - - - - - - - <li><a title="About Encryption Keys" href="duousersguide.html#encryption-keys">About Encryption Keys</a></li> - - - - - - - <li><a title="Generating Keys" href="importpgp.html#generating-keys">Generating Keys</a></li> - - - - - - - <li><a title="Loading Keys" href="importpgp.html#loading-keys">Loading Keys</a></li> - - - - - - - <li><a title="Secure Encrypted Backup Anywhere" href="duousersguide.html#secure-encrypted-backup-anywhere">Secure Encrypted Backup Anywhere</a></li> - - - - - - - <li><a title="Restore From Backup" href="duousersguide.html#restore-from-backup">Restore From Backup</a></li> - - - - - - - <li><a title="Loading OnlyKey Firmware" href="duousersguide.html#loading-onlykey-firmware">Loading OnlyKey Firmware</a></li> - - - - - - - <li><a title="Troubleshooting" href="duousersguide.html#troubleshooting">Troubleshooting</a></li> - - - - - - - <li><a title="Change your PIN" href="duousersguide.html#pin-change">Change your PIN</a></li> - - - - - - - <li><a title="Additional Information" href="duousersguide.html#web-links">Additional Information</a></li> - - - - - </ul> - </li> - - - - <li> - <a title="Features" href="#">Features</a> - <ul> - - - - <li><a title="Universal Support" href="features.html#universal-support">Universal Support</a></li> - - - - - - - <li><a title="Portable. Durable. Waterproof" href="features.html#portable-durable-waterproof">Portable. Durable. Waterproof</a></li> - - - - - - - <li><a title="Pin Protected" href="features.html#pin-protected">Pin Protected</a></li> - - - - - - - <li><a title="Hardware Password Manager" href="features.html#hardware-password-manager">Hardware Password Manager</a></li> - - - - - - - <li><a title="Universal Two-Factor Authentication" href="features.html#universal-2-factor-token">Universal Two-Factor Authentication</a></li> - - - - - - - <li><a title="SSH Authentication" href="features.html#ssh-authentication">SSH Authentication</a></li> - - - - - - - <li><a title="OpenPGP Everywhere" href="features.html#openpgp-support">OpenPGP Everywhere</a></li> - - - - - - - <li><a title="Self-Destruct" href="features.html#self-destruct-feature">Self-Destruct</a></li> - - - - - - - <li><a title="Encrypted Backup Anywhere" href="features.html#encrypted-backup-anywhere">Encrypted Backup Anywhere</a></li> - - - - - - - <li><a title="Automatic Lock" href="features.html#automatic-lock-feature">Automatic Lock</a></li> - - - - - - - <li><a title="International Keyboard Layouts" href="features.html#international-keyboard-layouts">International Keyboard Layouts</a></li> - - - - - - - <li><a title="Sysadmin Mode" href="features.html#sysadmin-mode">Sysadmin Mode</a></li> - - - - - - - <li><a title="LED Definitions" href="features.html#led-definitions-onlykey-color">LED Definitions</a></li> - - - - - - - <li><a title="Button Definitions" href="features.html#button-definitions">Button Definitions</a></li> - - - - - - - <li><a title="OnlyKey / OnlyKey DUO Differences" href="features.html##onlykey-and-onlykey-duo-differences">OnlyKey / OnlyKey DUO Differences</a></li> - - - - - - - <li><a title="Config Mode" href="security.html#config-mode">Config Mode</a></li> - - - - - - - <li><a title="Plausible Deniability" href="features.html#plausible-deniability-feature">Plausible Deniability</a></li> - - - - - </ul> - </li> - - - - <li> - <a title="Apps and Software" href="#">Apps and Software</a> - <ul> - - - - <li><a title="Desktop App" href="app.html">Desktop App</a></li> - - - - - - - <li><a title="WebCrypt (OpenPGP Webapp)" href="webcrypt.html">WebCrypt (OpenPGP Webapp)</a></li> - - - - - - - <li><a title="SSH/GPG Agent (onlykey-agent)" href="onlykey-agent.html">SSH/GPG Agent (onlykey-agent)</a></li> - - - - - - - <li class="active"><a title="Command-Line Utility (onlykey-cli)" href="command-line.html">Command-Line Utility (onlykey-cli)</a></li> - - - - - - - <li><a title="Firmware" href="firmware.html">Firmware</a></li> - - - - - </ul> - </li> - - - - <li> - <a title="Knowledge Base" href="#">Knowledge Base</a> - <ul> - - - - <li><a title="Works with OnlyKey" href="workswithonlykey.html">Works with OnlyKey</a></li> - - - - - - - <li><a title="Upgrade Guide" href="upgradeguide.html">Upgrade Guide</a></li> - - - - - - - <li><a title="Legacy Firmware Upgrade Guide" href="legacyupgradeguide.html">Legacy Firmware Upgrade Guide</a></li> - - - - - - - <li><a title="International Travel Edition Guide" href="ite.html">International Travel Edition Guide</a></li> - - - - - - - <li><a title="Plausible Deniability Setup Guide" href="pdguide.html">Plausible Deniability Setup Guide</a></li> - - - - - - - <li><a title="Windows Active Directory Guide" href="activedirectory.html">Windows Active Directory Guide</a></li> - - - - - - - <li><a title="Linux - Using OnlyKey with Linux" href="linux.html">Linux - Using OnlyKey with Linux</a></li> - - - - - - - <li><a title="Mobile - Using OnlyKey with iOS and Android" href="mobile.html">Mobile - Using OnlyKey with iOS and Android</a></li> - - - - - - - <li><a title="OpenPGP Keys - Import keys from Protonmail, Keybase, and Mailvelope" href="importpgp.html">OpenPGP Keys - Import keys from Protonmail, Keybase, and Mailvelope</a></li> - - - - - - - <li><a title="Virtual Machines with OnlyKey" href="virtualmachines.html">Virtual Machines with OnlyKey</a></li> - - - - - - - <li><a title="Qubes OS with OnlyKey" href="qubes.html">Qubes OS with OnlyKey</a></li> - - - - - - - <li><a title="Full-Disk Encryption with OnlyKey" href="full-disk-encryption.html">Full-Disk Encryption with OnlyKey</a></li> - - - - - - - <li><a title="OpenSSH With OnlyKey" href="openssh.html">OpenSSH With OnlyKey</a></li> - - - - - </ul> - </li> - - - - <!-- if you aren't using the accordion, uncomment this block: - <p class="external"> - <a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a> - </p> - --> -</ul> - -<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.--> -<script>$("li.active").parents('li').toggleClass("active");</script> - - </div> - - - - <!-- Content Column --> - <div class="col-md-9" id="tg-sb-content"> - <div class="post-header"> - <h1 class="post-title-main">OnlyKey Command-Line Utility</h1> -</div> - - - -<div class="post-content"> - - - <div class="summary">The OnlyKey Command-Line Utility is a command line interface to OnlyKey.</div> - - - - -<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. --> -<script> -$( document ).ready(function() { - // Handler for .ready() called. - -$('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3,h4' }); - -/* this offset helps account for the space taken up by the floating toolbar. */ -$('#toc').on('click', 'a', function() { - var target = $(this.getAttribute('href')) - , scroll_target = target.offset().top - - $(window).scrollTop(scroll_target - 10); - return false -}) - -}); -</script> - -<div id="toc"></div> - - - - - <h1 id="onlykey-cli">onlykey-cli</h1> - -<p>OnlyKey-cli - A command line interface to the OnlyKey (Similar functionality to <a href="https://docs.crp.to/app.html">OnlyKey App</a>) that can be used for configuration, scripting, and testing.</p> - -<h2 id="installation">Installation</h2> - -<h3 id="windows-stand-alone-exe">Windows Stand-Alone EXE</h3> -<p>No install is required. Download and run the EXE to open OnlyKey CLI interactive mode or run directly from command line like this:</p> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>C:\ onlykey-cli.exe getlabels -</code></pre></div></div> - -<p><a href="https://github.com/trustcrypto/python-onlykey/releases/download/v1.2.9/onlykey-cli.exe">Download here</a></p> - -<h3 id="windows-install-with-dependencies">Windows Install with dependencies</h3> -<p>1) Python 3.8 and pip3 are required. To setup a Python environment on Windows we recommend Anaconda <a href="https://www.anaconda.com/download/#windows">https://www.anaconda.com/download/#windows</a></p> - -<p>2) From an administrator command prompt run:</p> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pip3 install hidapi==0.9.0 onlykey -</code></pre></div></div> - -<p>You should see a message showing where the executable is installed. This is usually c:\python39\scripts\onlykey-cli.exe</p> - -<h3 id="macos-install-with-dependencies">MacOS Install with dependencies</h3> -<p>Python 3.8 and pip3 are required. To setup a Python environment on MacOS we recommend Anaconda <a href="https://www.anaconda.com/download/#macos">https://www.anaconda.com/download/#macos</a></p> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ brew install libusb -$ pip3 install onlykey -</code></pre></div></div> - -<h3 id="linuxbsd-install-with-dependencies">Linux/BSD Install with dependencies</h3> - -<p>In order for non-root users in Linux to be able to communicate with OnlyKey a udev rule must be created as described <a href="https://docs.crp.to/linux">here</a>.</p> - -<h4 id="ubuntu-install-with-dependencies">Ubuntu Install with dependencies</h4> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt update && sudo apt upgrade -$ sudo apt install python3-pip python3-tk libusb-1.0-0-dev libudev-dev -$ pip3 install onlykey -$ wget https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules -$ sudo cp 49-onlykey.rules /etc/udev/rules.d/ -$ sudo udevadm control --reload-rules && udevadm trigger -</code></pre></div></div> - -<h4 id="debian-install-with-dependencies">Debian Install with dependencies</h4> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt update && sudo apt upgrade -$ sudo apt install python3-pip python3-tk libusb-1.0-0-dev libudev-dev -$ pip3 install onlykey -$ wget https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules -$ sudo cp 49-onlykey.rules /etc/udev/rules.d/ -$ sudo udevadm control --reload-rules && udevadm trigger -</code></pre></div></div> - -<h4 id="redhat-install-with-dependencies">RedHat Install with dependencies</h4> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ yum update -$ yum install python3-pip python3-devel python3-tk libusb-devel libudev-devel \ - gcc redhat-rpm-config -$ pip3 install onlykey -$ wget https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules -$ sudo cp 49-onlykey.rules /etc/udev/rules.d/ -$ sudo udevadm control --reload-rules && udevadm trigger -</code></pre></div></div> - -<h4 id="fedora-install-with-dependencies">Fedora Install with dependencies</h4> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ dnf install python3-pip python3-devel python3-tkinter libusb-devel libudev-devel \ - gcc redhat-rpm-config -$ pip3 install onlykey -$ wget https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules -$ sudo cp 49-onlykey.rules /etc/udev/rules.d/ -$ sudo udevadm control --reload-rules && udevadm trigger -</code></pre></div></div> - -<h4 id="opensuse-install-with-dependencies">OpenSUSE Install with dependencies</h4> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ zypper install python3-pip python3-devel python3-tk libusb-1_0-devel libudev-devel -$ pip3 install onlykey -$ wget https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules -$ sudo cp 49-onlykey.rules /etc/udev/rules.d/ -$ sudo udevadm control --reload-rules && udevadm trigger -</code></pre></div></div> - -<h4 id="arch-linux-install-with-dependencies">Arch Linux Install with dependencies</h4> -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo pacman -Sy git python3-setuptools python3 libusb python3-pip -$ pip3 install onlykey -$ wget https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules -$ sudo cp 49-onlykey.rules /etc/udev/rules.d/ -$ sudo udevadm control --reload-rules && udevadm trigger -</code></pre></div></div> - -<h4 id="freebsd-install-with-dependencies">FreeBSD Install with dependencies</h4> - -<p>See forum thread <a href="https://groups.google.com/d/msg/onlykey/CEYwdXjB508/MCe14p0gAwAJ">here</a></p> - -<h2 id="quickstart">QuickStart</h2> - -<p>Usage: onlykey-cli [OPTIONS]</p> - -<h3 id="setup-options">Setup Options</h3> - -<h4 id="init">init</h4> -<p>A command line tool for setting PIN on OnlyKey (Initial Configuration)</p> - -<h3 id="general-options">General Options</h3> - -<h4 id="version">version</h4> -<p>Displays the version of the app</p> - -<h4 id="fwversion">fwversion</h4> -<p>Displays the version of the OnlyKey firmware</p> - -<h4 id="wink">wink</h4> -<p>OnlyKey flashes blue (winks), may be used for visual confirmation of connectivity</p> - -<h4 id="getlabels">getlabels</h4> -<p>Returns slot labels</p> - -<h4 id="settime">settime</h4> -<p>A command for setting time on OnlyKey, time is needed for TOTP (Google Authenticator)</p> - -<h4 id="getkeylabels">getkeylabels</h4> -<p>Returns key labels for RSA keys 1-4 and ECC keys 1-16</p> - -<h4 id="rng-type">rng [type]</h4> -<p>Access OnlyKey TRNG to generate random numbers:</p> -<ul> - <li>[type] must be one of the following: - <ul> - <li>hexbytes - Output hex encoded random bytes. Default 8 bytes; Maximum 255 bytes. Specify number of bytes to return with –count <number of="" bytes=""> i.e. 'onlykey-cli rng hexbytes --count 32'</number></li> - <li>feedkernel - Feed random bytes to /dev/random.</li> - </ul> - </li> -</ul> - -<h3 id="onlykey-preferences-options">OnlyKey Preferences Options</h3> - -<h4 id="idletimeout-num">idletimeout [num]</h4> -<p>OnlyKey locks after ideletimeout is reached (1 – 255 minutes; default = 30; 0 to disable). <a href="https://docs.crp.to/usersguide.html#configurable-inactivity-lockout-period">More info</a></p> - -<h4 id="wipemode-num">wipemode [num]</h4> -<p>Configure how the OnlyKey responds to -a factory reset. WARNING - Setting to Full Wipe mode cannot be changed. -1 = Sensitive Data Only (default); 2 = Full Wipe (recommended for plausible deniability users) Entire device is wiped. Firmware must be reloaded. <a href="https://docs.crp.to/usersguide.html#configurable-wipe-mode">More info</a></p> - -<h4 id="keylayout-num">keylayout [num]</h4> -<p>Set keyboard layout</p> -<ul> - <li>1 - USA_ENGLISH (Default)</li> - <li>2 - CANADIAN_FRENCH</li> - <li>3 - CANADIAN_MULTILINGUAL</li> - <li>4 - DANISH</li> - <li>5 - FINNISH</li> - <li>6 - FRENCH</li> - <li>7 - FRENCH_BELGIAN</li> - <li>8 - FRENCH_SWISS</li> - <li>9 - GERMAN</li> - <li>10 - GERMAN_MAC</li> - <li>11 - GERMAN_SWISS</li> - <li>12 - ICELANDIC</li> - <li>13 - IRISH</li> - <li>14 - ITALIAN</li> - <li>15 - NORWEGIAN</li> - <li>16 - PORTUGUESE</li> - <li>17 - PORTUGUESE_BRAZILIAN</li> - <li>18 - SPANISH</li> - <li>19 - SPANISH_LATIN_AMERICA</li> - <li>20 - SWEDISH</li> - <li>21 - TURKISH</li> - <li>22 - UNITED_KINGDOM</li> - <li>23 - US_INTERNATIONAL</li> - <li>24 - CZECH</li> - <li>25 - SERBIAN_LATIN_ONLY</li> - <li>26 - HUNGARIAN</li> - <li>27 - DANISH MAC</li> - <li>28 - US_DVORAK</li> -</ul> - -<p><a href="https://docs.crp.to/usersguide.html#configurable-keyboard-layouts">More info</a></p> - -<h4 id="keytypespeed-num">keytypespeed [num]</h4> -<p>1 = slowest; 10 = fastest [7 = default] -<a href="https://docs.crp.to/usersguide.html#configurable-keyboard-type-speed">More info</a></p> - -<h4 id="ledbrightness-num">ledbrightness [num]</h4> -<p>1 = dimmest; 10 = brightest [8 = default] -<a href="https://docs.crp.to/usersguide.html#configurable-led-brightness">More info</a></p> - -<h4 id="touchsense-num">touchsense [num]</h4> -<p>Change the OnlyKey’s button touch sensitivity. -WARNING: Setting button’s touch sensitivity lower than 5 is not recommended as this could result in inadvertent button press. -2 = highest sensitivity; 100 = lowest sensitivity [12 = default]</p> - -<h4 id="2ndprofilemode-num">2ndprofilemode [num]</h4> -<p>Set during init (Initial Configuration) to set 2nd profile type 1 = standard (default); 2 = plausible deniability</p> - -<h4 id="storedkeymode-num">storedkeymode [num]</h4> -<p>Enable or disable challenge for stored keys (SSH/PGP) -0 = Challenge Code Required (default); 1 = Button Press Required -<a href="https://docs.crp.to/usersguide.html#stored-challenge-mode">More info</a></p> - -<h4 id="derivedkeymode-num">derivedkeymode [num]</h4> -<p>Enable or disable challenge for stored keys (SSH/PGP) -0 = Challenge Code Required (default); 1 = Button Press Required -<a href="https://docs.crp.to/usersguide.html#derived-challenge-mode">More info</a></p> - -<h4 id="hmackeymode-num">hmackeymode [num]</h4> -<p>Enable or disable button press for HMAC challenge-response -0 = Button Press Required (default); 1 = Button Press Not Required. -<a href="https://docs.crp.to/usersguide.html#hmac-mode">More info</a></p> - -<h4 id="backupkeymode-num">backupkeymode [num]</h4> -<p>1 = Lock backup key so this may not be changed on device -WARNING - Once set to “Locked” this cannot be changed unless a factory reset occurs. -<a href="https://docs.crp.to/usersguide.html#backup-key-mode">More info</a></p> - -<h4 id="sysadminmode">sysadminmode</h4> -<p>Enable or disable challenge for stored keys (SSH/PGP) -0 = Challenge Code Required (default); 1 = Button Press Required -<a href="https://docs.crp.to/usersguide.html#derived-challenge-mode">More info</a></p> - -<h4 id="lockbutton">lockbutton</h4> -<p>Enable or disable challenge for stored keys (SSH/PGP) -0 = Challenge Code Required (default); 1 = Button Press Required -<a href="https://docs.crp.to/usersguide.html#derived-challenge-mode">More info</a></p> - -<h3 id="slot-config-options">Slot Config Options</h3> - -<h4 id="setslot-id-type-value">setslot [id] [type] [value]</h4> -<ul> - <li>[id] must be slot number 1a - 6b for OnlyKey or 1-24 for OnlyKey DUO</li> - <li>[type] must be one of the following: - <ul> - <li>label - set slots (1a - 6b) to have a descriptive label i.e. My Google Acct</li> - <li>url - URL to login page</li> - <li>delay1 - set a 0 - 9 second delay</li> - <li>addchar1 - Additional character before username 1 for TAB, 0 to clear</li> - <li>username - Username to login</li> - <li>addchar2 - Additional character after username 1 for TAB, 2 for RETURN</li> - <li>delay2 - set a 0 - 9 second delay</li> - <li>password - Password to login</li> - <li>addchar3 - Additional character after password 1 for TAB, 2 for RETURN</li> - <li>delay3 - set a 0 - 9 second delay</li> - <li>addchar4 - Additional character before OTP 1 for TAB</li> - <li>2fa - type of two factor authentication - <ul> - <li>g - Google Authenticator</li> - <li>y - Yubico OTP</li> - <li>u - U2F</li> - </ul> - </li> - <li>totpkey - Google Authenticator key</li> - <li>addchar5 - Additional character after OTP 2 for RETURN</li> - </ul> - </li> -</ul> - -<h4 id="wipeslot-id">wipeslot [id]</h4> -<ul> - <li>[id] must be slot number 1a - 6b for OnlyKey or 1-24 for OnlyKey DUO</li> -</ul> - -<h3 id="key-config-options">Key Config Options</h3> - -<h4 id="setkey-key-slot-type-features-hex-key">setkey [key slot] [type] [features] [hex key]</h4> -<p>Sets raw private keys and key labels, to set PEM format keys use the OnlyKey App</p> -<ul> - <li>[key slot] must be key number RSA1 - RSA4, ECC1 - ECC16, HMAC1 - HMAC2</li> - <li>[type] must be one of the following: - <ul> - <li>label - set to have a descriptive key label i.e. My GPG signing key</li> - <li>x - X25519 Key Type (32 bytes)</li> - <li>n - NIST256P1 Key Type (32 bytes)</li> - <li>s - SECP256K1 Key Type (32 bytes)</li> - <li>2 - RSA Key Type 2048bits (256 bytes)</li> - <li>4 - RSA Key Type 4096bits (512 bytes)</li> - <li>h - HMAC Key Type (20 bytes)</li> - </ul> - </li> - <li>[features] must be one of the following: - <ul> - <li>s - Use for signing</li> - <li>d - Use for decryption</li> - <li>b - Use for encryption/decryption of backups</li> - </ul> - </li> - <li>For setting keys see examples <a href="https://docs.crp.to/command-line.html#writing-private-keys-and-passwords">here</a>.</li> -</ul> - -<h4 id="genkey-key-slot-type-features">genkey [key slot] [type] [features]</h4> -<p>Generates random private key on device</p> -<ul> - <li>[key slot] must be key number ECC1 - ECC16 (only ECC keys supported)</li> - <li>[type] must be one of the following: - <ul> - <li>x - X25519 Key Type (32 bytes)</li> - <li>n - NIST256P1 Key Type (32 bytes)</li> - <li>s - SECP256K1 Key Type (32 bytes)</li> - </ul> - </li> - <li>[features] must be one of the following: - <ul> - <li>s - Use for signing</li> - <li>d - Use for decryption</li> - <li>b - Use for encryption/decryption of backups</li> - </ul> - </li> - <li>For generating key see example <a href="https://docs.crp.to/command-line.html#writing-private-keys-and-passwords">here</a>.</li> -</ul> - -<h4 id="wipekey-key-id">wipekey [key id]</h4> -<p>Erases key stored at [key id]</p> -<ul> - <li>[key id] must be key number RSA1 - RSA4, ECC1 - ECC16, HMAC1 - HMAC2</li> -</ul> - -<h3 id="fido2-config-options">FIDO2 Config Options</h3> - -<h4 id="ping">ping</h4> -<p>Sends a FIDO2 transaction to the device, which immediately echoes the same data back. This command is defined to be a uniform function for debugging, latency and performance measurements (CTAPHID_PING).</p> - -<h4 id="set-pin">set-pin</h4> -<p>Set new FIDO PIN, this is the PIN entered via keyboard and used for FIDO2 register/login (not the OnlyKey PIN entered on device).</p> - -<h4 id="change-pin">change-pin</h4> -<p>Change FIDO PIN, this is the PIN entered via keyboard and used for FIDO2 register/login (not the OnlyKey PIN entered on device, to change that PIN use the OnlyKey Desktop App).</p> - -<h4 id="credential-operation-credential-id">credential [operation] [credential ID]</h4> -<ul> - <li>[operation] must be one of the following: - <ul> - <li>info - Display number of existing resident keys and remaining space.</li> - <li>ls - List resident keys.</li> - <li>rm [credential ID] - Remove resident keys, <a href="https://docs.crp.to/command-line.html#list-and-remove-fido2-resident-key">example here</a>.</li> - </ul> - </li> -</ul> - -<h4 id="reset">reset</h4> -<p>Reset wipes all FIDO U2F and FIDO2 credentials!!! It is highly recommended to backup device prior to reset.</p> - -<h3 id="running-command-options">Running Command Options</h3> - -<p>You can run commands in two ways:</p> - -<h4 id="1-directly-in-terminal">1) Directly in terminal</h4> - -<p>Like this:</p> - -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ onlykey-cli getlabels - -Slot 1a: -Slot 1b: - -Slot 2a: -Slot 2b: - -Slot 3a: -Slot 3b: - -Slot 4a: -Slot 4b: - -Slot 5a: -Slot 5b: - -Slot 6a: -Slot 6b: - -$ onlykey-cli setslot 1a label ok -Successfully set Label -$ onlykey-cli getlabels - -Slot 1a: ok -Slot 1b: - -Slot 2a: -Slot 2b: - -Slot 3a: -Slot 3b: - -Slot 4a: -Slot 4b: - -Slot 5a: -Slot 5b: - -Slot 6a: -Slot 6b: - -</code></pre></div></div> - -<h4 id="2-interactive-mode">2) Interactive Mode</h4> - -<p>Or you can run commands in an interactive shell like this:</p> - -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ onlykey-cli -OnlyKey CLI v1.2.8 -Press the right arrow to insert the suggestion. -Press Control-C to retry. Control-D to exit. - -OnlyKey> getlabels - -Slot 1a: -Slot 1b: - -Slot 2a: -Slot 2b: - -Slot 3a: -Slot 3b: - -Slot 4a: -Slot 4b: - -Slot 5a: -Slot 5b: - -Slot 6a: -Slot 6b: - -OnlyKey> setslot 1a label ok - -Successfully set Label - -OnlyKey> getlabels - -Slot 1a: ok -Slot 1b: - -Slot 2a: -Slot 2b: - -Slot 3a: -Slot 3b: - -Slot 4a: -Slot 4b: - -Slot 5a: -Slot 5b: - -Slot 6a: -Slot 6b: - -OnlyKey> setslot 1a url accounts.google.com - -Successfully set URL - -OnlyKey> setslot 1a addchar1 2 - -Successfully set Character1 - -OnlyKey> setslot 1a delay1 2 - -Successfully set Delay1 - -OnlyKey> setslot 1a username onlykey.1234 - -Successfully set Username - -OnlyKey> setslot 1a addchar2 2 - -Successfully set Character2 - -OnlyKey> setslot 1a delay2 2 - -Successfully set Delay2 - -OnlyKey> setslot 1a password - -Type Control-T to toggle password visible. -Password: ********* -Successfully set Password - -OnlyKey> setslot 1a addchar3 2 - -Successfully set Character3 - -OnlyKey> setslot 1a delay3 2 - -Successfully set Delay3 - -OnlyKey> setslot 1a 2fa g - -Successfully set 2FA Type - -OnlyKey> setslot 1a totpkey - -Type Control-T to toggle password visible. -Password: ******************************** -Successfully set TOTP Key - -OnlyKey> setslot 1a addchar4 2 - -Successfully set Character4 - -OnlyKey> - -Bye! -</code></pre></div></div> - -<h2 id="examples">Examples</h2> - -<h3 id="writing-private-keys-and-passwords">Writing Private Keys and Passwords</h3> - -<p>Keys/passwords are masked when entered and should only be set from interactive mode and not directly from terminal. Entering directly from terminal is not secure as command history is stored.</p> - -<p><strong>Setkey Examples</strong></p> - -<p>To set key a device must first be put into config mode.</p> - -<p><strong>Set HMAC key 1 to a custom value</strong></p> - -<p>$ onlykey-cli</p> - -<p>OnlyKey> setkey HMAC1 h</p> - -<p>Type Control-T to toggle password visible. -Password/Key: <strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><em>**</em></p> - -<p>Successfully set ECC Key</p> - -<p><em>HMAC key must be 20 bytes, h is HMAC type</em></p> - -<p><strong>Set HMAC key 2 to a custom value</strong></p> - -<p>$ onlykey-cli</p> - -<p>OnlyKey> setkey HMAC2 h</p> - -<p>Type Control-T to toggle password visible. -Password/Key: <strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><em>**</em></p> - -<p>Successfully set ECC Key</p> - -<p><em>HMAC key must be 20 bytes, h is HMAC type</em></p> - -<p><strong>Set ECC key in slot ECC1 to a custom value (Slots ECC1-ECC16 are available for ECC keys. Supported ECC curves X25519(x), NIST256P1(n), SECP256K1(s))</strong></p> - -<p>$ onlykey-cli</p> - -<p>OnlyKey> setkey ECC1 x</p> - -<p>Type Control-T to toggle password visible. -Password/Key: <strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong>*</p> - -<p>Successfully set ECC Key</p> - -<p><em>ECC key must be 32 bytes, x is X25519 type</em></p> - -<p><strong>Genkey Examples</strong></p> - -<p>To set key a device must first be put into config mode.</p> - -<p><strong>Generate ECC key in slot ECC1 to a custom value (Slots ECC1-ECC16 are available for ECC keys. Supported ECC curves X25519(x), NIST256P1(n), SECP256K1(s))</strong></p> - -<p>$ onlykey-cli</p> - -<p>OnlyKey> genkey ECC1 x</p> - -<p>Successfully set ECC Key</p> - -<h3 id="scripting-example">Scripting Example</h3> - -<p><strong>Set time on OnlyKey (required for TOTP)</strong></p> - -<p>$ onlykey-cli settime</p> - -<p>This can be added to scripts such as the UDEV rule to automatically set time when device is inserted into USB port. See example <a href="https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/49-onlykey.rules">here</a></p> - -<p><strong>Scripted provisioning of an OnlyKey slots and keys can be done by creating a script that sets multiple values on OnlyKey</strong></p> - -<h3 id="list-and-remove-fido2-resident-key">List and Remove FIDO2 Resident Key</h3> - -<p>List current resident keys:</p> - -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>onlykey-cli credential ls -</code></pre></div></div> -<p><img src="https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/images/cli-cred-ls.png" alt="" /></p> - -<p>Remove a resident key by credential ID</p> - -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>onlykey-cli credential rm eu7LPIjTNwIJt2Ws9LWJlXkiNKaueSEEGteZM2MT/lZtEuYo49V6deCiIRMb6EDC29XG13nBL60+Yx+6hxSUYS1uxX9+AA== -</code></pre></div></div> - -<p>Once removed, list current resident keys to verify:</p> - -<p><img src="https://raw.githubusercontent.com/trustcrypto/trustcrypto.github.io/pages/images/cli-cred-ls2.png" alt="" /></p> - -<h2 id="source">Source</h2> - -<p><a href="https://github.com/trustcrypto/python-onlykey">OnlyKey CLI on Github</a></p> - - - - <div class="tags"> - - <b>Tags: </b> - - - - - - - - - - </div> - - - - - - -<a target="_blank" rel="noopener" href="https://github.com/trustcrypto/trustcrypto.github.io/edit/pages/pages/mydoc/command-line.md" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a> - - - -</div> - -<hr class="shaded"/> - -<footer> - <div class="row"> - <div class="col-lg-12 footer"> - ©2023 CryptoTrust. All rights reserved. <br /> -<span>Page last updated:</span> Jan, 19, 2022<br/> Site last generated: Jun 7, 2023 <br /> -<p><a href="https://crp.to"><img src="images/company_logo.png" alt="Company logo"/></a></p> - </div> - </div> -</footer> - - - </div> - <!-- /.row --> -</div> -<!-- /.container --> -</div> -<!-- /#main --> - </div> - -</body> - -<!-- the google_analytics_id gets auto inserted from the config file --> - - - -<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','UA-66296557-1','auto');ga('require','displayfeatures');ga('send','pageview');</script> - - -</html> diff --git a/hosts/_unmaintained/isimud/default.nix b/hosts/_unmaintained/isimud/default.nix deleted file mode 100644 index 5aa6ad3c..00000000 --- a/hosts/_unmaintained/isimud/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./hardware - ./networking.nix - ../../sys - ]; - - isoImage = { - contents = [ - { - source = ./command-line.html; - # TODO:: remove the implied dependency - target = "/home/soispha/cli.html"; - } - ]; - makeEfiBootable = true; - makeUsbBootable = true; - makeBiosBootable = true; - appendToMenuLabel = " Gpg-disk"; - }; - environment.systemPackages = [ - pkgs.onlykey - pkgs.onlykey-cli - pkgs.onlykey-agent - pkgs.cryptsetup - ]; - - soispha = { - secrets.enable = false; - impermanence.enable = false; - locale = { - enable = true; - keyMap = "dvorak"; - }; - fs.backup = { - enable = false; - }; - users = { - hashedPassword = "$y$jFT$YvneNBxEtbrysV2OMG0X30$eKHdzZxJkjD3pXuGOuqbnTaeym5.4ik6kxhE.rJxs3."; - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/hosts/_unmaintained/isimud/hardware/default.nix b/hosts/_unmaintained/isimud/hardware/default.nix deleted file mode 100644 index f55365b3..00000000 --- a/hosts/_unmaintained/isimud/hardware/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - hardware.cpu.amd.updateMicrocode = true; # Why not? - hardware.cpu.intel.updateMicrocode = true; # Why not? - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - soispha.disks = { - enable = false; - }; - - boot = { - kernelModules = []; - kernelPackages = lib.mkDefault pkgs.linuxPackages_6_1; # use this kernel, as it's supported by zfs - }; -} diff --git a/hosts/_unmaintained/isimud/networking.nix b/hosts/_unmaintained/isimud/networking.nix deleted file mode 100644 index 58c84ee5..00000000 --- a/hosts/_unmaintained/isimud/networking.nix +++ /dev/null @@ -1,8 +0,0 @@ -{lib, ...}: { - # Disable networking - networking.useDHCP = lib.mkForce false; - networking.interfaces = lib.mkForce {}; - boot.blacklistedKernelModules = ["igb" "iwlwifi" "rtw89"]; - - networking.hostName = "isimud"; -} diff --git a/hosts/_unmaintained/lahmu/default.nix b/hosts/_unmaintained/lahmu/default.nix deleted file mode 100644 index 94d8b054..00000000 --- a/hosts/_unmaintained/lahmu/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - nixpkgs, - home-manager, - ... -}: { - imports = [ - ./hardware - ./networking.nix - - ../../sys - ]; - - soispha = { - locale.enable = true; - users = { - # enable = true; - hashedPassword = "$y$jFT$qi3wS9njrMl2y55b3NOBI0$j40Qt6AAkMSfZ82KPhqMaUaPztWtPps1wOqaXaF/L.6"; - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/hosts/_unmaintained/lahmu/hardware/cpu.nix b/hosts/_unmaintained/lahmu/hardware/cpu.nix deleted file mode 100644 index 2d7232cd..00000000 --- a/hosts/_unmaintained/lahmu/hardware/cpu.nix +++ /dev/null @@ -1,4 +0,0 @@ -{config, ...}: { - powerManagement.cpuFreqGovernor = "powersave"; - hardware.cpu.amd.updateMicrocode = true; # Why not? -} diff --git a/hosts/_unmaintained/lahmu/hardware/default.nix b/hosts/_unmaintained/lahmu/hardware/default.nix deleted file mode 100644 index bc7b1f96..00000000 --- a/hosts/_unmaintained/lahmu/hardware/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") # TODO: is this necessary? - (modulesPath + "/profiles/qemu-guest.nix") - ./cpu.nix - ./gpu.nix - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - system.fileSystemLayouts = { - enable = true; - mainDisk = "/dev/disk/by-uuid/c0382dda-1f55-4209-967d-b8b22cb0f6e1"; - efiDisk = "/dev/disk/by-uuid/167D-2F0B"; - ssd = true; - swap = { - uuid = "c0382dda-1f55-4209-967d-b8b22cb0f6e1"; - resumeOffset = "140544"; - }; - }; - - boot = { - kernelModules = []; - - initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk"]; - }; -} diff --git a/hosts/_unmaintained/lahmu/hardware/gpu.nix b/hosts/_unmaintained/lahmu/hardware/gpu.nix deleted file mode 100644 index 88c9b88a..00000000 --- a/hosts/_unmaintained/lahmu/hardware/gpu.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - # hardware.opengl.extraPackages = with pkgs; [ - # rocm-opencl-icd # open-cl - # amdvlk # or directly through mesa - # amd-media-driver # libva - # ]; - # - # # Force radv, TODO: is this logical? - # environment.variables.AMD_VULKAN_ICD = "RADV"; -} diff --git a/hosts/_unmaintained/lahmu/networking.nix b/hosts/_unmaintained/lahmu/networking.nix deleted file mode 100644 index 1ef69e7c..00000000 --- a/hosts/_unmaintained/lahmu/networking.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - lib, - ... -}: { - # 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.<interface>.useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - networking.hostName = "lahmu"; -} diff --git a/hosts/_unmaintained/mammun/default.nix b/hosts/_unmaintained/mammun/default.nix deleted file mode 100644 index 5c66d9fa..00000000 --- a/hosts/_unmaintained/mammun/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - config, - lib, - nixpkgs, - home-manager, - pkgs, - ... -}: { - imports = [ - ./hardware - ./networking.nix - - ../../sys - ]; - soispha = { - locale.enable = true; - users = { - hashedPassword = "$y$jDT$O/42/7REOL50onRYcTV9R1$Ot3bPAh2raHmPN3yScP4wsJRtNqrMtTBzOq9oRJeRA0"; - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/hosts/_unmaintained/mammun/hardware/cpu.nix b/hosts/_unmaintained/mammun/hardware/cpu.nix deleted file mode 100644 index 70eaff6f..00000000 --- a/hosts/_unmaintained/mammun/hardware/cpu.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - hardware.cpu.amd.updateMicrocode = true; # Why not? -} diff --git a/hosts/_unmaintained/mammun/hardware/default.nix b/hosts/_unmaintained/mammun/hardware/default.nix deleted file mode 100644 index b1683d47..00000000 --- a/hosts/_unmaintained/mammun/hardware/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ./cpu.nix - ./gpu.nix - ]; - - nixpkgs.hostPlatform = "x86_64-linux"; - - system.fileSystemLayouts = { - enable = true; - mainDisk = "/dev/disk/by-uuid/ac6c5efd-51a7-42e7-a8cd-668a350554b1"; - efiDisk = "/dev/disk/by-uuid/7931-40E5"; - }; - - boot = { - kernelModules = ["kvm-amd"]; - - initrd.availableKernelModules = ["xhci_pci" "ahci" "ehci_pci" "sd_mod" "sr_mod" "sdhci_pci"]; - }; -} diff --git a/hosts/_unmaintained/mammun/hardware/gpu.nix b/hosts/_unmaintained/mammun/hardware/gpu.nix deleted file mode 100644 index 939497db..00000000 --- a/hosts/_unmaintained/mammun/hardware/gpu.nix +++ /dev/null @@ -1,14 +0,0 @@ -{pkgs, ...}: { - boot.initrd.kernelModules = ["amdgpu"]; - # for Southern Islands (SI ie. GCN 1) cards and for Sea Islands (CIK ie. GCN 2) cards - boot.kernelParams = ["radeon.si_support=0" "amdgpu.si_support=1" "radeon.cik_support=0" "amdgpu.cik_support=1"]; - - hardware.opengl.driSupport = true; - # For 32 bit applications - hardware.opengl.driSupport32Bit = true; - - hardware.opengl.extraPackages = with pkgs; [ - rocm-opencl-icd - rocm-opencl-runtime - ]; -} diff --git a/hosts/_unmaintained/mammun/networking.nix b/hosts/_unmaintained/mammun/networking.nix deleted file mode 100644 index e243ebe0..00000000 --- a/hosts/_unmaintained/mammun/networking.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - lib, - ... -}: { - networking = { - networkmanager = { - enable = true; - dns = "default"; - wifi = { - powersave = true; - }; - }; - hostName = "mammun"; - }; -} diff --git a/hosts/_unmaintained/marduk/default.nix b/hosts/_unmaintained/marduk/default.nix deleted file mode 100644 index 2379fcdf..00000000 --- a/hosts/_unmaintained/marduk/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{lib, ...}: { - imports = [ - ./hardware - ./networking.nix - ]; - - console = { - keyMap = "dvorak"; - }; - # needed to override defaults - isoImage.isoName = lib.mkForce "nixos-iso"; - - system.stateVersion = "23.05"; -} diff --git a/hosts/_unmaintained/marduk/hardware/default.nix b/hosts/_unmaintained/marduk/hardware/default.nix deleted file mode 100644 index 4fed1d06..00000000 --- a/hosts/_unmaintained/marduk/hardware/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/cd-dvd/installation-cd-graphical-gnome.nix") - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - boot = { - kernelModules = ["rtw89"]; - # FIXME: The kernel version should probably be updated, considering that it's 6.1 <2024-03-23> - kernelPackages = pkgs.linuxPackages_6_1; # use this kernel, as it's supported by zfs - zfs.package = pkgs.zfs_unstable; # Default zfs is "broken" (to nixos) on the newest kernel - }; -} diff --git a/hosts/_unmaintained/marduk/networking.nix b/hosts/_unmaintained/marduk/networking.nix deleted file mode 100644 index da8f3850..00000000 --- a/hosts/_unmaintained/marduk/networking.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - lib, - ... -}: { - # 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.<interface>.useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - networking.hostName = "marduk"; -} diff --git a/hosts/apzu/default.nix b/hosts/by-name/apzu/configuration.nix index d0090339..4464011e 100644 --- a/hosts/apzu/default.nix +++ b/hosts/by-name/apzu/configuration.nix @@ -1,24 +1,47 @@ -{...}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + lib, + pkgs, + baseLib, + ... +}: { imports = [ ./hardware.nix ]; soispha = { - services.backup = { - # Apzu should be regularly synced with Tiamat, which performs updates. - enable = false; - }; bluetooth.enable = true; laptop = { backlight = "intel_backlight"; enable = true; }; + + # TODO: Hard-code all the uids/gids <2025-05-13> + impermanence.directories = [ + "/var/lib/nixos" + "/var/log" + ]; + programs = { yambar = { laptop = true; backlight = "intel_backlight"; }; + river.init = { + mappings = { + layout = "dvorak-modified"; + }; + screenSetupCode = {}; + }; }; locale.enable = true; diff --git a/hosts/apzu/hardware.nix b/hosts/by-name/apzu/hardware.nix index ae204baa..8d481fa6 100644 --- a/hosts/apzu/hardware.nix +++ b/hosts/by-name/apzu/hardware.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {modulesPath, ...}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") # TODO: is this necessary? diff --git a/hosts/by-name/tiamat/configuration.nix b/hosts/by-name/tiamat/configuration.nix new file mode 100644 index 00000000..18393543 --- /dev/null +++ b/hosts/by-name/tiamat/configuration.nix @@ -0,0 +1,79 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + lib, + pkgs, + system, + libraries, + externalBinaries, + ... +}: { + imports = [ + ./hardware.nix + ]; + + soispha = { + bluetooth = {enable = true;}; + networking = { + enable = true; + hostName = "tiamat"; + mode = "systemd-networkd"; + }; + nixpkgs = { + enable = true; + systemName = "x86_64-linux"; + }; + + # TODO: Hard-code all the uids/gids <2025-05-13> + impermanence.directories = [ + "/var/lib/nixos" + "/var/log" + ]; + + services = { + unison.foreign.address = "apzu.fritz.box"; + }; + programs = { + river = { + unicodeInput.enable = true; + init = { + mappings = { + layout = "us"; + keymap = { + # Support Unicode input + "<Alt+Ctrl+Meta+Shift-Z>" = [ + "spawn" + "${lib.getExe externalBinaries.qmk_firmware.packages.${system}.qmk_unicode_type} 106 65377" + ]; + }; + }; + screenSetupCode = { + "DP-2" = {pos = "2560,0";}; + "DP-1" = { + scale = "1.5"; + pos = "0,0"; + }; + }; + }; + }; + }; + locale = { + enable = true; + keyMap = "us"; + }; + users = { + enable = true; + enableDeprecatedPlugdev = true; + hashedPassword = "$y$jFT$qi3wS9njrMl2y55b3NOBI0$j40Qt6AAkMSfZ82KPhqMaUaPztWtPps1wOqaXaF/L.6"; + }; + }; + + system.stateVersion = "23.05"; +} diff --git a/hosts/tiamat/hardware.nix b/hosts/by-name/tiamat/hardware.nix index 97600848..2b18a662 100644 --- a/hosts/tiamat/hardware.nix +++ b/hosts/by-name/tiamat/hardware.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {modulesPath, ...}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") # TODO: is this necessary? diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 00000000..64768074 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,61 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + self, + system, + openPRsNixpkgs, + packageSets, + libraries, + modules, + externalDependencies, + externalBinaries, +}: let + hosts = libraries.extra.mkByName { + useShards = false; + baseDirectory = ./by-name; + fileName = "configuration.nix"; + }; + + generateHost = _: path: + self.inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit + libraries + modules + self + ; + }; + modules = [ + { + _module.args = { + inherit + # extra package sources + openPRsNixpkgs + packageSets + # extra information + system + # nix registry + externalDependencies + # bins + # TODO: Integrate these into `pkgs/by-name` <2024-05-22> + externalBinaries + ; + }; + } + path + + ../modules + ../modules/common + ]; + }; + + generatedHosts = builtins.mapAttrs generateHost hosts; +in + generatedHosts diff --git a/hosts/hostinfo.toml b/hosts/hostinfo.toml index 4ee5918c..c2523a3a 100644 --- a/hosts/hostinfo.toml +++ b/hosts/hostinfo.toml @@ -1,17 +1,15 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [Tiamat] description = "This is my main desktop" [Apzu] description = "This is my light laptop, with modern hardware" - -[Mammun] -description = "This is my older and heavier laptop" - -[Lahmu] -description = "This is my config running on a vm" - -[Marduk] -description = "This is a small compilation target, to get a install-iso" - -[Marduk] -description = "A host mainly used to setup private gpg keys, without network access or other such things" diff --git a/hosts/tiamat/default.nix b/hosts/tiamat/default.nix deleted file mode 100644 index 4e76675c..00000000 --- a/hosts/tiamat/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{...}: { - imports = [ - ./hardware.nix - ]; - - soispha = { - bluetooth = {enable = true;}; - networking = { - enable = true; - hostName = "tiamat"; - mode = "systemd-networkd"; - }; - nixpkgs = { - enable = true; - systemName = "x86_64-linux"; - }; - services = { - backup = { - backupDiskUuid = "c06ce163-2955-4388-b212-dfec4448fcf4"; - enable = true; - }; - unison.foreign.address = "apzu.fritz.box"; - }; - programs = { - river = { - unicodeInput.enable = true; - }; - }; - locale = { - enable = true; - keyMap = "us"; - }; - users = { - enable = true; - enableDeprecatedPlugdev = true; - hashedPassword = "$y$jFT$qi3wS9njrMl2y55b3NOBI0$j40Qt6AAkMSfZ82KPhqMaUaPztWtPps1wOqaXaF/L.6"; - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 00000000..1cdbf936 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,126 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{lib}: rec { + /* + Converts `number` from a binary number to a decimal one. + + The input is indented to be a number composed only of `1`s and `0` (e.g., 10010.) + + # Type + + binaryToDecimal :: Int -> Int + + # Arguments + + number + : The sequence of `1`s and `0`s defining a binary number, in little endian. + + # Examples + + binaryToDecimal 1001 + => 9 + */ + binaryToDecimal = number: let + binaryList = + builtins.map lib.strings.toInt (lib.lists.reverseList (lib.strings.stringToCharacters (builtins.toString number))); + in + builtins.foldl' (acc: num: acc + num) 0 + (lib.lists.imap0 (index: elem: elem * (pow 2 index)) binaryList); + + /* + Converts `string` to a (probably) unique numerical id. + + This is achieved by hashing the string and returning the first six hex-digits + converted to a base 10 number. + + # Type + + idFromString :: String -> Int + + # Arguments + + string + : The string to use as seed for the id generation. + + # Examples + + idFromString "3d-printer" + => 10365713 + */ + idFromString = string: let + inputSeed = + builtins.concatStringsSep "" + (lib.lists.take 6 + (lib.strings.stringToCharacters (builtins.hashString "sha256" string))); + in + lib.trivial.fromHexString inputSeed; + + /* + source: https://github.com/NixOS/nix/issues/10387#issuecomment-2494597690 + + Raises the `base` to the power of `power`. + + Considering the small input size and the lack of a built-in power function [2], + this naive power implementation should satisfy reasonable performance + requirements. + + Due to the lack of a modulo and bitwise AND operator, it is questionable whether + the recursive exponentiation by squaring [1] implementation would even be + faster. + + [1]: https://en.wikipedia.org/wiki/Exponentiation_by_squaring + [2]: https://github.com/NixOS/nix/issues/10387 + + # Type + + pow :: Number -> Number -> Number + + # Arguments + + base + : The base number to be raised. + + power + : The exponent to raise `base` to. + + # Examples + + pow 2 5 + => 32 + */ + pow = base: power: + if power == 0 + then 1 + else if power > 0 + then (base * (pow base (power - 1))) + else builtins.throw "Negative powers are not supported"; + + options = { + /* + Generate an enable option definition, that defaults to true. + + This conveniently allows the composition of a “common” module set. + + # Type + + mkEnable :: String -> AttrSet + + # Arguments + + name + : The name to use in the option description. + */ + mkEnable = name: + (lib.mkEnableOption name) + // { + default = true; + }; + }; +} diff --git a/modules/by-name/ad/adb/module.nix b/modules/by-name/ad/adb/module.nix index ec5d4be6..71bd3c9b 100644 --- a/modules/by-name/ad/adb/module.nix +++ b/modules/by-name/ad/adb/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/ag/age/module.nix b/modules/by-name/ag/age/module.nix new file mode 100644 index 00000000..9a498ab6 --- /dev/null +++ b/modules/by-name/ag/age/module.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + modules, + pkgs, + ... +}: let + cfg = config.soispha.age; +in { + options.soispha.age = { + enable = lib.mkEnableOption "secret management with age"; + }; + + imports = [ + modules.agenix.nixosModules.default + ]; + + config = lib.mkIf cfg.enable { + age = { + # TODO(@bpeetz): Set once <https://github.com/ryantm/agenix/pull/317/files> is merged. <2025-05-16> + # enable = true; + ageBin = lib.getExe pkgs.rage; + }; + }; +} diff --git a/modules/by-name/at/atuin/atuin.zsh b/modules/by-name/at/atuin/atuin.zsh new file mode 100644 index 00000000..72dd7fa0 --- /dev/null +++ b/modules/by-name/at/atuin/atuin.zsh @@ -0,0 +1,137 @@ +#! /usr/bin/env zsh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck disable=SC2034,SC2153,SC2086,SC2155 + +# Above line is because shellcheck doesn't support zsh, per +# https://github.com/koalaman/shellcheck/wiki/SC1071, and the ignore: param in +# ludeeus/action-shellcheck only supports _directories_, not _files_. So +# instead, we manually add any error the shellcheck step finds in the file to +# the above line ... + +if ! [[ $options[zle] = on ]]; then + return 0 +fi + +# Source this in your ~/.zshrc +autoload -U add-zsh-hook + +zmodload zsh/datetime 2>/dev/null + +# If zsh-autosuggestions is installed, configure it to use Atuin's search. If +# you'd like to override this, then add your config after the $(atuin init zsh) +# in your .zshrc +_zsh_autosuggest_strategy_atuin() { + suggestion=$(ATUIN_QUERY="$1" atuin search --cmd-only --limit 1 --search-mode prefix) +} + +if [ -n "${ZSH_AUTOSUGGEST_STRATEGY:-}" ]; then + ZSH_AUTOSUGGEST_STRATEGY=("atuin" "${ZSH_AUTOSUGGEST_STRATEGY[@]}") +else + ZSH_AUTOSUGGEST_STRATEGY=("atuin") +fi + +export ATUIN_SESSION=$(atuin uuid) +ATUIN_HISTORY_ID="" + +_atuin_preexec() { + local id + id=$(atuin history start -- "$1") + export ATUIN_HISTORY_ID="$id" + __atuin_preexec_time=${EPOCHREALTIME-} +} + +_atuin_precmd() { + local EXIT="$?" __atuin_precmd_time=${EPOCHREALTIME-} + + [[ -z "${ATUIN_HISTORY_ID:-}" ]] && return + + local duration="" + if [[ -n $__atuin_preexec_time && -n $__atuin_precmd_time ]]; then + printf -v duration %.0f $(((__atuin_precmd_time - __atuin_preexec_time) * 1000000000)) + fi + + (ATUIN_LOG=error atuin history end --exit $EXIT ${duration:+--duration=$duration} -- $ATUIN_HISTORY_ID &) >/dev/null 2>&1 + export ATUIN_HISTORY_ID="" +} + +_atuin_search() { + emulate -L zsh + zle -I + + # swap stderr and stdout, so that the tui stuff works + # TODO: not this + local output + # shellcheck disable=SC2048 + output=$(ATUIN_SHELL_ZSH=t ATUIN_LOG=error ATUIN_QUERY=$BUFFER atuin search $* -i 3>&1 1>&2 2>&3) + + zle reset-prompt + + if [[ -n $output ]]; then + RBUFFER="" + LBUFFER=$output + + if [[ $LBUFFER == __atuin_accept__:* ]] + then + LBUFFER=${LBUFFER#__atuin_accept__:} + zle accept-line + fi + fi +} +_atuin_search_vicmd() { + _atuin_search --keymap-mode=vim-normal +} +_atuin_search_viins() { + _atuin_search --keymap-mode=vim-insert +} + +_atuin_up_search() { + # Only trigger if the buffer is a single line + if [[ ! $BUFFER == *$'\n'* ]]; then + _atuin_search --shell-up-key-binding "$@" + else + zle up-line + fi +} +_atuin_up_search_vicmd() { + _atuin_up_search --keymap-mode=vim-normal +} +_atuin_up_search_viins() { + _atuin_up_search --keymap-mode=vim-insert +} + +add-zsh-hook preexec _atuin_preexec +add-zsh-hook precmd _atuin_precmd + +zle -N atuin-search _atuin_search +zle -N atuin-search-vicmd _atuin_search_vicmd +zle -N atuin-search-viins _atuin_search_viins +zle -N atuin-up-search _atuin_up_search +zle -N atuin-up-search-vicmd _atuin_up_search_vicmd +zle -N atuin-up-search-viins _atuin_up_search_viins + +# These are compatibility widget names for "atuin <= 17.2.1" users. +zle -N _atuin_search_widget _atuin_search +zle -N _atuin_up_search_widget _atuin_up_search + +bindkey -M emacs '^r' atuin-search +bindkey -M viins '^r' atuin-search-viins +bindkey -M vicmd '/' atuin-search +bindkey -M emacs '^[[A' atuin-up-search +bindkey -M vicmd '^[[A' atuin-up-search-vicmd +bindkey -M viins '^[[A' atuin-up-search-viins +bindkey -M emacs '^[OA' atuin-up-search +bindkey -M vicmd '^[OA' atuin-up-search-vicmd +bindkey -M viins '^[OA' atuin-up-search-viins +bindkey -M vicmd 'k' atuin-up-search-vicmd + +# vim: ft=zsh diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index 604ee4ef..700f50fb 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -8,28 +17,40 @@ in { options.soispha.programs.atuin = { enable = lib.mkEnableOption "atuin"; + + enableAge = lib.mkEnableOption "atuin with age keys"; }; config = lib.mkIf cfg.enable { - age.secrets.atuin_encryption_key = { + age.secrets.atuin_encryption_key = lib.mkIf cfg.enableAge { file = ./secrets/encryption_key.age; mode = "700"; owner = "soispha"; group = "users"; }; + soispha.programs.zsh.integrations.atuin = ./atuin.zsh; + home-manager.users.soispha = { programs.atuin = { enable = true; package = pkgs.atuin-dvorak; - enableZshIntegration = config.soispha.programs.zsh.enable; + + # We can do this on our own. + enableZshIntegration = false; settings = { - key_path = "${config.age.secrets.atuin_encryption_key.path}"; + key_path = lib.mkMerge [ + (lib.mkIf cfg.enableAge "${config.age.secrets.atuin_encryption_key.path}") + (lib.mkIf (!cfg.enableAge) + "${config.home-manager.users.soispha.xdg.dataHome}/atuin/atuin_secret_key.key") + ]; - # TODO: Setup a self-hosted sync server. <2024-10-18> - session_path = ""; - auto_sync = false; - sync_address = ""; + sync = lib.mkIf cfg.enableAge { + # The v2 sync API + records = true; + }; + auto_sync = lib.mkIf cfg.enableAge true; + sync_address = lib.mkIf cfg.enableAge "https://atuin-sync.vhack.eu"; # Use the rather reasonable syntax of `skim` to search. search_mode = "skim"; diff --git a/modules/by-name/at/atuin/secrets/encryption_key.age.license b/modules/by-name/at/atuin/secrets/encryption_key.age.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/at/atuin/secrets/encryption_key.age.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/ba/backup/module.nix b/modules/by-name/ba/backup/module.nix index 92700bf2..d0805092 100644 --- a/modules/by-name/ba/backup/module.nix +++ b/modules/by-name/ba/backup/module.nix @@ -1,51 +1,207 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, - pkgs, config, + pkgs, ... }: let - backup-script = pkgs.writeShellScriptBin "backsnap" '' - set -xeu; - - ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; - ${pkgs.snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; - ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; - ''; - cfg = config.soispha.services.backup; + + snapshotDir = "/srv/last_snapshot"; in { options.soispha.services.backup = { - enable = lib.mkEnableOption "backups with my forked snap-sync"; - backupDiskUuid = lib.mkOption { - type = lib.types.str; - example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; - description = "The UUID of the backup disk"; + storagebox = { + enable = lib.mkEnableOption "remote backups"; + user = lib.mkOption { + type = lib.types.str; + description = "The storagebox-user to use"; + example = "u384702-sub2"; + }; + + sshKey = lib.mkOption { + type = lib.types.path; + description = "The age-encrypted ssh-key, passed to agenix"; + default = ./secrets/storagebox/ssh_key.age; + }; + + repositoryPassword = lib.mkOption { + type = lib.types.path; + description = "The age-encrypted restic password, passed to agenix"; + default = ./secrets/storagebox/repository_password.age; + }; + }; + + local = { + enable = lib.mkEnableOption "local backups"; + + repositoryPassword = lib.mkOption { + type = lib.types.path; + description = "The age-encrypted restic password, passed to agenix"; + default = ./secrets/local/repository_password.age; + }; + + backupMountPoint = lib.mkOption { + type = lib.types.path; + description = "The path where to expect the mounted backup disk"; + default = "/mnt/backup"; + }; }; }; - config = lib.mkIf cfg.enable { - systemd = { - services.backup = { - wantedBy = lib.mkForce []; - unitConfig = { - Description = "Backup the last snapshots of the persitent-storage subvolume."; - }; + config = { + age.secrets = { + resticStorageboxSshKey = lib.mkIf cfg.storagebox.enable { + file = cfg.storagebox.sshKey; + mode = "0700"; + owner = "root"; + group = "root"; + }; + resticStorageboxRepositoryPassword = lib.mkIf cfg.storagebox.enable { + file = cfg.storagebox.repositoryPassword; + mode = "0700"; + owner = "root"; + group = "root"; + }; + resticLocalRepositoryPassword = lib.mkIf cfg.local.enable { + file = cfg.local.repositoryPassword; + mode = "0700"; + owner = "root"; + group = "root"; + }; + }; + + soispha.programs.ssh = lib.mkIf cfg.storagebox.enable { + enable = true; + rootKnownHosts = { + "[u459143-sub1.your-storagebox.de]:23" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs"; + }; + }; + + systemd.services = { + prepare-backup = { + requires = []; + after = []; + + description = "Prepare a backup by snapshotting the system."; + serviceConfig = { + ExecStart = lib.getExe (pkgs.writeShellApplication { + name = "prepareBackup"; + text = '' + set -x + + [ -d "${snapshotDir}" ] && btrfs subvolume delete "${snapshotDir}" + + # -r := Make the snapshot read-only + btrfs subvolume snapshot -r /srv "${snapshotDir}"; + ''; + + inheritPath = false; + runtimeInputs = [ + pkgs.btrfs-progs + ]; + }); + Type = "oneshot"; - ExecStart = "${backup-script}/bin/backsnap"; + + User = "root"; + Group = "root"; + + # TODO: Hardening <2025-05-04> }; }; - timers.backup = { - wantedBy = ["timers.target"]; - unitConfig = { - Description = "Backup 15min after boot and every 8 hours"; + restic-backups-storagebox = lib.mkIf cfg.storagebox.enable { + requires = ["prepare-backup.service"]; + after = ["prepare-backup.service"]; + }; + + restic-backups-local = lib.mkIf cfg.local.enable { + requires = ["prepare-backup.service"]; + after = ["prepare-backup.service"]; + + serviceConfig = { + ConditionPathIsDirectory = "${cfg.local.backupMountPoint}"; }; + }; + }; + + services.restic.backups = let + homeDir = "${snapshotDir}/home"; + + paths = [ + snapshotDir + ]; + exclude = [ + "${homeDir}/soispha/.cache" + ]; + extraBackupArgs = [ + "--verbose=2" + ]; + in { + local = lib.mkIf cfg.local.enable { + inhibitsSleep = true; + initialize = true; + + inherit paths exclude extraBackupArgs; + + passwordFile = config.age.secrets.resticLocalRepositoryPassword.path; + + repository = "${cfg.local.backupMountPoint}/restic-backup-data/"; + + # Start on demand. + timerConfig = null; + }; + + storagebox = lib.mkIf cfg.storagebox.enable { + inhibitsSleep = true; + initialize = true; + + inherit paths exclude extraBackupArgs; + + passwordFile = config.age.secrets.resticStorageboxRepositoryPassword.path; + extraOptions = [ + "rclone.program='ssh -p 23 ${cfg.storagebox.user}@${cfg.storagebox.user}.your-storagebox.de -i ${config.age.secrets.resticStorageboxSshKey.path} command_forced_on_remote'" + ]; + + # This setting is normally passed to rclone, but we force + # the command on the remote. + # As such, the value does not matter and must only be parseable by restic. + repository = "rclone: "; + timerConfig = { - OnBootSec = "15min"; - OnUnitActiveSec = "8h"; + Requires = "network-online.target"; + OnActiveSec = "30m"; + OnUnitInactiveSec = "2h"; + Persistent = true; }; }; + + # This is only for listing, pruning and such stuff. + storagebox-admin = lib.mkIf cfg.storagebox.enable { + inhibitsSleep = false; + initialize = false; + + passwordFile = config.age.secrets.resticStorageboxRepositoryPassword.path; + extraOptions = [ + "rclone.program='ssh -p 23 ${cfg.storagebox.user}@${cfg.storagebox.user}.your-storagebox.de command_forced_on_remote'" + ]; + + # This setting is normally passed to rclone, but we force + # the command on the remote. + # As such, the value does not matter and must only be parseable by restic. + repository = "rclone: "; + + timerConfig = null; + }; }; }; } diff --git a/modules/by-name/ba/backup/secrets/local/repository_password.age b/modules/by-name/ba/backup/secrets/local/repository_password.age new file mode 100644 index 00000000..b1508e49 --- /dev/null +++ b/modules/by-name/ba/backup/secrets/local/repository_password.age @@ -0,0 +1,20 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqVCtBZzNBWFlxQnhlb3c2 +NG0xMjV3V2hQUWhNb01ROGpFbzM0c3NjRWlvCjRqMTdxNlNsY1lDM2VCUGRjcldZ +SUhScGRSejY3TFlwVjlweTRERkU4ZTQKLT4gc3NoLWVkMjU1MTkgelpFb25nIGtj +cVN4RzFseTJCVXhOc0tEWi96ckpGQjhNdUZrb1FVWnJ6TU1vSHZCMUkKc1JwM2Ir +TzNzZEV5VEE4QUp4cDdTNWZvTFlZR0tUbUFZTnNEZE1McnhISQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgYVQzRHdaa1NYUUpLODUyL0orV3d4Z1o1V2hhekZXVWFzNW50 +enhSYnlWbwpzbnZwK1dSczJ5SGZsRjNyRWZraUcreWlBakZOZkVyZ01CWml5V0E4 +TzY4Ci0+ICpMUC1ncmVhc2UgV0IKUTZVMzR1QTVGdWRyNWprVVpjaWhCTTFSRzY3 +bHVtdHpJQXlWQVFHZ3FzbkZncHRsQnJIaHlEekl5ZE15Sko0YQpSVEUKLS0tIGFy +N1Y2OUREY1NOL2xPODd4Y3Y4Wk83NFJ5ZVBpNnJYelo3RmZPL1V4Q28KcA+6qt2d +LrL0FS279XL1uqSeXiDdBBBh5i951dRx9ML33g7IoQxaGqSWU0yP/y7fcSp3B/rT +/alQGRL/uYnCS2z8zCngr2YCQBXAI8bOgf+th7fzc15FXNB14WMGvrCVRB8Rr6JZ +itTxcAebY192xeINJG269iL6Ef0YrmZLUufKQ9lcVob/G32tG0vxSbSBBx3asf7y +toiNdlXpxJPrIpFx5mc3dnkaXCTSRuXjiAqnncW/HNxovCI90sY3dyL+XRC8iEOD +sql7C7jUUvLubptk1gGW5pHmGvqeCLr+fJ6XrVqXE5VxOSbzvSUsdS84WOBInLiO +V36aUtthEzdRXd81P/n7U26O93GWpIwzctu0WwSHHHsPKhxqFY4RuWa3mO4Zk6fu +O6fsYnpAqYiCUd/k2zKrDtLosTnwuwc7Vm1glm4DEEtvteVibw47SR1LLfUds5XL +j1OR7Z6/ljIEKPjE1a81pQjYRfHDUtceXUvrlL6iCID30zU= +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ba/backup/secrets/storagebox/repository_password.age b/modules/by-name/ba/backup/secrets/storagebox/repository_password.age new file mode 100644 index 00000000..a2aa984a --- /dev/null +++ b/modules/by-name/ba/backup/secrets/storagebox/repository_password.age @@ -0,0 +1,14 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzbnJ5Z3NXRFRtdEdCNk1z +NG9Cb2FUTEZ2U2hTdUptWGpneHd2RGxGQlY0ClhqcHlMSUZlLzBPZko4a2hKdnE1 +Q1hnc3ErWlJiSk1HVXFLcSswQlV0WTAKLT4gc3NoLWVkMjU1MTkgelpFb25nIG5I +cFpMY21ZdU9TUHY5VksraG1xeFByQlM1WE1INEk0SWFJQzIvSXhZbXMKSWxiNlIr +NjZ6bEgySUJGdnpoZTY2MmxxajJMaUVTM3RkTmhpdkxaRnNCQQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgRGtLMHFORm9mUDUwZnBXM0djcFlxTExJbWVDeDJmbVVSRi9l +QTFmekpROApZY3Z0Zlc1SUdCcllKQ01ZNmdFQkI3UnViVGxzNTJNUkhqc2hOejY3 +MndrCi0+IG1Hbi1ncmVhc2UgUDJJdgpGUmVHa1NPWGtzUmZmMXM3eWkxVnJkek1h +MUxZeS9qMlArendXZ1ltdFgvMTBabTlPM2hzSjhuVXBQNktHKzc1ClF6bjZob09B +Ci0tLSB3dEZpbnpVR0pPdGpFVmNyM0JzUGl6eGcreXpkTG9xQUc5S09ndUthaEpR +CuHgXCIq/AUCuIQWepBRapAab6zczOwxEBpDv5R2kw2mw34UVRLuFs7hB1cHE79y +7Fc= +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ba/backup/secrets/storagebox/ssh_key.age b/modules/by-name/ba/backup/secrets/storagebox/ssh_key.age new file mode 100644 index 00000000..a7f30c7c --- /dev/null +++ b/modules/by-name/ba/backup/secrets/storagebox/ssh_key.age @@ -0,0 +1,22 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJOTFaQVpnQ2VJN1pJbmdu +STF2UTF1Y3lyU2p3OUJlcWRFWlg3Mm9vSEFFCjg4RklaZ0hqdWdZSlJ0dGx0ckJN +eHE4R1QyTEJEVkZudnVQV2VpblBYTW8KLT4gc3NoLWVkMjU1MTkgelpFb25nIDR0 +Z2RwTXJGV1VYT2Y1OUcxbXpnOGNEbG9BWmFxeWUzZ1huNW1YQk5BM3cKK1hLNnYx +VnNvRDZWM3Y4VUpCQTRtbHJOcDJLdTBOUXJ1ak52Mkp3TE9OcwotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgSHFSOXM1Vm1lY0ErRkZobndEU0xvQjVXbnhDbUlGNmE2dStY +SEFqSk9TMAo2VU5UbW9rc29kendvcHNuU3hFQ2lBQWNjRUxUSE10RmtjbkdwWGlv +cTRVCi0+IDwtZ3JlYXNlIHNPT3N1IHNkZzcoQzUgLUM3Ml1Tcgorb3FQcWlDSkJQ +L1g4WisydkYxdnJMeDNISVVDTGlZdmUyRkV0TkFUdW4ycXZBSlF3UWM2R3FTYjRs +ckEyaTg2ClVrbwotLS0gdHF5Q3BqV3h2TzEySCs4OFNIYmx1U0hsTWo1RDlTV3VC +T1RmelZaWXh4YwoeRkYbirDGX9aZj6OVxZ8sVsm2Sz23ikcBhAdTIXKErM7eQcdp +Y2nA5kUebPVznbSq/XSQNbqvCfSv9wVVTZWww7AqkrltjFS8yxQVMKB37IfnJsZI +92OCjJKArxAbvS7ERKY51Cf9oY/VqGk5WqxExH5ZvdbL144UI8JzrxhDopVXBWNd +fCrHirRAdlu3wgVILXV3vk1kmE69sspuV4cer5f/kOBKT1w09s2NFFHH4TO3cLTJ +Obgi/HWYHBjqGSgwd4bDtNOW2UDE1LN3YeUhloutWhuX8yt+NFzZJtl+CBrRqLKA +0CK+ZPKPWWKYPCNlzKT4vDF9BZeyCfoEj9dTXvxrNPEB6YYi16aQ8DhI8wxADl41 +ShrULlEmB8rfz7V+8TFmERKISBRSSH0p+XJi8e2DWh2dSco16rizmbFFNDdcYiGT +WWbXYCFNzj+kNFI/vEtt9dEWmfXlgg01khnyoOuRLedtoCDSuF+8z7YYy6oYt/2h +gmf4NHOUgyxK56c17JMQ3xT97d2odgqmwB+YZQ13IJCjt3M3pmSssD4sTgmA5alH +vtUlci6dZdO801h5vOesbAJplXCEyw== +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/bl/bluetooth/module.nix b/modules/by-name/bl/bluetooth/module.nix index 486f6e6f..7750e70d 100644 --- a/modules/by-name/bl/bluetooth/module.nix +++ b/modules/by-name/bl/bluetooth/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/bo/boot/boot_pictures/gnu.png.license b/modules/by-name/bo/boot/boot_pictures/gnu.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/bo/boot/boot_pictures/gnu.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/bo/boot/boot_pictures/gnulin_emb_1.png.license b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_1.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_1.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/bo/boot/boot_pictures/gnulin_emb_2.png.license b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_2.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_2.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/bo/boot/iso_entry/archlive_iso.nix b/modules/by-name/bo/boot/iso_entry/archlive_iso.nix index d19a4a87..d0ae8457 100644 --- a/modules/by-name/bo/boot/iso_entry/archlive_iso.nix +++ b/modules/by-name/bo/boot/iso_entry/archlive_iso.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux"}: let signing_key = import ./signing_key.nix {inherit pkgs;}; diff --git a/modules/by-name/bo/boot/iso_entry/signing_key.nix b/modules/by-name/bo/boot/iso_entry/signing_key.nix index 788447be..d9268d75 100644 --- a/modules/by-name/bo/boot/iso_entry/signing_key.nix +++ b/modules/by-name/bo/boot/iso_entry/signing_key.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux"}: pkgs.stdenv.mkDerivation { name = "archlinux_signing_keys"; diff --git a/modules/by-name/bo/boot/module.nix b/modules/by-name/bo/boot/module.nix index 8b71ce65..dfcd14b7 100644 --- a/modules/by-name/bo/boot/module.nix +++ b/modules/by-name/bo/boot/module.nix @@ -1,7 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, pkgs, + modules, ... }: let cfg = config.soispha.boot; @@ -12,6 +22,10 @@ in { # enableIsoEntry = lib.mkEnableOption "an tails iso boot entry"; }; + imports = [ + modules.lanzaboote.nixosModules.lanzaboote + ]; + config = lib.mkIf cfg.enable ( # let # cfg = config.boot.loader.systemd-boot; @@ -70,7 +84,7 @@ in { # This should only be necessary for `lanzaboote`, but that is the current default in # this module. soispha.impermanence.directories = [ - "/etc/secureboot" + "/var/lib/sbctl" ]; boot = { @@ -82,7 +96,7 @@ in { lanzaboote = { enable = true; - pkiBundle = "/etc/secureboot"; + pkiBundle = "/var/lib/sbctl"; settings = { # Disable editing the kernel command line (which could allow someone to become root) diff --git a/modules/by-name/ca/cargo/module.nix b/modules/by-name/ca/cargo/module.nix new file mode 100644 index 00000000..980ebcba --- /dev/null +++ b/modules/by-name/ca/cargo/module.nix @@ -0,0 +1,27 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.cargo; +in { + options.soispha.programs.cargo = { + enable = lib.mkEnableOption "cargo"; + }; + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + home.sessionVariables = { + CARGO_HOME = "${config.home-manager.users.soispha.xdg.dataHome}/cargo"; + }; + }; + }; +} diff --git a/modules/by-name/cl/cleanup/module.nix b/modules/by-name/cl/cleanup/module.nix index f8307b73..98c699eb 100644 --- a/modules/by-name/cl/cleanup/module.nix +++ b/modules/by-name/cl/cleanup/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/dc/dconf/module.nix b/modules/by-name/dc/dconf/module.nix index e4a1c7a9..ec055a6f 100644 --- a/modules/by-name/dc/dconf/module.nix +++ b/modules/by-name/dc/dconf/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { # needed to make home-manager play nice with some apps. See: # https://nix-community.github.io/home-manager/index.xhtml#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal diff --git a/modules/by-name/di/direnv/module.nix b/modules/by-name/di/direnv/module.nix new file mode 100644 index 00000000..7c81e671 --- /dev/null +++ b/modules/by-name/di/direnv/module.nix @@ -0,0 +1,30 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.direnv; +in { + options.soispha.programs.direnv = { + enable = lib.mkEnableOption "direnv"; + }; + + config.home-manager.users.soispha.programs.direnv = lib.mkIf cfg.enable { + enable = true; + nix-direnv.enable = true; + config = { + warn_timeout = 0; + # strict_env = true; + # disable_stdin = true; + }; + }; +} diff --git a/modules/by-name/di/disks/fstrim.nix b/modules/by-name/di/disks/fstrim.nix index 6daeb65e..0fbb6c83 100644 --- a/modules/by-name/di/disks/fstrim.nix +++ b/modules/by-name/di/disks/fstrim.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/di/disks/hibernate.nix b/modules/by-name/di/disks/hibernate.nix index a50e5b57..e983f9c7 100644 --- a/modules/by-name/di/disks/hibernate.nix +++ b/modules/by-name/di/disks/hibernate.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs}: { services = { hibernate-preparation = { diff --git a/modules/by-name/di/disks/module.nix b/modules/by-name/di/disks/module.nix index c0e5bcfd..d5746ecf 100644 --- a/modules/by-name/di/disks/module.nix +++ b/modules/by-name/di/disks/module.nix @@ -1,7 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, pkgs, + modules, ... }: let # FIXME: The iso redeploy requires a bigger efi partition <2024-05-12> @@ -37,6 +47,10 @@ in { }; }; + imports = [ + modules.disko.nixosModules.default + ]; + config = lib.mkIf cfg.enable { systemd = lib.recursiveUpdate (import ./hibernate.nix {inherit pkgs;}) (import ./fstrim.nix {inherit pkgs lib cfg;}); @@ -95,11 +109,20 @@ in { nodev = { "/" = { fsType = "tmpfs"; - mountOptions = ["defaults" "size=4G" "mode=755"]; + mountOptions = ["defaults" "size=25%" "mode=0755"]; }; "/tmp" = { fsType = "tmpfs"; - mountOptions = ["defaults" "size=16G" "mode=755"]; + mountOptions = ["defaults" "size=50%" "mode=0755"]; + }; + "/nix/var/nix/builds" = { + fsType = "tmpfs"; + mountOptions = [ + "defaults" + "noswap" # Otherwise, we might run into io-based slowdowns + "size=75%" + "mode=0755" + ]; }; }; }; diff --git a/modules/by-name/do/documentation/module.nix b/modules/by-name/do/documentation/module.nix index 4616a991..e4e51409 100644 --- a/modules/by-name/do/documentation/module.nix +++ b/modules/by-name/do/documentation/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/fo/fonts/emoji_font.xml b/modules/by-name/fo/fonts/emoji_font.xml index f3f6bb3e..8a922f61 100644 --- a/modules/by-name/fo/fonts/emoji_font.xml +++ b/modules/by-name/fo/fonts/emoji_font.xml @@ -1,4 +1,17 @@ <?xml version="1.0"?> + +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <alias binding="weak"> diff --git a/modules/by-name/fo/fonts/module.nix b/modules/by-name/fo/fonts/module.nix index 057c3f36..f8752ae6 100644 --- a/modules/by-name/fo/fonts/module.nix +++ b/modules/by-name/fo/fonts/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/fw/fwupd/module.nix b/modules/by-name/fw/fwupd/module.nix index 5ad4f467..0c4a7bf3 100644 --- a/modules/by-name/fw/fwupd/module.nix +++ b/modules/by-name/fw/fwupd/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/gi/git/aliases.nix b/modules/by-name/gi/git/aliases.nix index 96456bea..bc30ea40 100644 --- a/modules/by-name/gi/git/aliases.nix +++ b/modules/by-name/gi/git/aliases.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, defaultBranchName, diff --git a/modules/by-name/gi/git/git_ignore.git.license b/modules/by-name/gi/git/git_ignore.git.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/gi/git/git_ignore.git.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/gi/git/git_template.git.license b/modules/by-name/gi/git/git_template.git.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/gi/git/git_template.git.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/gi/git/module.nix b/modules/by-name/gi/git/module.nix index 8e413e8a..a70c38d7 100644 --- a/modules/by-name/gi/git/module.nix +++ b/modules/by-name/gi/git/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/home.legacy/conf/gpg/keys/key_1.asc b/modules/by-name/gp/gpg/keys/key_1.asc index 795f82af..f29184d8 100644 --- a/modules/home.legacy/conf/gpg/keys/key_1.asc +++ b/modules/by-name/gp/gpg/keys/key_1.asc @@ -1,3 +1,13 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + -----BEGIN PGP PUBLIC KEY BLOCK----- Comment: 8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26 Comment: Benedikt Peetz <benedikt.peetz@b-peetz.de> diff --git a/modules/home.legacy/conf/gpg/keys/key_2.asc b/modules/by-name/gp/gpg/keys/key_2.asc index 47188da7..7433a3f2 100644 --- a/modules/home.legacy/conf/gpg/keys/key_2.asc +++ b/modules/by-name/gp/gpg/keys/key_2.asc @@ -1,3 +1,13 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + -----BEGIN PGP PUBLIC KEY BLOCK----- Comment: 2FEA 7BDB 9171 70A7 B8E7 2001 DF18 78E6 D9C3 B27F Comment: Silas <sils@sils.li> diff --git a/modules/by-name/gp/gpg/module.nix b/modules/by-name/gp/gpg/module.nix new file mode 100644 index 00000000..d5136e92 --- /dev/null +++ b/modules/by-name/gp/gpg/module.nix @@ -0,0 +1,93 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +# TODO: Migrate to squoia-sq <2025-04-25> +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.soispha.programs.gpg; + homeConfig = config.home-manager.users.soispha; +in { + options.soispha.programs.gpg = { + enable = lib.mkEnableOption "gpg"; + }; + + config = lib.mkIf cfg.enable { + soispha.programs.qutebrowser.key = "8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26"; + + home-manager.users.soispha = { + programs.gpg = { + enable = true; + homedir = "${homeConfig.xdg.dataHome}/gnupg"; + mutableKeys = true; + mutableTrust = true; + + settings = { + default-key = "Benedikt Peetz <benedikt.peetz@b-peetz.de>"; + # TODO: add more + }; + + publicKeys = [ + { + source = ./keys/key_1.asc; + trust = "ultimate"; + } + { + source = ./keys/key_2.asc; + trust = "full"; + } + ]; + }; + + services = { + gpg-agent = { + enable = true; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + + # Cache the key passwords + defaultCacheTtl = 60 * 50; + defaultCacheTtlSsh = 60 * 50; + maxCacheTtl = 60 * 50; + maxCacheTtlSsh = 60 * 50; + + pinentry = { + package = pkgs.pinentry-curses; + # package = pkgs.pinentry-tty; + }; + + enableSshSupport = true; + sshKeys = let + removeSpace = str: builtins.replaceStrings [" "] [""] str; + in [ + (removeSpace "8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26") + ]; + }; + }; + }; + + soispha.programs.zsh.integrations.gpg = '' + export GPG_TTY=$(tty) + + # Magic copied from the gpg-agent manual + unset SSH_AGENT_PID + if [ "''${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + fi + + + # Ensure that get gpg agent is started (necessary because ssh does not start it + # automatically and has it's tty updated) + gpg-connect-agent /bye + ''; + }; +} diff --git a/modules/by-name/ha/hardware/module.nix b/modules/by-name/ha/hardware/module.nix index 850416b7..599f5d23 100644 --- a/modules/by-name/ha/hardware/module.nix +++ b/modules/by-name/ha/hardware/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ho/home-manager/module.nix b/modules/by-name/ho/home-manager/module.nix index f5304170..d7eccbd6 100644 --- a/modules/by-name/ho/home-manager/module.nix +++ b/modules/by-name/ho/home-manager/module.nix @@ -1,22 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, - pkgsStable, - nixpkgs_open_prs, - sysLib, - # extra information system, - # bins - # TODO: Integrate these <2024-05-22> - river_init_lesser, - shell_library, - qmk_firmware, - # external deps - user_js, - # modules - impermanence, - nix-index-database, - nixVim, + modules, ... }: let cfg = config.soispha.home-manager; @@ -25,6 +20,10 @@ in { enable = lib.mkEnableOption "home-manager with custom config."; }; + imports = [ + modules.home-manager.nixosModules.home-manager + ]; + # TODO: Find a way to throw this error below, when a user `enable`s a home-manager # module, but not this module. Without having to plaster all the `home-manager` modules # with `assert`s. <2024-10-18> @@ -33,24 +32,12 @@ in { home-manager = { useGlobalPkgs = true; useUserPackages = true; + + # TODO(@bpeetz): Remove this once the legacy -> by-name migration is done. <2025-05-16> users.soispha = import ../../../home.legacy; extraSpecialArgs = { inherit - nixpkgs_open_prs - pkgsStable - sysLib - # extra information system - # bins - river_init_lesser - shell_library - qmk_firmware - # external deps - user_js - # modules - impermanence - nixVim - nix-index-database ; }; }; diff --git a/modules/by-name/i3/i3bar-river/module.nix b/modules/by-name/i3/i3bar-river/module.nix new file mode 100644 index 00000000..8a2203aa --- /dev/null +++ b/modules/by-name/i3/i3bar-river/module.nix @@ -0,0 +1,197 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.i3bar-river; + + toColor = color: + if builtins.isString color + then lib.trivial.fromHexString color + else color; + + substractColor = color_a: color_b: let + saturatingSub = a: b: + if a < b + then 0 + else a - b; + in { + red = saturatingSub color_a.red color_b.red; + green = saturatingSub color_a.green color_b.green; + blue = saturatingSub color_a.blue color_b.blue; + alpha = saturatingSub color_a.alpha color_b.alpha; + inherit (color_a) __toString; + }; + + colorOption = red: green: blue: alpha: + lib.mkOption { + type = lib.types.submodule { + options = { + red = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of red in this color"; + default = toColor red; + }; + green = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of green in this color"; + default = toColor green; + }; + blue = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of blue in this color"; + default = toColor blue; + }; + alpha = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of alpha in this color"; + default = toColor alpha; + }; + + __toString = lib.mkOption { + internal = true; + + default = self: let + tH = num: let + converted = lib.trivial.toHexString num; + in + if builtins.stringLength converted == 1 + then "0${converted}" + else assert (builtins.stringLength converted) == 2; converted; + + output = "#${tH self.red}${tH self.green}${tH self.blue}${tH self.alpha}"; + in + output; + + description = "Convert this type to a string before use"; + }; + }; + }; + + default = { + red = toColor red; + green = toColor green; + blue = toColor blue; + alpha = toColor alpha; + }; + + description = "The specific color to use for this name."; + }; +in { + options.soispha.programs.i3bar-river = { + enable = lib.mkEnableOption "i3bar-river"; + + package = lib.mkPackageOption pkgs "i3bar-river-patched" {}; + + colors = { + none = colorOption 00 00 00 00; + + white = colorOption "ff" "ff" "ff" "ff"; + + blue = colorOption "99" "d1" "db" "ff"; + green = colorOption "a6" "e3" "a1" "dd"; + lavendar = colorOption "b4" "be" "fe" "dd"; + mauve = colorOption "cb" "a6" "f7" "dd"; + normal = colorOption "c6" "ce" "ef" "ff"; + peach = colorOption "fa" "b3" "87" "dd"; + sapphire = colorOption "74" "c7" "ec" "dd"; + teal = colorOption "94" "e2" "d5" "dd"; + + light_gray = colorOption "58" "5b" "70" "ff"; + gray = colorOption "45" "47" "5a" "ff"; + dark_gray = colorOption "30" "34" "46" "ff"; + bright_red = colorOption "e7" "82" "84" "ff"; + + vivid_burgundy = colorOption "9f" "1d" "35" "ff"; + + unfocused_offset = colorOption "33" "33" "33" "00"; + }; + }; + + config = lib.mkIf cfg.enable { + soispha.programs.river.init.backgroundStart = [cfg.package]; + + home-manager.users.soispha = { + programs.i3bar-river = { + enable = true; + inherit (cfg) package; + + settings = { + theme = { + focused = { + # Colors + background = toString cfg.colors.none; + color = toString cfg.colors.white; # Only used, if blocks do not specify one + separator = toString cfg.colors.vivid_burgundy; + + # Tag is set (but not focused or urgent) + tag_fg = toString cfg.colors.white; + tag_bg = toString cfg.colors.light_gray; + + tag_urgent_fg = toString cfg.colors.white; + tag_urgent_bg = toString cfg.colors.bright_red; + + tag_focused_fg = toString cfg.colors.white; + tag_focused_bg = toString cfg.colors.teal; + + tag_inactive_fg = toString cfg.colors.white; + tag_inactive_bg = toString cfg.colors.none; + + # Shop options + blend = true; # whether tags/blocks colors should blend with bar's background + hide_inactive_tags = false; + show_layout_name = false; + show_mode = true; + show_tags = true; + }; + + unfocused = { + hide_inactive_tags = true; + + color = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + separator = toString (substractColor cfg.colors.vivid_burgundy cfg.colors.unfocused_offset); + + tag_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_bg = toString (substractColor cfg.colors.light_gray cfg.colors.unfocused_offset); + + tag_urgent_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_urgent_bg = toString (substractColor cfg.colors.bright_red cfg.colors.unfocused_offset); + + tag_focused_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_focused_bg = toString cfg.colors.vivid_burgundy; + + tag_inactive_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_inactive_bg = toString (substractColor cfg.colors.none cfg.colors.unfocused_offset); + }; + }; + + # The font and various sizes + font = "SauceCodePro Nerd Font Mono:pixelsize=26"; + height = 24; + margin_top = 10; + margin_bottom = 0; + margin_left = 0; + margin_right = 0; + separator_width = 0; + tags_r = 10.0; + tags_padding = 10.0; + tags_margin = 5.0; + blocks_r = 6.0; + blocks_overlap = 0.0; + + # Misc + position = "top"; # either "top" or "bottom" + layer = "overlay"; # one of "top", "overlay", "bottom" or "background" + invert_touchpad_scrolling = true; + start_hidden = false; # whether the bar is initially in the 'hidden' state + + # WM-specific options + wm.river = { + max_tag = 9; # Show only the first nine tags + }; + }; + }; + }; + }; +} diff --git a/modules/by-name/i3/i3status-rust/module.nix b/modules/by-name/i3/i3status-rust/module.nix new file mode 100644 index 00000000..5bd911d8 --- /dev/null +++ b/modules/by-name/i3/i3status-rust/module.nix @@ -0,0 +1,152 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.i3status-rust; + + mkScript = name: deps: + lib.getExe (pkgs.writeShellApplication { + inherit name; + text = builtins.readFile ./scripts/${name}; + + inheritPath = false; + runtimeInputs = deps; + }); +in { + options.soispha.programs.i3status-rust = { + enable = lib.mkEnableOption "i3status-rust"; + + package = lib.mkPackageOption pkgs "i3status-rust-patched" {}; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + programs.i3status-rust = { + enable = true; + inherit (cfg) package; + + bars.default = { + settings = { + icons = { + icons = "material-nf"; + + overrides = { + cpu = [ + "" # nf-md-memory + ]; + memory_mem = ""; # nf-fa-bars + }; + }; + + theme = { + theme = "slick"; + + overrides = { + separator = "native"; + alternating_tint_bg = "none"; + alternating_tint_fg = "none"; + }; + }; + }; + + blocks = [ + { + block = "time"; + format = " $timestamp.datetime(format:'%d/%m/%y (%a) %H:%M %:z') "; + interval = 60; + } + + { + # TODO(@bpeetz): Switch to “music” when mpd gets mpris support <2025-05-20> + block = "custom"; + interval = "once"; + persistent = true; + command = mkScript "mpd_song_name.sh" [pkgs.mpc pkgs.coreutils]; + hide_when_empty = true; + shell = "${lib.getExe pkgs.dash}"; + format = " $text.str(max_width:60,rot_interval:0.5) "; + } + + { + block = "sound"; + driver = "pulseaudio"; + headphones_indicator = true; + } + + # System info + { + block = "cpu"; + } + { + block = "memory"; + format = " $icon $mem_used_percents {($swap_used_percents.eng(range:1..)) | }"; + } + { + block = "amd_gpu"; + format = " $icon $utilization (^icon_memory_mem $vram_used_percents) "; + } + + { + block = "net"; + format = " ^icon_net_down $speed_down.eng(prefix:Ki) ^icon_net_up $speed_up.eng(prefix:Ki) "; + } + { + block = "privacy"; + driver = [ + {name = "v4l";} + {name = "pipewire";} + ]; + } + + { + block = "disk_space"; + path = "/srv"; + info_type = "used"; + format = " $icon $used.eng(prefix:Gi) ($percentage) "; + backend = "btrfs"; + + # warn if 80 % is used, alert after 90 % used. + warning = 80; + alert = 90; + } + { + block = "backlight"; + missing_format = ""; + } + { + block = "battery"; + missing_format = ""; + } + + # { + # block = "calendar"; + # + # source = { + # calendars = ["user/calendar"]; + # auth = { + # type = "unauthenticated"; + # }; + # }; + # } + # { + # block = "focused_window"; + # driver = "wlr_toplevel_management"; + # } + # { + # block = "maildir"; + # display_type = "new"; + # inboxes = ["~/.local/share/maildir/soispha/*"]; + # interval = 60; + # threshold_critical = 10; + # threshold_warning = 1; + # } + ]; + }; + }; + + programs.i3bar-river.settings.command = "${lib.getExe cfg.package} config-default.toml"; + }; + }; +} diff --git a/modules/by-name/i3/i3status-rust/scripts/mpd_song_name.sh b/modules/by-name/i3/i3status-rust/scripts/mpd_song_name.sh new file mode 100755 index 00000000..28921520 --- /dev/null +++ b/modules/by-name/i3/i3status-rust/scripts/mpd_song_name.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +while true; do + state="$(mpc status '%state%')" + + if [ "$state" = "playing" ]; then + song="$(mpc --format '[[%artist% - ]%title%]|[%file%]' current)" + progress="$(mpc status "%currenttime%/%totaltime%")" + + echo "$song :: $progress" + else + # The song has stopped, we are done displaying it. + echo "" + + # Wait for a new song. (Or in this case for a new event.) + mpc idle + fi + + sleep 1 +done + +# vim: ft=sh diff --git a/modules/by-name/im/impermanence/module.nix b/modules/by-name/im/impermanence/module.nix index 9c289346..e31cfaaf 100644 --- a/modules/by-name/im/impermanence/module.nix +++ b/modules/by-name/im/impermanence/module.nix @@ -1,6 +1,16 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, + modules, ... }: let cfg = config.soispha.impermanence; @@ -23,6 +33,10 @@ in { }; }; + imports = [ + modules.impermanence.nixosModules.impermanence + ]; + config = lib.mkIf cfg.enable { environment.persistence = { "/srv" = { @@ -39,11 +53,9 @@ in { ".local/state/wireplumber" ".config/Signal" - ".config/Element" ".config/iamb/profiles" ".cache" - ".mozilla" "media" "repos" diff --git a/modules/by-name/im/imv/module.nix b/modules/by-name/im/imv/module.nix index 0a324e01..fdf95982 100644 --- a/modules/by-name/im/imv/module.nix +++ b/modules/by-name/im/imv/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/is/issue_file/module.nix b/modules/by-name/is/issue_file/module.nix index d8b6faa8..f9a7b58a 100644 --- a/modules/by-name/is/issue_file/module.nix +++ b/modules/by-name/is/issue_file/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, self, diff --git a/modules/by-name/la/laptop/module.nix b/modules/by-name/la/laptop/module.nix index f70230ad..dd8935b9 100644 --- a/modules/by-name/la/laptop/module.nix +++ b/modules/by-name/la/laptop/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/le/less/command.less.license b/modules/by-name/le/less/command.less.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/le/less/command.less.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/le/less/env.less.license b/modules/by-name/le/less/env.less.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/le/less/env.less.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/le/less/line-edit.less.license b/modules/by-name/le/less/line-edit.less.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/le/less/line-edit.less.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/le/less/module.nix b/modules/by-name/le/less/module.nix index f2475b73..0dd45a90 100644 --- a/modules/by-name/le/less/module.nix +++ b/modules/by-name/le/less/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/lf/lf/colors b/modules/by-name/lf/lf/colors index 1c2853ec..17201e64 100644 --- a/modules/by-name/lf/lf/colors +++ b/modules/by-name/lf/lf/colors @@ -60,11 +60,6 @@ fi 00 # FILE # links to hide ~/.mozilla 01;08;30 ~/.ssh 01;08;30 -~/.zshenv 01;08;30 - -~/.steampid 01;08;30 -~/.steam 01;08;30 -~/.steampath 01;08;30 # archives or compressed (dircolors defaults) *.tar 01;31 diff --git a/modules/by-name/lf/lf/colors.license b/modules/by-name/lf/lf/colors.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/lf/lf/colors.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/lf/lf/commands/base.sh b/modules/by-name/lf/lf/commands/base.sh new file mode 100755 index 00000000..99852c3e --- /dev/null +++ b/modules/by-name/lf/lf/commands/base.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck disable=SC2269 +id="$id" + +# Prompt the user for input. +# This will just _print_ the prompt, you still need to `read -r` the user's answer. +# +# # Type +# prompt :: String +# +# # Arguments +# $1 +# : The prompt to print for the user. +prompt() { + printf "=> %s" "$1" +} + +# Reads its Stdin into a temporary file and returns the path of the temporary file. +# This is only really useful, if you want to pipe something into an while read loop that +# should modify global variables. Piping directly into it will not work, because the shell +# would just run it in a subshell, so you need this workaround. +# +# # Type +# tmp :: <stdin> -> Path +# +# # Arguments +# +# # Examples +# while read -r file; do +# set -- "$@" "$file" +# done < "$(echo "$fx" | tmp)" +tmp() { + __base_tmp_temporary_file="$(mktemp --tmpdir="$__base_tmp_temporary_directory")" + cat >"$__base_tmp_temporary_file" + echo "$__base_tmp_temporary_file" +} +__base_tmp_temporary_directory="$(mktemp --directory)" +trap 'rm --recursive "$__base_tmp_temporary_directory"' EXIT + +# Run a lf command on the current lf client +# All arguments will run in like they were typed directly into lf. +# # TODO(@bpeetz): Escape the single quotes in the input arguments. <2025-02-02> +# +# # Type +# lf_cmd :: [String] +# +# # Arguments +# $1..$@ +# : The arguments composing the command to run. +lf_cmd() { + arguments="" + for arg in "$@"; do + if [ -z "$arguments" ]; then + arguments="'$arg'" + else + arguments="$arguments '$arg'" + fi + done + + lf -remote "send $id $arguments" +} + +# Print an error message and exit with error code 1. +# The error message will be printed to lf. +# +# # Type +# die :: String +# +# # Arguments +# $1 +# : The error message +die() { + lf_cmd echo "Error: $1" + exit 1 +} + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix index b3c9acab..f953834b 100644 --- a/modules/by-name/lf/lf/commands/default.nix +++ b/modules/by-name/lf/lf/commands/default.nix @@ -1,231 +1,155 @@ -{ - pkgs, - sysLib, - shell_library, - system, - ... -}: let +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{pkgs, ...}: let functionCall = { name, dependencies, - replacementStrings, - ... + keepPath ? false, }: - sysLib.writeShellScript { + pkgs.writeShellApplication { inherit name; - src = ./scripts/${name}.sh; - keepPath = true; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash coreutils;}); - inherit replacementStrings; + text = builtins.readFile ./base.sh + builtins.readFile ./scripts/${name}.sh; + runtimeInputs = [pkgs.lf pkgs.mktemp pkgs.coreutils] ++ dependencies; + inheritPath = keepPath; } + "/bin/${name}"; - shell = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' + # closes the lf tui + shell = args: '' ''${{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall args} }} - ''; # closes the lf tui - pipe = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' + ''; + # runs the command in the ui/term bar + pipe = args: '' %{{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall args} }} - ''; # runs the command in the ui/term bar - async = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' + ''; + # runs the command in the background + async = args: '' &{{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall args} }} - ''; # runs the command in the background - wait = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' + ''; + # adds a prompt after the command has run + wait = args: '' !{{ - ${functionCall {inherit name dependencies replacementStrings;}} + ${functionCall args} }} - ''; # adds a prompt after the command has run + ''; in { - archive = shell { - name = "archive"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - gnutar - xz - p7zip - zip - ; - }; - }; - broot_jump = shell { - name = "broot_jump"; - dependencies = builtins.attrValues { - inherit (pkgs) broot; - }; + archive_compress = shell { + name = "archive_compress"; + dependencies = with pkgs; [ + fzf + gnutar + xz + p7zip + zip + ]; + }; + archive_decompress = pipe { + name = "archive_decompress"; + dependencies = with pkgs; [ + gnutar + unzip + p7zip + ]; + }; + + cd_project_root = async { + name = "cd_project_root"; + dependencies = [pkgs.git]; }; + chmod = pipe { name = "chmod"; dependencies = []; }; - clear_trash = shell { - name = "clear_trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - trashy - ; - }; - }; - dl_file = pipe { - name = "dl_file"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - curl - ; - }; - }; + dragon = pipe { name = "dragon"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; + dependencies = [pkgs.dragon-drop]; }; dragon_individual = pipe { name = "dragon_individual"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; + dependencies = [pkgs.dragon-drop]; }; dragon_stay = pipe { name = "dragon_stay"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; + dependencies = [pkgs.dragon-drop]; }; + execute = shell { name = "execute"; dependencies = []; + keepPath = true; }; follow_link = pipe { name = "follow_link"; - dependencies = with pkgs; [lf]; - }; - fzf_jump = shell { - name = "fzf_jump"; - dependencies = builtins.attrValues { - inherit (pkgs) fzf lf gnused; - }; + dependencies = []; }; - mk_dir = pipe { - name = "mk_dir"; + + mk_directory = pipe { + name = "mk_directory"; dependencies = []; }; mk_file = shell { name = "mk_file"; dependencies = []; }; - mk_file_and_edit = shell { - name = "mk_file_and_edit"; + mk_link = pipe { + name = "mk_link"; dependencies = []; }; - mk_ln = pipe { - name = "mk_ln"; + mk_script = shell { + name = "mk_script"; dependencies = []; + keepPath = true; }; - mk_scr_default = shell { - name = "mk_scr_default"; - dependencies = builtins.attrValues {}; - replacementStrings = { - SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; - }; - }; - mk_scr_temp = shell { - name = "mk_scr_temp"; - dependencies = builtins.attrValues {}; - replacementStrings = { - SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; - TO_BE_SHELL_LIBRARY_PATH = "%SHELL_LIBRARY_PATH"; # replacement is not recursive - }; - }; - view_file = async { - name = "view_file"; - dependencies = builtins.attrValues {inherit (pkgs) file;}; - }; - go_project_base_directory = async { - name = "go_project_root"; - dependencies = []; - }; - restore_trash = shell { - name = "restore_trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - trashy - ; - }; - }; + set_clipboard_path = async { name = "set_clipboard_path"; dependencies = [pkgs.wl-clipboard]; }; - set_wall_paper = pipe { - name = "set_wall_paper"; - dependencies = []; + set_wallpaper = pipe { + name = "set_wallpaper"; + dependencies = with pkgs; [ + river # for `riverctl` + swaybg + procps + ]; }; + stripspace = pipe { name = "stripspace"; - dependencies = []; + dependencies = [pkgs.gnused]; }; + trash = pipe { name = "trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - trashy - trash-cli - findutils - ; - }; - }; - unarchive = pipe { - name = "unarchive"; - dependencies = builtins.attrValues { - inherit - (pkgs) - gnutar - unzip - p7zip - ; - }; + dependencies = [pkgs.trash-cli]; + }; + trash_clear = shell { + name = "trash_clear"; + dependencies = with pkgs; [conceal fzf gawk trashy gnused]; + }; + trash_restore = shell { + name = "trash_restore"; + dependencies = with pkgs; [conceal fzf gawk trashy gnused]; + }; + + view_file = async { + name = "view_file"; + dependencies = with pkgs; [file]; + keepPath = true; }; } diff --git a/modules/by-name/lf/lf/commands/run.sh b/modules/by-name/lf/lf/commands/run.sh new file mode 100755 index 00000000..06106aed --- /dev/null +++ b/modules/by-name/lf/lf/commands/run.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# Run one of the commands for debugging purposes. + +[ "$#" -gt 1 ] || { + echo "Usage: $0 <script_name> <input_files>.." + exit 2 +} + +script_name="./scripts/$1" +shift 1 + +fx="" +for arg in "$@"; do + if [ -z "$fx" ]; then + fx="$arg" + else + fx="$(printf "%s\n%s" "$fx" "$arg")" + fi +done + +export f="$1" +set -- + +# shellcheck source=/dev/null +. ./base.sh +# shellcheck source=/dev/null +. "$script_name" + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive.sh b/modules/by-name/lf/lf/commands/scripts/archive.sh deleted file mode 100755 index 25f40534..00000000 --- a/modules/by-name/lf/lf/commands/scripts/archive.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# Option '-f' disables pathname expansion which can be useful when $f, $fs, and -# $fx variables contain names with '*' or '?' characters. However, this option -# is used selectively within individual commands as it can be limiting at -# times. -set -f - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" - -archivers="$(tmp echo gzip xz 7z zip)" -archiver="$(awk '{for (i=1; i<=NF; i++) print $i}' "$archivers" | fzf)" - -case "$archiver" in -"gzip") - ext=tar.gz - ;; -"xz") - ext=tar.xz - ;; -"7z") - ext=7z - ;; -"zip") - ext=zip - ;; -esac - -prompt "Archive name: " -name="" -while [ -z "$name" ] || [ -e "$name" ]; do - read -r name_base - name="$name_base.$ext" - if [ -e "$name" ]; then - prompt "Archive already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "Archive name: " - fi - fi -done - -root="$(if [ "$(pwd)" = "/" ]; then pwd; else echo "$(pwd)/"; fi)" - -# fx contains all selected file name separated by a newline -while read -r raw_file; do - file="$(echo "$raw_file" | sed "s|$root||")" - set -- "$@" "$file" -done <"$(tmp echo "$fx")" - -case "$archiver" in -"gzip") - tar --create --gzip -file="$name" "$@" - ;; -"xz") - tar --create --file="$name" "$@" - xz --compress -9 --extreme --threads=0 "$name" - ;; -"7z") - 7z a "$name" "$@" - ;; -"zip") - zip --symlinks -9 -r "$name" "$@" - ;; -esac -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive_compress.sh b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh new file mode 100755 index 00000000..b42688bf --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh @@ -0,0 +1,73 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" + +archiver="$(printf "%s\n" gzip xz 7z zip | fzf)" + +case "$archiver" in +"gzip") + ext=tar.gz + ;; +"xz") + ext=tar.xz + ;; +"7z") + ext=7z + ;; +"zip") + ext=zip + ;; +esac + +prompt "Archive name: " +name="" +while [ -z "$name" ] || [ -e "$name" ]; do + read -r name_base + name="$name_base.$ext" + if [ -e "$name" ]; then + prompt "Archive already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "New Archive name: " + fi + fi +done + +# fx contains all selected file name separated by a newline +while read -r file; do + set -- "$@" "$(realpath --relative-to="$(pwd)" "$file")" +done <"$(echo "$fx" | tmp)" + +case "$archiver" in +"gzip") + tar --create --gzip --file="$name" "$@" + ;; +"xz") + tar --create "$@" | xz --compress -9 --format=xz --extreme --threads=0 --stdout >"$name" + ;; +"7z") + 7z a "$name" "$@" + ;; +"zip") + zip --symlinks -9 --recurse-paths "$name" "$@" + ;; +esac +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh new file mode 100755 index 00000000..11d634b1 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh @@ -0,0 +1,33 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +echo "$fx" | while read -r file; do + case "$file" in + *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar --extract --bzip2 --verbose --file="$file" ;; + *.tar.gz | *.tgz) tar --extract --gzip --verbose --file="$file" ;; + *.tar.xz | *.txz) tar --extract --xz --verbose --file="$file" ;; + *.tar*) tar --extract --verbose --file="$file" ;; + *.zip) unzip "$file" ;; + *.7z) 7z x "$file" ;; + *) die "'$file' is not a supported file for unarchiving." ;; + esac +done +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/broot_jump.sh b/modules/by-name/lf/lf/commands/scripts/broot_jump.sh deleted file mode 100755 index 8f40ba01..00000000 --- a/modules/by-name/lf/lf/commands/scripts/broot_jump.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -tmp=$(mktmp) -res="$(broot --outcmd "$tmp" && sed 's/cd //' "$tmp")" - -if [ -f "$res" ]; then - cmd="select" -elif [ -d "$res" ]; then - cmd="cd" -fi - -lf -remote "send '$id' '$cmd' '$res'" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh b/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh new file mode 100755 index 00000000..c2de61e6 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh @@ -0,0 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +root="$(git rev-parse --show-toplevel)" +if [ "$root" ]; then + lf_cmd cd "$root" || die "Bug: Failed to cd to project root at '$root'" +else + die "Unable to locate base dir" +fi + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/chmod.sh b/modules/by-name/lf/lf/commands/scripts/chmod.sh index 9859127b..757f3c9c 100755 --- a/modules/by-name/lf/lf/commands/scripts/chmod.sh +++ b/modules/by-name/lf/lf/commands/scripts/chmod.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,13 +19,12 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -readp "Mode bits: " bits -# shellcheck disable=SC2269 -bits="$bits" +prompt "Mode bits: " +read -r bits -while read -r file; do +echo "$fx" | while read -r file; do chmod "$bits" "$file" -done <"$(tmp echo "$fx")" +done -lf -remote 'send reload' +lf_cmd reload # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/clear_trash.sh b/modules/by-name/lf/lf/commands/scripts/clear_trash.sh deleted file mode 100755 index 9052bb5f..00000000 --- a/modules/by-name/lf/lf/commands/scripts/clear_trash.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# could also use --force, for instand removal -trash list | fzf --multi | awk '{print $NF}' | xargs trash empty --match=exact -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/cow_cp.sh b/modules/by-name/lf/lf/commands/scripts/cow_cp.sh index 98675b9e..dbe00654 100755 --- a/modules/by-name/lf/lf/commands/scripts/cow_cp.sh +++ b/modules/by-name/lf/lf/commands/scripts/cow_cp.sh @@ -1,5 +1,15 @@ #!/usr/bin/env bash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/lf/lf/commands/scripts/dl_file.sh b/modules/by-name/lf/lf/commands/scripts/dl_file.sh deleted file mode 100755 index c7e3d8b2..00000000 --- a/modules/by-name/lf/lf/commands/scripts/dl_file.sh +++ /dev/null @@ -1,43 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -# Provides the ability to download a file by dropping it into a window - -url="$(dragon -t -x)" - -if [ -n "$url" ]; then - prompt "File Name: " - name="" - while [ -z "$name" ] || [ -e "$name" ]; do - read -r name - if [ -e "$name" ]; then - prompt "File already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "File Name: " - fi - fi - done - - # Download the file with curl - if [ -n "$name" ]; then - curl -o "$name" "$url" || die "curl failed" - fi -else - die "URL is null!" -fi -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dragon.sh b/modules/by-name/lf/lf/commands/scripts/dragon.sh index cf3c3176..a4a52c72 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,7 +21,7 @@ id="$id" while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" +done <"$(echo "$fx" | tmp)" -dragon -a -x "$@" +dragon-drop --all --and-exit "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh index 2465cdfa..370e9753 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,7 +21,7 @@ id="$id" while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" +done <"$(echo "$fx" | tmp)" -dragon "$@" +dragon-drop "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh index 066b4c75..86a19370 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,7 +21,7 @@ id="$id" while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" +done <"$(echo "$fx" | tmp)" -dragon -a "$@" +dragon-drop --all "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/execute.sh b/modules/by-name/lf/lf/commands/scripts/execute.sh index aa97fd7f..ce62dfa0 100755 --- a/modules/by-name/lf/lf/commands/scripts/execute.sh +++ b/modules/by-name/lf/lf/commands/scripts/execute.sh @@ -1,7 +1,14 @@ -#!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/commands/scripts/follow_link.sh b/modules/by-name/lf/lf/commands/scripts/follow_link.sh index 80413990..71fa6825 100755 --- a/modules/by-name/lf/lf/commands/scripts/follow_link.sh +++ b/modules/by-name/lf/lf/commands/scripts/follow_link.sh @@ -1,7 +1,14 @@ -#!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,6 +21,12 @@ id="$id" dir="$(realpath "$f")" -lf -remote "send $id cd \"$dir\"" +if [ -f "$dir" ]; then + cmd="select" +elif [ -d "$dir" ]; then + cmd="cd" +fi + +lf_cmd "$cmd" "$dir" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh b/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh deleted file mode 100755 index ad1633fb..00000000 --- a/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -res="$(fd . --maxdepth 3 | fzf --header='Jump to location')" - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -if [ -f "$res" ]; then - cmd="select" -elif [ -d "$res" ]; then - cmd="cd" -fi - -lf -remote "send $id $cmd \"$res\"" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/go_project_root.sh b/modules/by-name/lf/lf/commands/scripts/go_project_root.sh deleted file mode 100755 index 5f7746d3..00000000 --- a/modules/by-name/lf/lf/commands/scripts/go_project_root.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -flake_base_dir="$(search_flake_base_dir)" -if [ "$flake_base_dir" ]; then - lf -remote "send $id cd $flake_base_dir" || die "Bug: No base dir ($flake_base_dir)" -else - die "Unable to locate base dir" -fi - -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_dir.sh b/modules/by-name/lf/lf/commands/scripts/mk_directory.sh index 150f7eed..f3bd6d29 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_dir.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_directory.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -23,7 +30,7 @@ while [ -z "$name" ] || [ -e "$name" ]; do if [ "$ans" = "y" ]; then break else - prompt "Directory Name: " + prompt "New Directory Name: " fi fi done diff --git a/modules/by-name/lf/lf/commands/scripts/mk_file.sh b/modules/by-name/lf/lf/commands/scripts/mk_file.sh index 41d5cf1a..78271aaa 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_file.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -23,7 +30,7 @@ while [ -z "$name" ] || [ -e "$name" ]; do if [ "$ans" = "y" ]; then break else - prompt "File name: " + prompt "New File name: " fi fi done diff --git a/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh b/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh deleted file mode 100755 index 19fc51db..00000000 --- a/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -prompt "File name: " -name="" -while [ -z "$name" ] || [ -e "$name" ]; do - read -r name - if [ -e "$name" ]; then - prompt "File already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "File name: " - fi - fi -done - -touch "$name" -"$EDITOR" "$name" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_ln.sh b/modules/by-name/lf/lf/commands/scripts/mk_link.sh index 7fab8e22..35f49c38 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_ln.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_link.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -14,20 +21,19 @@ id="$id" while IFS= read -r i; do set -- "$@" "$i" -done <"$HOME"/.local/share/lf/files +done <"$HOME/.local/share/lf/files" mode="$1" shift if [ "$#" -eq 0 ]; then - msg "no files to link" + lf_cmd echo "No files to link." exit 0 fi case "$mode" in copy) - while [ "$#" -gt 0 ]; do - file="$1" + for file in "$@"; do ans="$(basename "$file")" while [ -e "$ans" ]; do @@ -36,10 +42,10 @@ copy) done ln --symbolic --relative "$file" "$(pwd)/$ans" - shift done ;; esac -rm ~/.local/share/lf/files +rm "$HOME/.local/share/lf/files" # lf -remote "send clear" + # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh b/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh deleted file mode 100755 index 47d05080..00000000 --- a/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -prompt "Script name: " -name="" -while [ -z "$name" ] || [ -e "$name" ]; do - read -r name_base - name="$name_base.sh" - if [ -e "$name" ]; then - prompt "Script already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "Script Name: " - fi - fi -done - -script="$(pwd)"/"$name" - -cat "%SHELL_LIBRARY_TEMPLATE" >"$script" -chmod +x "$script" -"$VISUAL" "$script" - -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh b/modules/by-name/lf/lf/commands/scripts/mk_script.sh index 512b5d0b..a708825d 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_script.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -23,15 +30,21 @@ while [ -z "$name" ] || [ -e "$name" ]; do if [ "$ans" = "y" ]; then break else - prompt "Script Name: " + prompt "New Script Name: " fi fi done -script="$(pwd)"/"$name" +script="$(pwd)/$name" + +cat <<SCRIPT >"$script" +#! /usr/bin/env sh + + + +# vim: ft=sh +SCRIPT -sed 's|%TO_BE_SHELL_LIBRARY_PATH|%SHELL_LIBRARY_PATH|' "%SHELL_LIBRARY_TEMPLATE" >"$script" -sed -i 's|dash|sh|' "$script" chmod +x "$script" "$VISUAL" "$script" diff --git a/modules/by-name/lf/lf/commands/scripts/restore_trash.sh b/modules/by-name/lf/lf/commands/scripts/restore_trash.sh deleted file mode 100755 index b4ef492f..00000000 --- a/modules/by-name/lf/lf/commands/scripts/restore_trash.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -trash list | fzf --multi | awk '{print $NF}' | xargs trash restore --match=exact -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh b/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh index ff5f3c01..f4cb5115 100755 --- a/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh +++ b/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -17,10 +24,10 @@ if [ -n "$fx" ]; then elif [ -n "$f" ]; then echo "$f" | wl-copy --trim-newline else - lf -remote "send $id echo 'No file selected.'" + lf_cmd echo "No file selected." exit 1 fi -lf -remote "send $id echo 'Path copied'" +lf_cmd echo "Path copied to clipboard." # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh b/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh deleted file mode 100755 index 2e607d33..00000000 --- a/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -die "No yet implemented" # TODO: do what the 'die' says -#sed -i "s,export AWMWALLPAPER='.*',export AWMWALLPAPER='${f}'," ${ZDOTDIR}/.zshenv -#nohub swaybg -i "$f" -#feh --bg-max --no-fehbg "$f" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh b/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh new file mode 100755 index 00000000..6311031e --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh @@ -0,0 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +# Kill all previous instances +pkill swaybg + +# We cannot control the available commands for river. +# Thus we ensure that it can correctly start `swaybg` +swaybg="$(command -v swaybg)" +riverctl spawn "$swaybg --image \"$f\"" && lf_cmd echo "Temporary background image set." +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/stripspace.sh b/modules/by-name/lf/lf/commands/scripts/stripspace.sh index 33b1cbcf..9253b6de 100755 --- a/modules/by-name/lf/lf/commands/scripts/stripspace.sh +++ b/modules/by-name/lf/lf/commands/scripts/stripspace.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,29 +19,14 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -files=$(mktmp) -echo "$fx" >"$files" +echo "$fx" | while read -r file; do + dirty_name=$(basename "$file") + clean_name=$(echo "$dirty_name" | sed 's/[[:blank:]]\+/_/g' | sed 's/\(.*\)/\L\1/') -awk_source=$(mktmp) -cat <<OFT >"$awk_source" -BEGIN {FS=" "} -{for (i=1; i != NF + 1; i++) - if (i == NF) { - parts[i]=tolower(\$i); - } else { - parts[i]=tolower(\$i"_"); - } -} -END {for (i in parts) printf parts[i]} -OFT + [ -e "$clean_name" ] && die "file '$clean_name' already exists!" + mv "$dirty_name" "$clean_name" || die "Move failed" -while read -r file; do - dirty_name=$(mktmp) - basename "$file" >"$dirty_name" - clean_name=$(awk -f "$awk_source" "$dirty_name") - - [ -e "$clean_name" ] && die "file \"$clean_name\" already exists!" - mv "$(cat "$dirty_name")" "$clean_name" || die "Move failed" - lf -remote 'send reload' -done <"$files" + lf_cmd reload + lf_cmd select "$clean_name" +done # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash.sh b/modules/by-name/lf/lf/commands/scripts/trash.sh index f4878c49..68b36774 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash.sh @@ -1,7 +1,14 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,26 +19,9 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -trash_output=$(mktmp) -expected_error_output=$(mktmp) - while read -r file; do set -- "$@" "$file" -done <"$(tmp echo "$fx")" - -# TODO: why are we using trashy at all, when trash-cli can do everything? -# -# try trashy first, through nix because both trashy and trash-cli provide a trash command, which conflicts -nix run nixpkgs#trashy -- put "$@" 2>"$trash_output" - -# FIXME: Find a way, that does not depend on parsing an error message <2023-08-29> -cat <<EOF >"$expected_error_output" -[1;31merror:[0m Error during a \`trash\` operation: Unknown { description: "Path: '\"/.Trash-1000\"'. Message: Permission denied (os error 13)" } -EOF +done <"$(echo "$fx" | tmp)" -if [ "$(cat "$expected_error_output")" = "$(cat "$trash_output")" ]; then - warning "Deleting with trash-cli to the /.Trash folder" - # this file could not be trashed because it is on the tempfs volume, trash-cli can do this this - trash-put "$@" -fi +trash-put -- "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh new file mode 100755 index 00000000..597995f9 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh @@ -0,0 +1,19 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh + +while IFS="$(printf '\n')" read -r file; do + set -- "$@" "$(pwd)/$file" +done <"$(conceal list | fzf --multi --ansi | awk '{$1="";$2=""; print $0}' | sed 's/^\s*//' | tmp)" + +[ "$#" -ne 0 ] && trash empty --match=exact "$@" + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh new file mode 100755 index 00000000..7b078c26 --- /dev/null +++ b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh @@ -0,0 +1,27 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck shell=sh + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +fx="$fx" +# shellcheck disable=SC2269 +fs="$fs" +# shellcheck disable=SC2269 +id="$id" + +while IFS="$(printf '\n')" read -r file; do + set -- "$@" "$(pwd)/$file" +done <"$(conceal list | fzf --multi --ansi | awk '{$1="";$2=""; print $0}' | sed 's/^\s*//' | tmp)" + +[ "$#" -ne 0 ] && trash restore --match=exact "$@" +# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/unarchive.sh b/modules/by-name/lf/lf/commands/scripts/unarchive.sh deleted file mode 100755 index d4835f6b..00000000 --- a/modules/by-name/lf/lf/commands/scripts/unarchive.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -# extract the current file with the right command -# (xkcd link: https://xkcd.com/1168/) -set -f - -unarchive() { - case "$1" in - *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar xjvf "$1" ;; - *.tar.gz | *.tgz) tar xzvf "$1" ;; - *.tar.xz | *.txz) tar xJvf "$1" ;; - *.zip) unzip "$1" ;; - *.rar) - die "rar is a unfree format!" - ;; - *.7z) 7z x "$1" ;; - *) die "Unsupported format" ;; - esac -} - -while read -r file; do - unarchive "$file" -done <"$fx" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/view_file.sh b/modules/by-name/lf/lf/commands/scripts/view_file.sh index 6258d755..48cdd85e 100755 --- a/modules/by-name/lf/lf/commands/scripts/view_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/view_file.sh @@ -1,7 +1,14 @@ -#!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=sh # shellcheck disable=SC2269 f="$f" @@ -12,7 +19,7 @@ fs="$fs" mime_type="$(file --mime-type --brief --dereference "$f")" case "$mime_type" in -application/pdf) +application/pdf | application/epub*) "$READER" "$f" ;; image/*) diff --git a/modules/by-name/lf/lf/ctpv/default.nix b/modules/by-name/lf/lf/ctpv/default.nix index 3748eca4..6f9988b9 100644 --- a/modules/by-name/lf/lf/ctpv/default.nix +++ b/modules/by-name/lf/lf/ctpv/default.nix @@ -1,5 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, lib, config, pkgs, @@ -8,15 +16,15 @@ functionCall = { name, dependencies, - replacementStrings, scriptPath, - ... + environment, }: - sysLib.writeShellScript { + pkgs.writeShellApplication { inherit name; - src = scriptPath; - keepPath = false; - inherit replacementStrings dependencies; + text = builtins.readFile ./helpers.sh + builtins.readFile scriptPath; + inheritPath = false; + runtimeInputs = dependencies; + runtimeEnv = environment; } + "/bin/${name}"; @@ -24,8 +32,8 @@ matches, priority, dependencies, - replacementStrings, previewer, + environment, }: let mkMimePath = val: let split = lib.strings.splitString "/" val; @@ -49,7 +57,7 @@ inherit name dependencies - replacementStrings + environment ; scriptPath = previewer; }; @@ -93,6 +101,12 @@ }; }; + environment = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = {}; + description = "Environment variables to set for the script"; + }; + previewer = lib.mkOption { type = lib.types.pathInStore; description = "The path to the preview script or binary"; @@ -104,13 +118,6 @@ default = 0; description = "The priority to use this previewer."; }; - replacementStrings = lib.mkOption { - type = lib.types.attrsOf (lib.types.either lib.types.str lib.types.pathInStore); - default = { - HELPERS = ./helpers.sh; - }; - description = "Arbitrary strings to replace in the shell script."; - }; dependencies = lib.mkOption { type = lib.types.listOf lib.types.package; default = []; @@ -153,17 +160,6 @@ in { package = lib.mkPackageOption pkgs "ctpv-64-types" {}; - # TODO: This is necessary, as the `./prev` dir is imported separately and as such - # cannot access the `./helpers.sh` file in it's parent directory. - # This separate import should ideally be removed. <2024-12-15> - helpers = lib.mkOption { - default = ./helpers.sh; - type = lib.types.pathInStore; - - internal = true; - readOnly = true; - }; - previewers = lib.mkOption { description = '' The previewers to add to the config file. diff --git a/modules/by-name/lf/lf/ctpv/helpers.sh b/modules/by-name/lf/lf/ctpv/helpers.sh index 6dc7fee6..71524082 100644 --- a/modules/by-name/lf/lf/ctpv/helpers.sh +++ b/modules/by-name/lf/lf/ctpv/helpers.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 cache_f="$cache_f" # shellcheck disable=SC2269 @@ -59,7 +69,7 @@ preview_xxd() { # This has been derived mathematically. octet_columns=$(((2 * w - 22) / 7)) - if [ -n "$CTPV_LESS_PREVIEWER" ]; then + if [ "${CTPV_LESS_PREVIEWER:-unset}" != "-unset" ]; then __base_xxd_preview "$1" else __base_xxd_preview "$1" -len "$((h * octet_columns))" diff --git a/modules/by-name/lf/lf/ctpv/prev/any.sh b/modules/by-name/lf/lf/ctpv/prev/any.sh index 38dfd538..01c31e2b 100644 --- a/modules/by-name/lf/lf/ctpv/prev/any.sh +++ b/modules/by-name/lf/lf/ctpv/prev/any.sh @@ -1,16 +1,23 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" # shellcheck disable=SC2269 -e="$e" +e="${e:-[missing extension]}" # shellcheck disable=SC2269 -m="$m" +m="${m:-[missing mime type]}" # shellcheck disable=SC2269 h="$h" @@ -19,8 +26,6 @@ extension="$e" # shellcheck disable=SC2269 mime="$m" -. %HELPERS - is_not_printable() { grep --text --quiet '[^[:print:]]' "$1" } @@ -33,8 +38,8 @@ case "$mime" in *) echo "(ctpv did not recognize this file, with extension: '$extension' and mime: '$mime')" - directory_storage="%STORAGE_DIRECTORY/$mime" - mkdir --parents "$(dirname "%STORAGE_DIRECTORY/$mime")" + directory_storage="$STORAGE_DIRECTORY/$mime" + mkdir --parents "$(dirname "$STORAGE_DIRECTORY/$mime")" printf "%s -- %s\n" "$f" "$extension" >>"$directory_storage" ;; diff --git a/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh b/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh index 5f4baac7..2bf8a89f 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh @@ -1,11 +1,16 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" -. %HELPERS - atool --list -- "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix index febacb7d..aee5c732 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { atool = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix index 00c7e389..121f419d 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { dll = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh b/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh index 678506eb..6ec68d55 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh @@ -1,19 +1,24 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" # shellcheck disable=SC2269 -e="$e" +e="${e:-[missing extension]}" # shellcheck disable=SC2269 -m="$m" +m="${m:-[missing mime type]}" # shellcheck disable=SC2269 h="$h" -. %HELPERS - preview_xxd "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix index 40510a78..d28503e2 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { epub = { @@ -5,11 +14,11 @@ matches.mime = ["application/epub+zip"]; matches.extension = ["epub"]; priority = 1; - dependencies = with pkgs; [ - bk - epub-thumbnailer - chafa - gnused + dependencies = [ + pkgs.bk + pkgs.epub-thumbnailer + pkgs.chafa + pkgs.gnused ]; }; }; diff --git a/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh b/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh index 703e7dad..87c33dff 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh @@ -1,23 +1,28 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" # shellcheck disable=SC2269 -e="$e" +e="${e:-[missing extension]}" # shellcheck disable=SC2269 -m="$m" +m="${m:-[missing mime type]}" # shellcheck disable=SC2269 h="$h" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - epub() { epub-thumbnailer "$f" "$cache_f" 20000 } diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix index d3061ea8..e30aab3e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { pdf = { @@ -8,6 +17,7 @@ pkgs.poppler_utils # for `pdftoppm` pkgs.chafa pkgs.gnused + pkgs.coreutils ]; }; }; diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh b/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh index 2f807b1a..2c2e5ff9 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - pdf() { pdftoppm -f 1 -l 1 \ -scale-to-x 1920 \ diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix index 32f42783..c9001176 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { pgp = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh b/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh index a4eefd96..cfe359ea 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh @@ -1,13 +1,18 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" -. %HELPERS - hide_script_env sq inspect --certifications -- "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix index 54b8c29e..ab200dd9 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { sqlite = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh index 07e77a93..2d3a45fe 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" -. %HELPERS - echo "SQLite database. Schema:" echo diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix index 504623a0..dfd6911b 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { torrent = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh index 16cfcbcd..38838d2e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh @@ -1,13 +1,18 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - transmission-show -- "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix new file mode 100644 index 00000000..fb82aa8a --- /dev/null +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix @@ -0,0 +1,20 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{pkgs, ...}: { + soispha.programs.lf.ctpv.previewers = { + pem = { + previewer = ./pem.sh; + matches.mime = ["application/x-pem-file"]; + dependencies = [ + pkgs.openssl + ]; + }; + }; +} diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh new file mode 100644 index 00000000..2948e25a --- /dev/null +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh @@ -0,0 +1,18 @@ +#! /usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# shellcheck disable=SC2269 +f="$f" +# shellcheck disable=SC2269 +cache_f="$cache_f" + +openssl x509 -in "$f" -text -noout diff --git a/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh b/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh index c5abc646..324a2170 100644 --- a/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh +++ b/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - audio() { ffmpegthumbnailer -i "$f" -s 0 -q 5 -t 10 -o "$cache_f" 2>/dev/null } diff --git a/modules/by-name/lf/lf/ctpv/prev/audio/default.nix b/modules/by-name/lf/lf/ctpv/prev/audio/default.nix index 0c60e9d5..7ae5d7fd 100644 --- a/modules/by-name/lf/lf/ctpv/prev/audio/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/audio/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { audio = { @@ -9,6 +18,7 @@ pkgs.chafa pkgs.gnused + pkgs.coreutils ]; }; }; diff --git a/modules/by-name/lf/lf/ctpv/prev/default.nix b/modules/by-name/lf/lf/ctpv/prev/default.nix index b59430f8..d7e420d0 100644 --- a/modules/by-name/lf/lf/ctpv/prev/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, @@ -10,18 +19,15 @@ in { previewer = ./any.sh; priority = -1; matches.mime = ["*/*"]; - replacementStrings = { - # FIXME: This declaration replaces the default (although it should be merged with - # the default value.) There must be a way, so that repeating the default values is - # not needed. <2024-12-15> - HELPERS = cfg.ctpv.helpers; - + environment = { STORAGE_DIRECTORY = "${cfg.ctpv.xdgDataHome}/ctpv/missing_previews"; }; dependencies = [ pkgs.tinyxxd # For xxd pkgs.bat + pkgs.gnugrep + pkgs.coreutils ]; }; }; diff --git a/modules/by-name/lf/lf/ctpv/prev/font/default.nix b/modules/by-name/lf/lf/ctpv/prev/font/default.nix index 306e7892..76a284f4 100644 --- a/modules/by-name/lf/lf/ctpv/prev/font/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/font/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { font = { @@ -13,6 +22,7 @@ pkgs.fontforge # for `fontimage` pkgs.chafa pkgs.gnused + pkgs.coreutils ]; }; }; diff --git a/modules/by-name/lf/lf/ctpv/prev/font/font.sh b/modules/by-name/lf/lf/ctpv/prev/font/font.sh index 4065557e..49e12ec7 100644 --- a/modules/by-name/lf/lf/ctpv/prev/font/font.sh +++ b/modules/by-name/lf/lf/ctpv/prev/font/font.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - font() { fontimage -o "$cache_f.png" "$f" 2>/dev/null && mv -- "$cache_f.png" "$cache_f" diff --git a/modules/by-name/lf/lf/ctpv/prev/image/default.nix b/modules/by-name/lf/lf/ctpv/prev/image/default.nix index 87fba00c..79037d5a 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/image/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { image = { diff --git a/modules/by-name/lf/lf/ctpv/prev/image/image.sh b/modules/by-name/lf/lf/ctpv/prev/image/image.sh index b5b97668..d021cbf6 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/image.sh +++ b/modules/by-name/lf/lf/ctpv/prev/image/image.sh @@ -1,11 +1,16 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" -. %HELPERS - send_image "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix index 90915c84..25bd6f77 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { svg = { diff --git a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh index 04a06f56..b16e4fc5 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh +++ b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - svg() { magick "$f" "jpg:$cache_f" } diff --git a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix index a3394ef4..5af6c501 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { xcf = { diff --git a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh index 1603e337..4ad4b34b 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh +++ b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - xcf() { # TODO: Add this (currently it fails, as gimp lacks the `python-fu` evaluator) <2024-11-25> true diff --git a/modules/by-name/lf/lf/ctpv/prev/inode/default.nix b/modules/by-name/lf/lf/ctpv/prev/inode/default.nix index eaade0f1..fe5ee3e1 100644 --- a/modules/by-name/lf/lf/ctpv/prev/inode/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/inode/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { ls = { diff --git a/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh b/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh index f73bd1c2..73e036eb 100644 --- a/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh +++ b/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh @@ -1,7 +1,14 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" @@ -10,6 +17,4 @@ cache_d="$cache_d" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - ls --color --group-directories-first -- "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh b/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh index b30957d0..2629f62a 100644 --- a/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh +++ b/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh @@ -1,13 +1,18 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" -. %HELPERS - # # do nothing because in src/ctpv.c some kind of a "preview" # is already printed diff --git a/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh b/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh index ec57da0b..ade1038e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh +++ b/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh @@ -1,7 +1,14 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" @@ -10,8 +17,6 @@ cache_d="$cache_d" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - doc() { # File produced by libreoffice jpg="$(printf '%s\n' "$f" | sed 's|^.*/||; s|\..*$||')" diff --git a/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix b/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix index 1407386b..6614fa8d 100644 --- a/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix +++ b/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { soispha.programs.lf.ctpv.extraConfigPre = '' remove any diff --git a/modules/by-name/lf/lf/ctpv/prev/text/bat.sh b/modules/by-name/lf/lf/ctpv/prev/text/bat.sh index be952aea..b20e9cea 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/bat.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/bat.sh @@ -1,13 +1,18 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" -. %HELPERS - preview_bat "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/text/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/default.nix index 14e74a4d..edb6e09d 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/text/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { glow = { diff --git a/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix index e0fa15bb..f21acd5e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { delta = { diff --git a/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh b/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh index 6a4e9a4e..d30565df 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh @@ -1,11 +1,16 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" -. %HELPERS - delta <"$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/text/glow.sh b/modules/by-name/lf/lf/ctpv/prev/text/glow.sh index 301fe675..2e8d9f58 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/glow.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/glow.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" -. %HELPERS - # Specify the style, to force `glow` to output colors. # tracking issue: https://github.com/charmbracelet/glow/issues/654 # We can't use `hide_script_env` because of some bespoke reason. (It just forces glow to diff --git a/modules/by-name/lf/lf/ctpv/prev/text/html/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/html/default.nix deleted file mode 100644 index 2a7a9a9f..00000000 --- a/modules/by-name/lf/lf/ctpv/prev/text/html/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - # TODO: I might want to use lynx/w3m instead <2024-11-24> - soispha.programs.lf.ctpv.previewers = { - elinks = { - previewer = ./elinks.sh; - priority = 1; - matches.mime = ["text/html"]; - dependencies = [ - pkgs.elinks - ]; - }; - }; -} diff --git a/modules/by-name/lf/lf/ctpv/prev/text/html/elinks.sh b/modules/by-name/lf/lf/ctpv/prev/text/html/elinks.sh deleted file mode 100644 index ca0de22e..00000000 --- a/modules/by-name/lf/lf/ctpv/prev/text/html/elinks.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -w="$w" - -. %HELPERS - -elinks \ - -dump 1 -dump-width "$w" \ - -no-references -no-numbering <"$f" - -# lynx -dump -nonumbers -nolist -width="$w" -- "$f" -# w3m -dump "$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix index 7e2ef090..9538c365 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { jq = { diff --git a/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh b/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh index bf807d1d..fa7c47b6 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh @@ -1,11 +1,16 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" -. %HELPERS - jq --color-output . <"$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/video/default.nix b/modules/by-name/lf/lf/ctpv/prev/video/default.nix index f38f61c7..d500fbd9 100644 --- a/modules/by-name/lf/lf/ctpv/prev/video/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/video/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { video = { diff --git a/modules/by-name/lf/lf/ctpv/prev/video/video.sh b/modules/by-name/lf/lf/ctpv/prev/video/video.sh index e42e3612..dac75205 100644 --- a/modules/by-name/lf/lf/ctpv/prev/video/video.sh +++ b/modules/by-name/lf/lf/ctpv/prev/video/video.sh @@ -1,15 +1,20 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 cache_f="$cache_f" -. %HELPERS - video() { ffmpegthumbnailer -i "$f" -o "$cache_f" -s 0 -t 50% 2>/dev/null } diff --git a/modules/by-name/lf/lf/icons.license b/modules/by-name/lf/lf/icons.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/lf/lf/icons.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index f624719f..d4c2a6a3 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { uid, downloadDir, @@ -36,21 +45,18 @@ cp = "set_clipboard_path"; # Archive Mappings - au = "unarchive"; - aa = "archive"; + au = "archive_decompress"; + aa = "archive_compress"; # Trash Mappings dd = "trash"; - jc = "clear_trash"; - jr = "restore_trash"; + jc = "trash_clear"; + jr = "trash_restore"; # Dragon Mapping dr = "dragon"; - ds = "dragon-stay"; - di = "dragon-individual"; - #dm = "mvdragon"; - #dc = "cpdragon"; - dl = "dlfile"; + ds = "dragon_stay"; + di = "dragon_individual"; cs = "stripspace"; @@ -68,17 +74,15 @@ y = "copy"; "<enter>" = "open"; - mk = "mk_ln"; + mk = "mk_link"; mf = "mk_file"; - me = "mk_file_and_edit"; - md = "mk_dir"; - ms = "mk_scr_default"; - mt = "mk_scr_temp"; + md = "mk_directory"; + ms = "mk_script"; ch = "chmod"; - bg = "set_wall_paper"; + bg = "set_wallpaper"; r = ":rename; cmd-end"; - H = "go_project_base_directory"; + H = "cd_project_root"; R = "reload"; C = "clear"; U = "unselect"; diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix index 6dc8e919..ea9970ef 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, @@ -10,6 +19,8 @@ commands = import ./commands {inherit pkgs sysLib shell_library system;}; keybindings = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; + packages = import ./wrappers {inherit pkgs;}; + cfg = config.soispha.programs.lf; in { imports = [ @@ -49,6 +60,11 @@ in { "lf/colors".source = ./colors; }; + programs.zsh.shellAliases = { + ll = ". ${lib.getExe packages.ll}"; + lm = ". ${lib.getExe packages.lm}"; + }; + programs.lf = { enable = true; @@ -75,7 +91,7 @@ in { icons = true; ifs = "\\n"; # internal field separator for shell commands #info = "size"; # show the size of a directory - shell = "sh"; + shell = "${lib.getExe pkgs.dash}"; shellopts = "-eu"; # e: exit on error; u: error for unset variables }; extraConfig = '' diff --git a/modules/by-name/lf/lf/wrappers/default.nix b/modules/by-name/lf/lf/wrappers/default.nix new file mode 100644 index 00000000..7257a66e --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/default.nix @@ -0,0 +1,4 @@ +{pkgs}: { + ll = pkgs.callPackage ./ll {}; + lm = pkgs.callPackage ./lm {}; +} diff --git a/modules/by-name/lf/lf/wrappers/ll/default.nix b/modules/by-name/lf/lf/wrappers/ll/default.nix new file mode 100644 index 00000000..6e4ee336 --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/ll/default.nix @@ -0,0 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{writeShellApplication}: +writeShellApplication { + name = "ll"; + text = builtins.readFile ./ll.sh; + + # This is sourced in the shell + inheritPath = true; + bashOptions = []; +} diff --git a/modules/by-name/lf/lf/wrappers/ll/ll.sh b/modules/by-name/lf/lf/wrappers/ll/ll.sh new file mode 100755 index 00000000..e012cffa --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/ll/ll.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +last_directory="$(mktemp)" +cleanup() { + rm "$last_directory" +} +trap cleanup EXIT + +command lf -last-dir-path="$last_directory" "$@" + +dir="$(cat "$last_directory")" +if cd "$dir"; then + [ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" + echo "$dir" >"$XDG_RUNTIME_DIR/ll/last_directory" +else + die "$dir does not exist!" +fi + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/wrappers/lm/default.nix b/modules/by-name/lf/lf/wrappers/lm/default.nix new file mode 100644 index 00000000..42bdc687 --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/lm/default.nix @@ -0,0 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{writeShellApplication}: +writeShellApplication { + name = "lm"; + text = builtins.readFile ./lm.sh; + + # This is sourced in the shell + inheritPath = true; + bashOptions = []; +} diff --git a/modules/by-name/lf/lf/wrappers/lm/lm.sh b/modules/by-name/lf/lf/wrappers/lm/lm.sh new file mode 100755 index 00000000..71213721 --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/lm/lm.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +die() { + echo "ERROR: $1" + exit 1 +} + +msg() { + echo "$1" +} + +if [ -f "$XDG_RUNTIME_DIR/ll/last_directory" ]; then + last_dir="$(cat "$XDG_RUNTIME_DIR/ll/last_directory")" + cd "$last_dir" || die "$last_dir does not exist!" +else + msg "No last directory saved (try using ll instead)." +fi +# vim: ft=sh diff --git a/modules/by-name/li/libvirtd/module.nix b/modules/by-name/li/libvirtd/module.nix index 5c519550..ba1cc2e1 100644 --- a/modules/by-name/li/libvirtd/module.nix +++ b/modules/by-name/li/libvirtd/module.nix @@ -1,4 +1,15 @@ -{pkgs, ...}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { + # FIXME(@bpeetz): Do something with this module. <2025-04-04> + # virtualisation = { # spiceUSBRedirection.enable = true; # TODO: this allows usb access to any user, which shouldn't be that bad # cores = 8; diff --git a/modules/by-name/lo/locale/keymaps/dvorak_modified.xkb.license b/modules/by-name/lo/locale/keymaps/dvorak_modified.xkb.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/lo/locale/keymaps/dvorak_modified.xkb.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/lo/locale/keymaps/us_modified.xkb b/modules/by-name/lo/locale/keymaps/us_modified.xkb deleted file mode 100644 index 6299a5e9..00000000 --- a/modules/by-name/lo/locale/keymaps/us_modified.xkb +++ /dev/null @@ -1,9 +0,0 @@ -partial alphanumeric_keys -xkb_symbols "us-modified" { - name[Group1]= "US English with caps lock key as compose key"; - - - include "us(basic)" - include "compose(caps)" -}; -// vim: ft=xkb diff --git a/modules/by-name/lo/locale/module.nix b/modules/by-name/lo/locale/module.nix index 10569216..17096731 100644 --- a/modules/by-name/lo/locale/module.nix +++ b/modules/by-name/lo/locale/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -42,11 +51,6 @@ in { }; services.xserver.xkb.extraLayouts = { - "us-modified" = { - description = "standard us with caps as compose key."; - languages = ["eng" "swe" "deu"]; - symbolsFile = ./keymaps/us_modified.xkb; - }; "dvorak-modified" = { description = "standard dvorak english with german and swedish extra chars."; languages = ["eng" "swe" "deu"]; diff --git a/modules/by-name/ma/mako/module.nix b/modules/by-name/ma/mako/module.nix new file mode 100644 index 00000000..1630d2d0 --- /dev/null +++ b/modules/by-name/ma/mako/module.nix @@ -0,0 +1,81 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.services.mako; + + iconPath = "${pkgs.gruvbox-dark-icons-gtk.overrideAttrs (prev: final: { + # Remove unused dependencies + propagatedBuildInputs = []; + })}/share/icons/oomox-gruvbox-dark"; +in { + options.soispha.services.mako = { + enable = lib.mkEnableOption "mako"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + services.mako = { + enable = true; + + # See mako(5) + settings = { + max-history = 5; + sort = "-time"; + + background-color = "#2e3440"; + border-color = "#88c0d0"; + border-radius = 25; + border-size = 2; + default-timeout = 5000; + font = "Source Code Pro 10"; + group-by = "body"; + height = 500; + icon-path = iconPath; + icons = true; + ignore-timeout = false; + layer = "overlay"; + markup = true; + max-icon-size = 64; + width = 500; + + "urgency=low" = { + border-color = "#cccccc"; + }; + + "urgency=normal" = { + border-color = "#d08770"; + }; + + "urgency=high" = { + border-size = 3; + border-color = "#bf616a"; + default-timeout = 0; + }; + + "urgency=critical" = { + border-size = 4; + border-color = "#bf616a"; + default-timeout = 0; + }; + + "category=mpd" = { + default-timeout = 2000; + group-by = "category"; + }; + }; + }; + }; + }; +} diff --git a/modules/by-name/me/mergiraf/module.nix b/modules/by-name/me/mergiraf/module.nix new file mode 100644 index 00000000..474a0ae3 --- /dev/null +++ b/modules/by-name/me/mergiraf/module.nix @@ -0,0 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + libraries, + ... +}: let + cfg = config.soispha.programs.mergiraf; +in { + options.soispha.programs.mergiraf = { + enable = libraries.base.options.mkEnable "mergiraf"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + programs.mergiraf = { + enable = true; + }; + }; + }; +} diff --git a/modules/by-name/mp/mpd/module.nix b/modules/by-name/mp/mpd/module.nix index 6f045f9f..b7c7ab5a 100644 --- a/modules/by-name/mp/mpd/module.nix +++ b/modules/by-name/mp/mpd/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, diff --git a/modules/by-name/mp/mpd/mpc.nix b/modules/by-name/mp/mpd/mpc.nix index 031465fe..cd4a4ec0 100644 --- a/modules/by-name/mp/mpd/mpc.nix +++ b/modules/by-name/mp/mpd/mpc.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -5,7 +14,6 @@ ... }: let cfg = config.soispha.services.mpd.mpc; - parentCfg = config.soispha.services.mpd; in { options.soispha.services.mpd.mpc = { enable = lib.mkEnableOption "mpc with extensions"; @@ -29,9 +37,7 @@ in { beets = cfg.beetsPkg; }) # Displays the lyrics of the currently playing song - (pkgs.mpp-lyrics.override { - mpd_music_dir = parentCfg.directories.music; - }) + pkgs.mpp-lyrics ]; }; } diff --git a/modules/by-name/mp/mpd/mpdconf.example.license b/modules/by-name/mp/mpd/mpdconf.example.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/mp/mpd/mpdconf.example.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/mp/mpv/module.nix b/modules/by-name/mp/mpv/module.nix new file mode 100644 index 00000000..7c8435d5 --- /dev/null +++ b/modules/by-name/mp/mpv/module.nix @@ -0,0 +1,54 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.mpv; +in { + options.soispha.programs.mpv = { + enable = lib.mkEnableOption "mpv"; + }; + + config.home-manager.users.soispha = lib.mkIf cfg.enable { + programs.mpv = { + enable = true; + + bindings = { + q = "quit 0"; + "Ctrl+c" = "quit 1"; + "Shift+q" = "quit-watch-later 1"; + }; + config = { + osd-bar = true; + + border = false; + }; + scriptOpts = { + osc = { + scalewindowed = 0.8; + hidetimeout = 300; + }; + thumbfast = { + hwdec = true; + network = false; + spawn_first = false; + max_height = 250; + max_width = 250; + }; + }; + scripts = with pkgs.mpvScripts; [ + thumbfast + ]; + }; + }; +} diff --git a/modules/by-name/ne/networking/module.nix b/modules/by-name/ne/networking/module.nix index 8448e9b3..6f8633e8 100644 --- a/modules/by-name/ne/networking/module.nix +++ b/modules/by-name/ne/networking/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/zs/zsh/config/command_not_found/command_not_found.sh b/modules/by-name/ni/nix-index/command_not_found.sh index fb21b676..e3036797 100644 --- a/modules/by-name/zs/zsh/config/command_not_found/command_not_found.sh +++ b/modules/by-name/ni/nix-index/command_not_found.sh @@ -1,5 +1,15 @@ #!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # This was taken from the # `${pkgs.nix-index}/etc/profile.d/command-not-found.sh` file on 2024-02-28 @@ -21,7 +31,7 @@ command_not_found_handle() { case "$len" in 0) - eprintln "$cmd: command not found" + printf "%s: command not found\n" "$cmd" >&2 ;; 1) # If only one package provides this, then we can invoke it @@ -48,7 +58,7 @@ EOF The program '$cmd' is currently not installed. It is provided by several packages. You can run it once with: EOF - awk --assign=toplevel="$toplevel" 'BEGIN{counter=0} {printf("%3s)", counter); printf(" nix shell %s#%s\n", toplevel, $1); counter+=1}' "$(ptmp "$attrs")" + echo "$attrs" | awk --assign=toplevel="$toplevel" 'BEGIN{counter=0} {printf("%3s)", counter); printf(" nix shell %s#%s\n", toplevel, $1); counter+=1}' ;; esac diff --git a/modules/by-name/ni/nix-index/module.nix b/modules/by-name/ni/nix-index/module.nix new file mode 100644 index 00000000..06acfc8a --- /dev/null +++ b/modules/by-name/ni/nix-index/module.nix @@ -0,0 +1,44 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + modules, + ... +}: let + cfg = config.soispha.programs.nix-index; +in { + options.soispha.programs.nix-index = { + enable = lib.mkEnableOption "nix-index"; + }; + + config = lib.mkIf cfg.enable { + soispha.programs.zsh.integrations.nix-index = ./command_not_found.sh; + home-manager.users.soispha = { + imports = [ + modules.nix-index-database.hmModules.nix-index + ]; + + programs.nix-index = { + enable = true; + symlinkToCacheHome = true; + + # Handled by myself (and the script is overridden) + enableBashIntegration = false; + enableZshIntegration = false; + enableFishIntegration = false; + }; + + programs.nix-index-database = { + comma.enable = false; + }; + }; + }; +} diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index 767ab076..40a84539 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -1,22 +1,33 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, # flakes - nixpkgs_as_input, - templates, self, system, + externalDependencies, ... }: { + # TODO(@bpeetz): Modularize <2025-02-08> + nix = { - package = pkgs.lix; + # TODO(@bpeetz): Switch back to lix, once they fix their correctness bug. <2025-06-28> + package = pkgs.nix; # Disable nix channels (this is a remnant of old days) channel.enable = false; registry = { - nixpkgs.flake = nixpkgs_as_input; + nixpkgs.flake = self.inputs.nixpkgs; n.flake = - nixpkgs_as_input + self.inputs.nixpkgs // { # Otherwise nixpkgs's config and overlays are not available: @@ -25,7 +36,7 @@ legacyPackages."${system}" = pkgs; }; - t.flake = templates; + t.flake = externalDependencies.templates; my_flake.flake = self; m.flake = self; @@ -52,7 +63,7 @@ fallback = true; # Build from source, if binary can't be substituted - keep-failed = true; # keep failed tmp build dirs + keep-failed = false; # keep failed tmp build dirs pure-eval = true; # restrict file system and network access to hash sandbox-fallback = false; # Don't disable the sandbox, if the kernel doesn't support it diff --git a/modules/by-name/ni/nixos-shell/module.nix b/modules/by-name/ni/nixos-shell/module.nix new file mode 100644 index 00000000..219f080d --- /dev/null +++ b/modules/by-name/ni/nixos-shell/module.nix @@ -0,0 +1,128 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Jörg Thalheim and contributors +# SPDX-License-Identifier: MIT +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + lib, + config, + pkgs, + self, + ... +}: let + cfg = config.soispha.nixos-shell; +in { + options.soispha.nixos-shell = { + enable = lib.mkEnableOption "nixos-shell"; + + user_name = lib.mkOption { + type = lib.types.str; + default = "soispha"; + description = "The user to auto-login into the vm."; + }; + + configuration = { + specialArgs = lib.mkOption { + type = lib.types.attrsOf lib.types.anything; + default = {}; + description = '' + The arguments to pass to the `specialArgs` attribute set. + ''; + }; + value = lib.mkOption { + type = lib.types.deferredModule; + default = {}; + description = '' + Additional NixOS configuration to load into the VM's config. + ''; + }; + }; + + mounts = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule ({config, ...}: { + options = { + target = lib.mkOption { + type = lib.types.path; + description = "Target on the guest."; + }; + + cache_mode = lib.mkOption { + type = lib.types.enum ["none" "loose" "fscache" "mmap"]; + default = "loose"; # bad idea? Well, at least it is fast!1!! + description = "9p caching policy"; + }; + + readOnly = + (lib.mkEnableOption "mount this disk in read-only mode") + // { + default = true; + }; + + tag = lib.mkOption { + type = lib.types.str; + internal = true; + }; + }; + + config.tag = lib.mkDefault ( + builtins.substring 0 31 ( # tags must be shorter than 32 bytes + "a" + + # tags must not begin with a digit + builtins.hashString "md5" config._module.args.name + ) + ); + })); + default = {}; + description = '' + Extra paths to make available in the vm. + These will be mounted ro to their `target.` + ''; + }; + }; + + config = let + vmSystem = self.inputs.nixpkgs.lib.nixosSystem { + inherit (cfg.configuration) specialArgs; + + modules = [ + { + # TODO(@bpeetz): This should be bumped each release. <2025-05-17> + system.stateVersion = "25.05"; + } + + cfg.configuration.value + + (import ./shell_setup.nix {inherit cfg;}) + ]; + }; + + nixos-shell = pkgs.writeShellApplication { + name = "nixos-shell"; + text = builtins.readFile ./nixos-shell.sh; + + # We need to keep the PATH, as we otherwise can't pass it along. + inheritPath = true; + + runtimeInputs = [ + vmSystem.config.system.build.vm + pkgs.mktemp + pkgs.coreutils + pkgs.moreutils # for sponge + ]; + runtimeEnv = { + HOST_NAME = vmSystem.config.system.name; + }; + }; + in + lib.mkIf cfg.enable { + environment.systemPackages = [ + nixos-shell + ]; + + system.build.nixos-shell = vmSystem.config.system.build.vm; + }; +} diff --git a/modules/by-name/ni/nixos-shell/nixos-shell.sh b/modules/by-name/ni/nixos-shell/nixos-shell.sh new file mode 100755 index 00000000..390e60b1 --- /dev/null +++ b/modules/by-name/ni/nixos-shell/nixos-shell.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Jörg Thalheim and contributors +# SPDX-License-Identifier: MIT +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +SHARED_DIR="$(mktemp --directory)" +cleanup() { + rm --recursive "$SHARED_DIR" +} +trap cleanup EXIT +export SHARED_DIR + +TMPDIR="$SHARED_DIR" +export TMPDIR + +cat <<EOF >"$SHARED_DIR/.env_variables" +{ + "pwd": "$PWD", + "term": "$TERM", + "path": "$PATH" +} +EOF + +mk_tag() { + additional_path="$1" + + # tags must be shorter than 32 bytes + # and must not begin with a digit. + { + printf "a" + echo "$additional_path" | sha256sum | head -c 30 + } +} + +for raw_additional_path in "$@"; do + additional_path="$(realpath "$raw_additional_path")" + tag="$(mk_tag "$additional_path")" + + if [ "$(jq --arg mount "$tag" '.mount.[$mount]' "$SHARED_DIR/.env_variables")" != "null" ]; then + echo "Path '$additional_path' alread added." + shift 1 + continue + fi + + jq --arg mount "$tag" --arg target "$additional_path" \ + '. + {mount: {$mount: $target}}' "$SHARED_DIR/.env_variables" | sponge "$SHARED_DIR/.env_variables" + + set -- "$@" -virtfs "local,path=$additional_path,security_model=none,readonly=on,mount_tag=$tag" + shift 1 +done + +# Do not exec here, as we don't want to lose our cleanup hooks. +"run-$HOST_NAME-vm" "$@" diff --git a/modules/by-name/ni/nixos-shell/shell_setup.nix b/modules/by-name/ni/nixos-shell/shell_setup.nix new file mode 100644 index 00000000..75af0678 --- /dev/null +++ b/modules/by-name/ni/nixos-shell/shell_setup.nix @@ -0,0 +1,191 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Jörg Thalheim and contributors +# SPDX-License-Identifier: MIT +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +# This file contains the code that is used to setup the VM shell. +{cfg}: { + lib, + config, + pkgs, + modulesPath, + ... +}: let + mkVMDefault = lib.mkOverride 970; + + env_file = "/tmp/shared/.env_variables"; +in { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + (modulesPath + "/virtualisation/qemu-vm.nix") + ]; + + config = { + assertions = [ + { + assertion = builtins.elem cfg.user_name (lib.mapAttrsToList (name: value: name) config.users.users); + message = '' + Your user ${cfg.user_name} is not a recorded user in `config.users.users`. + Auto-login will not work. + ''; + } + ]; + + # Lock root login. + users.users.root.hashedPassword = ""; + + # Remove unneeded clutter. + system.switch.enable = false; + + virtualisation = { + # See https://wiki.qemu.org/Documentation/9psetup#Performance_Considerations. + # It is effectively a balance between ram and IO speed. + msize = let + kib = x: x * 1024; + in + mkVMDefault (kib 512); + + graphics = mkVMDefault false; + memorySize = mkVMDefault 1700; # in MB + cores = mkVMDefault 16; + + # Do not persist this VM. + diskImage = mkVMDefault null; + + fileSystems = + lib.mapAttrs' + (_: mount: { + name = mount.target; + + value = { + device = mount.tag; + fsType = "9p"; + options = + [ + "trans=virtio" + "version=9p2000.L" + "cache=${mount.cache_mode}" + "msize=${toString config.virtualisation.msize}" + ] + ++ lib.optionals mount.readOnly ["ro"]; + }; + }) + cfg.mounts; + + qemu = { + consoles = lib.mkIf (!config.virtualisation.graphics) ["tty0" "hvc0"]; + + options = let + mkMount = options: "-virtfs " + (builtins.concatStringsSep "," options); + in + lib.optionals (!config.virtualisation.graphics) [ + "-serial null" + "-device virtio-serial" + "-chardev stdio,mux=on,id=char0,signal=off" + "-mon chardev=char0,mode=readline" + "-device virtconsole,chardev=char0,nr=0" + ] + ++ (lib.mapAttrsToList + (hostPath: mount: + mkMount [ + "local" + "path=${builtins.toString hostPath}" + "security_model=none" + "readonly=on" + "mount_tag=${mount.tag}" + ]) + cfg.mounts); + }; + }; + + services = { + getty.helpLine = '' + If you are connect via serial console: + Type Ctrl-a c to switch to the qemu console + and `quit` to stop the VM. + ''; + + getty.autologinUser = cfg.user_name; + }; + + system.activationScripts = { + mountAdditionalPaths = + # bash + '' + PATH="${pkgs.jq}/bin:${pkgs.util-linux}/bin:$PATH" + export PATH + + max_index="$(jq '.mount | keys | length' --raw-output ${env_file})" + index=0 + + mount --mkdir --type=tmpfs none "/.rw" --options=rw,relatime,mode=0755 + while [ "$index" -lt "$max_index" ]; do + what="$(jq --argjson index "$index" '.mount | keys | map(.)[$index]' --raw-output ${env_file})" + where="$(jq --argjson index "$index" '.mount | map(.)[$index]' --raw-output ${env_file})" + + mkdir "/.rw/$what" + mount --mkdir "$what" "/.ro/$what" \ + --type=9p \ + --options=ro,trans=virtio,version=9p2000.L,msize=${toString config.virtualisation.msize},x-systemd.requires=modprobe@9pnet_virtio.service + + mkdir "/.rw/work-$what" + mount --mkdir --type=overlay overlay \ + --options=rw,relatime,lowerdir="/.ro/$what",upperdir="/.rw/$what",workdir="/.rw/work-$what",uuid=on \ + "/.ov/$what" + + index="$((index + 1))" + done + ''; + }; + + systemd.services.mountAdditionalPaths = { + after = ["local-fs.target"]; + wantedBy = ["multi-user.target"]; + path = [pkgs.jq]; + script = + # bash + '' + max_index="$(jq '.mount | keys | length' --raw-output ${env_file})" + index=0 + + while [ "$index" -lt "$max_index" ]; do + what="$(jq --argjson index "$index" '.mount | keys | map(.)[$index]' --raw-output ${env_file})" + where="$(jq --argjson index "$index" '.mount | map(.)[$index]' --raw-output ${env_file})" + + systemd-mount --type none "/.ov/$what" "$where" --options=bind + + # HACK(@bpeetz): Nearly all of the paths are in $HOME anyways. So simply avoid + # the permission issue. + # Ideally, we would pass the original owners along with the mount. <2025-05-17> + chown --recursive soispha:users "/home/soispha" + + index="$((index + 1))" + done + ''; + }; + + environment = { + systemPackages = [ + pkgs.jq + ]; + + sessionVariables = { + IN_NIXOS_SHELL = "true"; + }; + + loginShellInit = + # bash + '' + cd "$(jq '.pwd' --raw-output ${env_file})" + export TERM="$(jq '.term' --raw-output ${env_file})" + export PATH="$(jq '.path' --raw-output ${env_file}):$PATH" + ''; + }; + + networking.firewall.enable = mkVMDefault true; + }; +} diff --git a/modules/by-name/ni/nixpkgs/config.nix b/modules/by-name/ni/nixpkgs/config.nix index 1a24444d..ea8f3c45 100644 --- a/modules/by-name/ni/nixpkgs/config.nix +++ b/modules/by-name/ni/nixpkgs/config.nix @@ -1,10 +1,19 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { cfg, - myPkgs, lib, + packageSets, ... }: let - myPkgsOverlay = self: super: myPkgs; + myPkgsOverlay = self: super: packageSets.soispha; in { nixpkgs = { hostPlatform = cfg.systemName; @@ -22,6 +31,12 @@ in { allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "pypemicro" # required by pynitrokey + + # TODO(@bpeetz): Allow moving them to their respective module. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" ]; }; }; diff --git a/modules/by-name/ni/nixpkgs/module.nix b/modules/by-name/ni/nixpkgs/module.nix index eda3ac89..fcde9505 100644 --- a/modules/by-name/ni/nixpkgs/module.nix +++ b/modules/by-name/ni/nixpkgs/module.nix @@ -1,8 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, + packageSets, ... -} @ args: let +}: let cfg = config.soispha.nixpkgs; in { options.soispha.nixpkgs = { @@ -13,5 +23,35 @@ in { type = lib.types.str; }; }; - config = lib.mkIf cfg.enable (import ./config.nix (args // {inherit cfg;})); + config = let + myPkgsOverlay = self: super: packageSets.soispha; + in + lib.mkIf cfg.enable + { + nixpkgs = { + hostPlatform = cfg.systemName; + + overlays = [ + myPkgsOverlay + ]; + + config = { + # TODO: this fails because of the root tempsize, which should be increased + # contentAddressedByDefault = true; + + hostSystem = cfg.systemName; + + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "pypemicro" # required by pynitrokey + + # TODO(@bpeetz): Allow moving them to their respective module. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" + ]; + }; + }; + }; } diff --git a/modules/by-name/nv/nvim/autocmds/default.nix b/modules/by-name/nv/nvim/autocmds/default.nix index 54fd6831..706f1bbd 100644 --- a/modules/by-name/nv/nvim/autocmds/default.nix +++ b/modules/by-name/nv/nvim/autocmds/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/clipboard/default.nix b/modules/by-name/nv/nvim/clipboard/default.nix index 4cc3bd8a..f6348e44 100644 --- a/modules/by-name/nv/nvim/clipboard/default.nix +++ b/modules/by-name/nv/nvim/clipboard/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/mappings/default.nix b/modules/by-name/nv/nvim/mappings/default.nix index 4b6344c2..683b0465 100644 --- a/modules/by-name/nv/nvim/mappings/default.nix +++ b/modules/by-name/nv/nvim/mappings/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -18,34 +27,6 @@ in { action = "<cmd>noh<CR><Esc>"; options.desc = "Disable the search highlighting and send Escape"; } - { - key = "hh"; - mode = ["i"]; - action.__raw = '' - function() - local cmp = require('cmp'); - local luasnip = require('luasnip'); - - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end - ''; - options.desc = "completion trigger/ forward in completen menu"; - } - { - key = "uu"; - mode = ["i"]; - action.__raw = '' - function() - local cmp = require('cmp'); - cmp.confirm() - end - ''; - options.desc = "confirm the selected item"; - } { key = "<C-Tab>"; @@ -208,12 +189,13 @@ in { action = "\"_dP"; options.desc = "keep the cut thing in the base register"; } - { - mode = ["n"]; - key = "<leader>c"; - action = "\"_c"; - options.desc = "change without saving to register"; - } + # Overlaps with the femaco mapping (`<Space>cc`). + # { + # mode = ["n"]; + # key = "<leader>c"; + # action = "\"_c"; + # options.desc = "change without saving to register"; + # } { mode = ["n"]; diff --git a/modules/by-name/nv/nvim/module.nix b/modules/by-name/nv/nvim/module.nix index 69e417bb..9b44906a 100644 --- a/modules/by-name/nv/nvim/module.nix +++ b/modules/by-name/nv/nvim/module.nix @@ -1,18 +1,37 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, config, + modules, + libraries, ... }: let cfg = config.soispha.programs.nvim; + + plgs = builtins.attrValues (libraries.extra.mkByName { + useShards = false; + baseDirectory = ./plgs; + fileName = "default.nix"; + }); in { - imports = [ - ./autocmds - ./clipboard - ./mappings - ./options - ./plgs - ]; + imports = + [ + ./autocmds + ./clipboard + ./mappings + ./options + ./performance + ] + ++ plgs; options.soispha.programs.nvim = { enable = lib.mkEnableOption "custom nvim config"; @@ -24,14 +43,22 @@ in { config = lib.mkIf cfg.enable { home-manager.users.soispha = { + imports = [ + modules.nixvim.homeManagerModules.nixvim + ]; + home.sessionVariables = { EDITOR = "nvim"; VISUAL = "nvim"; CODEEDITOR = "nvim"; }; + programs.nixvim = { enable = true; + # Use my global nixpkgs set, instead of constructing a separate one. + nixpkgs.useGlobalPackages = true; + # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim extraConfigLuaPre = lib.mkBefore '' --------------------------------------------------------------------------- diff --git a/modules/by-name/nv/nvim/options/default.nix b/modules/by-name/nv/nvim/options/default.nix index be475b13..301f0ac0 100644 --- a/modules/by-name/nv/nvim/options/default.nix +++ b/modules/by-name/nv/nvim/options/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -23,7 +32,6 @@ in { confirm = true; # confirm to save changes before closing modified buffer colorcolumn = "+1"; # show a +1 before the 'textwidth' - completeopt = ["menuone" "noselect"]; # have a better completion experience # https://www.compart.com/en/unicode/U+XXXX (unicode character code) fillchars = { diff --git a/modules/by-name/nv/nvim/performance/default.nix b/modules/by-name/nv/nvim/performance/default.nix new file mode 100644 index 00000000..a392a672 --- /dev/null +++ b/modules/by-name/nv/nvim/performance/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + performance = { + combinePlugins = { + enable = true; + }; + + byteCompileLua = { + enable = true; + configs = true; + initLua = true; + luaLib = true; + nvimRuntime = true; + plugins = true; + }; + }; + }; +} diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/default.nix b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix index ebc26826..f8cd5892 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/default.nix +++ b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua b/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua index d02171b5..44c76084 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua +++ b/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + local opts = { bg = "NONE", bold = true } ---@param hl_group string: The name of the hl group diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua b/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua index 4c502153..38f6f0a1 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua +++ b/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("nightfox").setup({ options = { -- Compiled file's destination location diff --git a/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix index bd70c5c2..68a88d32 100644 --- a/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -17,6 +26,7 @@ in { }; }; }; + keymaps = [ { key = "gcc"; diff --git a/modules/by-name/nv/nvim/plgs/debugprint/default.nix b/modules/by-name/nv/nvim/plgs/debugprint/default.nix deleted file mode 100644 index 4a3af1c5..00000000 --- a/modules/by-name/nv/nvim/plgs/debugprint/default.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # TODO: package debugprint though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/debugprint.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.debugprint-nvim - ]; - - keymaps = [ - { - key = "g?v"; - mode = ["v" "n"]; - action.__raw = '' - function() - return require('debugprint').debugprint({variable = true;}); - end - ''; - options.expr = true; - options.desc = '' - 'variable' debug line below the current line - ''; - } - { - key = "g?V"; - mode = ["v" "n"]; - action.__raw = '' - function() - return require('debugprint').debugprint({above = true; variable = true;}) ; - end - ''; - options.expr = true; - options.desc = '' - 'variable' debug line above the current line - ''; - } - { - key = "g?p"; - mode = "n"; - action.__raw = '' - function() - return require('debugprint').debugprint(); - end - ''; - options.expr = true; - options.desc = '' - 'plain' debug line below the current line - ''; - } - { - key = "g?P"; - mode = "n"; - action.__raw = '' - function() - return require('debugprint').debugprint({above = true;}); - end - ''; - options.expr = true; - options.desc = '' - 'plain' debug line above the current line - ''; - } - ]; - }; -} diff --git a/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua b/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua deleted file mode 100644 index da7e1735..00000000 --- a/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("debugprint").setup({ - create_keymaps = false, -}) diff --git a/modules/by-name/nv/nvim/plgs/default.nix b/modules/by-name/nv/nvim/plgs/default.nix deleted file mode 100644 index 991bc315..00000000 --- a/modules/by-name/nv/nvim/plgs/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{...}: { - imports = - [ - # Plugins not yet packaged in nixpkgs - # ./debugprint - ./lf-nvim - # ./lsp-progress-nvim - ] - ++ [ - # Already packaged in nixpkgs - ./colorscheme - ./comment-nvim - ./femaco - ./flatten-nvim - ./goto-preview - ./harpoon - ./leap - ./lsp - ./lspkind - ./ltex_extra - ./lualine - ./luasnip - ./neorg - ./nvim-cmp - ./nvim-lint - ./raw_plugins - ./telescope - ./todo-comments - ./treesitter - ./vim-tex - ./which-key - ]; -} diff --git a/modules/by-name/nv/nvim/plgs/femaco/default.nix b/modules/by-name/nv/nvim/plgs/femaco/default.nix index adf0ba63..0388844a 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/default.nix +++ b/modules/by-name/nv/nvim/plgs/femaco/default.nix @@ -1,5 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - pkgs, lib, config, ... @@ -7,13 +15,14 @@ cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # TODO: package femaco through a module + plugins.femaco = { + enable = true; + }; + extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/femaco.lua} ''; - extraPlugins = [ - pkgs.vimPlugins.nvim-FeMaco-lua - ]; + keymaps = [ { key = "<leader>cc"; diff --git a/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua index c113e4c7..50a6cb23 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua +++ b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua @@ -1,4 +1,16 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + + local clip_val = require("femaco.utils").clip_val + require("femaco").setup({ -- should prepare a new buffer and return the winid -- by default opens a floating window @@ -7,7 +19,8 @@ require("femaco").setup({ prepare_buffer = function(opts) local buf = vim.api.nvim_create_buf(false, false) return vim.api.nvim_open_win(buf, true, opts) - end, + end; + -- should return options passed to nvim_open_win -- @param code_block: data about the code-block with the keys -- * range @@ -15,30 +28,43 @@ require("femaco").setup({ -- * lang float_opts = function(code_block) return { - relative = "cursor", - width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10), -- TODO: how to offset sign column etc? - height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6), - anchor = "NW", - row = 0, - col = 0, - style = "minimal", - border = "rounded", - zindex = 1, + relative = "cursor"; + width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10); -- TODO how to offset sign column etc? + height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6); + anchor = "NW"; + row = 0; + col = 0; + style = "minimal"; + border = "rounded"; + zindex = 1; } - end, + end; + -- return filetype to use for a given lang -- lang can be nil - ft_from_lang = function(lang) return lang end, + ft_from_lang = function(lang) + return lang + end; + -- what to do after opening the float - post_open_float = function(winnr) vim.wo.signcolumn = "no" end, + post_open_float = function(winnr) + vim.wo.signcolumn = "no" + end; + -- create the path to a temporary file - create_tmp_filepath = function(filetype) return os.tmpname() end, + create_tmp_filepath = function(filetype) + return os.tmpname() + end; + -- if a newline should always be used, useful for multiline injections -- which separators needs to be on separate lines such as markdown, neorg etc -- @param base_filetype: The filetype which FeMaco is called from, not the -- filetype of the injected language (this is the current buffer so you can -- get it from vim.bo.filetyp). - ensure_newline = function(base_filetype) return false end, + ensure_newline = function(base_filetype) + return base_filetype == "nix" + end; + -- Return true if the indentation should be normalized. Useful when the -- injected language inherits indentation from the construction scope (e.g. an -- inline multiline sql string). If true, the leading indentation is detected, @@ -47,5 +73,7 @@ require("femaco").setup({ -- @param base_filetype: The filetype which FeMaco is called from, not the -- filetype of the injected language (this is the current buffer, so you can -- get it from vim.bo.filetype). - normalize_indent = function(base_filetype) return false end, + normalize_indent = function(base_filetype) + return base_filetype == "nix" + end; }) diff --git a/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix b/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix deleted file mode 100644 index c1ace4ac..00000000 --- a/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # TODO: package flatten-nvim though a module - - extraConfigLuaPre = '' - ${lib.strings.fileContents ./lua/flatten-nvim.lua} - if os.getenv("NVIM") ~= nil then - -- Avoid loading plugins because the host will take control of the instance anyways - return - end - ''; - extraPlugins = [ - pkgs.vimPlugins.flatten-nvim - ]; - }; -} diff --git a/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua b/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua deleted file mode 100644 index 2cdbcdde..00000000 --- a/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua +++ /dev/null @@ -1,104 +0,0 @@ ----Types: --- --- Passed to callbacks that handle opening files ----@alias BufInfo { fname: string, bufnr: buffer } --- --- Needed aliases ----@alias buffer integer: Buffer id ----@alias window integer: Window id --- --- The first argument is a list of BufInfo tables representing the newly opened files. --- The third argument is a single BufInfo table, only provided when a buffer is created from stdin. --- --- IMPORTANT: For `block_for` to work, you need to return a buffer number OR a buffer number and a window number. --- The `winnr` return value is not required, `vim.fn.bufwinid(bufnr)` is used if it is not provided. --- The `filetype` of this buffer will determine whether block should happen or not. --- ----@alias OpenHandler fun(files: BufInfo[], argv: string[], stdin_buf: BufInfo, guest_cwd: string):window, buffer --- -require("flatten").setup({ - callbacks = { - ---Called to determine if a nested session should wait for the host to close the file. - ---param argv: a list of all the arguments in the nested session - ---@type fun(argv: table): boolean - should_block = require("flatten").default_should_block, - - ---If this returns true, the nested session will be opened. - ---If false, default behavior is used, and - ---config.nest_if_no_args is respected. - ---@type fun(host: channel):boolean - should_nest = require("flatten").default_should_nest, - - ---Called before a nested session is opened. - pre_open = function() end, - - ---Called after a nested session is opened. - ---@param bufnr buffer - ---@param winnr window - ---@param filetype string - ---@param is_blocking boolean - ---@param is_diff boolean - post_open = function(bufnr, winnr, filetype, is_blocking, is_diff) - -- If the file is a git commit, create one-shot autocmd to delete its buffer on write - if filetype == "gitcommit" or filetype == "gitrebase" then - vim.api.nvim_create_autocmd("BufWritePost", { - buffer = bufnr, - once = true, - callback = vim.schedule_wrap(function() vim.api.nvim_buf_delete(bufnr, {}) end), - }) - end - end, - - ---Called when a nested session is done waiting for the host. - ---@param filetype string - block_end = function(filetype) end, - }, - -- <String, Bool> dictionary of filetypes that should be blocking - block_for = { - gitcommit = true, - }, - -- Command passthrough - allow_cmd_passthrough = true, - -- Allow a nested session to open if Neovim is opened without arguments - nest_if_no_args = false, - -- Window options - window = { - -- Options: - -- current -> open in current window (default) - -- alternate -> open in alternate window (recommended) - -- tab -> open in new tab - -- split -> open in split - -- vsplit -> open in vsplit - -- smart -> smart open (avoids special buffers) - -- OpenHandler -> allows you to handle file opening yourself (see Types) - -- - -- TODO: Open gitcommit filetypes in the current buffer, everything else in a new tab <2023-08-29> - open = "split", - - -- Options: - -- vsplit -> opens files in diff vsplits - -- split -> opens files in diff splits - -- tab_vsplit -> creates a new tabpage, and opens diff vsplits - -- tab_split -> creates a new tabpage, and opens diff splits - -- OpenHandler -> allows you to handle file opening yourself (see Types) - diff = "tab_vsplit", - - -- Affects which file gets focused when opening multiple at once - -- Options: - -- "first" -> open first file of new files (default) - -- "last" -> open last file of new files - focus = "first", - }, - -- Override this function to use a different socket to connect to the host - -- On the host side this can return nil or the socket address. - -- On the guest side this should return the socket address - -- or a non-zero channel id from `sockconnect` - -- flatten.nvim will detect if the address refers to this instance of nvim, to determine if this is a host or a guest - pipe_path = require("flatten").default_pipe_path, - -- The `default_pipe_path` will treat the first nvim instance within a single kitty/wezterm session as the host - -- You can configure this behaviour using the following: - one_per = { - kitty = true, -- Flatten all instance in the current Kitty session - wezterm = true, -- Flatten all instance in the current Wezterm session - }, -}) diff --git a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix index 5c56fe8c..93761dfd 100644 --- a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix +++ b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua b/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua index 9687a5a0..ad285033 100644 --- a/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua +++ b/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("goto-preview").setup({ width = 120, -- Width of the floating window height = 15, -- Height of the floating window diff --git a/modules/by-name/nv/nvim/plgs/harpoon/default.nix b/modules/by-name/nv/nvim/plgs/harpoon/default.nix index 05a40d9f..c85c7c80 100644 --- a/modules/by-name/nv/nvim/plgs/harpoon/default.nix +++ b/modules/by-name/nv/nvim/plgs/harpoon/default.nix @@ -1,100 +1,53 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - pkgs, - config, lib, + config, ... }: let - numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]; - mkNumberedCommand = { - command_template, - prefix, - number, - desc_template, - }: { - key = "${prefix}${number}"; - action.__raw = '' - function() - ${command_template number} - end - ''; - options.desc = "${desc_template number}"; - }; - mkGotoTerminalCommand = number: let - desc_template = number: "Goto terminal number ${number}"; - command_template = number: ''require("harpoon.term").gotoTerminal(${number})''; - prefix = "gt"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - mkGotoFileCommand = number: let - desc_template = number: "Goto Buffer number ${number}"; - command_template = number: ''require("harpoon.ui").nav_file(${number})''; - prefix = "gf"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - - gotoTerminalMappings = builtins.map mkGotoTerminalCommand numbers; - gotoFileMappings = builtins.map mkGotoFileCommand numbers; cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - plugins.harpoon = { - enable = true; - package = pkgs.vimPlugins.harpoon; - enableTelescope = true; - # menu.width = "vim.api.nvim_win_get_width(0) - 4"; # TODO: integrate that - keymaps = { - tmuxGotoTerminal = null; # TODO: - }; - }; + plugins.harpoon.enable = true; + keymaps = - [ - { - key = "-"; - action.__raw = '' + lib.mapAttrsToList + (key: action: { + mode = "n"; + inherit key; + action.__raw = builtins.elemAt action 0; + options.silent = true; + options.desc = builtins.elemAt action 1; + }) + { + # add current file + "<leader><leader>" = [ + # lua + '' function() - require("harpoon.ui").nav_next() - end - ''; - options.desc = "go to the next marked file"; - } - { - key = "_"; - action.__raw = '' - function() - require("harpoon.ui").nav_prev() - end - ''; - options.desc = "go to the previous marked file"; - } - { - key = "<leader><leader>"; - action.__raw = '' - function() - require("harpoon.mark").add_file() - end - ''; - options.desc = "add a mark to the open file in harpoon."; - } - { - key = "gqc"; - action.__raw = '' - function() - require("harpoon.cmd-ui").toggle_quick_menu() + require("harpoon"):list():add() end - ''; - options.desc = "toggle the harpoon command quick menu to see all commands."; - } - { - key = "<leader>q"; - action.__raw = '' + '' + "Add a mark to the open file in harpoon." + ]; + + # open menu + "<leader>q" = [ + # lua + '' function() - require("harpoon.ui").toggle_quick_menu() + require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end - ''; - options.desc = "toggle the harpoon normal quick menu to see all marks."; - } - ] - ++ gotoFileMappings - ++ gotoTerminalMappings; + '' + "Toggle the harpoon normal quick menu to see all marks." + ]; + }; }; } diff --git a/modules/by-name/nv/nvim/plgs/leap/default.nix b/modules/by-name/nv/nvim/plgs/leap/default.nix deleted file mode 100644 index 57e78879..00000000 --- a/modules/by-name/nv/nvim/plgs/leap/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - plugins.leap = { - enable = true; - addDefaultMappings = false; # They don't work with dvorak. - safeLabels = [ - "f" - "j" - "k" - "l" - "/" - "z" - "S" - "F" - "J" - "K" - "L" - "H" - "W" - "E" - "M" - "B" - "U" - "X" - "?" - "Z" - ]; - }; - keymaps = [ - { - key = "j"; - action = "<Plug>(leap-forward-to)"; - options.desc = "jump forward to"; - } - { - key = "J"; - action = "<Plug>(leap-backward-to)"; - options.desc = "jump backward to"; - } - { - key = "gj"; - action = "<Plug>(leap-from-window)"; - options.desc = "jump to enterable windows"; - } - /* - {key= "x"; - mode = "v"; - action = "<Plug>(leap-forward-till)"; - options.desc = "leap forward till"; - } - {key= "X"; - mode = "v"; - action = "<Plug>(leap-backward-till)"; - options.desc = "leap backward till"; - } - */ - ]; - }; -} diff --git a/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix index 5e2836b0..e652a60d 100644 --- a/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix @@ -1,21 +1,95 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - pkgs, lib, config, ... }: let cfg = config.soispha.programs.nvim; in { + # TODO: change the nvim path, when I change the path with lf home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # TODO: package lf-nvim though a module - # FIXME: change the nvim path, when I change the path with lf - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/lf-nvim.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.lf-nvim + plugins.lf = { + enable = true; - pkgs.vimPlugins.toggleterm-nvim # required by lf-nvim - ]; + settings = { + default_actions = { + "<C-o>" = "tab drop"; + "<C-t>" = "tabedit"; + "<C-v>" = "vsplit"; + "<C-x>" = "split"; + }; + + default_action = "drop"; + + winblend = 10; + dir = ""; + direction = "float"; + border = "rounded"; + height.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.lines))"; + width.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.columns))"; + escape_quit = true; + focus_on_open = true; + mappings = true; + tmux = false; + default_file_manager = true; + disable_netrw_warning = true; + highlights = { + Normal = {link = "Normal";}; + NormalFloat = {link = "Normal";}; + FloatBorder = { + guifg = "#cdcbe0"; + guibg = "#191726"; + }; + }; + + layout_mapping = "<M-u>"; + views = [ + { + width = 0.800; + height = 0.800; + } + { + width = 0.600; + height = 0.600; + } + { + width = 0.950; + height = 0.950; + } + { + width = 0.500; + height = 0.500; + col = 0; + row = 0; + } + { + width = 0.500; + height = 0.500; + col = 0; + row = 0.5; + } + { + width = 0.500; + height = 0.500; + col = 0.5; + row = 0; + } + { + width = 0.500; + height = 0.500; + col = 0.5; + row = 0.5; + } + ]; + }; + }; }; } diff --git a/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua b/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua deleted file mode 100644 index 1eadf375..00000000 --- a/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua +++ /dev/null @@ -1,43 +0,0 @@ -local fn = vim.fn - --- Defaults -require("lf").setup({ - default_action = "drop", -- default action when `Lf` opens a file - -- TODO: what do these mappings do? - default_actions = { -- default action keybindings - ["<C-t>"] = "tabedit", - ["<C-x>"] = "split", - ["<C-v>"] = "vsplit", - ["<C-o>"] = "tab drop", - }, - - winblend = 10, -- psuedotransparency level - dir = "", -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD) - direction = "float", -- window type: float horizontal vertical - border = "rounded", -- border kind: single double shadow curved - height = fn.float2nr(fn.round(0.75 * vim.o.lines)), -- height of the *floating* window - width = fn.float2nr(fn.round(0.75 * vim.o.columns)), -- width of the *floating* window - escape_quit = true, -- map escape to the quit command (so it doesn't go into a meta normal mode) - focus_on_open = true, -- focus the current file when opening Lf (experimental) - mappings = true, -- whether terminal buffer mapping is enabled - tmux = false, -- tmux statusline can be disabled on opening of Lf - default_file_manager = true, -- make lf default file manager - disable_netrw_warning = true, -- don't display a message when opening a directory with `default_file_manager` as true - highlights = { -- highlights passed to toggleterm - Normal = { link = "Normal" }, - NormalFloat = { link = "Normal" }, - FloatBorder = { guifg = "#cdcbe0", guibg = "#191726" }, - }, - - -- Layout configurations - layout_mapping = "<M-u>", -- resize window with this key - views = { -- window dimensions to rotate through - { width = 0.800, height = 0.800 }, - { width = 0.600, height = 0.600 }, - { width = 0.950, height = 0.950 }, - { width = 0.500, height = 0.500, col = 0, row = 0 }, - { width = 0.500, height = 0.500, col = 0, row = 0.5 }, - { width = 0.500, height = 0.500, col = 0.5, row = 0 }, - { width = 0.500, height = 0.500, col = 0.5, row = 0.5 }, - }, -}) diff --git a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix deleted file mode 100644 index 1a2fb6eb..00000000 --- a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # TODO: package lsp-progress-nvim though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/lsp-progress-nvim.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.lsp-progress-nvim - ]; - - # Status line setup - autoGroups.lsp_refresh.clear = true; - autoCmd = [ - { - event = ["User LspProgressStatusUpdated"]; - pattern = ["*"]; - callback = - /* - lua - */ - { - __raw = '' - require("lualine").refresh - ''; - }; - group = "lsp_refresh"; - description = "Refresh the statusbar when the lsp status was updated."; - } - ]; - plugins.lualine = let - get_lsp_progress = { - __raw = - /* - lua - */ - '' - require('lsp-progress').progress - ''; - }; - in { - sections = { - lualine_c = [{name = get_lsp_progress;}]; - }; - }; - }; -} diff --git a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua deleted file mode 100644 index 5a2cff26..00000000 --- a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua +++ /dev/null @@ -1,146 +0,0 @@ ---- @type table<string, any> -require("lsp-progress").setup({ - -- Spinning icons. - -- - --- @type string[] - spinner = { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }, - - -- Spinning update time in milliseconds. - -- - --- @type integer - spin_update_time = 200, - - -- Last message cached decay time in milliseconds. - -- - -- Message could be really fast(appear and disappear in an - -- instant) that user cannot even see it, thus we cache the last message - -- for a while for user view. - -- - --- @type integer - decay = 700, - - -- User event name. - -- - --- @type string - event = "LspProgressStatusUpdated", - - -- Event update time limit in milliseconds. - -- - -- Sometimes progress handler could emit many events in an instant, while - -- refreshing statusline cause too heavy synchronized IO, so we limit the - -- event rate to reduce this cost. - -- - --- @type integer - event_update_time_limit = 100, - - -- Max progress string length, by default -1 is unlimited. - -- - --- @type integer - max_size = -1, - - -- Regular internal update time. - -- - -- Emit user event to update the lsp progress status, even there's no new - -- message. - -- - --- @type integer - regular_internal_update_time = 500, - - -- Disable emitting events on specific mode/filetype. - -- User events would interrupt insert mode, thus break which-key like plugins behaviour. - -- See: - -- * https://github.com/linrongbin16/lsp-progress.nvim/issues/50 - -- * https://neovim.io/doc/user/builtin.html#mode() - -- - --- @type table[] - disable_events_opts = { { mode = "i", filetype = "TelescopePrompt" } }, - - -- Format series message. - -- - -- By default it looks like: `formatting isort (100%) - done`. - -- - --- @param title string|nil - --- Message title. - --- @param message string|nil - --- Message body. - --- @param percentage number|nil - --- Progress in percentage numbers: 0-100. - --- @param done boolean - --- Indicate whether this series is the last one in progress. - --- @return string|nil messages - --- The returned value will be passed to function `client_format` as - --- one of the `series_messages` array, or ignored if return nil. - series_format = function(title, message, percentage, done) - local builder = {} - local has_title = false - local has_message = false - if title and title ~= "" then - table.insert(builder, title) - has_title = true - end - if message and message ~= "" then - table.insert(builder, message) - has_message = true - end - if percentage and (has_title or has_message) then table.insert(builder, string.format("(%.0f%%%%)", percentage)) end - if done and (has_title or has_message) then table.insert(builder, "- done") end - return table.concat(builder, " ") - end, - - -- Format client message. - -- - -- By default it looks like: - -- `[null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)`. - -- - --- @param client_name string - --- Client name. - --- @param spinner string - --- Spinner icon. - --- @param series_messages string[]|table[] - --- Messages array. - --- @return string|nil messages - --- The returned value will be passed to function `format` as one of the - --- `client_messages` array, or ignored if return nil. - client_format = function(client_name, spinner, series_messages) - return #series_messages > 0 - and ("[" .. client_name .. "] " .. spinner .. " " .. table.concat(series_messages, ", ")) - or nil - end, - - -- Format (final) message. - -- - -- By default it looks like: - -- ` LSP [null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)` - -- - --- @param client_messages string[]|table[] - --- Client messages array. - --- @return nil|string message - --- The returned value will be returned from `progress` API. - format = function(client_messages) - local sign = " LSP" -- nf-fa-gear \uf013 - return #client_messages > 0 and (sign .. " " .. table.concat(client_messages, " ")) or sign - end, - - -- Enable debug. - -- - --- @type boolean - debug = false, - - -- Print log to console(command line). - -- - --- @type boolean - console_log = false, - - -- Print log to file. - -- - --- @type boolean - file_log = true, - - -- Log file to write, work with `file_log=true`. - -- - -- For Windows: `$env:USERPROFILE\AppData\Local\nvim-data\lsp-progress.log`. - -- For *NIX: `~/.local/share/nvim/lsp-progress.log`. - -- - --- @type string - file_log_name = "lsp-progress.log", -}) diff --git a/modules/by-name/nv/nvim/plgs/lsp/default.nix b/modules/by-name/nv/nvim/plgs/lsp/default.nix index d97f2f0a..27a6f909 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix index 903e8c17..7cc9f6d5 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix index 605046d4..b6e47ca4 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix @@ -1,6 +1,14 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ - # ./servers/pylyzer.nix ./servers/bashls.nix ./servers/ccls.nix ./servers/quick-lint-js.nix diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix index 5a37e133..8d2b0d03 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix index 9f3195fa..eed7f349 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix index 03b7d4c1..e55cf377 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix index 39e4b989..9350cd37 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix index 94ca99ce..3b7e2523 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix index 94f7b067..fba1113f 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix deleted file mode 100644 index 3ac66102..00000000 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').pylyzer.setup{} - ''; - extraPackages = with pkgs; [pylyzer]; - }; -} diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix index 48a3a71c..82d3b5a9 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix index 57cb8366..4f9834ee 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix index 093f5250..fd344c50 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix index 1fe3c764..5f001177 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lspkind/default.nix b/modules/by-name/nv/nvim/plgs/lspkind/default.nix index 078d607d..6e966ad1 100644 --- a/modules/by-name/nv/nvim/plgs/lspkind/default.nix +++ b/modules/by-name/nv/nvim/plgs/lspkind/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix index c37a7591..a01d5653 100644 --- a/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua index d532428a..883b22c4 100644 --- a/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("ltex_extra").setup({ -- table <string> : languages for witch dictionaries will be loaded, e.g. { "es-AR", "en-US" } -- https://valentjn.github.io/ltex/supported-languages.html#natural-languages diff --git a/modules/by-name/nv/nvim/plgs/lualine/default.nix b/modules/by-name/nv/nvim/plgs/lualine/default.nix index 2f3bb552..7a69519b 100644 --- a/modules/by-name/nv/nvim/plgs/lualine/default.nix +++ b/modules/by-name/nv/nvim/plgs/lualine/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/luasnip/default.nix b/modules/by-name/nv/nvim/plgs/luasnip/default.nix index f67c9899..222b5070 100644 --- a/modules/by-name/nv/nvim/plgs/luasnip/default.nix +++ b/modules/by-name/nv/nvim/plgs/luasnip/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, @@ -7,14 +16,81 @@ cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + keymaps = [ + { + key = "<C-K>"; + mode = ["i"]; + action.__raw = '' + function() + require('luasnip').expand() + end + ''; + options = { + # silent = true; + desc = "Expand the snippet"; + }; + } + { + key = "<C-L>"; + mode = ["i" "s"]; + action.__raw = '' + function() + require('luasnip').jump(1) + end + ''; + options = { + # silent = true; + desc = "Jump forward in snippet insert nodes"; + }; + } + { + key = "<C-J>"; + mode = ["i" "s"]; + action.__raw = '' + function() + require('luasnip').jump(-1) + end + ''; + options = { + # silent = true; + desc = "Jump backwards in snippet insert nodes"; + }; + } + { + key = "<C-E>"; + mode = ["i" "s"]; + action.__raw = '' + function() + if require('luasnip').choice_active() then + require('luasnip').change_choice(1) + end + end + ''; + options = { + # silent = true; + desc = "Cycle through the snippets choice nodes"; + }; + } + ]; plugins.luasnip = { enable = true; + + settings = { + # Enable auto triggered snippets. + enable_autosnippets = true; + + # Use Tab to trigger visual selection. + store_selection_keys = "<Tab>"; + }; + + fromLua = [ + { + paths = ./snippets; + lazyLoad = true; + } + ]; }; - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/luasnip.lua}; - require("luasnip.loaders.from_lua").load({paths = "${./lua/snippets}"}); - require("luasnip.loaders.from_lua").lazy_load({paths = "${./lua/snippets}"}); - ''; + extraPlugins = [ # needed for the todo-comments snippets pkgs.vimPlugins.comment-nvim diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua deleted file mode 100644 index a05fa57f..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("luasnip").config.set_config({ - -- Enable auto triggered snippets - enable_autosnippets = true, - - -- Use Tab (or some other key if you prefer) to trigger visual selection - store_selection_keys = "<Tab>", -}) diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua deleted file mode 100644 index 2b923f20..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua +++ /dev/null @@ -1,211 +0,0 @@ -local ls = require("luasnip") --- auto_pairs {{{ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end -local function char_count_same(c1, c2) - local line = vim.api.nvim_get_current_line() - -- '%'-escape chars to force explicit match (gsub accepts patterns). - -- second return value is number of substitutions. - local _, ct1 = string.gsub(line, "%" .. c1, "") - local _, ct2 = string.gsub(line, "%" .. c2, "") - return ct1 == ct2 -end - -local function even_count(c, ...) - local line = vim.api.nvim_get_current_line() - local _, ct = string.gsub(line, c, "") - return ct % 2 == 0 -end - --- This makes creation of pair-type snippets easier. -local function pair(pair_begin, pair_end, file_types, condition_function) - -- FIXME(@Soispha): This only works if file_types == nil, otherwise the snippet does not expand. - -- It would be nice, if it would support both an empty array (`{}`) and nil <2023-08-27> - -- file_types = file_types or {}; - - return s( - { trig = pair_begin, wordTrig = false, snippetType = "autosnippet" }, - { t({ pair_begin }), d(1, get_visual), t({ pair_end }) }, - { - condition = function() - local filetype_check = true - if file_types ~= nil then filetype_check = file_types[vim.bo.filetype] or false end - return (not condition_function(pair_begin, pair_end)) and filetype_check - end, - } - ) -end - -local auto_pairs = { - pair("(", ")", nil, char_count_same), - pair("{", "}", nil, char_count_same), - pair("[", "]", nil, char_count_same), - pair("<", ">", { ["rust"] = true, ["tex"] = true }, char_count_same), - pair("'", "'", nil, even_count), - pair("\"", "\"", nil, even_count), - pair("`", "`", nil, even_count), -} - -ls.add_snippets("all", auto_pairs, { type = "snippets", key = "auto_pairs" }) --- }}} - --- todo_comments {{{ -local calculate_comment_string = require("Comment.ft").calculate -local utils = require("Comment.utils") - -local read_git_config = function(config_value) - local command = string.format("git config \"%s\"", config_value) - local handle = io.popen(command) - if handle == nil then return error(string.format("Failed to call `%s`.", command)) end - local result = handle:read("*a") - handle:close() - -- stripped = string.gsub(str, '%s+', '') - return string.gsub(result, "\n", "") -end - -local name_to_handle = function(name) - -- from: https://stackoverflow.com/a/7615129 - local split = function(inputstr, sep) - local t = {} - for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do - table.insert(t, str) - end - return t - end - - local parts = split(name, "%s") - - local output_name = "" - if #parts > 2 then - for _, val in ipairs(parts) do - output_name = string.format("%s%s", output_name, val:sub(1, 1)) - end - elseif #parts == 2 then - output_name = string.format("%s%s", parts[1]:sub(1, 1), parts[2]) - elseif #parts == 1 then - output_name = parts[1] - else - -- parts is 0 - output_name = "<NoName>" - end - return string.format("@%s", output_name:lower()) -end - -_G.luasnip = {} -_G.luasnip.vars = { - username = function() return name_to_handle(read_git_config("user.name")) end, - email = function() return read_git_config("user.email") end, -} - ---- Get the comment string {beg,end} table ----@param ctype integer 1 for `line`-comment and 2 for `block`-comment ----@return table comment_strings {begcstring, endcstring} -local get_cstring = function(ctype) - -- use the `Comments.nvim` API to fetch the comment string for the region (eq. '--%s' or '--[[%s]]' for `lua`) - local cstring = calculate_comment_string({ ctype = ctype, range = utils.get_region() }) or vim.bo.commentstring - -- as we want only the strings themselves and not strings ready for using `format` we want to split the left and right side - local left, right = utils.unwrap_cstr(cstring) - -- create a `{left, right}` table for it - return { left, right } -end - ---- Options for marks to be used in a TODO comment ----@return table,table: The first table contains a node for the date, the second for the signature -local marks = { - signature = function() return t("(" .. _G.luasnip.vars:username() .. ")"), t("") end, - date_signature = function() return t("<" .. os.date("%Y-%m-%d") .. ">"), t("(" .. _G.luasnip.vars:username() .. ")") end, - date = function() return t("<" .. os.date("%Y-%m-%d") .. ">"), t("") end, - empty = function() return t(""), t("") end, -} - ----@param alias string ----@param opts table ----@param mark_function function: This function should return two nodes ----@return table: Returns the comment node -local todo_snippet_nodes = function(alias, opts, mark_function) - local date_node, signature_node = mark_function() - -- format them into the actual snippet - local comment_node = fmta("<> <><>: <> <> <>", { - f(function() - return get_cstring(opts.ctype)[1] -- get <comment-string[1]> - end), - t(alias), -- [name-of-comment] - signature_node, - i(0), -- {comment-text} - date_node, - f(function() - return get_cstring(opts.ctype)[2] -- get <comment-string[2]> - end), - }) - return comment_node -end - ---- Generate a TODO comment snippet with an automatic description and docstring ----@param context table merged with the generated context table `trig` must be specified ----@param alias string of aliases for the todo comment (ex.: {FIX, ISSUE, FIXIT, BUG}) ----@param opts table merged with the snippet opts table ----@param mark_function function: The function used to get the marks -local todo_snippet = function(context, alias, opts, mark_function) - opts = opts or {} - context = context or {} - if not context.trig then - return error("context doesn't include a `trig` key which is mandatory", 2) -- all we need from the context is the trigger - end - opts.ctype = opts.ctype or 1 -- comment type can be passed in the `opts` table, but if it is not, we have to ensure, it is defined - local alias_string = alias -- `choice_node` documentation - context.name = context.name or (alias_string .. " comment") -- generate the `name` of the snippet if not defined - context.dscr = context.dscr or (alias_string .. " comment with a signature-mark") -- generate the `dscr` if not defined - context.docstring = context.docstring or (" {1:" .. alias_string .. "}: {3} <{2:mark}>{0} ") -- generate the `docstring` if not defined - local comment_node = todo_snippet_nodes(alias, opts, mark_function) - return s(context, comment_node, opts) -- the final todo-snippet constructed from our parameters -end - ----@param context table: The luasnip context ----@param opts table: The luasnip opts table, needs to have a ctype set ----@param aliases string: All aliases for a name ----@param marks table: Possible marks to account in snipped generation ----@return table: All possible snippets build from the marks -local process_marks = function(context, aliases, opts, marks) - local output = {} - for mark_name, mark_function in pairs(marks) do - local contex_trig_local = context.trig - context.trig = context.trig .. "-" .. mark_name - output[#output + 1] = todo_snippet(context, aliases, opts, mark_function) - context.trig = contex_trig_local - end - return output -end - -local todo_snippet_specs = { - { { trig = "todo" }, { "TODO" }, { ctype = 1 } }, - { { trig = "fix" }, { "FIXME", "ISSUE" }, { ctype = 1 } }, - { { trig = "hack" }, { "HACK" }, { ctype = 1 } }, - { { trig = "warn" }, { "WARNING" }, { ctype = 1 } }, - { { trig = "perf" }, { "PERFORMANCE", "OPTIMIZE" }, { ctype = 1 } }, - { { trig = "note" }, { "NOTE", "INFO" }, { ctype = 1 } }, - - -- NOTE: Block commented todo-comments - { { trig = "todob" }, { "TODO" }, { ctype = 2 } }, - { { trig = "fixb" }, { "FIXME", "ISSUE" }, { ctype = 2 } }, - { { trig = "hackb" }, { "HACK" }, { ctype = 2 } }, - { { trig = "warnb" }, { "WARNING" }, { ctype = 2 } }, - { { trig = "perfb" }, { "PERF", "PERFORMANCE", "OPTIM", "OPTIMIZE" }, { ctype = 2 } }, - { { trig = "noteb" }, { "NOTE", "INFO" }, { ctype = 2 } }, -} - -local todo_comment_snippets = {} -for _, v in ipairs(todo_snippet_specs) do - local snippets = process_marks(v[1], v[2][1], v[3], marks) - for _, value in pairs(snippets) do - table.insert(todo_comment_snippets, value) - end -end - -ls.add_snippets("all", todo_comment_snippets, { type = "snippets", key = "todo_comments" }) - --- }}} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua deleted file mode 100644 index 568c97ec..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua +++ /dev/null @@ -1,102 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1)) - end -end - -local line_begin = require("luasnip.extras.expand_conditions").line_begin - -return { - -- HEADER - s( - { - trig = "h([123456])", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmt( - [[ - <h{}>{}</h{}> - ]], - { - f(function(_, snip) return snip.captures[1] end), - d(1, get_visual), - f(function(_, snip) return snip.captures[1] end), - } - ), - { condition = line_begin } - ), -- PARAGRAPH - s( - { trig = "pp", snippetType = "autosnippet" }, - fmt( - [[ - <p>{}</p> - ]], - { d(1, get_visual) } - ), - { condition = line_begin } - ), -- UNORDERED LIST - s( - { trig = "itt", snippetType = "autosnippet" }, - fmt( - [[ - <ul> - <li>{}</li>{} - </ul> - ]], - { i(1), i(0) } - ), - { condition = line_begin } - ), -- LIST ITEM - s( - { trig = "ii", snippetType = "autosnippet" }, - fmt( - [[ - <li>{}</li> - ]], - { d(1, get_visual) } - ), - { condition = line_begin } - ), - -- DOCUMENT TEMPLATE - s( - { trig = "base" }, - fmt( - [[ - <!doctype HTML> - <html lang="en"> - <head> - <meta charset="UTF-8"> - <title>{}</title> - </head> - <body> - {} - </body> - </html> - ]], - { i(1, "FooBar"), i(0) } - ), - { condition = line_begin } - ), -- ANCHOR TAG - s( - { - trig = "([^%l])aa", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmt( - [[ - {}<a href="{}">{}</a> - ]], - { - f(function(_, snip) return snip.captures[1] end), - i(1), - d(2, get_visual), - } - ) - ), -} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua deleted file mode 100644 index ef453973..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua +++ /dev/null @@ -1,28 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end - -local translation_table = { ["("] = ")", ["{"] = "}", ["["] = "]" } - --- Return snippet tables -return { - -- LEFT/RIGHT ALL BRACES - s( - { - trig = "([^%a])l([%(%[%{])", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmta("<>\\left<><>\\right<>", { - f(function(_, snip) return snip.captures[1] end), - f(function(_, snip) return snip.captures[2] end), - d(1, get_visual), - f(function(_, snip) return translation_table[snip.captures[2]] end), - }) - ), -} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua deleted file mode 100644 index ebf4f9d7..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Return snippet tables -return { - s({ trig = ";a", snippetType = "autosnippet" }, { t("\\alpha") }), - s({ trig = ";b", snippetType = "autosnippet" }, { t("\\beta") }), - s({ trig = ";g", snippetType = "autosnippet" }, { t("\\gamma") }), - s({ trig = ";G", snippetType = "autosnippet" }, { t("\\Gamma") }), - s({ trig = ";d", snippetType = "autosnippet" }, { t("\\delta") }), - s({ trig = ";D", snippetType = "autosnippet" }, { t("\\Delta") }), - s({ trig = ";e", snippetType = "autosnippet" }, { t("\\epsilon") }), - s({ trig = ";ve", snippetType = "autosnippet" }, { t("\\varepsilon") }), - s({ trig = ";z", snippetType = "autosnippet" }, { t("\\zeta") }), - s({ trig = ";h", snippetType = "autosnippet" }, { t("\\eta") }), - s({ trig = ";o", snippetType = "autosnippet" }, { t("\\theta") }), - s({ trig = ";vo", snippetType = "autosnippet" }, { t("\\vartheta") }), - s({ trig = ";O", snippetType = "autosnippet" }, { t("\\Theta") }), - s({ trig = ";k", snippetType = "autosnippet" }, { t("\\kappa") }), - s({ trig = ";l", snippetType = "autosnippet" }, { t("\\lambda") }), - s({ trig = ";L", snippetType = "autosnippet" }, { t("\\Lambda") }), - s({ trig = ";m", snippetType = "autosnippet" }, { t("\\mu") }), - s({ trig = ";n", snippetType = "autosnippet" }, { t("\\nu") }), - s({ trig = ";x", snippetType = "autosnippet" }, { t("\\xi") }), - s({ trig = ";X", snippetType = "autosnippet" }, { t("\\Xi") }), - s({ trig = ";i", snippetType = "autosnippet" }, { t("\\pi") }), - s({ trig = ";I", snippetType = "autosnippet" }, { t("\\Pi") }), - s({ trig = ";r", snippetType = "autosnippet" }, { t("\\rho") }), - s({ trig = ";s", snippetType = "autosnippet" }, { t("\\sigma") }), - s({ trig = ";S", snippetType = "autosnippet" }, { t("\\Sigma") }), - s({ trig = ";t", snippetType = "autosnippet" }, { t("\\tau") }), - s({ trig = ";f", snippetType = "autosnippet" }, { t("\\phi") }), - s({ trig = ";vf", snippetType = "autosnippet" }, { t("\\varphi") }), - s({ trig = ";F", snippetType = "autosnippet" }, { t("\\Phi") }), - s({ trig = ";c", snippetType = "autosnippet" }, { t("\\chi") }), - s({ trig = ";p", snippetType = "autosnippet" }, { t("\\psi") }), - s({ trig = ";P", snippetType = "autosnippet" }, { t("\\Psi") }), - s({ trig = ";w", snippetType = "autosnippet" }, { t("\\omega") }), - s({ trig = ";W", snippetType = "autosnippet" }, { t("\\Omega") }), -} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua new file mode 100644 index 00000000..371f5539 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua @@ -0,0 +1,338 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +local ls = require("luasnip") +local fmt = require("luasnip.extras.fmt").fmt + +--- Get the comment string {begin,end} table +--- +---@param comment_type integer 1 for `line`-comment and 2 for `block`-comment +---@return table comment_strings {["begin"]=begin_comment_string, ["end"]=end_comment_string} +local get_comment_string = function(comment_type) + local calculate_comment_string = require("Comment.ft").calculate + local utils = require("Comment.utils") + + -- use the `Comments.nvim` API to fetch the comment string for the region (eq. '--%s' or '--[[%s]]' for `lua`) + local cstring = + calculate_comment_string({ ctype = comment_type; range = utils.get_region(); }) + + if cstring == nil then + -- TODO: Use `vim.bo.commentstring` <2025-05-02> + + -- Use some useful default values. + return { ["begin"] = "#"; ["end"] = ""; } + end + + -- as we want only the strings themselves and not strings ready for using `format` we want to split the left and right side + local left, right = utils.unwrap_cstr(cstring) + + -- create a `{left, right}` table for it + return { ["begin"] = left; ["end"] = right; } +end + +--- Wraps a table of snippet nodes in two comment function nodes. +--- +---@param comment_type integer 1 for `line`-comment and 2 for `block`-comment +---@param nodes table The nodes that should be wrapped +---@return table wrapped_nodes The now wrapped `nodes` table. +local wrap_snippet_in_comments = function(comment_type, nodes) + local output = {} + + table.insert(output, ls.function_node(function() + return get_comment_string(comment_type)["begin"] + end)) + + + for _, v in ipairs(nodes) do + table.insert(output, v) + end + + table.insert(output, ls.function_node(function() + return get_comment_string(comment_type)["end"] + end)) + + return output +end + +-- auto_pairs {{{ +local get_visual = function(_, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return ls.snippet_node(nil, ls.insert_node(1, parent.snippet.env.SELECT_RAW)) + else + return ls.snippet_node(nil, ls.insert_node(1, "")) + end +end + +local function char_count_same(c1, c2) + local line = vim.api.nvim_get_current_line() + -- '%'-escape chars to force explicit match (gsub accepts patterns). + -- second return value is number of substitutions. + local _, ct1 = string.gsub(line, "%" .. c1, "") + local _, ct2 = string.gsub(line, "%" .. c2, "") + return ct1 == ct2 +end + +local function even_count(c, ...) + local line = vim.api.nvim_get_current_line() + local _, ct = string.gsub(line, c, "") + return ct % 2 == 0 +end + +-- This makes creation of pair-type snippets easier. +local function pair(pair_begin, pair_end, file_types, condition_function) + -- FIXME(@Soispha): This only works if file_types == nil, otherwise the snippet does not expand. + -- It would be nice, if it would support both an empty array (`{}`) and nil <2023-08-27> + -- file_types = file_types or {}; + + return ls.snippet( + { + trig = pair_begin; + wordTrig = false; + snippetType = "autosnippet"; + }, + { + ls.text_node({ pair_begin; }); + ls.dynamic_node(1, get_visual); + ls.text_node({ pair_end; }); + }, + { + condition = function() + local filetype_check = true + + if file_types ~= nil then + filetype_check = file_types[vim.bo.filetype] or false + end + + return (not condition_function(pair_begin, pair_end)) and filetype_check + end; + } + ) +end + +local auto_pairs = { + pair("(", ")", nil, char_count_same); + pair("{", "}", nil, char_count_same); + pair("[", "]", nil, char_count_same); + pair("<", ">", { ["rust"] = true; ["tex"] = true; }, char_count_same); + pair("'", "'", nil, even_count); + pair("\"", "\"", nil, even_count); + pair("`", "`", nil, even_count); +} + +ls.add_snippets("all", auto_pairs, { type = "snippets"; key = "auto_pairs"; }) +-- }}} + +-- todo_comments {{{ +local read_git_config = function(config_value) + local command = string.format("git config \"%s\"", config_value) + + local handle = io.popen(command) + if handle == nil then + return error(string.format("Failed to call `%s`.", command)) + end + + local result = handle:read("*a") + handle:close() + + -- stripped = string.gsub(str, '%s+', '') + return string.gsub(result, "\n", "") +end + +--- Create a @handle from a full name. +--- +--- Example: +--- “Benedikt Peetz” -> “@bpeetz” +local handle_from_name = function(name) + -- from: https://stackoverflow.com/a/7615129 + local split = function(inputstr, sep) + local t = {} + for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do + table.insert(t, str) + end + return t + end + + -- Split on spaces + local parts = split(name, "%s") + + local output_name = "" + + if #parts > 2 then + -- Only use the first chars. + -- + -- Example: + -- “Richard Matthew Stallman” -> “rms” + for _, val in ipairs(parts) do + output_name = string.format("%s%s", output_name, val:sub(1, 1)) + end + elseif #parts == 2 then + output_name = string.format("%s%s", parts[1]:sub(1, 1), parts[2]) + elseif #parts == 1 then + output_name = parts[1] + elseif #parts == 0 then + output_name = "<NoName>" + end + + return string.format("@%s", output_name:lower()) +end + +--- Generate a comment snippet +--- +---@param trig string The trigger +---@param name string name for the comment (ex.: {FIX, ISSUE, FIXIT, BUG}) +---@param comment_type integer The comment type. +---@param mark_function function: The function used to get the marks +local todo_snippet = function(trig, name, comment_type, mark_function) + assert(trig, "context doesn't include a `trig` key which is mandatory") + assert(comment_type == 1 or comment_type == 2) + + local context = {} + context.name = name .. " comment" + context.trig = trig + + local date_node, signature_node = mark_function() + + local nodes = fmt("{} {}{}: {} {} {}", wrap_snippet_in_comments(comment_type, { + ls.text_node(name); + signature_node; + ls.insert_node(1, "content"); + date_node; + })) + + return ls.snippet(context, nodes, { ctype = comment_type; }) +end + +---@param trigger string: The luasnip trigger +---@param comment_type integer: The luasnip comment type +---@param name string: All aliases for a name +---@return table: All possible snippets build from the marks +local process_marks = function(trigger, name, comment_type) + local username = function() + return handle_from_name(read_git_config("user.name")) + end + + local marks = { + signature = function() + return ls.text_node("(" .. username() .. ")"), ls.text_node("") + end; + + date_signature = function() + return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("(" .. username() .. ")") + end; + + date = function() + return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("") + end; + + empty = function() + return ls.text_node(""), ls.text_node("") + end; + } + + local output = {} + for mark_name, mark_function in pairs(marks) do + local trig = trigger .. "-" .. mark_name + + output[#output + 1] = todo_snippet(trig, name, comment_type, mark_function) + end + + return output +end + +local todo_snippet_specs = { + { { trig = "todo"; }; { "TODO"; }; { ctype = 1; }; }; + { { trig = "fix"; }; { "FIXME"; "ISSUE"; }; { ctype = 1; }; }; + { { trig = "hack"; }; { "HACK"; }; { ctype = 1; }; }; + { { trig = "warn"; }; { "WARNING"; }; { ctype = 1; }; }; + { { trig = "perf"; }; { "PERFORMANCE"; "OPTIMIZE"; }; { ctype = 1; }; }; + { { trig = "note"; }; { "NOTE"; "INFO"; }; { ctype = 1; }; }; + + -- NOTE: Block commented todo-comments + { { trig = "todob"; }; { "TODO"; }; { ctype = 2; }; }; + { { trig = "fixb"; }; { "FIXME"; "ISSUE"; }; { ctype = 2; }; }; + { { trig = "hackb"; }; { "HACK"; }; { ctype = 2; }; }; + { { trig = "warnb"; }; { "WARNING"; }; { ctype = 2; }; }; + { { trig = "perfb"; }; { "PERF"; "PERFORMANCE"; "OPTIM"; "OPTIMIZE"; }; { ctype = 2; }; }; + { { trig = "noteb"; }; { "NOTE"; "INFO"; }; { ctype = 2; }; }; +} + +local todo_comment_snippets = {} +for _, v in ipairs(todo_snippet_specs) do + local snippets = process_marks(v[1].trig, v[2][1], v[3].ctype) + for _, value in pairs(snippets) do + table.insert(todo_comment_snippets, value) + end +end + +ls.add_snippets("all", todo_comment_snippets, { type = "snippets"; key = "todo_comments"; }) +-- }}} + +-- spdx snippets {{{ +local generate_spdx_snippet = function(comment_type, spdx_license_expr, trigger) + assert(trigger, "context doesn't include a `trig` key which is mandatory") + assert(comment_type == 1 or comment_type == 2) + + local context = {} + context.name = trigger .. " spdx snippet expr" + context.trig = trigger + + + local nodes = { + fmt("{} SPDX-SnippetBegin {}", wrap_snippet_in_comments(comment_type, {})); + + fmt("{} SPDX-SnippetCopyrightText: {} {} <{}> {}", + wrap_snippet_in_comments(comment_type, { + ls.insert_node(1, "year"); + ls.insert_node(2, "author"); + ls.insert_node(3, "email"); + }) + ); + + fmt("{} SPDX-License-Identifier: {} {}", wrap_snippet_in_comments(comment_type, { + ls.text_node(spdx_license_expr); + })); + + { ls.insert_node(4, "content"); }; + + fmt("{} SPDX-SnippetEnd {}", wrap_snippet_in_comments(comment_type, {})); + + { ls.insert_node(0); }; + } + + local newline_nodes = {} + for _, sub_nodes in ipairs(nodes) do + for _, node in ipairs(sub_nodes) do + table.insert(newline_nodes, node) + end + + -- luasnip requires newlines to be encoded like this: + table.insert(newline_nodes, ls.text_node({ ""; ""; })) + end + + return ls.snippet(context, newline_nodes, { ctype = comment_type; }) +end + +local spdx = { + { trigger = "spdx-AGPL3+"; license = "AGPL-3.0-or-later"; }; + { trigger = "spdx-GPL3+"; license = "GPL-3.0-or-later"; }; + { trigger = "spdx-MIT"; license = "MIT"; }; +} + +local spdx_snippets = {} +for _, value in ipairs(spdx) do + local snippet = generate_spdx_snippet(1, value.license, value.trigger) + table.insert(spdx_snippets, snippet) + + snippet = generate_spdx_snippet(2, value.license, value.trigger .. "-block") + table.insert(spdx_snippets, snippet) +end + +ls.add_snippets("all", spdx_snippets, { type = "snippets"; key = "spdx_snippets"; }) +-- }}} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua new file mode 100644 index 00000000..bcd128f7 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua @@ -0,0 +1,41 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +local ls = require("luasnip") +local fmt = require("luasnip.extras.fmt").fmt + +local get_visual = function(_, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return ls.snippet_node(nil, ls.insert_node(1, parent.snippet.env.SELECT_RAW)) + else + return ls.snippet_node(nil, ls.insert_node(1, "")) + end +end + +local translation_table = { ["("] = ")"; ["{"] = "}"; ["["] = "]"; } + +-- Return snippet tables +return { + -- LEFT/RIGHT ALL BRACES + ls.snippet( + { + trig = "([^%a])l([%(%[%{])"; + regTrig = true; + wordTrig = false; + snippetType = "autosnippet"; + }, + fmt("{}\\left{}{}\\right{}", { + ls.function_node(function(_, snip) return snip.captures[1] end); + ls.function_node(function(_, snip) return snip.captures[2] end); + ls.dynamic_node(1, get_visual); + ls.function_node(function(_, snip) return translation_table[snip.captures[2]] end); + }) + ); +} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua new file mode 100644 index 00000000..21aa7414 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua @@ -0,0 +1,49 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +local ls = require("luasnip") + +-- Return snippet tables +return { + ls.snippet({ trig = ";a"; snippetType = "autosnippet"; }, { ls.text_node("\\alpha"); }); + ls.snippet({ trig = ";b"; snippetType = "autosnippet"; }, { ls.text_node("\\beta"); }); + ls.snippet({ trig = ";g"; snippetType = "autosnippet"; }, { ls.text_node("\\gamma"); }); + ls.snippet({ trig = ";G"; snippetType = "autosnippet"; }, { ls.text_node("\\Gamma"); }); + ls.snippet({ trig = ";d"; snippetType = "autosnippet"; }, { ls.text_node("\\delta"); }); + ls.snippet({ trig = ";D"; snippetType = "autosnippet"; }, { ls.text_node("\\Delta"); }); + ls.snippet({ trig = ";e"; snippetType = "autosnippet"; }, { ls.text_node("\\epsilon"); }); + ls.snippet({ trig = ";ve"; snippetType = "autosnippet"; }, { ls.text_node("\\varepsilon"); }); + ls.snippet({ trig = ";z"; snippetType = "autosnippet"; }, { ls.text_node("\\zeta"); }); + ls.snippet({ trig = ";h"; snippetType = "autosnippet"; }, { ls.text_node("\\eta"); }); + ls.snippet({ trig = ";o"; snippetType = "autosnippet"; }, { ls.text_node("\\theta"); }); + ls.snippet({ trig = ";vo"; snippetType = "autosnippet"; }, { ls.text_node("\\vartheta"); }); + ls.snippet({ trig = ";O"; snippetType = "autosnippet"; }, { ls.text_node("\\Theta"); }); + ls.snippet({ trig = ";k"; snippetType = "autosnippet"; }, { ls.text_node("\\kappa"); }); + ls.snippet({ trig = ";l"; snippetType = "autosnippet"; }, { ls.text_node("\\lambda"); }); + ls.snippet({ trig = ";L"; snippetType = "autosnippet"; }, { ls.text_node("\\Lambda"); }); + ls.snippet({ trig = ";m"; snippetType = "autosnippet"; }, { ls.text_node("\\mu"); }); + ls.snippet({ trig = ";n"; snippetType = "autosnippet"; }, { ls.text_node("\\nu"); }); + ls.snippet({ trig = ";x"; snippetType = "autosnippet"; }, { ls.text_node("\\xi"); }); + ls.snippet({ trig = ";X"; snippetType = "autosnippet"; }, { ls.text_node("\\Xi"); }); + ls.snippet({ trig = ";i"; snippetType = "autosnippet"; }, { ls.text_node("\\pi"); }); + ls.snippet({ trig = ";I"; snippetType = "autosnippet"; }, { ls.text_node("\\Pi"); }); + ls.snippet({ trig = ";r"; snippetType = "autosnippet"; }, { ls.text_node("\\rho"); }); + ls.snippet({ trig = ";s"; snippetType = "autosnippet"; }, { ls.text_node("\\sigma"); }); + ls.snippet({ trig = ";S"; snippetType = "autosnippet"; }, { ls.text_node("\\Sigma"); }); + ls.snippet({ trig = ";t"; snippetType = "autosnippet"; }, { ls.text_node("\\tau"); }); + ls.snippet({ trig = ";f"; snippetType = "autosnippet"; }, { ls.text_node("\\phi"); }); + ls.snippet({ trig = ";vf"; snippetType = "autosnippet"; }, { ls.text_node("\\varphi"); }); + ls.snippet({ trig = ";F"; snippetType = "autosnippet"; }, { ls.text_node("\\Phi"); }); + ls.snippet({ trig = ";c"; snippetType = "autosnippet"; }, { ls.text_node("\\chi"); }); + ls.snippet({ trig = ";p"; snippetType = "autosnippet"; }, { ls.text_node("\\psi"); }); + ls.snippet({ trig = ";P"; snippetType = "autosnippet"; }, { ls.text_node("\\Psi"); }); + ls.snippet({ trig = ";w"; snippetType = "autosnippet"; }, { ls.text_node("\\omega"); }); + ls.snippet({ trig = ";W"; snippetType = "autosnippet"; }, { ls.text_node("\\Omega"); }); +} diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix index 03afb16c..ea451d3a 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/default.nix +++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -44,11 +53,7 @@ in { __empty = null; }; "core.dirman".config = { - workspaces = { - general = "~/repos/notes/general"; - journal = "~/repos/notes/journal"; - projects = "~/repos/notes/projects"; - }; + workspaces = { }; }; "core.export".config = { __empty = null; diff --git a/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua b/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua index e2ebb653..5391bf0b 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua +++ b/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + -- Override some of my default key mappings to better integrate into neorg. -- They still to the same conceptual thing. diff --git a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix index 8d61dbd7..315f3fc7 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -5,49 +14,82 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim.plugins.cmp = lib.mkIf cfg.enable { - /* - TODO: integrate this: - ```lua - enabled = { - function() - -- disable completion in comments - local context = require 'cmp.config.context' - -- keep command mode completion enabled when cursor is in a comment - -- te - if vim.api.nvim_get_mode().mode == 'c' then - return true - else - return not context.in_treesitter_capture("comment") - and not context.in_syntax_group("Comment") + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + opts.completeopt = [ + "menu" # Show completions in a menu + "menuone" # Also open menu, when only one completion exists + "noselect" # Do not pre select one of the completions + ]; + + keymaps = [ + { + key = "hh"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').select_next_item() end - end - }, - ``` - */ - enable = true; - autoEnableSources = true; - settings = { - mapping = { - # TODO: add support for desc and which key here - "<C-d>" = "cmp.mapping.scroll_docs(-4)"; # desc = "Scroll up by four lines" - "<C-f>" = "cmp.mapping.scroll_docs(4)"; # desc = "Scroll down by four lines" - "HH" = "cmp.mapping.complete()"; # desc = "Confirm snipped" - }; + ''; + options.desc = "go forward in completion menu"; + } + { + key = "uu"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').confirm() + end + ''; + options.desc = "confirm the selected item"; + } + + { + key = "<C-d>"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').mapping.scroll_docs(-4) + end + ''; + options.desc = "Scroll up by four lines"; + } + { + key = "<C-f>"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').mapping.scroll_docs(4) + end + ''; + options.desc = "Scroll down by four lines"; + } + ]; + + plugins.cmp = { + enable = true; + autoEnableSources = true; - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + settings = { + mapping = {}; - sources = [ - {name = "nvim_lsp";} - {name = "luasnip";} - {name = "path";} - {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> - # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> - # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> - # {name = "buffer";} - # {name = "digraphs";} - {name = "calc";} - ]; + snippet.expand.__raw = '' + function(args) + require('luasnip').lsp_expand(args.body) + end + ''; + + sources = [ + {name = "nvim_lsp";} + {name = "luasnip";} + {name = "path";} + {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> + # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> + # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> + # {name = "buffer";} + # {name = "digraphs";} + {name = "calc";} + ]; + }; }; }; } diff --git a/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix index ee057a9b..90e81832 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua b/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua index 770c3bb5..5b5fd4b8 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("lint").linters_by_ft = { -- text markdown = {}, diff --git a/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix b/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix deleted file mode 100644 index e5d401a0..00000000 --- a/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.soispha.programs.nvim; -in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # Not all plugins have own modules - # You can add missing plugins here - # `pkgs.vimExtraPlugins` is added by the overlay you added at the beginning - # For a list of available plugins, look here: - # https://github.com/jooooscha/nixpkgs-vim-extra-plugins/blob/main/plugins.md - extraPlugins = [ - ]; - }; -} diff --git a/modules/by-name/nv/nvim/plgs/telescope/default.nix b/modules/by-name/nv/nvim/plgs/telescope/default.nix index 193ee1ac..b2c66edc 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix index 11d04304..7cfe9698 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix index 818aa18e..693db974 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix @@ -1,32 +1,36 @@ -{ - pkgs, - config, - lib, - ... -}: let +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{config, ...}: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - extraPlugins = [ - pkgs.vimExtraPlugins.telescope-bibtex-nvim - ]; - - # Only activate this in tex files. - # TODO: Why? <2024-11-23> - extraFiles = { - "ftplugin/tex.lua".text = '' - ${lib.strings.fileContents ./tex.lua} - ''; - }; - - keymaps = [ - { - key = "<space>ib"; - # This is registered in the ftplugin file, so we set this to null here - action = "<Nop>"; - mode = "n"; - options.desc = "[i]nsert a [b]atex citation"; - } - ]; - }; + # TODO: Re-enable this, once the plugin is merged into nixpkgs <2025-03-29> + # home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # extraPlugins = [ + # pkgs.vimExtraPlugins.telescope-bibtex-nvim + # ]; + # + # # Only activate this in tex files. + # extraFiles = { + # "ftplugin/tex.lua".text = '' + # ${lib.strings.fileContents ./tex.lua} + # ''; + # }; + # + # keymaps = [ + # { + # key = "<space>ib"; + # # This is registered in the ftplugin file, so we set this to null here + # action = "<Nop>"; + # mode = "n"; + # options.desc = "[i]nsert a [b]atex citation"; + # } + # ]; + # }; } diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua index 4107a7c5..fbe7c993 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + -- local used = false; -- vim.keymap.set('n', '<leader>t', function() -- used = not used; diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix index 0b1e033a..0b0ed0f6 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ ./bibtex diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix index f4e3d116..3d5eae99 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix index 4194e688..7a2fc164 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix index 6153b063..4d91e988 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua index 48a8588d..b6542429 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- SPDX-License-Identifier: GPL-3.0-or-later +-- +-- This file is part of my nixos-config. +-- +-- You should have received a copy of the License along with this program. +-- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + -- Taken from: https://github.com/desdic/telescope-rooter.nvim/blob/69423216c75a5f1f1477bbf8faf6b0dc8af04099/lua/telescope/_extensions/rooter.lua local has_telescope, telescope = pcall(require, "telescope") if not has_telescope then diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix index adbb466a..1f82523d 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix index a474f097..d5cc55f5 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/todo-comments/default.nix b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix index ddbe367d..cd1a7dbf 100644 --- a/modules/by-name/nv/nvim/plgs/todo-comments/default.nix +++ b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/treesitter/default.nix b/modules/by-name/nv/nvim/plgs/treesitter/default.nix index 02088d0a..ed1499f8 100644 --- a/modules/by-name/nv/nvim/plgs/treesitter/default.nix +++ b/modules/by-name/nv/nvim/plgs/treesitter/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, @@ -6,15 +15,17 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha. programs.nixvim = lib.mkIf cfg.enable { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # NOTE: These are required to build grammars, but I already use the nix grammars <2024-07-13> + dependencies = { + tree-sitter.enable = false; + nodejs.enable = false; + gcc.enable = false; + }; + plugins.treesitter = { enable = true; - # NOTE: These are required to build grammars, but I already use the nix grammars <2024-07-13> - gccPackage = null; - nodejsPackage = null; - treesitterPackage = null; - # inject nixvim specific highlighting (eg in extraConfigLua). nixvimInjections = true; @@ -39,7 +50,7 @@ in { # Set this to `true` if you depend on 'syntax' being enabled (like for indentation). # Using this option may slow down your editor; and you may see some duplicate highlights. # Instead of true it can also be a list of languages - additionalVimRegexHighlighting = ["latex"]; + additionalVimRegexHighlighting = []; }; incrementalSelection = { diff --git a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix index 680f169a..739b69d9 100644 --- a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix +++ b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/which-key/default.nix b/modules/by-name/nv/nvim/plgs/which-key/default.nix index 20004bb1..e5bca546 100644 --- a/modules/by-name/nv/nvim/plgs/which-key/default.nix +++ b/modules/by-name/nv/nvim/plgs/which-key/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ol/ollama/module.nix b/modules/by-name/ol/ollama/module.nix index bd0baaa6..f819c035 100644 --- a/modules/by-name/ol/ollama/module.nix +++ b/modules/by-name/ol/ollama/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -28,6 +37,16 @@ in { services.ollama = { enable = true; acceleration = false; + + # TODO: This could work for GPU acceleration. <2024-12-20> + # acceleration = "rocm"; + # host = "127.0.0.1"; + # port = 11434; + # environmentVariables = { + # HCC_AMDGPU_TARGET = "gfx1032"; # used to be necessary, but doesn't seem to anymore + # }; + # + # rocmOverrideGfx = "10.3.2"; }; }; } diff --git a/modules/by-name/op/openssh/module.nix b/modules/by-name/op/openssh/module.nix index b733dbe7..97cf7fd7 100644 --- a/modules/by-name/op/openssh/module.nix +++ b/modules/by-name/op/openssh/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { services.openssh = { enable = true; diff --git a/modules/by-name/pi/printing/module.nix b/modules/by-name/pi/printing/module.nix index 85d15b16..cfcd2154 100644 --- a/modules/by-name/pi/printing/module.nix +++ b/modules/by-name/pi/printing/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/po/polkit/module.nix b/modules/by-name/po/polkit/module.nix index fb13505b..c6d1c750 100644 --- a/modules/by-name/po/polkit/module.nix +++ b/modules/by-name/po/polkit/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/po/postgresql/module.nix b/modules/by-name/po/postgresql/module.nix index 62233e96..5cdf6c77 100644 --- a/modules/by-name/po/postgresql/module.nix +++ b/modules/by-name/po/postgresql/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/po/power/module.nix b/modules/by-name/po/power/module.nix index 13013879..3489853c 100644 --- a/modules/by-name/po/power/module.nix +++ b/modules/by-name/po/power/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/qu/qutebrowser/include/redirects.py b/modules/by-name/qu/qutebrowser/include/redirects.py new file mode 100644 index 00000000..23456a25 --- /dev/null +++ b/modules/by-name/qu/qutebrowser/include/redirects.py @@ -0,0 +1,64 @@ +# Based on the redirect scripts from here: +# - https://github.com/Phantop/dotfiles/blob/9f6256820dbb99cdf5afd373b74d93fe8b8972d7/qutebrowser/include/redirects.py +# - https://gitlab.com/jgkamat/dotfiles/-/blob/0e5f05d347079a9839cb2c7878fd81d9850928ce/qutebrowser/.config/qutebrowser/pyconfig/redirectors.py + +from qutebrowser.api import interceptor, message + +import operator +import typing + +from PyQt6.QtCore import QUrl + + +def get_host(url: QUrl, base: bool = False) -> str: + host = url.host() + if base: + # www.someSite.com -> someSite.com + return ".".join(host.split(".")[-2:]) + else: + return host + + +def partial(func, *part_args): + def wrapper(*extra_args): + return func(*part_args, *extra_args) + + return wrapper + + +def farside_redir(target: str, url: QUrl) -> bool: + url.setHost("farside.link") + url.setPath("/" + target + url.path()) + return True + + +# Any return value other than a literal 'False' means we redirect +REDIRECT_MAP: typing.Dict[str, typing.Callable[..., typing.Optional[bool]]] = { + "reddit.com": operator.methodcaller("setHost", "redlib.vhack.eu"), + # Source: https://libredirect.github.io/ + "medium.com": partial(farside_redir, "scribe"), + "stackoverflow.com": partial(farside_redir, "anonymousoverflow"), + "goodreads.com": partial(farside_redir, "biblioreads"), +} + + +def rewrite(info: interceptor.Request): + if ( + info.resource_type != interceptor.ResourceType.main_frame + or info.request_url.scheme() in {"data", "blob"} + ): + return + + url = info.request_url + + redir = REDIRECT_MAP.get(get_host(url, base=False)) + if redir is None: + # Try again, but now only with the base host. + redir = REDIRECT_MAP.get(get_host(url, base=True)) + + if redir is not None and redir(url) is not False: + message.info("Redirecting to " + url.toString()) + info.redirect(url) + + +interceptor.register(rewrite) diff --git a/modules/by-name/qu/qutebrowser/module.hm.nix b/modules/by-name/qu/qutebrowser/module.hm.nix new file mode 100644 index 00000000..3f0f0d52 --- /dev/null +++ b/modules/by-name/qu/qutebrowser/module.hm.nix @@ -0,0 +1,490 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.programs.qutebrowser; + + /* + Flattens an attribute set of key values to stringified keys and their values. + + This is necessary, as qutebrowser only understands key value settings. + + ## Determining the keys and values + + Currently, this function will recursively iterate through the `configAttrs`, whilst + adding up the attribute keys, until one of the following conditions apply: + - The value is not an attribute set. + - The value is “marked” as being a raw attribute set. This is done automatically via the + `apply` functions in the option that take attribute sets (i.e., dictionaries) as + values. + + ## Marking an attribute set as value + Currently, this function assumes that a attribute set is meant as value, if it's key is + `__raw`. For example: + ```nix + { + bindings.command.__raw = { + normal.L = "close"; + }; + } + ``` + + # Type + + flattenSettings :: AttrSet -> [{key :: String; value :: Any}] + + # Arguments + + configAttrs + : The configuration attribute set to flatten. + + # Examples + + flattenSettings {aliases.__raw = {c = "close";}; colors.background = "0xffffff00";} + => [ + {key = "aliases"; value = {c = "close";};} + {key = "colors.background"; value = "0xffffff00";} + ] + */ + flattenSettings = let + isValue = aS: (builtins.attrNames aS) == ["__raw"]; + in + configAttrs: + lib.collect (aS: (builtins.attrNames aS) == ["key" "value"]) ( + lib.attrsets.mapAttrsRecursiveCond (a: !(isValue a)) ( + path: value: + assert builtins.isList path; { + key = lib.concatStringsSep "." path; + inherit value; + } + ) + configAttrs + ); + + pythonize = identCount: v: let + nextIdentCount = identCount + 2; + prevIdentCount = identCount - 2; + ident = builtins.concatStringsSep "" (builtins.genList (_: " ") identCount); + prevIdent = builtins.concatStringsSep "" (builtins.genList (_: " ") prevIdentCount); + in + if v == null + then "None" + else if builtins.isBool v + then + ( + if v + then "True" + else "False" + ) + else if builtins.isString v + then ''"${lib.escape ["\"" "\\"] v}"'' + else if builtins.isInt v + then builtins.toString v + else if builtins.isList v + then + ( + let + items = builtins.map (pythonize nextIdentCount) v; + in + if (builtins.length items) < 2 + then "[${builtins.concatStringsSep "," items}]" + else "[\n${ident}${builtins.concatStringsSep ",\n${ident}" items}\n${prevIdent}]" + ) + else if builtins.isAttrs v + then + if (v ? __raw && v.__raw == null) + # Make it possible to skip values, as we would otherwise unconditional override the + # non-set default values with `{}`. + then null + else if (v ? __raw && builtins.isList v.__raw) + # The raw value is already pre-rendered (e.g., used by the bindings.commands to use + # the `config.bind` functions instead of setting the keys directly.) + then v.__raw + else + ( + # {key = "value"; other = "other";} -> "{'key': 'value', 'other': 'other'}" + let + items = + lib.attrsets.mapAttrsToList + (key: value: ''${pythonize nextIdentCount key}: ${pythonize nextIdentCount value}'') + (v.__raw or v); + in + if (builtins.length items) == 0 + then "{}" + else "{\n${ident}${builtins.concatStringsSep ",\n${ident}" items}\n${prevIdent}}" + ) + else builtins.throw "Cannot serialize a '${builtins.typeOf v}' as python value."; + + configSet = keyValue: maybe_url: let + value = pythonize 2 keyValue.value; + in + if value == null + then "" + else if builtins.isList value + then builtins.concatStringsSep "\n" value + else "config.set(${pythonize 2 keyValue.key}, ${value}${ + if (maybe_url != null) + then ", ${maybe_url}" + else "" + })"; + urlConfigSet = url: conf: builtins.map (c: configSet c url) (flattenSettings conf); + extraConfigSet = name: path_or_string: ''config.source("${ + if (builtins.isPath path_or_string) + then path_or_string + else pkgs.writeText name path_or_string + }")''; + + mkRaw = value: {__raw = value;}; + formatQuickmarks = n: s: "${n} ${s}"; + + settingsType = lib.types.submodule { + freeformType = lib.types.attrsOf lib.types.anything; + options = { + # A list of config keys, that take dicts and need special handling: + # (See their configdata.yml for the source of this list) + # aliases + # bindings.commands + # bindings.default + # bindings.key_mappings + # content.headers.custom + # content.javascript.log + # hints.selectors + # statusbar.padding + # url.searchengines + + aliases = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + }; + + bindings = let + keyBindType = lib.types.nullOr (lib.types.attrsOf ( + lib.types.attrsOf ( + lib.types.nullOr ( + lib.types.separatedString " ;; " + ) + ) + )); + in { + key_mappings = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + }; + + # This is special, as we need to use the `config.bind` command, instead of the + # normal one. + commands = lib.mkOption { + type = keyBindType; + default = null; + apply = v: + if v == null + then null + else { + __raw = + lib.lists.flatten + (lib.mapAttrsToList + (mode: mappings: + lib.mapAttrsToList + (key: value: "config.bind(${pythonize 0 key}, ${pythonize 0 value}, mode=${pythonize 0 mode})") + mappings) + v); + }; + example = lib.literalExpression '' + { + normal = { + "<Ctrl-v>" = "spawn mpv {url}"; + ",p" = "spawn --userscript qute-pass"; + ",l" = '''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'''; + "<F1>" = mkMerge [ + "config-cycle tabs.show never always" + "config-cycle statusbar.show in-mode always" + "config-cycle scrolling.bar never always" + ]; + }; + prompt = { + "<Ctrl-y>" = "prompt-yes"; + }; + } + ''; + }; + + default = lib.mkOption { + type = keyBindType; + default = null; + apply = mkRaw; + }; + }; + + content = { + headers = { + custom = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + }; + }; + javascript = { + log = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + }; + }; + }; + + hints = { + selectors = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + }; + }; + + qt = { + environ = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + }; + }; + + url = { + searchengines = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + apply = mkRaw; + example = lib.literalExpression '' + { + w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1"; + aw = "https://wiki.archlinux.org/?search={}"; + nw = "https://wiki.nixos.org/index.php?search={}"; + g = "https://www.google.com/search?hl=en&q={}"; + } + ''; + }; + }; + statusbar = { + padding = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.int); + default = null; + apply = mkRaw; + }; + }; + }; + }; +in { + options.programs.qutebrowser = { + enable = lib.mkEnableOption "qutebrowser"; + + package = lib.mkPackageOption pkgs "qutebrowser" {}; + + loadAutoconfig = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Load settings configured via the GUI. + ''; + }; + + settings = lib.mkOption { + type = settingsType; + + default = {}; + description = '' + Options to add to qutebrowser {file}`config.py` file. + See <https://qutebrowser.org/doc/help/settings.html> + for options. + ''; + example = lib.literalExpression '' + { + colors = { + hints = { + bg = "#000000"; + fg = "#ffffff"; + }; + tabs.bar.bg = "#000000"; + }; + tabs.tabs_are_windows = true; + } + ''; + }; + + quickmarks = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = {}; + description = '' + Quickmarks to add to qutebrowser's {file}`quickmarks` file. + Note that when Home Manager manages your quickmarks, you cannot edit them at runtime. + ''; + example = lib.literalExpression '' + { + nixpkgs = "https://github.com/NixOS/nixpkgs"; + home-manager = "https://github.com/nix-community/home-manager"; + } + ''; + }; + + greasemonkey = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + example = lib.literalExpression '' + [ + (pkgs.fetchurl { + url = "https://raw.githubusercontent.com/afreakk/greasemonkeyscripts/1d1be041a65c251692ee082eda64d2637edf6444/youtube_sponsorblock.js"; + sha256 = "sha256-e3QgDPa3AOpPyzwvVjPQyEsSUC9goisjBUDMxLwg8ZE="; + }) + (pkgs.writeText "some-script.js" ''' + // ==UserScript== + // @name Some Greasemonkey script + // ==/UserScript== + ''') + ] + ''; + description = '' + Greasemonkey userscripts to add to qutebrowser's {file}`greasemonkey` + directory. + ''; + }; + + perUrlSettings = lib.mkOption { + type = lib.types.attrsOf settingsType; + default = {}; + description = '' + Options to set, as in {option}`settings` but per url pattern. + + See <https://qutebrowser.org/doc/help/settings.html> for options, + but beware, that not every option supports being set per-url. + ''; + example = lib.literalExpression '' + { + "zoom.us" = { + content = { + autoplay = true; + media.audio_capture = true; + media.video_capture = true; + }; + }; + "github.com".colors.webpage.darkmode.enabled = false; + }; + ''; + }; + + extraConfig = lib.mkOption { + type = lib.types.attrsOf (lib.types.either lib.types.str lib.types.pathInStore); + default = {}; + description = '' + Extra config snippets. The attribute name is their name, and the value their + value. + ''; + example = lib.literalExpression '' + { + "redirects" = ' ' + from PyQt5.QtCore import QUrl + from qutebrowser.api import interceptor + + def intercept(info: interceptor.Request): + if info.request_url.host() == 'www.youtube.com': + new_url = QUrl(info.request_url) + new_url.setHost('www.invidio.us') + try: + info.redirect(new_url) + except interceptors.RedirectFailedException: + pass + + interceptor.register(intercept) + ' ' + } + ''; + }; + }; + + config = let + qutebrowserConfig = lib.concatStringsSep "\n" ( + [ + ( + if cfg.loadAutoconfig + then "config.load_autoconfig()" + else "config.load_autoconfig(False)" + ) + ] + ++ builtins.map (c: configSet c null) (flattenSettings cfg.settings) + ++ lib.lists.flatten (lib.mapAttrsToList urlConfigSet cfg.perUrlSettings) + ++ lib.mapAttrsToList extraConfigSet cfg.extraConfig + ); + + quickmarksFile = lib.optionals (cfg.quickmarks != {}) lib.concatStringsSep "\n" ( + lib.mapAttrsToList formatQuickmarks cfg.quickmarks + ); + + greasemonkeyDir = + lib.optionals ( + cfg.greasemonkey != [] + ) + pkgs.linkFarmFromDrvs "greasemonkey-userscripts" + cfg.greasemonkey; + in + lib.mkIf cfg.enable { + home = { + packages = [cfg.package]; + + file = { + ".qutebrowser/config.py" = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin { + text = qutebrowserConfig; + }; + + ".qutebrowser/quickmarks" = + lib.mkIf (cfg.quickmarks != {} && pkgs.stdenv.hostPlatform.isDarwin) + { + text = quickmarksFile; + }; + + ".qutebrowser/greasemonkey" = + lib.mkIf (cfg.greasemonkey != [] && pkgs.stdenv.hostPlatform.isDarwin) + { + source = greasemonkeyDir; + }; + }; + }; + + xdg = { + configFile = { + "qutebrowser/config.py" = lib.mkIf pkgs.stdenv.hostPlatform.isLinux { + text = qutebrowserConfig; + onChange = '' + hash="$(echo -n "$USER" | md5sum | cut -d' ' -f1)" + socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash" + if [[ -S $socket ]]; then + command=${ + lib.escapeShellArg ( + builtins.toJSON { + args = [":config-source"]; + target_arg = null; + protocol_version = 1; + } + ) + } + echo "$command" | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:"$socket" + fi + unset hash socket command + ''; + }; + + "qutebrowser/quickmarks" = + lib.mkIf (cfg.quickmarks != {} && pkgs.stdenv.hostPlatform.isLinux) + { + text = quickmarksFile; + }; + + "qutebrowser/greasemonkey" = + lib.mkIf (cfg.greasemonkey != [] && pkgs.stdenv.hostPlatform.isLinux) + { + source = greasemonkeyDir; + }; + }; + }; + }; +} diff --git a/modules/by-name/qu/qutebrowser/module.nix b/modules/by-name/qu/qutebrowser/module.nix new file mode 100644 index 00000000..dab06237 --- /dev/null +++ b/modules/by-name/qu/qutebrowser/module.nix @@ -0,0 +1,106 @@ +{ + config, + lib, + pkgs, + self, + ... +}: let + cfg = config.soispha.programs.qutebrowser; + + qutebrowsersWithProfiles = let + xdg_data_home = config.home-manager.users.soispha.xdg.dataHome; + xdg_config_home = config.home-manager.users.soispha.xdg.configHome; + + mkQutebrowser = name: let + statusbar_widgets = [ + "keypress" + "text:${name}" + "search_match" + "url" + "scroll" + "history" + "tabs" + "progress" + ]; + + statusbar_widgets_str = + # NOTE(@bpeetz): We need either two layers of escaping or the binary wrapper, as we first inline this + # into the runCommand below, and then into the actual qutebrowser wrapper script. <2025-06-16> + lib.strings.escapeShellArg (builtins.toJSON statusbar_widgets); + in + pkgs.runCommandLocal "qutebrowser-${name}" { + nativeBuildInputs = [ + pkgs.makeBinaryWrapper + ]; + } + '' + makeWrapper ${lib.getExe pkgs.qutebrowser-patched} "$out/bin/qutebrowser-${name}" \ + --add-flags --no-err-windows \ + --add-flags --basedir \ + --add-flags "${xdg_data_home}/qutebrowser/${name}" \ + --add-flags --config \ + --add-flags "${xdg_config_home}/qutebrowser/config.py" \ + --add-flags --set \ + --add-flags statusbar.widgets \ + --add-flags ${statusbar_widgets_str} + ''; + in + builtins.filter (val: val != null) (lib.mapAttrsToList (name: value: + if value.enable + then mkQutebrowser name + else null) + cfg.profiles); +in { + options.soispha.programs.qutebrowser = { + enable = lib.mkEnableOption "qutebrowser"; + + key = lib.mkOption { + type = lib.types.str; + description = '' + The gpg key, used when decrypting the keepassxc connection key. + ''; + }; + + profiles = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule { + options = { + enable = + (lib.mkEnableOption "this profile") + // { + default = true; + }; + }; + }); + + description = "A name enable map of profies to create besides the default `default` profile."; + default = {}; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + disabledModules = [ + "${self.inputs.home-manager}/modules/programs/qutebrowser.nix" + ]; + imports = [ + ./module.hm.nix + ]; + + home.packages = qutebrowsersWithProfiles; + + programs.qutebrowser = { + enable = true; + package = pkgs.hello; # TODO: Set to null, once supported <2025-06-06> + + settings = import ./settings { + inherit lib pkgs; + cfg = config.soispha.programs.qutebrowser; + }; + + extraConfig = { + "redirects" = ./include/redirects.py; + }; + }; + }; + }; +} diff --git a/modules/by-name/qu/qutebrowser/settings/default.nix b/modules/by-name/qu/qutebrowser/settings/default.nix new file mode 100644 index 00000000..fc097eac --- /dev/null +++ b/modules/by-name/qu/qutebrowser/settings/default.nix @@ -0,0 +1,537 @@ +{ + lib, + pkgs, + cfg, +}: let + millisecond = 1; + second = 1000 * millisecond; + + wordlist = + pkgs.runCommandNoCCLocal "wordlist" { + nativeBuildInputs = [pkgs.python3]; + } + '' + python ${ + pkgs.writeText "normalize-words" + # python + '' + import string + import os + + # Perform qutebrowser's normalizations, to reduce our dependency closure. + # See <//qutebrowser/qutebrowser/browser/hints.py> for them. + with open("${pkgs.scowl}/share/dict/words.txt", encoding = "latin1") as wordfile: + alphabet = set(string.ascii_lowercase) + hints = set() + lines = (line.rstrip().lower() for line in wordfile) + for word in lines: + if len(word) > 4: + # we don't need words longer than 4 + continue + if set(word) - alphabet: + # contains none-alphabetic chars + continue + for i in range(len(word)): + # remove all prefixes of this word + hints.discard(word[:i + 1]) + hints.add(word) + + with open(os.environ["out"], "w") as out: + for word in hints: + out.write(word) + out.write("\n") + '' + } + ''; +in { + aliases = { + q = "close"; + qa = "quit"; + w = "session-save"; + wq = "quit --save"; + wqa = "quit --save"; + read = "spawn --userscript readability"; + }; + + auto_save = { + interval = 10 * second; + session = true; # Safe/restore the session + }; + + backend = "webengine"; + + bindings = { + default = {}; # Disable the default key bindings + + commands = import ./keybindings.nix {inherit cfg lib;}; + + key_mappings = { + "<Ctrl-6>" = "<Ctrl-^>"; + "<Ctrl-Enter>" = "<Ctrl-Return>"; + "<Ctrl-I>" = "<Tab>"; + "<Ctrl-J>" = "<Return>"; + "<Ctrl-M>" = "<Return>"; + "<Ctrl-[>" = "<Escape>"; + "<Enter>" = "<Return>"; + "<Shift-Enter>" = "<Return>"; + "<Shift-Return>" = "<Return>"; + }; + }; + + changelog_after_upgrade = "minor"; + + fonts = {}; + colors = { + # TODO(@bpeetz): Use a nord color scheme (or stylix). <2025-05-31> + + # Make things readable. + messages.error.fg = "black"; + completion.match.fg = "black"; + + webpage = { + darkmode = { + enabled = true; + algorithm = "lightness-cielab"; + policy = { + images = "smart"; + page = "smart"; + }; + threshold = { + background = 0; # 0 -> always + foreground = 256; # 256 -> always + }; + }; + preferred_color_scheme = "auto"; + }; + }; + + completion = { + cmd_history_max_items = -1; # No limit. + delay = 0; # delay before updating completions in milliseconds. + favorite_paths = []; + height = "50%"; + min_chars = 1; + open_categories = ["searchengines" "quickmarks" "bookmarks" "history" "filesystem"]; + + quick = true; # Select, when only one left. + + scrollbar = { + padding = 0; + width = 0; + }; + + show = "auto"; # Only show, when selected + + shrink = true; + + use_best_match = false; + web_history = { + exclude = []; + max_items = -1; # unlimited. + }; + }; + + confirm_quit = [ + "downloads" + ]; + + content = { + autoplay = false; + + blocking = { + enabled = true; + + # Sources for brave's adblocker + adblock = { + lists = [ + "https://easylist.to/easylist/easylist.txt" + "https://easylist.to/easylist/easyprivacy.txt" + ]; + }; + + # Sources for the (simpler) /etc/hosts based one. + hosts = { + block_subdomains = true; + lists = []; + }; + + method = "adblock"; # Only brave's + whitelist = []; + }; + + # Allow websites to read canvas elements. + canvas_reading = true; + + cookies = { + store = true; + accept = "no-3rdparty"; + }; + + default_encoding = "utf-8"; + + dns_prefetch = true; + + fullscreen = { + # Fullscreen is limited to the browser window. + window = true; + overlay_timeout = 3 * second; + }; + + headers = { + accept_language = "en-CA,sv,en;q=0.9"; + custom = {}; + do_not_track = true; + referer = "same-domain"; + user_agent = "Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version_short} Safari/{webkit_version}"; + }; + + hyperlink_auditing = false; + + # Auto-load images. + images = true; + + javascript = { + enabled = true; + + can_open_tabs_automatically = false; + alert = true; + clipboard = "ask"; + legacy_touch_events = "never"; + + log = { + error = "debug"; + warning = "debug"; + info = "debug"; + unknown = "debug"; + }; + + modal_dialog = false; + prompt = true; + }; + + local_content_can_access_file_urls = true; + local_content_can_access_remote_urls = false; + + local_storage = true; + + desktop_capture = "ask"; + geolocation = "ask"; + persistent_storage = "ask"; + mouse_lock = "ask"; + register_protocol_handler = "ask"; + media = { + audio_capture = "ask"; + audio_video_capture = "ask"; + video_capture = "ask"; + }; + + mute = false; + + notifications = { + # TODO(@bpeetz): I might change that. <2025-05-31> + enabled = true; + + presenter = "libnotify"; + show_origin = true; + }; + + pdfjs = false; + + # TODO(@bpeetz): What are “plugins in Web pages”? <2025-05-31> + plugins = false; + + prefers_reduced_motion = false; + print_element_backgrounds = true; + private_browsing = false; + proxy = "system"; + + site_specific_quirks = { + enabled = true; + skip = []; + }; + + tls = { + certificate_errors = "ask"; + }; + + unknown_url_scheme_policy = "allow-from-user-interaction"; + user_stylesheets = []; + + webgl = true; + + webrtc_ip_handling_policy = "all-interfaces"; + xss_auditing = false; + }; + + downloads = { + location = { + # Use OS default. + directory = null; + prompt = true; + remember = true; + suggestion = "path"; + }; + + # TODO(@bpeetz): I might want to set that. <2025-05-31> + open_dispatcher = null; + + position = "top"; + prevent_mixed_content = true; + + # Never remove downloads without my intervention. + remove_finished = -1; + }; + + editor = { + command = [ + "${lib.getExe pkgs.alacritty}" + "--title" + "floating please" + "--command" + "nvim" + "-c" + "normal {line}G{column0}|" + "{file}" + ]; + encoding = "utf-8"; + remove_file = true; + }; + + fileselect = { + handler = "default"; + }; + + hints = { + auto_follow = "unique-match"; + auto_follow_timeout = 0; + + chars = "asdfghjkl"; + dictionary = "${wordlist}"; + + hide_unmatched_rapid_hints = true; + leave_on_load = false; + + min_chars = 1; + next_regexes = ["\\bnext\\b" "\\bmore\\b" "\\bnewer\\b" "\\b[>→≫]\\b" "\\b(>>|»)\\b" "\\bcontinue\\b"]; + prev_regexes = ["\\bprev(ious)?\\b" "\\bback\\b" "\\bolder\\b" "\\b[<←≪]\\b" "\\b(<<|«)\\b"]; + + scatter = true; + uppercase = false; + mode = "word"; + }; + + input = { + escape_quits_reporter = false; + forward_unbound_keys = "auto"; + + insert_mode = { + auto_enter = true; + auto_leave = true; + auto_load = false; + leave_on_load = true; + plugins = false; + }; + + links_included_in_focus_chain = true; + match_counts = true; + + media_keys = true; + + mode_override = null; + + mouse = { + back_forward_buttons = true; + rocker_gestures = false; + }; + + partial_timeout = 0; + spatial_navigation = false; + }; + + keyhint = { + blacklist = []; + delay = 250 * millisecond; + }; + + logging = { + level = { + console = "info"; + ram = "debug"; + }; + }; + + messages = { + timeout = 3 * second; + }; + + new_instance_open_target = "tab"; + new_instance_open_target_window = "last-focused"; + + prompt = { + filebrowser = true; + }; + + qt = { + args = []; + + chromium = { + experimental_web_platform_features = "auto"; + low_end_device_mode = "auto"; + process_model = "process-per-site-instance"; + sandboxing = "enable-all"; + }; + + environ = {}; + force_platform = null; + force_platformtheme = null; + force_software_rendering = "none"; + + highdpi = true; + + workarounds = { + disable_accelerated_2d_canvas = "auto"; + disable_hangouts_extension = false; + locale = false; + remove_service_workers = false; + }; + }; + + scrolling = { + bar = "never"; + smooth = false; + }; + + search = { + ignore_case = "smart"; + incremental = true; + wrap = true; + wrap_messages = true; + }; + + session = { + default_name = null; + lazy_restore = true; + }; + + spellcheck = { + # TODO(@bpeetz): Installing them (reproducibly) is simply not worth the hassle, as + # qutebrowser already provides quick access to an editor. <2025-06-04> + # languages = ["en-GB" "sv-SE" "de-DE"]; + }; + + statusbar = { + padding = { + bottom = 5; + left = 5; + right = 5; + top = 5; + }; + + position = "top"; + show = "always"; + widgets = [ + /* + Already set in the wrappers + */ + ]; + }; + + tabs = { + background = true; + close_mouse_button = "middle"; + close_mouse_button_on_bar = "new-tab"; + + favicons = { + scale = 1; + show = "always"; + }; + + focus_stack_size = 10; + + last_close = "default-page"; + + max_width = -1; + min_width = -1; + + mode_on_change = "normal"; + + mousewheel_switching = true; + + new_position = { + related = "next"; + unrelated = "next"; + stacking = true; + }; + + pinned = { + frozen = true; + shrink = true; + }; + + position = "top"; + + select_on_remove = "last-used"; + + show = "multiple"; + show_switching_delay = 2 * second; + + tabs_are_windows = false; + title = { + alignment = "center"; + elide = "middle"; + format = "{audio}{index}: {current_title}"; + format_pinned = "{index}"; + }; + + tooltips = true; + undo_stack_size = 100; + width = "15%"; + wrap = true; + }; + + url = { + auto_search = "naive"; + default_page = "qute://start"; + incdec_segments = ["path" "query"]; + + open_base_url = false; # Of search engine. + searchengines = rec { + DEFAULT = leta; + + leta = "https://leta.mullvad.net/search?q={}"; + "@ls" = leta; + + # NIX + "@np" = "https://search.nixos.org/packages?type=packages&query={}"; # Nix packages + + "@ng" = "https://noogle.dev/q?term={}"; # Nix functions + + "@no" = "https://search.nixos.org/options?type=options&query={}"; # NixOS options + "@nh" = "https://home-manager-options.extranix.com/?query={}&release=master"; # Home-Manager options + + "@ni" = "https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+{}"; # Nixpkgs issues + "@nr" = "https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+{}"; # Nixpkgs pull requests + + "@nt" = "https://nixpk.gs/pr-tracker.html?pr={}"; # Nixpkgs pull requests tracker + "@nw" = "https://wiki.nixos.org/w/index.php?search={}"; # NixOS Wiki + + # RUST + "@rs" = "https://doc.rust-lang.org/std/?search={}"; # Rust std + "@rt" = "https://docs.rs/tokio/latest/tokio/index.html?search={}"; # Rust tokio + + # OTHER + "@gs" = "https://scholar.google.com/scholar?hl=en&q={}"; # Google Scholar + "@wp" = "https://en.wikipedia.org/wiki/{}"; # Wikipedia + "@aw" = "https://wiki.archlinux.org/index.php?search={}"; # Arch Wiki + }; + + start_pages = ["qute://start"]; + yank_ignored_parameters = ["ref" "utm_source" "utm_medium" "utm_campaign" "utm_term" "utm_content" "utm_name"]; + }; + + window = { + hide_decoration = true; + title_format = "{perc}{current_title}{title_sep}qutebrowser"; + transparent = false; + }; +} diff --git a/modules/by-name/qu/qutebrowser/settings/keybindings.nix b/modules/by-name/qu/qutebrowser/settings/keybindings.nix new file mode 100644 index 00000000..fde78457 --- /dev/null +++ b/modules/by-name/qu/qutebrowser/settings/keybindings.nix @@ -0,0 +1,289 @@ +{ + cfg, + lib, +}: { + caret = { + "<Escape>" = "mode-leave"; + + H = "scroll left"; + T = "scroll down"; + N = "scroll up"; + S = "scroll right"; + h = "move-to-prev-char"; + t = "move-to-next-line"; + n = "move-to-prev-line"; + s = "move-to-next-char"; + + "$" = "move-to-end-of-line"; + "0" = "move-to-start-of-line"; + G = "move-to-end-of-document"; + gg = "move-to-start-of-document"; + + b = "move-to-prev-word"; + c = "mode-enter normal"; + e = "move-to-end-of-word"; + w = "move-to-next-word"; + + "{" = "move-to-end-of-prev-block"; + "}" = "move-to-end-of-next-block"; + "[" = "move-to-start-of-prev-block"; + "]" = "move-to-start-of-next-block"; + + y = "yank selection"; + Y = "yank selection -s"; + V = "selection-toggle --line"; + v = "selection-toggle"; + "<Ctrl-Space>" = "selection-drop"; + "<Return>" = "yank selection"; + "<Space>" = "selection-toggle"; + o = "selection-reverse"; + }; + + command = { + "<Alt-B>" = "rl-backward-word"; + "<Alt-Backspace>" = "rl-backward-kill-word"; + "<Alt-D>" = "rl-kill-word"; + "<Alt-F>" = "rl-forward-word"; + "<Ctrl-?>" = "rl-delete-char"; + "<Ctrl-A>" = "rl-beginning-of-line"; + "<Ctrl-B>" = "rl-backward-char"; + "<Ctrl-C>" = "completion-item-yank"; + "<Ctrl-D>" = "completion-item-del"; + "<Ctrl-E>" = "rl-end-of-line"; + "<Ctrl-F>" = "rl-forward-char"; + "<Ctrl-H>" = "rl-backward-delete-char"; + "<Ctrl-K>" = "rl-kill-line"; + "<Ctrl-N>" = "command-history-next"; + "<Ctrl-P>" = "command-history-prev"; + "<Ctrl-Return>" = "command-accept --rapid"; + "<Ctrl-Shift-C>" = "completion-item-yank --sel"; + "<Ctrl-Shift-Tab>" = "completion-item-focus prev-category"; + "<Ctrl-Shift-W>" = "rl-filename-rubout"; + "<Ctrl-Tab>" = "completion-item-focus next-category"; + "<Ctrl-U>" = "rl-unix-line-discard"; + "<Ctrl-W>" = "rl-rubout \" \""; + "<Ctrl-Y>" = "rl-yank"; + "<Down>" = "completion-item-focus --history next"; + "<Escape>" = "mode-leave"; + "<PgDown>" = "completion-item-focus next-page"; + "<PgUp>" = "completion-item-focus prev-page"; + "<Return>" = "command-accept"; + "<Shift-Delete>" = "completion-item-del"; + "<Shift-Tab>" = "completion-item-focus prev"; + "<Tab>" = "completion-item-focus next"; + "<Up>" = "completion-item-focus --history prev"; + }; + + hint = { + "<Ctrl-B>" = "hint all tab-bg"; + "<Ctrl-F>" = "hint links"; + "<Ctrl-R>" = "hint --rapid links tab-bg"; + "<Escape>" = "mode-leave"; + "<Return>" = "hint-follow"; + }; + + insert = { + "<Ctrl-E>" = "edit-text"; + "<Escape>" = "mode-leave"; + "<Shift-Escape>" = "fake-key <Escape>"; + "<Shift-Ins>" = "insert-text -- {primary}"; + "<Ctrl-k>" = "spawn --userscript qute-keepassxc --key ${lib.escapeShellArg cfg.key}"; + }; + + normal = { + # a + # b + # c + # d -> download management + # e -> [e]merge tab + # f -> `hint all` + # g -> tabs [g]oing + # h -> `back` + # i -> `mode-enter insert` + # j -> inputs + # k + # l -> `search-next` + # m -> in page movement + # n -> `scroll up` + # o + # p + # q -> `macro-record` + # r + # s -> `forward` + # t -> `scroll down` + # u -> `undo` + # v -> `mode-enter caret` + # w -> theme switching + # x -> hinting + # y -> yanking + # z + + # Theme switching + wd = "set --temp colors.webpage.darkmode.enabled true"; + wl = "set --temp colors.webpage.darkmode.enabled false"; + + # Tab [g]oing + "g$" = "tab-focus -1"; + g0 = "tab-focus 1"; + gh = "home"; + gH = "history"; + gs = "cmd-set-text --space :open"; + gP = "open -- {primary}"; + gp = "open -- {clipboard}"; + go = "cmd-set-text :open {url:pretty}"; + gt = "cmd-set-text --space :tab-select"; + # TODO(@bpeetz): Make this to a lf tab listing. <2025-05-31> + "\\f" = "cmd-set-text --space --relative :tab-focus"; + + eP = "open --tab -- {primary}"; + ep = "open --tab -- {clipboard}"; + ea = "open --tab"; + es = "cmd-set-text --space :open --tab"; + eo = "cmd-set-text :open --tab --related {url:pretty}"; + eh = "back --tab"; + en = "forward --tab"; + ec = "tab-clone"; + em = "tab-move"; + ed = "tab-close"; + eR = "reload --force"; + er = "reload"; + + # Download management + dm = "download"; + dc = "download-cancel"; + dp = "download-clear"; + do = "download-open"; + dr = "download-retry"; + + # In page hierarchy [m]ovement + mi = "navigate increment"; + md = "navigate increment"; + mp = "navigate prev"; + mn = "navigate next"; + mu = "navigate up"; + mh = "navigate strip"; + + # Page movement + H = "scroll left"; + t = "scroll down"; + n = "scroll up"; + S = "scroll right"; + h = "back"; + T = "tab-prev"; + N = "tab-next"; + s = "forward"; + G = "scroll-to-perc"; + gg = "scroll-to-perc 0"; + + l = "search-next"; + L = "search-prev"; + + "+" = "zoom-in"; + "-" = "zoom-out"; + "=" = "zoom"; + + "." = "cmd-repeat-last"; + "/" = "cmd-set-text /"; + "?" = "cmd-set-text ?"; + ":" = "cmd-set-text :"; + + # Hinting + xI = "hint images tab"; + xi = "hint images"; + xO = "hint links fill :open --tab --related {hint-url}"; + xo = "hint links fill :open {hint-url}"; + xY = "hint links yank-primary"; + xy = "hint links yank"; + xb = "hint all tab-bg"; + xf = "hint all tab-fg"; + xd = "hint links download"; + xh = "hint all hover"; + xr = "hint --rapid links tab-bg"; + xt = "hint inputs"; + f = "hint all"; + + # Inputs + jf = "hint inputs --first"; + jk = "spawn --userscript qute-keepassxc --key ${lib.escapeShellArg cfg.key}"; + + # Yanking + yD = "yank domain --sel"; + yM = "yank inline [{title}]({url:yank}) --sel"; + yP = "yank pretty-url --sel"; + yT = "yank title --sel"; + yY = "yank --sel"; + yd = "yank domain"; + ym = "yank inline [{title}]({url:yank})"; + yp = "yank pretty-url"; + yt = "yank title"; + yy = "yank"; + + "<Escape>" = "clear-keychain ;; search ;; fullscreen --leave ;; clear-messages"; + "<Shift-Space>" = "scroll-page 0 -1"; + "<Space>" = "scroll-page 0 1"; + "<Ctrl-Return>" = "selection-follow --tab"; + "<Return>" = "selection-follow"; + "<back>" = "back"; + "<forward>" = "forward"; + + i = "mode-enter insert"; + "'" = "mode-enter jump_mark"; + "`" = "mode-enter set_mark"; + v = "mode-enter caret"; + V = "mode-enter caret ;; selection-toggle --line"; + "<Ctrl-V>" = "mode-enter passthrough"; + + q = "macro-record"; + "@" = "macro-run"; + u = "undo"; + U = "undo --window"; + }; + + passthrough = { + "<Shift-Escape>" = "mode-leave"; + }; + + prompt = { + "<Alt-B>" = "rl-backward-word"; + "<Alt-Backspace>" = "rl-backward-kill-word"; + "<Alt-D>" = "rl-kill-word"; + "<Alt-E>" = "prompt-fileselect-external"; + "<Alt-F>" = "rl-forward-word"; + "<Alt-Shift-Y>" = "prompt-yank --sel"; + "<Alt-Y>" = "prompt-yank"; + "<Ctrl-?>" = "rl-delete-char"; + "<Ctrl-A>" = "rl-beginning-of-line"; + "<Ctrl-B>" = "rl-backward-char"; + "<Ctrl-E>" = "rl-end-of-line"; + "<Ctrl-F>" = "rl-forward-char"; + "<Ctrl-H>" = "rl-backward-delete-char"; + "<Ctrl-K>" = "rl-kill-line"; + "<Ctrl-P>" = "prompt-open-download --pdfjs"; + "<Ctrl-Shift-W>" = "rl-filename-rubout"; + "<Ctrl-U>" = "rl-unix-line-discard"; + "<Ctrl-W>" = "rl-rubout \" \""; + "<Ctrl-X>" = "prompt-open-download"; + "<Ctrl-Y>" = "rl-yank"; + "<Down>" = "prompt-item-focus next"; + "<Escape>" = "mode-leave"; + "<Return>" = "prompt-accept"; + "<Shift-Tab>" = "prompt-item-focus prev"; + "<Tab>" = "prompt-item-focus next"; + "<Up>" = "prompt-item-focus prev"; + }; + + register = { + "<Escape>" = "mode-leave"; + }; + + yesno = { + "<Alt-Shift-Y>" = "prompt-yank --sel"; + "<Alt-Y>" = "prompt-yank"; + "<Escape>" = "mode-leave"; + "<Return>" = "prompt-accept"; + N = "prompt-accept --save no"; + Y = "prompt-accept --save yes"; + n = "prompt-accept no"; + y = "prompt-accept yes"; + }; +} diff --git a/modules/by-name/ri/river/init_base.sh b/modules/by-name/ri/river/init_base.sh new file mode 100755 index 00000000..b68d147b --- /dev/null +++ b/modules/by-name/ri/river/init_base.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# NOTE: Keep this in sync with the file from `river-start` <2025-02-03> +RIVER_LOG_FILE="$HOME/.cache/river/log" + +err_fail() { + if ! "$@"; then + output="" + for arg in "$@"; do + if [ -z "$output" ]; then + output="'$arg'" + else + output="$output '$arg'" + fi + done + printf "%s failed!\n" "$output" >>"$RIVER_LOG_FILE" + fi +} +exec 1>>"$RIVER_LOG_FILE" +exec 2>>"$RIVER_LOG_FILE" + +# Start of the generated stuff. diff --git a/modules/by-name/ri/river/keymap.nix b/modules/by-name/ri/river/keymap.nix new file mode 100644 index 00000000..052d36c3 --- /dev/null +++ b/modules/by-name/ri/river/keymap.nix @@ -0,0 +1,139 @@ +{ + lib, + pkgs, + libraries, + config, + ... +}: let + index2tag = input: builtins.toString (libraries.base.pow 2 (input - 1)); + + mkTagCommand = name: index: [name (index2tag index)]; + mkSpawn' = pkg: binaryName: args: { + command = [ + "spawn" + "${lib.getExe' pkg binaryName} ${args}" + ]; + + description = "${binaryName} ${args}"; + }; + mkSpawn = pkg: args: (mkSpawn' pkg pkg.meta.mainProgram args); + + cfg = config.soispha.programs.river; +in { + soispha.programs.river.init.mappings.keymap = lib.mkIf cfg.enable { + "<LEFT_SUPER>" = { + # Change focus + "f" = { + "t" = ["focus-view" "next"]; + "n" = ["focus-view" "previous"]; + "<Ctrl-t>" = ["focus-output" "next"]; + "<Ctrl-n>" = ["focus-output" "previous"]; + }; + + # Spawn standard programs + "r" = { + "a" = mkSpawn pkgs.alacritty ""; + "b" = mkSpawn pkgs.tskm "open select"; + "k" = mkSpawn pkgs.keepassxc ""; + "s" = mkSpawn pkgs.signal-desktop ""; + "p" = mkSpawn pkgs.screenshot_persistent ""; + }; + + # Client changes + "c" = { + "f" = ["toggle-fullscreen"]; + "c" = ["close"]; + " " = ["toggle-float"]; + "<ENTER>" = ["zoom"]; + "o" = ["send-to-output" "next"]; + "t" = ["swap" "next"]; + "n" = ["swap" "previous"]; + }; + + # River compositor control. + "x" = { + "q" = ["exit"]; + "l" = mkSpawn pkgs.lock ""; + }; + + # Media control + "m" = { + "r" = mkSpawn' pkgs.wireplumber "wpctl" "set-volume @DEFAULT_SINK@ 5%+"; + "l" = mkSpawn' pkgs.wireplumber "wpctl" "set-volume @DEFAULT_SINK@ 5%-"; + "m" = mkSpawn pkgs.mpp "toggle"; + }; + + # Select tags to view. + "v" = { + "0" = ["set-view-tags" (builtins.toString ((libraries.base.pow 2 32) - 1))]; + "p" = ["send-to-previous-tags"]; + + "1" = mkTagCommand "set-view-tags" 1; + "2" = mkTagCommand "set-view-tags" 2; + "3" = mkTagCommand "set-view-tags" 3; + "4" = mkTagCommand "set-view-tags" 4; + "5" = mkTagCommand "set-view-tags" 5; + "6" = mkTagCommand "set-view-tags" 6; + "7" = mkTagCommand "set-view-tags" 7; + "8" = mkTagCommand "set-view-tags" 8; + "9" = mkTagCommand "set-view-tags" 9; + + # Add tags to view. + "a" = { + "1" = mkTagCommand "toggle-view-tags" 1; + "2" = mkTagCommand "toggle-view-tags" 2; + "3" = mkTagCommand "toggle-view-tags" 3; + "4" = mkTagCommand "toggle-view-tags" 4; + "5" = mkTagCommand "toggle-view-tags" 5; + "6" = mkTagCommand "toggle-view-tags" 6; + "7" = mkTagCommand "toggle-view-tags" 7; + "8" = mkTagCommand "toggle-view-tags" 8; + "9" = mkTagCommand "toggle-view-tags" 9; + }; + }; + + # Select tags to focus. + "f" = { + "0" = ["set-focused-tags" (builtins.toString ((libraries.base.pow 2 32) - 1))]; + "p" = ["focus-previous-tags"]; + + "1" = mkTagCommand "set-focused-tags" 1; + "2" = mkTagCommand "set-focused-tags" 2; + "3" = mkTagCommand "set-focused-tags" 3; + "4" = mkTagCommand "set-focused-tags" 4; + "5" = mkTagCommand "set-focused-tags" 5; + "6" = mkTagCommand "set-focused-tags" 6; + "7" = mkTagCommand "set-focused-tags" 7; + "8" = mkTagCommand "set-focused-tags" 8; + "9" = mkTagCommand "set-focused-tags" 9; + }; + }; + + # Audio + "<MEDIA_RAISEVOLUME>" = + (mkSpawn' pkgs.wireplumber "wpctl" "set-volume @DEFAULT_SINK@ 5%+") + // { + allow_locked = true; + }; + "<MEDIA_LOWERVOLUME>" = + (mkSpawn' pkgs.wireplumber "wpctl" "set-volume @DEFAULT_SINK@ 5%-") + // { + allow_locked = true; + }; + "<MEDIA_MUTEVOLUME>" = + (mkSpawn pkgs.mpp "toggle") + // { + allow_locked = true; + }; + + # Mouse + "<Meta-<MOUSE_LEFT>>" = ["move-view"]; + "<Meta-<MOUSE_RIGHT>>" = ["resize-view"]; + + # Lock screen. + "<Meta-L>" = mkSpawn pkgs.lock ""; + + # Screenshot + "<PRINTSCREEN>" = mkSpawn pkgs.screenshot_persistent ""; + }; +} diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index a059da4d..4b446934 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -1,21 +1,243 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, - qmk_firmware, system, + pkgs, + externalBinaries, ... }: let cfg = config.soispha.programs.river; + esa = lib.strings.escapeShellArg; + riverctl = lib.getExe' pkgs.river "riverctl"; + + mkOutputFlags = output: flags: let + expandedFlags = builtins.concatStringsSep " " (lib.attrsets.mapAttrsToList (flag: value: "--${esa flag} ${esa value}") flags); + in '' + err_fail ${lib.getExe pkgs.wlr-randr} --output ${esa output} ${expandedFlags} + ''; + screenSetupCode = builtins.concatStringsSep "" (lib.attrsets.mapAttrsToList mkOutputFlags cfg.init.screenSetupCode); + + mkLrProgram = input: let + program = builtins.concatStringsSep " " ( + if lib.isDerivation input + then [(lib.getExe input)] + else builtins.map esa input + ); + in "err_fail ${program} &"; + longRunningPrograms = builtins.concatStringsSep "\n" (builtins.map mkLrProgram cfg.init.backgroundStart); + + keymapFormat = pkgs.formats.json {}; + keymapGenerate = name: value: + pkgs.runCommandLocal "mk-${name}-and-check" { + nativeBuildInputs = [pkgs.river-mk-keymap]; + preferLocalBuild = true; + + env = { + JSON_FILE = keymapFormat.generate name value; + }; + } '' + river-mk-keymap --keymap "$JSON_FILE" init --dry-run; + cp "$JSON_FILE" "$out" + ''; + + keymappings = '' + err_fail ${riverctl} keyboard-layout ${esa cfg.init.mappings.layout} + err_fail ${lib.getExe pkgs.river-mk-keymap} ${keymapGenerate "keys.json" cfg.init.mappings.keymap} + ''; + + mkRule = { + app-id, + title, + action, + }: '' + err_fail ${riverctl} rule-add -app-id ${esa app-id} -title ${esa title} ${esa action} + ''; + ruleSetup = builtins.concatStringsSep "" (builtins.map mkRule cfg.init.rules); + + mkSetting = name: maybe_values: let + rawValues = + if builtins.isString maybe_values + then [maybe_values] + else maybe_values; + values = builtins.concatStringsSep " " (builtins.map esa rawValues); + in '' + err_fail ${riverctl} ${esa name} ${values} + ''; + generalSettings = + builtins.concatStringsSep "" (lib.attrsets.mapAttrsToList mkSetting + cfg.init.generalSettings); + + mkInput = name: arguments: + builtins.concatStringsSep "" (builtins.map (argumentLine: mkSetting "input" ([name] ++ argumentLine)) arguments); + inputs = + builtins.concatStringsSep "" (lib.attrsets.mapAttrsToList mkInput cfg.init.inputs); in { options.soispha.programs.river = { enable = lib.mkEnableOption "river"; + unicodeInput = { enable = lib.mkEnableOption "udev rules for rawhid based unicode input"; }; + + init = { + mappings = { + layout = lib.mkOption { + type = lib.types.str; + description = "The keymap to use"; + default = "dvorak-modified"; + }; + + keymap = lib.mkOption { + type = lib.types.submodule { + freeformType = keymapFormat.type; + + options = {}; + }; + default = {}; + + description = '' + Configuration for river-mk-keymap via `keys.json`. + ''; + }; + }; + + rules = lib.mkOption { + type = lib.types.listOf (lib.types.attrsOf lib.types.str); + default = []; + + example = '' + [ + { + app-id = "*"; + title = "floating please"; + action = "float"; + } + { + app-id = "*"; + title = "*"; + action = "ssd"; + } + ] + ''; + + description = '' + Configuration for river's rules. + ''; + }; + + generalSettings = lib.mkOption { + type = lib.types.attrsOf (lib.types.either (lib.types.listOf lib.types.str) lib.types.str); + description = "Simple key value settings."; + default = {}; + example = '' + { + background-color = "0x002b36"; + set-repeat = ["50" "300"]; + hide-cursor = ["when-typing" "enabled"]; + } + ''; + }; + + inputs = lib.mkOption { + type = lib.types.attrsOf (lib.types.listOf (lib.types.listOf lib.types.str)); + description = "Options to set per input device"; + default = {}; + example = '' + { + pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; + pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; + } + ''; + }; + + backgroundStart = lib.mkOption { + type = lib.types.listOf (lib.types.either lib.types.package (lib.types.listOf lib.types.str)); + description = "List of programs to start in the background"; + example = '' + [ + pkgs.gammastep + ] + ''; + }; + + screenSetupCode = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); + default = {}; + description = '' + `wlr-randr` flags to set up outputs. The attribute names are the `--output` keys + and the attrs are flag value pairs to setup. + ''; + example = '' + { + "Virtual-1" = {mode = "1920x1080";}; + "DP-2" = {pos = "2560,0";}; + "DP-1" = {scale = "1.5"; pos = "0,0";}; + } + ''; + }; + }; }; + imports = [ + ./keymap.nix + ]; + config = lib.mkIf cfg.enable { - # TODO: Migrate the complete river module <2024-12-30> - services.udev.packages = lib.mkIf cfg.unicodeInput.enable [qmk_firmware.packages.${system}.qmk_unicode_type]; + services.udev.packages = lib.mkIf cfg.unicodeInput.enable [externalBinaries.qmk_firmware.packages.${system}.qmk_unicode_type]; + + home-manager.users.soispha = { + home.sessionVariables = { + WM = "river"; + XDG_CURRENT_DESKTOP = "river"; + DESKTOP_SESSION = "river"; + + # Export Wayland env Vars {{{ + QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct + CLUTTER_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; # might brake some things + # }}} + }; + + home.packages = [ + (pkgs.callPackage ./river-start/package.nix {}) + ]; + + xdg.configFile."river/init" = { + executable = true; + text = let + mkHeading = text: other_stuff: '' + # ${text} + ${other_stuff} + ''; + in + builtins.readFile ./init_base.sh + + + # bash + mkHeading "Environment variables" '' + err_fail ${riverctl} spawn "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" + export XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river; + '' + + mkHeading "Key Mappings" keymappings + + mkHeading "Rules" ruleSetup + + mkHeading "General Settings" generalSettings + + mkHeading "Input Section" inputs + + mkHeading "Screen setup code" screenSetupCode + + mkHeading "Background services" longRunningPrograms + + mkHeading "Layout Setup" '' + err_fail ${riverctl} default-layout rivertile + ${lib.getExe' pkgs.river "rivertile"} -main-ratio 0.5 -view-padding 1 -outer-padding 0 + ''; + }; + }; }; } diff --git a/modules/by-name/ri/river/river-start/package.nix b/modules/by-name/ri/river/river-start/package.nix new file mode 100644 index 00000000..10957cc0 --- /dev/null +++ b/modules/by-name/ri/river/river-start/package.nix @@ -0,0 +1,23 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + writeShellApplication, + river, +}: +writeShellApplication { + name = "river-start"; + text = builtins.readFile ./river-start.sh; + runtimeInputs = [ + river + ]; + meta = { + mainProgram = "river-start"; + }; +} diff --git a/modules/by-name/ri/river/river-start/river-start.sh b/modules/by-name/ri/river/river-start/river-start.sh new file mode 100755 index 00000000..b4c5b0a6 --- /dev/null +++ b/modules/by-name/ri/river/river-start/river-start.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# NOTE: Keep this in sync with the file from `base_init.sh` <2025-02-03> +RIVER_LOG_FILE="$HOME/.cache/river/log" + +[ -d "$(dirname "$RIVER_LOG_FILE")" ] || mkdir --parents "$(dirname "$RIVER_LOG_FILE")" + +exec river -log-level info >"$RIVER_LOG_FILE" 2>&1 + +# vim: ft=sh diff --git a/modules/by-name/sc/scanning/module.nix b/modules/by-name/sc/scanning/module.nix index dda507fa..30e99bd1 100644 --- a/modules/by-name/sc/scanning/module.nix +++ b/modules/by-name/sc/scanning/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/se/serverphone/certificates/ca.crt.license b/modules/by-name/se/serverphone/certificates/ca.crt.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/certificates/ca.crt.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/se/serverphone/certificates/server.crt.license b/modules/by-name/se/serverphone/certificates/server.crt.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/certificates/server.crt.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/se/serverphone/module.currently_ignored.nix b/modules/by-name/se/serverphone/module.currently_ignored.nix index aaa818c2..f7280bed 100644 --- a/modules/by-name/se/serverphone/module.currently_ignored.nix +++ b/modules/by-name/se/serverphone/module.currently_ignored.nix @@ -1,13 +1,33 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, serverphone, system, lib, + modules, ... -}: { +}: let + cfg = config.soispha.serverphone; +in { # FIXME: Reactive this module, when serverphone is working again <2024-05-11> - config = lib.mkIf config.soispha.secrets.enable { + options.soispha.serverphone = { + enable = lib.mkEnableOption "serverphone"; + }; + + imports = [ + modules.serverphone.nixosModules.default + ]; + + config = lib.mkIf cfg.enable { age.secrets = { serverphoneCa = { file = ./private_keys/ca.key; diff --git a/modules/by-name/se/serverphone/private_keys/ca.key.license b/modules/by-name/se/serverphone/private_keys/ca.key.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/private_keys/ca.key.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/se/serverphone/private_keys/server.key.license b/modules/by-name/se/serverphone/private_keys/server.key.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/private_keys/server.key.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sn/snapper/module.nix b/modules/by-name/sn/snapper/module.nix index bf8201a4..c232a177 100644 --- a/modules/by-name/sn/snapper/module.nix +++ b/modules/by-name/sn/snapper/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/so/sound/module.nix b/modules/by-name/so/sound/module.nix index f3120a67..622cc01d 100644 --- a/modules/by-name/so/sound/module.nix +++ b/modules/by-name/so/sound/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -10,7 +19,7 @@ in { }; config = lib.mkIf cfg.enable { - hardware.pulseaudio.enable = false; + services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { diff --git a/modules/by-name/ss/ssh/module.nix b/modules/by-name/ss/ssh/module.nix new file mode 100644 index 00000000..91cc4aeb --- /dev/null +++ b/modules/by-name/ss/ssh/module.nix @@ -0,0 +1,55 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.ssh; +in { + options.soispha.programs.ssh = { + enable = lib.mkEnableOption "ssh config"; + rootKnownHosts = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + description = '' + An attrset of keys (the domain) and values (the host key.) + These are only applied to the root user. + ''; + default = {}; + apply = value: + builtins.concatStringsSep "\n" + (lib.attrsets.mapAttrsToList (hostName: hostKey: "${hostName} ${hostKey}") value); + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users = { + root.programs.ssh = { + enable = true; + compression = true; + hashKnownHosts = false; + serverAliveInterval = 240; + userKnownHostsFile = builtins.toString (pkgs.writeTextFile { + name = "root-known-hosts"; + text = cfg.rootKnownHosts; + }); + }; + + soispha.programs.ssh = { + enable = true; + compression = true; + hashKnownHosts = false; + serverAliveInterval = 240; + userKnownHostsFile = "${config.home-manager.users.soispha.xdg.dataHome}/ssh/known_hosts"; + }; + }; + }; +} diff --git a/modules/by-name/st/steam/module.nix b/modules/by-name/st/steam/module.nix index 49149cd7..a02b2e4b 100644 --- a/modules/by-name/st/steam/module.nix +++ b/modules/by-name/st/steam/module.nix @@ -1,23 +1,42 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, pkgs, ... }: let - cfg = config.soispha.services.steam; + cfg = config.soispha.programs.steam; in { - options.soispha.services.steam = { + options.soispha.programs.steam = { enable = lib.mkEnableOption "Steam"; }; config = lib.mkIf cfg.enable { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + # NOTE: These are not really applied. Look at + # <modules/by-name/ni/nixpkgs/config.nix> instead. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" + ]; + programs.steam = { enable = true; }; environment.systemPackages = [ # TODO: Why is this package needed? <2024-05-16> - pkgs.wineWowPackages.waylandFull + # pkgs.wineWowPackages.waylandFull ]; }; } diff --git a/modules/home.legacy/conf/swaylock/GTDcanonical.png b/modules/by-name/sw/swaylock/images/GTDcanonical.png index ef41d79d..ef41d79d 100644 --- a/modules/home.legacy/conf/swaylock/GTDcanonical.png +++ b/modules/by-name/sw/swaylock/images/GTDcanonical.png Binary files differdiff --git a/modules/by-name/sw/swaylock/images/GTDcanonical.png.license b/modules/by-name/sw/swaylock/images/GTDcanonical.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/GTDcanonical.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/swaylock/commands.jpg b/modules/by-name/sw/swaylock/images/commands.jpg index 54016503..54016503 100644 --- a/modules/home.legacy/conf/swaylock/commands.jpg +++ b/modules/by-name/sw/swaylock/images/commands.jpg Binary files differdiff --git a/modules/by-name/sw/swaylock/images/commands.jpg.license b/modules/by-name/sw/swaylock/images/commands.jpg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/commands.jpg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/swaylock/duwon-lee-tempano-port.jpg b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg index d72f32d1..d72f32d1 100644 --- a/modules/home.legacy/conf/swaylock/duwon-lee-tempano-port.jpg +++ b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg Binary files differdiff --git a/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg.license b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/swaylock/gnu.png b/modules/by-name/sw/swaylock/images/gnu.png index d07dee3e..d07dee3e 100644 --- a/modules/home.legacy/conf/swaylock/gnu.png +++ b/modules/by-name/sw/swaylock/images/gnu.png Binary files differdiff --git a/modules/by-name/sw/swaylock/images/gnu.png.license b/modules/by-name/sw/swaylock/images/gnu.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/gnu.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sw/swaylock/module.nix b/modules/by-name/sw/swaylock/module.nix index 6cbcef28..ab18f41b 100644 --- a/modules/by-name/sw/swaylock/module.nix +++ b/modules/by-name/sw/swaylock/module.nix @@ -1,4 +1,34 @@ -{...}: { - # otherwise swaylock can't access the user password. - security.pam.services.swaylock = {}; +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.swaylock; +in { + options.soispha.programs.swaylock = { + enable = lib.mkEnableOption "swaylock"; + }; + + config = lib.mkIf cfg.enable { + # otherwise swaylock can't access the user password. + security.pam.services.swaylock = {}; + + home-manager.users.soispha.programs.swaylock = { + enable = true; + settings = { + image = "${./images/duwon-lee-tempano-port.jpg}"; + scaling = "stretch"; + color = "000000"; + }; + }; + }; } diff --git a/modules/by-name/sy/system_diff/module.nix b/modules/by-name/sy/system_diff/module.nix index 052ffae2..cc2ec75c 100644 --- a/modules/by-name/sy/system_diff/module.nix +++ b/modules/by-name/sy/system_diff/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix index 0a942820..bb881768 100644 --- a/modules/by-name/ta/taskwarrior/module.nix +++ b/modules/by-name/ta/taskwarrior/module.nix @@ -1,44 +1,173 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, + pkgs, ... }: let cfg = config.soispha.programs.taskwarrior; + + hooksDir = + pkgs.runCommandNoCCLocal "mk-taskwarrior-hooks" {} + ('' + mkdir "$out" + '' + + (builtins.concatStringsSep "\n" + (lib.attrsets.mapAttrsToList + (name: value: '' + ln --symbolic "${lib.getExe value.executable}" "$out/${value.mode}_${name}" + '') + cfg.hooks))); + + mkHook = mode: deps: path: { + inherit mode; + + executable = pkgs.writeShellApplication { + name = "add-hook-${builtins.baseNameOf path}"; + runtimeInputs = [pkgs.taskwarrior3 pkgs.coreutils pkgs.gnugrep] ++ deps; + inheritPath = false; + text = + # bash + '' + die() { + echo "$@">&2 + exit 1 + } + + enable_hook_dbg() { + # TODO: We should probably be smarter with the debug detection <2025-04-04> + if echo "$2" | grep --quiet 'rc.debug.hooks='; then + set -x + mkdir --parents "$HOME/.cache/task" + exec >>"$HOME/.cache/task/hook.log.$1" + exec 2>>"$HOME/.cache/task/hook.log.$1" + fi + } + + addedCall() { + ${builtins.readFile path} + } + + ${ + if mode == "on-modify" + then "read -r old_task" + else "old_task=NULL" + } + read -r new_task + # We don't change the task, thus immediately return the JSON + echo "$new_task" + + enable_hook_dbg "$@" + addedCall "$new_task" "$old_task" + + exit 0 + ''; + }; + }; in { options.soispha.programs.taskwarrior = { - enable = lib.mkEnableOption "taskwarrior-secrets"; + enable = lib.mkEnableOption "taskwarrior"; + + enableAge = lib.mkEnableOption "taskwarrior with age keys"; + + includeFiles = lib.mkOption { + type = lib.types.attrsOf lib.types.path; + description = "Extra files to include in the taskwarrior config"; + default = {}; + apply = value: + builtins.concatStringsSep "\n" + (builtins.map (path: "include ${path}") + (builtins.attrValues value)); + }; + + hooks = lib.mkOption { + description = "Map hook names to their values"; + type = lib.types.attrsOf (lib.types.submodule { + options = { + mode = lib.mkOption { + type = lib.types.enum ["on-add" "on-modify"]; + description = "The type of the hook"; + }; + executable = lib.mkOption { + type = lib.types.package; + description = "The executable to call."; + }; + }; + }); + }; }; - # HACK: Migrating the whole `taskwarrior` setup is right now unrealistic, as the module is - # tightly coupled with the `firefox` module, and `neorg` script. - # But to work around the fact that setting the `age` secrets in the legacy module is - # impossible, this module was created as work-around until the `taskwarrior` module can - # be fully migrated. <2024-10-18> - config = lib.mkIf cfg.enable { - age.secrets = { - taskserverPrivate = { - file = ./secrets/private.key; - mode = "700"; - owner = "soispha"; - group = "users"; - }; - taskserverPublic = { - file = ./secrets/public.cert; - mode = "700"; - owner = "soispha"; - group = "users"; - }; - taskserverCA = { - file = ./secrets/ca.cert; - mode = "700"; - owner = "soispha"; - group = "users"; + config = { + lib.taskwarrior = { + inherit mkHook; + }; + + age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf (cfg.enable && cfg.enableAge) { + file = ./secrets/sync_server_encryption_key.age; + mode = "700"; + owner = "soispha"; + group = "users"; + }; + + soispha.programs.taskwarrior.includeFiles.syncServerSecret = lib.mkIf (cfg.enable && cfg.enableAge) config.age.secrets.taskwarrior_sync_server_encryption_key.path; + + home-manager.users.soispha = lib.mkIf cfg.enable { + services.taskwarrior-sync = lib.mkIf cfg.enableAge { + enable = true; + package = pkgs.taskwarrior3; }; - taskserverCredentials = { - file = ./secrets/credentials; - mode = "700"; - owner = "soispha"; - group = "users"; + + programs.taskwarrior = { + enable = true; + colorTheme = ./nord.theme; + package = pkgs.taskwarrior3; + extraConfig = cfg.includeFiles; + + config = { + complete.all.tags = true; + list.all = { + projects = true; + tags = true; + }; + + news.version = "3.4.1"; + + regex = true; + weekstart = "Monday"; + + uda = { + total_active_time = { + type = "duration"; + label = "Total active time"; + }; + }; + + sync.server = lib.mkIf cfg.enableAge { + client_id = "a3619d43-031f-4f85-848f-5512804f9a1d"; + url = "https://taskchampion.vhack.eu"; + }; + + alias = { + mod = "modify"; + }; + color = true; + + hooks.location = "${hooksDir}"; + + urgency.uda.priority = { + H.coefficient = 6.0; + M.coefficient = 0; + L.coefficient = -1.8; + }; + }; }; }; }; diff --git a/modules/home.legacy/conf/taskwarrior/nord.theme b/modules/by-name/ta/taskwarrior/nord.theme index 2897418f..2897418f 100644 --- a/modules/home.legacy/conf/taskwarrior/nord.theme +++ b/modules/by-name/ta/taskwarrior/nord.theme diff --git a/modules/by-name/ta/taskwarrior/nord.theme.license b/modules/by-name/ta/taskwarrior/nord.theme.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/ta/taskwarrior/nord.theme.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/ta/taskwarrior/secrets/ca.cert b/modules/by-name/ta/taskwarrior/secrets/ca.cert deleted file mode 100644 index 81528a2a..00000000 --- a/modules/by-name/ta/taskwarrior/secrets/ca.cert +++ /dev/null @@ -1,161 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4dVVkOWlYNjJQSFZYbExM -bENvUTFzbmdPQ0ljR2V1TlJXYUZFVnNMS3owCjNmaE5pNnZqN0FXRUtFQzZYR0xQ -NWh0L0NLVDlEeWlvdlB1T2dwRmkybXcKLT4gc3NoLWVkMjU1MTkgelpFb25nIHR3 -TmJzS2Q4WDN4KzVkVXgyMzhiYmdId0wwSzJndmZJQUlzYm9MTW5zR3cKRmswT3RN -QTR2VjYvVXY4TnJCNEVrY0V1c3FEK3hGMkppeWh0bEUzdEdMRQotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgY2R5WUVpdlJCVjBxR0lTMmFnY0plV0J4NUFWTk1XWnllbjlt -OS8xS3FIVQo4MytXd054Rm5neTFsREpWTFdJc2xzLzdDckZ5M2tOelNhakMxanlY -cTQ4Ci0+IE1Dci1ncmVhc2UgfSYwZlg0YlcKQUlENkdEalVMZ0VzTXFlUHB1Yzhr -VWZwb1FMZFdtbm1HU01VMWtLVnB4MmlyUQotLS0gUTh6RGZ4NVRaQXppQ1ozbmlS -U1FqSVRDOEQzZDc0NUtyN3JMMmhER1U3TQrE19bvLibjcNcMzhiPZxX9K38Lr4Xo -TXxkclMNX1EKveHCqG8rzkkquPJar5M5PAo7UL+zXBaB63XCbuscUv1jTiTFYN7V -hVEAoj1rpcsDslhchpra3TZWuQZuhDJw+2Ig0qaCQWCzqi+e0j6oTAwZWyo3lIB1 -jt1xik+2QAxdMae2i3CBpPdwlyWGN5rpX+CgFQg3SKpOtaE5T924GJTBdm6jSfR6 -91tNoU+8cR82tHlR1NrhoKFPqw4xKZhrIhe+WW5IqK2SB7IRsnS7hiYz+UzDQu/9 -Bvfd2RO07JH1wCphnH7l+YmTVyZSydm1gPzBwGnRtWrxZa4B6xYatTWT8CQZyg0k -suKe9EVYb6A9+UzrfjwNKIm+1aTyy7NUPTtbJ0Qjn3NoNMZIdONXqPQnT2iSFy4G -ym4ZvkIRoyjh3dzd3csVvHIAsdWyyUL3uvri+HeHuaTtiSpyUl5hzHnjQyKgubI4 -rIfrSYtqsA76scj8HsMQ9DaQsGnEtIbvUAHemTKKVDnozY1vrO2RNg4CtAyRRfbl -DnITU9S5V5CzMZdnUnq0qeVyKG/amPnDuEhk/IyaaLOM7T7Zl2PuT6T+Dckmj6GV -zTOhXEwrvgMhRbeNvLDcNVkYa+BMtY8GVYWMbiEW0jUy75XC5e4TZ5fyI/IZEh5D -rBqaQszpwskkMstlVzG95XbtjdireJjjau4qaA9aCpSKhOPzreNIQHiBWCBAvmGk -IWuTKxMlRpCjaG9VKiOlrMrSQNDfOmyv3PascWaLwY1vJKYnkdz8LMlK+JdR4Ft9 -VzpM2emuQj3fzrZQ4W1esha8KwmyluHZJ/lmzXYo1TPvpXmW2yFKzkoT2jX2OvKf -ly0JQEzy0g6K0FiJWP5t5Ss/jGlvV75ud/sCCISTDoc1NpljHgChEshxXQZgW4Sf -wHWsMy4c2O/UyyvGGDO/aIGGwjRsTKrQxHyQezkLn5d7sn/RYl19xzSG6N+u0bJi -l70OAKMldCqWnHTpoFf6EdyxOCQKez/Bi8+RDYDDbQawuyuwWmCopBpsrOHAvsOs -6zYYnhuMDuU9vicFUjkDxVSQhyQqAeypK7xMowgfC7IbPGUAmX5ygzxtv9cWPFDn -qwcULgcChTwPRh7NGqaq5QOmU38WdMVrzmZT8lurI1iR56OFHX33G8ZbsO/hSE03 -UAeX4Av09BfsGC7BoHaH0y0eUF4OdLv7LOEPpPN2hLKFqD23qDc1ux2210M1AxH/ -ZKCPEHu+fZU+wCLDGGztSGWzSAudncJfa/xqD7rjS2jtcb26o6B1yi5EJ6RHeh43 -t+hQBEdFm8kixsJu2ByzPhvO+gZg6SJlFIQloD7OKbk1AHYX1jDQB7IWg6CVNRBj -Z0XgaGnRR4GCD+P0fWLrKuk+v1Bd3sTjZt7MaFxuS0l1ZQobP71Yh5Z8tX4Zy+nl -ErjiShNTcjsTJO3+bOIdZTJh1h7oVu09hWsN1+HM4HbXVzS2n/gK4KloUK8KFIu1 -5WG7ZtVTK7PDFrIEHxoHFCCCmOTC4GQFEebvuVmc6PADZZVmP71y6mEyLAC4SPC0 -rd96lpkXhJA3nqXwc9okJXyirK1fs2CCCmK0dTxaXl/kuRAb8AQhF+2XCTV/HTYe -5wlJSm5B0nKFOZ57+qv5T8bAqIazSUCbgOd57olC9UxJY7uPItzgP+RJZQfAFv8e -n5dgGDsEaV1ZcLGPkfnBSa1jz6Fubf0rWmNvzkzx6gjf6j/jCBAv7O0lxpNKnDRq -5Zl+d7Ckl/nmcMKyrVYLHFB3Vf1fJhgdenlT7zVr4+ZlpyDut7ETIbIruE7iVjAr -JjCyfkJzIGfpkjrC5LcbqDWKF0FI2SfWIBIUMWRLLqRFHQM9fgepFsuCWlwUTevl -J055nmA1tqyVAtMmldOc5MkyZGk1zgp2PHnWBoRS5IcsIynAsUBtbNbldDS3aLdj -oCgRtQIcqs+zrxkylCjOcuGh9VCOYWXliICrYK9YN2pYXYKJ1fbR2+Nk8VChB6LA -7HsmuNOE3K/Tj5izxKx60ieZXfZobTdNCVnEvyPIyX/3f96ro2UE4x3ghJ+3LvgQ -ui+4R1r+USOEUyOaaW1v5TD5VN0G3n4HxAyge36Wgit3NCXi66k2Exy4iFjlxoIq -b1G4whrmvR/1UsqWDpQ55skcJ2yt7Gsu/mcN2mMEBSlNlXJPBT+L/rX6bYwbe2/K -s+XkML7VGBgQw1rYoCgZturzMfBispM595yJGa+hhpBBJsHKUF/pWOJk/1Um+8HV -ILXqhncwpX9xIINyNdswZ4F7ZxYkywnEcgnBPVTWSXvUaOhoqD/w+la+Ifa2NhwG -UN3Hoesbh0JCcsewhZk4tsVonBNbORe0ow84744HFpq4mGcQWoBDj+crrYjUezw4 -eDJTwvWDPyKB7D700xfPBrpfpNqU62loqJ3QjfsnIgCD0yKbnGASQiw9pfBQQrNJ -7yoUHG0OjwgdoUSbnemjMaWx/l1r0qg//D0SRlni+UmIKIL53WHhrDFWWndEcEjb -26b7YNCXmjmdtnV49rW396bxkzAKmXZyf9CT6KZOlMzM7VqUuem7mfJS76B+iL38 -HPSggxQ7bYq134wSDOph0dIUf7rthoSps7KG70zGhyJtFn4erVWAWrw0npDFwSLb -e237FL1tr2QfgTE189hb0XRSqXKNXx0kg+vNn6YQufkV/sdRKmM/Svk1pzzTgeWZ -cdJNCRkH/fD7tU1H94CE0eAe9nlTOAj0cS/rG+aRA0K4Un9ChUTALCzNXTih0pm7 -GieyEoZVsWdKtm7Yt3onUcNzaupfGYgvk4csHXoAx+LHtjusOqgEFqt6S9+SUulx -y+fZ98btapZQ+DJSoz6fIKjey5LCf7UOQ/oUUt6Fz+OPywdfzcDtIH0TWiT+Vf+W -bob7/suFhQwE2VCqyvxlWVqqVu7jbbIiROQiI7fFpgRzFX/MQJH816E3JRP9qo69 -YAW6wa43L0xcjcczG3SuAjl735h2BK+oTbWXhUMusEGVgp8d8YlyQhX8xrSkNKSj -w6iLxDMyuPC9d9LjojqyTMo/4rTwl1ATX5FtAWP7eYXbUSw4Rl/M3ClS35nThU4c -rSe3fWh1Su6IeSK2VMchoKCX6tcrnVFSz499HF+4vG8E1bRpSQbARvgZ+sWqrMs6 -egMoJmn4Fx1x8AKPqISZ/4wwoZA9ysQroVnu1G7lVJa9z14+rznooNfh7lxTyP6m -NNIkvetycy97qRjUQIjhxe+4XvTEZd/2PexMAaboZrPqwakMAPrDQoyU73r2MxNi -KiihpE/qzmTOtJ+WVYsuVu0Gf+63nKiGfTPEHpirpxfef3HZeCs4yyqkIPnjNRGU -OOtiQB9ZcdrkhWHs+cN3tRbC3OoACZ+KVh7hi2RyThMuCl69aCb4zQ8foS+gPUAL -MJnAy/sg8X5Y/WMcsqN382rbZcL9BEhpRGF8OoAuYGjNLuRCCMrRemzZ9vKozR55 -GIGDiGXppaOSF4/MlYtSvkdXzU/7a41FKmMe8zUPG/XL4kXyFHleJeWVJuxs1b3i -n5lFt+t/7nkKaZdZI0eBLmJNfs4KA+9QoYbeRV8J5bajgm2BvRtCSdYajhn/f9SI -a4Vtv0WyU2MIyOE/dYkIUzHnpFjVzytuKFu1V/4uV/SyZ2wOIHYWAKWMvqJp1XJt -+iNbrU54GTsFkgOzftj+OWMCGDnouIAjIDIqGgX1bBmgEhNnZvQsoeLsnhpaYgWq -XHV0X/bVa1liXOWQ7C3PWwfPXu9dCUkJVxpHTRZ371Ys4YF4CsuU7fQmkKph8U2l -DHVIiZhW532zMihmSzpieM2NxHdMn4a427BYr4Omt1xS34c3e2AN/jAoF3gpBLIC -Mv0f798oXkb81MjcxXsL/f7ADuWSaRGSLSXdRGWDXGvQZd854hDiWB2BkBchJTIT -zbt8/o+uQ8p1bx5bY5nLEpau9O5METVWkn0eEshFXsL7Wp7/5AByklE1fbtHowhx -OdPTFGPASom28Qzvxy2ZaOmzCMOobTXaqk3LuBO45RX9erSdo+lvetJKq/dD2l0i -BtXpiOZUlPVZ8RjVEVSzItOaBrfEa69nUmtGwMYvs4oOMhOqquhLcnyfSs+fb2dh -7H0uc5ZwJq5pZn2B+ZLQPix5xAiwYdqciSMPhB/XCLFZYIe54xxS4vhWfVF0c7c9 -HWCfGu2fCt8WLleWmAmWe3bXqqc5zxIWiH+KzJO7RmVTbobT4gUtNIoY1j0+y1jX -SF+yPAtF0Aq48q88nytOAYCE66rLG4KkRBPOra/URZdCv2VPqguvBz07ehJhn9Gb -TSN19AePr6xTe6OVGh/mC6pSE2DO4NR+Kk7GB3UFXzYpRmOQlAW7dhXxueRp2voq -ktwsxC0VM05YBhx+/G9iIiONcfyGpbWuTE5ZlTVarPj8NruULjejvuEj0X+x2Dzs -mhTTuFlowIVP1tnjQwMqf+Lw4Vn2PhVI4fOfok/jgfVK/PG1wXAPUt6Z79K+MDg+ -GHB+sPx5vRzm9aKIdoRpip29g7XlP3p4r4PSjlovmX0sMtDotPkti6frXaMIGaCh -vsu0Mxs3Wpv5FMoaTsNyUbMWaGzhlnHXttOktKQDwbLoqEMPZUKlEFYH35XejpdY -jQypXPEO6WY+hzCF1488K30nTC3ccSo9UvGPpCRTx+Lmrj2+mGgyHpa6mgV0XiQB -nag6lJAt7+PY/Q5kjFhTojIn493+099kmyp3yeoVE5PMslqMliBMPK5Ey3NMkc3n -/dEVgtPotxkfy6JiJQh2ncjlEILvAr7FnZ5t3w9Oi/Nno3qKYXFQdSYM5wUBDNhK -XjvMIzieRq4lRQFvACh4iWswqvM+xpDnL4NKrdXP/wF+Ocv0pUUUt93KWEnhPT7Q -dEZlAIMU9mU0sPFAZ43Y5rqclJvrkbv1ipgNpFjjRX/kgHlFv5fkr9jY0axA9mTY -88Q/7RYmVZ8urkyDNV+zOCOYrC0WUR0NRFPJtk+btr8b2Ma+Xko6jIeDuNDwfdIz -cgSuRicyxShZqW+8ZqRW15w6dnLhDwzQ9UGYklor2AsTkQtHWgUyEu/mIrvlHmjR -L/uj/2btZfOY+1DjGfZegOSLiNJA2B3Y4yXaF29IPmn6WR3ouzk7MN1e+USbNc1P -aACQlnkZyMc7KDAxOYcmuXUNVziNA10OfKGrF6WtC4V2Ps1K0kD7cxgmnjCVCFuX -YrJLZDAi+B/SvGZmlOPY6GXhtCehm01Tsk29yyCqh4VHhUc2EQmc2CWyf+d9Civ0 -bD36DHs93U/R1NL+v5RGLxDGgxNySAS3/Vnlm88mFXP2Vm7JeXYfRejrtbCkdcyR -iQgYabH5cROC/Qo+PdJK9EVZkC88Bw8tV0JqEg5uiKYtrXGy++YrP92ragazxd77 -7hSTDE2BSckATMUWlzCgMXI+DbfaXWwZvMbAa2tInqWvk7NJCkNdJzbly+2R6pHa -8YpQz01WMFhFKDThe7QGFYxA/fF1fCMJ3aAeYBrIcEZ9LocjTCWLlTBaNkZVzo/g -Hih5JgPGlQWQ21pTFH03YFmxYz02hxrxEwC50/AFE646JQ/iSYSU7jLDitnhBdMu -rqgZAVbcH9+TNlwRu+pgrqhLVSy5KyDQLqxkB4oCKQW4R5XvaKBOOBJr44g7RUoG -kYMjkHKXd7LibkkzlnF5v2tlI3EJ3lEUQCAAhhBEASOkwO9cCHNAxQo5FLRRFZ+8 -xTqKCjqbgeyazyVnruYb3Be8mtrEgdTELbbPciKCmTBmJWi+g+lM9YUhTLrCI6ZD -JyQSwb4t4eU+eG8RrsA6n3ye9ocZbAfqfb+qrMLfuPVF5wns3UDlkBVvG+Bxm2v6 -PrkBYHu4WYgHgdcoqPxRNWNYugHOOsRqiPJO2RUSmsXGqgwu3NNUW14KcLUS8vv6 -fGmZ2gPz5klbqVAetjZy5y17MPZBH0r2sal/AtSKjqe9lrnQMvlFHCFJg+w6KSyU -Yeb0Q5vbgoFV4anitJyJFnvZSmOlXAnCOT7olWoO/wv0voMAoLBuGS/Fm2eToBct -uC54qIZRdSYtzo2aDec9Oz0YOaXbMGHe/vpjA0KwMyICTv4OD8lg9d1pwyLwzH9N -To3zyIjwoJxT3CRGUSFCfxweehfKhFRz3Bl6gzk2KVfNxbZOPp3HArhobKOwUkTE -aTUBUFCeRTQs/uSi/0ujFubtj/kQ9hP12X2rtEcC42ot32uoz/I3h2Hu98442nFU -L/VdzOc4V6hhAhQgGaPuKYOeI1JjHIYoNk2zow4p/A8VNOyZ3uZPlpLtAPFP+Ee7 -WO6l4+V1kllCnqYZBqCuHwx5FbBj/oKmhsYgtL708w6dnIovL0WOPvwyMwshpIyJ -UYzmW136tO9LWjBDsjkqThFfngy5sq0XuHhm9mSUTRXbA2UK6dnBESBw00ugpM97 -u7BEExL5RZLloEE9SrqfhHxyPdeWSD3Nosq6MQYoXq9/OHxboUc265Ri5N6pGkH6 -JtOLmYr4KDoSxaODlKoGQGVqxjdkGt7pzcb1tQOmdfUUQ2/aMmaSf2Pd8qjWHObR -X7RA/WAchZih091aQqVQ7NIpjbIbNAeypd5FofFNDaelkRZZSZaAsyt6Tk03LCmq -7Y9+zJVxqV/QUYLMJdACZbqZOsTayG5lBHEB6ahL2GQyGIpkk54KNbMDzfDIxYY6 -Z8IYKmAsF0FVcTUHRntIw8oSM38x3Gs6KIzpo1ZmZGYTazO1TgyCkDno6nPgohJQ -PlyvjChulbfQf94sZTGG4IKzJmPh2Rg2EYJ7tJjrKzRZVOfBJc6fzE2FYGwOndvO -RWNMhoyU5GXVdeACx/tFIp2Iyj8uVPFoHWqerbdBIQKeAmJ/zFCqOndsdmQov4UT -w6kzs/q9jyjN5T0FTAW/rubdOUatEGjmLosk9rn+5LRHvzk3ilj6RsUj+UOLiHov -NPAF0qhZaOxX1h/tuRawQwlLFvRAWC4aqjOmvIVAOIfnEU2xNPCMYT6NEpTRW4pZ -xTbTg530EDwQATKYlTtYZ+SybsayggJKGpJeGCWlypZywCOb9O6hRcD1kD+3e8sB -pYNtNAlE85izlxHK1VSNycLlvVEIFOzphD210yaW4F40a0MlHINni/EBvgW9ZBxe -hO8RkCt3oTScuD+psNnEl/BriBD2ozHskQEd5sGZOuZwF4KvlJrtYXcbcMIQmPDB -Xqy1qxKTa3UaAeNtpMDNwGTbJaCVPNZdafQ2cD0KSqcZcj4Oy0nYUsXxKF/+KZvl -iZ+4ToEKFMSS4TSS5nowrW6xpMpSU6Rp8i6y7ei4RegpG2ZOstxuyruQlEqlc3+r -03HJ8rZ98wLTFmPwglXtYgGaoXx7E+ng3G/toIKR+5bdzqY9sExsukGyaX2VA334 -jcJfZJWM4a2ft9HZoBOeGnH4nAIaa5GjHhzzpZEhc3hUkZOBh0RIWxTwutScjg4s -zXXsh8rGHeNRNDX8Rka/i5blS5qZp1omjbyqF5kqDcojQVpPPTvEB8jaQDzmp4f6 -JfK/W4Qrk+WhDHJrej82XqZ+iW4MVOtloxza08HWfSI727fa+5aSsPJ3vfbWD41V -Ioc2c1qweXv3r9RIBkll8W7D3b8BaluggcuuVKuGezj5RbAOy9rgm4CHtVtn70QC -M5Z3rThtDgX7jr+6tNJjU3XgDxuqNwMlLHtIfv+KB0wPVgBKn0lVz6w5yRBDOvom -Tpc0ub7xkvaCNNvvtrAQ5LLlNZ+4a7DzX5s/ViR2ammy2/jvZf14AH0rBILpZ04J -YMWc9kFg/cRC8Odh6JyLOct/zj2YBa/J6umhy91/U+BXzCjs8Y0GF1zaaBp59YcI -PEH7xKeGKL9n64sAWsfkgtYU5zx2yAEOYLk47eithAT0nQKB2Vv2t9LaCfv7V6Wk -K1aZrWZqVVwhZiKwP9IMmxrCZpVUYWY5qJzgmFIy3Qxu9MjIKsGXIRRoZdQjsOWJ -6Pz2cuGpOJ3WopqucgImBbSi8tdi1PwjGuid20idU+Z7TfJRncFVnvELiytsi3ex -zQe8AqigmsATQbYkBAGTs59OqaObgCOTzI+eJEruOpH+wK7jpc5+bUXea0egQPJH -KXAaqLTbViEl7k+yDT3yt+siQQI049YKx3/EyBSwpmRvazSCIS5TsF40GllPYRmO -lwlJKnNNjao16utCWhK/r+q7Pa0QislnnjUc80aqeuz2NcUsgrn2qR8d40c767IY -qwHuwkiO02+c3o6Yn/RvH9x4V8Si98N6cs63Jjc0VFWh2USMx08TwhzlyVMeUc8+ -17FH/knukHfx22edsrAfq1SvzdeAjW1kAjctr0YthWMnY4CU8Li0VTqlsFCTzbOV -a7SwYg/RW1T1D30A6XL/STLiSZfseQJWRNk55251Culx5LdWM62npvTlhHeg191K -cwbD0yw1MtedknRcGlCy8NLkM9OuEM1hF/T+O0xhw1hAWhDIWz3JClrn+1HzW4Lz -V7hKhJK5s57eWtSYV6ybmRVgoVn3Qlxm2Ew/OvCWAEwX0DjJoah35JXaTiZzMCC8 -ZHy4K4/smfNn2d1fZu9AIJxTZLE/VVVsaKRPscs/ceze4N7vPwkf/o4Xn2dFe1ny -ZSw9n1JxME5rj2Twy20b360wTFrAHgRwC51wStyOfnWK78LWW0+iSBq5ai1IpUKz -42wN6A8syfYCnGtvl4T3Aw28zaCHk5Gj6zCcyYfxOS1Mzs/yNGcKNaAk1Rog7jpT -VT5C9llptNEUD9/PwhZlK7Zd4wI3CW+KNaEIYYKkwBO43PF+kTYELFkie7pium7F -0o5Zp/uzjvYKOF8AuUg0CjC9BgQOaYZhfQ3gDmTFeXex9zP3mScXc0wZo6q045Ho -UPw6aT/7bvFRXuYFAtDf4QhwRGLjSS6JFMpsSr5FC8xiNw1wk94VFvFhstcvv69N -k9PVnHFX8katlvqa1CA0JTwjue+x9sTcgIuUG+8Vr6jCuO1fvpFt2TDOB7eesuvE -nFdSiJugyGDh/7mz4BOG7NOm05oGUJJxAnSzV3B1z4sfyZg8rOVa9Ox5kuF4sQxi -WR6l+xgEXndzhYKTaRRa5WMOhh6J5ENKZPQY05h1WKdupufzpm/zrzZidt6c9iJ2 -vmmjT+T/ZHF9x8uN6LaV/jBTo7js1HTmqvxpDxwI5OAdkZNAYb8s/5EoJ04Wz05t -+9iGsxfiRQH1Z1F2fhbH56nrHdgaL15EgQilLqs38FTOvQ0egRwjF7/yVPRGAzSa -kiBbDWlpxqN+Qu5SDY1Er+P7wURHkgflq6uOlfG5DGTKKPKD9wzP9uVregRlFiY6 -UXKo/7yrYcanmmHtlqCRHVWeXhz19UItPzE9ERXT+GqXjlGlSphAk+OBdrb+/6ND -6IPmfRcUxznHtSQQkOcZWznXGc3w7ext+dZ2EBzJYsaj609z5HCisBIbtDS+OmfG -jk+8bKjrFiXBZcARn/MBTycN334vvNiXgq1k5hDwE8mx6/vryADpbBNr+QE3Su3z -+qF0kDR5FDjzPXk3zh5Oj4nrxWAcgVEWl1vcCvULUC88blyyU4IiffygkZyolCqj ------END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ta/taskwarrior/secrets/credentials b/modules/by-name/ta/taskwarrior/secrets/credentials deleted file mode 100644 index f3aaf502..00000000 --- a/modules/by-name/ta/taskwarrior/secrets/credentials +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqdGQ3a0pWb3lvZXFWbTFQ -UG1JbGREZW9SS3ZuWXJhbTdvTTBqZUdhN0Q0CjF1cnJFM1d2ZFNyRW44Rzlvamlz -VWQycXhmWnB4L1hiSE5qbFozWFlGMU0KLT4gc3NoLWVkMjU1MTkgelpFb25nIEFk -bVQ3U3BsU1FkeWxBY0sySTV2UkxocXJpVXMyd1FrMXA3YUR0NWtTR1kKeUtHODVy -aXE3aXh4WkFmYTJtdlZyZ1A1QlhYZGZuTUYxYVVlblRUV1BqOAotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgdGR4cFMya3p6TEx5cnhYcWNXR2FlVEk3UTBEcHQ3Y3RmK0lY -YlpwRXJGcwpwZUVqODB3SUZUdTlQVW4yaWlZaTE0RE9OT1dLanZlSGV6cnlJRElQ -UjBBCi0+ICFALWdyZWFzZSB0MFU2IDZoIEJPWUZIP1sKN1l2dzdWN1JDbEhEeXBq -THV0cWJIV1RLalVsVVp3RCtwbk5NS2pnd3kxS1RhNTNaa3pqWXZFVm9FM2N2cFp5 -TQpYR2MKLS0tIEhLQWdwL0VoT1ZGNU5UUWs0SVVqK0ZQTndkTURPb0VtNEtJN3or -S0Q0K1UKRfhyrcVb0EbsKj9gL5kqaIpfrsWd2cizrVQ67y9ZOwWilWgk/gkoXadf -q7QeYjnWsHeIVtSZIaHSa8+9pvKAwiYW+B6DjRi7EXkCYz8zGeanMuoKA4by5Q9x -VMKJlWk7c0WIzSuviw== ------END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ta/taskwarrior/secrets/private.key b/modules/by-name/ta/taskwarrior/secrets/private.key deleted file mode 100644 index 64f925fb..00000000 --- a/modules/by-name/ta/taskwarrior/secrets/private.key +++ /dev/null @@ -1,449 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBncVlhL2RhS3JNaWFIKzl5 -VFV2Y3dZRkE2SlFvV25wd2NRU0NVN1Z0T2pBCmpRM2FJSUpPMGpQRE5EZHR5NElu -UlBLcE9EWVBRSHA4eTRTNHpDaDdIOHMKLT4gc3NoLWVkMjU1MTkgelpFb25nIGlC -cGR2aytobjcxV0xJMUc4d1VseUN2K3NoMEx4UnIzRGZvOTZoNHJVaGMKYWV3TVAw -RWJzN3NnOHo3QnZSL3JvbTFxWG9zQmtISzRIMDJXVXg4U1kvZwotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgV0E4b05Kc3FwRXdFT3Y4c1VmTi83QXFxSXViVVVORTRMMms0 -cVpzMEd6ZwphazBuREVxSWxMcFJUYUplQXFOQkVjM2hUSytMUmN0d1dsM21lOGE1 -SkhNCi0+IE57XS1ncmVhc2UKN0RPSGRMOG5YSUZNblphWXg3MUxyNVVyS2RocnAw -SFlsbG5PZzlWNndtL016WnFraXhWNHhaV1hwK3F1NCtDVQpSMm5vcjk5M282UUk1 -c1BjMHdCSjlkdmxQM1NKdzFVUG53Ci0tLSBlbE9TSUV2Tmxlc1FhaWZZU0hWQVdX -SnNnWFUvWEcwSmppdCsvQUxWVGlvCqDjHDzuQfNWNpnVCLFdErXs5Xp1tedq+HIK -/os5NEoGXikwdJTi0QMbBJwe/jKtf6WNEz/CX/sNCRg2qHGLZFFOuTZ+daIhfx3U -kO3rA0pZzN1nyVwZhWSs63SOnooAUjfMzIcnDnu0qfGKXUAf1VmKxrqx5r/g4Sk3 -pYj383uWylTkrCo1OA4Hq02ynCosS+rDtyMb+mO8v2MxhG/r5noMO9YbBA7DOKtv -Rp2Ji8vdrvUnsLMBWBZsdFr0mpg7adoraCRIerpbJAG5LpA3QsHS8rjymn9RDLH3 -CogNs5NcYEjIj2sf+1/pLUqlUb6BEog/4QLD9aRIoQECwNTIMHRtwq09V3YkOEB+ -UXCTnfdDyqj+DlADFfRmu82P32E/VcS9MH0WHSKuVCiNa6Vzljowrt9JUXVxXKbs -+ae8+qnQA/rOInWMG94ypFBH+fcYuso0rFSLU40MSUZtZmBHa1TYJ0md4U5V7Fnp -0OpL7PNnoxh1fdlTwDJ7zGOUyijTl15dPbAdzSiqm0mYmXms0BzPkubOMbAsiKmu -lXUVOD8RPq7yUQAjlC/x7h/0XifGLNXBhkhAFM2DL7J3nNM4CZUbdma2eeRDhKYZ -i+gx3xy8YjQ2mGkjQbCE03pofO4xNiUKohdomF0Njpu0tzAXG/l9P8AourxLhKgc -nJ2lzEtoe4BspjacHWsvRU4RUXptxC2oTmcDDhD5tYWg0yntj1Kd/qdGJPXclkMC -tyfpJVPOkehCSM+yvByAtZizCRQONbrdxzDZNO2TzCR3ecv38icPV6xFxQXGdCTo -O9uydl0gFA9lQm5k0NhhqCEkRJX32n4KSVF7stSo/IPyv15QqRTMQtvxrAbXfxNc -Mc0/72Y/+7HsyzJgnK6HRNU9O9H5QT9DpoyTcFOfiaGYXJm6EuZtt805PvA8bZM3 -v0nbjW/r8dsdov0io1WtQlT8c0iT9Ty/AoZh3EHQg6yqQ5TUGFyETqMQXbyoR2C1 -/UFtfcN2J/9sJUPlgMhUpGH97k/RX6uZiZj3JHtxT54XVO7MtobpeXvCKvYkPPze -UNnV+6+jWWf5dn5z5Y4EOAcxTjgVvfmVQV5xLyeORPBhqUbX723d5HYKZ2+I91wo -XBUa4c7YxB1UlW7Vt9SAVJZEvTXkofsz4TAqm1DNOFHDzJw9rHkGCIQorPhb0ga9 -APF+pOv1I0dyFdfA8novDIF1c0A3lGP2yeoCEQrfoQXOWpmL8O1U/LCmd9oulQrt -B78MxsifVxmatEvEMvgCtMzyRK1xz00rBz0rqbd3NLSxLjdigdGgOdZSSVhyYGXH -V9qVgcD6QxxlC6mMMK2ZtMdiHK1kAv1/20C45mXTdXJjYDBxeSt8JqOrZeJqBVQL -XMztF4yHDxYQO+P3nb+my3dXe2PkK9wF0AKImAxraN7OjD+HZLSsQoYMo2jvQYh9 -/uYvwpOrfkiawqM9U5zF6WyJuAge5BVojTkqfQEo2pcLrfQ/cYXEtVbuOFXLTkfG -o8Umfy9fpAYDv293x0gUyS8kzdRFnLeEJw4OaSCtjATJ2zJIWWEYxriKVpOu5bei -ZjeDFEW5on1dBmVMVj9CKWk/KU9YoCT922Gs2MzHzdEXKL4l5ww6ow3KXeggALhE -oUh2jMPW58oDu2zPNooD94epqbNbMqeSfdzoyCE+AhkLqM68Hc3RvgF/nI3N95z+ -QxEmovIITPORwSoWg1lmSu5VxDNuXtbRN2/bFT5xmXyQsoZ/zx7Se02DZbNBJ8UW -XmqoyPMmGyyvrsuvTWeT4CMt2iRM/7EDaYgY9D3xPmbmuGU+/32zS2pl/KrF/cbk -daM8vCfvFvMGW7kIgwLi5UrgZHxehGZWQzELLW9tjQjE6UGUsm+ZBD0B1SX+GRg1 -bj5X+ez5pYUPSfGlJU7v+KYb2BBLv4jtPNiiQ35dxZAcSzHrY+QLh/Q0+ZBXfaQ3 -Qh2rGsYaa+qYMZeB8nvmgl2GyRP+NaReyRoyCdnpyy7DDweIoIxrcB4d/tDPqyGp -EUnWtqfJj3fRIQIYre/UK4eQ+CJcZlQbnsUjO28dq+fEwWoycUOX8g6ilxNa2s2a -CHUBDW/Ov7hFWdRSrF59Rjj5z5GkchQ/OYVFReuhb0dGrOHupT7NJ30BBKofWv5g -Y9NzFyZw1jjK0K1PtdxjslUXmAMaPtu4dp84Kf0VGOr2myMvR1Xk9ZeEdp+fTXFe -f/X5+UDcJo8WrTGNMz6Ef4mJshGsEyxtg0a19iZPYR8yjXf/9LxVEGkx3/STWSJ4 -LwnEzMEmBtU4RwzgxqsUbE6YIvhDaY/YoRKEKmo+5rMsM1NDdTXaxd83VP45UjF5 -hYerBjbo/g2Q53s2gH4nQ1Z9DSZSqoN6wgD22a/kTd9udQMOWuf5XWIBGV4iwnLL -vcT3C4QYxPKcQNRJ0ROv7CtKwFUD8vDC988Ze6740/PgrLwsHjDc4Nq9OjXmsspe -+hcV7qmSUCBB4C9V9sQaI74PnFdu60BxbfHTe6/AZs16ZegNzmnLe5Dy1dZer2Xz -x4Mi2ZB8jiAHkSZltFMMkH9Ultr4GrXOSP6hpgOoVGKtef1CmDIQA0b/f956kaU4 -yfjaoHGltj6jDv6s59X9EPUg6FdySLbZFnwZY73VHl4DoCsw7ivBDmvC5M0ifpJU -p/OeP/QY7+HFrdwUS5TLIh7FoO0tbw/VKhBuToxvlc33eZaTUH0yRcZ5zxEeB9eT -5githZaMMIaT/mWe4NkHvoK25vJSy0GCC4POoT0yBsf+ZJtbNoQDjcZkOEMY7fJW -+LrVJe198aYZ5AfxYL4B7vOQaRa0Ntjw7YHJ54JA3FptC4m0x/vFV1isiw3AL0FF -JhEqmabWVbMJ9ghc91W/pA9Mc97hjZ6tWNqd5q4cK+E9yRvzUFcXSHU7g0nRwbJ3 -uPQd9j3LgF+lsts7EdUKLlQbD8UHR1U52WiU4yxdu7G6eMEocptEbVrqkSs7ERU7 -Bsete55PALCdOLd5DonxmWhHTqlwwJwurIfbhRQFerPGqBm1n/9LEHjeiwyG2qAD -26ATN3Yq9P7E9JVRnRa2sSRyQ1DQ4ejBQhX3Bj3YWMaHA/sxW3g/vNqH+zGpOTOK -DcLXSb9a4EDgdCcbT9XHZYXp/MAs31BprPZpIoFdEyBF0vR19kn9kVb5TDIJfqCg -hfIYtNtbitXSSGmkVRCBO/bRb7NSr+LEcvFTSe7y3d7Audav67y0FEIU82lWnl8M -51gwRCd1JcdDxwywUfXbg70vMWT9ZS7vn8zmQ004YqCVobcGyaNAerczkISwvYJq -2wuactaCVpcFkko010xpvfuHqY7y0zH+N8jqO5q1pQh59woqFIYKeajqmSdMv6dY -pGB/KcMfXeo+bStQOmzTdwJi+VDxUhDzNbJylYcm/QICrUu+CkCBA5rHLInyIxVd -06xxlVcOp2y3sMq7eLoczELFSd/F67+LvafqmLfBv0SaRmvRrcSZOgJMTwOOEuhV -fCNwqbBuXE4AMIt+Fjx9SYx86O0H67xSssyOmUWm6pd4ZF5f2yufB3ro0BRcGvrF -/Wsr1Xo6gmp0Z9DQh1x2gqFLSGieCRgtD7MEH78G3dF75SQ88Gy1GeisahYQrbW4 -wGKwlDFO6cAliwJ7tm73Z4reakPIamX20gdkynQKohavlYc/NaK+fhexOUmM8z61 -uuTcXoVOoplBnYJICJbshwnmvyQRzmqEGvPItC4eY32s9t3EO9gsjz2J9aLHfwHK -RRr2hy9xXYuETnY8R8IhmO7/YfhK3nVBh5KtOcUZU8jzDUgTSsX3lmC87oC0Mfbv -N0WEaJRzXpJKw0HKMPKQdXmHdvomj9PYC0vJeG2x+NMcEBpSx9CpT+++wqCrKKuh -J2qBbSeLldw7CowrkJn6ll2Vqw6UJOEExDyhoDtkAdSvee0J+XeczycVQtx7AevC -E4bOchWeBkg8aoLnKLyEANJx2e6kqH2fF/zOM3gATXheEXxwbs2gRg/R9bGmQnNU -v/j8S7urwMRxAWm4FYhX5JM3kQEkhNBN2DXw5xZxVvtjLzQIVcRy/Ma9+O8Rhvjf -nbfC0I7GNfGTVIsXr9Jv+4V22MZ/ShP0XkcaFyzUipbgAnxxpsMKfoBrHeuQkNWS -9BCkfuvFtQgtgP/KEMklX2bZmx4KdtiA8neqGGoqJA37QOA0gbVoJv0SepT1UEDS -47vhYwg8yhNptNjxdcwrjq85UmYdzibBOAXIY57lXmUsxfYDWGXSXGWvlPIdBc/q -vrAgmoNNfY7yjV5eCTLcTLsGr8O/U2oP8CIL4chMuNZWQ5785T0nPlRenue3XI70 -E3FC+bCXCjHerN1iAE7yKNMCb9AsTHLSPcXTn8udFTjQRphoaGdDDTMxHJOC0djD -6ATE3JDep0P18IlzVICNOlZts1J2pmrga9A0VsIuZXtCy7RpMpyOLuxrOCjQo0Db -zhlwJThD6p6MNmlqvzKh4TPxjC/REQxeTN4yt2Wdu/sasAvXtyS0Usr2i89NfMZS -SnXscihAMK3xnUwPcqj+yQp1+P6Od2+/rfojL8hG7UjoLCVOP5Pxap4oQwlz4gB4 -0Al0k/QfLatVCMOCQaYQOv0/ujfzj6ujWOT9qA7u5ziLxJaWxIdlzMeS/oU6Fg7z -x7N0Bxm5f33z0nS09Iaoxew178InzLfJGwoqZN0A82itz8x/EKwrn1KLbzeh07vP -aGJ0FydcjHbtppLIqDFppju2qoRFx1Eljijom3o09Cp8wjNiDASC+q9gD83i9cQV -Z2rmDabvGmvM9QYv9qxyCnv98DWLRkFqnjS2B2Fy53V90BH8Okn9EBUouUO9PVGy -vaoaP5GGyXzV52UDQm9gbVrb2tiel8X1fvzbBsz2+HMmJis+5mu1PnNxJXO5V5a4 -0i1+fnozHpGSgs/j7tTP/76yCwdRkkPyUJIi6RDN3MZuGxwgR55qnNmfZnoJTHlJ -Duu/4oiJigaJlXRkvyiYmB3JAhj1ivAJlqiloVzvoZSYXdvLKrITK1Om4Pc6fjDY -ITYK7q1q7GdsePLx4NUt1cAJmdXEHdjTLY7XLoXSIm7yj9io3swdOjF5/D5k7tid -Doukxtwjvm/GLG7unCWLKQAnP9FcsagfRQQsaiCj/1STaMSAmb97MKUGtGG7SrZE -cwhBBOmhjmlW1y3P+G6dXXEE1CX1oIl+jvkk9Y8rJr7kaK4D1OyN+EOW8ofSBFbP -MUacZP//d088fOoAgzOa/0TtDsyxrgcPD9DVDDJIXtM6Edf6lBO10f3aAMcRuj8y -RmJDDZfsMdWUu4ThprjJdDFtkxLnJrwA1iE93uFRlAPaoA+qpERBeWc1uhQHJ9Av -AT71rxWdYHPD3V/utKf6ln6qNez4KvKIkO6SL7sYkp+XPfBgdN0vSG+fwVFOWMFc -cbuNq2ugnmnmbGJVJrGGy/gvM08DOSDYUKH3BVcmDraTIR2u5KNDrMpO7Xh0wxCF -7688xmQ7TETEueJmznM4JyKaUAWrXcCSIGQZYT1OOgLRvoRlZFOlio8j+oy8mhxl -oq/kCsKiVyBW10FxI6TOyxpwJeS6bA+jSYLML0xN/x2R4YazrRW6SDceH69beT/d -GEw4MNKqMZfdcTPV24OxL2DzPlwV33u57n09+2tFFn8fkB/9imQSFQNG+xcvT1De -mq8hHfHnyxD9rJNdQc1StdzWeps5okFOq2PIltnmyJWW1OTa9JCODzEesctMsMOA -NT9cOrTnZr4EgqAwjyahDfYglgaVE+M763NK08IGuJxVOx6pbjpFka5Ih1wlKYS6 -b2yn1jfEoOz7j/dtlWLIaiomnqZOHvvQ11mizjy7143On8jAg5AFtcriYo8EYGsF -0UIz3+jyg8unPoc4wvVdj3hBmsYSYAogeUMNIrVN/ZQPadA9hyRvbqYc7xKJqt2W -eomS5fWaGRZlZCQZwtHegSdkGWBLqu6KFO525i8tXZ5MCSeVznVF8RqZ6zHdqgxk -ZsZURgk7xlJwh0mBUHt8pr1Gzm26Xgis4IN9gGgwFpW5VLsEzuW78FmQSwKSIV8V -yRh7mqz2xTiqJhpfzgJId37ovln9TVoeL/fcsx2vXaHYRKznHnFSKr3Ew8U6f4IW -Wv7ZhylKk33DiT3NyjmMxUbq+UNK0UR3docBIgaw+xJEU6dyyzSTgGeovVeZitCm -/QOZzUod4UbtZ4919RJ0I69iICOgNoi0D9iz17JAmQEcgP5T+pglFwDqvvrgf8Fh -cWc2qdg3MlTt5MjMesJ9+qljK9xjRww935tnAY3r4WZ7yeVd2z2U6JnzPVzo37C9 -SzPl3ayJMIVwZwGxU/O+QoP/rA1JggJtLCHki7Z89Dy1ERK33+1zZKMy4n7NcIlQ -z9Yyv0O5qP32ZQDZYaBUumfgp0SIYlkfqMa4de6aI+UQeo68H/1rHn+Lw/nCDXBk -nzimNn1tWyJA2YED70YhLoTx5GGyfH/T5+YhU8f4ydtRl11pVdQw1EXolIq3+nUU -xGtl4fKyfPHvy0ZZB6ysU/z+XS8N/RGE7w3fOZKvY/EeAxPciQSes3SvBI//9l4j -t7ODbaBcRocvTJslaRBr1oym7hGSH1y/YdE5EWbNky/OIFrobMgThXOPqFz2ScAO -Grk9QWXZ9RSO8sN0mbR4xKiKePbpNs4/11+KA2WLpcIa7f+I/EHaD2fPkKcJrPpK -kkWxnsl5eyI8MSNY3y+Z8nA1rzvHyZnLf8On9m1OBLBM7lXCvX/q1p7Nq/Q/wpqY -vTdRcKn83vtRJkbFoRPXJGt2dfSYMMfd13t/RN/J17eof/ErLuxB8K9XuXB2Y7/k -g8DmdrG7lK1lU8uPeNto3bc94ztZs0tmC3jri8aLA0EPBrHR9mgb441ov/N5mB/9 -A8c3RHCBiKAVyIIp7pX7KCN1U8vDfTjkXHEi0kWGmUTEAd8cyWzMn+GLIDD+wx3b -601UdympSx/4eornUyW9Ozw0f9urBVIXJS/b0Cmo5AzcKRRchjCPDCsz39PzCneD -hULYUEktpW+oJY0OjGqwWkcS6miXOaeKc9St/laYAJuzaAyYHIKbsCpIijB1rIrp -xKmFITZtEzYlpTjsU2AGyFU8xhrUC5bvVoYdR7VirtEi4ucdxfZQItcADRg9hbSz -BDMfTNbKG32g7wMY6tJeounqylQA14aNX9cGQgLWYJVAmjGS79+JRn49IWuutLP8 -Zjmoa2BaSOgANj6ZwEGtL4NK1//817HPWHsSFq4zctKxNS/OLPbRJdmKRDS0mHOY -uaSAtg0EsZKe9jjqYukb3AXSm4jIPaQIpIORZU1zQmaOX1ECzlSs7bkiRsfJffGX -XoJuWZMLoI938nd604cvnoUZMuHQM/6nqdYZ31GHPYZ3XLmQmIb1udRfLZGLuLo3 -DXV0QFVF2O9Fq9VeOzxO+7otHIGL9sKKQlzaZLmWbao4E229Oq9REGYScyoadVmr -J94gnYWyt8KDSCQRx0C1CmbTL6O7Q+xhwyI1q94+ioi9MzZptJ+kSRkz+IpFVIfC -MmIsMXwkzRpNB3CrRnS7QTYcFxZeABVm6Pz+GLxOYDJvCo3gqBKV7iv4hk/eKMpu -nALDhpvfoIXZc2dpKJevEcvkoetFzOdCcScibe9L67WBYBhnj6Ub0mkrgZfBpkrX -vF+1oqb48k42M4fjhxy5lxF6PvHpSrjmEV1GOe5EgCnZ6/MUibG4dO4igz7iB5xs -Do/ac8GAp++uxVuNUMJ4kzlZqbgGt2yR1ndackcLoZ/i35R6UtR2m36MsFtucdYG -fCMwLwsBs5NayJTtW1GaMEcvhgBH4d9TVInqKFnoFjDrQUW6A3WDz0Oz1psD8LFh -WUhrSqOkm5wX5Lphjp6dGPXEVOE395IJ/Ld6d/95dvD1epzgNnlHBu4JA2xh0V65 -KxETXGwNsu1Ku6DdMj//zh4VgEqjIzYLaJPTF1vqTwHgmgUXAcpS2b/HENv/Mz6G -7UK6J1WzqYuR4qbu+F6VRtRCpmF/tiqsSYMuMLXyx30NndZD7x9o30zbBdPOTTAH -+l9P2SjDrBcT2UD4z39IdnpFm5yrcqiFWbQjE0FlDaTPUI1cRhuVsLh/6Ozng4vB -gGtDrp6Nm2XyjQycLASQOqdwqVKOi8NQnZbsjQ+jE7qOwWpfJxBYQ6rRmat5QgLm -tmC5ynt9uihOSwIuOP18f3vZUo+/Q+LFQHvarriVikIIDFsbC5M80Cz7Hh/DupL/ -yA+2jYQlEbMBxoNcDaoaGl8g59xcsn/LWZPSDIrY01WNWno0O5jDUoapEV7ZdsVL -hvLO2XL5mhDpW69FaEhAu98J3uiRJ9LXfOTQRf5e4BXmTMXNABs+VWaP7igzPuMB -+rbJkY6ZsVDWEU/9JHpFlHv23uV6zqxQuU1U19Uw+q8YHaEn7Jl+oJphJIfZZaxn -/n285NFAVt3lqVBeSwsWkaw2/zx8QB3oGjlRPLShr0RXGlwU87QwfVUsXU18mO5a -geihvooTrr6j5Ha2tWUoVz6SffhzaCCts75krIxWoz4YGs29eE5iIqHY4ly2UZ8t -Iq8g4rBKzzozMPJ/li6RXIJqrV403B6Be18gCOxpQ40aP1q5Mhnt/nMWxrwpp7Zr -xRlfWONO8xGbz+yBe7RIAiAZMjeD2IQPyxwMO8d6AcTT4CStA0ySUHnTPAfcneIr -1Aitw4yhDI4FUQRUSxRW0b4IlLB/RmKv9accR+31zRmaW95jxTaW3h8Advapg8KE -q71pl7qTz4ZWp9Ub8ZztE6CrlTRwP6c0yyPsuAsxVGkazEs5SbeCxQRZfj4DUH1E -7gXZN7DktuQPO2Fsq8hFrKOMztE2SfDJG9KIc9T25prvHve3flOVz7V7dDuVMlfD -qeydFA1bzHaZ3R2jtq4toYRQTCOy6MxgC7lW1s9Xhe8ga/5JpSc7AdOtDE73Zdic -qC/hk98zOf/mhF7CoVfK2UOJIG9mAOpAQ/sw8+FbIwpVSOnpmDdyRmG5EPXRYI7I -yf8OvnWAyGElXDAyLml62VI/eSVYouhNhT/8kCAe9N5H01aFKe5X2ktj3CZP6nwi -S+5ENe9kjxKiLiembki2HAyyC2aVSV4/aqsAAp5JwHdS22R0+263sJrRGb3rUPRS -ad1yV+E+VtXtMQIXrJ08yuzQQcdjXeJ2olqz4Ar89BQg7zV9p3jqKoAxhq220DG2 -vLgs1/Baq8VyLJaqhjMdRn6ArNkkQpdeL/bKQmDIU6z5T/7M9t4FGpmRwm5HsoaL -AQbTp9sHgM7PvCD6pYmQZIKhr0rH8XjkdM7SIaEIAvLaIU95FdTX1OKXUYpSYYid -2EuKcrzkviiwsrF5H+MzhkQX2W9fjX5SJ7+JijTGcQxEl4KMjKneQC5t4YbLZ7oF -j7esHFHNR1LgkwzNhPVliJyzPVUkF6z1OqJw2vqhaSXuJ0s5djwRGoWCoCWs/j+A -JIJ0PmqkTdVFllkPOyXM2cgb4B7gGt7IUq/YgAbrndNyTmHkInZlPvBCxDdQIiiu -grhmWN688juD19UTt5kCg9Z2kAFTbLd7o7nNXAl/NmYdfBhvcp5uECS2f5DyS50u -+ol1htE6JmcDgRVAmPh9J8m+kAROJvOe6Jkc+uNKiCRtsgpILeqAbPvDZvasJUrh -KEEh0dWGmB+n4EwN1FaHJ3zGux1ttx7BnuAjj+2ztYTo2EDdmT3yfbcsYQpypPkr -LhjVI6Rgi0SdvFwvYhg4/OsdxB5zr5je/ucJTQ+wpZoUhBiRyfhYyqbq9gWdAo0K -Ff/5GS1Gqm1whXS1aSS4u8gmNisr+e0C61vPOjpGkosd5MWJtj5PZijARFi+PslY -7tMjj0VyRMv1v59mtF7kzg2Whp85vk66tSbzKo8O0gvEEr7zfJtb1nEiCD1TfMFH -734qVEOrnP6V4HM9jyQZKbxC8YYEc1OD1IMAmS3q8uBERe305WpSrpb8qG1MVlrm -bDx0JN5qdLz3/+MKo+gIR9wgy/+ba3cJ9UEHgdYQXbkK/jSp3inPsa91Y0HBlnoo -z1f02ckNiuZxzM1oLbeZSA9NgYN7OsV7gnlv9fbutIuV8DqGnKTY4EHmyuJb7wPo -A/eTTMGBDnY6jeJ2C/Qmp/Kg1Gj7P7LKhjtMw85vL6h3/na4oMg+c9cEgu+tpH7u -SUAvH9aPDsFXp2UlVf4UxJAJxfLb11/Ok0PvoDtVpjwwk1UnAbLzSueKIxiUMw/7 -RLqgXlfi06NMxwVIcp2XoVmVtb/l4BqyuYFhBqcB7pHjmuK38leOijrVl5p8UmON -lQHsW5a+vrshBHxbMHtSgEebiQGJXR5fB6F51CDjic9aCN/mjpT/ta+fcluGIPng -FVpO7QwNTEFQX9VNbt+bw2DU+A3CvWlRP++sg2neM1sZZzogYIEWZBG2tcTmEOrl -9Kp7pfbjmxSQAy3+o6ukT+bAOfg4kOiSRirIHsBIgGtb7eDHpi4VWdyWtQs9z4Yk -LAKbxjvVeFuL3aiTz5998sc3kGJ31ksGj0U+3NOE9C6XfeV8m1kvNoeehmY0GSBx -iQOJ0/BA15xnj1fujIXfS0KdNH/o/CjxWC3iyibHULFMubI10E6sI4rnZIsUDaHQ -ztkHKhqm5R+FrRth6kgBxp6tm53T3ZoW+BXz1fDlm88dkeKmbi+6ocofFgUqxqTD -OKHZZjAiSLCQsYDmSQ9tVZP74DtIt8iC/xkMJETdU6OFvlcY4bjQZddno9UDrPVG -U0c/7TAh4cVwumfNyi/V113Vr4Qn2Tl+2Vm/EsLoJASxAcoHO29+VzHRzXxX39Kq -wP9e4qyQUMQCa02YT+4lPmsLry17RNJUA7BKtjbW1zU0Qa/DI3NGNgfzbysJGoHb -7ZK/5GzN5+g9kZqnplOl8UCini4mlSY6cD0RY+x9iWkG0tA6si3IesF2uuGosbph -aF7iY7uH+wpGo+GVsI+SGiTHM6u/vQnLhiwwEQP55Lb/VzifAZH1gQTzcJjvAv4+ -R8vetivsgbbJPfumGv1tToxsFNAOGevCNseZC6ODq3cr1QjANNTBJNODse1J2fpN -MXv2QLl56LJ6eU5RlJ5bo04m4nHxi9kGIRql0QDPFUssW0UcFN6SYCxlFzxkfzxu -xUdsx+RWmatnXMu/h2jKOL4gjmtQLg6PQ92tH4c8qMYS+ez2c0g3HXRyQHJRYy7k -Uk7cDxJpigIjeQvPri0TVpM12sxcKVOWVOnQwZvWig9Hzg6Shq7iSgkI4ksoqgiY -QEq9Ee3E/d1Luvn7zvDB4VqWUWG3cuZk21hrETe/3kmeiTJSk2R1Ytcrama5B1Hp -Wz7Qj1h2yuLVYEKkL1QIj9NrUyF5EyCcljU4REXXVug9FVnfW1fmMK5bjhqGMkGh -smxeBHpcPn2vIXjs1FCXXcyNdvVv75Qqg44R2sHnPDb3Z38bQmH42r1iToJrwpwk -kgdSaDOXli2RvCR4zpKf+/74rDrAKYSNpqUlR5d5fdj+n3GuSq6o4Qy4yGKW5mrn -zivbU87sRIHFL3r/ob7Y6VRT1maFJqQw045K5zsJMpWmy2pbpgFwBBa9Qtf9sIn2 -fHxOYjek7e4sO3ESnOK92iQGuVics9CV2uHr7GdoaVffx1IQHPd60rWrjCdSSiS8 -tkRWriijJ5I9EB9Z3kf9zIw7ePWU1jEoqT7lbkqCFa86FKj3vDMKlJCARgGWSISn -vmTLBoMG0cHuH1DsOU4JveOaLgtJJHd9QNbbd9iYd8XBt1OWKpj0DHf8Usq2A+1Q -G+2llPk3YD+UdcyE4pOHpc+Ehh3WSF3g2HeUgL1o8W1nHnOe+zcgNzXPKyszUzpD -DdjrLsxSdDgDEDiU4DUQDLiUCMZyi8jE/aBbZnF+b7/OU8xuJcEHkOUkGu3D3plI -wpN4lDUhjdeCZ1zGdUM8ZvdXaLzwgM/8YgRs+MtnPmjmefYXl2nmYVlmwBIHI9gv -sOhFfLCW373vKnAk1puojqEfCNaZwHfNvDtKhidjmjrmqZ+0zMWnn03nvH1/I8xi -1jn+b+MeIUu+Ki0IyI2WlUVLI654KxkSvHOcJqwHk2oPTEMEvR5x5jR324XHs9f4 -gt6K2/FKmqNGMEgN6S8vML7nmltJC8HXxT9t3SkjNpZHEM1s5vg6pEsUEmI4l2Rd -v4xRSuqGd6LeCVexF7dWSs6NkNF5fto2V9aSyLka8WY0QFmrklk4JusM0aw9/pNU -oEQNqk4XnZLPcv26PqRy1omLzhR81wmmSFVSaqTnC480ku4KSZBi+Hztb2aPXqym -iSyG37moId/WAeiwrof9Lg18YLc8rg9y1whXcNSGk79HUOshqE39bRF0pvLFBKEM -YU/wc1DqtJ32CiW6mIe7YaaN5+1ZhOlCXZB9jEBx98bx0pH/f0g+xjsZwbrTtSfN -XCDT/P5ayHif2tPFwsmJ/nbKI3UxW5qLBrCkEb5MnmY4ZBKuyxoMO0eVUkgB3b/A -rz9XvQ+BZW+tyQCCaAHMP+aXMtVAEXVPUcEiwpx4xxjOtFut6Xu2XTD5EazRUqRd -ofhb4G9VMpPzJVm3T4lidb4mH986P9X+kq0gF8x4qA20oKUTbVbQYli97A1i3h1k -3n5ma2+RNgYlCrXNEpDL3m+oe8oyzCo+80cdq6DI4AblkCUGetou9mD99+M61tXW -sBLLwB7WvAhUB4RTnw0kmRbHcnenb90MF3doKZUyITy4j+LggBgr7ic+w1U73MKL -C7RyscTK2JkFPPMi2HRyu86JBW8ctrL27lr+ErSMXXqXd00T2sGYYonu36SDBu+q -s30fLGkoXAM+55Fs7T+zYXeHBRIDFJTR6P5PeXzj583Pqel4koObC4vt3QE4Xzad -hpzP6vmLWcFdaOn82nFMGMr37S8JlNW7VFG+jCSIElTSKXdUPDpHT9FuPV0XpheU -v3Xnx50V6ksuMEPJ7njs18iaBcAqz08VCbyybfmUPnak3KX+wNi9B09hui/TPVXK -zizFjlKNAxdeC8vhBbbrW01+Q8uavXzFXyMu8FTb5Lbn+7kVZQrSDfDrxTjD550U -BuoOrx+wv+rIPsFzPYrfgKE9hWFdOevLKSOjkM5O+UnZHnV+BWNjERP0qyykuqrA -WochLkw0OWgzSXyMUnuz4wtEiaJUfkOa+g3fHgQvTwbr4Lf6Tf5L/L3nLdKTcRBL -8mrTW+hHg/RfKewvpW6+cGiJD3e/bc3KCO2zL6jv1nn6RStbbwptJK7itEMrad31 -TUJTrbX9iUajAIS5AcicUbr/Oyj8fE/GAu5KgZHwEgLV66tOd3Dmrj1MXcyvCNLF -NfnLftKc6/tLuZ16q9BgCl5lIzZN8aFt7t+2fWuAnAW4TlLtKTlCQhewUIhDIQCa -ZVDW5PO/bIdO7SXZACTeDb9XNzRoVIB4iw3WQKrLcTqpUD+MYTySZr6HUAxD2flj -0fdrtCLO+Fu6mvrllhqXzMkUpORlpBQ2HkcoQ26ce+fNdqDGpVfzyit0+A/L4o44 -oP7h1XcKaMKIIB4FUgwY3XDXTbvRfHxYUr+Uod15+waT1+s8sqRQuHdbQKRCm0Ju -tu29DXk+0EGR94AWpxKD4h/zf9HSDeXq+U6nPOuUb1/ANaaOo7ixfF26/27N5BMa -LMFjCw+F4SBfd2Uz0YLsFD/ssIdMGsmpj2FxhCRy1RKUFvYOml/h4broxpv4wiNQ -CCj74CwakKMzTRjyeNa8cwbZWJ6XbcAQi3AxaqsrcBI7aQWRwJ08QUkJ/rHqIaMg -DgYESrvGmgAoBJpmIYfGsw9qU++AIw9OFqbpi7XbLTmFFpMEHv7gmNRhgwlK8G2E -9O0lARSVToXGyUpKHJpVVYgs/KXJE8fF9bA2RLdnfSZj70QWBdeh5En/YDyV1wRI -v0Y4f5YXYyHh8BrkAi2kIsMq6Vi5yC1iJ9nmA1GDgHcG4uTF144OcBEWysX6LD2d -zdv5GSkf8SjhQ+SRJ1sdjF0m7Okz9RohXdhDXy6SJgt0Q+tLiNL1FTDjFG7moljZ -ckIg8VSwhP0aPD8QeAe5HG/nIBQ0dX2str6GznNbKxlPe8imZi6efqc+ynECUqVC -yFzHLir7IjYDzh1hMs6tsUfiSsfj3SqjDw0aYpncyRvaHetU7uApqIjqdj055WO7 -pwU/Po7JPW6Xsd9tucfG5zWqL/CCm5YkentObymYA81IQezBMkRIJ39+tm2zdWo5 -OlGRNkQ3yNNJSf0i4WkdnGAu0mmEekposoW1hiXRli+ebh7RZadIvHjeuRfMJj4u -MMawsN6cd9XzZRxiaeIzrjzn0CXa34Fg+INBZx0PkZVkaCqR+TsdJ0JdIREEAH0W -mmwnuOQrD+47gnAiRz5bHO9vi9JQxRGO8PEVO97ntKIBR3EjL+ZulbFgXdryecAk -iF5vh1BjQGCIzZ0ehy7ehdiskQ++Zv+l1HazNj6iyc2qztShzKfNkqHPuJ1g8bwo -DoIScplw5SCdRMU7//dtsa8zexSzgLKpiC2xtHa37JvnPg/MXTGgae3BycbNp/xD -+OzQieNx1LHinyhkBGzvIKDWkV7mar6bOO4eySVkIPD2Nt7yP6RcIT7DyhllFSmz -AtYcLs19NUH60X9bcZjxehYRAlT5PXTxY/oQWo1BSJvsK1BRVhEOhKT68e34a3Eo -V8l81Eb6LUZmAtoufulPvGPgss5paAFaQINhhukEM22/fymc//jIO//DMrH7ekB/ -AfIneJm4TNWkhTgxh4JLMuYQKvtWu7uMbRrfhB+W//8yF0iERqMpO9HAErGTzykK -ZceYw88o0pVYBTmqgqlC96cCve5tVNgxttIc+Ov6q5Ii6pGj906l9dY94K1v8ntd -hhsgd0mFmTivDR0fGNlgas/+gJwqZdn4IZY6tdmYoLiP239JHHg1bsWQA4Pl1FYS -WT1TACCPCiCcB8Hy4VUPNpBSoFsFsc4FJf3cccxycAlHMHajc/T8fT1E29DrIpaB -9BeFSRI2wbNqAZkGSVorUr9zGj1xiVQ34MB+psSKjQK3Qvk45wRRxzcT+vLZXGWt -Bj0vufitaevyz8X1JPJiOxDsAS/nyllm2GJPusqsoSlrWnogb/vXK5gl1JkMh1nL -tLife1KQUEl71gu/GW1WVYZkLf+5pxNL+eCfrwo/vFPRb4SZDz/+d8G3wZ5IWRj7 -aQfzv6t4QyNt/QEkdoq7OxQ7r8T4/LBkwscP592Uc0bQXvjeTRYW3SZFSQS0mLMQ -/yciT+c7veCBbepV2uPcYi9H2O/BrZuhtyvONPqvrR3a9wGcPvGObgtLFuncuFBO -qd6EXQm3DFy0I1FWaYDvDQcwHmKlSiu8gPVdav9aUfkw8cr4ShiIuw0UqALOMoPl -pUVHsOC4SaMRQMhpOQnvbwsHj0GiJirErlXUkIQaLXmyWjbmb5kGCshHzP1h6dxM -KpvY7xDR8lSgqV+zsRdbCnrDyymemNQ9Lniiz1of0mXR1bAHu0SB8SJThNTp+pc3 -44Q33GWTp0oYyhwmVxGUA36hnTbYlCLgbqZV5EP8svZfi+Q0noo48uXkTQ4TdEz0 -AHzC0I/Ru/WpBaIRAdal49cqLpjYl4KtXRZPM2U6J72uPhaRmk3jVseEveIfoJUD -npuR+G+hjwvjJIMOtJknLEsu8MIQtlOPySkc74THyQHU0DNOFXN5CkFRnxLWOzdz -wwe9xl43fQxu0GklGzgwl7tCtgxvehuMJrq2uvCmqZSZJ1hFIT6NKv5JsQmkwcXM -smaVL2DtcuEa+vcr2o1gtijaj/ZON4w7LDWH1XfBosEgNcLZa+sTQ3AZSK4NrhJk -AR1Oz9gK6ZoVbHou1xBNTb8kgQyBB86Q4u/rBv4KzqVOXeR8hkpEr+9JH8MUMQa5 -7176HBSlRk4dssevCKNA5q4JfcN2b+8bfD1AlogSwqBVBdESPVN+/4jsOlPD6wLO -dVIgsDLOFZQxYtLV96jBmGNbjVN+3ZYbL1g7NmEa2oYpyoLfn0OMMJyn0cVGJpex -jLPxWIokJthrVpJ/imWzELh7pR5C/09KuGyK7zoIRKHSlM23u13IyaGNq4cLmKJ2 -4maLhB3EsNi4GOJJFUrr8GjiO8BL4DGIhXNhBeHqW9DSjD5JhUwtMI+PsD9xwJip -EIzDBxaHubnBZO9qDQiXNQlIBW4DLx7plflvFmaRuREYN+aVeA5JeEviSfO+6FPo -0gti/JBXhMh/e2ZruSYyZGoeP9o/HcBnv4XxDYx11sRljDbvvgVbKveSZLmKpxgN -RD1D9ip37aA87+E3hHS8m+VMQ71ZTQ5Kd6EUsTuEzHuGmiv+kBg/+glnsliJ6I+h -JGAExTu288v7zPgzrpce0iMu74BI/zep69GkKGNEATtmQya1GZ/InKuGndx4ttxT -UsS1/johetzCpCE7EbcPnBX1j8hJy1cxVQOdBlhXxNZL7LmLdbs/7hM8YOUOnVM0 -1X+8qg9OYGWTBVe8JVuGbg4FPt2qtiuqFe/yjVM24FLaKqdWXi8kyn6ICdk/H9NG -tng3203/k9UYLJw79HwqiYofwBTlwC9P9+pYObznqKN9P6PSsnEYxOGC+ohNGDlh -2XdE5N+O/CGiT3wCbhY++rXCzHVB9Nrk7NHAqEjRvD6QeSKK3Csw2M54NOG54Bhg -YZPpnaa8z//XxOqZjJvNQXyGTsln4VVA6wszjgeolFC2OatCjcy1eyU5F87vNBzP -e3P7NjaiMO0tXg/SZO9gK9tBIvHndnPfWYFJJLXUzaUvlHdaIWOxFwF9NhY3cLWo -F+Rjz8TaxL3etOEaI3K0GsVWTGvCF4FmuGcu6DUBBDhfnZQryTJwFrPnZ8jNbBkg -+usbu5Qk2WuT5ZMH7vdmJI0HODz4SMvLj1nwnM7xpKPSdtW1Gqxg6YndT3iT3tgK -H6pdCOQeJ10AXBv0t+NCu0eB+wXhYw4AKz2EEJmgY3RbDJ8JjnUl1FBGm0RVilmN -N6fXZFtOpyXE5okISpLPazsapPQAFXur/imlof3Had2ovH69GM6LNsGurhSRsA5A -rtCw00J3qtqEtusN5qcjYVtXOCGwzzVE5wq8PlZ0f8tskzJdiXnWZmatZac/N7OD -ShLQBPTZqvqF1ZJni1Fxi9E9fenOjrSIWaIbDMu1JwUC5/H7W9GiQBQ399oUURiM -rVlRYpiRBMbqUtw6s2GVpjYD6/Za2zqy75Oes51dU+R/15NZAe8fcDxTmDiE6Gc0 -qnINDM0LcU36KGhN0iQm3BRvSKxIeue4SwSPYwnsoZwa83fbYqXHfwq6FR6tR1Qm -JSAin36xImOKcBPNdTEvmx31dGR8on87AmWvbWyUQ3sG4znZ1vdGHP6bb6ae6ssz -kplKANRJ+kFKcpGJAlkCf2KkKaNGKOyFh9DqSpyWfvgpHnXAfSBIb4rfXn3hucji -C5A2lTX3k/D9IufWhvZxV8Qet8UmLikojJxLdDvbbwQ2YJ4A5Tb7LGzx9+GayWJc -rKsfkT0eGDMPZk2QXJXzg+BSZCTIC6Y7r9jAtvHrNjZAj9/C22ShK6s8Dm1EIBRA -2enWo/70Muww/xDWr7hUw2Ex/uWESHF+/v+ak34N5ulIY2DFsU487Fb/gbVheav9 -H/FkHQQdUYq54GAo4onAQG92urgZ5cupOmBFxVP1PCCzJK/JyXq6raAsPJZ0jwFo -hpdtOxzr4NexzawqGwQfJCz6NdKUETQtk02CF27mOUAuL6PHB4h25SCjYvNKAE39 -gbX3Yk2B/tEoI2j/4kw1GZrJ9S6c4rKkDOezJCvHaRmvsFJjhaP+mOcP2K5KjEDN -1TxSkra8qg7oapoccAs6gH/PnsIGTYDaQZs3LvTuS0W8LYDLOgtUz/hn+FKeTeU9 -Ldc+D551WiDPQNU+MGu+RHDMC/UViQOnFqgPuJbjWL9JATnc6KUl1H4ESl/e89nf -n6iBkLCr+9QRFCr1vzYZ+Hv/8SgBQ/6aygPb63qh3s4OCUlxJnoKtoDGI9Pazcom -pj2zHCTtwCC7G2YjrWr+Rnm/VZXrMb/lOgc2cms9XdhVN4ht1jJmA72A10Qm0BuE -4N+6Omf4E9E4+3JZYOOB2UlVYOkUUrebvLgiASZ70QduBoIcBTbZ5qMmY0Exin3/ -Jh+hcFrGAXvXxvudST8DV9cfgmo/V62JHjSmFSloYtBzkzjHLoSdsFvH5cczNLGe -l6VkL/wk5wxuAFraj5MScpJOSDFnHiB5p1FjnMc8PosvnY4Dgjfe8cvTWc0sMDTo -JiXNQ5oBgHs8n+YwKdC5WMGhQSgf1w48jCXCB4Ltb42w495q0g8rsqWKbYxkEIDk -iqD4Tdrueg+hYwxdgqEOz4D8tBjKSNIzfTgsOa0kz3VnoWxlbD84XwrahABerX9A -GuFuckHq0+l0Fwx75eAsQTWlK9qirIEPA9ksv66ZmrCeUS2eIxH5Tda11xDW+v0m -RtaFExYjE21oPQJHi2OKrAc4Rq55kCRs1HwY6BUtI2xG6EHe83I6RjAnGdf3E+9+ -fodl4BM2gz53CeSEXGb1wjYKqNLiorIWAS5C31qWryUdL1mJ/W41WiwOU2tg9bjF -Rz7z+T5aTNZ8Re5BPag5mPBVfKfkAI7GM8qAbmYTQOKqIbYlDLu2BnhEp0GzcZgV -8GKmzQUQzhwJkI/aiU3yEnfEocne8GPQERSif3/tRkN6lTX8+9aZYWj6+zga26fL -/MaujR6iDyhMgxcMXCCBDcUqXXX12ibN+mmo9eAl0PCeyaAJgV2Izbm7wBEgV1XI -JuKPo/yQp9Soae7koWDXAk0ioazsENSrcjxqtbF0OPrVJXb3Qbgq5a/Ag5fRlQg0 -mnJgvnQii/v5tFVlOFcxmKlEctZke+hIesnAcQNcIrhMJMoXlCbB8a8qBSPbjRuZ -NkNY+PNTgP6kTrNG8ne5AnjdnMIX8XZU/kq7kSL48uWRjAiner80a85617l69WCp -Sezq8ImO+CiKnqmmUGdpaP6MZyO1DG5O58u7UU5jVHBJpCr7fFymHrX4eY7ZtRRx -6k80Bjv44AwEwzVVVDVu5q0E9DPwtaqP9npytVS5+OWYN0qJUlFp1TSiP0hhahJw -tyxmb2fOTM+LNgkWLGzNWNt/1BjDqo+Fs49T3clllpcDLS703kdUtfGfc2n3wlBo -QfFiXEYoWFAAG2pL/N3Z24VPsmhfzEp4I27HS1RRZsv7zFmPDZdMxVFvnuxigwhM -j91zhQRGTaJA1WHoL5NEOLx7yLqjrCHnoXqbZrz2wgBLVpJnOtfb61ylWyC5cjrE -UXT4lNy4nMC89AjdqGzhABv9Rem2DyVgxQd7TW7+cMnkySKTl77DAXsmV3qTF6mT -jB8CadgqlntNRfVu+ACqgRvYO3+oTgmK4cDpZIW4x9k+3jvQTDqkuI7An1QRl6Cn -KOg35kkmN8nQWoL2ZKzIjFeStp/h4kSmBR2ooGY+IknZQIXdHQ9pdSL6YEU6YVLf -yUtM4k4GNZRSC2EQmHAZfAN2F7TOChBes4WyPxE0HtwKyH6HDkOmvgEaCEY0Bi81 -YE/bVK+OLBVME2JLLJyXV0eO44DAKV0treCYRL8WxfCJWnzGOXGOgBM8vCTgXDo7 -n4jcfs8tjql+hXrACeCu6M205rkDaf1/TgxLkF7bHdi0SC9JKai0/8YDF0PVa85y -cmM1kCbTMZK0mXJZ56PtkTwkTN014HJhDzjMljOZguK5Z6Kib6YmLJwaVRCQ8BXg -K82ISUT2cMLqgJHC26efjNRzmi/jFOgchXmjBIUS9nwGffro4h0IEmt6tNAuoKaJ -jjyIXtiuA6T7q0vO+EwbZ9DHnkcybaqRsR3AiFalHzJ74x+IkNpY5M2b68J9AOfM -/X6PQqxJ1ZZp2+2+XN7I8lPjE3tWp7PgVzVajk6+iiQeDCmoBnnttLFE5nirkUgs -O5grd9uTPtOmhe2fkpaHaLE2Kg7eNGlxBhISnF1HbnI03H9wX+AqlkBtWOh7giNH -G2jE42OQL4oc8kmnQlpCUT+W+mN+uQihaLy28o8znV/0b33yGXWvHtnwmPPdzL9I -Li9D66vmW6+Gm1L75Fznub+1pzLV1qitO7++CmUpQ0zbtPIFA694iMcwF0wdwGku -1qzmbfpCxyzyMJxxy+W3Rc99EoTt08j93Hv4TjC2vFRRfGoCZQYGUQ9tkgiCpUFy -gEawXu1fayMebmy0KZh1ZSsSXloSA+OzevnomHsJ9EVG1RplfVkCKvAR4t8WnRi/ -d+4yVGHHVpsarIsAyvN4o/eeKCLqEArr2z4X0Q/FefiS6zGX6+C8uHbK/+hQIzvi -2/yMaoLHy7cai8vVjrW4uCKTewrgEueq1i0WqR63y+Sa8pbm61n1H9Av4hCLYjVF -Mw1+eXEi23PthX1qi6LJqQ6ubN2q6ckVuWk1D/JvdSz5IAZgfB+9iiXuiPQJK/ra -LTFmlDnIh6wB/jqqVl+SlFA5E624b9A7ueg5DZrY/zlTqrfC7bNg4J+uxKzrFnPu -pQKYCrNjI2GMonykHNeTvZ/y8zxARO4S/RTTOWJnUCZRoIDXoZ1ktRJNqH60BDSQ -PL7BcgYTYtpyzhivFZ17GgRNfsxUu59d/R4KM2nq8XD8VKjQ+QgZ6OeErhJroM8f -oX2c4XAeTENpZEeDmJ0gwvBZOePJ3V8wWtTFFG0faranWEs4RYoFFRaf4DlnVG4f -UAu4/jheWM6AHBfznfw7QWPvKtM/Z79DbqIHTkIp710Gn1H2IOLINoyTvo0YWfR4 -7SE/NSerkC0D+CASxDzIIv0dmU8ukrfZx13YIHi+NM0MEG7dc3YrDwSSKr/D7seg -QZJwzqS4ks1V/O9LwNYnT9RWH/tgXzXIMiPw4Wn1MkYs62v3zejfA7IkaWtX/keq -ErAYg5EYmAd5Al7nNDxt93LJ74CJltD+rHThPeE3tHRwP14FjMQiYyUQ+vWeoXZu -7C3pyIp1NBjEDEXveJJtVtLT6dyoIXZa5vprrWG8FKhoHQmmHEbnMYvKGgfeEAGD -PYDIzOniWPxIBdRhsxxjBC+IJMyHDOMhwIOf6rYWbrjsixeD6ctL1Tb/P2akt4d2 -JsGgAs10gwlvesu80YsFDEZ9stqxndzSy6QOwJjnRurNBVDV+bzlmD4OxMOcSBV0 -l0gSNtHUbsrbe6ADC+CIM4XqpVQh4o8DY0VLLQ8iLRJ178wTBBCoitlmjAlhRp+J -qW4fEk5r4D9JvYlRT4jX5YQ9OnacVw0Z5UIn7t3c7HrV5VjMvuR98c/2o++P4IDv -6YdFN/WGZRkhIU9BU1F2z4FXNw+4pjoeZvSS04Lz6Q1Zb11ccjkvMjCIGZbVyE/H -oru7kyk0cNnU7rf7YOjzhXlcmQH9FPofwoZm0a9V0c/ebF6WgQy6gbQVztaCswl3 -mbvl+ErRVJlyZzKdD3Jwu1rF9W7RccZ0MTBeLDA2+8s5jvFiu11kog++MOj/oyom -nszIqas+R/1SC8pXPd9sYO0QYBvxy2PGEaZYumxUjFTitzxoaPmXYbg9hAvnS9EJ -DNWe3dBjftHduC1TT0wQMsSGePEzi44BX2fH5MCQltd5EEWo49ZoukHkXCdUG7AE -0AtoJ5ghRyvpX8iY7W1UgLzgnpCQEOWL+iQo8nm+gK+RKTWdqNZJI2jzNgByVxhR -7UORscQ7E/0FWf+b5Fs3Fxv18fTUPcT4TOt6KdP6D3OAUuwkR3+yi9G3o0s+SJSb -UAg91PiA/VZ+aTVX3ZvEg1wtlnGEluLz8IPCi0lL0ZEMUQL095/eU9WCIH9mZhrb -qEz2uKuA/dbvF9+u3AMV35MeIvg7bbbaAaGP1niOilsJrd2/6wmANfGM3SzJffnJ -Dlldx5ZKjKUizT1x2+vOs8FC5V7cOc2z+pt0wGtfnqoCrOevbKxDe3qN8SoLE/EV -zPzKsEzlrK98jx6LHygrlrISEjzyWb9vj9O7VjgfCQS+ArMEBreRrKZZs/8hhHtX -B6Gc6U7DTYvOGT8PTys4T0DiyfDMaUwBQ6KpDG6lg1d5sc7K2j0wl4DNFuv58MoX -mDspWkwr3IGPaA+DiCUQPiR55PlhSQB3S/Yrg83GyeM5Q0LrIQspq2mShMzv9FHR -YexZxbINw1w17WvG4m3YJeH+5G4rFDfhHOHNHDp0c/P/v8xyzXB96JTq05X3ThrU -c7L/duMIHMW2nG8z251JJzqGwiq7TNSo/ousPhtK4iPkAWT3846ciLy6mPfLdHXQ -P0VQJy6X56YUKxe7lp/h4y/C/jXLxZzw0MC5eco+a3ezQ0IeZl0/MtL+ae5ZTKlk -o8NHVPx5+j+wxITivj6gLFjV7k0gOG72I+gfoHztK/qH151rFZk0CVj0W0Y3Avwm -IkMp/+NI0TeKRwAU9dzxTFvZLkysS/I2zXnS4V9wtx5Zf61w22M9cXMiBLgYxBVb -ArR+4N/ORBnvBCKua8FBU+HHjlYbShAesgXktXqoS0hk4SJuceER/6hz1NbSu7ex -dpHAKPH1fefnntgOiN2wTcfPEWxUmFOai3PkD9t8WVzH1MbiRplaCZuxkUFeu66c -cZA+/QzSBI1am9ENuPDnTB2U7+eXkEUFFIPhh4Jmk9FzRK/wyplX+vImvXJwiPJs -43F7HGu+pi9f7cs77EVyx9ACjdpeJU9s2aihZr9k7CrZl2Wu57Mb1vGkgWvW4Suu -b0t0iDNkSaNTCrXZSCVYmrM1FdezTSeXTtOF+m5f52wjFvh3ydAz6Yw+Edu1y4dj -cIAe6KzDcO6Hub7my0JQHntorgKloVPiBopAS0ev9iBI5QWSGKjbTGV3WranZWTH -5duD9KvkbfSPPFtD5xHc5Tg2xgPTCEv3De1DP6Ti1eKjRLlXupVdE5ygPzGIWclK -5Mdq2zDCCTcSaEabrYCjnnWJO2JFLOjWSeaMh/S6SEjaAHz4LNJvy3vhDvvJupMl -Ikfn+K9FpVr2Q1gpXrN5scD6yMMyUoqr5ZsuUh//qSZDloJPBv0KeaY6vzWpkVlU -Dm7Pr+j3xmSbrb6i9O8zKDBL4Q1e20oBaCPsUY5eq48spQKKO2S+pUaeMRG/A5nI -OwLBY0U2amFDlOEStJwUGr3+hQW70NEAFD689Q7/Qj0aC+rigodF4U5/c6B9tRRo -vRlstVcn+ClU3mm1lRoxUBuYDnc4aBIZ5cmfnqsWJ1u9VfZPwYHxhmQpaTvQbdgw -CLEoDW4tFNr/eZNnJLikCKbcFAWHKG3h8YVWO30CXfk0BskBHlUP8pIoTgbcC1G/ -jaHRqDylDz6ZKKVsYiqij3wjZul+HqArboF9lrCuxLahzs8303hP+BXa1XKzPPBp -tT7FIfDqy+P6s6s8amT1APQAjnpFXUEz8SpunrMHcZnmH3+1SjQZZ1D6Mg+JNwYa -x3UEt7y4R7z/3+q9a/Keuzb884jEHHPmv6Ckx65Em0j6WYXtD5ZRh6yGt4l8bkC4 -N7I92qk7dzxkVmIf98NGag0Vj5alDNR9tas4TKduwU7iFXic8CXvDxKtUvN5U5mW -Gb4fivysAlMFmiJ9/EDWyo9Ip9/mR6aHkseqstRVs1DBsV0CfboFXFMGZjVYJRig -fXkyWyjWL8p47BcMkGV7znSI+K50oU1Q0eTIqysTfjPJiqRs0NTI/b37uy+dIzbp -3IdQDiz8qohvzBZ053dCvSD02UC4e6sxwMMvsUJRraoGrl1YjlG8RRnBETimOqvy -y7NZWGnTTwxXHFM8QG2tkD/OKH3lj0bW74pRqcC+npYHKW5oaIsW03bm+z2BUGNg -pE91fNaJhbLBbrOvSWJ3AWzVz3Sn4h+PZ03Qmf9m0MsynVhJF7hfk7KPrGRcYeQs -56C00LJU8JCvfc7B1LXtDfy5++BMzso7mBJ0AM7fsrkmdB2V7zI4apXG4gxOcGly -uQsHNKNVoTlKPMEqBndDc65jWPrkubKYmXt0NHA2oOx0x242EqwVZuzK7uISgSj/ -wrJdZtNjezCYfQpFPO+ALq3o8CmvaVZMH2fgnUQ5X7U/kN3SNEV5d467qvWF5Ot1 -002/gDOs9up9BALXYlDTQoFGaqxVEqC6ux67YtTNIQlFHFYabrnfB/ywHJD/97it -5ruRwdwKIsIUF+bNHlx2s1mSwQA4KPTpOw4u3dgb43ST/Uwax7jJQ1rNL4S+ZBmR -GS7OU3lcWrHECj4CHHUiwPPxWmPuJSjSP1xacvU5JvywtxYWPxfHf3F+DJsT8bN8 -xAkkFY3HaD2Llih6nelSRMwATT62bkx3MfolM0h12v76towHQ8Chl3HH3wfhdbQq -hTpdp2E80jAOJCVke7yJyu3xSTmZO3a0r20qlBCYRaUiC04z3cgj+lG1kqr+XNGV -faQJzMvP6BxOXw8h0YCOPWQE30SULxUPI1AyolkkK5SE5SRulkgSbsZXEX2WbHuG -5Rw1YkXjDZ36MGW4ZIQBBhSvKbUX1NMUcbQnMurmzCu6HV6V1/DJqA/k46p26v5J -ijWqI9328yWEP9miJ7tWzx30ZXh7LKpfYdywZ/IohkX4GioMpe3jyucvOuN5zYA+ -DvWd8nn6sq1JoKkzlvK2jfrrK8GKWt6ErOjYdV0Rlgxi9FX2WQC86OQ340jds0K5 -0EMnsrQb3DrVEaJGXuxZvZ3RC5zkd2Pk/hVo5wMOAddvwDEVWIzqML/B4y73g0RD -c1QAHGpYtmc+0ZrNKzXZkqXrXPdwYwqUAIGLCz5wkxz5ljBT3Wa6XFsVzsN2su6H -KFfSZuowHP6zDMywzc6gGdxDGxXtxLMk2wfGLZscL+Hd01LtP++j8OYfe4uvoiDP -kA/vxHByg8DKMTeLn0IEG3DkuyP05EFa3oHgMkZ9irEIJAaTBP+ZnuFa8Su29uDA -N2IMgd5tVpEBP0RtECHm8aicPKLnR/299PK6sGdCCukChuihvla9LhzQrNRFXvVv -6VQKW8JvbHzSV2CUgzRPqva0stg45WGY7VUmnemvE0eUn8RnFO4D+17bc1jWVknV -dPpbu68q9UuxUg2KptB3yG9UZ1IFG5QunfqnWacLwiemf96t5svOiocn32e3Hag3 -L9oLUHM7+W+sHMbs0XriyPUhnwvA2tGhNL/N9dtwDGwpIFzLkbWKQ8p+JRUUhc41 -gdH8EXUf79J6QJOW40ote2EYYhXmkKhGK3sax3WD5H4ulyXtqzvnKo0V07Uwic1m -gkr34d959FOJBsGol/HeBYZuka9vU4i4N3T5zmCRLU6cp5M/yxxyYxU3opzoA3yl -hi0rtcxWL1+/ZUPy/7HDJ3sWVrltjwWHeGPzpDYCBMfDbSV3yM1ora87UrGf9KGG -j95tbQrheFkz5fB/8PcKqux7adh64Zj/XH5HWBij3UoQ+4kjFd8dZrgft1JbL2xf -nPYWgso2sjV1vcMLczCGGjkGWgmEXHBfC86KiXm3yzXnPEVrkYZbVtre8fh8bqy5 -vau7PB32ctYSepOXV2n4KBwEWJaf7SRTjUQTNveMy51clmv+jE1pmea2stvwnGSJ -PLRp5joQWZPF3Tia8BkG5Fc2LXTITRlzKwjVSzU8HUEan4O0xce3EJbIwKQM8piT -hUyGylot5YF9FUsYDAe9dk+T2+C/Cr/NZnapcaWls6mmhPyiQdPNXYj8HkEOmD20 -HnG0izNsGBiNYUXX5b6Mgf7fjKtnHJy3QH0mBHFObGW0MpAqNtkyoql5zFs9Hh10 -HDAJFSxJh4LJaZuvJ+6+Hd1n8GOZIl9hRRHQEjQjRrNe9gpvuq1i2fLbDDApcerI -2c8gBL1jRL93WsF0GxCTBBd0SesJrWCL3eFi4c9J77lWa+ZbT4ig3BNfVbaAphUC -ZNC9jNXonP7Pz7JHm6829qHi4cDuGOIy3VA58y7mKkUFg57UrpDrClu18IM80ybw -q4YorVvhKjKslUAbquN42zp8SjPJOWixYmNVFCYm6X24g79wvj7d1VKo1fODIgFB -FjRhSiyIMhrWWUpbQAB9ql7qJ8njOYbeFxgOs+/hr3vofI2HteHdd3K8z5GswhyQ -pFM9Hf/c8dGCGjBoUGMf2cQFybiG3IJOZAB0kpZi/6FiBWM1f/3zBICgA1rp7bID -4zP7bqTRVbNWsIf9xnTy5S5ZCat71XQzk+g6aw/hZpuehCaCkSQZ+hT6PQ9lTM52 -qKnW6FO9kqJIVbb8b8k2dui/5R3f82QrPBcR4+/45BZ0oM+S3I0a6XG3dqqVrdYR -eHjSkhqkJkZ9sHBegU6LqkT57eaM+HoRkqr/T6xlg1tIGiUbiw7C9y15eBn5aJYT -Ad6DoiEILJkujSsJ1SAIJdKGjtv6yKjPJyoIGjIfsVBNzTKHcjvVg1m9vNyfollR -olzG84KYRJI3oBqv2WSzS/9Xts68bJKhDU2pgm9ltkkx+zLelF/fcllOiXrBOBUC -xneIws8BTrvGOwD7zds8EpJWsqT7jy0BZ2fmL8g+Fh5hbd6PUPEy1HjfkpAcLbHf -/EXJstemIi3OLM+iCLxpC3+Zn5rTbtwCTAjzb1FqlZ31CI/ZDbvmY6XOkJRf7y/1 -wirJPEJ+87L+tn00rLl2OJ52xgO3UIEUBmyEJ6brbmJSNR4XP9Ihkopi2I7y+G90 -Y6hAuM728ksaIxs9Z4nGmKVA8/LwMQg8jvXgibpnXgunxMC1T4chRNWz6kGyTQIu -NYu8O2zVxtTBPoGinDMzIIv2+oTJsIdY7Kba5FNp+IuszB2RmRYV15jwOZsrF5U3 -5AC0LTV12iSJ5fm+vxSEjWMzFL78umVpDQH14EZ46jkiMTQ8My7WdHR8LXrpoP59 -nK214cvDod5k5+qmvCgujKRzhAggUlWZrQFX6a1eNuemTzLTqf5mbBqJFRLBHpH7 -4shjGuFCumJ9QWpK3VfaCFE1I8txEEXPjCScFvClRAFFJLnljn+GsZvGNOetLZCw -FquONiKPVQNVOeXbcisVsT7WivvSfGI9mcEwVkXEJ80rqSh+P5/ziYOwhi3zFdt0 -Txck7EKF3jqybQ8LXWoUtc/6weYZkJwuXzUtkIwN9qq4zzQrUydtreQRTMKMwcWi -Ak43sXFknifTpyg0Z1FCC4ppXQM+S2SDPSOrPYcbz8GZNHMne3sFv6D2ZqndfdJq -JbdegWlTXgArYGZ2TyP9lEc1yXfJ0owqf2QfsTCLty4ihE4RrYJcwSH4R7Eududb -V6aHh1U1DVEA7N6z2Yd+SUHygo4EOP1SHDaNbxuXXUdzN3HVc4KSvDFjofmTRIKU -rb+ht8MutJq0fuu6+hzxQGVx755Re1UhpO5J0rCdzZA6Mxl/Tl/RU5H1rslD+YbC -K07MRdYQnDpeDnnWZwFUENEXfZinARfqd4b8WrLvxy2BuyhKXjocARvPP/8zk2yz -fmRjmcs8xvEZ79/DaoYvQOL+YsFKpFim1qSsIwMYf9L0Zgre99O301djmUiBBHe2 -qtOzvdAxDIMihgn6oNKZUMszCM7PVxHbPhLfjPTUffkQ4PE5XusiYdWGdGk7tkyv -D2MW+rjT8wQ75CeG9iwnZ1VyEibbTpELiCTOfDzjuD5H7XfPCHWBr0ZklJ16mPBL -rC/GXhaUb8bhdYi8RJsu3y/0/A8KG5cq7rT0hnChyki4EpT7rns8uKs0BFUEspXO -nrbUiLna89rlMeTOudMojUtkR4nLxcT/0UxOPHfkYsigXR7VlTmkaYs3Ch5dHLKI -xP23qmEtRW0vWvlwuhAQIB0X7t5bZKLnoA2tcqsr+0CzRbn05UYrVCucsbb5D7qU -QJOBAKfvQuKQ2NjOKTwN0b/aUxGhr/bi51+XFMJZibyAsJUlU+LVMH05Wir5L3rp -yOWtti7HK4iBlbgs8KZ1z0YjvD0VmQCkyuluVajUj90bPWKpq/+4xp8Cf2q02xNn -OUWfs5lSnARu12QinxSYDJtPN/0x6lcGixlIX/3ZdTRg4f1REKlRj35paiSruhKf -Mfoar9/TM+perLNXW3/cOII8+LiNVz8y+Vc= ------END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ta/taskwarrior/secrets/public.cert b/modules/by-name/ta/taskwarrior/secrets/public.cert deleted file mode 100644 index d20ef291..00000000 --- a/modules/by-name/ta/taskwarrior/secrets/public.cert +++ /dev/null @@ -1,83 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBkQVJNM1RDMEp0NkM1dzlF -UE42amNBaERmanAyUDNFSlFlUWszb3hiMWtVCllKSml4QVBGT293U3lmaEo2YVVn -TGdRcllMOFI5WXJsL3ZvdnpIeS9UZjgKLT4gc3NoLWVkMjU1MTkgelpFb25nIEVE -WnJYU28wdThLWEJlYlpSeDM5eklZR05aR0dpVnN0QjFCU3hueW9NR0UKSXhlV2oy -b3BWaDQ0K1R2YVZhbjVjZHkyWTQwNGZ6K09QcHJwcFN2S2doRQotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgemg3dWV3emhNSjdIOVRqYk1mSHdMUnk4bnpBUWZZTkZlY0tG -aUVkWUt6bwpDRmhKNlU3NGNCQzdNQmsvUndQQ3c2VHRab0h2NDl6MVdlb1BncnRo -ME1NCi0+ID0tZ3JlYXNlCk9OOVlwMmlONmN1aUNScmNwT3drVHBUc1dqb0FuNUU3 -UWoxNy9SRUp3NDFXRFh6WE0zdUVJMnVCemVkUmtpamcKd3BEb1VtajcxUQotLS0g -YVo1S1JLQmQrZkIzMmE1YlFCMGlHNElaSXdCR0VBU3pNYS8xSGtFRlpwWQp2we4U -b9JZk9snxRROCHh9w0nfIDwqGsR8+mFScXDHZAT5pji2nlJncjOToUUf6kqDY3EH -+UzfvxUZrzF0LZxhlJEApmeo5ObuexQqtm6M4mg8Sx+3XoTHM/07xWB464eKSyGw -4xBzR0Lj21XUBdfbM3gBAY2J4kvZwPyD0ygun+x+JesJFWgkezh5Vn/oY7bCtgE5 -VjFKR7+kSltBeK7PiqafiukuF/0KRsTDg02FryCCH4nGcjeZeqhs5k2B/56Mxd89 -MD1K/tw4lkvrZ09gLdCN7bY8d72WMQ+Qbilrf5InJsLaUn3dloeyQgJiR9LUkwP0 -b1jZWsUgWOeHfwKUhFoPW4b8VVT8PV3SaLgeoCtoW3ZME+Yv3T7NJZupq57KGcYo -XgDl8XOG2GjL2UIqp7i7cQFt8KuZxRs2259e8Jf1shyHr34Qw18UpL01++DkZbS3 -f6SucDAbak57CS+qHxLzTqtZT6kLQhfY3yF8QTXcdVC7hMbGNar8TaqIe6SQ1HCT -HHFRHZ4hj/VVdVlaOLHBvIokFkZE85tTiyjW/llkyfQWH2z+Dwctou6nUBzPgNNF -S3U4CPFMZuIjmc+hk2p+U8s0SkNWdn1cnsBhj30Cxq0Bq2rBcBeVIRtrzbBN3CYr -I4kzDXjKu1qWpfZuaBlqQuJBl4Vy6l6T881/Og0UmFnunGAWlOJgfwlXoxqy15Z3 -tLjC8ZkxvXNyQElzbg6kOfhonbvuuM6NIkpcfM3jce5GHBkdchLQEByvGLg6fqtk -Bco8cErbIEsDQKmYHtHqyfiJf07PeK9ceqQ1bJAiDbQ0ZddqLa135/oODX8Yje1q -d5W0dR0jqb7AogsaGozoe3b72OlOdQRE+io6GL00OPKiVhh5S311xYkovVSWoo3a -mSVpwv859x4yWGk7rUEYUY0AiquQCG+4n31lQHu2RnLCDkr/l88wqiPWfb1pH28+ -eNkky+kZ45YdU24E93edLLTSqTDoez45VQGGEmiP3fmOsdEzDU3IaX+gQAI9atBO -z6K0qk/uxcYYweLPcLdeLwxaXoaLFCG20PpK+YsBujP9qZKoosMzO4b/V7QdhzCl -CQ4i4csW3uwAeQkr2CiByt2cdViIbSYw8kLwwrzjp5tRKv89VkgpeT+ypIPbbWTe -xWGlrdtAHlk9gE17aEeYwhvgdswmgSLJSXq33BEUi8so6TNerjyRE15lJhtJHOWA -ZTBibWPmBgGn6lnYltGFswa/oTf4iJvLENYKekYokIdYUlX2SiIj6QoJO4OU//E1 -G15Nsx8GktCMQza/Q8R+a81FTDJdA6TJ82PRUpuvWz57zeynQQ1qoMRf+wpGlMqi -vVs9x8pZcg1mNDnMukfIcEKc62tJPu69vjiR1ofqCUb9LMJdgToVo5lTINnTr/b2 -0wDStTUQcYHsEnikRxqessEUicOU6XEvWSO5Fn0LC6nWqoDSmYVUX7wOmODGZzea -j5uZuXSJp8+q5Sfs0WiS9GqarX/pHAIdnlubiXMITaB0DKm6mQzfu4xRkWE5e6ea -R2aLsUy4wflnLiL3aF5/l1D9kj045TfWTJDX5l9LcZoFqxrak2rpQ/7+LtY9irm5 -D1hZWPYsfMF/ti0vbfa26hQ+p1iNmqEPGcJJYpbe6WK4EMSuTX5P2kZVqkxnpEWU -b0Ab8pGp8k92GOiiPB9/qIVG5oK4JFkbbzrRTmmQcGiI7jWcrqL22dNATPUQcsLG -PfxRNbCSP2wmKnmxg5QnQYAW+Xq3dIBvbITNRtJ1KRL496KyVl+QT4XZUoMwHke0 -9e5DJ8ITc93GFbN0MEl+y1sOhxnfWLD9y+ZtygjiHpeQL9oKfpVtOh5nbwOxY59+ -5DYtqgOoHmnc61ZDROs0mDAZbgvFeOisS5DkaAJ4AwiOWvws0P1fKHWb/1hK/Ps/ -zXnlsEE3zr98m3Qd2VLz/dxBTN0HJCrSICTzpOhUNH/RrhjBzJgnG4RkljRnv0fa -gB5oMU3ghN9Ovdr4iReZ5pg/tEIc4kFVIUUJobWPc2Y42PLlkW+lL5x8gXnq3nJn -4gf6wx82B7Jaycs90bU2+jLbD9fLpPSxfRR8RAsqk+h/Lb5rhzBPJ2ehwVGQCWnm -rCl0uB174trv2vGAWliMSI8qgEWi2s6qUTG2F3duDld/Y6QPNbw8wdbLYGZZLmWd -DwLEhdhPJxxpw4GIyiOzIleMOhtGECfCTVYMEL3OK6dL8eabw/D/hmsfos05Yuvk -MUOaxtfDdtslpv6jjsa7snUBbZ5qmjcADb9frMTSPlumK3Umeo/v6VlTkh6Pikek -yyl32o2P4pjGY+uyf09EQKcWb/dLKjVwFS00ULJDaS1qyYjyWtm3v0pXANyd8hzc -+R4kM3wWwF2YQy5kCp6Nvg4ZUc/m4kzVw1HBMzZT3oIBW2GzD94XTnG+qJbVwGg2 -lEIZsJm0Mrheq1HqEIQNHgS7icJwoQjXHQ6lgGMbYr+5Pcu7DFRG4d1zUlocdy16 -yEiCj2qeJE/nEkNzEazl/eJ8l4oxRzWWMY3Pt6kRw343qZ4ZDXu0WSLhyJGeX1QX -0v+4gJz0dLzWKTnJLxif1ks45PSF7ybiOvbW6BJkaaqcDv4cKjm5LfZ/6ugjna3K -f5YLEZZ3jhmyLtLE7K7mnN5XfPyw3f5hv2Qzoo/R3PJOn8pZpxUjF89xmS0LN4DY -GQ/T3Rg9uuQOIYmYHfSI/uynI8KPXbSbHvXj8/KNwEaE7Xa4blCBUg4qW4jj22q+ -ZdJ7vsTlbGHiXCd6HcrIYIttuVgp/qDlZ5LAvilxgDlvpeLDc2v345iA4t2OXJu6 -XmMLR7cesUW5nQWNQ86IHA954cLA4YCIxZuDi4qsuSz+6GraQxI0AveB5tCFRTPR -408bwvOzJl31XU+acHpGYuzqb0pVVAKZBI6Ez4ZGyJA9o8Jd2OkboSNeoJNz/L6P -k7d7fQCo3nnHJ90xYTZBVNHLI1/m2HinkiTlg2K9fzicyh3uoTUuDZJGmy5xGVcr -Glh5Mz3HlPkjSn3jQdaqujKFoNuERk+qsHoqhin+Z2q13vZSovywTbhvfd4KY/qH -cFYsPCJnpc204yAxZs6tqA0xJ446ReuDtkxUANI93h54NzlVh2TK4r0RkB+UpIpJ -BBz1Ii2LGcKftLp7Suz8oU/SigVAf7qAnUNZ+uvEwHJ17gTgoWKC8XeRmZKjPaMf -7xrJbEFT2+L79if383V2ckuhPne03H5GmUDqavROiFbp87o4+zWOWVV/e6SnwgUt -tepo7rhot6fv8dPMHThsma02lUCB+QlacxM1d069d1n0FXlEWVb1+yQ/kS9LV5cv -dAz3gfOLSeL5reh21bRzNuoT4APE4d0O3MJ7+jNwvN5ZIvMzv3UCYGvqG3nhnLFx -/K7/niJVr2x5fMJSNzUVy0SKNweoIYceHp+376K6XwFxOsWAWU74IrsVQoEYS1pN -RbdDlaGbfCGHuTQx34CxJDYdJgLbDj2/J5mfBEASdQclduERQx0kKDvykinYzpUN -3R7n5xMMwvykUQ4pHNQA3KdRON73gkR+D1GZTEGTuzd1XeIjzf0HrfjdvL7CqLRg -0SRsi5HimWThsdk1eI3+4juXBHhAM8HTdITsUxB4sRrBdALYet7g97Lfm+BB+9IC -ISJLy36pu6/R2wpiCWP+8eQc93+inwB/yQVBCmrzQRMb4XUO4kMlw/9+bdaOSzlQ -qrVTJOTwFXenETNNpbHLdzJtu6r1BxG82goKn3hn/qSEViAbkWe/bvfvNIm8Lt4/ -PV3drkHcSXwPl6fn2fLDdYAD0iD3gL0Rb8G8ahkCBr1i85HOwISMyZ0WqtlBrcWZ -mJxcG2QxqBy/8DA1MyP5f6LQ8JQ+pMq0QQ74h4zHAb+MnJYP4kM2u8zAm0EexmfP -ckISP+DSmoL2wFApzVHH29QAbPmi3zj0rD11b+jjvEKRi3iNIq5qA2D2jiIE2w7w -1TiJ4Zhu7qRfhbFtQoLYZPdhXtB7cSabCLmvM0YYVovvl0FgzBjOemtxrnh8QGs1 -N2SbJQehgFnehmUopBbcQ99RUpuj/qB/3XYoGY1KR9ZqQkiHpf6rSVJZJq8TOfY9 -fc+OhAUrAXUV9SrU5eHU92R20jqlsIxocDlwlhhVgxiFwf1hHPtRmhPN3UoJ6lus -SeYGWQurXOtPcIr8ZcMqXuc6RdR9t3rkquLkXTCaXOeOrkEsUGyDM64bEXiYBGiA -iUEd5RIJhRnpkQAYnvDgQc54ObBG6BS+Izo/CnqTsa5d7gITK8p8knZGfTd07iSE -bIQ5b2PViUEptiwkAEqV4/OlVAcNKUJ0Q+rXHJKYjWDUkaRYzwcI44NoU94b3hDW -3BVCaxwDWiMJJOTifbzYFlhccTKwtVXZR34N0FdszJXZ2T4V3jMJ+FHblQyjd2JM -PEu9OvKK4IdhEi02VOxy1hArQqpthcCeMWYgD7iWPcqTFo+1ArovrQFxfcaGNWLi -dw== ------END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age b/modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age new file mode 100644 index 00000000..1e1a252e --- /dev/null +++ b/modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age @@ -0,0 +1,41 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBhUEkzOWlvdU00NnVYcVN1 +TjZMMWUwY3l1c1JEbUFHZFZtcmZ2YWU2VVRnCjYzS3ZrNC9Nc2J2d1Nxc0FtbHM1 +WGJjenE5UFhROGxOdVhka2ZCcm04TUEKLT4gc3NoLWVkMjU1MTkgelpFb25nIEpk +LysxejJOcnNJNEpxWnQzcEd5YWlhTEUreS90R1hiNlRYNmJQTGRYSE0KeU0yVEZy +WTcrZVRiUjZyWFdQWTVTak9Ua3dwZ3pKZXBCRHJhMXN1UElXRQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgUHlFZnkrd3RuN3ROK1lmdG1hcGJHZmFPMENOTjNMdndsSEJL +VDRNL0pCdwo0MmZIRTlTeWFNM2Q5NW1ja1hwY0dCOUg5YUhHYzVkWGlta2ZSTWI3 +aHVvCi0+IFkrRC1ncmVhc2UgNGZkCk5KSzd2RjhIaUFnMHFFeVhOcFM3MktEWERI +cUY1dlY4SDA0Ci0tLSBtSi9zUkdQV0xWMlA4SUtEeGJCeTRGZmFpbC9EMUN3ZVRQ +YXIzaXNWS3lJCitm6obeMX9iJ9HZ48/kS0qt6PjOI5iWfag3oiBVhUAaab3P42KM +KS3Vi1nTKXR5FHigy84Z10uV2apxq73g9uwD97IPH7APyeQsibs6q5aJXmntBYLi +bROu9pSHSYHUrOMHL3hrzs/9bbmS0TXPm1q9ixem2Zm93z96AJQ95IunaeNtA1ya +UooQ2MtYWtLkbj7Z78PydKzqMYsk1zBehBFfHbdyVenDAoaTXpzhRBCGgRmDvvNA +vL/7GKOXLg7Djh8DR4sPXYt3d07DXkrFsxF9GgA+dmhCIMmS6KCldyAfRLHQaYjb +5WQ/Xmx0MpZwdMNF8AWNX7U2/ZlfJwH4zSZ1SMPYgKqbk4FxzktY5BVsGCyq7aqz +fU8EgoIAU3wio6GLWnvwI6AA0evowooUkHncmBDIFTfNY64wD8KeYyz0EiLOfOLd +tjnnzzl2u6aWN8nOToRDDTzVIJg3mQNJjgxZF8G7iJh4WtGYyhrldgcefrGfFRP9 +ZoNj5JhWsNA96KrfdFZPTH1RKZsDd631UEpkP5aA3wv1mzK4D+R0tuttc6AD5Gk7 +QlwSz86OUN4hDGbUEGtRt9WBt34VkFLeH4WgPP6trkXGr8gtGHBnxLzl1JgssmC1 +evoz/jHUDT2f3/gFfe6mZFIMgEuibmL18vQ9FUYfZsigMzvkOTnpIbKX8FXm4Hfy +/4qi8q6rqrwRttDuzX1mK0frqx7MIIUp45UvemfJVN7qDB4IrKBfjw5ICy3gifx3 +7dVgjXBmGAzGkzXk2PtRUscSHW9r21cMICwRsDRM4dawTF1Rk0pkkkureZ0fnLNv +krhmv5SQEEWILm+hkg2963a4osbeHIMQnRiPd3wgfhTcd0peNq+E+S1+w5/3+R5M +Cc4JbHbYiHxCcfhFNI5iPkQVm4lMWi53YvPrweLw09+IGpUwTVB4jN3q2qvlCGeF +7n615QH8xchMxKfB4fwa7uXo5T8phYo31KguPBYX94vJPK/R6mR9WUnq8//+m6VD +n9SDSrSYUq/ckCbQkPAWnBzwUzm9Ykok9XKPbdMfeeyMc8wQ/FaXNoofvkWiCTDp +BVYNrlQUnRavmjTW6r8CMz/PIRCk3MzTeMX8nvpxeMALBTJjKGt1ZPaCTiObAcBh +QDrohH6c/iRQu1ZmaKwtcDfwJKNAnsqnZWWwfFayV/PXvVl5jgwYpwJYbC/Pu7Km +ssdrpCcW/O48L861lw7wF5f4Fneo/ZbSx0erGTviYqiaoRgLaeEhMBZZFhdENHbS +MDJ24qu3qHl/h725edpmiAMziD5jeE9oBUvh7JkhVobc87dFpBHC6znseRlIpr+J +8csSU8mQEAHy7tW9PGK4wZLVGQr9mpADyYgYpow3X6HNuX/DHqzs0GDHanG4uOiF +vSeW2YADEU7O1focnfFGBhEMzbbNVfSBmvcU0avGa2ZajW1h6S2JpfDPsyQfC6Xr +4LmRL+myH0V9i72m9kChsDuQPHGRYBW+iQctoYalXzPFrU7Kpl+/yURecV7JI/v5 +ujHtGPgzvfqTEama/PGbjxC0kVQ9TayPB7ymIjjJquBYKTW74S/exvpYbZz8vN1B +xcwyd7TeMdRYI2nfuI82Q13WoLdLUEW1O5VXPxTm+5pnYbvxfipR4S45+U3tbaaE +YNy26DiZEKUXdyL5Jd+LlArXJXSLd5lzJXs+h8YeogxjtJ7PMmUqmtUDj6PCDrsF +54T5sTGjO2w7QSanwsXgALRgBQpvPTniFpFBllSH44Nj9B2LybmbWIyph67FeIeM +p+YedymnlewwiM2nGcjY/Zs/abdrQwnnKsgkWRGRAHHxhV0pamXfdoZJZEHzebWU +u5iGa9slaCAJxuLs5DQ940e8VFESEwM+e0AECwRmCf+1YazXemiJ+w== +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ti/timewarrior/module.nix b/modules/by-name/ti/timewarrior/module.nix new file mode 100644 index 00000000..90a541d8 --- /dev/null +++ b/modules/by-name/ti/timewarrior/module.nix @@ -0,0 +1,97 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.timewarrior; + + track_timewarrior = pkgs.stdenv.mkDerivation { + name = "track-timewarrior"; + nativeBuildInputs = [ + pkgs.makeWrapper + ]; + buildInputs = [ + pkgs.timewarrior + pkgs.taskwarrior3 + pkgs.python3 + ]; + dontUnpack = true; + installPhase = '' + install -Dm755 ${./taskwarrior_hooks/on-modify.track-timewarrior.py} $out/bin/track-timewarrior + wrapProgram $out/bin/track-timewarrior \ + --set PATH ${lib.makeBinPath [pkgs.taskwarrior3 pkgs.timewarrior]} + ''; + + meta.mainProgram = "track-timewarrior"; + }; + track_total_active_time = pkgs.stdenv.mkDerivation { + name = "track-total-active-time"; + nativeBuildInputs = [ + pkgs.makeWrapper + ]; + buildInputs = [ + pkgs.taskwarrior3 + pkgs.python3 + ]; + dontUnpack = true; + installPhase = '' + install -Dm755 ${./taskwarrior_hooks/on-modify.track-total-active-time.py} $out/bin/track-total-active-time + wrapProgram $out/bin/track-total-active-time \ + --set PATH ${lib.makeBinPath [pkgs.taskwarrior3]} + ''; + + meta.mainProgram = "track-total-active-time"; + }; +in { + options.soispha.programs.timewarrior = { + enable = lib.mkEnableOption "timewarrior"; + }; + config = lib.mkIf cfg.enable { + soispha.programs.taskwarrior = { + hooks = { + track-timewarrior = { + mode = "on-modify"; + executable = track_timewarrior; + }; + track-total-active-time = { + mode = "on-modify"; + executable = track_total_active_time; + }; + }; + }; + + home-manager.users.soispha = { + home.packages = [ + pkgs.timewarrior + ]; + + xdg.configFile."timewarrior/timewarrior.cfg".text = '' + # source: https://github.com/arcticicestudio/igloo + #+----+ + #+ UI + + #+----+ + import ${./nord.theme} + color = true + + #+---------+ + #+ Reports + + #+---------+ + define reports: + day: + lines = 10 + month = true + week = true + ''; + }; + }; +} diff --git a/modules/home.legacy/conf/timewarrior/nord.theme b/modules/by-name/ti/timewarrior/nord.theme index da3c387a..da3c387a 100644 --- a/modules/home.legacy/conf/timewarrior/nord.theme +++ b/modules/by-name/ti/timewarrior/nord.theme diff --git a/modules/by-name/ti/timewarrior/nord.theme.license b/modules/by-name/ti/timewarrior/nord.theme.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/ti/timewarrior/nord.theme.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py new file mode 100755 index 00000000..3b42b3f2 --- /dev/null +++ b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# Copyright 2016 - 2021, 2023, Gothenburg Bit Factory +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +import json +import subprocess +import sys + +# Hook should extract all the following for use as Timewarrior tags: +# UUID +# Project +# Tags +# Description +# UDAs + +try: + input_stream = sys.stdin.buffer +except AttributeError: + input_stream = sys.stdin + + +MAX_ACTIVE = 1 + + +def extract_tags_from(json_obj) -> [str]: + # Extract attributes for use as tags. + tags = [json_obj["description"]] + + if "project" in json_obj: + tags.append(json_obj["project"]) + + if "tags" in json_obj: + if type(json_obj["tags"]) is str: + # Usage of tasklib (e.g. in taskpirate) converts the tag list into a string + # If this is the case, convert it back into a list first + # See https://github.com/tbabej/taskpirate/issues/11 + tags.extend(json_obj["tags"].split(",")) + else: + tags.extend(json_obj["tags"]) + + return tags + + +def extract_annotation_from(json_obj): + if "annotations" not in json_obj: + return "''" + + return json_obj["annotations"][0]["description"] + + +def main(old, new): + start_or_stop = "" + + # Started task. + if "start" in new and "start" not in old: + # Prevent this task from starting if "task +ACTIVE count" is greater than "MAX_ACTIVE". + p = subprocess.Popen( + ["task", "+ACTIVE", "status:pending", "count", "rc.verbose:off"], + stdout=subprocess.PIPE, + ) + out, err = p.communicate() + count = int(out.rstrip()) + if count >= MAX_ACTIVE: + print( + f"Only {MAX_ACTIVE} task(s) can be active at a time.", + ) + sys.exit(1) + else: + start_or_stop = "start" + + # Stopped task. + elif ("start" not in new or "end" in new) and "start" in old: + start_or_stop = "stop" + + if start_or_stop: + tags = extract_tags_from(new) + + subprocess.call(["timew", start_or_stop] + tags + [":yes"]) + + # Modifications to task other than start/stop + elif "start" in new and "start" in old: + old_tags = extract_tags_from(old) + new_tags = extract_tags_from(new) + + if old_tags != new_tags: + subprocess.call(["timew", "untag", "@1"] + old_tags + [":yes"]) + subprocess.call(["timew", "tag", "@1"] + new_tags + [":yes"]) + + old_annotation = extract_annotation_from(old) + new_annotation = extract_annotation_from(new) + + if old_annotation != new_annotation: + subprocess.call(["timew", "annotate", "@1", new_annotation]) + + +if __name__ == "__main__": + old = json.loads(input_stream.readline().decode("utf-8", errors="replace")) + new = json.loads(input_stream.readline().decode("utf-8", errors="replace")) + print(json.dumps(new)) + main(old, new) diff --git a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_track-total-active-time.py b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py index d5b380d0..303a5c57 100755 --- a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_track-total-active-time.py +++ b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py @@ -1,8 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# nixos-config - My current NixOS configuration +# # Copyright (C) 2016-present Arctic Ice Studio <development@arcticicestudio.com> # Copyright (C) 2016-present Sven Greb <development@svengreb.de> +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # Project: igloo # Repository: https://github.com/arcticicestudio/igloo @@ -20,37 +29,24 @@ By default, this plugin allows to have one task active at a time. This can be ch ``1``. Note: - This hook requires Python 3 and the `taskw`_ package to be installed which provides the python bindings for Taskwarrior! - Also note that this hook is only compatible with Taskwarrior version greater or equal to 2.4! + Note that this hook is only compatible with Taskwarrior version greater or equal to 2.4! This hook is a fork from `kostajh/taskwarrior-time-tracking-hook`_ -.. _taskw: - https://pypi.python.org/pypi/taskw .. _kostajh/taskwarrior-time-tracking-hook: https://github.com/kostajh/taskwarrior-time-tracking-hook """ import datetime import json -import re import sys import subprocess -from taskw import TaskWarrior from typing import TypeVar TIME_FORMAT = "%Y%m%dT%H%M%SZ" UDA_KEY = "total_active_time" -w = TaskWarrior(config_filename=sys.argv[4].replace("rc:", "")) -config = w.load_config(config_filename=sys.argv[4].replace("rc:", "")) -if "max_active_tasks" in config: - MAX_ACTIVE = int(config["max_active_tasks"]) -else: - MAX_ACTIVE = 1 - -"""Compiled regular expression for the duration as ISO-8601 formatted string.""" -ISO8601DURATION = re.compile("P((\d*)Y)?((\d*)M)?((\d*)D)?T((\d*)H)?((\d*)M)?((\d*)S)?") +MAX_ACTIVE = 1 """The duration type either as integer (in seconds), as ISO-8601 formatted string ("PT1H10M31S") or the seconds suffixed with "seconds".""" DurationType = TypeVar("DurationType", str, int) @@ -63,31 +59,7 @@ def duration_str_to_time_delta(duration_str: DurationType) -> datetime.timedelta :return: The duration as timedelta object """ if duration_str.startswith("P"): - match = ISO8601DURATION.match(duration_str) - if match: - year = match.group(2) - month = match.group(4) - day = match.group(6) - hour = match.group(8) - minute = match.group(10) - second = match.group(12) - value = 0 - if second: - value += int(second) - if minute: - value += int(minute) * 60 - if hour: - value += int(hour) * 3600 - if day: - value += int(day) * 3600 * 24 - if month: - # Assume a month is 30 days for now. - value += int(month) * 3600 * 24 * 30 - if year: - # Assume a year is 365 days for now. - value += int(year) * 3600 * 24 * 365 - else: - value = int(duration_str) + value = datetime.fromisoformat(duration_str) elif duration_str.endswith("seconds"): value = int(duration_str.rstrip("seconds")) else: diff --git a/modules/by-name/ts/tskm/module.nix b/modules/by-name/ts/tskm/module.nix new file mode 100644 index 00000000..6f6517f8 --- /dev/null +++ b/modules/by-name/ts/tskm/module.nix @@ -0,0 +1,137 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + lib, + config, + pkgs, + ... +}: let + cfg = config.soispha.programs.tskm; + + allProjectNames = lib.lists.flatten (lib.attrsets.mapAttrsToList mkProject cfg.projects); + + projectList = builtins.concatStringsSep "\n" allProjectNames; + mkProject = name: value: let + subprojects = lib.attrsets.mapAttrsToList (newName: mkProject "${name}.${newName}") value.subprojects; + in + [name] ++ subprojects; + + qutebrowserProfiles = builtins.listToAttrs ( + builtins.map (name: { + inherit name; + value = {}; + }) + allProjectNames + ); + + contexts = + builtins.concatStringsSep "\n" + (lib.lists.flatten + (lib.attrsets.mapAttrsToList mkContext cfg.projects)); + mkContext = name: value: let + subprojects = + lib.attrsets.mapAttrsToList + (newName: newValue: let + finalValue = + if newValue.prefix == "" + then newValue // {inherit (value) prefix;} + else newValue; + in + mkContext "${name}.${newName}" finalValue) + value.subprojects; + contextName = builtins.replaceStrings ["."] ["_"] name; + in + [ + '' + context.${contextName}.rc.neorg_path=${value.prefix}/index.norg + context.${contextName}.read=project:${name} + context.${contextName}.write=project:${name} + '' + ] + ++ subprojects; + + contextsFile = + pkgs.writeText "contexts-file" contexts; + + projectType = lib.types.submodule { + options = { + name = lib.mkOption { + type = lib.types.str; + example = "timesinks"; + description = "The name of this project"; + }; + + prefix = lib.mkOption { + type = lib.types.str; + default = ""; + example = "programming/zig"; + description = '' + A prefix to append to the project neorg path. + This can be used to group similar project's neorg directories together. ' + ''; + }; + + subprojects = lib.mkOption { + type = lib.types.attrsOf projectType; + description = '' + A list of subprojects. + These can also contain subprojects. + ''; + default = {}; + }; + }; + }; +in { + options.soispha.programs.tskm = { + enable = lib.mkEnableOption "tskm"; + + projects = lib.mkOption { + type = lib.types.attrsOf projectType; + }; + }; + + config = lib.mkIf cfg.enable { + soispha.programs = { + qutebrowser.profiles = qutebrowserProfiles; + + taskwarrior = { + includeFiles = { + tskm-contexts = contextsFile; + }; + hooks = { + enforce-projects = + config.lib.taskwarrior.mkHook "on-add" [ + pkgs.jq + pkgs.gnugrep + pkgs.tskm + ] + ./taskwarrior_hooks/enforce-projects.sh; + }; + }; + }; + + home-manager.users.soispha = { + home.sessionVariables = { + # TODO: Remove this hard-coded path with a reference. <2025-04-04> + "TSKM_PROJECT_FILE" = "/home/soispha/repos/nix/own/config/modules/common/projects.json"; + }; + + programs.nixvim = { + plugins.neorg.settings.load."core.dirman".config.workspaces = { + tskm = "~/.local/share/tskm/notes"; + }; + }; + + xdg.configFile."tskm/projects.list" = { + text = projectList; + }; + }; + }; +} diff --git a/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh b/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh new file mode 100755 index 00000000..c3e377c0 --- /dev/null +++ b/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +new_task="$1" + +project="$(echo "$new_task" | jq '.project' --raw-output)" +[ "$project" = "null" ] && die "No project supplied!" + +if ! tskm projects list | grep -q "^$project$"; then + die "The project '$project' is not (yet) registered, registered projects: $(tskm projects list | tr '\n' ',')" +fi + +# vim: ft=sh diff --git a/modules/by-name/un/unison/module.nix b/modules/by-name/un/unison/module.nix index 9de27c0f..8d156b00 100644 --- a/modules/by-name/un/unison/module.nix +++ b/modules/by-name/un/unison/module.nix @@ -1,13 +1,21 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, pkgs, - sysLib, ... }: let cfg = config.soispha.services.unison; - script = import ./shellScript.nix {inherit sysLib lib pkgs cfg;}; + script = import ./shellScript.nix {inherit lib pkgs cfg;}; in { options.soispha.services.unison = let homePath = lib.types.strMatching "^~.*"; diff --git a/modules/by-name/un/unison/shellScript.nix b/modules/by-name/un/unison/shellScript.nix index 4618ae8e..df373805 100644 --- a/modules/by-name/un/unison/shellScript.nix +++ b/modules/by-name/un/unison/shellScript.nix @@ -1,5 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, lib, pkgs, cfg, @@ -60,7 +68,7 @@ lib.strings.concatStringsSep " " [ "unison" "${serialiseArgs cfg.unisonOptions}" - "$EXTRA_OPTIONS" + "\"$@\"" "${getIgnored cfg.pathsToIgnore path}" "${esa path}" (esa "ssh://${cfg.foreign.userName}@${cfg.foreign.address}/${path}") @@ -68,24 +76,18 @@ script = lib.strings.concatStringsSep "\n" (builtins.map mkScriptLine cfg.pathsToSync); in - sysLib.writeShellScript { + pkgs.writeShellApplication { name = "unison-sync"; - src = builtins.toFile "unison-backup" ('' - #!/usr/bin/env dash + text = script; - # shellcheck source=/dev/null - SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - - export UNISON=${esa cfg.dataDir}; - - EXTRA_OPTIONS="$UNISON_EXTRA_OPTIONS $*" - '' - + script); + runtimeEnv = { + UNISON = cfg.dataDir; + }; - dependencies = with pkgs; [ - unison - openssh # needed to connect to the other server - less # needed to show diffs - diffutils # needed to compute diffs + runtimeInputs = [ + pkgs.unison + pkgs.openssh # needed to connect to the other server + pkgs.less # needed to show diffs + pkgs.diffutils # needed to compute diffs ]; } diff --git a/modules/by-name/us/users/module.nix b/modules/by-name/us/users/module.nix index a44df7e8..555e61f9 100644 --- a/modules/by-name/us/users/module.nix +++ b/modules/by-name/us/users/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, @@ -8,6 +17,7 @@ in { options.soispha.users = { enable = lib.mkEnableOption "user set-up for soispha"; + hashedPassword = lib.mkOption { type = lib.types.str; example = lib.literalExpression "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; @@ -31,19 +41,42 @@ in { users = { mutableUsers = false; - users.soispha = { - isNormalUser = true; - home = "/home/soispha"; - createHome = true; - shell = pkgs.zsh; - initialHashedPassword = cfg.hashedPassword; - extraGroups = cfg.groups ++ lib.optional cfg.enableDeprecatedPlugdev "plugdev"; - - uid = 1000; - openssh.authorizedKeys.keys = [ - # TODO: This should be parameterized. <2024-05-16> - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz" - ]; + users = { + soispha = { + isNormalUser = true; + home = "/home/soispha"; + createHome = true; + shell = pkgs.zsh; + initialHashedPassword = cfg.hashedPassword; + extraGroups = cfg.groups ++ lib.optional cfg.enableDeprecatedPlugdev "plugdev"; + + uid = 1000; + openssh.authorizedKeys.keys = [ + # TODO: This should be parameterized. <2024-05-16> + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz" + ]; + }; + + root = { + hashedPassword = lib.mkForce null; # to lock root + openssh.authorizedKeys.keys = lib.mkForce []; + }; + }; + }; + + home-manager.users = { + soispha.home = { + username = "soispha"; + homeDirectory = config.users.users.soispha.home; + stateVersion = "23.05"; + enableNixpkgsReleaseCheck = true; + }; + + root.home = { + username = "root"; + homeDirectory = config.users.users.root.home; + stateVersion = "23.05"; + enableNixpkgsReleaseCheck = true; }; }; }; diff --git a/modules/by-name/ve/version/module.nix b/modules/by-name/ve/version/module.nix index 77cada14..fc03b107 100644 --- a/modules/by-name/ve/version/module.nix +++ b/modules/by-name/ve/version/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/wa/water-reminder/module.nix b/modules/by-name/wa/water-reminder/module.nix new file mode 100644 index 00000000..76e5aafa --- /dev/null +++ b/modules/by-name/wa/water-reminder/module.nix @@ -0,0 +1,66 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.services.water-reminder; +in { + options.soispha.services.water-reminder = { + enable = lib.mkEnableOption "periodic reminder for water intake"; + + frequency = lib.mkOption { + type = lib.types.str; + default = "*-*-* *:00/30:00"; # Every 30 minutes + description = '' + How often to remind. This value is passed to the systemd + timer configuration as the `OnCalendar` option. See + {manpage}`systemd.time(7)` for more information about the format. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + systemd.user.services.water-reminder = { + Unit = {Description = "Water reminder";}; + Service = { + CPUSchedulingPolicy = "idle"; + IOSchedulingClass = "idle"; + ExecStart = lib.getExe ( + pkgs.writeShellApplication { + name = "water-reminder"; + + inheritPath = false; + runtimeInputs = [pkgs.libnotify]; + + text = + # bash + '' + notify-send 'Seek fluid intake' 'Water intake required' --wait --expire-time=0 --urgency=critical + ''; + } + ); + }; + }; + + systemd.user.timers.water-reminder = { + Unit = {Description = "periodic reminder for water intake";}; + Timer = { + Unit = "water-reminder.service"; + OnCalendar = cfg.frequency; + }; + Install = {WantedBy = ["timers.target"];}; + }; + }; + }; +} diff --git a/modules/by-name/wa/waydroid/module.nix b/modules/by-name/wa/waydroid/module.nix index 58bce7d1..a55ccf90 100644 --- a/modules/by-name/wa/waydroid/module.nix +++ b/modules/by-name/wa/waydroid/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/xd/xdg/module.nix b/modules/by-name/xd/xdg/module.nix index 5140a832..496ed129 100644 --- a/modules/by-name/xd/xdg/module.nix +++ b/modules/by-name/xd/xdg/module.nix @@ -1,58 +1,130 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, - nixpkgs_open_prs, - sysLib, - system, + lib, + config, ... }: let - pkgs_tfc = nixpkgs_open_prs.nixpkgs-tfc.legacyPackages."${system}"; + lf-wrapper = pkgs.writeShellApplication { + name = "lf-wrapper"; + + runtimeInputs = [pkgs.lf pkgs.alacritty]; + inheritPath = true; + + text = builtins.readFile ./scripts/lf-wrapper.sh; + }; + + url-handler = pkgs.writeShellApplication { + name = "url-handler"; + + runtimeInputs = [pkgs.rofi pkgs.libnotify pkgs.zathura pkgs.tskm]; + + # We need to run the browser in tskm or nvim and alacritty. + inheritPath = true; + + text = builtins.readFile ./scripts/url-handler.sh; + }; + + tfcConfigFile = (pkgs.formats.ini {}).generate "xdg-desktop-portal-termfilechooser.ini" { + filechooser = { + default_dir = "/tmp"; + cmd = "${lib.getExe lf-wrapper}"; + }; + }; + + cfg = config.soispha.xdg; in { - services.dbus.enable = true; - xdg = { - portal = { - enable = true; - termfilechooser = { - enable = true; - logLevel = "TRACE"; - package = pkgs_tfc.xdg-desktop-portal-termfilechooser; - settings = { - filechooser = { - default_dir = "/tmp"; - cmd = "${sysLib.writeShellScript { - src = ./scripts/lf_wrapper.sh; - name = "lf_wrapper"; - keepPath = true; - dependencies = with pkgs; [ - lf - alacritty - bash - ]; - }}/bin/lf_wrapper"; + options.soispha.xdg = { + enable = lib.mkEnableOption "xdg"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + xdg = { + configFile."xdg-desktop-portal-termfilechooser/config".source = tfcConfigFile; + + desktopEntries = { + url-handler = { + name = "url-handler"; + genericName = "Web Browser"; + exec = "${lib.getExe url-handler} %u"; + terminal = false; + categories = [ + "Application" + "Network" + "WebBrowser" + ]; + mimeType = [ + "text/html" + "text/xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/about" + "x-scheme-handler/unknown" + ]; }; }; }; - wlr = { + }; + + services.dbus.enable = true; + + xdg = { + mime = { enable = true; + defaultApplications = { + "application/pdf" = ["url-handler.desktop"]; + "application/x-pdf" = ["url-handler.desktop"]; + + "text/html" = ["url-handler.desktop"]; + "text/xml" = ["url-handler.desktop"]; + "x-scheme-handler/http" = ["url-handler.desktop"]; + "x-scheme-handler/https" = ["url-handler.desktop"]; + "x-scheme-handler/about" = ["url-handler.desktop"]; + "x-scheme-handler/unknown" = ["url-handler.desktop"]; + }; }; - config = { - common = { - # NOTE: The next entry is supposedly needed for gtk based apps <2023-08-31> - default = ["wlr" "gtk"]; - "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; + + portal = { + enable = true; + wlr = { + enable = true; }; + config = { + common = { + # NOTE: The next entry is supposedly needed for gtk based apps <2023-08-31> + default = ["wlr" "gtk"]; + "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; + }; - # TODO: Also activate, when on another wlr-based compositor <2023-11-25> - river = { - default = ["wlr" "gtk"]; - "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; + # TODO: Also activate, when on another wlr-based compositor <2023-11-25> + river = { + default = ["wlr" "gtk"]; + "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; + }; }; + + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-wlr + pkgs.xdg-desktop-portal-termfilechooser + ]; }; - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - pkgs.xdg-desktop-portal-wlr - pkgs_tfc.xdg-desktop-portal-termfilechooser + }; + + systemd.user.services.xdg-desktop-portal-termfilechooser = { + serviceConfig.ExecStart = [ + "" + "${pkgs.xdg-desktop-portal-termfilechooser}/libexec/xdg-desktop-portal-termfilechooser --loglevel=TRACE" ]; }; }; - # TODO: mime = {}; } diff --git a/modules/by-name/xd/xdg/scripts/lf-wrapper.sh b/modules/by-name/xd/xdg/scripts/lf-wrapper.sh new file mode 100755 index 00000000..6a5c5295 --- /dev/null +++ b/modules/by-name/xd/xdg/scripts/lf-wrapper.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# This wrapper script is invoked by xdg-desktop-portal-termfilechooser. +# +# For more information about input/output arguments read `xdg-desktop-portal-termfilechooser(5)` + +set -ex + +multiple="$1" +directory="$2" +save="$3" +path="$4" +out="$5" + +# echo > /tmp/stdout +# echo > /tmp/stderr +# +# exec 1>> /tmp/stdout +# exec 2>> /tmp/stderr + +if [ "$save" = "1" ]; then + # save a file + set -- -selection-path="$out" -command='set promptfmt "Select the file to write to %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$path" +elif [ "$directory" = "1" ]; then + # upload files from a directory + set -- -last-dir-path="$out" -command='set dironly' -command='set promptfmt "Select directory (quit in dir to select it) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$path" +elif [ "$multiple" = "1" ]; then + # upload multiple files + set -- -selection-path="$out" -command='set promptfmt "Select file(s) (open file to select it; <Space> to select multiple) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$path" +else + # upload only 1 file + set -- -selection-path="$out" -command='set promptfmt "Select file (open file to select it) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$path" +fi + +alacritty --title 'floating please' -e lf "$@" + +# Delete the left recommended file, if we did not actually save anything. +if [ "$save" = "1" ] && ! [ -s "$out" ]; then + rm "$path" +fi diff --git a/modules/by-name/xd/xdg/scripts/lf_wrapper.sh b/modules/by-name/xd/xdg/scripts/lf_wrapper.sh deleted file mode 100755 index 16603fe4..00000000 --- a/modules/by-name/xd/xdg/scripts/lf_wrapper.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# This wrapper script is invoked by xdg-desktop-portal-termfilechooser. -# -# Inputs: -# 1. "1" if multiple files can be chosen, "0" otherwise. -# 2. "1" if a directory should be chosen, "0" otherwise. -# 3. "0" if opening files was requested, "1" if writing to a file was -# requested. For example, when uploading files in Firefox, this will be "0". -# When saving a web page in Firefox, this will be "1". -# 4. If writing to a file, this is recommended path provided by the caller. For -# example, when saving a web page in Firefox, this will be the recommended -# path Firefox provided, such as "~/Downloads/webpage_title.html". -# Note that if the path already exists, we keep appending "_" to it until we -# get a path that does not exist. -# 5. The output path, to which results should be written. -# -# Output: -# The script should print the selected paths to the output path (argument #5), -# one path per line. -# If nothing is printed, then the operation is assumed to have been canceled. - -multiple="$1" -directory="$2" -save="$3" -recommended_path="$4" -out="$5" - -# echo > /tmp/stdout -# echo > /tmp/stderr -# -# exec 1>> /tmp/stdout -# exec 2>> /tmp/stderr - -cmd="$(command -v lf)" -termcmd="${TERMINAL:-$(command -v alacritty)}" - -if [ "$save" = "1" ]; then - set -- -selection-path="$out" -command='set promptfmt "Select the file to write to %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$recommended_path" - cat <<EOF >"$recommended_path" -xdg-desktop-portal-termfilechooser saving files tutorial - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! === WARNING! === !!! -!!! The contents of *whatever* file you open last in !!! -!!! lf will be *overwritten*! !!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -Instructions: -1) Move this file wherever you want. -2) Rename the file if needed. -3) Confirm your selection by opening the file, for - example by pressing <Enter>. - -Notes: -1) This file is provided for your convenience. You - could delete it and choose another file to overwrite - that, for example. -2) If you quit lf without opening a file, this file - will be removed and the save operation aborted. -EOF - -elif [ "$directory" = "1" ]; then - set -- -selection-path="$out" -command='set dironly' -command='set promptfmt "Select directory (quit in dir to select it) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' -elif [ "$multiple" = "1" ]; then - set -- -selection-path="$out" -command='set promptfmt "Select file(s) (open file to select it; <Space> to select multiple) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' -else - set -- -selection-path="$out" -command='set promptfmt "Select file (open file to select it) %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' -fi - -"$termcmd" --title 'floating please' -e "$cmd" "$@" - -if [ "$save" = "1" ] && [ ! -s "$out" ]; then - rm "$recommended_path" -fi -# vim: ft=sh diff --git a/modules/by-name/xd/xdg/scripts/ranger_wrapper.sh b/modules/by-name/xd/xdg/scripts/ranger_wrapper.sh deleted file mode 100755 index e148bf19..00000000 --- a/modules/by-name/xd/xdg/scripts/ranger_wrapper.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH -# This wrapper script is invoked by xdg-desktop-portal-termfilechooser. -# -# Inputs: -# 1. "1" if multiple files can be chosen, "0" otherwise. -# 2. "1" if a directory should be chosen, "0" otherwise. -# 3. "0" if opening files was requested, "1" if writing to a file was -# requested. For example, when uploading files in Firefox, this will be "0". -# When saving a web page in Firefox, this will be "1". -# 4. If writing to a file, this is recommended path provided by the caller. For -# example, when saving a web page in Firefox, this will be the recommended -# path Firefox provided, such as "~/Downloads/webpage_title.html". -# Note that if the path already exists, we keep appending "_" to it until we -# get a path that does not exist. -# 5. The output path, to which results should be written. -# -# Output: -# The script should print the selected paths to the output path (argument #5), -# one path per line. -# If nothing is printed, then the operation is assumed to have been canceled. - -multiple="$1" -directory="$2" -save="$3" -path="$4" -out="$5" - -cmd="$(command -v ranger)" -termcmd="${TERMCMD:-$(command -v kitty)}" - -if [ "$save" = "1" ]; then - set -- --choosefile="$out" --cmd='echo Select save path (see tutorial in preview pane; try pressing zv or zp if no preview)' "$path" - printf '%s' 'xdg-desktop-portal-termfilechooser saving files tutorial - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! === WARNING! === !!! -!!! The contents of *whatever* file you open last in !!! -!!! ranger will be *overwritten*! !!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -Instructions: -1) Move this file wherever you want. -2) Rename the file if needed. -3) Confirm your selection by opening the file, for - example by pressing <Enter>. - -Notes: -1) This file is provided for your convenience. You - could delete it and choose another file to overwrite - that, for example. -2) If you quit ranger without opening a file, this file - will be removed and the save operation aborted. -' >"$path" -elif [ "$directory" = "1" ]; then - set -- --choosedir="$out" --show-only-dirs --cmd="echo Select directory (quit in dir to select it)" -elif [ "$multiple" = "1" ]; then - set -- --choosefiles="$out" --cmd="echo Select file(s) (open file to select it; <Space> to select multiple)" -else - set -- --choosefile="$out" --cmd="echo Select file (open file to select it)" -fi - -"$termcmd" -- "$cmd" "$@" -if [ "$save" = "1" ] && [ ! -s "$out" ]; then - rm "$path" -fi diff --git a/modules/by-name/xd/xdg/scripts/url-handler.sh b/modules/by-name/xd/xdg/scripts/url-handler.sh new file mode 100755 index 00000000..b3563349 --- /dev/null +++ b/modules/by-name/xd/xdg/scripts/url-handler.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +project="$({ + tskm projects list + printf "%s\n" nvim zathura +} | rofi -sep "$(printf "\n")" -dmenu)" + +if [ "$project" = "nvim" ]; then + "$TERMINAL" -e nvim "$1" +elif [ "$project" = "zathura" ]; then + zathura "$1" +elif [ "$project" ]; then + tskm open project "$project" "$1" +else + notify-send "(URL HANDLER) No project selected" + exit 1 +fi + +# vim: ft=sh diff --git a/modules/by-name/ya/yambar/config/config.yml b/modules/by-name/ya/yambar/config/config.yml index 442135aa..14da18fd 100644 --- a/modules/by-name/ya/yambar/config/config.yml +++ b/modules/by-name/ya/yambar/config/config.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + --- # Config file for yambar # Note that this may be version-dependent, this file is written for v1.8.0 diff --git a/modules/by-name/ya/yambar/module.nix b/modules/by-name/ya/yambar/module.nix index 2d0f1e97..40edf978 100644 --- a/modules/by-name/ya/yambar/module.nix +++ b/modules/by-name/ya/yambar/module.nix @@ -1,6 +1,14 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, - sysLib, pkgs, lib, ... @@ -12,12 +20,11 @@ dependencies, ... }: - sysLib.writeShellScript { + lib.getExe (pkgs.writeShellApplication { inherit name; - src = ./scripts/${name}.sh; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); - } - + "/bin/${name}"; + text = builtins.readFile ./scripts/${name}.sh; + runtimeInputs = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); + }); mkWrapper = bin: cmd: pkgs.writeShellScript cmd '' diff --git a/modules/by-name/ya/yambar/scripts/disk.sh b/modules/by-name/ya/yambar/scripts/disk.sh index a5547a74..4efe1384 100755 --- a/modules/by-name/ya/yambar/scripts/disk.sh +++ b/modules/by-name/ya/yambar/scripts/disk.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/scripts/mpd_song_name.sh b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh index 7d294781..5c288d1a 100755 --- a/modules/by-name/ya/yambar/scripts/mpd_song_name.sh +++ b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh @@ -1,5 +1,15 @@ #!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/scripts/network.sh b/modules/by-name/ya/yambar/scripts/network.sh index adfc93df..d642e6c7 100755 --- a/modules/by-name/ya/yambar/scripts/network.sh +++ b/modules/by-name/ya/yambar/scripts/network.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/scripts/sound-volume.sh b/modules/by-name/ya/yambar/scripts/sound-volume.sh index 8a98daf7..9d9f7be8 100755 --- a/modules/by-name/ya/yambar/scripts/sound-volume.sh +++ b/modules/by-name/ya/yambar/scripts/sound-volume.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/settings/default.nix b/modules/by-name/ya/yambar/settings/default.nix index 52c3d1f7..ebe17261 100644 --- a/modules/by-name/ya/yambar/settings/default.nix +++ b/modules/by-name/ya/yambar/settings/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # TODO: This should not do something depending on whether the host is a laptop or not. It # should instead match on monitor-width or scale factor. <2024-11-29> { diff --git a/modules/by-name/yt/yt/config.toml b/modules/by-name/yt/yt/config.toml index 981481d9..aecb74ba 100644 --- a/modules/by-name/yt/yt/config.toml +++ b/modules/by-name/yt/yt/config.toml @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [download] max_cache_size = "5 GiB" diff --git a/modules/by-name/yt/yt/input.conf b/modules/by-name/yt/yt/input.conf index 10e453a1..68dad824 100644 --- a/modules/by-name/yt/yt/input.conf +++ b/modules/by-name/yt/yt/input.conf @@ -7,8 +7,8 @@ D script-message yt-description-local WHEEL_LEFT playlist-prev WHEEL_RIGHT playlist-next -q script-message yt-mark-done-and-go-next -Q script-message yt-mark-watch-later +q script-message yt-mark-watched +Q script-message yt-mark-picked r script-message yt-check-new-videos P quit diff --git a/modules/by-name/yt/yt/input.conf.license b/modules/by-name/yt/yt/input.conf.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/yt/yt/input.conf.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/yt/yt/module.nix b/modules/by-name/yt/yt/module.nix index b93feeb5..4e7e90fe 100644 --- a/modules/by-name/yt/yt/module.nix +++ b/modules/by-name/yt/yt/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/yt/yt/mpv.conf b/modules/by-name/yt/yt/mpv.conf index b6d2501f..52a40823 100644 --- a/modules/by-name/yt/yt/mpv.conf +++ b/modules/by-name/yt/yt/mpv.conf @@ -1,2 +1 @@ -speed=2.7 volume=75 diff --git a/modules/by-name/yt/yt/mpv.conf.license b/modules/by-name/yt/yt/mpv.conf.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/yt/yt/mpv.conf.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/za/zathura/module.nix b/modules/by-name/za/zathura/module.nix index 1c55be54..a332e313 100644 --- a/modules/by-name/za/zathura/module.nix +++ b/modules/by-name/za/zathura/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh b/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh deleted file mode 100644 index 5126845a..00000000 --- a/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh +++ /dev/null @@ -1,298 +0,0 @@ -#! /usr/bin/env bash -print_message() { - - local messages - local message - - ### STANDARD INSULTS ### - declare -a _array1=( - "(╯°□°)╯︵ ┻━┻" - "¯\_(ツ)_/¯" - "ACHTUNG! ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS! DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN. IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN." - "And the Darwin Award goes to.... ${USER}!" - "Allowing you to survive childbirth was medical malpractice." - "Are you always this stupid or are you making a special effort today?!" - "Are you even trying?!" - "Bad." - "Boooo!" - "Brains aren't everything. In your case they're nothing." - "Commands, random gibberish, who cares!" - "Come on! You can do it!" - "Don't you have anything better to do?!" - "Don't you know anything?" - "Dropped on your head as a baby, eh?" - "error code: 1D10T" - "Even your mom loves you only as a friend." - "ERROR_INCOMPETENT_USER" - "Fake it till you make it!" - "Go outside." - "Haha, n00b!" - "How many times do I have to flush before you go away?" - "I am _seriously_ considering 'rm -rf /'-ing myself..." - "I don't know what makes you so stupid, but it really works." - "I was going to give you a nasty look, but I see you already have one." - "If beauty fades then you have nothing to worry about." - "If brains were gasoline you wouldn’t have enough to propel a flea’s motorcycle around a doughnut." - "If ignorance is bliss, you must be the happiest person on earth." - "If shit was music, you'd be an orchestra." - "If what you don't know can't hurt you, you're invulnerable." - "Incompetence is also a form of competence" - "I’d slap you, but that’d be animal abuse." - "I’ve heard of being hit with the ugly stick, but you must have been beaten senseless with it." - "Keep trying, someday you'll do something intelligent!" - "Let’s play horse. I’ll be the front end. And you be yourself." - "Life is good, you should get one." - "lol" - "lol... plz" - "My keyboard is not a touch screen!" - "My uptime is longer than your relationships." - "Nice try." - "n00b alert!" - "Pathetic" - "Perhaps computers are not for you..." - "Perhaps you should leave the command line alone..." - "Please step away from the keyboard!" - "plz uninstall" - "Pro tip: type a valid command!" - "Rose are red. Violets are blue. I have five fingers. The middle one's for you." - "RTFM!" - "Sorry what? I don’t understand idiot language." - "The degree of your stupidity is enough to boil water." - "The worst one today!" - "This is not a search engine." - "This is not Windows" - "This is why nobody likes you." - "This is why you get to see your children only once a month." - "Try using your brain the next time!" - "Two wrongs don't make a right, take your parents as an example." - "Typing incorrect commands, eh?" - "u suk" - "What if... you type an actual command the next time!" - "What if I told you... it is possible to type valid commands." - "What is this...? Amateur hour!?" - "Why are you so stupid?!" - "Why are you doing this to me?!" - "Why did the chicken cross the road? To get the hell away from you." - "Wow! That was impressively wrong!" - "Y u no speak computer???" - "You are not as bad as people say, you are much, much worse." - "You are not useless since you can still be used as a bad example." - "You must have been born on a highway because that's where most accidents happen." - "Your application for reduced salary has been sent!" - "Your mom had a severe case of diarrhea when you were born." - "You're proof that god has a sense of humor." - "You’re so dumb your first words were DUH." - "You're so fat, people jog around you for exercise." - "You’re the reason Santa says ho, ho, ho, on Christmas!" - ) - ### SHAKESPEARE INSULTS ### - declare -a array2=( - "A most notable coward, an infinite and endless liar, an hourly promise breaker, the owner of no one good quality." - "Away, you starvelling, you elf-skin, you dried neat's-tongue, bull's-pizzle, you stock-fish!" - "Away, you three-inch fool! " - "Come, come, you froward and unable worms!" - "Go, prick thy face, and over-red thy fear, Thou lily-liver’d boy." - "His wit's as thick as a Tewkesbury mustard." - "I am pigeon-liver'd and lack gall." - "I am sick when I do look on thee " - "I must tell you friendly in your ear, sell when you can, you are not for all markets." - "If thou wilt needs marry, marry a fool; for wise men know well enough what monsters you make of them." - "I'll beat thee, but I would infect my hands." - "I scorn you, scurvy companion. " - "Methink'st thou art a general offence and every man should beat thee." - "More of your conversation would infect my brain." - "My wife's a hobby horse!" - "Peace, ye fat guts!" - "Poisonous bunch-backed toad! " - "The rankest compound of villainous smell that ever offended nostril" - "The tartness of his face sours ripe grapes." - "There's no more faith in thee than in a stewed prune." - "Thine forward voice, now, is to speak well of thine friend; thine backward voice is to utter foul speeches and to detract." - "That trunk of humours, that bolting-hutch of beastliness, that swollen parcel of dropsies, that huge bombard of sack, that stuffed cloak-bag of guts, that roasted Manningtree ox with pudding in his belly, that reverend vice, that grey Iniquity, that father ruffian, that vanity in years?" - "Thine face is not worth sunburning." - "This woman's an easy glove, my lord, she goes off and on at pleasure." - "Thou art a boil, a plague sore." - "Was the Duke a flesh-monger, a fool and a coward?" - "Thou art as fat as butter." - "Here is the babe, as loathsome as a toad." - "Like the toad; ugly and venomous." - "Thou art unfit for any place but hell." - "Thou cream faced loon" - "Thou clay-brained guts, thou knotty-pated fool, thou whoreson obscene greasy tallow-catch!" - "Thou damned and luxurious mountain goat." - "Thou elvish-mark'd, abortive, rooting hog!" - "Thou leathern-jerkin, crystal-button, knot-pated, agatering, puke-stocking, caddis-garter, smooth-tongue, Spanish pouch!" - "Thou lump of foul deformity" - "That poisonous bunch-back'd toad!" - "Thou sodden-witted lord! Thou hast no more brain than I have in mine elbows " - "Thou subtle, perjur'd, false, disloyal man!" - "Thou whoreson zed , thou unnecessary letter!" - "Thy sin’s not accidental, but a trade." - "Thy tongue outvenoms all the worms of Nile." - "Would thou wert clean enough to spit upon" - "Would thou wouldst burst!" - "You poor, base, rascally, cheating lack-linen mate! " - "You are as a candle, the better burnt out." - "You scullion! You rampallian! You fustilarian! I’ll tickle your catastrophe!" - "You starvelling, you eel-skin, you dried neat's-tongue, you bull's-pizzle, you stock-fish-O for breath to utter what is like thee!-you tailor's-yard, you sheath, you bow-case, you vile standing tuck!" - "Your brain is as dry as the remainder biscuit after voyage." - "Virginity breeds mites, much like a cheese." - "Villain, I have done thy mother" - ) - ### MARTIN LUTHER INSULTS ### - declare -a array3=( - "You live like simple cattle or irrational pigs and, despite the fact that the gospel has returned, have mastered the fine art of misusing all your freedom." - "You shameful gluttons and servants of your bellies are better suited to be swineherds and keepers of dogs." - "You deserve not only to be given no food to eat, but also to have the dogs set upon you and to be pelted with horse manure." - "Oh, what mad senseless fools you are!" - "For this you deserve to have God deprive you of his Word and blessing and once again allow preachers of lies to arise who lead you to the devil - and wring sweat and blood out of you besides." - "All your holiness is only stench and filth, and it merits nothing but wrath and damnation." - "May your grain spoil in the barn, your beer in the cellar, your cattle perish in the stall. Yes, your entire hoard ought to be consumed by rust so that you will never enjoy it." - "You relish and delight in the chance to stir up someone else's dirt like pigs that roll in manure and root around in it with their snouts." - "Your sin smells to high heaven." - "Your words are so foolishly and ignorantly composed that I cannot believe you understand them." - "You are the most insane heretics and ingrafters of heretical perversity." - "What you say is a blasphemy that has made you worthy of a thousand deaths." - "Behold, indeed, this little golden work of a golden teacher! It is a work most worthy of golden letters, and lest there be something about it which is not golden, it must be handed down by golden disciples, namely, by those about whom it is said, 'The idols of the nations are silver and gold. They have eyes, but they see not.'" - "You are worthy only to be mocked by the words of error." - "It is presumptuous for people who are as ignorant as you are not to take up the work of a herdsman." - "What bilgewater of heresies has ever been spoken so heretically as what you have said?" - "What do you mean when you say this? Are you dreaming in the throes of a fever or are you laboring under a madness?" - "Your astute minds have been completely turned into stinking mushrooms." - "You are the prostitute of heretics!" - "I am tired of the pestilent voice of your sirens." - "You are a bungling magpie, croaking loudly." - "You forgot to purge yourself with hellabore while you were preparing to fabricate this lie." - "You are more corrupt than any Babylon or Sodom ever was, and, as far as I can see, are characterized by a completely depraved, hopeless, and notorious godlessness." - "Your home, once the holiest of all, has become the most licentious den of thieves, the most shameless of all brothels, the kingdom of sin, death, and hell. It is so bad that even Antichrist himself, if he should come, could think of nothing to add to its wickedness." - "What devilish unchristian thing would you not undertake?" - "You are an extraordinary creature, being neither God nor man. Perhaps you are the devil himself." - "Even if the Antichrist appears, what greater evil can he do than what you have done and do daily?" - "It may be that you want to build yourself a heaven of your own, like those jugglers build themselves out of linen cloth at the Shrove Tuesday carnival. Is it not disgusting that we have to hear such foolish and childish things from you?" - "In our country, fruit grows on trees and from trees, and meditation upon sin grows from contrition. But in your land, trees may grow on fruits, contrition from sins, people walk on their ears, and everything is upside down." - "O you wolf in Christendom!" - "You know less than does a log on the ground." - "I think that all the devils have at once entered into you." - "You are worse than all the devils. What you have done, no devil has ever done. Your end is near, you son of perdition and Antichrist! Stop now, you are going to far!" - "You are the true, chief, and final Antichrist." - "How far will you go, O devilish pride?" - "All Christians should be on guard against your antichristian poison." - "I think you received these ideas in your pipe dreams." - "You are in all you do the very opposite of Christ as befits a true Antichrist." - "You are a person of sin and the child of perdition, leading all the world with you to the devil, using your lying and deceitful ways." - "You are not a pious fraud, but an infernal, diabolical, antichristian fraud." - "You are the Roman Nimrod and a teacher of sin." - "It is the old dragon from the abyss of hell who is standing before me!" - "You hold fast to human dreams and the doctrines of devils." - "If you who are assembled in a council are so frivolous and irresponsible as to waste time and money on unnecessary questions, when it is the business of a council to deal only with the important and necessary matters, we should not only refuse to obey you, but consider you insane or criminals." - "Even Lucifer was not guilty of so great a sacrilege in heaven, for he only presumed to be God's equal. God help us!" - "You condemned the holy gospel and replaced it with the teaching of the dragon from hell." - "Your words are un-Christian, antichristian, and spoken by the inspiration of the evil spirit." - "What happened to the house built on sand in Matthew 7 will also happen to you." - "Must we believe your nightmares?" - "Look how this great heretic speaks brazenly and sacrilegiously." - "You run against God with the horns of your pride up in the air and thus plunge into the abyss of hell. Woe unto you, Antichrist!" - "You are the devil's most dangerous tool!" - "It seems I must have liars and villains for opponents. I am not worthy in the sight of God that a godly and honorable person should discuss these matters with me in a Christian way. This is my greatest lament." - "May the Lord Jesus protect me and all devout souls from your contagion and your company!" - "This venom - the mere smell of which kills a man!" - "You are a Baal-zebub - that is, a man of flies." - "You are full of poisonous refuse and insane foolishness." - "You are ignorant, stupid, godless blasphemers." - "You moderate enforcer and eulogizer of moderation. You are one of those bloody and deceitful people who affect modesty in words and appearance, but who meanwhile breathe out threats and blood." - "We leave you to your own devices, for nothing properly suits you except hypocrisy, flattery, and lies." - "In lying fashion you ignore what even children know." - "The reward of such flattery is what your crass stupidity deserves. Therefore, we shall turn from you, a sevenfold stupid and blasphemous wise person." - "People of your sort are hirelings, dumb dogs unable to bark, who see the wolf coming and flee or, rather, join up with the wolf." - "You are a wolf and apostle of Satan." - "You are the ultimate scourges of the world, the Antichrist together with your sophists and bishops." - "You cowardly slave, you corrupt sycophant, with your sickening advice!" - "You are idiots and swine." - "Every letter of yours breathes Moabitish pride. So much can a single bull inflate a single bubble that you practically make distinguished asses into gods." - "You sophistic worms, grasshoppers, locusts, frogs and lice!" - 'You completely close your mind and do nothing but shout, "Anathema, anathema, anathema!" so that by your own voice you are judged mad.' - "Let this generation of vipers prepare itself for unquenchable fire!" - "You rush forward as an ass under the pelt of a lion." - "In appearance and words you simulate modesty, but you are so swollen with haughtiness, arrogance, pride, malice, villainy, rashness, superciliousness, ignorance, and stupidity that there is nothing to surpass you." - "Blind moles!" - "We despise your whorish impudence." - ) - ### EDIT THIS LINE IF YOU ONLY WANT TO USE CERTAIN INSULT LISTS ### - messages=( - # "${array1[@]}" ## normal ones - "${array2[@]}" ## Shakespeare - "${array3[@]}" ## Luther - ) - - # If CMD_NOT_FOUND_MSGS array is populated use those messages instead of the defaults - [[ -n ${CMD_NOT_FOUND_MSGS} ]] && messages=("${CMD_NOT_FOUND_MSGS[@]}") - - # If CMD_NOT_FOUND_MSGS_APPEND array is populated append those to the existing messages - [[ -n ${CMD_NOT_FOUND_MSGS_APPEND} ]] && messages+=("${CMD_NOT_FOUND_MSGS_APPEND[@]}") - - # Seed RANDOM with an integer of some length - RANDOM=$(od -vAn -N4 -tu </dev/urandom) - - # Print a randomly selected message, but only about half the time to annoy the user a - # little bit less. - if [[ $((RANDOM % 2)) -lt 1 ]]; then - message=${messages[RANDOM % ${#messages[@]}]} - printf "\n %s%s%s\n\n" "$(tput bold)$(tput setaf 1)" "$message" "$(tput sgr0)" >&2 - fi -} - -function_exists() { - # Zsh returns 0 even on non existing functions with -F so use -f - declare -f "$1" >/dev/null - return $? -} - -# -# The idea below is to copy any existing handlers to another function -# name and insert the message in front of the old handler in the -# new handler. By default, neither bash or zsh has has a handler function -# defined, so the default behaviour is replicated. -# -# Also, ensure the handler is only copied once. If we do not ensure this -# the handler would add itself recursively if this file happens to be -# sourced multiple times in the same shell, resulting in a neverending -# stream of messages. -# - -# -# Zsh -# -if function_exists command_not_found_handler; then - if ! function_exists orig_command_not_found_handler; then - eval "orig_$(declare -f command_not_found_handler)" - fi -else - orig_command_not_found_handler() { - printf "zsh: command not found: %s\n" "$1" >&2 - return 127 - } -fi - -command_not_found_handler() { - print_message - orig_command_not_found_handler "$@" -} - -# -# Bash -# -if function_exists command_not_found_handle; then - if ! function_exists orig_command_not_found_handle; then - eval "orig_$(declare -f command_not_found_handle)" - fi -else - orig_command_not_found_handle() { - printf "%s: %s: command not found\n" "$0" "$1" >&2 - return 127 - } -fi - -command_not_found_handle() { - print_message - orig_command_not_found_handle "$@" -} diff --git a/modules/by-name/zs/zsh/config/custom_cursor.zsh b/modules/by-name/zs/zsh/config/custom_cursor.zsh index 071bb5fe..aa137173 100644 --- a/modules/by-name/zs/zsh/config/custom_cursor.zsh +++ b/modules/by-name/zs/zsh/config/custom_cursor.zsh @@ -1,5 +1,15 @@ #!/usr/bin/env zsh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + autoload -U add-zsh-hook autoload -U add-zle-hook-widget diff --git a/modules/by-name/zs/zsh/config/edit_command_line.zsh b/modules/by-name/zs/zsh/config/edit_command_line.zsh index 1d51a4e8..e14da5c6 100644 --- a/modules/by-name/zs/zsh/config/edit_command_line.zsh +++ b/modules/by-name/zs/zsh/config/edit_command_line.zsh @@ -1,5 +1,15 @@ #! /usr/bin/env zsh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + autoload -Uz edit-command-line wrapped_edit-command-line() { diff --git a/modules/by-name/zs/zsh/config/keymaps/.safe.zsh b/modules/by-name/zs/zsh/config/keymaps/.safe.zsh index ee3bfa32..b37d22f2 100644 --- a/modules/by-name/zs/zsh/config/keymaps/.safe.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/.safe.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -M .safe "^J" .accept-line bindkey -M .safe "^M" .accept-line bindkey -R -M .safe "^@"-"^I" .self-insert diff --git a/modules/by-name/zs/zsh/config/keymaps/command.zsh b/modules/by-name/zs/zsh/config/keymaps/command.zsh index 81ae6dda..e195ed4c 100644 --- a/modules/by-name/zs/zsh/config/keymaps/command.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/command.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Keymap used in the vicmd `execute-named-cmd` mode bindkey -N command diff --git a/modules/by-name/zs/zsh/config/keymaps/emacs.zsh b/modules/by-name/zs/zsh/config/keymaps/emacs.zsh index b789faf5..1cbf77e9 100644 --- a/modules/by-name/zs/zsh/config/keymaps/emacs.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/emacs.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N emacs bindkey -M emacs "^[A" accept-and-hold diff --git a/modules/by-name/zs/zsh/config/keymaps/isearch.zsh b/modules/by-name/zs/zsh/config/keymaps/isearch.zsh index db80bae8..d5e68f1b 100644 --- a/modules/by-name/zs/zsh/config/keymaps/isearch.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/isearch.zsh @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Nothing? bindkey -N isearch diff --git a/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh b/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh index ceb4f348..acf3746d 100644 --- a/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N vicmd # Bind in string to out string diff --git a/modules/by-name/zs/zsh/config/keymaps/viins.zsh b/modules/by-name/zs/zsh/config/keymaps/viins.zsh index d215d190..3353956c 100644 --- a/modules/by-name/zs/zsh/config/keymaps/viins.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/viins.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N viins # Completion Debugging diff --git a/modules/by-name/zs/zsh/config/keymaps/viopp.zsh b/modules/by-name/zs/zsh/config/keymaps/viopp.zsh index 8b291d00..3dd900f8 100644 --- a/modules/by-name/zs/zsh/config/keymaps/viopp.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/viopp.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N viopp bindkey -M viopp "t" down-line diff --git a/modules/by-name/zs/zsh/config/keymaps/visual.zsh b/modules/by-name/zs/zsh/config/keymaps/visual.zsh index c09cd578..73191d94 100644 --- a/modules/by-name/zs/zsh/config/keymaps/visual.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/visual.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N visual bindkey -M visual "^[" deactivate-region diff --git a/modules/by-name/zs/zsh/config/keymaps_end.zsh b/modules/by-name/zs/zsh/config/keymaps_end.zsh index 2e973de4..2ce403a5 100644 --- a/modules/by-name/zs/zsh/config/keymaps_end.zsh +++ b/modules/by-name/zs/zsh/config/keymaps_end.zsh @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Use the vi imitation keymap as default bindkey -A viins main diff --git a/modules/by-name/zs/zsh/config/keymaps_start.zsh b/modules/by-name/zs/zsh/config/keymaps_start.zsh index 2504e799..dfae8dcc 100644 --- a/modules/by-name/zs/zsh/config/keymaps_start.zsh +++ b/modules/by-name/zs/zsh/config/keymaps_start.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Delete all default keymaps (with the exception of .safe) bindkey -D command emacs isearch main vicmd viins viopp visual diff --git a/modules/by-name/zs/zsh/config/zsh-init.zsh b/modules/by-name/zs/zsh/config/zsh-init.zsh index aac344dc..740fc44b 100644 --- a/modules/by-name/zs/zsh/config/zsh-init.zsh +++ b/modules/by-name/zs/zsh/config/zsh-init.zsh @@ -1,5 +1,15 @@ #!/usr/bin/env zsh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Display current tasks [ -z "$NVIM" ] && task next diff --git a/modules/by-name/zs/zsh/module.nix b/modules/by-name/zs/zsh/module.nix index 833da126..644854a2 100644 --- a/modules/by-name/zs/zsh/module.nix +++ b/modules/by-name/zs/zsh/module.nix @@ -1,111 +1,138 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, - shell_library, - system, ... }: let cfg = config.soispha.programs.zsh; - homeConfig = config.home-manager.users.soispha; + + zDotDir = ".config/zsh"; sourceFile = path: "source ${path}\n"; + + extraFiles = builtins.concatStringsSep "\n" ( + builtins.map (value: + if builtins.isPath value + then (sourceFile value) + else value) ( + builtins.attrValues cfg.integrations + ) + ); in { options.soispha.programs.zsh = { enable = lib.mkEnableOption "zsh"; - }; - - config.home-manager.users.soispha = lib.mkIf cfg.enable { - home.sessionPath = []; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion = { - enable = true; - strategy = []; - }; - syntaxHighlighting.enable = true; - autocd = true; + integrations = lib.mkOption { + type = lib.types.attrsOf (lib.types.either lib.types.path lib.types.str); + example = '' + { + atuin = ./integrations/atuin.zsh; + } + ''; + default = {}; + }; + }; - # Must be relative to the users home directory (for whatever reason) - # Thus no `${homeConfig.xdg.configHome}` - dotDir = ".config/zsh"; + config = lib.mkIf cfg.enable { + environment.variables = { + ZDOTDIR = "${config.home-manager.users.soispha.home.homeDirectory}/${zDotDir}"; + }; - # TODO: Remove the whole history and replace it completely with `atuin` <2024-10-21> - history = { - path = "/dev/null"; - # save = 0; # number of lines to save - # size = 0; # number of lines to keep - # share = false; # share between sessions - }; + home-manager.users.soispha = { + home.sessionPath = lib.mkForce []; - loginExtra = - # bash - '' - setopt AUTO_CD - setopt AUTO_PUSHD - setopt CHASE_DOTS - - setopt ALWAYS_TO_END - - setopt EXTENDED_HISTORY - setopt HIST_ALLOW_CLOBBER - setopt HIST_VERIFY - setopt HIST_FCNTL_LOCK - setopt APPEND_HISTORY - - setopt DVORAK - setopt CORRECT - - setopt PROMPT_SUBST - setopt TRANSIENT_RPROMPT # maybe? - - setopt COMBINING_CHARS - setopt VI - ''; - - initExtraFirst = - sourceFile ./config/zsh-init.zsh - + '' - SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}} - ''; - - initExtra = let - start = lib.modules.mkBefore ( - # NOTE: This must be before the insult, as we otherwise override the previous handler <2024-02-28> - sourceFile ./config/command_not_found/command_not_found.sh - + sourceFile ./config/command_not_found/command_not_found_insult.sh - + sourceFile ./config/custom_cursor.zsh - + sourceFile ./config/edit_command_line.zsh - + sourceFile ./plugins/zsh-history-substring-search.zsh - ); - end = lib.modules.mkAfter ( - sourceFile ./config/keymaps_start.zsh - + sourceFile ./config/keymaps/command.zsh - + sourceFile ./config/keymaps/emacs.zsh - + sourceFile ./config/keymaps/isearch.zsh - + sourceFile ./config/keymaps/vicmd.zsh - + sourceFile ./config/keymaps/viins.zsh - + sourceFile ./config/keymaps/viopp.zsh - + sourceFile ./config/keymaps/visual.zsh - + sourceFile ./config/keymaps_end.zsh - ); - in - lib.modules.mkMerge - [ - start - end - ]; - - localVariables = { - HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND = "bg=cyan,fg=white"; - HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND = "fg=red,underline,standout,bold"; - }; + # This just includes a `source ~/.config/zsh/.zshenv`, because home-manger by-default + # can't access the root `/etc/zshenv`. We can and thus, we can remove this file. + home.file.".zshenv".enable = false; - shellAliases = { - ll = ". ll"; - lm = ". lm"; + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion = { + enable = true; + strategy = []; + }; + syntaxHighlighting.enable = true; + + autocd = true; + + # Must be relative to the users home directory (for whatever reason) + # Thus no `${homeConfig.xdg.configHome}` + dotDir = zDotDir; + + # TODO: Remove the whole history and replace it completely with `atuin` <2024-10-21> + history = { + path = "/dev/null"; + # save = 0; # number of lines to save + # size = 0; # number of lines to keep + # share = false; # share between sessions + }; + + loginExtra = + # bash + '' + setopt AUTO_CD + setopt AUTO_PUSHD + setopt CHASE_DOTS + + setopt ALWAYS_TO_END + + setopt EXTENDED_HISTORY + setopt HIST_ALLOW_CLOBBER + setopt HIST_VERIFY + setopt HIST_FCNTL_LOCK + setopt APPEND_HISTORY + + setopt DVORAK + setopt CORRECT + + setopt PROMPT_SUBST + setopt TRANSIENT_RPROMPT # maybe? + + setopt COMBINING_CHARS + setopt VI + ''; + + initContent = let + start = lib.modules.mkBefore ( + sourceFile ./config/zsh-init.zsh + + sourceFile ./config/custom_cursor.zsh + + sourceFile ./config/edit_command_line.zsh + + sourceFile ./plugins/zsh-history-substring-search.zsh + ); + end = lib.modules.mkAfter ( + sourceFile ./config/keymaps_start.zsh + + sourceFile ./config/keymaps/command.zsh + + sourceFile ./config/keymaps/emacs.zsh + + sourceFile ./config/keymaps/isearch.zsh + + sourceFile ./config/keymaps/vicmd.zsh + + sourceFile ./config/keymaps/viins.zsh + + sourceFile ./config/keymaps/viopp.zsh + + sourceFile ./config/keymaps/visual.zsh + + sourceFile ./config/keymaps_end.zsh + ); + in + lib.modules.mkMerge + [ + start + + extraFiles + + end + ]; + + localVariables = { + HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND = "bg=cyan,fg=white"; + HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND = "fg=red,underline,standout,bold"; + }; }; }; }; diff --git a/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh b/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh index 4314b784..cc2b6e98 100644 --- a/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh +++ b/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh @@ -1,46 +1,25 @@ #!/usr/bin/env zsh -############################################################################## -# Original Source before 2024 modifications: -# https://github.com/zsh-users/zsh-history-substring-search/blob/87ce96b1862928d84b1afe7c173316614b30e301/zsh-history-substring-search.zsh + +# nixos-config - My current NixOS configuration # # Copyright (c) 2009 Peter Stephenson # Copyright (c) 2011 Guido van Steen -# Copyright (c) 2011 Suraj N. Kurapati # Copyright (c) 2011 Sorin Ionescu +# Copyright (c) 2011 Suraj N. Kurapati # Copyright (c) 2011 Vincent Guerci # Copyright (c) 2016 Geza Lore # Copyright (c) 2017 Bengt Brodersen -# Copyright (c) 2024 Benedikt Peetz -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: +# Copyright (c) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later # -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# This file is part of my nixos-config. # -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# * Neither the name of the FIZSH nor the names of its contributors -# may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################## +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# Original Source before 2024 modifications: +# https://github.com/zsh-users/zsh-history-substring-search/blob/87ce96b1862928d84b1afe7c173316614b30e301/zsh-history-substring-search.zsh #----------------------------------------------------------------------------- # declare global configuration variables diff --git a/modules/home.legacy/files/wallpaper/abstract-nord.png b/modules/common/abstract-nord.png index 5ef498bf..5ef498bf 100644 --- a/modules/home.legacy/files/wallpaper/abstract-nord.png +++ b/modules/common/abstract-nord.png Binary files differdiff --git a/modules/common/abstract-nord.png.license b/modules/common/abstract-nord.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/common/abstract-nord.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/common/default.nix b/modules/common/default.nix new file mode 100644 index 00000000..a272bd52 --- /dev/null +++ b/modules/common/default.nix @@ -0,0 +1,301 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +# This file contains common configuration applied to every host. +# It should only `enable` options defined in the `modules/by-name` directory. +{ + config, + pkgs, + lib, + # Needed for nixos-shell + libraries, + modules, + openPRsNixpkgs, + packageSets, + system, + self, + externalDependencies, + externalBinaries, + ... +}: { + # TODO(@bpeetz): Move this file to default options in their respective modules. <2025-05-31> + + soispha = { + age.enable = true; + boot.enable = true; + cleanup.enable = true; + documentation.enable = true; + + fonts = { + enable = true; + enableEmoji = true; + }; + + hardware = { + enable = lib.mkDefault true; + }; + home-manager.enable = true; + impermanence = { + enable = true; + + directories = [ + "/etc/nixos" + "/var/lib/systemd" + ]; + }; + + nixos-shell = { + enable = lib.mkDefault true; + configuration = { + specialArgs = { + inherit + libraries + modules + ; + }; + value = lib.mkMerge [ + { + _module.args = { + inherit + # extra package sources + openPRsNixpkgs + packageSets + # extra information + system + # nix registry + self + externalDependencies + # bins + # TODO: Integrate these into `pkgs/by-name` <2024-05-22> + externalBinaries + ; + }; + } + + { + require = [ + ./nixos_shell_configuration.nix + + ../../modules + ../../modules/common + ]; + } + ]; + }; + mounts = {}; + }; + + polkit.enable = true; + power.enable = true; + xdg.enable = true; + + services = { + adb = { + enable = true; + user = "soispha"; + }; + backup = { + storagebox = { + enable = lib.mkDefault true; + user = "u459143-sub1"; + }; + local = { + enable = lib.mkDefault true; + }; + }; + fwupd.enable = true; + mako.enable = true; + mpd = { + enable = true; + directories = let + data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd"; + in { + inherit data; + playlists = "${data}/playlists"; + runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd"; + music = config.home-manager.users.soispha.programs.beets.settings.directory; + }; + mpc = { + enable = true; + beetsPkg = config.home-manager.users.soispha.programs.beets.package; + }; + }; + ollama.enable = false; + postgresql.enable = false; + printing.enable = true; + scanning.enable = true; + snapper.enable = true; + water-reminder.enable = true; + systemDiff.enable = true; + unison = { + enable = lib.mkDefault true; + + foreign.userName = "soispha"; + dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; + userSourceDir = "/srv/home/soispha"; + pathsToIgnore = let + extractTarget = attr: "~/${attr.target}"; + homeManagerSymlinks = + builtins.map extractTarget + (builtins.attrValues + config.home-manager.users.soispha.home.file); + in + [ + # TODO(@bpeetz): Move these to their respective modules <2025-05-09> + # Already synchronized by TaskChampion sync server + "~/.local/share/task" + # Already synchronized by atuin sync server + "~/.local/share/atuin" + # Already synchronized by mbsync + "~/.local/share/maildir" + + # Should not be synchronized + "~/.local/share/unison" + + # These are just to big to be synchronized (# TODO: Work around that <2024-08-31> ) + "~/media/music" + "~/.local/share/Steam" + ] + ++ homeManagerSymlinks; + + pathsToSync = [ + "~/.local/state/mpv" + "~/.local/state/nvim" + "~/.local/share" + "~/.local/.Trash-1000" + + "~/media" + "~/school" + "~/repos" + ]; + }; + }; + + programs = { + i3bar-river.enable = true; + i3status-rust.enable = true; + + qutebrowser = { + enable = true; + }; + + nvim = { + enable = true; + shell = pkgs.zsh; + }; + atuin = { + enable = true; + enableAge = lib.mkDefault true; + }; + cargo.enable = true; + direnv.enable = true; + git.enable = true; + imv.enable = true; + less.enable = true; + lf.enable = true; + gpg.enable = true; + river = { + enable = lib.mkDefault true; + init = { + rules = [ + { + app-id = "float"; + title = "*"; + action = "float"; + } + { + app-id = "mpv"; + title = "*"; + action = "float"; + } + { + app-id = "ModernGL"; + title = "*"; + action = "float"; + } + { + app-id = "*"; + title = "Manim Slides"; + action = "float"; + } + { + app-id = "*"; + title = "floating please"; + action = "float"; + } + + { + app-id = "*"; + title = "*"; + action = "ssd"; + } + # # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) + # { + # app-id = "firefox"; + # title = "*"; + # action = "csd"; + # } + ]; + generalSettings = { + # background + background-color = "0x002b36"; + border-color-focused = "0x93a1a1"; + border-color-unfocused = "0x586e75"; + + # keyboard repeat rate + set-repeat = ["50" "300"]; + + # Cursor + focus-follows-cursor = "normal"; + # hide-cursor = ["timeout" "2000"]; + hide-cursor = ["when-typing" "enabled"]; + set-cursor-warp = "on-output-change"; + xcursor-theme = ["Nordzy-cursors" "24"]; + }; + inputs = { + pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; + pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; + }; + backgroundStart = [ + # TODO(@bpeetz): Move these to systemd units/their own modules <2025-05-18> + pkgs.gammastep + + pkgs.mako + ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"] + pkgs.swayidle + pkgs.alacritty + ]; + }; + }; + mpv.enable = true; + steam.enable = true; + ssh.enable = true; + swaylock.enable = true; + timewarrior.enable = true; + taskwarrior = { + enable = true; + enableAge = lib.mkDefault true; + + hooks = import ./hooks {inherit pkgs lib config;}; + }; + tskm = { + enable = true; + projects = builtins.fromJSON (builtins.readFile ./projects.json); + }; + nix-index.enable = true; + yambar.enable = false; + yt.enable = true; + zathura.enable = true; + zsh.enable = true; + }; + + sound.enable = true; + version.enable = true; + }; +} diff --git a/modules/common/hooks/default.nix b/modules/common/hooks/default.nix new file mode 100644 index 00000000..5b694039 --- /dev/null +++ b/modules/common/hooks/default.nix @@ -0,0 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + pkgs, + lib, + config, +}: { + sync-git-repos = config.lib.taskwarrior.mkHook "on-add" [pkgs.git] ./scripts/sync-git-repo.sh; + sync-git-repos-mod = config.lib.taskwarrior.mkHook "on-modify" [pkgs.git] ./scripts/sync-git-repo.sh; +} diff --git a/modules/common/hooks/scripts/sync-git-repo.sh b/modules/common/hooks/scripts/sync-git-repo.sh new file mode 100755 index 00000000..fe0d0085 --- /dev/null +++ b/modules/common/hooks/scripts/sync-git-repo.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +task_data="$(task _get rc.data.location)" +[ "$task_data" ] || die "Taskwarrior should have a location set" + +cd "$task_data" || die "(BUG?): Your data.location path is not accessable" + +[ -d ./.git/ ] || git init + +git add . +git commit --message="chore: Update" --no-gpg-sign + +# vim: ft=sh diff --git a/modules/common/nixos_shell_configuration.nix b/modules/common/nixos_shell_configuration.nix new file mode 100644 index 00000000..1bec0145 --- /dev/null +++ b/modules/common/nixos_shell_configuration.nix @@ -0,0 +1,66 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { + soispha = { + networking = { + enable = true; + hostName = "lahmu"; + mode = "systemd-networkd"; + }; + + nixos-shell.enable = false; + + nixpkgs = { + enable = true; + systemName = "x86_64-linux"; + }; + + services = { + unison.enable = false; + backup = { + storagebox.enable = false; + local.enable = false; + }; + }; + + programs = { + river.enable = false; + + # We don't have access to the age secrets. + atuin.enableAge = false; + taskwarrior.enableAge = false; + }; + + locale = { + enable = true; + keyMap = "us"; + }; + + users = { + enable = true; + enableDeprecatedPlugdev = true; + + # Make logging in impossible. + # (This also removes root a obvious access-point from the virtual machine) + hashedPassword = ""; + }; + }; + + soispha = { + hardware = { + enable = false; + }; + + disks.enable = false; + }; + + # We run without state + # system.stateVersion = null; +} diff --git a/modules/common/projects.json b/modules/common/projects.json new file mode 100644 index 00000000..df3b0c60 --- /dev/null +++ b/modules/common/projects.json @@ -0,0 +1,67 @@ +{ + "aoc": { + "prefix": "programming/advent_of_code" + }, + "book": { + "prefix": "book" + }, + "buy": { + "prefix": "buy", + "subprojects": { + "books": {}, + "pc": {} + } + }, + "latex": { + "prefix": "programming/latex" + }, + "me": { + "subprojects": { + "bank": {}, + "google": {}, + "health": {}, + "job": {}, + "sweden": {} + } + }, + "server": { + "prefix": "config", + "subprojects": { + "b-peetz": {}, + "blog": {}, + "ci": {}, + "email": {}, + "nix-sync": {}, + "sudo-less": {} + } + }, + "smartphone": { + "prefix": "hardware" + }, + "system": { + "prefix": "config", + "subprojects": { + "backup": {}, + "bar": {}, + "email": {}, + "firefox": {}, + "gpg": {}, + "keyboard": {}, + "laptop": {}, + "nvim": {}, + "rss": {}, + "shell": {}, + "task": {}, + "wm": {}, + "youtube": {} + } + }, + "timesinks": { + "subprojects": { + "games": {}, + "music": {}, + "netflix": {}, + "youtube": {} + } + } +} diff --git a/modules/common/projects.json.license b/modules/common/projects.json.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/common/projects.json.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/default.nix b/modules/default.nix index 1df511a1..f83cf683 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,20 +1,20 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # NOTE: This file **must** not depend on `pkgs`. This is because `pkgs` is defined in a # module imported by it, and thus would require infinite recursion. <2024-10-18> -{nixLib, ...}: let +{libraries, ...}: let files = builtins.attrValues - (nixLib.mkByName { + (libraries.extra.mkByName { baseDirectory = ./by-name; fileName = "module.nix"; - finalizeFunction = name: value: value; - - # TODO: Re-activate, when/if most modules have tests. <2024-11-23> - # coImportsNameFunction = { - # shard, - # name, - # }: - # ../tests/by-name + "/${shard}" + "/${name}" + "/test.nix"; - # coImportsWarnMessageObject = "test"; }); in { imports = files; diff --git a/modules/home.legacy/conf/alacritty/default.nix b/modules/home.legacy/conf/alacritty/default.nix index 87d02959..493c4114 100644 --- a/modules/home.legacy/conf/alacritty/default.nix +++ b/modules/home.legacy/conf/alacritty/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {lib, ...}: let config_file = '' ${lib.strings.fileContents ./toml/general.toml} diff --git a/modules/home.legacy/conf/alacritty/toml/bell.toml b/modules/home.legacy/conf/alacritty/toml/bell.toml index 912d08e3..821306cc 100644 --- a/modules/home.legacy/conf/alacritty/toml/bell.toml +++ b/modules/home.legacy/conf/alacritty/toml/bell.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Bell # # The bell is rung every time the BEL control character is received. diff --git a/modules/home.legacy/conf/alacritty/toml/colorscheme.toml b/modules/home.legacy/conf/alacritty/toml/colorscheme.toml index f98a5b91..13c796c9 100644 --- a/modules/home.legacy/conf/alacritty/toml/colorscheme.toml +++ b/modules/home.legacy/conf/alacritty/toml/colorscheme.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Nightfox Alacritty Colors ## name: carbonfox ## upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/carbonfox/alacritty.toml diff --git a/modules/home.legacy/conf/alacritty/toml/cursor.toml b/modules/home.legacy/conf/alacritty/toml/cursor.toml index d9cb93f4..6e633b5a 100644 --- a/modules/home.legacy/conf/alacritty/toml/cursor.toml +++ b/modules/home.legacy/conf/alacritty/toml/cursor.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [cursor] blink_interval = 750 blink_timeout = 5 diff --git a/modules/home.legacy/conf/alacritty/toml/env.toml b/modules/home.legacy/conf/alacritty/toml/env.toml index fdd4e5d1..307f1f1d 100644 --- a/modules/home.legacy/conf/alacritty/toml/env.toml +++ b/modules/home.legacy/conf/alacritty/toml/env.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [env] TERM = "alacritty" COLORTERM = "truecolor" diff --git a/modules/home.legacy/conf/alacritty/toml/font.toml b/modules/home.legacy/conf/alacritty/toml/font.toml index dd18a6fb..fd8b0b94 100644 --- a/modules/home.legacy/conf/alacritty/toml/font.toml +++ b/modules/home.legacy/conf/alacritty/toml/font.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [font] builtin_box_drawing = true size = 12.0 diff --git a/modules/home.legacy/conf/alacritty/toml/general.toml b/modules/home.legacy/conf/alacritty/toml/general.toml index 4651b51b..588d8ea0 100644 --- a/modules/home.legacy/conf/alacritty/toml/general.toml +++ b/modules/home.legacy/conf/alacritty/toml/general.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Configuration for Alacritty, the GPU enhanced terminal emulator. [general] diff --git a/modules/home.legacy/conf/alacritty/toml/hints.toml b/modules/home.legacy/conf/alacritty/toml/hints.toml index 31d91a37..da18dc59 100644 --- a/modules/home.legacy/conf/alacritty/toml/hints.toml +++ b/modules/home.legacy/conf/alacritty/toml/hints.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [hints] alphabet = "jfkdls;ahgurieowpq" diff --git a/modules/home.legacy/conf/alacritty/toml/keyboard_bindings.toml b/modules/home.legacy/conf/alacritty/toml/keyboard_bindings.toml index 8e0b1e13..f2a6eb55 100644 --- a/modules/home.legacy/conf/alacritty/toml/keyboard_bindings.toml +++ b/modules/home.legacy/conf/alacritty/toml/keyboard_bindings.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [[keyboard.bindings]] action = "Paste" key = "P" diff --git a/modules/home.legacy/conf/alacritty/toml/mouse.toml b/modules/home.legacy/conf/alacritty/toml/mouse.toml index eba68edf..cbc9cd32 100644 --- a/modules/home.legacy/conf/alacritty/toml/mouse.toml +++ b/modules/home.legacy/conf/alacritty/toml/mouse.toml @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [mouse] hide_when_typing = false diff --git a/modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml b/modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml index 1b281748..e566a452 100644 --- a/modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml +++ b/modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [[mouse.bindings]] action = "Copy" mouse = "Middle" diff --git a/modules/home.legacy/conf/alacritty/toml/scrolling.toml b/modules/home.legacy/conf/alacritty/toml/scrolling.toml index ed7c22cf..09240872 100644 --- a/modules/home.legacy/conf/alacritty/toml/scrolling.toml +++ b/modules/home.legacy/conf/alacritty/toml/scrolling.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [scrolling] history = 10000 multiplier = 3 diff --git a/modules/home.legacy/conf/alacritty/toml/selection.toml b/modules/home.legacy/conf/alacritty/toml/selection.toml index 60ea0495..ebc8c849 100644 --- a/modules/home.legacy/conf/alacritty/toml/selection.toml +++ b/modules/home.legacy/conf/alacritty/toml/selection.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [selection] save_to_clipboard = false semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" diff --git a/modules/home.legacy/conf/alacritty/toml/window.toml b/modules/home.legacy/conf/alacritty/toml/window.toml index 123b5b7a..edc9cf6e 100644 --- a/modules/home.legacy/conf/alacritty/toml/window.toml +++ b/modules/home.legacy/conf/alacritty/toml/window.toml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [window] decorations = "none" decorations_theme_variant = "None" diff --git a/modules/home.legacy/conf/alacritty/yaml/base.yml b/modules/home.legacy/conf/alacritty/yaml/base.yml index 0791a60f..637d0d2e 100644 --- a/modules/home.legacy/conf/alacritty/yaml/base.yml +++ b/modules/home.legacy/conf/alacritty/yaml/base.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + --- # Configuration for Alacritty, the GPU enhanced terminal emulator. diff --git a/modules/home.legacy/conf/alacritty/yaml/bell.yml b/modules/home.legacy/conf/alacritty/yaml/bell.yml index bd071aeb..4331a121 100644 --- a/modules/home.legacy/conf/alacritty/yaml/bell.yml +++ b/modules/home.legacy/conf/alacritty/yaml/bell.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Bell # # The bell is rung every time the BEL control character is received. diff --git a/modules/home.legacy/conf/alacritty/yaml/colors.yml b/modules/home.legacy/conf/alacritty/yaml/colors.yml index 899c660a..05d2e0e6 100644 --- a/modules/home.legacy/conf/alacritty/yaml/colors.yml +++ b/modules/home.legacy/conf/alacritty/yaml/colors.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Colors (Tomorrow Night) colors: # Default colors diff --git a/modules/home.legacy/conf/alacritty/yaml/colorscheme.yml b/modules/home.legacy/conf/alacritty/yaml/colorscheme.yml index 4e0abfae..0b07fe80 100644 --- a/modules/home.legacy/conf/alacritty/yaml/colorscheme.yml +++ b/modules/home.legacy/conf/alacritty/yaml/colorscheme.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Nightfox Alacritty Colors # Style: carbonfox # Upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/carbonfox/nightfox_alacritty.yml diff --git a/modules/home.legacy/conf/alacritty/yaml/cursor.yml b/modules/home.legacy/conf/alacritty/yaml/cursor.yml index ef700ebc..5a3946f2 100644 --- a/modules/home.legacy/conf/alacritty/yaml/cursor.yml +++ b/modules/home.legacy/conf/alacritty/yaml/cursor.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + cursor: # Cursor style style: diff --git a/modules/home.legacy/conf/alacritty/yaml/debug.yml b/modules/home.legacy/conf/alacritty/yaml/debug.yml index 2c391da2..e876d801 100644 --- a/modules/home.legacy/conf/alacritty/yaml/debug.yml +++ b/modules/home.legacy/conf/alacritty/yaml/debug.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + #debug: # Display the time it takes to redraw each frame. #render_timer: false diff --git a/modules/home.legacy/conf/alacritty/yaml/env.yml b/modules/home.legacy/conf/alacritty/yaml/env.yml index ee7528b7..585416a1 100644 --- a/modules/home.legacy/conf/alacritty/yaml/env.yml +++ b/modules/home.legacy/conf/alacritty/yaml/env.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Any items in the `env` entry below will be added as # environment variables. Some entries may override variables # set by alacritty itself. diff --git a/modules/home.legacy/conf/alacritty/yaml/font.yml b/modules/home.legacy/conf/alacritty/yaml/font.yml index a3fd3b1d..a711f231 100644 --- a/modules/home.legacy/conf/alacritty/yaml/font.yml +++ b/modules/home.legacy/conf/alacritty/yaml/font.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Font configuration font: # Normal (roman) font face diff --git a/modules/home.legacy/conf/alacritty/yaml/hints.yml b/modules/home.legacy/conf/alacritty/yaml/hints.yml index 8c35548b..b9d75378 100644 --- a/modules/home.legacy/conf/alacritty/yaml/hints.yml +++ b/modules/home.legacy/conf/alacritty/yaml/hints.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Hints # # Terminal hints can be used to find text or hyperlink in the visible part of diff --git a/modules/home.legacy/conf/alacritty/yaml/key_bindings.yml b/modules/home.legacy/conf/alacritty/yaml/key_bindings.yml index c8be747e..6bf31719 100644 --- a/modules/home.legacy/conf/alacritty/yaml/key_bindings.yml +++ b/modules/home.legacy/conf/alacritty/yaml/key_bindings.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Key bindings # # Key bindings are specified as a list of objects. For example, this is the diff --git a/modules/home.legacy/conf/alacritty/yaml/mouse.yml b/modules/home.legacy/conf/alacritty/yaml/mouse.yml index 4bdb408b..c5d2acbb 100644 --- a/modules/home.legacy/conf/alacritty/yaml/mouse.yml +++ b/modules/home.legacy/conf/alacritty/yaml/mouse.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + mouse: # Click settings # diff --git a/modules/home.legacy/conf/alacritty/yaml/mouse_bindings.yml b/modules/home.legacy/conf/alacritty/yaml/mouse_bindings.yml index ab244d21..82e2b92b 100644 --- a/modules/home.legacy/conf/alacritty/yaml/mouse_bindings.yml +++ b/modules/home.legacy/conf/alacritty/yaml/mouse_bindings.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Mouse bindings # # Mouse bindings are specified as a list of objects, much like the key diff --git a/modules/home.legacy/conf/alacritty/yaml/scrolling.yml b/modules/home.legacy/conf/alacritty/yaml/scrolling.yml index 50365627..0d108f76 100644 --- a/modules/home.legacy/conf/alacritty/yaml/scrolling.yml +++ b/modules/home.legacy/conf/alacritty/yaml/scrolling.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + scrolling: # Maximum number of lines in the scrollback buffer. # Specifying '0' will disable scrolling. diff --git a/modules/home.legacy/conf/alacritty/yaml/selection.yml b/modules/home.legacy/conf/alacritty/yaml/selection.yml index 5e5bd544..100118fc 100644 --- a/modules/home.legacy/conf/alacritty/yaml/selection.yml +++ b/modules/home.legacy/conf/alacritty/yaml/selection.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + selection: # This string contains all characters that are used as separators for # "semantic words" in Alacritty. diff --git a/modules/home.legacy/conf/alacritty/yaml/shell.yml b/modules/home.legacy/conf/alacritty/yaml/shell.yml index 04844dd0..4da99581 100644 --- a/modules/home.legacy/conf/alacritty/yaml/shell.yml +++ b/modules/home.legacy/conf/alacritty/yaml/shell.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Shell # # You can set `shell.program` to the path of your favorite shell, e.g. diff --git a/modules/home.legacy/conf/alacritty/yaml/window.yml b/modules/home.legacy/conf/alacritty/yaml/window.yml index 7b89b6ed..2d4006ba 100644 --- a/modules/home.legacy/conf/alacritty/yaml/window.yml +++ b/modules/home.legacy/conf/alacritty/yaml/window.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + window: # Window dimensions (changes require restart) # diff --git a/modules/home.legacy/conf/beets/default.nix b/modules/home.legacy/conf/beets/default.nix index 8d6277b7..612a5f03 100644 --- a/modules/home.legacy/conf/beets/default.nix +++ b/modules/home.legacy/conf/beets/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, @@ -5,6 +14,16 @@ ... }: let plugins = import ./plugins.nix {}; + + # TODO: Enable xtractor again <2025-03-29> + # package = pkgs.beets.override { + # pluginOverrides = { + # xtractor = { + # enable = true; + # propagatedBuildInputs = [pkgs.beetsExtraPlugins.xtractor]; + # }; + # }; + package = pkgs.beets; in { imports = [ ./plugins @@ -12,14 +31,7 @@ in { programs.beets = { enable = true; - package = pkgs.beets.override { - pluginOverrides = { - xtractor = { - enable = true; - propagatedBuildInputs = [pkgs.beetsExtraPlugins.xtractor]; - }; - }; - }; + inherit package; settings = { library = "${config.xdg.dataHome}/beets/library.db"; @@ -29,9 +41,12 @@ in { color = true; }; - include = [ - "./replace_override.yaml" - ]; + replace = { + "[/]" = "\\"; + "[\\x00-\\x1f]" = ""; + "\\s+$" = ""; + "^\\s+" = ""; + }; import = { # move, instead of copying or linking the files @@ -50,15 +65,11 @@ in { }; paths = let - j = lib.strings.concatStringsSep "/"; + join = lib.strings.concatStringsSep "/"; in { - default = j ["[Default]" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"]; - "albumtype:live" = j ["[Live]" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"]; + "albumtype:live" = join ["[Live, please delete]" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"]; - "albumtype:album" = j ["Music" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"]; - "albumtype::(Single|EP)" = j ["Music" "$genre" "$first_artist_singleton" "$album ($albumtype)" "$track $title"]; - "albumtype:compilation" = j ["Complilations" "$genre" "Various Artists" "$album ($albumtype)" "$track $title"]; - "albumtype:soundtrack" = j ["Soundtracks" "$genre" "$first_artist" "$album" "$track $title"]; + default = "$albumartist/$album%aunique{}/$track $title"; }; inherit plugins; @@ -90,8 +101,6 @@ in { }; }; - xdg.configFile."beets/replace_override.yaml".source = ./replace_override.yaml; - # Use the json formatter instead of the YAML one, as the YAML formatter mangles the # longer python inline strings. # YAML is a superset of JSON. diff --git a/modules/home.legacy/conf/beets/plugins.nix b/modules/home.legacy/conf/beets/plugins.nix index bea2fefe..a3abb580 100644 --- a/modules/home.legacy/conf/beets/plugins.nix +++ b/modules/home.legacy/conf/beets/plugins.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: # NOTE: This list is here and not split over the various plugin dirs, as we need a way to # specify the order plugins are loaded in. <2024-08-11> @@ -8,11 +17,8 @@ # <2024-08-07> # "scrub" - # Help submitting stuff to music brainz - "mbsubmit" - # Extract things from the music file - "xtractor" + # "xtractor" # Calculate replay gain "replaygain" @@ -20,12 +26,6 @@ # Check for bad files "badfiles" - # Alows to use inline python for parsing tags - "inline" - - # Support player integration - "play" - # Show tags on files/queries "info" @@ -38,9 +38,6 @@ # Warn, when importing a matching item "ihate" - # Allow fuzzy searching - "fuzzy" - # Filter out duplicates "duplicates" @@ -50,9 +47,6 @@ # Download album art "fetchart" - # Fetches tags from `last.fm` and adds them as genres to imported music - "lastgenre" - # Run commands on events "hook" diff --git a/modules/home.legacy/conf/beets/plugins/badfiles/default.nix b/modules/home.legacy/conf/beets/plugins/badfiles/default.nix index 33884785..505ecb5b 100644 --- a/modules/home.legacy/conf/beets/plugins/badfiles/default.nix +++ b/modules/home.legacy/conf/beets/plugins/badfiles/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, pkgs, diff --git a/modules/home.legacy/conf/beets/plugins/default.nix b/modules/home.legacy/conf/beets/plugins/default.nix index 3bea5ea8..ddba95e0 100644 --- a/modules/home.legacy/conf/beets/plugins/default.nix +++ b/modules/home.legacy/conf/beets/plugins/default.nix @@ -1,16 +1,20 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ ./badfiles ./duplicates - ./fuzzy ./ihate - ./inline - ./lastgenre ./lyrics - ./mbsubmit - ./play ./replaygain ./smartplaylist - ./xtractor + # ./xtractor ]; } diff --git a/modules/home.legacy/conf/beets/plugins/duplicates/default.nix b/modules/home.legacy/conf/beets/plugins/duplicates/default.nix index c8a6c108..6ab08d55 100644 --- a/modules/home.legacy/conf/beets/plugins/duplicates/default.nix +++ b/modules/home.legacy/conf/beets/plugins/duplicates/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { programs.beets.settings.duplicates = { keys = ["acoustid_fingerprint"]; diff --git a/modules/home.legacy/conf/beets/plugins/fuzzy/default.nix b/modules/home.legacy/conf/beets/plugins/fuzzy/default.nix deleted file mode 100644 index b86b3a20..00000000 --- a/modules/home.legacy/conf/beets/plugins/fuzzy/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - programs.beets.settings.fuzzy = { - # The prefix denoting that a search should be run in fuzzy mode - prefix = "."; - }; -} diff --git a/modules/home.legacy/conf/beets/plugins/ihate/default.nix b/modules/home.legacy/conf/beets/plugins/ihate/default.nix index 145f5f8b..51cb6f11 100644 --- a/modules/home.legacy/conf/beets/plugins/ihate/default.nix +++ b/modules/home.legacy/conf/beets/plugins/ihate/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { programs.beets.settings.ihate = { warn = [ diff --git a/modules/home.legacy/conf/beets/plugins/inline/default.nix b/modules/home.legacy/conf/beets/plugins/inline/default.nix deleted file mode 100644 index 0dda8cfc..00000000 --- a/modules/home.legacy/conf/beets/plugins/inline/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{...}: { - programs.beets.settings = { - item_fields = { - # Taken from https://github.com/trapd00r/configs/blob/4f3dada5700846cca6c2869e6fa6b3c795b87b67/beets/config.yaml - first_artist = - /* - python - */ - '' - # import an album to another artists directory, like: - # Tom Jones │1999│ Burning Down the House [Single, CD, FLAC] - # to The Cardigans/+singles/Tom Jones & the Cardigans │1999│ Burning Down the House [Single, CD, FLAC] - # https://github.com/beetbox/beets/discussions/4012#discussioncomment-1021414 - # beet import --set myartist='The Cardigans' - # we must first check to see if myartist is defined, that is, given on - # import time, or we raise an NameError exception. - try: - myartist - except NameError: - import re - return re.split(',|\\s+(feat(.?|uring)|&|(Vs|Ft).)', albumartist, 1, flags=re.IGNORECASE)[0] - else: - return myartist - ''; - - first_artist_singleton = - /* - python - */ - '' - try: - myartist - except NameError: - import re - return re.split(',|\\s+(feat(.?|uring)|&|(Vs|Ft).)', artist, 1, flags=re.IGNORECASE)[0] - else: - return myartist - ''; - }; - album_fields = {}; - }; -} diff --git a/modules/home.legacy/conf/beets/plugins/lastgenre/default.nix b/modules/home.legacy/conf/beets/plugins/lastgenre/default.nix deleted file mode 100644 index d10ca49f..00000000 --- a/modules/home.legacy/conf/beets/plugins/lastgenre/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.beets.settings.lastgenre = { - prefer_specific = false; - # Lookup the track, not the album - source = "track"; - }; -} diff --git a/modules/home.legacy/conf/beets/plugins/lyrics/default.nix b/modules/home.legacy/conf/beets/plugins/lyrics/default.nix index 80544aea..4d566f0b 100644 --- a/modules/home.legacy/conf/beets/plugins/lyrics/default.nix +++ b/modules/home.legacy/conf/beets/plugins/lyrics/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { programs.beets.settings.lyrics = { # Always fetch lyrics (and update them, if some were found) diff --git a/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix b/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix index b70f1c63..e69de29b 100644 --- a/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix +++ b/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix @@ -1,9 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.beets.settings.mbsubmit = { - picard_path = lib.getExe pkgs.picard; - }; -} diff --git a/modules/home.legacy/conf/beets/plugins/play/default.nix b/modules/home.legacy/conf/beets/plugins/play/default.nix deleted file mode 100644 index 635848c0..00000000 --- a/modules/home.legacy/conf/beets/plugins/play/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - lib, - pkgs, - config, - ... -}: { - programs.beets.settings.play = { - command = "${lib.getExe pkgs.mpc} $args add"; - relative_to = config.services.mpd.musicDirectory; - - # Run the command with the returned paths as arguments - raw = true; - }; -} diff --git a/modules/home.legacy/conf/beets/plugins/replaygain/default.nix b/modules/home.legacy/conf/beets/plugins/replaygain/default.nix index 611f3799..dd176541 100644 --- a/modules/home.legacy/conf/beets/plugins/replaygain/default.nix +++ b/modules/home.legacy/conf/beets/plugins/replaygain/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { programs.beets.settings = { replaygain = { diff --git a/modules/home.legacy/conf/beets/plugins/smartplaylist/default.nix b/modules/home.legacy/conf/beets/plugins/smartplaylist/default.nix index b55c487c..9b52c1ad 100644 --- a/modules/home.legacy/conf/beets/plugins/smartplaylist/default.nix +++ b/modules/home.legacy/conf/beets/plugins/smartplaylist/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {config, ...}: { programs.beets.settings.smartplaylist = { relative_to = config.services.mpd.musicDirectory; diff --git a/modules/home.legacy/conf/beets/plugins/xtractor/default.nix b/modules/home.legacy/conf/beets/plugins/xtractor/default.nix index d4582c5f..0a54385e 100644 --- a/modules/home.legacy/conf/beets/plugins/xtractor/default.nix +++ b/modules/home.legacy/conf/beets/plugins/xtractor/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, pkgs, diff --git a/modules/home.legacy/conf/beets/replace_override.yaml b/modules/home.legacy/conf/beets/replace_override.yaml deleted file mode 100644 index 23d6ea55..00000000 --- a/modules/home.legacy/conf/beets/replace_override.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -replace: - '[\\/]': _ - '^\.': _ - '[\x00-\x1f]': _ - '[<>:"\?\*\|]': _ - '\.$': _ - '\s+$': '' - '^\s+': '' - '^-': _ diff --git a/modules/home.legacy/conf/btop/default.nix b/modules/home.legacy/conf/btop/default.nix index 06b56ea7..ee835b65 100644 --- a/modules/home.legacy/conf/btop/default.nix +++ b/modules/home.legacy/conf/btop/default.nix @@ -1,4 +1,13 @@ -{config, ...}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { programs.btop = { enable = true; }; diff --git a/modules/home.legacy/conf/dconf/default.nix b/modules/home.legacy/conf/dconf/default.nix index dc439e1e..7aaf03a7 100644 --- a/modules/home.legacy/conf/dconf/default.nix +++ b/modules/home.legacy/conf/dconf/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { # Also see: https://github.com/gvolpe/dconf2nix dconf.settings = { diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index 328f4dab..622f32d5 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -1,13 +1,19 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ ./alacritty ./beets ./btop ./dconf - ./direnv - ./firefox ./gammastep - ./gpg ./gtk ./himalaya ./hyfetch @@ -15,25 +21,16 @@ ./keepassxc ./latexindent ./mail - ./mako ./mbsync - ./mpv ./mumble ./neomutt - ./nix-index ./npm ./prusa_slicer ./python ./rclone ./rofi - ./ssh ./starship ./swayidle - ./swaylock - ./taskwarrior - ./timewarrior ./tridactyl - ./xdg - ./ytcc ]; } diff --git a/modules/home.legacy/conf/direnv/default.nix b/modules/home.legacy/conf/direnv/default.nix deleted file mode 100644 index 3a7b8add..00000000 --- a/modules/home.legacy/conf/direnv/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; -} diff --git a/modules/home.legacy/conf/firefox/config/bookmarks/default.nix b/modules/home.legacy/conf/firefox/config/bookmarks/default.nix deleted file mode 100644 index c612bf4d..00000000 --- a/modules/home.legacy/conf/firefox/config/bookmarks/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - lib, - pkgs, - ... -}: let - bookmarks = [ - { - name = "Feed - Piped"; - url = "https://piped.video/feed"; - } - - { - name = "DeepL Translate"; - url = "https://www.deepl.com/translator"; - } - - { - name = "Nix lib"; - url = "https://teu5us.github.io/nix-lib.html"; - } - - { - name = "Nixpkgs manual"; - url = "https://ryantm.github.io/nixpkgs/"; - } - ]; - - mkBookmarksFile = (import ./lib.nix) {inherit lib pkgs;}; - bookmarks_file = mkBookmarksFile bookmarks; -in - bookmarks_file diff --git a/modules/home.legacy/conf/firefox/config/bookmarks/lib.nix b/modules/home.legacy/conf/firefox/config/bookmarks/lib.nix deleted file mode 100644 index d1d89dd2..00000000 --- a/modules/home.legacy/conf/firefox/config/bookmarks/lib.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - lib, - pkgs, -}: bookmarks: let - indent = level: - lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); - - bookmarkToHTML = indentLevel: bookmark: '' - ${indent indentLevel}<DT><A HREF="${ - lib.escapeXML bookmark.url - }" ADD_DATE="0" LAST_MODIFIED="0">${lib.escapeXML bookmark.name}</A>''; - - directoryToHTML = indentLevel: directory: '' - ${indent indentLevel}<DT>${ - if directory.toolbar - then ''<H3 PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar'' - else "<H3>${lib.escapeXML directory.name}" - }</H3> - ${indent indentLevel}<DL><p> - ${allItemsToHTML (indentLevel + 1) directory.bookmarks} - ${indent indentLevel}</p></DL>''; - - itemToHTMLOrRecurse = indentLevel: item: - if item ? "url" - then bookmarkToHTML indentLevel item - else directoryToHTML indentLevel item; - - allItemsToHTML = indentLevel: bookmarks: - lib.concatStringsSep "\n" - (map (itemToHTMLOrRecurse indentLevel) bookmarks); - - bookmarkEntries = allItemsToHTML 1 bookmarks; -in - pkgs.writeText "firefox-bookmarks.html" '' - <!DOCTYPE NETSCAPE-Bookmark-file-1> - <!-- This is an automatically generated file. - It will be read and overwritten. - DO NOT EDIT! --> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> - <TITLE>Bookmarks</TITLE> - <H1>Bookmarks Menu</H1> - - <DL><p> - <DT><H3 ADD_DATE="0" LAST_MODIFIED="0" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar</H3> - <DL><p> - ${bookmarkEntries} - </DL><p> - </p></DL> - '' diff --git a/modules/home.legacy/conf/firefox/config/chrome/userChrome.css b/modules/home.legacy/conf/firefox/config/chrome/userChrome.css deleted file mode 100644 index 0b3aff77..00000000 --- a/modules/home.legacy/conf/firefox/config/chrome/userChrome.css +++ /dev/null @@ -1,41 +0,0 @@ -/* thickness of tab when you have too many open tabs */ -.tabbrowser-tab:not([pinned="true"]) { - min-width: 10px !important; - min-height: 10px !important; -} - -/* tab height -#TabsToolbar .tabbrowser-tabs { -min-height: 10px !important; -} -*/ - -/* -.tabbrowser-tab {min-width: 016px !important;} -.tabbrowser-tab {clip-width: 016px !important;} -*/ - -/* the + button that opens new tabs */ -#TabsToolbar .tabs-newtab-button { - margin-left: 10px !important; - height: Auto !important; -} - -#main-window[privatebrowsingmode="temporary"] #navigator-toolbox { - background-color: #c40944 !important; -} - -/* close button inside a tab */ -.tab-close-button * { - width: 10px !important; - height: 10px !important; -} - -/* bookmark toolbar */ -#personal-bookmarks .bookmark-item > .toolbarbutton-text { - font-size: 10pt !important; -} -#personal-bookmarks .bookmark-item > .toolbarbutton-icon { - height: 12px !important; - width: 12px !important; -} diff --git a/modules/home.legacy/conf/firefox/config/extensions/extensions.json b/modules/home.legacy/conf/firefox/config/extensions/extensions.json deleted file mode 100644 index 0c318236..00000000 --- a/modules/home.legacy/conf/firefox/config/extensions/extensions.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "darkreader": { - "addonId": "addon@darkreader.org", - "default_area": "navbar", - "pname": "darkreader", - "sha256": "sha256:02c67ce2b3cd96719b5e369b9207ef11ed6c3a79eccb454d1e6ec3e005004e72", - "url": "https://addons.mozilla.org/firefox/downloads/file/4405074/darkreader-4.9.99.xpi", - "version": "4.9.99" - }, - "keepassxc-browser": { - "addonId": "keepassxc-browser@keepassxc.org", - "default_area": "navbar", - "pname": "keepassxc-browser", - "sha256": "sha256:41cab3f7a1bdcc394d538ffd4106b85fe5916cc44735a61f1791bb6fe8ce790e", - "url": "https://addons.mozilla.org/firefox/downloads/file/4410175/keepassxc_browser-1.9.6.xpi", - "version": "1.9.6" - }, - "torproject-snowflake": { - "addonId": "{b11bea1f-a888-4332-8d8a-cec2be7d24b9}", - "default_area": "navbar", - "pname": "torproject-snowflake", - "sha256": "sha256:4028bad3bef6610a985edda954d5c4f1487480a8f32f230d9edf88d97c8dd88e", - "url": "https://addons.mozilla.org/firefox/downloads/file/4379590/torproject_snowflake-0.9.2.xpi", - "version": "0.9.2" - }, - "tridactyl-vim": { - "addonId": "tridactyl.vim@cmcaine.co.uk", - "default_area": "menupanel", - "pname": "tridactyl-vim", - "sha256": "sha256:807925f26aab56ab19a28e663ade73743a033e3b77aa09edd3f77bf92e5fb36e", - "url": "https://addons.mozilla.org/firefox/downloads/file/4405615/tridactyl_vim-1.24.2.xpi", - "version": "1.24.2" - }, - "ublock-origin": { - "addonId": "uBlock0@raymondhill.net", - "default_area": "menupanel", - "pname": "ublock-origin", - "sha256": "sha256:8a9e02aa838c302fb14e2b5bc88a6036d36358aadd6f95168a145af2018ef1a3", - "url": "https://addons.mozilla.org/firefox/downloads/file/4412673/ublock_origin-1.62.0.xpi", - "version": "1.62.0" - }, - "vhack-libredirect": { - "addonId": "vhack-libredirect@addons.vhack.eu", - "default_area": "navbar", - "pname": "vhack-libredirect", - "sha256": "sha256:08ccfd4b32ba15b357252208da7f383099ed5aefb9e92ffb5b9ae33f9146caf6", - "url": "https://addons.mozilla.org/firefox/downloads/file/4427811/vhack_libredirect-3.0.2.xpi", - "version": "3.0.2" - } -} diff --git a/modules/home.legacy/conf/firefox/config/extensions/native_messaging_hosts/default.nix b/modules/home.legacy/conf/firefox/config/extensions/native_messaging_hosts/default.nix deleted file mode 100644 index 9aaa1682..00000000 --- a/modules/home.legacy/conf/firefox/config/extensions/native_messaging_hosts/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: -/* -++ lib.optional (cfg.enableBrowserpass or false) (lib.getBin browserpass) -++ lib.optional (cfg.enableBukubrow or false) bukubrow -++ lib.optional (cfg.enableTridactylNative or false) tridactyl-native -++ lib.optional (cfg.enableGnomeExtensions or false) gnome-browser-connector -++ lib.optional (cfg.enableUgetIntegrator or false) uget-integrator -++ lib.optional (cfg.enablePlasmaBrowserIntegration or false) plasma5Packages.plasma-browser-integration -++ lib.optional (cfg.enableFXCastBridge or false) fx-cast-bridge -++ lib.optional (cfg.enableKeePassXC or false) keepassxc -*/ -with pkgs; [ - tridactyl-native - keepassxc -] diff --git a/modules/home.legacy/conf/firefox/config/policies/default.nix b/modules/home.legacy/conf/firefox/config/policies/default.nix deleted file mode 100644 index 02c740f6..00000000 --- a/modules/home.legacy/conf/firefox/config/policies/default.nix +++ /dev/null @@ -1,146 +0,0 @@ -{ - config, - extensions, - ... -}: let - locals = [ - "en-CA" - "de" - "sv-SE" - ]; - mkAllowedExtension = extension: { - name = extension.addonId; - value = { - installation_mode = "normal_installed"; - updates_disabled = true; - inherit (extension) default_area; - install_url = "file://${builtins.fetchurl { - inherit - (extension) - url - sha256 - ; - }}"; - }; - }; - allowedExtensions = - builtins.listToAttrs - (builtins.map mkAllowedExtension (builtins.attrValues - extensions)); - - mkBlockedExtension = id: { - name = id; - value = { - install_mode = "blocked"; - }; - }; - blockedExtensions = builtins.listToAttrs (builtins.map mkBlockedExtension [ - # these are the default search engines - "addons-search-detection@mozilla.com" - "amazon@search.mozilla.org" - "bing@search.mozilla.org" - "ddg@search.mozilla.org" - "google@search.mozilla.org" - "wikipedia@search.mozilla.org" - ]); - - language_packs = builtins.listToAttrs (builtins.map - ( - lang: { - name = "langpack-${lang}@firefox.mozilla.org"; - value = { - installation_mode = "normal_installed"; - updates_disabled = true; - install_url = "https://releases.mozilla.org/pub/firefox/releases/${config.soispha.firefox.package_version}/linux-x86_64/xpi/${lang}.xpi"; - }; - } - ) - locals); -in { - # NOTE: See https://mozilla.github.io/policy-templates for documentation <2023-10-21> - policies = { - # NixOS manages this already - DisableAppUpdate = true; - - DisableFirefoxAccounts = true; - DisableFirefoxScreenshots = true; - - # KeepassXC does this for me - DisableMasterPasswordCreation = true; - - # I use a self-hosted services for that - DisablePocket = true; - - # I don't want to lose my data - DisableProfileRefresh = true; - - DisableDeveloperTools = false; - - DisplayBookmarksToolbar = "newtab"; - DisplayMenuBar = "default-off"; - - DNSOverHTTPS = { - Enabled = true; - Locked = false; - }; - # The concept of a "default browser" does not apply to my NixOS config - DontCheckDefaultBrowser = true; - - EnableTrackingProtection = { - Value = true; - Locked = false; - Cryptomining = true; - Fingerprinting = true; - EmailTracking = true; - }; - - EncryptedMediaExtensions = { - # I want a _free_ config (and I can always just run another browser) - Enabled = false; - Locked = true; - }; - - ExtensionSettings = - { - "*" = { - # Blocking the extension install here, also blocks the 'about:debugging' page - - # blocked_install_message = '' - # You can't install a extension manually, - # please specify it in your NixOS configuration - # ''; - installation_mode = "allowed"; - }; - } - // allowedExtensions - // blockedExtensions - // language_packs; - - ExtensionUpdate = false; - - # TODO: Add handlers for the default file types <2023-10-21> - # Handlers = { - # }; - - HardwareAcceleration = true; - - # Blocking the extension install here, also blocks the 'about:debugging' page - # InstallAddonsPermission = { - # Allowed = []; - # Default = false; - # }; - - # KeepassXC and such things - OfferToSaveLogins = false; - PasswordManagerEnabled = false; - - PDFjs = { - Enabled = true; - # Don't honor documents right to be un-copy-able - EnablePermissions = false; - }; - - SearchBar = "unified"; - RequestedLocales = locals; - }; -} diff --git a/modules/home.legacy/conf/firefox/config/prefs/default.nix b/modules/home.legacy/conf/firefox/config/prefs/default.nix deleted file mode 100644 index 80c6d274..00000000 --- a/modules/home.legacy/conf/firefox/config/prefs/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - pkgs, - config, - user_js, - bookmarks, - ... -}: let - user_js_override = pkgs.writeText "user.override.js" (builtins.readFile ./override.js); -in - pkgs.runCommand "user.js" {} '' - mkdir $out; - cat "${user_js}/user.js" > $out/user.js; - cat "${user_js_override}" >> $out/user.js; - - cat << EOF >> $out/user.js; - // My bookmarks - user_pref("browser.bookmarks.file", "${toString bookmarks}"); - user_pref("browser.startup.homepage", "file:///home/dt/home.html"); // 0103 // TODO: add this from a flake - user_pref("browser.download.dir", "${config.xdg.userDirs.download}"); - EOF - '' diff --git a/modules/home.legacy/conf/firefox/config/prefs/override.js b/modules/home.legacy/conf/firefox/config/prefs/override.js deleted file mode 100644 index bf874b33..00000000 --- a/modules/home.legacy/conf/firefox/config/prefs/override.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - 0100: STARTUP - 0200: GEOLOCATION / LANGUAGE / LOCALE - 0300: QUIETER FOX - 0400: SAFE BROWSING - 0600: BLOCK IMPLICIT OUTBOUND - 0700: DNS / DoH / PROXY / SOCKS / IPv6 - 0800: LOCATION BAR / SEARCH BAR / SUGGESTIONS / HISTORY / FORMS - 0900: PASSWORDS - 1000: DISK AVOIDANCE - 1200: HTTPS (SSL/TLS / OCSP / CERTS / HPKP) - 1400: FONTS - 1600: HEADERS / REFERERS - 1700: CONTAINERS - 2000: PLUGINS / MEDIA / WEBRTC - 2400: DOM (DOCUMENT OBJECT MODEL) - 2600: MISCELLANEOUS - 2700: ETP (ENHANCED TRACKING PROTECTION) - 2800: SHUTDOWN & SANITIZING - 4500: RFP (RESIST FINGERPRINTING) - 5000: OPTIONAL OPSEC - 5500: OPTIONAL HARDENING - 6000: DON'T TOUCH - 7000: DON'T BOTHER - 8000: DON'T BOTHER: FINGERPRINTING - 9000: NON-PROJECT RELATED - 9999: DEPRECATED / REMOVED / LEGACY / RENAMED -*/ - - -// restore session -user_pref("browser.startup.page", 3); // 0102 - -user_pref("browser.newtabpage.enabled", true); // 0104 - -// disable the geoservice, TODO: don't know if I want this -//user_pref("geo.provider.use_geoclue", false); // 0202 - -// TODO: is this something useful? -user_pref("datareporting.policy.dataSubmissionEnabled", true); // 0330 - -// enable health reports -user_pref("datareporting.healthreport.uploadEnabled", true); // 0331 - -// Do I want to opt-out? -user_pref("toolkit.telemetry.coverage.opt-out", false); // 0333 - -// enables studies -user_pref("app.shield.optoutstudies.enabled", true); // 0340 - -// I guess that browsing protection is useful -user_pref("browser.safebrowsing.downloads.remote.enabled", true); // 0403 - -// TODO: does this (-> set to false) make things slower? -user_pref("network.prefetch-next", true); // 0601 - -// enable ipv6 because the rest of the system uses it -user_pref("network.dns.disableIPv6", false); // 0701 - -// TRR only -user_pref("network.trr.mode", 3); // 0710 - -// I trust my search engine -user_pref("keyword.enabled", true); // 801 -user_pref("browser.search.suggest.enabled", true); // 0804 -user_pref("browser.urlbar.suggest.searches", true); // 0804 -// TODO: no idea what this does, enabling it -user_pref("browser.urlbar.showSearchTerms.enabled", true); // 9004 - -// prefetch urls, if the get auto completed -user_pref("browser.urlbar.speculativeConnect.enabled", true); // 0805 - -// Disable autoScrolling (clicking with the mouse wheel) -user_pref("general.autoScroll", false); - -// add new tabs after the current one -user_pref("browser.tabs.insertAfterCurrent", true); - -// TODO: I might want to enable this -//user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); // 0807 - -// TODO: enable form and search history? -//user_pref("browser.formfill.enable", false); // 0810 - -// disk cache should help performance -user_pref("browser.cache.disk.enable", true); // 1001 - -// store extra session data (form content, cookies and POST data) 0: everywhere -user_pref("browser.sessionstore.privacy_level", 0); // 1003 - -// Disable unsafe passive content (images) on https sites -user_pref("security.mixed_content.block_display_content", true); // 1241 - -// Disable the eme banner -user_pref("browser.eme.ui.enabled", false); // 2022 - -// Don't delete my precious temp files -user_pref("browser.helperApps.deleteTempFileOnExit", false); // 2603 - -// Download to the download dir -user_pref("browser.download.useDownloadDir", true); // 2651 - -// Open the download panel -user_pref("browser.download.alwaysOpenPanel", true); // 2652 - -// Block after custom ruleset -user_pref("browser.contentblocking.category", "custom"); // 2701 - -// set the custom settings // 7016 -user_pref("network.cookie.cookieBehavior", 1); -user_pref("network.http.referer.disallowCrossSiteRelaxingDefault", true); -user_pref("network.http.referer.disallowCrossSiteRelaxingDefault.top_navigation", true); -user_pref("privacy.partition.network_state.ocsp_cache", true); -user_pref("privacy.query_stripping.enabled", true); -user_pref("privacy.trackingprotection.enabled", true); -user_pref("privacy.trackingprotection.socialtracking.enabled", true); -user_pref("privacy.trackingprotection.cryptomining.enabled", true); -user_pref("privacy.trackingprotection.fingerprinting.enabled", true); - - -// I might want to change that, when it hinders session restore -//user_pref("privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage", false); // 2720 - -// I like my history very much! -user_pref("privacy.sanitize.sanitizeOnShutdown", false); // 2810 - -// The downsides (light theme + potential breakages): -//user_pref("privacy.resistFingerprinting", true); // 4501 -user_pref("privacy.resistFingerprinting.letterboxing", false); // 4504 - -// I would like to keep my gl, even in the web -user_pref("webgl.disabled", false); // 4520 - -// I like my service workers and am using a service using them. -user_pref("dom.serviceWorkers.enabled", true); // 7017 - -// I've got a password manager already -user_pref("signon.rememberSignons", false); // 5003 - -// Do not track header -user_pref("privacy.donottrackheader.enabled", true); // 7015 - -// Allow my custom css -user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); - -// might improve performance TODO: -user_pref("gfx.webrender.all", true); - -// disable updates (pretty pointless with nix) -user_pref("extensions.update.autoUpdateDefault", false); -user_pref("extensions.update.enabled", false); -user_pref("app.update.channel", "default"); - -user_pref("browser.ctrlTab.recentlyUsedOrder", false); - -user_pref("browser.download.useDownloadDir", true); -user_pref("browser.download.folderList", 2); // TODO: -user_pref("browser.download.viewableInternally.typeWasRegistered.svg", true); -user_pref("browser.download.viewableInternally.typeWasRegistered.webp", true); -user_pref("browser.download.viewableInternally.typeWasRegistered.xml", true); - -// TODO: what does this do? -user_pref("browser.search.widget.inNavBar", true); - -user_pref("browser.shell.checkDefaultBrowser", false); -user_pref("browser.tabs.loadInBackground", true); -user_pref("browser.urlbar.placeholderName", "Brave"); - -// Set the tabs and bookmarks -user_pref("browser.tabs.inTitlebar", 1); -user_pref("browser.toolbars.bookmarks.visibility", "always"); -user_pref("browser.places.importBookmarksHTML", true); - -// Theme -user_pref("extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); -user_pref("extensions.extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); - -// highlight all entries when searching -user_pref("findbar.highlightAll", true); - -// Set the default position for the developer toolbox -user_pref("devtools,toolbox.host", "right"); -user_pref("devtools,toolsidebar-width.inspector", 700); - -// Don't bother me with translations -user_pref("browser.translations.automaticallyPopup", true); -user_pref("browser.translations.neverTranslateLanguages", "de"); - -// Put all downloads into the downloads directory -user_pref("browser.download.start_downloads_in_tmp_dir", false); - -// TODO: -//user_pref("extensions.webcompat.enable_picture_in_picture_overrides", true); -//user_pref("extensions.webcompat.enable_shims", true); -//user_pref("extensions.webcompat.perform_injections", true); -//user_pref("extensions.webcompat.perform_ua_overrides", true); - -// onlykey / copied from a yubikey config -//user_pref("security.webauth.u2f", true); -//user_pref("security.webauth.webauthn", true); -//user_pref("security.webauth.webauthn_enable_softtoken", true); -//user_pref("security.webauth.webauthn_enable_usbtoken", true); diff --git a/modules/home.legacy/conf/firefox/config/search/engines/default.nix b/modules/home.legacy/conf/firefox/config/search/engines/default.nix deleted file mode 100644 index a47c77df..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/default.nix +++ /dev/null @@ -1,84 +0,0 @@ -{pkgs, ...}: { - # DEFAULT - "Brave Search" = { - urls = [{template = "https://search.brave.com/search?q={searchTerms}";}]; - icon = ./logos/brave.svg; - definedAliases = ["@bs"]; - }; - - # NIX - "Nix Packages" = { - urls = [{template = "https://search.nixos.org/packages?type=packages&query={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@np"]; - }; - - "NixOS Options" = { - urls = [{template = "https://search.nixos.org/options?type=options&query={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@no"]; - }; - "HomeManager Options" = { - urls = [{template = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nh"]; - }; - - "Nixpkgs issues" = { - urls = [{template = "https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+{searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@ni"]; - }; - "Nixpkgs pull requests" = { - urls = [{template = "https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+{searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nr"]; - }; - - "Nixpkgs pull requests tracker" = { - urls = [{template = "https://nixpk.gs/pr-tracker.html?pr={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nt"]; - }; - "NixOS Wiki" = { - urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nw"]; - }; - - # RUST - "Rust std" = { - urls = [{template = "https://doc.rust-lang.org/std/?search={searchTerms}";}]; - icon = ./logos/rust_std.svg; - definedAliases = ["@rs"]; - }; - "Rust tokio" = { - urls = [{template = "https://docs.rs/tokio/latest/tokio/index.html?search={searchTerms}";}]; - icon = ./logos/rust_tokio.png; - definedAliases = ["@rt"]; - }; - - # OTHER - "Google Scholar" = { - urls = [{template = "https://scholar.google.com/scholar?hl=en&q={searchTerms}";}]; - icon = ./logos/google_scholar.ico; - definedAliases = ["@gs"]; - }; - "Wikipedia" = { - urls = [{template = "https://en.wikipedia.org/wiki/{searchTerms}";}]; - icon = ./logos/wikipedia.svg; - definedAliases = ["@wp"]; - }; - "Arch Wiki" = { - urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; - icon = ./logos/arch_linux.svg; - definedAliases = ["@aw"]; - }; - - "Wikipedia (en)".metaData.hidden = true; - "DuckDuckGo".metaData.hidden = true; - "Bing".metaData.hidden = true; - "Google".metaData.hidden = true; - "Amazon.de".metaData.hidden = true; - "eBay".metaData.hidden = true; -} diff --git a/modules/home.legacy/conf/firefox/config/search/engines/logos/arch_linux.svg b/modules/home.legacy/conf/firefox/config/search/engines/logos/arch_linux.svg deleted file mode 100644 index 949b5c5f..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/logos/arch_linux.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><path d="M31.994-.006c-2.85 6.985-4.568 11.554-7.74 18.332 1.945 2.062 4.332 4.462 8.2 7.174-4.168-1.715-7-3.437-9.136-5.224-4.06 8.47-10.42 20.538-23.327 43.73C10.145 58.15 18 54.54 25.338 53.16c-.315-1.354-.494-2.818-.48-4.345l.012-.325c.16-6.5 3.542-11.498 7.547-11.158s7.118 5.886 6.957 12.386a18.36 18.36 0 0 1-.409 3.491c7.25 1.418 15.03 5.02 25.037 10.797l-5.42-10.026c-2.65-2.053-5.413-4.726-11.05-7.62 3.875 1.007 6.65 2.168 8.8 3.467-17.1-31.84-18.486-36.07-24.35-49.833z" fill="#1793d1" fill-rule="evenodd"/></svg> \ No newline at end of file diff --git a/modules/home.legacy/conf/firefox/config/search/engines/logos/brave.svg b/modules/home.legacy/conf/firefox/config/search/engines/logos/brave.svg deleted file mode 100644 index 09dd2e42..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/logos/brave.svg +++ /dev/null @@ -1,25 +0,0 @@ -<svg width='100' height='129' xmlns='http://www.w3.org/2000/svg'> - <style> - @keyframes bounce{to{transform:translateY(5%)}} - </style> - <defs> - <linearGradient x1='0%' y1='50.706%' y2='50.706%' id='a'> - <stop stop-color='#F50' offset='0%'/> - <stop stop-color='#FF2000' offset='100%'/> - </linearGradient> - <linearGradient x1='2.148%' y1='50.706%' y2='50.706%' id='b'> - <stop stop-color='#FA3F2E' offset='0%'/> - <stop stop-color='#FF2000' offset='46.132%'/> - <stop stop-color='#FF2000' offset='100%'/> - </linearGradient> - <linearGradient x1='50%' y1='100%' x2='96.767%' y2='100%' id='c'> - <stop stop-color='#FFF' offset='0%'/> - <stop stop-color='#F4F4F4' offset='100%'/> - </linearGradient> - </defs> - <g fill='none' fill-rule='evenodd' style='animation:bounce 1s infinite alternate ease-in-out'> - <path d='M99.914 37.337l-3.616-9.848 2.512-5.657a1.941 1.941 0 0 0-.391-2.148l-6.835-6.936a11.014 11.014 0 0 0-11.464-2.676l-1.91.665L68.226.014H31.524L21.67 10.876l-1.858-.656a11.04 11.04 0 0 0-11.574 2.7l-6.956 7.067a1.541 1.541 0 0 0-.309 1.711l2.625 5.872L0 37.413l2.329 8.875 10.605 40.45a20.6 20.6 0 0 0 7.949 11.545s12.876 9.11 25.583 17.384c1.117.729 2.286 1.26 3.54 1.241 1.254.017 2.422-.512 3.537-1.244 14.271-9.384 25.562-17.417 25.562-17.417a20.61 20.61 0 0 0 7.936-11.556l10.555-40.467 2.318-8.887z' fill='url(#a)'/> - <path d='M31.565.033l-9.73 10.987-.803-.554c-6.463-2.01-9.277-.647-13.447 3.23l-.923.996 5.093-.996c1.407 0 5.342.133 6.167.416 3.473 1.195 4.437 2.593 6.662 4.059l1.069.359 10.385 2.083a4.21 4.21 0 0 0 1.96-.096l4.879-1.602c4.416-1.711 9.227-1.79 14.238 0l4.786 1.622a4.645 4.645 0 0 0 2.272.14l.859-.162 10.493-2.344.17-.422.723-.583c4.463-3.249 8.017-4.822 14.867-4.152h.527l-.315-.424c-5.711-4.543-9.193-3.178-12.401-2.124l-.877.3L68.281.033H31.565z' fill='url(#b)'/> - <path d='M53.472 72.856l1.388.576c1.496.62 3.903 1.73 5.346 2.464l4.096 2.085c1.444.733 1.548 2.106.23 3.05l-3.493 2.505a73.241 73.241 0 0 0-4.602 3.644l-4.406 3.853c-1.21 1.059-3.17 1.064-4.356.014a605.63 605.63 0 0 0-4.368-3.823 71.635 71.635 0 0 0-4.614-3.612l-3.481-2.465c-1.324-.937-1.23-2.317.207-3.066l4.118-2.148a80.664 80.664 0 0 1 5.33-2.495l1.388-.579c1.495-.621 2.835-1.131 2.979-1.131h1.258c.142 0 1.484.506 2.98 1.128zm34.992-33.039l-.263.946c-.703.878-2.184 2.563-3.293 3.746L74.713 55.38c-1.11 1.182-1.735 2.665-1.102 4.159l1.375 3.399c.632 1.492.694 3.962.088 5.62a10.013 10.013 0 0 1-3.065 4.315l-1.064.87c-1.255 1.026-3.478 1.296-4.941.598l-4.696-2.234c-1.462-.695-3.643-2.153-4.848-3.24l-4.443-4.005a2.07 2.07 0 0 1-.109-2.968l10.82-7.32c1.342-.908 2.052-2.587 1.29-4.018l-3.847-7.02c-.763-1.432-1.068-3.334-.679-4.228.39-.894 1.948-2.095 3.464-2.67l12.559-4.68c1.514-.575 1.433-1.169-.179-1.32l-8.025-.6c-1.613-.151-2.796.084-4.355.52l-6.074 1.508c-1.56.436-1.89 2.1-1.597 3.695l2.506 13.626c.294 1.596.437 3.202.32 3.571-.118.37-1.506.964-3.086 1.323l-2.077.473c-1.58.359-4.167.375-5.75.038l-2.514-.537c-1.584-.339-2.976-.918-3.094-1.286-.118-.369.024-1.978.317-3.572l2.49-13.629c.292-1.595-.04-3.257-1.6-3.692l-6.076-1.5c-1.56-.436-2.743-.666-4.355-.514l-8.025.606c-1.613.153-1.692.747-.178 1.32l12.567 4.665c1.514.574 3.074 1.774 3.464 2.668.392.892.088 2.794-.672 4.227l-3.84 7.021c-.76 1.433-.048 3.112 1.295 4.018l10.83 7.31a2.07 2.07 0 0 1-.106 2.967l-4.439 4.012c-1.202 1.087-3.382 2.547-4.844 3.246l-4.693 2.24c-1.461.698-3.686.432-4.94-.592L27.72 72.9c-1.392-1.136-2.455-2.626-3.122-4.447-.558-1.524-.5-3.992.13-5.486l1.372-3.4c.63-1.494.003-2.977-1.108-4.158L14.786 44.552c-1.11-1.18-2.593-2.864-3.296-3.74l-.265-.947-.166-.527c-.015-.607.201-2.542.447-3.066.246-.521 1.189-2.049 2.096-3.393l2.184-3.239a91.717 91.717 0 0 1 3.484-4.75l3.201-4.023c1.01-1.268 1.87-2.3 2-2.292.006-.008 1.312.236 2.902.541l4.85.933c1.59.306 3.344.642 3.898.746.554.105 2.267-.218 3.809-.719l3.487-1.131c1.54-.502 3.879-1.162 5.195-1.468l1.219.018 1.22-.02c1.315.305 3.654.962 5.195 1.46l3.49 1.13c1.541.498 3.255.82 3.808.714.555-.105 2.308-.445 3.898-.753l4.848-.937c1.59-.308 2.897-.553 2.99-.545.042-.008.903 1.021 1.914 2.29l3.206 4.019a90.663 90.663 0 0 1 3.49 4.746l2.188 3.235c.909 1.342 2.328 3.786 2.416 4.342.09.556.15 1.507.136 2.114l-.166.527z' fill='url(#c)'/> - </g> -</svg> diff --git a/modules/home.legacy/conf/firefox/config/search/engines/logos/google_scholar.ico b/modules/home.legacy/conf/firefox/config/search/engines/logos/google_scholar.ico deleted file mode 100644 index 85d0c664..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/logos/google_scholar.ico +++ /dev/null Binary files differdiff --git a/modules/home.legacy/conf/firefox/config/search/engines/logos/rust_std.svg b/modules/home.legacy/conf/firefox/config/search/engines/logos/rust_std.svg deleted file mode 100644 index 0091b5a8..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/logos/rust_std.svg +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg width="100%" height="100%" viewBox="0 0 1200 800" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"> - <g id="Layer-1" serif:id="Layer 1"> - <g transform="matrix(1,0,0,1,597.344,637.02)"> - <path d="M0,-279.559C-121.238,-279.559 -231.39,-264.983 -312.939,-241.23L-312.939,-38.329C-231.39,-14.575 -121.238,0 0,0C138.76,0 262.987,-19.092 346.431,-49.186L346.431,-230.37C262.987,-260.465 138.76,-279.559 0,-279.559" style="fill:rgb(165,43,0);fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,1068.75,575.642)"> - <path d="M0,-53.32L-14.211,-82.761C-14.138,-83.879 -14.08,-84.998 -14.08,-86.121C-14.08,-119.496 -48.786,-150.256 -107.177,-174.883L-107.177,2.643C-79.932,-8.849 -57.829,-21.674 -42.021,-35.482C-46.673,-16.775 -62.585,21.071 -75.271,47.686C-96.121,85.752 -103.671,118.889 -102.703,120.53C-102.086,121.563 -94.973,110.59 -84.484,92.809C-60.074,58.028 -13.82,-8.373 -4.575,-25.287C5.897,-44.461 0,-53.32 0,-53.32" style="fill:rgb(165,43,0);fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,149.064,591.421)"> - <path d="M0,-99.954C0,-93.526 1.293,-87.194 3.788,-80.985L-4.723,-65.835C-4.723,-65.835 -11.541,-56.989 0.465,-38.327C11.055,-21.872 64.1,42.54 92.097,76.271C104.123,93.564 112.276,104.216 112.99,103.187C114.114,101.554 105.514,69.087 81.631,32.046C70.487,12.151 57.177,-14.206 49.189,-33.675C71.492,-19.559 100.672,-6.755 135.341,4.265L135.341,-204.17C51.797,-177.622 0,-140.737 0,-99.954" style="fill:rgb(165,43,0);fill-rule:nonzero;"/> - </g> - <g transform="matrix(-65.8097,-752.207,-752.207,65.8097,621.707,796.312)"> - <path d="M0.991,-0.034L0.933,0.008C0.933,0.014 0.933,0.02 0.933,0.026L0.99,0.069C0.996,0.073 0.999,0.08 0.998,0.087C0.997,0.094 0.992,0.1 0.986,0.103L0.92,0.133C0.919,0.139 0.918,0.145 0.916,0.15L0.964,0.203C0.968,0.208 0.97,0.216 0.968,0.222C0.965,0.229 0.96,0.234 0.953,0.236L0.882,0.254C0.88,0.259 0.877,0.264 0.875,0.27L0.91,0.33C0.914,0.336 0.914,0.344 0.91,0.35C0.907,0.356 0.9,0.36 0.893,0.361L0.82,0.365C0.817,0.369 0.813,0.374 0.81,0.379L0.832,0.445C0.835,0.452 0.833,0.459 0.828,0.465C0.824,0.47 0.816,0.473 0.809,0.472L0.737,0.462C0.733,0.466 0.729,0.47 0.724,0.474L0.733,0.544C0.734,0.551 0.731,0.558 0.725,0.562C0.719,0.566 0.711,0.568 0.704,0.565L0.636,0.542C0.631,0.546 0.626,0.549 0.621,0.552L0.615,0.621C0.615,0.629 0.61,0.635 0.604,0.638C0.597,0.641 0.589,0.641 0.583,0.638L0.521,0.602C0.52,0.603 0.519,0.603 0.518,0.603L0.406,0.729C0.406,0.729 0.394,0.747 0.359,0.725C0.329,0.705 0.206,0.599 0.141,0.543C0.109,0.52 0.089,0.504 0.09,0.502C0.093,0.499 0.149,0.509 0.217,0.554C0.278,0.588 0.371,0.631 0.38,0.619C0.38,0.619 0.396,0.604 0.406,0.575C0.406,0.575 0.406,0.575 0.406,0.575C0.407,0.576 0.407,0.576 0.406,0.575C0.406,0.575 0.091,0.024 0.305,-0.531C0.311,-0.593 0.275,-0.627 0.275,-0.627C0.266,-0.639 0.178,-0.598 0.12,-0.566C0.055,-0.523 0.002,-0.513 0,-0.516C-0.001,-0.518 0.018,-0.533 0.049,-0.555C0.11,-0.608 0.227,-0.707 0.256,-0.726C0.289,-0.748 0.301,-0.73 0.301,-0.73L0.402,-0.615C0.406,-0.614 0.41,-0.613 0.415,-0.613L0.47,-0.658C0.475,-0.663 0.483,-0.664 0.49,-0.662C0.497,-0.66 0.502,-0.655 0.504,-0.648L0.522,-0.58C0.527,-0.578 0.533,-0.576 0.538,-0.574L0.602,-0.608C0.608,-0.612 0.616,-0.612 0.623,-0.608C0.629,-0.605 0.633,-0.599 0.633,-0.592L0.637,-0.522C0.642,-0.519 0.647,-0.515 0.652,-0.512L0.721,-0.534C0.728,-0.536 0.736,-0.535 0.741,-0.531C0.747,-0.526 0.75,-0.519 0.749,-0.512L0.738,-0.443C0.742,-0.439 0.746,-0.435 0.751,-0.431L0.823,-0.439C0.83,-0.44 0.837,-0.437 0.842,-0.432C0.847,-0.426 0.848,-0.419 0.845,-0.412L0.821,-0.347C0.824,-0.342 0.828,-0.337 0.831,-0.332L0.903,-0.327C0.911,-0.327 0.917,-0.322 0.92,-0.316C0.924,-0.31 0.924,-0.302 0.92,-0.296L0.883,-0.236C0.885,-0.231 0.887,-0.226 0.889,-0.22L0.959,-0.202C0.966,-0.2 0.972,-0.195 0.974,-0.188C0.976,-0.181 0.974,-0.174 0.969,-0.168L0.92,-0.116C0.921,-0.111 0.923,-0.105 0.924,-0.099L0.988,-0.068C0.995,-0.065 0.999,-0.059 1,-0.052C1.001,-0.045 0.997,-0.038 0.991,-0.034ZM0.406,0.575C0.406,0.575 0.406,0.575 0.406,0.575C0.406,0.575 0.406,0.575 0.406,0.575Z" style="fill:url(#_Linear1);fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,450.328,483.629)"> - <path d="M0,167.33C-1.664,165.91 -2.536,165.068 -2.536,165.068L140.006,153.391C23.733,0 -69.418,122.193 -79.333,135.855L-79.333,167.33L0,167.33Z" style="fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,747.12,477.333)"> - <path d="M0,171.974C1.663,170.554 2.536,169.71 2.536,169.71L-134.448,159.687C-18.12,0 69.421,126.835 79.335,140.497L79.335,171.974L0,171.974Z" style="fill-rule:nonzero;"/> - </g> - <g transform="matrix(-1.53e-05,-267.211,-267.211,1.53e-05,809.465,764.23)"> - <path d="M1,-0.586C1,-0.586 0.768,-0.528 0.524,-0.165L0.5,-0.064C0.5,-0.064 1.1,0.265 0.424,0.731C0.424,0.731 0.508,0.586 0.405,0.197C0.405,0.197 0.131,0.376 0.14,0.736C0.14,0.736 -0.275,0.391 0.324,-0.135C0.324,-0.135 0.539,-0.691 1,-0.736L1,-0.586Z" style="fill:url(#_Linear2);fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,677.392,509.61)"> - <path d="M0,-92.063C0,-92.063 43.486,-139.678 86.974,-92.063C86.974,-92.063 121.144,-28.571 86.974,3.171C86.974,3.171 31.062,47.615 0,3.171C0,3.171 -37.275,-31.75 0,-92.063" style="fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,727.738,435.209)"> - <path d="M0,0.002C0,18.543 -10.93,33.574 -24.408,33.574C-37.885,33.574 -48.814,18.543 -48.814,0.002C-48.814,-18.539 -37.885,-33.572 -24.408,-33.572C-10.93,-33.572 0,-18.539 0,0.002" style="fill:white;fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,483.3,502.984)"> - <path d="M0,-98.439C0,-98.439 74.596,-131.467 94.956,-57.748C94.956,-57.748 116.283,28.178 33.697,33.028C33.697,33.028 -71.613,12.745 0,-98.439" style="fill-rule:nonzero;"/> - </g> - <g transform="matrix(1,0,0,1,520.766,436.428)"> - <path d="M0,0C0,19.119 -11.27,34.627 -25.173,34.627C-39.071,34.627 -50.344,19.119 -50.344,0C-50.344,-19.124 -39.071,-34.627 -25.173,-34.627C-11.27,-34.627 0,-19.124 0,0" style="fill:white;fill-rule:nonzero;"/> - </g> - <g transform="matrix(-1.53e-05,-239.021,-239.021,1.53e-05,402.161,775.388)"> - <path d="M0.367,0.129C-0.364,-0.441 0.223,-0.711 0.223,-0.711C0.259,-0.391 0.472,-0.164 0.472,-0.164C0.521,-0.548 0.525,-0.77 0.525,-0.77C1.203,-0.256 0.589,0.161 0.589,0.161C0.627,0.265 0.772,0.372 0.906,0.451L1,0.77C0.376,0.403 0.367,0.129 0.367,0.129Z" style="fill:url(#_Linear3);fill-rule:nonzero;"/> - </g> - </g> - <defs> - <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,1.38778e-17,-1,0,-0.000650515)"><stop offset="0" style="stop-color:rgb(247,76,0);stop-opacity:1"/><stop offset="0.33" style="stop-color:rgb(247,76,0);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(244,150,0);stop-opacity:1"/></linearGradient> - <linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,-1,0,1.23438e-06)"><stop offset="0" style="stop-color:rgb(204,58,0);stop-opacity:1"/><stop offset="0.15" style="stop-color:rgb(204,58,0);stop-opacity:1"/><stop offset="0.74" style="stop-color:rgb(247,76,0);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(247,76,0);stop-opacity:1"/></linearGradient> - <linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,1.32349e-23,1.32349e-23,-1,0,-9.1568e-07)"><stop offset="0" style="stop-color:rgb(204,58,0);stop-opacity:1"/><stop offset="0.15" style="stop-color:rgb(204,58,0);stop-opacity:1"/><stop offset="0.74" style="stop-color:rgb(247,76,0);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(247,76,0);stop-opacity:1"/></linearGradient> - </defs> -</svg> diff --git a/modules/home.legacy/conf/firefox/config/search/engines/logos/rust_tokio.png b/modules/home.legacy/conf/firefox/config/search/engines/logos/rust_tokio.png deleted file mode 100644 index f1de55ff..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/logos/rust_tokio.png +++ /dev/null Binary files differdiff --git a/modules/home.legacy/conf/firefox/config/search/engines/logos/wikipedia.svg b/modules/home.legacy/conf/firefox/config/search/engines/logos/wikipedia.svg deleted file mode 100644 index dc32f984..00000000 --- a/modules/home.legacy/conf/firefox/config/search/engines/logos/wikipedia.svg +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY st0 "opacity:.22;fill:#231F20;"><!ENTITY st1 "opacity:.34;fill:url(#SVGID_25_);"><!ENTITY st2 "opacity:.19;fill:#231F20;"><!ENTITY st3 "opacity:.18;fill:url(#SVGID_42_);"><!ENTITY st4 "opacity:.73;fill:#FFF;"><!ENTITY st5 "opacity:.35;fill:url(#SVGID_6_);"><!ENTITY st6 "opacity:.53;fill:#FFF;"><!ENTITY st7 "opacity:.43;fill:url(#SVGID_23_);"><!ENTITY st8 "opacity:.25;fill:#231F20;"><!ENTITY st9 "opacity:.53;fill:url(#SVGID_9_);"><!ENTITY st10 "opacity:.88;fill:#231F20;"><!ENTITY st11 "opacity:.31;fill:url(#SVGID_24_);"><!ENTITY st12 "fill:#232323;"><!ENTITY st13 "opacity:.68;fill:url(#SVGID_22_);"><!ENTITY st14 "opacity:.28;fill:#231F20;"><!ENTITY st15 "opacity:.38;fill:url(#SVGID_43_);"><!ENTITY st16 "fill:url(#SVGID_1_);"><!ENTITY st17 "fill:url(#SVGID_2_);"><!ENTITY st18 "fill:url(#SVGID_4_);"><!ENTITY st19 "opacity:.45;fill:url(#SVGID_5_);"><!ENTITY st20 "opacity:.17;fill:#FFF;"><!ENTITY st21 "opacity:.3;fill:#505050;"><!ENTITY st22 "fill:#616161;"><!ENTITY st23 "fill:#FFF;"><!ENTITY st24 "opacity:.2;fill:url(#SVGID_41_);"><!ENTITY st25 "opacity:.69;fill:url(#SVGID_3_);"><!ENTITY st26 "opacity:.45;fill:url(#SVGID_39_);"><!ENTITY st27 "opacity:.96;fill:url(#SVGID_10_);"><!ENTITY st28 "opacity:.3;fill:#FFF;"><!ENTITY st29 "fill:#9FA2A3;"><!ENTITY st30 "opacity:.73;fill:url(#SVGID_8_);"><!ENTITY st31 "fill:#6B6B6B;"><!ENTITY st32 "opacity:.36;fill:#231F20;"><!ENTITY st33 "opacity:.5;fill:url(#SVGID_7_);"><!ENTITY st34 "opacity:.1;fill:#232323;"><!ENTITY st35 "fill:url(#SVGID_11_);"><!ENTITY st36 "fill:url(#SVGID_12_);"><!ENTITY st37 "fill:url(#SVGID_13_);"><!ENTITY st38 "fill:url(#SVGID_14_);"><!ENTITY st39 "fill:url(#SVGID_15_);"><!ENTITY st40 "fill:url(#SVGID_16_);"><!ENTITY st41 "fill:url(#SVGID_17_);"><!ENTITY st42 "fill:url(#SVGID_18_);"><!ENTITY st43 "fill:url(#SVGID_19_);"><!ENTITY st44 "fill:url(#SVGID_20_);"><!ENTITY st45 "fill:url(#SVGID_21_);"><!ENTITY st46 "fill:url(#SVGID_26_);"><!ENTITY st47 "fill:url(#SVGID_27_);"><!ENTITY st48 "fill:url(#SVGID_28_);"><!ENTITY st49 "fill:url(#SVGID_29_);"><!ENTITY st50 "fill:url(#SVGID_30_);"><!ENTITY st51 "fill:url(#SVGID_31_);"><!ENTITY st52 "fill:url(#SVGID_33_);"><!ENTITY st53 "fill:url(#SVGID_34_);"><!ENTITY st54 "fill:url(#SVGID_35_);"><!ENTITY st55 "fill:url(#SVGID_36_);"><!ENTITY st56 "fill:url(#SVGID_37_);"><!ENTITY st57 "fill:url(#SVGID_38_);"><!ENTITY st58 "fill:url(#SVGID_40_);"><!ENTITY st59 "opacity:.1;fill:#231F20;"><!ENTITY st60 "opacity:.5;fill:#141414;"><!ENTITY st61 "opacity:.38;fill:#231F20;"><!ENTITY st62 "opacity:.83;fill:url(#SVGID_32_);">]><svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="103px" height="94px" viewBox="0 0 103 94"><title>Wikipedia logo version 2</title><radialGradient id="SVGID_1_" cx="244.5713" cy="-427.1392" r="68.6868" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#FFF"/><stop offset=".4835" stop-color="#EAEAEB"/><stop offset=".9451" stop-color="#A9ABAE"/><stop offset="1" stop-color="#999B9E"/></radialGradient><path style="&st16;" d="M49.85,17.003c0.014-0.606-0.392-1.27-0.392-1.27l-0.025-0.058c0,0-0.487-0.949-1.301-1.228c-0.815-0.278-1.478,0.342-1.478,0.342s-0.114,0.131-0.428,0.494c-0.313,0.364-0.507,0.666-1.198,0.938c-0.692,0.271-1.379,0.204-1.743,0.033c-0.365-0.172-0.457-0.537-0.457-0.537s-0.229-0.722-0.313-1.049c-0.086-0.331-0.308-1.694-0.308-1.694s-0.492-2.747-0.535-3.304c0,0,1.475-0.126,3.686-0.775c2.3-0.673,3.043-1.206,3.043-1.206s-0.432-0.156-0.484-0.662c-0.051-0.507-0.089-1.19-0.089-1.19s-0.089-0.5,0.483-1.139c0.572-0.64,1.354-0.863,1.763-0.953c0.41-0.089,1.281-0.17,2.092-0.134c0.813,0.038,1.266,0.112,1.594,0.291c0.327,0.178,0.356,0.61,0.356,0.61l-0.009,1.146c0,0-0.035,0.402,0.262,0.529c0,0,0.505,0.305,2.197,0.133c0,0,0.719-0.126,1.845-0.46c1.125-0.335,4.129-1.229,4.554-1.341c0.426-0.111,0.953-0.291,1.645-0.469c0.693-0.179,2.041-0.626,2.309-0.73c0.27-0.104,1.811-0.618,2.928-0.81c1.114-0.195,2.226-0.186,2.813,0.149c0,0,0.357,0.304,0.521,0.662c0.162,0.358,0.476,0.863,0.92,1.088c0.457,0.227,0.754,0.371,1.877,0.273c0,0,0.021-0.096-0.396-0.37c-0.417-0.277-0.991-0.701-0.991-0.701s-0.334-0.245-0.408-0.447c-0.072-0.202-0.043-0.306-0.043-0.306l0.877-1.406c0,0,0-0.172,0.506-0.238c0.506-0.067,1.074-0.134,1.742-0.313c0.67-0.178,0.789-0.312,0.789-0.312l0.578,0.178c0,0,3.547,2.853,4.655,3.583l0.198-0.239c0,0,0.437,0.018,0.828,0.172c0.393,0.154,0.979,0.562,0.979,0.562s1.613,1.31,2.072,2.2l0.222,0.679l-0.102,0.161c0,0,0.919,1.307,2.096,2.602c0,0,1.229,1.664,1.689,2.09c0,0-0.108-0.399-0.203-0.849l0.339-0.226l0.2-0.144l0.617,0.259c3.575,4.811,6.435,10.424,8.144,16.328l-0.121,0.484l0.396,0.501c1.129,4.212,1.729,8.643,1.729,13.211c0,1.122-0.038,2.236-0.109,3.339l-0.304,0.511l0.226,0.555C99.95,72.645,78.057,93.131,51.38,93.131c-18.502,0-34.702-9.854-43.637-24.601l-0.102-0.365l-0.205-0.151c-3.387-5.742-5.682-12.205-6.595-19.104l0.212-0.524l-0.336-0.482c-0.213-1.892-0.322-3.812-0.322-5.758c0-2.985,0.255-5.909,0.748-8.755l0.25-0.562l-0.087-0.328C2.463,26.451,4.689,20.783,7.78,15.7l0.684-0.384l0.081,0.032c0,0,0.233-0.169,0.354-0.217l0.076-0.023c0,0,1.179-1.971,1.625-2.601c0,0,0.542-0.348,0.745-0.407c0,0,0.124-0.016,0.189,0.076c0,0,0.496-0.432,1.699-2.054c0.004-0.005,0.007-0.011,0.012-0.017c0,0-0.114-0.076-0.131-0.174c-0.018-0.097,0.108-0.591,0.173-0.717s0.108-0.156,0.108-0.156s1.722-2.032,3.151-3.238c0,0,0.26-0.202,0.678-0.25c0,0,1.472-0.613,3.264-2.184c0,0,0.051-0.289,0.478-0.858c0.428-0.57,1.456-1.163,2.222-1.337c0.764-0.174,0.896-0.038,0.896-0.038l0.064,0.065l0.515,0.766c0,0,0.565-0.316,1.413-0.604c0.847-0.289,0.979-0.262,0.979-0.262l0.823,1.336l-0.987,2c0,0-0.644,1.421-1.655,2.185c0,0-0.472,0.284-1.12,0.127c-0.648-0.157-1.072,0.333-1.072,0.333l-0.17,0.14c0,0,0.14-0.024,0.346-0.103c0,0,0.158,0.065,0.274,0.223c0.114,0.158,0.913,1.175,0.913,1.175s0.005,0.837-0.415,1.938c-0.419,1.1-1.467,2.891-1.467,2.891s-0.733,1.424-1.075,2.253c-0.342,0.829-0.515,1.765-0.488,2.262c0,0,0.187,0.062,0.707-0.202c0.655-0.332,1.083,0.027,1.083,0.027s0.719,0.53,1.041,0.881c0.262,0.289,0.802,1.765,0.209,3.224c0,0-0.402,1.008-1.377,1.724c0,0-0.216,0.332-1.529,0.174c-0.368-0.043-0.585-0.276-1.372-0.2c-0.785,0.077-1.231,0.815-1.231,0.815l0.013-0.024c-0.692,0.999-1.154,2.458-1.154,2.458l-0.057,0.165c0,0-0.241,0.509-0.292,1.752c-0.053,1.284,0.284,3.109,0.284,3.109s7.876-1.387,9.88-0.055l0.58,0.532c0,0,0.046,0.174-0.031,0.376c-0.08,0.204-0.375,0.673-0.987,1.113c-0.611,0.438-1.222,1.583-0.313,2.304c1.034,0.818,1.691,0.766,3.43,0.468c1.74-0.297,2.898-1.269,2.898-1.269s0.972-0.72,0.783-1.628c-0.188-0.908-1.017-1.189-1.017-1.189s-0.658-0.423-0.141-1.238c0,0,0.141-0.689,2.553-1.316c2.414-0.626,6.812-1.52,10.557-1.989c0,0-2.539-8.223-0.738-9.289c0,0,0.438-0.296,1.224-0.408l0.72-0.037c0.131-0.027,0.343,0.005,0.796,0.045c0.453,0.038,1.001,0.076,1.678-0.441c0.676-0.519,0.697-0.819,0.697-0.819"/><radialGradient id="SVGID_2_" cx="197.6416" cy="-371.8613" r="0" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#FFF"/><stop offset=".4835" stop-color="#EAEAEB"/><stop offset=".9451" stop-color="#A9ABAE"/><stop offset="1" stop-color="#999B9E"/></radialGradient><path style="&st17;" d="M-16.122-14.641"/><linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="456.2744" y1="510.1602" x2="502.7757" y2="582.9122" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#8A8A8A"/><stop offset=".5687" stop-color="#606060"/><stop offset=".5914" stop-color="#FFF"/><stop offset=".6116" stop-color="#585858"/><stop offset="1" stop-color="#303030"/></linearGradient><path style="&st25;" d="M82.447,79.307l0.451,0.168c-0.032,0.061-0.067,0.119-0.101,0.179c-0.864,1.573-0.936,1.927-1.36,2.253c-0.424,0.326-0.58,0.539-1.443,0.695c-0.865,0.156-1.771,1.175-1.771,1.175s-0.875,0.835-0.48,0.866c0.396,0.025,1.177-0.609,1.177-0.609s0.497-0.354,0.625-0.255c0.125,0.099-0.539,0.751-0.539,0.751s-1.161,1.176-2.479,1.982l-0.396,0.213c0,0,1.869-1.392,2.764-2.395c0,0,0.185-0.271-0.185,0.057c-0.369,0.325-1.332,0.821-1.741,0.821c-0.41,0,0.016-0.563,0.016-0.563s0.596-0.768,1.812-1.758c1.22-0.994,2.239-0.922,2.239-0.922s0.227,0.043,0.253-0.271c0.028-0.313,0.312-0.863,0.312-0.863s0.453-1.032,1.674-2.749c1.218-1.714,1.77-2.195,1.77-2.195s1.588-1.629,2.423-3.259c0,0,0.581-1.006-0.364-0.255c-0.951,0.753-2.211,1.7-3.44,2.014c-1.233,0.312-1.349-0.836-1.349-0.836s-0.271-1.884,1.049-3.344c1.188-1.316,2.492-1.273,3.684-1.415c1.188-0.144,2.21-1.571,2.21-1.571s0.82-0.922,1.289-3.797c0.218-1.337,0.067-2.244-0.144-2.818l0.021-0.647l-0.368-0.021c-0.078-0.106-0.135-0.153-0.135-0.153s-0.297-0.299-0.607-0.524c-0.313-0.227-0.692-0.649-1.063-1.457c0,0-1.019-2.11-0.792-5.156c0.227-3.047,2.762-2.762,2.762-2.762s1.475,0.143,1.76-0.298c0.283-0.438,0.553-0.993,0.649-2.223c0.101-1.233-0.396-2.408-0.396-2.408s-0.186-0.609-1.049-0.708c-0.863-0.1-1.051,0.169-1.051,0.169s-0.255,0.072-0.723,1.09c-0.471,1.021-0.75,1.488-1.602,1.702c-0.849,0.211-2.023,0.099-2.549-0.992c-0.515-1.072-1.757-3.693-2.351-5.772l0.084-0.735l-0.325-0.471c-0.063-0.396-0.117-0.846-0.13-1.236c-0.026-0.992-0.312-2.097-0.638-3.2c-0.326-1.106-1.459-2.972-1.672-3.399c-0.324-0.667-0.621-0.949-1.021-0.893c-0.396,0.056-0.339,0.056-0.513,0.056c-0.168,0-0.266,0.212-0.311,0.425c-0.042,0.212-0.375,1.315-1.104,1.812c-0.752,0.51-1.147,0.737-2.438,0.85c0,0-1.487,0.099-2.661-2.097C71,29.36,71.301,27.96,71.398,27.45c0.099-0.51,0.539-1.247,1.229-1.388c0.693-0.141,1.119-0.184,1.119-0.184s1.122-0.01,1.603-0.071c0.551-0.071,0.283-1.006,0.283-1.006s-0.361-2.371-2.348-4.318l-0.096-0.487l-0.756-0.381c-1.881-2.04-4.354-5.354-4.354-5.354s-1.105-1.048-0.17-2.493c0,0,0.438-0.963,1.742-0.792c0.419,0.081,0.457,0.123,0.818,0.199c0.481,0.099,1.008,0.225,1.478-0.398c0,0,0.438-0.792-0.271-1.812s-0.923-1.742-1.785-1.687c0,0-0.397-0.055-0.793,0.384C68.702,8.1,67.682,8.378,67.086,8.44c-0.679,0.071-2.252-0.528-3.156-2.082c-0.513-0.874-0.752-1.35-0.865-1.595l0.231-0.34l0.72,0.08c0.186,0.358,0.549,1.056,0.978,1.812c0.552,0.978,1.048,1.118,1.373,1.261c0.325,0.141,1.049-0.071,1.431-0.283c0.385-0.213,0.766-0.695,1.43-0.738c0.668-0.043,1.629,0.071,2.311,0.793c0.682,0.723,1.531,2.224,1.459,2.932c-0.068,0.708-0.111,1.403-1.035,1.699c-0.921,0.298-1.303,0.043-1.884-0.084c-0.581-0.128-0.864-0.072-1.104,0.211c-0.242,0.284-0.512,0.892-0.412,1.162c0.102,0.27,0.186,0.454,0.75,1.262c0.566,0.806,3.474,4.25,4.031,4.766l-0.152,0.698l0.968,0.176c0.625,0.724,1.358,1.668,1.687,2.263c0.493,0.907,0.752,2.337,0.779,3.002c0.025,0.666-0.299,0.963-0.299,0.963s-0.313,0.524-2.012,0.524c-1.517,0-1.614,0.297-1.614,0.297s-0.47,0.467-0.369,1.615c0.103,1.146,0.616,2.344,1.56,3.37c0.778,0.851,2.252-0.006,2.748-0.295c0.51-0.299,0.822-1.264,0.822-1.264s0.102-1.217,1.432-1.217c1.377,0,1.969,1.318,1.969,1.318s0.963,1.295,1.941,4.121c0.481,1.389,0.566,2.281,0.566,2.281l0.126,1.668l-0.513,0.892l0.732,0.312c0.135,0.541,0.348,1.24,0.686,2.044c0,0,1.008,2.381,1.443,3.286c0.44,0.906,0.896,0.766,1.264,0.808c0,0,0.85,0.113,1.16-0.282c0.313-0.398,0.61-1.092,0.61-1.092s0.663-1.812,2.138-1.657c1.475,0.156,1.84,1.092,2.096,2.168c0.256,1.074,0.313,3.229-0.479,4.545c-0.798,1.318-1.688,1.135-1.688,1.135s-1.813-0.17-2.225,0.213c-0.41,0.382-0.623,0.724-0.681,1.613c-0.058,0.894,0.026,2.336,0.751,4.08c0.631,1.523,1.146,1.361,1.432,1.728c0.284,0.368,1.188,1.204,1.104,3.272c-0.082,2.067-0.791,4.149-1.586,5.439c-0.793,1.288-1.997,2.053-1.997,2.053s-0.338,0.211-1.076,0.311c-0.735,0.102-1.784,0.086-2.534,0.513c-0.75,0.426-0.992,1.501-1.063,1.971c-0.069,0.468-0.112,1.529,0.921,1.413c1.034-0.109,2.577-1.4,2.577-1.4s1.486-1.104,1.685-0.752c0.199,0.354-0.636,1.784-0.636,1.784s-1.035,1.562-1.898,2.523c-0.709,0.791-1.641,1.868-2.431,3.102L82.447,79.307L82.447,79.307z"/><linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="425.2861" y1="502.9512" x2="445.7861" y2="598.6606" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#A8A9AB"/><stop offset="1" stop-color="#636668"/></linearGradient><path style="&st18;" d="M23.441,22.732c-0.007,0.008-0.013,0.018-0.021,0.025C23.428,22.75,23.434,22.74,23.441,22.732z"/><linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="421.0684" y1="504.3701" x2="441.068" y2="597.7433" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#A8A9AB"/><stop offset="1" stop-color="#636668"/></linearGradient><path style="&st19;" d="M38.188,89.707l0.163,0.01c-0.163-0.147-0.37-0.281-0.62-0.414c-0.699-0.371-3.731-2.375-4.669-3.009c-0.936-0.633-2.575-1.7-3.297-1.478c-0.554,0.172-0.475,0.394-0.804,0.556c-0.331,0.157-0.687,0.052-1.504-0.384c-0.818-0.434-1.424-0.725-3.02-2.239c-1.245-1.185,1.595-0.118,1.595-0.118s0.619,0.262,0.343-0.385c-0.277-0.646-1.676-2.333-2.994-3.691c-1.068-1.098-1.674-1.86-2.435-2.97l-0.566-0.661l0.007-0.166c-0.018-0.024-0.035-0.054-0.052-0.078c0,0-1.874-3.377-1.676-4.617c0,0,0.068-0.828,1.241-1.188c0.817-0.251,0.71,0.542,3.112,0.975c0,0,2.07,0.559,2.611-0.945c0.539-1.505-0.567-3.393-0.567-3.393s-1.449-2.656-3.244-2.758c-0.95-0.053-0.692,0.586-2.125,0.926c0,0-1.913,0.184-2.519-0.963c-0.734-1.389-1.04-2.969-1.015-4.022c0.022-1,0.054-1.079,0.119-1.371c0.045-0.206,0.192-0.582,0.254-1.128l-0.134-0.667l0.204-0.501c0.002-0.26-0.004-0.535-0.021-0.83c-0.091-1.66-0.213-4.221-0.437-5.71c-0.223-1.491-0.633-3.798-1.991-3.866c0,0-0.671-0.051-1.634,0.885c-0.884,0.856-1.684-0.708-1.728-1.663c-0.053-1.121,0.131-2.254,0.409-2.795c0.277-0.541,1.042-0.567,1.186-0.555c0.146,0.013,0.555,0.171,1.043,0.474c0.488,0.305,1.16,0.305,1.557-0.092c0.395-0.394,0.947-0.856,1.173-2.598c0.224-1.741,0.224-3.547,0.013-5.71l-0.225-0.484l1.339-0.289c-0.001-0.017-0.021-0.126-0.032-0.193c0-0.002,0-0.003,0-0.005c-0.002-0.017-0.005-0.032-0.007-0.049c-0.001-0.003-0.001-0.005-0.001-0.007c-0.003-0.019-0.007-0.038-0.009-0.057c0-0.001-0.001-0.001-0.001-0.003c-0.003-0.02-0.006-0.042-0.009-0.062c0-0.001,0-0.001,0-0.001c-0.004-0.023-0.007-0.045-0.011-0.068c0-0.004-0.001-0.006-0.001-0.008c-0.002-0.022-0.006-0.045-0.008-0.066c-0.001-0.006-0.001-0.01-0.003-0.017c-0.002-0.023-0.005-0.046-0.009-0.069c-0.001-0.004-0.001-0.007-0.002-0.014c-0.003-0.026-0.007-0.05-0.011-0.076c0-0.002,0-0.004,0-0.005c-0.004-0.024-0.008-0.05-0.011-0.076c-0.001-0.007-0.001-0.01-0.003-0.017c-0.002-0.025-0.006-0.052-0.009-0.08c-0.001-0.005-0.001-0.011-0.002-0.021c-0.005-0.027-0.007-0.053-0.011-0.081c-0.001-0.006-0.002-0.013-0.002-0.019c-0.002-0.029-0.006-0.058-0.01-0.087c0-0.004-0.001-0.008-0.003-0.014c-0.002-0.028-0.005-0.056-0.009-0.082c-0.001-0.006-0.001-0.011-0.002-0.016c-0.002-0.031-0.006-0.06-0.01-0.09c0-0.006-0.001-0.015-0.002-0.021c-0.004-0.03-0.006-0.061-0.011-0.09c0-0.007-0.001-0.015-0.002-0.022c-0.003-0.03-0.006-0.062-0.01-0.093c0-0.006-0.002-0.012-0.002-0.019c-0.003-0.032-0.005-0.063-0.009-0.094c0-0.002,0-0.005,0-0.009c-0.004-0.032-0.005-0.066-0.01-0.1c0-0.005,0-0.012-0.001-0.02c-0.002-0.033-0.005-0.065-0.007-0.098c-0.001-0.007-0.001-0.014-0.001-0.021c-0.004-0.033-0.006-0.067-0.008-0.099c0-0.005,0-0.012-0.001-0.02c-0.002-0.033-0.006-0.069-0.007-0.102c0-0.003,0-0.007-0.001-0.01c-0.002-0.033-0.004-0.066-0.006-0.1c-0.001-0.006-0.001-0.011-0.001-0.017c-0.001-0.032-0.003-0.068-0.005-0.1c0-0.008,0-0.014-0.001-0.021c-0.001-0.031-0.002-0.065-0.003-0.099c-0.001-0.006-0.001-0.013-0.001-0.021c-0.002-0.033-0.003-0.066-0.004-0.1c0-0.005,0-0.009,0-0.014c-0.001-0.032-0.001-0.066-0.002-0.099c0-0.003,0-0.005,0-0.009c0-0.034,0-0.067-0.001-0.101c0-0.005,0-0.013,0-0.017c0-0.033,0-0.067,0-0.098c0-0.005,0.001-0.012,0.001-0.019c0-0.032,0-0.065,0.001-0.095c0-0.005,0-0.009,0-0.015c0.001-0.033,0.001-0.065,0.003-0.099c0.052-1.244,0.292-1.752,0.292-1.752l0.057-0.164c0,0,0.46-1.459,1.154-2.459l-0.013,0.024c0,0,0.446-0.738,1.231-0.814c0.785-0.079,1.004,0.156,1.371,0.2c0.04,0.004,0.078,0.008,0.115,0.013c0.013,0.002,0.025,0.002,0.037,0.004c0.025,0.002,0.051,0.004,0.075,0.006c0.014,0.001,0.027,0.003,0.041,0.003c0.021,0.001,0.043,0.003,0.064,0.004c0.014,0.001,0.028,0.002,0.041,0.003c0.02,0.001,0.04,0.001,0.058,0.003c0.014,0,0.026,0,0.042,0c0.019,0.001,0.036,0.002,0.055,0.002c0.013,0.001,0.026,0.001,0.038,0.002c0.017,0,0.034,0,0.051,0c0.011,0,0.023,0,0.034,0c0.017,0,0.033,0,0.05,0c0.011,0,0.02-0.001,0.032-0.001c0.016-0.001,0.031-0.001,0.046-0.001c0.011-0.001,0.02-0.001,0.03-0.002c0.016,0,0.03-0.002,0.045-0.002c0.009,0,0.019,0,0.026-0.001c0.016-0.001,0.03-0.002,0.044-0.004c0.006,0,0.016-0.001,0.023-0.002c0.015-0.001,0.029-0.001,0.044-0.003c0.006-0.001,0.013-0.002,0.02-0.002c0.016-0.002,0.03-0.004,0.045-0.008c0.004,0,0.008,0,0.013-0.001c0.019-0.002,0.036-0.005,0.052-0.008l0,0c0.035-0.006,0.068-0.014,0.098-0.021c0,0,0,0,0.002-0.002c0.012-0.002,0.026-0.005,0.039-0.01c0.002,0,0.004,0,0.008-0.001c0.009-0.003,0.019-0.006,0.028-0.009c0.004,0,0.007-0.002,0.01-0.003c0.009-0.003,0.019-0.007,0.026-0.009c0.002-0.001,0.005-0.002,0.008-0.003c0.008-0.003,0.015-0.006,0.021-0.009c0.004-0.001,0.006-0.003,0.009-0.003c0.007-0.004,0.014-0.005,0.02-0.009c0.003-0.001,0.006-0.003,0.008-0.004c0.005-0.002,0.012-0.005,0.019-0.007c0.001-0.001,0.003-0.002,0.005-0.004c0.005-0.003,0.01-0.005,0.016-0.007c0.002-0.002,0.003-0.002,0.006-0.004c0.004-0.001,0.008-0.005,0.012-0.007c0.002-0.001,0.004-0.001,0.005-0.003c0.004-0.002,0.008-0.006,0.012-0.008c0.001,0,0.003-0.002,0.004-0.003c0.003-0.003,0.007-0.004,0.011-0.007c0.001-0.001,0.001-0.001,0.002-0.003c0.004-0.001,0.006-0.005,0.008-0.008h0.002c0.003-0.002,0.005-0.005,0.008-0.007l0.001-0.001c0.002-0.002,0.004-0.004,0.006-0.006s0.002-0.002,0.003-0.003c0.001,0,0.002-0.002,0.002-0.002c0.001-0.003,0.001-0.003,0.003-0.005c0.003-0.001,0.003-0.004,0.003-0.004c0.328-0.241,0.593-0.516,0.797-0.775c0.014-0.017,0.026-0.033,0.04-0.05c0.002-0.004,0.005-0.009,0.008-0.012c0.013-0.015,0.026-0.031,0.038-0.048c0.002-0.004,0.006-0.008,0.007-0.011c0.012-0.018,0.025-0.033,0.038-0.05c0.001,0,0.001,0,0.001-0.001c0.039-0.054,0.075-0.109,0.109-0.159c0-0.002,0.002-0.004,0.003-0.007c0.01-0.016,0.02-0.029,0.03-0.044c0.001-0.004,0.005-0.007,0.007-0.011c0.008-0.014,0.017-0.029,0.024-0.042c0.003-0.004,0.005-0.009,0.009-0.013c0.008-0.014,0.017-0.028,0.024-0.042l0.001-0.002c0.017-0.027,0.032-0.055,0.046-0.079c0.002-0.003,0.004-0.008,0.007-0.012c0.005-0.009,0.01-0.021,0.016-0.03c0.003-0.007,0.007-0.014,0.012-0.02c0.004-0.008,0.01-0.017,0.014-0.024c0.002-0.008,0.006-0.017,0.011-0.023c0.004-0.007,0.009-0.016,0.012-0.022c0.004-0.007,0.007-0.014,0.011-0.021c0.002-0.006,0.007-0.011,0.01-0.018c0.066-0.13,0.097-0.207,0.097-0.207c0.594-1.459,0.052-2.935-0.21-3.224c-0.32-0.354-1.041-0.883-1.041-0.883s-0.426-0.357-1.08-0.025c-0.521,0.264-0.711,0.201-0.711,0.201c-0.024-0.498,0.149-1.432,0.491-2.263c0.341-0.829,1.075-2.253,1.075-2.253s1.047-1.792,1.467-2.89c0.418-1.102,0.415-1.94,0.415-1.94s-0.795-1.019-0.91-1.177c-0.115-0.158-0.272-0.223-0.272-0.223c-0.205,0.078-0.345,0.103-0.345,0.103l0.169-0.14c0,0,0.424-0.492,1.073-0.334c0.648,0.158,1.119-0.126,1.119-0.126c1.011-0.764,1.654-2.187,1.654-2.187l0.988-1.997L27.059,1.12c0,0-0.131-0.028-0.979,0.259c0,0-0.773,1.905-1.725,3.087c0,0-0.374,0.552-0.664,0.416c-0.289-0.134-0.629-0.144-0.91-0.085c-0.281,0.06-1.156,0.349-1.948,1.413c-0.79,1.064-0.883,1.863-0.458,2.101c0.425,0.238,1.045-0.076,1.42-0.407c0.375-0.333,0.638-0.485,0.757-0.47c0.118,0.02,0.093,0.315,0.068,0.41c-0.026,0.094-0.154,1.364-1.625,3.913c-0.369,0.64-0.845,1.589-1.069,2.046l0.608,0.447l-0.999,0.503c-0.266,0.758-0.605,1.945-0.471,2.61c0.204,1.011,1.158,1.011,1.158,1.011s0.621,0.027,1.344-0.348c0.722-0.375,0.892,1.242,0.892,1.505c0,0.264-0.007,1.726-1.02,2.442c0,0-0.409,0.313-0.985,0.313c-0.579,0-0.954-0.169-0.954-0.169s-0.984-0.272-1.59,0.083c-0.604,0.358-1.326,1.098-1.897,2.17c-0.569,1.072-1.045,2.986-1.019,4.397c0.02,1.111,0.18,2.162,0.291,2.879l0.667,0.435l-0.543,0.623c0.079,1.136,0.168,3.363,0.155,4.109c-0.018,0.911-0.154,2.84-1.115,3.292c0,0-0.324,0.171-0.868-0.238s-1.132-0.426-1.37-0.435c-0.238-0.007-1.285,0.162-1.692,1.311c-0.408,1.145-0.375,2.688-0.29,3.597c0.086,0.91,0.876,2.458,1.872,2.458c0,0,0.484,0.035,1.055-0.553c0.568-0.586,0.902-0.637,1.156-0.629c0.255,0.009,0.749,0.272,1.072,2.851c0.307,2.442,0.437,4.442,0.414,6.668l0.605,0.392l-0.758,0.768c-0.042,0.199-0.089,0.417-0.142,0.626c-0.169,0.682-0.187,1.364-0.024,2.569c0.161,1.21,0.811,3.72,1.754,4.375c1.252,0.871,2.071,0.856,2.916,0.791c0.842-0.067,1.424-0.712,1.424-0.712s0.331-0.342,0.685-0.237c0.356,0.104,1.346,0.66,2.058,2.084c0.713,1.425,0.871,2.992-0.316,3.272c-1.187,0.272-3.231-0.846-3.231-0.846s-1.161-0.647-2.109,0.064c-0.951,0.713-0.977,1.807-0.502,3.15c0.261,0.738,0.782,1.938,1.513,3.188l0.721,0.302l-0.193,0.551c0.492,0.748,1.055,1.479,1.678,2.105c0,0,2.466,2.729,3.838,4.457c0,0,0.08,0.157-0.158,0.016c-0.238-0.146-1.266-0.621-1.82-0.566c-0.555,0.054-0.45,0.395-0.45,0.395s0.238,1.254,4.01,3.365c0,0,1.359,0.766,2.216,0.766c0,0,0.277,0.039,0.619-0.346c0.346-0.381,0.45-0.341,0.688-0.262c0.237,0.076,0.553,0.249,1.741,1.105c1.188,0.857,3.496,2.176,4.325,2.731c0.83,0.555,0.793,0.657,0.621,1.054c-0.171,0.396,0.593,0.619,0.593,0.619s1.899,0.855,2.928,0.846c1.029-0.016,1.464-0.119,2.097,0.012c0.632,0.133,1.28,0.291,1.345,0.346c0.066,0.053-0.315,0.038-0.315,0.038s-2.362-0.276-2.494-0.21c-0.13,0.066,0.014,0.184,0.99,0.436v0.006c1.245,0.217,2.507,0.387,3.782,0.51c-0.489-0.061-2.52-0.322-3.823-0.713c0,0-0.131-0.078,0.173-0.014c0.303,0.065,2.018,0.225,2.466,0.157c0.448-0.065-0.092-0.274-0.092-0.274s-0.897-0.425-2.889-0.582c0,0-0.803-0.055-1.503,0.014c-0.699,0.066-1.41-0.264-1.41-0.264s-1.028-0.317-0.78-0.646c0.126-0.165,0.137-0.336,0.065-0.502L38.188,89.707L38.188,89.707z"/><linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="444.7598" y1="550.8145" x2="473.8418" y2="550.8145" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#231F20"/><stop offset="1" stop-color="#474747"/></linearGradient><path style="&st5;" d="M62.342,86.16l-0.438,0.646c0.096,0.655-0.104,0.875-0.254,1.119c-0.156,0.26-0.59,0.592-0.375,1.185c0.218,0.59,1.687,0.401,2.535,0.144c0.852-0.26,1.569-0.49,2.134-0.693c0.562-0.198,0.719,0.086,0.719,0.086s0.246,0.175-0.574,0.606c-0.821,0.433-2.336,0.634-3.055,0.72c-0.724,0.086-0.506-0.043-1.586,0.33c-1.082,0.377-0.07,0.707-0.07,0.707c2.435,0.635,4.188,0.115,4.188,0.115l0.332-0.097c0.27-0.077,0.535-0.161,0.803-0.244c-2.021,0.456-3.326,0.149-3.739,0.095c-0.431-0.058-0.778-0.145-0.88-0.361c-0.102-0.215,0.479-0.2,0.479-0.2s1.683-0.188,3.24-0.69c1.557-0.506,1.932-0.98,1.871-1.341c-0.057-0.358-0.848-0.332-1.785-0.028c-0.937,0.305-2.334,0.75-2.662,0.821c-0.334,0.07-0.691,0.06-0.812-0.146c-0.114-0.203-0.216-0.53,0.146-0.905c0.36-0.376,0.402-0.694,0.402-0.694c0.055-0.254,0.057-0.523,0.021-0.8L62.342,86.16l0.545-0.118c-0.298-1.124-1.052-2.218-1.279-2.577c-0.314-0.507-0.836-0.793-2.393-0.535c-1.556,0.26-3.386,1.035-3.386,1.035s-1.888,0.997-3.298,0.812c-1.413-0.188-1.703-1.614-1.688-2.063c0.015-0.447,0.304-0.835,1.039-1.123c0.735-0.289,2.465-0.678,4.985-0.808s3.458-1.771,3.458-1.771c0.33-0.478,0.922-1.543-0.489-2.336c-1.41-0.791-1.441-0.593-2.119-1.107c-0.678-0.52-1.412-1.153-1.701-2.033c-0.025-0.084-0.066-0.197-0.104-0.292l-0.849-0.558l0.41-0.371c-0.34-0.67-0.693-1.271-0.693-1.271s-1.281-1.902-0.246-3.703c1.038-1.803,2.736-2.348,2.736-2.348s1.5-0.332,2.996,0.016c1.418,0.324,2.133-0.219,2.133-0.219s0.865-0.374,1.123-2.102c0.264-1.729-0.014-4.943-2.316-5.578c-2.307-0.633-3.527,0.563-3.527,0.563s-1.24,1.369-1.644,1.57c-0.404,0.201-1.022,0.563-1.022,0.563s-0.867,0.519-1.453,0.648c-0.393,0.086-1.791-1.771-1.933-3.201c-0.133-1.316-0.401-2.388-0.306-5.096l-0.485-0.63l0.537-0.533c0.101-2.999-0.417-5.116-1.188-6.461c-0.807-1.412-2.119-2.161-2.766-2.478c-0.648-0.318-2.147-0.462-3.17-0.086c-1.023,0.374-1.239,0.678-1.613,1.326c-0.376,0.648-0.836,0.605-0.836,0.605s-1.427,0.043-1.888-2.133c-0.646-3.049,0.359-4.035,0.359-4.035s0.318-0.476,1.369-0.619c1.053-0.144,1.73,0.115,2.537,0.315c0.806,0.202,1.41,0.116,2.419-0.374c1.008-0.491,1.442-1.297,1.238-2.739c-0.195-1.393-0.255-1.742-1.483-5.964l-0.875-0.46l0.583-0.579C44.87,23.032,44.8,20.35,44.8,20.35c-0.106-0.977,0.049-1.292,0.598-1.54c0.576-0.259,1.116-0.175,1.934-0.123c0.818,0.053,1.425-0.079,1.847-0.316c0.422-0.237,1.581-0.87,1.504-2.162c-0.08-1.292-1.109-2.824-1.953-3.351c-0.843-0.528-1.953-0.316-2.558,0.131c-0.606,0.45-0.845,1.029-1.214,1.214c-0.369,0.183-0.895,0.605-1.45,0.474c-0.554-0.132-0.581-1.371-0.818-2.77c-0.153-0.907-0.271-1.611-0.338-1.989l-0.678-0.254c0.044,0.557,0.535,3.304,0.535,3.304s0.223,1.364,0.308,1.692c0.086,0.329,0.314,1.05,0.314,1.05s0.092,0.364,0.456,0.535c0.365,0.172,1.052,0.24,1.743-0.032c0.692-0.271,0.886-0.572,1.199-0.938c0.315-0.364,0.429-0.493,0.429-0.493s0.663-0.622,1.478-0.343c0.813,0.278,1.299,1.228,1.299,1.228l0.028,0.06c0,0,0.403,0.661,0.392,1.269v-0.057c0,0-0.022,0.301-0.697,0.818c-0.676,0.519-1.226,0.479-1.678,0.442c-0.454-0.04-0.666-0.072-0.797-0.045l-0.719,0.038C45.178,18.303,44.74,18.6,44.74,18.6c-1.8,1.064,0.736,9.288,0.736,9.288l0,0L45.2,28.501c0,0,0.514,2.052,0.904,3.378c0.388,1.326,0.562,2.637,0.62,2.91c0.058,0.274,0.044,0.762-0.317,1.051c-0.359,0.289-1.239,0.534-1.425,0.562c-0.187,0.029-0.535-0.042-0.996-0.201c-0.462-0.158-0.922-0.187-0.922-0.187s-1.11-0.188-2.291,0.173c-1.182,0.359-2.076,1.569-2.148,3.083c-0.071,1.513-0.057,2.278,0.535,3.617c0.59,1.34,1.657,2.104,2.463,2.118c0.808,0.014,1.469-0.403,1.931-1.051c0.459-0.65,0.59-0.751,0.59-0.751c0.548-0.302,1.944-0.433,2.651-0.172c0.708,0.258,2.007,1.073,2.723,2.679c0.579,1.298,0.76,2.75,0.729,5.363l0.584,0.448l-0.61,0.703c-0.007,0.246-0.016,0.498-0.026,0.761c-0.143,3.876,0.72,5.864,0.72,5.864c0.491,1.065,1.023,1.83,1.745,2.318c0.719,0.489,1.699,0.156,2.018,0c0.315-0.158,1.194-0.563,1.943-1.037c0.749-0.477,0.725-0.679,1.629-1.515c0.907-0.833,2.076-0.604,2.076-0.604s1.107,0.028,1.74,1.313c0.637,1.283,0.509,3.109,0.347,3.773c-0.158,0.662-0.444,1.097-1.063,0.979c-0.621-0.114-1.645-0.217-2.019-0.231c-0.375-0.014-1.433-0.049-2.394,0.203c-0.938,0.244-2.205,0.92-3.414,2.883c-0.938,1.52-0.478,3.013-0.262,3.603c0.17,0.462,0.635,1.104,1.043,1.896l0.756,0.252l-0.35,0.656c0.398,0.963,0.701,1.493,1.305,2.151c0.648,0.705,1.672,1.251,2.881,1.714c1.213,0.462,0.662,1.282,0.662,1.282c-0.69,1.497-2.75,1.557-3.354,1.628c-0.604,0.07-1.872,0.188-3.058,0.447c-1.182,0.261-2.291,0.418-2.954,1.182c-0.661,0.764-0.402,1.557-0.013,2.393c0.388,0.834,1.427,1.28,2.853,1.226c1.426-0.058,2.35-0.476,3.214-0.851s2.362-0.809,2.81-0.937c0.445-0.129,1.051-0.39,1.498,0.26c0.482,0.701,0.994,1.697,1.229,2.45L62.342,86.16L62.342,86.16z"/><path style="&st34;" d="M101.566,51.162c0,0,0.347-3.236,0.457-4.392c0.018-0.173,0.031-0.343,0.045-0.513l-0.098-0.241c-0.459,5.815-0.938,7.727-0.938,7.727s0.013-0.037,0.031-0.101c0.189-0.817,0.357-1.646,0.51-2.48C101.568,51.162,101.566,51.162,101.566,51.162L101.566,51.162z"/><path style="&st34;" d="M91.268,12.579l0.328,0.413l0.279,0.5c1.021,1.648,2.846,4.295,2.846,4.295s0.739,0.958,0.905,0.968c0.164,0.01-0.084-0.741-0.084-0.741s-0.271-0.979,0.517,0.298c0.73,1.19,1.207,2.359,1.317,2.72c0.114,0.361,0.042,0.411,0.042,0.411s-0.146,0.072-0.146,0.33c0,0.505,0.496,1.659,0.496,1.659s1.545,3.926,2.07,5.563c0.526,1.641,1.133,4.368,1.133,4.368s0.187,0.804,0.207,1.174c0.021,0.371-0.063,0.381-0.229,0.186c-0.164-0.196-0.329-0.072-0.329-0.072s-0.175,0.072-0.175,0.773c0,0.7,0.085,2.346,0.217,3.615c0.152,1.505,0.616,2.133,0.616,2.133s0.413,0.618,0.526-0.577c0.096-1.028,0.185-0.228,0.185-0.228c0.196,1.557,0.062,4.544,0.03,4.955c-0.019,0.218-0.032,0.433-0.049,0.64l0.133-0.221c0.201-2.971,0.06-5.359,0.06-5.359s-0.144-1.323-0.3-1.311c-0.155,0.01-0.211,0.701-0.211,0.701s-0.065,0.467-0.156,0.456c-0.088-0.011-0.369,0.022-0.566-1.412c-0.199-1.436-0.156-2.949-0.156-2.949s-0.043-0.155,0.048-0.189c0.09-0.034,0.188,0.1,0.188,0.1s0.133,0.189,0.287,0.033c0.156-0.154,0.19-0.622-0.301-3.08c-0.288-1.454-0.711-2.896-1.006-3.832l-0.294-0.333l-0.058-0.718c0,0-0.311-0.913-1.033-2.737c-0.723-1.824-0.846-2.458-0.846-2.458s-0.045-0.2,0.066-0.234c0.111-0.032,0.091-0.178,0.091-0.178s-0.013-0.245-0.278-0.99c-0.268-0.746-0.426-1.281-1.356-2.86c-0.869-1.468-1.124-1.558-1.124-1.558s-0.426-0.234-0.112,0.591c0.313,0.823-0.075,0.232-0.075,0.232c-0.925-1.177-2.838-4.292-2.838-4.292l-0.537-0.373l-0.508-1.261l-0.015,0.01"/><path style="&st34;" d="M1.547,32.696l-0.183,0.37c-0.472,2.495-0.625,5.135-0.62,5.31c0.01,0.208-0.036,0.211-0.075,0.178c-0.042-0.035,0.03-0.16-0.048-0.16c-0.079,0-0.108,0.211-0.108,0.211L0.512,38.6c-0.021,0.288-0.038,0.574-0.053,0.861l0.016-0.003c0.068-0.098,0.097-0.028,0.097-0.028s-0.029,0.126,0.097,0.056c0.126-0.07,0.21-1.379,0.21-1.379s0.014-2.813,0.836-6.14c0.819-3.327,1.281-4.259,1.281-4.259s0.154-0.418,0.138-0.083C3.12,27.958,3.33,27.986,3.33,27.986c0.375-0.054,0.821-1.125,1.267-2.493c0.445-1.363,0.668-2.589,0.668-2.7c0-0.11-0.055-0.194-0.152-0.138c-0.098,0.056-0.125,0.014-0.125,0.014c-0.014-0.208,0.361-1.127,0.361-1.127c1.253-3.202,3.104-5.694,3.104-5.694l0.09-0.504c-0.164,0.254-0.27,0.419-0.421,0.661c-0.056,0.089-0.042,0.297-0.001,0.32c-0.201,0.191-0.365,0.35-0.476,0.456c-2.707,4.473-3.059,6.556-3.059,6.556c-0.017,0.214,0.004,0.311,0.111,0.306c0.065-0.003,0.251-0.349,0.116,0.354c-0.09,0.468-0.524,1.708-0.693,2.212c-0.171,0.505-0.358,0.85-0.495,0.826C3.49,27.01,3.49,26.801,3.49,26.801s-0.042-0.546-0.398,0.245c-0.356,0.791-0.713,1.859-1.425,4.65c-0.031,0.125-0.063,0.251-0.092,0.38L1.547,32.696L1.547,32.696z"/><path style="&st34;" d="M4.841,62.626c-0.15-0.401-0.264-0.722-0.179-0.581c0.085,0.143,0.198,0.432,0.462,0.725c0.263,0.291,0.442-0.226-0.622-3.104s-1.354-3.04-1.402-3.095c-0.046-0.058-0.215-0.237-0.167,0.167c0.045,0.404,0.018,0.656-0.51-1.146c-0.528-1.806-0.996-4.844-1.025-5.089c-0.027-0.243-0.169-1.778-0.396-3.594c-0.226-1.814-0.246-3.743-0.207-4.28c0.039-0.537-0.066-0.828-0.123-0.837c-0.056-0.008-0.094,0.047-0.131,0.284c-0.038,0.234-0.01,0.395-0.067,0.385c-0.057-0.009-0.076-0.471-0.076-0.471H0.391c0,0.05,0,0.1,0,0.151c0,0.174,0.001,0.345,0.002,0.519l0.039,0.402c0.033,0.597,0.129,0.354,0.135,0.246c0.006-0.109,0.03-0.329,0.03-0.329s0.103-0.884,0.084,0.02c-0.019,0.904,0.236,4.563,0.236,4.563c0.019,0.236,0.041,0.479,0.068,0.729l0.063,0.092l-0.042,0.104c0.265,2.425,0.795,5.086,0.795,5.086c0.507,2.417,1.11,3.846,1.308,4.25c0.198,0.405,0.236,0.085,0.17-0.271c-0.066-0.357,0.546,0.688,0.873,1.674c0.332,0.99,0.556,1.815,0.556,1.815s0.254,0.781,0.142,0.828c-0.113,0.046-0.292-0.293-0.292-0.293s-0.473-0.835-0.274-0.228c0.398,1.231,1.6,3.822,1.6,3.822l1.396,2.471C6.282,65.836,4.982,63.004,4.841,62.626L4.841,62.626z"/><path style="&st34;" d="M7.281,67.639c0.069,0.125,0.136,0.246,0.202,0.359L7.281,67.639z"/><path style="&st34;" d="M20.722,2.874C20.51,3.216,20.48,3.388,20.48,3.388s0.112-0.118,0.183-0.237C20.733,3.033,20.722,2.874,20.722,2.874z"/><path style="&st34;" d="M17.216,5.572c-0.417,0.048-0.677,0.25-0.677,0.25S16.889,5.761,17.216,5.572z"/><path style="&st34;" d="M84.005,4.909c0,0,0.247-0.03,0.347,0.02c0.101,0.049,0.066-0.158,0.066-0.158s-0.287-0.406-0.322-0.556c-0.32-0.089-0.611-0.1-0.611-0.1l-0.028,0.034c-0.01,0.075-0.036,0.188-0.012,0.297C83.441,4.448,83.917,4.811,84.005,4.909L84.005,4.909z"/><path style="&st34;" d="M87.487,7.88l0.095-0.152l-0.223-0.679c-0.004-0.012-0.012-0.022-0.021-0.036c-0.007,0.066-0.049,0.125-0.172,0.115c0,0-0.099-0.03-0.011,0.198C87.219,7.469,87.355,7.699,87.487,7.88L87.487,7.88z"/><path style="&st34;" d="M101.566,51.162c0,0,0.347-3.236,0.457-4.392c0.018-0.173,0.031-0.343,0.045-0.513l-0.098-0.241c-0.459,5.815-0.938,7.727-0.938,7.727s0.013-0.037,0.031-0.101c0.189-0.817,0.357-1.646,0.51-2.48C101.568,51.162,101.566,51.162,101.566,51.162L101.566,51.162z"/><linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="266.4922" y1="-395.2783" x2="295.9644" y2="-485.0349" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset=".0094" stop-color="#FCFCFC"/><stop offset=".0655" stop-color="#EEEEEE"/><stop offset=".1342" stop-color="#E5E5E5"/><stop offset=".2515" stop-color="#E3E3E3"/><stop offset=".3357" stop-color="#8A8A8A"/><stop offset=".4422" stop-color="#B8B8B8"/><stop offset="1" stop-color="#3B3B3B"/></linearGradient><path style="&st33;" d="M79.003,84.528c0,0,0.667-0.653,0.539-0.752c-0.128-0.101-0.623,0.256-0.623,0.256s-0.073,0.062-0.185,0.142l0.393-0.252c0,0-0.038,0.238-0.355,0.555c0,0-0.094,0.094-0.258,0.248c-0.957,0.938-2.386,1.998-2.386,1.998l0.396-0.211C77.844,85.703,79.003,84.528,79.003,84.528z"/><linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="460.4629" y1="512.5557" x2="509.5884" y2="573.3062" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EFF0F0"/><stop offset=".5914" stop-color="#F0F1F2"/><stop offset=".599" stop-color="#787878"/><stop offset=".6456" stop-color="#EEEFF0"/><stop offset="1" stop-color="#D8D9DB"/></linearGradient><path style="&st30;" d="M82.984,39.705l0.51-0.891l-0.127-1.667c0,0-0.085-0.893-0.566-2.28c-0.979-2.828-1.941-4.122-1.941-4.122s-0.592-1.318-1.969-1.318c-1.33,0-1.431,1.219-1.431,1.219s-0.312,0.963-0.821,1.261c-0.5,0.29-1.972,1.146-2.748,0.296c-0.941-1.026-1.461-2.225-1.56-3.372c-0.101-1.146,0.367-1.615,0.367-1.615s0.1-0.296,1.614-0.296c1.703,0,2.014-0.525,2.014-0.525s0.324-0.296,0.297-0.963s-0.284-2.097-0.779-3.001c-0.324-0.596-1.058-1.537-1.684-2.261l-0.967-0.178l0.15-0.699c-0.56-0.514-3.465-3.959-4.031-4.766c-0.564-0.808-0.65-0.993-0.75-1.262c-0.099-0.269,0.17-0.877,0.412-1.161c0.238-0.283,0.521-0.341,1.104-0.212c0.58,0.127,0.961,0.381,1.886,0.084c0.919-0.297,0.962-0.992,1.033-1.699c0.071-0.708-0.78-2.209-1.458-2.932c-0.684-0.721-1.645-0.836-2.311-0.792c-0.664,0.042-1.047,0.523-1.433,0.737c-0.382,0.213-1.103,0.425-1.429,0.284c-0.326-0.142-0.823-0.284-1.375-1.261c-0.43-0.76-0.794-1.459-0.979-1.817L63.299,4.42v0.012c0,0,0.633,1.654,1.633,2.811c0.998,1.157,2.266,0.919,2.266,0.919s0.82-0.089,1.533-0.772c0.711-0.683,1.761-0.148,2.024,0.04c0.269,0.189,0.853,0.911,1.478,2.127c0.621,1.216-0.355,2.058-0.355,2.058s-0.555,0.535-1.691,0.088c-1.14-0.443-1.813,0.259-1.986,0.614c-0.182,0.357-0.508,0.99,0.076,1.73c0.584,0.742,3.178,4.273,4.916,5.945c1.74,1.672,2.314,3.047,2.682,4.342c0.365,1.297,0.079,1.899-0.521,2.018c-0.604,0.118-1.148,0.021-2.086,0.187c-0.94,0.17-1.349,0.367-1.543,1.653c-0.199,1.286,0.562,3.373,1.67,4.361c1.106,0.989,2.334,0.386,2.76,0.228c0.427-0.159,1.352-0.653,1.681-2.027c0.188-0.783,0.851-0.721,0.851-0.721s0.563-0.071,0.854,0.117c0.287,0.19,0.633,0.525,1.402,1.87c0.772,1.346,1.453,3.146,1.724,4.738C82.924,38.35,82.729,38.576,82.984,39.705c0.256,1.128,1.078,3.245,1.466,4.074c0.383,0.832,0.78,1.662,0.989,2.107c0.205,0.445,0.531,0.782,1.443,0.802c0.908,0.02,1.273-0.228,1.541-0.662c0.27-0.435,0.612-1.088,0.713-1.316c0.1-0.228,0.467-0.911,1.146-1.02c0.685-0.108,1.762,0.01,2.106,1.198c0.313,1.071,0.76,2.622-0.158,4.5c-0.65,1.334-1.129,0.859-2.451,0.948c0,0-1.165-0.01-1.781,0.921c-0.611,0.93-0.416,2.61-0.286,3.877s0.988,3.113,1.621,3.563c0.636,0.443,0.86,0.849,1.08,1.256c0.216,0.404,0.534,1.205,0.216,3.313c-0.313,2.106-0.979,3.74-1.867,4.521c-0.024,0.021-0.05,0.043-0.07,0.063c-0.067,0.065-0.141,0.135-0.219,0.201c-0.537,0.521-0.371,0.543-0.889,0.793c-0.594,0.289-0.988,0.207-1.958,0.365c-0.97,0.16-1.583,0.327-2.088,0.821c-0.503,0.495-1.243,1.409-0.979,3.187c0.148,0.986,1.318,0.584,2.229,0.111c-0.274,0.125-0.553,0.221-0.798,0.246c-1.033,0.113-0.991-0.949-0.921-1.415c0.069-0.47,0.313-1.544,1.063-1.97s1.799-0.41,2.533-0.512c0.738-0.101,1.076-0.313,1.076-0.313s1.205-0.766,1.997-2.055c0.793-1.289,1.502-3.371,1.587-5.438c0.084-2.068-0.821-2.902-1.104-3.271c-0.283-0.366-0.799-0.203-1.431-1.729c-0.724-1.74-0.81-3.188-0.751-4.079c0.057-0.892,0.27-1.231,0.682-1.612c0.41-0.383,2.223-0.213,2.223-0.213s0.893,0.185,1.686-1.134c0.793-1.317,0.738-3.471,0.481-4.546c-0.253-1.076-0.623-2.013-2.097-2.168c-1.471-0.152-2.138,1.66-2.138,1.66s-0.297,0.693-0.608,1.092c-0.312,0.395-1.16,0.285-1.16,0.285c-0.37-0.044-0.821,0.099-1.264-0.81c-0.438-0.906-1.442-3.286-1.442-3.286c-0.339-0.809-0.556-1.512-0.688-2.055L82.984,39.705L82.984,39.705z"/><linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="272.8721" y1="-392.8257" x2="302.4699" y2="-482.9646" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st9;" d="M82.487,79.313l0.801-0.479c0.788-1.231,1.72-2.31,2.431-3.103c0.863-0.961,1.896-2.522,1.896-2.522s0.835-1.431,0.638-1.784c-0.13-0.23-0.704,0.02-1.687,0.752c-3.674,2.746-3.971,1.246-3.971,1.246c0.422,2.438,4.729-1.633,5.108-1.375c-0.063,0.563-0.457,1.172-1.25,2.25c0,0-0.388,0.555-0.78,0.953c-0.369,0.432-0.578,0.641-0.578,0.641s-0.088,0.09-0.125,0.125c-0.471,0.541-1.024,1.242-1.595,2.018c-0.019,0.021-0.104,0.113-0.125,0.143c-0.295,0.416-0.491,0.73-0.702,1.062c-0.014,0.022-0.064,0.011-0.076,0.034c0-0.002-0.013,0.014-0.025,0.037c-0.245,0.39-0.373,0.713-0.508,0.959c-0.012,0.029-0.021,0.065-0.03,0.095c0,0-0.319,0.665-0.457,1.067c-0.14,0.405-0.12,0.547-0.623,0.625c-0.504,0.078-0.276-0.053-1.021,0.196c0,0-0.403,0.199-0.938,0.571c-0.027,0.021-0.057,0.042-0.082,0.063c-0.736,0.604-1.247,1.119-1.534,1.436c-0.051,0.063-0.099,0.13-0.146,0.195c0,0-0.157,0.168,0.051,0.188c0.206,0.021,0.633-0.01,1.008-0.169l0.088-0.057c-0.186,0.103-0.373,0.174-0.513,0.162c-0.396-0.026,0.479-0.864,0.479-0.864s0.906-1.019,1.771-1.175c0.862-0.156,1.021-0.371,1.444-0.693c0.426-0.327,0.494-0.682,1.359-2.254c0.03-0.059,0.064-0.115,0.098-0.176L82.487,79.313L82.487,79.313z"/><linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="444.6943" y1="510.9561" x2="469.7246" y2="592.0699" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#FFF"/><stop offset=".7473" stop-color="#F9F9F9"/><stop offset="1" stop-color="#D5D7D8"/></linearGradient><path style="&st27;" d="M55.064,72.686l0.408-0.377c-0.34-0.668-0.693-1.269-0.693-1.269s-1.282-1.901-0.245-3.703c1.036-1.803,2.737-2.348,2.737-2.348s1.5-0.332,2.996,0.017c1.418,0.323,2.133-0.22,2.133-0.22s0.865-0.376,1.123-2.104c0.261-1.729-0.014-4.94-2.317-5.576c-2.306-0.633-3.528,0.563-3.528,0.563s-1.242,1.369-1.644,1.57c-0.404,0.2-1.024,0.562-1.024,0.562s-0.865,0.52-1.453,0.648c-0.39,0.087-1.788-1.771-1.931-3.2c-0.133-1.313-0.4-2.385-0.305-5.084c0-0.005,0-0.01,0-0.017l-0.486-0.629l0.537-0.526c0.102-3-0.418-5.119-1.188-6.463c-0.805-1.414-2.118-2.163-2.766-2.479c-0.647-0.317-2.146-0.461-3.169-0.086c-1.022,0.375-1.237,0.677-1.613,1.325c-0.376,0.65-0.835,0.606-0.835,0.606s-1.427,0.044-1.89-2.132c-0.644-3.049,0.36-4.036,0.36-4.036s0.318-0.475,1.369-0.619c1.053-0.144,1.73,0.115,2.536,0.317c0.807,0.2,1.41,0.114,2.42-0.374c1.009-0.49,1.442-1.298,1.24-2.738c-0.196-1.397-0.249-1.727-1.484-5.966l-0.874-0.458l0.582-0.579c-1.182-4.271-1.257-6.961-1.257-6.961c-0.105-0.975,0.049-1.29,0.598-1.537c0.576-0.261,1.117-0.177,1.934-0.125c0.819,0.052,1.425-0.079,1.847-0.316c0.423-0.236,1.583-0.87,1.503-2.163c-0.078-1.292-1.108-2.823-1.951-3.35c-0.844-0.528-1.952-0.317-2.56,0.132c-0.606,0.447-0.843,1.028-1.213,1.212c-0.368,0.185-0.896,0.607-1.45,0.474c-0.554-0.132-0.581-1.372-0.818-2.77c-0.155-0.915-0.276-1.614-0.342-1.989l-0.674-0.254c0.043,0.557,0.535,3.304,0.535,3.304l0.294,1.624c0,0,0,0.007,0,0.02c0.006,0.018,0.009,0.036,0.013,0.05c0.019,0.079,0.049,0.18,0.082,0.289c0.114,0.215,0.37,0.456,0.942,0.502c1.076,0.089,1.772-0.468,2.025-0.709c0.254-0.239,0.86-0.911,0.86-0.911s0.329-0.632,1.253-0.494c0.922,0.14,1.238,0.773,1.403,1.013c0.167,0.242,1.57,1.961,0.672,2.861c-0.039,0.039-0.093,0.089-0.152,0.146c-0.104,0.111-0.245,0.246-0.446,0.399c-0.675,0.517-1.226,0.48-1.678,0.442c-0.453-0.039-0.665-0.07-0.795-0.043l-0.72,0.038c-0.787,0.11-1.224,0.408-1.224,0.408c-1.8,1.065,0.735,9.287,0.735,9.287s0.671,2.029,0.973,2.979c0.301,0.949,0.496,1.625,0.791,3.264c0.295,1.639-0.231,2.092-0.525,2.251c-0.294,0.158-0.984,0.568-1.77,0.604c-0.783,0.034-1.027-0.368-2.371-0.432c-1.345-0.065-2.246,0.345-2.661,0.906c-0.417,0.561-0.913,1.862-0.675,3.4c0.237,1.541,0.504,2.064,1.092,2.748c0.59,0.681,1.165,0.97,1.978,0.696c0.792-0.266,0.764-0.756,1.173-1.164c0.517-0.519,0.855-0.792,2.063-0.821c1.208-0.029,1.979,0.288,2.594,0.784c0.619,0.496,1.934,1.646,2.294,3.356c0.359,1.713,0.424,2.268,0.424,3.676s-0.101,2.978-0.064,4.381c0.036,1.4,0.187,2.841,0.577,3.795c0.386,0.955,0.926,1.755,1.4,2.18c0.475,0.426,0.896,0.438,1.373,0.252c0.475-0.188,1.511-0.771,2.373-1.324c0.861-0.555,0.797-0.99,1.576-1.502c0.875-0.576,1.799-0.605,2.457-0.486c0.661,0.112,1.676,0.631,2.092,1.889C63.059,60.58,63,61.998,63,61.998s0.035,1.186-0.445,1.876c-0.48,0.688-1.272,0.616-1.625,0.545c-0.354-0.071-1.094-0.136-1.094-0.136s-1.451-0.165-2.563,0.094c-1.105,0.258-2.077,1.085-2.73,1.896c-0.652,0.813-0.941,1.57-0.984,2.158c-0.043,0.59,0.027,1.595,0.642,2.572c0.612,0.979,0.712,1.432,1.409,2.827c0.695,1.396,2.15,2.17,2.201,2.206c0.05,0.037,1.388,0.523,1.89,0.949c0.505,0.425,0.555,0.826,0.411,1.208c-0.145,0.381-0.438,1.094-1.604,1.604c-1.166,0.512-2.591,0.523-3.496,0.617c-0.906,0.094-2.651,0.332-3.697,0.834c-1.043,0.503-0.97,1.454-0.97,1.454s-0.028,1.556,1.337,1.983c1.365,0.434,2.64,0,3.201-0.237c0.562-0.238,1.487-0.583,1.487-0.583s1.791-0.631,2.752-0.848c0.965-0.217,1.533-0.323,2.188,0.832c0.652,1.158,1.014,1.886,1.078,2.625c0.064,0.74-0.209,1.148-0.461,1.432c-0.25,0.279-0.217,0.46-0.217,0.46c-0.105,0.873,1.182,0.763,1.182,0.763s0.041-0.004,0.11-0.018c-0.26,0.021-0.499-0.021-0.59-0.178c-0.116-0.202-0.217-0.531,0.146-0.906c0.359-0.374,0.402-0.693,0.402-0.693c0.305-1.439-1.038-3.371-1.354-3.875c-0.315-0.503-0.836-0.791-2.394-0.531c-1.556,0.26-3.386,1.037-3.386,1.037s-1.891,0.995-3.299,0.809c-1.413-0.188-1.701-1.614-1.687-2.063c0.016-0.444,0.304-0.836,1.038-1.122c0.733-0.289,2.464-0.679,4.984-0.809c2.522-0.128,3.458-1.771,3.458-1.771c0.331-0.478,0.923-1.543-0.489-2.338c-1.412-0.789-1.44-0.589-2.116-1.104c-0.68-0.521-1.412-1.153-1.701-2.034c-0.026-0.084-0.07-0.198-0.108-0.291L55.064,72.686L55.064,72.686z"/><linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="390.042" y1="485.6797" x2="390.042" y2="485.6797" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#FFF"/><stop offset=".7473" stop-color="#F9F9F9"/><stop offset="1" stop-color="#D5D7D8"/></linearGradient><path style="&st35;" d="M-16.122-14.641"/><linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="390.042" y1="485.6797" x2="390.042" y2="485.6797" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#FFF"/><stop offset=".7473" stop-color="#F9F9F9"/><stop offset="1" stop-color="#D5D7D8"/></linearGradient><path style="&st36;" d="M-16.122-14.641"/><path style="&st34;" d="M92.002,13.363c1.021,1.649,2.844,4.295,2.844,4.295s0.256,0.332,0.5,0.605l0.01-0.011c0.011-0.375-0.051-0.571-0.06-0.621l-0.091-0.274c-0.021-0.367,0.438,0.095,0.611,0.288c-0.498-0.754-0.659-0.811-0.659-0.811s-0.423-0.234-0.111,0.59c0.312,0.824-0.075,0.233-0.075,0.233c-0.924-1.177-2.838-4.293-2.838-4.293l-0.553-0.383L92.002,13.363L92.002,13.363z"/><path style="&st34;" d="M101.539,51.352c0.014-0.063,0.023-0.125,0.034-0.188c-0.004,0-0.009,0-0.009,0s0.005-0.03,0.013-0.089C101.563,51.17,101.551,51.262,101.539,51.352L101.539,51.352z"/><path style="&st34;" d="M100.822,35.679c0.088-0.033,0.188,0.1,0.188,0.1s0.135,0.189,0.289,0.033c0.107-0.104,0.155-0.353,0.025-1.257c-0.004,0.229-0.053,0.409-0.137,0.59c-0.139,0.296-0.314,0.02-0.441-0.081c-0.129-0.098-0.168,0.07-0.168,0.07l-0.004,0.162c0,0.7,0.087,2.346,0.217,3.617c0.063,0.605,0.173,1.071,0.287,1.408l0.041,0.076c0.089,0.148,0.188,0.343,0.307,0.255c0.116-0.089,0.274-0.582,0.274-0.582l0.128-0.591c0.191,0.113,0.291,0.529,0.341,0.962c-0.002-0.037-0.004-0.056-0.004-0.056s-0.144-1.324-0.3-1.313c-0.155,0.01-0.21,0.701-0.21,0.701s-0.066,0.468-0.157,0.456c-0.088-0.011-0.365,0.022-0.564-1.412c-0.201-1.436-0.158-2.949-0.158-2.949S100.732,35.713,100.822,35.679L100.822,35.679z"/><path style="&st34;" d="M99.696,28.566l0.298,0.341c0.479,1.494,0.996,3.843,1.092,4.264c-0.027-0.139-0.056-0.286-0.088-0.441c-0.288-1.454-0.711-2.896-1.006-3.832L99.696,28.566l-0.05-0.702c-0.004-0.01-0.006-0.016-0.006-0.016s-0.312-0.913-1.033-2.737c-0.725-1.824-0.848-2.458-0.848-2.458s-0.043-0.2,0.066-0.234c0.109-0.032,0.09-0.178,0.09-0.178s-0.013-0.245-0.277-0.99c-0.182-0.503-0.312-0.911-0.662-1.607c0.281,0.585,0.463,1.052,0.524,1.259l0.028,0.068c0,0,0.099,0.148,0.066,0.552c-0.027,0.403-0.146,0.452-0.146,0.452l0.022,0.14c0.141,0.538,0.418,1.187,0.418,1.187s1.065,2.709,1.748,4.54L99.696,28.566L99.696,28.566z"/><linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="274.5342" y1="-396.1577" x2="255.2091" y2="-490.1944" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st37;" d="M42.958,91.536c0.938,0.177,1.723,0.358,1.889,0.396C44.514,91.822,43.895,91.653,42.958,91.536z"/><linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="422.5586" y1="518.7568" x2="427.2878" y2="578.1768" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset=".2198" stop-color="#989A9C"/><stop offset=".2527" stop-color="#FFF"/></linearGradient><path style="&st38;" d="M20.381,74.92l0.007-0.164l-0.052-0.08c0,0-1.874-3.375-1.676-4.615c0,0,0.069-0.827,1.241-1.187c0.817-0.25,0.71,0.538,3.112,0.976c0,0,2.07,0.557,2.611-0.946c0.539-1.507-0.566-3.394-0.566-3.394s-1.45-2.656-3.244-2.756c-0.95-0.055-0.692,0.583-2.125,0.924c0,0-1.913,0.185-2.519-0.963c-0.733-1.389-1.015-2.968-1.015-4.021c0-1.058,0.045-1.001,0.126-1.405c0.045-0.219,0.186-0.548,0.248-1.09l-0.134-0.675l0.204-0.499c0.002-0.26-0.004-0.535-0.021-0.83c-0.092-1.661-0.211-4.221-0.436-5.711c-0.223-1.491-0.633-3.799-1.991-3.865c0,0-0.671-0.052-1.636,0.885c-0.882,0.856-1.682-0.708-1.726-1.663c-0.052-1.121,0.131-2.255,0.409-2.795c0.277-0.541,1.042-0.566,1.186-0.554c0.146,0.012,0.555,0.17,1.042,0.474c0.489,0.304,1.161,0.304,1.558-0.092c0.395-0.395,0.948-0.856,1.173-2.598c0.225-1.741,0.225-3.547,0.013-5.71l-0.224-0.485l1.339-0.288c-0.001-0.016-0.021-0.125-0.032-0.195c0,0,0-0.001-0.001-0.002c-0.001-0.017-0.004-0.033-0.007-0.052c0-0.002,0-0.004,0-0.005c-0.003-0.019-0.007-0.038-0.009-0.057c-0.001-0.001-0.001-0.001-0.001-0.003c-0.003-0.022-0.006-0.042-0.009-0.062c0-0.001,0-0.001,0-0.001c-0.004-0.022-0.006-0.045-0.011-0.067c0-0.003-0.001-0.006-0.001-0.007c-0.002-0.022-0.006-0.045-0.008-0.068c-0.001-0.005-0.001-0.01-0.003-0.015c-0.002-0.023-0.005-0.047-0.009-0.069c-0.001-0.004-0.002-0.01-0.002-0.014c-0.003-0.026-0.007-0.05-0.012-0.076c0-0.002,0-0.005,0-0.005c-0.004-0.025-0.008-0.05-0.012-0.076c0-0.007-0.001-0.012-0.002-0.018c-0.002-0.024-0.006-0.052-0.009-0.079c-0.001-0.005-0.001-0.011-0.003-0.021c-0.004-0.027-0.006-0.053-0.01-0.081c-0.001-0.007-0.002-0.013-0.003-0.02c-0.003-0.028-0.005-0.057-0.009-0.087c-0.001-0.003-0.001-0.008-0.003-0.013c-0.003-0.028-0.005-0.056-0.009-0.082c-0.001-0.006-0.001-0.011-0.002-0.017c-0.003-0.031-0.006-0.06-0.01-0.091c-0.001-0.007-0.001-0.014-0.002-0.02c-0.004-0.03-0.006-0.062-0.011-0.09c0-0.007-0.001-0.015-0.002-0.022c-0.003-0.031-0.006-0.063-0.01-0.094c-0.001-0.006-0.002-0.011-0.002-0.018c-0.003-0.032-0.005-0.063-0.009-0.094c0-0.003,0-0.005-0.001-0.009c-0.003-0.033-0.004-0.068-0.009-0.1c0-0.005,0-0.013-0.001-0.02c-0.002-0.035-0.005-0.065-0.007-0.099c-0.001-0.008-0.001-0.015-0.002-0.021c-0.003-0.032-0.005-0.066-0.007-0.099c0-0.005-0.001-0.011-0.001-0.02c-0.002-0.033-0.006-0.068-0.007-0.101c0-0.003-0.001-0.008-0.001-0.009c-0.002-0.033-0.004-0.066-0.007-0.1c0-0.006,0-0.012,0-0.017c-0.001-0.032-0.003-0.068-0.005-0.1c0-0.008,0-0.014-0.001-0.022c-0.001-0.033-0.004-0.067-0.005-0.098c0-0.006,0-0.013,0-0.021c-0.002-0.033-0.003-0.066-0.004-0.101c0-0.005,0-0.008,0-0.013c-0.001-0.032-0.002-0.066-0.002-0.099c0-0.003,0-0.005,0-0.009c0-0.034-0.001-0.067-0.001-0.102c0-0.005,0-0.012,0-0.016c0-0.033,0-0.067,0-0.098c0-0.005,0-0.012,0-0.019c0.001-0.032,0.001-0.065,0.001-0.096c0-0.004,0.001-0.009,0.001-0.014c0-0.033,0.001-0.066,0.003-0.1c0.052-1.243,0.291-1.751,0.291-1.751l0.058-0.166c0,0,0.46-1.458,1.152-2.458l-0.011,0.024c0,0,0.446-0.738,1.231-0.816c0.785-0.077,1.003,0.158,1.371,0.202c0.04,0.004,0.078,0.008,0.115,0.013c0.013,0.001,0.025,0.002,0.037,0.004c0.025,0.002,0.051,0.003,0.074,0.006c0.014,0.001,0.028,0.002,0.042,0.003c0.021,0.001,0.043,0.002,0.064,0.004c0.014,0.001,0.028,0.001,0.041,0.002c0.02,0.001,0.04,0.002,0.058,0.002c0.013,0.002,0.026,0.002,0.04,0.002c0.021,0.001,0.037,0.002,0.055,0.002c0.014,0,0.026,0.001,0.039,0.001c0.016,0,0.034,0.001,0.051,0.001c0.011,0,0.023,0,0.034,0c0.017,0,0.032,0,0.05-0.001c0.01,0,0.02,0,0.032-0.001c0.016,0,0.031,0,0.046-0.001c0.011,0,0.02-0.001,0.03-0.001c0.015,0,0.03-0.002,0.045-0.002c0.009,0,0.017-0.001,0.026-0.001c0.015-0.001,0.03-0.003,0.044-0.004c0.006-0.001,0.016-0.002,0.022-0.002c0.016-0.001,0.03-0.002,0.044-0.004c0.007-0.001,0.014-0.001,0.019-0.002c0.016-0.002,0.03-0.004,0.045-0.007c0.006,0,0.009,0,0.014-0.001c0.019-0.002,0.036-0.006,0.052-0.008l0,0c0.035-0.008,0.068-0.014,0.098-0.021c0,0,0-0.002,0.002-0.002c0.012-0.002,0.025-0.005,0.039-0.01c0.002,0,0.004-0.001,0.007-0.001c0.01-0.003,0.02-0.006,0.029-0.009c0.003-0.001,0.007-0.002,0.01-0.004c0.009-0.002,0.018-0.006,0.026-0.008c0.002-0.002,0.005-0.003,0.008-0.003c0.008-0.003,0.015-0.006,0.021-0.009c0.003-0.001,0.006-0.003,0.009-0.004c0.006-0.003,0.014-0.004,0.02-0.009c0.003-0.001,0.006-0.002,0.008-0.003c0.005-0.002,0.012-0.005,0.019-0.007c0.001-0.002,0.003-0.003,0.005-0.004c0.005-0.004,0.01-0.005,0.015-0.008c0.003-0.001,0.004-0.003,0.008-0.003c0.004-0.002,0.008-0.005,0.012-0.008c0,0,0.004,0,0.005-0.002c0.004-0.003,0.008-0.006,0.012-0.008c0.001-0.002,0.002-0.002,0.004-0.003c0.003-0.003,0.007-0.004,0.01-0.008c0.002,0,0.002,0,0.002-0.002c0.003-0.001,0.007-0.005,0.011-0.008c0,0,0.001,0,0.001-0.001c0.004-0.002,0.005-0.004,0.009-0.007h0.001c0.002-0.002,0.004-0.004,0.006-0.007c0.001-0.001,0.002-0.001,0.003-0.002s0.002-0.002,0.002-0.002c0.001-0.003,0.001-0.003,0.003-0.005c0.002-0.002,0.004-0.004,0.004-0.004c0.328-0.241,0.591-0.516,0.797-0.775c0.014-0.017,0.026-0.034,0.04-0.05c0.002-0.004,0.005-0.009,0.008-0.012c0.013-0.016,0.026-0.032,0.038-0.05c0.002-0.003,0.006-0.006,0.007-0.01c0.012-0.018,0.025-0.032,0.038-0.05c0,0,0,0,0.001,0c0.039-0.055,0.075-0.109,0.109-0.159c0-0.003,0.002-0.006,0.003-0.008c0.01-0.015,0.021-0.028,0.03-0.044c0.001-0.003,0.004-0.007,0.007-0.01c0.008-0.016,0.017-0.029,0.024-0.042c0.002-0.004,0.005-0.009,0.009-0.013c0.008-0.014,0.017-0.028,0.023-0.042c0.001-0.001,0.001-0.002,0.002-0.002c0.017-0.028,0.032-0.055,0.046-0.079c0.002-0.003,0.004-0.008,0.006-0.013c0.006-0.01,0.01-0.021,0.017-0.029c0.003-0.007,0.007-0.014,0.012-0.02c0.004-0.008,0.009-0.017,0.014-0.024c0.002-0.008,0.006-0.017,0.01-0.023c0.004-0.007,0.009-0.016,0.012-0.023c0.004-0.006,0.006-0.014,0.011-0.021c0.002-0.006,0.007-0.013,0.01-0.021c0.066-0.128,0.097-0.205,0.097-0.205c0.593-1.459,0.052-2.936-0.21-3.225c-0.32-0.353-1.041-0.882-1.041-0.882s-0.288-0.241-0.751-0.144c0.349-0.049,0.791,0.091,0.966,0.558c0.277,0.734,0.376,1.335,0.212,2.33c0,0-0.26,1.387-1.384,2.233c-1.125,0.848-1.923,0.096-2.885,0.13c-0.962,0.032-1.516,0.701-1.809,1.157c-0.293,0.457-1.417,2.2-1.319,5.067c0.097,2.868,0.291,4.301,0.325,5.558c0.033,1.205,0.178,3.976-0.635,5.278c-0.815,1.303-1.628,0.65-2.2,0.309c-0.571-0.341-1.223-0.245-1.744,0.131c-0.521,0.375-0.833,1.124-0.848,3.324c-0.016,2.364,1.532,2.606,1.532,2.606s0.293,0.146,0.945-0.537c0,0,0.651-0.685,1.253-0.603c0.604,0.082,0.995,0.716,1.255,1.808c0.261,1.092,0.796,5.621,0.717,8.668c-0.034,1.271-0.62,1.286-0.36,3.617c0,0,0.409,3.13,1.401,4.089c0.995,0.962,2.378,0.781,2.706,0.75c0.324-0.032,0.7-0.26,0.7-0.26s0.309-0.197,0.537-0.374c0.23-0.182,0.522-0.428,1.011-0.277c0.489,0.146,1.645,0.896,2.557,2.571c0.915,1.678,0.496,3.317-0.26,3.521c-0.668,0.182-0.848,0.229-1.971-0.05c-1.124-0.274-1.451-0.567-1.957-0.766c-0.504-0.196-1.043-0.263-1.547,0.114c-0.505,0.373-1.345,1.057-0.343,3.32c0.961,2.174,1.692,3.797,3.518,5.623c-0.522-0.607-0.956-1.188-1.427-1.871L20.381,74.92L20.381,74.92z"/><linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="237.3721" y1="-388.3604" x2="218.8474" y2="-478.5023" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st39;" d="M22.494,7.387l-0.05,0.025C22.45,7.41,22.469,7.401,22.494,7.387z"/><linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="259.9063" y1="-479.3379" x2="259.8987" y2="-479.3752" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st40;" d="M46.028,92.85c0.13,0.014,0.26,0.026,0.391,0.041c-0.114-0.016-0.31-0.039-0.561-0.074C45.916,92.828,45.972,92.838,46.028,92.85L46.028,92.85z"/><path style="&st29;" d="M24.089,5.489c-0.649,0.36-0.7-0.016-1.141,0.017c-0.439,0.033-1.026,0.212-1.596,1.043c-0.571,0.831-0.586,1.89,0.326,1.417c0,0,0.436-0.428,0.815-0.579c0.081-0.043,0.24-0.126,0.406-0.174l0.144-0.117c0,0,0.424-0.491,1.073-0.333c0.648,0.156,1.119-0.129,1.119-0.129c1.01-0.761,1.655-2.184,1.655-2.184l0.987-1.998l-0.826-1.336c0,0-0.698,1.489-1.383,2.53C24.986,4.692,25.033,4.972,24.089,5.489L24.089,5.489z"/><path style="&st29;" d="M19.871,16.292c0,0-0.424,1.89,1.156,1.597c0,0,0.006-0.002,0.022-0.007c-0.062,0.003-0.089-0.006-0.089-0.006c-0.025-0.497,0.149-1.432,0.49-2.261c0.341-0.83,1.075-2.254,1.075-2.254s1.047-1.791,1.467-2.89c0.42-1.102,0.416-1.939,0.416-1.939s-0.8-1.019-0.915-1.176c-0.115-0.157-0.272-0.223-0.272-0.223c-0.054,0.019-0.103,0.036-0.146,0.051c0.115-0.007,0.221,0.021,0.283,0.114c0.213,0.31-0.39,2.036-0.39,2.036s-0.522,1.238-1.548,3.03C20.393,14.157,19.871,16.292,19.871,16.292L19.871,16.292z"/><linearGradient id="SVGID_17_" gradientUnits="userSpaceOnUse" x1="268.9033" y1="-394.6382" x2="249.4966" y2="-489.0725" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st41;" d="M38.185,89.697l0.166,0.02c-0.134-0.119-0.305-0.236-0.497-0.347c0.184,0.113,0.489,0.358,0.312,0.665c-0.245,0.424-0.048,0.457,0.489,0.863c0,0,0.022,0.013,0.061,0.033c-0.156-0.107-0.253-0.234-0.156-0.362c0.125-0.166,0.136-0.334,0.065-0.499L38.185,89.697L38.185,89.697z"/><linearGradient id="SVGID_18_" gradientUnits="userSpaceOnUse" x1="254.4561" y1="-391.5991" x2="235.0337" y2="-486.1104" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st42;" d="M24.437,82.749c-1.245-1.185,1.595-0.118,1.595-0.118s0.619,0.262,0.343-0.385c-0.246-0.57-1.373-1.963-2.543-3.219l0.144,0.156c0,0,2.346,2.721,2.183,2.966c-0.164,0.245-1.108-0.325-1.108-0.325s-1.401-0.539-1.206,0.13c0.143,0.491,1.059,1.271,1.536,1.649C25.109,83.372,24.798,83.09,24.437,82.749z"/><linearGradient id="SVGID_19_" gradientUnits="userSpaceOnUse" x1="262.6514" y1="-392.9692" x2="243.1559" y2="-487.8355" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st43;" d="M26.977,84.73c0.424,0.256,0.903,0.513,1.365,0.676c0,0,0.831,0.293,1.337-0.114c0.503-0.403,0.503-0.601,1.238-0.243c0,0,1.388,0.696,2.382,1.444c0.98,0.735,3.557,2.336,4.396,2.791c-0.764-0.417-3.712-2.365-4.633-2.99c-0.936-0.633-2.574-1.698-3.297-1.476c-0.554,0.172-0.474,0.396-0.804,0.555c-0.331,0.158-0.688,0.055-1.504-0.383C27.291,84.9,27.134,84.818,26.977,84.73L26.977,84.73z"/><linearGradient id="SVGID_20_" gradientUnits="userSpaceOnUse" x1="271.5479" y1="-390.9575" x2="251.1904" y2="-490.0176" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st44;" d="M39.903,91.448c0.37,0.104,0.672,0.06,0.787,0.035c-0.678,0.04-1.35-0.269-1.35-0.269s-0.067-0.021-0.165-0.061C39.413,91.268,39.689,91.385,39.903,91.448z"/><linearGradient id="SVGID_21_" gradientUnits="userSpaceOnUse" x1="274.6582" y1="-395.8442" x2="255.2559" y2="-490.2569" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset="1" stop-color="#E4E5E6"/></linearGradient><path style="&st45;" d="M44.293,92.169c0,0-1.344-0.163-1.939-0.163c0,0-0.037,0.064,0.226,0.158c-0.021-0.021-0.031-0.049,0.189,0c0.304,0.064,2.018,0.225,2.465,0.158c0.448-0.068-0.091-0.278-0.091-0.278s-0.088-0.041-0.267-0.102C44.553,92.201,44.293,92.169,44.293,92.169L44.293,92.169z"/><path style="&st34;" d="M4.662,62.045c0.085,0.143,0.198,0.432,0.462,0.725c0.146,0.16,0.266,0.072,0.162-0.525c-0.253-0.182-0.407-0.318-0.464-0.371c-0.113-0.013-0.263-0.297-0.263-0.297s-0.471-0.835-0.274-0.227c0.398,1.23,1.6,3.821,1.6,3.821l1.396,2.47c-0.999-1.803-2.299-4.633-2.44-5.013C4.691,62.223,4.577,61.904,4.662,62.045L4.662,62.045z"/><path style="&st34;" d="M1.547,32.696l0.032-0.643c0.027-0.122,0.057-0.241,0.087-0.36c0.712-2.789,1.069-3.858,1.425-4.649c0.356-0.792,0.398-0.245,0.398-0.245s0,0.209,0.136,0.234c0.135,0.023,0.324-0.32,0.494-0.826c0.17-0.504,0.604-1.745,0.693-2.212c0.135-0.704-0.051-0.358-0.115-0.354c-0.108,0.005-0.126-0.091-0.113-0.306c0,0,0.382-2.122,3.064-6.563c0.18-0.17,0.321-0.307,0.47-0.449c-0.055-0.052-0.033-0.265,0.001-0.32c0.136-0.214,0.275-0.435,0.422-0.661l-0.09,0.504c0,0-1.85,2.492-3.104,5.694c0,0-0.342,0.835-0.359,1.094c-0.025,0.154-0.104,0.739,0.152,0.582l0.065-0.048c-0.093,0.484-0.295,1.37-0.607,2.325c-0.288,0.878-0.573,1.633-0.841,2.078l-0.002-0.004c-0.08,0.067-0.098-0.016-0.146-0.21c-0.048-0.198-0.113-0.198-0.113-0.198c-0.179,0-0.324,0.202-0.41,0.359c-0.04,0.056-0.089,0.19-0.089,0.19s-0.461,0.934-1.281,4.26c-0.822,3.328-0.836,6.14-0.836,6.14s-0.084,1.309-0.21,1.379c-0.126,0.07-0.097-0.056-0.097-0.056s-0.045-0.052-0.114,0.045c0,0,0.02-0.76,0.044-0.875c0,0,0.041-0.206,0.119-0.206s0.006,0.125,0.048,0.16c0.039,0.032,0.084,0.03,0.075-0.178c-0.005-0.176,0.147-2.816,0.621-5.312L1.547,32.696L1.547,32.696z"/><path style="&st34;" d="M0.392,41.994c0-0.002,0-0.004,0-0.005c0,0,0.018,0.217,0.042,0.356l-0.003,0.01c0.078,0.357,0.187,0.357,0.187,0.357c0.008-0.096,0.087-0.273,0.183-0.458c0.007,0.106,0.007,0.231-0.004,0.375c-0.037,0.537-0.019,2.466,0.209,4.28c0.225,1.815,0.367,3.349,0.394,3.594c0.029,0.245,0.498,3.283,1.025,5.089c0.285,0.967,0.422,1.344,0.483,1.424l0.008,0.049c0,0,0.097,0.184,0.348,0.32c0,0,0.111-0.097,0.112-0.412c0.018,0.031,0.037,0.065,0.057,0.105c-0.083,0.262-0.105,0.426-0.105,0.426l0,0c-0.042-0.043-0.06-0.031-0.046,0.045c0.067,0.357,0.027,0.68-0.169,0.272c-0.198-0.403-0.8-1.832-1.307-4.251c0,0-0.531-2.659-0.795-5.084l0.042-0.105L0.989,48.29c-0.027-0.248-0.048-0.491-0.067-0.729c0,0-0.255-3.657-0.237-4.562c0.019-0.904-0.085-0.02-0.085-0.02s-0.021,0.219-0.028,0.329c-0.008,0.109-0.103,0.352-0.136-0.246C0.459,43.322,0.392,42.261,0.392,41.994L0.392,41.994z"/><path style="&st34;" d="M24.672,1.974l-0.53-0.753l-0.066-0.065c0,0-0.131-0.136-0.896,0.038l-0.11,0.022c0,0,0.38-0.094,0.168,0.191c-0.212,0.285-0.56,0.496-1.172,1.15c-0.612,0.655-0.411,0.803-0.01,0.668c0.401-0.138,1.188-0.499,2.606-1.243L24.672,1.974z"/><path style="&st34;" d="M23.106,1.21c-0.022,0.003-0.036,0.006-0.036,0.006L23.106,1.21z"/><path style="&st34;" d="M23.637,1.811c0.31-0.272,0.429-0.484,0.454-0.641l-0.015-0.014c0,0-0.131-0.136-0.896,0.038l-0.075,0.015c0.09-0.015,0.303-0.032,0.133,0.198c-0.212,0.285-0.56,0.496-1.172,1.151c-0.612,0.656-0.411,0.803-0.01,0.667c0.106-0.038,0.239-0.088,0.4-0.157C22.599,2.755,23.046,2.325,23.637,1.811z"/><path style="&st34;" d="M83.482,4.115l-0.2,0.235c0,0,0.136,0.081,0.208,0.141c0.008,0.005,0.014,0.01,0.021,0.012c-0.043-0.034-0.07-0.056-0.07-0.056c-0.023-0.109,0.004-0.223,0.014-0.297L83.482,4.115c0,0,0.055,0.002,0.143,0.011L83.482,4.115L83.482,4.115z"/><path style="&st6;" d="M62.559,90.319c0,0,1.686-0.187,3.239-0.691c1.558-0.504,1.935-0.981,1.874-1.341c-0.037-0.238-0.396-0.305-0.906-0.238c0.271-0.021,0.514,0.032,0.354,0.332c-0.313,0.582-0.861,0.782-0.861,0.782s-0.267,0.19-0.89,0.371c-0.806,0.245-1.794,0.375-2.335,0.438c-0.691,0.082-0.521-0.033-1.465,0.291c-0.023,0.016-0.047,0.025-0.065,0.043c-0.289,0.237,1.071,0.514,1.071,0.514s1.302,0.361,3.257,0.23l0.067-0.021c0.267-0.078,0.533-0.161,0.8-0.245c-2.021,0.457-3.324,0.149-3.737,0.095c-0.434-0.058-0.777-0.144-0.88-0.359C61.98,90.305,62.559,90.319,62.559,90.319L62.559,90.319z"/><path style="&st34;" d="M63.301,4.417l0.717,0.076c1.429-0.405,2.651-0.776,2.651-0.776s1.265-0.41,1.901-0.636c0.635-0.227,1.09-0.313,1.656-0.41c0.563-0.096,1.309-0.14,1.709-0.131c0.398,0.007,0.528,0.122,0.528,0.122s0.166,0.131,0.245,0.27c0.077,0.138,0.74,1.891,2.975,2.005c2.231,0.112,2.261-1.096,2.063-1.464c-0.226-0.427-0.896-0.863-0.896-0.863s-0.898-0.575-1.09-0.846c-0.192-0.271,0.033-0.358,0.104-0.376c0.066-0.018,2.433-0.497,2.729-0.608l0.021-0.02l-0.563-0.174c0,0-0.119,0.134-0.789,0.312c-0.67,0.179-1.233,0.246-1.742,0.313c-0.504,0.067-0.504,0.239-0.504,0.239l-0.879,1.406c0,0-0.029,0.104,0.043,0.305c0.073,0.202,0.41,0.448,0.41,0.448s0.573,0.424,0.99,0.699c0.418,0.275,0.395,0.373,0.395,0.373c-1.123,0.095-1.418-0.048-1.875-0.276c-0.445-0.223-0.76-0.729-0.922-1.086c-0.162-0.357-0.521-0.663-0.521-0.663c-0.589-0.336-1.696-0.343-2.813-0.15c-1.115,0.194-2.656,0.707-2.923,0.812c-0.271,0.104-1.616,0.551-2.309,0.729c-0.694,0.179-1.224,0.357-1.646,0.47c-0.426,0.11-3.431,1.005-4.557,1.339c-1.124,0.333-1.848,0.461-1.848,0.461c-1.688,0.171-2.193-0.134-2.193-0.134c-0.297-0.125-0.262-0.527-0.262-0.527l0.009-1.147c0,0-0.029-0.433-0.356-0.611c-0.328-0.179-0.779-0.252-1.593-0.29c-0.811-0.038-1.683,0.044-2.093,0.134c-0.408,0.09-1.19,0.313-1.764,0.952c-0.573,0.641-0.481,1.141-0.481,1.141s0.035,0.683,0.088,1.19c0.052,0.504,0.484,0.662,0.484,0.662s-0.744,0.532-3.045,1.206c-2.209,0.648-3.682,0.774-3.682,0.774l0.678,0.254c0,0,5.468-1.015,7.148-2.616c0,0,0.624-0.293,0.02-0.88c-0.606-0.585-0.897-0.761-0.897-0.761s-0.41-0.224,0.019-0.771c0.43-0.547,0.923-0.795,1.352-0.933c0.429-0.138,1.753-0.25,2.925-0.093c0,0,0.491,0.041,0.459,0.408c-0.034,0.366-0.088,0.872-0.077,1.028c0.008,0.158,0.023,0.515,0.398,0.845c0.378,0.332,1.099,0.453,1.099,0.453s1.257,0.228,2.843-0.217c1.584-0.445,3.642-1.14,5.431-1.629L63.301,4.417L63.301,4.417z"/><path style="&st12;" d="M-16.122-14.641"/><path style="&st22;" d="M48.462,6.628c0.31,0.207,0.476,0.221,0.5,0.421c0.055,0.339-0.56,0.64-0.56,0.64l-0.006-0.011c0,0-0.431-0.157-0.484-0.664c-0.052-0.505-0.088-1.19-0.088-1.19s0.001,0.2,0.046,0.26C48.004,6.256,48.087,6.378,48.462,6.628z"/><path style="&st20;" d="M82.447,79.307l0.451,0.17c1.104-0.617,1.496-0.809,1.759-0.963c1.183-0.703,2.592-1.563,2.963-1.855c0,0,0.761-0.518,0.116,0.195s-0.969,1.007-0.969,1.007s-0.625,0.626-0.471,0.782c0,0,0.166,0.246,1.193-0.687c1.023-0.929,2.15-2.258,2.275-2.44c0.127-0.188,0.146-0.293,0.146-0.293s0.107-0.215,0.273-0.393c0.145-0.15,1.377-1.496,1.994-2.121c0,0,0.002,0.001,0.006,0.003c0.273-0.362,0.541-0.729,0.806-1.102c-0.358,0.379-1.724,1.829-2.483,2.684c0,0-0.713,0.763-0.938,1.056s-0.225,0.47-0.225,0.47s-0.117,0.196-0.392,0.519s-1.24,1.186-1.24,1.186s-0.577,0.47-0.754,0.478c-0.179,0.011,0.431-0.538,0.431-0.538s0.588-0.625,0.967-1.123c0.382-0.498,0.137-0.47,0.137-0.47s-0.186-0.049-0.986,0.459c-0.8,0.508-1.367,0.858-1.367,0.858s-1.722,0.986-2.814,1.623c-1.096,0.636-3.6,1.908-5.021,2.492c-1.43,0.588-2.162,0.715-2.035,0.527c0.127-0.186,0.461-0.459,0.461-0.459s0.399-0.4,0.399-0.803c0,0,0.128-0.586-1.604-0.223c-1.729,0.36-3.293,1.213-3.293,1.213s-2.571,1.182-1.965,1.887c0,0,0.117,0.186,0.635,0.352c0.52,0.166-0.92,0.606-0.92,0.606c-1.365,0.448-2.413,0.651-3.74,0.926c-1.963,0.403-3.564,0.761-4.165,0.894c-0.165,0.035-0.253,0.059-0.253,0.059s-1.212,0.292-3.229,1.072c-2.015,0.783-5.972,1.43-5.972,1.43s-2.542,0.293-2.777,0.627c-0.234,0.331,0.177,0.499,0.177,0.499s0.362,0.224,1.671,0.283c0,0,0.451,0,0.471,0.036c0.018,0.039,0.046,0.068-0.235,0.156c-0.286,0.088-0.854,0.314-2.778,0.558c-1.936,0.245-1.896-0.067-1.896-0.067s-0.01-0.076,0.078-0.216c0.087-0.134,0.009-0.369-0.293-0.535c0,0-0.419-0.272-1.829-0.262c-1.408,0.009-4.212,0.017-6.833-0.14c-2.374-0.143-5.59-0.551-6.099-0.664c0,0-0.117-0.029-0.206-0.117c-0.088-0.09-0.646-0.422-1.164-0.733c-0.517-0.313-2.073-0.907-2.073-0.907s-2.011-0.783-1.945-0.521c0.015,0.063,0.13,0.153,0.268,0.246c0.351,0.188,0.704,0.375,1.06,0.56l0.002-0.002c0,0-0.743-0.402-0.538-0.402s0.438,0.109,0.438,0.109s1.213,0.332,1.966,0.686c0.753,0.353,1.407,0.83,1.407,0.83s0.929,0.549,2.319,0.732c1.346,0.182,3.174,0.389,3.777,0.448l0.594-0.272l0.433,0.354c1.106,0.068,2.575,0.146,2.575,0.146s2.976,0.111,4.605-0.019c0.733-0.063,0.507,0.317,0.507,0.317s-0.214,0.354,0.206,0.529c0,0,0.771,0.439,3.343,0.157c2.573-0.286,3.138-0.862,3.138-0.862s0.299-0.275-0.351-0.398c-0.513-0.1-0.513-0.051-1.175-0.117c-0.665-0.067-0.998-0.205-0.557-0.323c0.441-0.114,1.174-0.175,1.174-0.175s2.249-0.313,4.066-0.783c0,0,1.938-0.458,3.861-1.134c0.756-0.265,1.395-0.459,1.887-0.599l0.438-0.644l0.644,0.372c0.065-0.014,0.103-0.021,0.103-0.021s2.306-0.539,3.274-0.703c0.966-0.168,3.154-0.637,4.087-1.086c0.928-0.448,1.396-0.805,1.505-1.075c0.107-0.272-0.393-0.431-0.393-0.431s-0.588-0.138-0.508-0.34c0.075-0.205,0.293-0.382,1.213-0.793c0.918-0.41,2.07-0.859,3.227-1.144c1.154-0.282,0.732,0.194,0.732,0.194s-0.692,0.705-0.783,0.979c-0.086,0.273,0.029,0.285,0.119,0.333c0.088,0.05,0.646,0.028,1.022-0.067c0.383-0.099,3.464-1.271,5.341-2.347c0.049-0.026,0.094-0.054,0.139-0.08L82.447,79.307z"/><linearGradient id="SVGID_22_" gradientUnits="userSpaceOnUse" x1="221.1826" y1="-454.5649" x2="221.373" y2="-454.5649" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#808080"/><stop offset=".0868" stop-color="#7A7A7A"/><stop offset=".36" stop-color="#6B6B6B"/><stop offset=".5192" stop-color="#686868"/><stop offset=".6377" stop-color="#5F5F5F"/><stop offset=".7431" stop-color="#4E4E4E"/><stop offset=".8408" stop-color="#383838"/><stop offset=".9324" stop-color="#1B1B1B"/><stop offset="1" stop-color="#000"/></linearGradient><path style="&st13;" d="M7.432,68.01l0.178,0.131c-0.105-0.099-0.167-0.155-0.167-0.155s-0.008,0.003-0.024,0.003C7.423,67.993,7.429,68.002,7.432,68.01L7.432,68.01z"/><linearGradient id="SVGID_23_" gradientUnits="userSpaceOnUse" x1="221.4043" y1="-449.8027" x2="316.0254" y2="-449.8027" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#808080"/><stop offset=".0868" stop-color="#7A7A7A"/><stop offset=".3817" stop-color="#828282"/><stop offset=".5185" stop-color="#808080"/><stop offset=".5677" stop-color="#797979"/><stop offset=".6027" stop-color="#6E6E6E"/><stop offset=".608" stop-color="#6B6B6B"/><stop offset="1" stop-color="#4E4E4E"/></linearGradient><path style="&st7;" d="M90.412,59.954l-0.371-0.021c-1.807,1.463-2.342,1.938-3.781,2.955c0,0-1.644,1.228-3.44,2.196c-1.804,0.97-3.919,0.853-3.919,0.853s-0.573-0.062-0.295-0.477c0.275-0.415,0.634-1.425,0.771-1.938c0.141-0.516,0.415-1.82-0.633-2.235s-3.018,0.196-3.018,0.196s-4.525,1.205-6.371,3.23c-1.793,1.969-0.286,2.846-0.286,2.846s0.702,0.49,1.386,0.73c0.645,0.229,0.516,0.436,0.354,0.555c0,0-2.021,1.287-4.408,1.974c0,0-3.268,1.001-6.441,1.206c-3.154,0.203-4.495,0.283-4.495,0.283l-0.399,0.379l-0.758-0.252c-1.283,0.154-3.455,0.463-5.596,0.979c-2.622,0.64-5.123,1.147-6.903,2.296c0,0-1.333,0.887-0.566,1.746c0.765,0.862,1.565,1.23,1.565,1.23s0.472,0.207,0.464,0.336c-0.009,0.164-0.015,0.309-0.367,0.512c0,0-1.394,0.814-4.108,0.859c-2.714,0.045-3.911,0.021-4.707-0.695c-0.658-0.591,0.165-1.844,0.165-1.844s0.33-0.612,0-1.453c-0.33-0.84-2.218-0.854-2.218-0.854l-2.615-0.134c-3.095-0.081-7.182-0.427-9.001-0.653c0,0-0.012-0.002-0.033-0.006l-0.006,0.166l-0.721-0.303c-1.139-0.221-3.243-0.668-4.075-1.084c-0.759-0.38-1.167-0.313-1.066-1.102c0.101-0.769-0.753-1.836-0.753-1.836s-1.188-1.287-2.257-2.086c-1.069-0.804-1.523-0.564-1.523-0.564s-0.484,0.258-0.049,1.296c0.436,1.04,0.86,1.403,0.86,1.403s0.208,0.22,0.089,0.279c-0.118,0.06-0.484-0.219-0.789-0.478c-0.253-0.21-1.885-1.742-2.456-2.276l0.105,0.356c0.019,0.028,0.035,0.062,0.052,0.086c0.184,0.291,0.855,1.269,2.155,2.28c1.549,1.213,1.559,0.729,1.559,0.729s0.061-0.399-0.297-0.84c-0.359-0.44-0.934-1.373-0.791-1.715c0.144-0.339,0.309-0.31,0.309-0.31s0.133-0.051,0.596,0.299c0.462,0.351,1.498,1.076,2.011,1.703c0.513,0.623,0.48,1.181,0.48,1.181s-0.102,0.563,0.453,1.17c0.553,0.604,1.733,1.714,5.859,2.351c0.025,0.004,0.034,0.006,0.059,0.01l0.193-0.551l0.573,0.663c3.598,0.521,5.555,0.563,5.555,0.563s4.709,0.162,5.982,0.162c1.272,0,1.035,0.666,1.035,0.666s-0.072,0.359-0.225,0.646c-0.155,0.287-0.524,1.365-0.144,1.939c0,0,0.585,1.427,4.381,1.527c0,0,3.324,0.268,5.643-0.688c2.319-0.954,0.226-2.275,0.226-2.275s-0.794-0.481-1.13-0.739c-0.308-0.234-0.184-0.481-0.121-0.646c0.06-0.162,0.297-0.359,0.563-0.492c0.266-0.134,1.239-0.654,5.365-1.722c4.124-1.069,6.587-1.183,6.587-1.183s0.02-0.002,0.055-0.004l0.338-0.656l0.854,0.556c0.732-0.06,1.681-0.129,2.526-0.171c1.691-0.082,4.341-0.471,5.879-0.807c1.54-0.343,3.869-1.062,5.592-1.951c1.725-0.895,1.809-1.519,1.809-1.519s0.328-0.475-0.392-0.995c-0.719-0.523-1.036-0.382-1.673-1.027c-0.637-0.646,0.557-1.62,0.557-1.62s0.612-0.861,4.021-2.175c3.403-1.313,3.979-0.873,4.153-0.729s0.195,0.615,0.123,0.935c-0.069,0.317-0.494,1.455-0.721,2.053c-0.227,0.594-0.316,1.406,0.605,1.601c0.923,0.194,2.215-0.008,3.428-0.442c2.893-1.033,3.756-2.295,8.534-5.764c0.012-0.008,0.021-0.017,0.03-0.021L90.412,59.954l0.689,0.108c1.978-1.573,3.869-3.571,3.869-3.571s1.258-1.261,1.889-2.356c0.595-1.026,0.027,0.89,0.027,0.89s-0.32,1.516,0.19,2.077c0.405,0.445,1.563-0.795,1.563-0.795s0.688-0.789,0.965-2.061c0.408-1.875,0.185-2.248,0.185-2.248s-0.246-0.389-0.093-0.852c0.154-0.459,1.158-3.047,1.98-4.01l0.502-0.563c0-0.008,0.002-0.02,0.002-0.027l-0.224-0.557l0.304-0.512c0,0-0.279,0.322-1.404,2.177c-1.266,2.087-1.467,3.771-1.467,3.771s-0.119,0.653-0.054,1.034c0.063,0.355,0.188,0.519,0.192,0.622c0.009,0.104-0.073,0.959-0.508,1.773c-0.438,0.814-0.815,1.031-0.815,1.031s-0.756,0.545-0.86,0.157c-0.104-0.39-0.074-0.72-0.035-0.966c0.035-0.248,0.289-1.579,0.252-2.072c-0.035-0.494-0.479-0.098-0.479-0.098s-0.104,0.119-0.298,0.366s-1.288,1.637-1.705,2.125c-0.988,1.157-1.886,1.989-4.292,3.93c-0.007,0.003-0.015,0.011-0.019,0.015L90.412,59.954L90.412,59.954z"/><linearGradient id="SVGID_24_" gradientUnits="userSpaceOnUse" x1="214.5928" y1="-431.356" x2="314.4043" y2="-431.356" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#555555"/><stop offset="1" stop-color="#231F20"/></linearGradient><path style="&st11;" d="M1.193,48.543l0.104,0.975c0.235,0.285,0.577,0.677,1.071,1.187c1.084,1.121,1.427,0.416,1.427,0.416s0.253-0.705-0.054-1.985C3.434,47.85,3.488,47.09,4.066,47.11c0.578,0.019,2.258,0.361,2.782,1.752c0,0,0.217,0.649,0.018,1.479c-0.2,0.834-0.162,1.57-0.018,2.295c0.145,0.725,0.759,1.407,1.464,1.971c0.706,0.562,2.746,1.535,4.734,1.66c1.987,0.127,2.601,0.021,2.601,0.021l0.746-0.767l0.134,0.668c0.812-0.09,2.116-0.229,3.62-0.393c2.528-0.271,4.227-0.544,5.798-0.308c1.573,0.235,2.079,1.462,2.079,1.462s0.108,0.314-0.253,0.544c-0.349,0.224-0.749,0.547-0.948,0.89c-0.199,0.346-0.411,1.068,0.16,2.035c0.572,0.963,2.142,1.592,3.478,1.432c1.335-0.155,3.335-0.67,4.52-0.979c1.287-0.337,2.424-0.971,2.572-1.98c0.147-1.008-1.534-2.295-1.534-2.295s-0.812-0.609-0.91-0.75c-0.1-0.139,0.099-0.197,0.099-0.197s0.949-0.229,1.357-0.414c0.404-0.189,1.522-0.646,3.353-1.219s5.608-1.248,5.608-1.248s2.084-0.332,4.685-0.543l0.622-0.702l0.485,0.625c0.409-0.024,0.825-0.046,1.243-0.063c3.572-0.129,5.344-0.554,7.242-0.979c1.897-0.427,4.568-1.978,4.965-2.276c0.396-0.295,1.229-0.66,1.396-1.957c0.168-1.295-1.364-2.157-1.364-2.157s-1.218-0.644-1.475-0.93c-0.258-0.287-0.02-0.562-0.02-0.562s0.689-1.485,2.896-2.354c2.205-0.872,3.689-1.107,4.618-1.208c0.932-0.099,1.245,0.237,1.374,0.396c0.128,0.157,0.128,0.485,0.021,0.821c-0.102,0.308-0.444,1.038-0.645,1.395c-0.197,0.356-0.523,1.216-0.316,1.622c0.208,0.405,0.843,0.593,1.662,0.445c0.821-0.149,2.988-0.761,4.888-1.553c1.9-0.792,5.073-2.345,5.073-2.345s0.009-0.004,0.022-0.012l0.086-0.729l0.729,0.295c1.02-0.562,2.764-1.58,4.01-2.631c1.871-1.573,3.699-3.225,4.166-3.639c0.465-0.417,0.892-0.752,1.307-0.732c0.414,0.021,0.732,0.317,0.988,1.434c0.258,1.118,0.308,2.038,0.426,2.582c0.117,0.543,0.285,1.175,0.931,1.304c0.646,0.129,1.513-0.434,1.838-0.713c0.33-0.276,0.92-1.176,0.882-2.382c0,0,0.068-1.604-0.761-3.127c0,0-0.351-0.614-0.479-0.782c-0.088-0.118-0.155-0.238-0.01-0.525c0.148-0.286,0.467-0.821,1.062-1.156c0.448-0.256,0.88-0.316,1.128-0.396c0,0,0.275-0.067,0.626-0.261l-0.126-0.412l0.289,0.316c0.404-0.239,0.652,0.045,0.652,0.045l-0.392-0.501l0.119-0.484c0,0-0.304-0.163-0.685-0.088c-0.383,0.078-0.42,0.362-1.014,0.458c-0.593,0.096-1.275,0.306-1.945,1.319c-0.67,1.011,0,2.271,0,2.271s0.359,0.592,0.533,0.896c0.172,0.306,1.066,2.215,0.037,3.608c0,0-0.552,0.643-1.525,0.86c-0.86,0.19-0.642-0.816-0.729-1.355c0,0-0.129-2.281-1.237-3.588c-0.976-1.146-2.746,0.888-3.629,1.566c-0.822,0.629-3.228,3.112-6.684,4.925l-0.51,0.892l-0.324-0.472c-1.658,0.827-5.418,2.656-7.87,3.514c0,0-1.875,0.762-2.64,0.782c0,0-0.17,0.006-0.034-0.179c0.133-0.185,0.276-0.322,0.507-0.737c0.23-0.418,0.646-1.357,0.646-2.327c0-0.969-1.119-1.917-2.68-1.748c-1.561,0.167-3.052,0.6-4.849,1.292c-1.796,0.692-3.343,2.159-3.55,3.375c-0.209,1.216,1.105,1.92,1.105,1.92s1.484,0.751,1.674,1.157c0.188,0.406,0.049,0.783,0.049,0.783s-0.129,0.406-0.783,0.782c-0.649,0.377-2.42,1.287-2.42,1.287s-2.207,1.217-5.562,1.512c0,0-3.058,0.26-4.817,0.348c-0.022,0.002-0.046,0.002-0.069,0.003l-0.541,0.53l-0.587-0.449c-1.64,0.136-3.54,0.359-3.54,0.359s-4.29,0.609-8.219,1.822c-3.336,1.027-3.971,1.594-3.971,1.594s-0.711,0.596-0.118,1.453c0,0,0.341,0.539,1.03,1.08c0.685,0.541,1.237,1.057,1.159,1.317c-0.08,0.265-0.29,0.382-0.29,0.382s-0.961,0.856-4.894,1.518c0,0-2.531,0.488-3.31-0.275c-0.778-0.766-0.435-1.279-0.435-1.279s0.052-0.173,0.62-0.527c0,0,0.951-0.596,0.647-1.727c-0.303-1.135-2.129-2.545-4.101-2.533c0,0-2.303,0.006-8.196,0.762c0,0-0.008,0-0.027,0.005l-0.204,0.501l-0.605-0.393c-0.324,0.039-0.713,0.076-1.114,0.107c-1.012,0.07-2.477-0.057-4.3-0.596c-1.824-0.543-2.963-1.535-3.126-2.133c-0.114-0.412,0.035-0.996,0.035-0.996S7.62,50.2,7.405,49.115c-0.22-1.083-0.582-1.934-1.631-2.567c-1.048-0.632-1.643-0.522-1.643-0.522s-0.939-0.144-0.904,1.446c0.037,1.59,0.235,2.256,0.235,2.256s0.181,0.562-0.108,0.635c-0.288,0.072-0.74-0.361-0.74-0.361s-1.021-0.924-1.619-1.688l0.048,0.066l-0.214,0.525c0,0,0.067,0.115,0.266,0.375L1.193,48.543L1.193,48.543z"/><linearGradient id="SVGID_25_" gradientUnits="userSpaceOnUse" x1="214.8965" y1="-410.8818" x2="306.501" y2="-410.8818" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#A0A0A0"/><stop offset=".0769" stop-color="#656767"/><stop offset="1" stop-color="#717375"/></linearGradient><path style="&st1;" d="M91.075,11.742l0.183,0.846c0,0-0.563,0.313-1.678,0.613c-1.113,0.3-2.188,0.801-2.188,0.801s-0.89,0.289-0.551,1.013c0.338,0.726,0.838,1.076,0.838,1.076s0.711,0.69,0.736,1.213c0.021,0.526-0.199,0.765-0.764,1.076c-0.563,0.313-1.075,0.375-1.075,0.375s-1.338,0.24-2.001-0.387c-0.663-0.626-0.787-1.663-0.787-1.663s-0.05-0.876-1.148-1.251c-1.102-0.375-2.453,0.425-2.453,0.425s-1.063,0.563-2.2,1.3c-1.14,0.738-3.291,1.64-4.642,2.114l-0.152,0.699l-0.758-0.382c-1.422,0.489-3.271,1.109-3.271,1.109S66.652,21.645,65,21.871c-1.648,0.224-2.016-0.014-2.238-0.238c-0.228-0.224,0.039-1.012,0.039-1.012s0.674-1.376,0.348-2.09c-0.324-0.714-2.451-0.9-2.486-0.9c-0.04,0-2.318-0.265-4.451,0.932c-1.895,1.062-2.143,1.642-2.143,1.642s-0.604,0.938,0.113,1.867c0.807,1.051,1.879,1.146,1.879,1.146s1.021,0.079,1.258,0.38c0.24,0.299,0.076,0.626,0.076,0.626s-0.336,0.925-2.228,1.312c0,0-3.181,0.933-9.113,1.776l-0.582,0.579c-3.743,0.47-8.143,1.363-10.555,1.989c-2.412,0.627-2.553,1.317-2.553,1.317c-0.519,0.813,0.141,1.236,0.141,1.236s0.829,0.283,1.017,1.19c0.19,0.91-0.783,1.629-0.783,1.629s-1.159,0.972-2.898,1.269c-1.739,0.297-2.396,0.35-3.429-0.47c-0.91-0.721-0.298-1.863,0.312-2.301c0.612-0.438,0.909-0.91,0.988-1.112c0.079-0.204,0.032-0.377,0.032-0.377l-0.58-0.534c-2.005-1.33-9.883,0.063-9.883,0.063s0,0.002,0,0l-1.341,0.289l-0.673-0.435c0,0-2.291,0.604-4.876,0.589c-2.712-0.014-1.27-2.128-1.27-2.128s0.638-1.118,0.75-1.764c0,0,0.224-1.745-1.42-1.631c-1.645,0.112-1.968,1.546-1.968,1.546s-0.112,0.801-0.089,1.392c0.021,0.594-0.002,1.847-0.742,2.56c-0.737,0.713-1.529,0.495-1.529,0.495s-1.331-0.582-1.595-0.718c-0.274-0.142-0.517-0.151-0.751-0.066c-0.02,0.007-0.039,0.018-0.057,0.029l-0.175,0.75l0.025-0.623c-0.156,0.176-0.271,0.42-0.271,0.42l0.088,0.327l-0.248,0.565c-0.002,0.012-0.005,0.023-0.006,0.035l0.008,0.003c0,0,0.087-0.196,0.222-0.357l0.182-0.369L1.493,32.94c0.055-0.044,0.112-0.07,0.172-0.074c0.281-0.017,0.629,0.158,0.629,0.158s1.135,0.611,1.642,0.716s0.875-0.065,1.205-0.292c0.527-0.365,1.143-1.121,1.4-1.839c0.229-0.646,0.279-2.394,0.279-2.394l0.004,0.014c0,0,0-0.421-0.011-0.518c-0.012-0.098-0.075-0.553,0.204-0.783c0.278-0.234,0.459-0.347,1.144-0.364c0.68-0.017,0.886,0.38,0.886,0.38S9.28,28.269,9.28,28.48c0,0.21-0.068,0.34-0.068,0.34s-0.371,0.626-0.5,0.934c-0.13,0.307-0.636,1.323-0.489,2.177c0.148,0.852,1.479,1.251,1.479,1.251s1.062,0.25,2.575,0.027l3.12-0.503l0.543-0.624l0.218,0.474c0.805-0.147,2.14-0.369,3.583-0.511c2.326-0.228,4.787-0.262,5.821-0.132c0,0,0.484,0.061,0.405,0.234c-0.062,0.136-0.421,0.415-0.421,0.415s-0.135,0.081-0.654,0.667s-0.671,1.155-0.693,1.661c-0.024,0.505,0.516,1.995,2.415,2.394c1.901,0.397,4.077-0.341,4.077-0.341s1.427-0.314,2.786-1.674c1.41-1.411,0.012-3.108,0.012-3.108s-0.22-0.304-0.647-0.442c0,0-0.187-0.05-0.079-0.17c0.108-0.12,0.37-0.647,1.37-0.905c1-0.257,3.977-1.198,11.065-2.135l0.274-0.617l0.874,0.459c2.708-0.373,4.551-0.694,7.827-1.454c0,0,3.04-0.539,3.675-1.651c0.368-0.65,1.032-1.539-0.045-2.434c0,0-0.125-0.161-0.791-0.312c-0.666-0.151-1.179-0.252-1.738-0.653c-0.563-0.403-0.551-0.869-0.551-0.869s-0.047-0.445,0.862-0.958c0,0,0.851-0.623,2.54-1.158c1.691-0.533,3.648-0.296,3.648-0.296s0.82,0.089,0.685,0.643c-0.14,0.555-0.604,1.482-0.622,1.959c-0.021,0.474,0.012,1.027,0.938,1.414c0.931,0.386,2.267,0.266,2.267,0.266s1.386-0.069,3.647-0.801c2.265-0.731,4.594-1.573,4.594-1.573l-0.094-0.483l0.971,0.173c0.591-0.22,1.406-0.539,2.285-0.936c1.801-0.81,2.656-1.488,3.48-1.958c0,0,1.815-1.118,2.887-1.088c0,0,0.25-0.009,0.272,0.32c0.022,0.329,0.104,0.814,0.218,1.096c0.111,0.281,0.734,1.822,2.729,2.048c1.993,0.228,2.846-1.118,2.846-1.118s0.683-1.049-0.493-2.296c0,0-0.961-1.028-0.99-1.107c0,0-0.104-0.155,0.168-0.233c0.269-0.078,3.152-0.884,4.268-1.398c0,0,0.012-0.005,0.036-0.015l-0.271-0.485l0.535,0.365c0.202-0.101,0.449-0.246,0.544-0.395c0.171-0.271-0.054-0.797-0.054-0.797l0.006-0.007c-0.133-0.184-0.266-0.366-0.4-0.546l-0.606-0.256l-0.06,0.033L91.075,11.742"/><path style="&st34;" d="M8.12,16.324l-0.291,0.435c0.134-0.023,0.244-0.056,0.244-0.056s0.404-0.066,1.112,0.12c0.917,0.244,2.067-0.496,2.067-0.496s0.872-0.523,1.274-1.381l0.361-1.005c0,0,0.291-0.972,1.105-1.281c0,0,0.317-0.171,0.831-0.177c0.513-0.005,0.392,0.354,0.392,0.354s-0.056,0.233-0.586,0.912c-0.529,0.677-0.671,1.196-0.671,1.196s-0.318,0.722,0.193,0.957c0,0,0.24,0.141,0.939-0.091c0.7-0.233,3.02-0.843,4.438-1.06l0.993-0.506c-0.313-0.23-0.602-0.444-0.602-0.444c-2.388,0.442-4.168,0.995-4.775,1.226c-0.609,0.23-0.62,0.082-0.62,0.082c-0.211-0.248,0.435-1.022,0.435-1.022s0.655-0.894,0.913-1.715c0.259-0.82-0.892-0.707-0.892-0.707c-0.758,0.121-1.303,0.48-1.93,1.236c-0.486,0.586-0.782,1.389-0.893,1.814c-0.071,0.267-0.193,0.515-0.193,0.515s-0.091,0.165-0.45,0.322c-0.416,0.182-1.228,0.396-1.228,0.396s-0.54,0.045-0.931-0.15c-0.24-0.118-0.901,0.05-0.901,0.05l0.091-0.504l-0.082-0.032l-0.683,0.383c-0.115,0.189-0.228,0.379-0.341,0.569c-0.063,0.146-0.179,0.475,0.044,0.51c0.05,0.008,0.113,0.008,0.164,0.008L8.12,16.324L8.12,16.324z"/><path style="&st34;" d="M13.295,9.19c0,0,0.342-0.271,0.342-0.026c0,0.248-0.333,0.69-0.333,0.69s-0.107,0.134-0.172,0.134C13.068,9.987,13.15,9.516,13.295,9.19L13.295,9.19z"/><path style="&st12;" d="M-16.122-14.641"/><path style="&st34;" d="M10.595,12.501c0,0-0.388,0.46,0,0.52l0.838-0.828c-0.037-0.037-0.054-0.055-0.157-0.112C11.277,12.081,10.752,12.343,10.595,12.501L10.595,12.501z"/><path style="&st28;" d="M77.807,85.745c0,0-1.75,0.806-3.396,1.603c-1.647,0.803-2.25,1.14-2.25,1.14s-0.088,0.049-0.031,0.082c0.056,0.028-0.008,0.063-0.008,0.063c-0.847,0.409-2.703,1.07-2.703,1.07s-0.167,0.057-0.157,0.02c0.006-0.041,0.199-0.105,0.199-0.105s0.381-0.146,0.283-0.217c-0.098-0.072-1.21,0.305-1.21,0.305s-1.949,0.621-2.894,0.887c-0.941,0.269-2.75,0.735-2.75,0.735c-1.201,0.298-3.75,0.798-4.315,0.901c-0.562,0.104-0.417,0.064-0.417,0.064s0.492-0.189-0.411-0.226c-1.146-0.05-2.362,0.112-3.612,0.288c-1.25,0.18-1.178,0.324-1.178,0.324s-0.04,0.154,0.708,0.14c0.752-0.019,0.534,0.046,0.534,0.046c-1.396,0.202-4.2,0.238-4.2,0.238l0.005,0.01c0.456,0.014,0.916,0.018,1.376,0.018c0.608,0,1.218-0.01,1.822-0.031c0.241-0.021,1.483-0.15,1.925-0.244c0.486-0.105-0.093-0.105-0.093-0.105l-0.74-0.023c0,0-0.776-0.026-0.052-0.158c0.729-0.133,1.834-0.192,2.388-0.252c0.83-0.094,0.541,0.105,0.541,0.105l-0.04,0.023c0,0,0.014,0.094,0.528,0.066c0.515-0.024,4.721-0.804,7.069-1.487c2.347-0.688,4.102-1.255,4.102-1.255s0.157-0.055,0.066,0.025c-0.094,0.078-0.463,0.2-0.463,0.2s-0.595,0.3,0.844-0.108c0.066-0.02,0.134-0.039,0.197-0.06c1.234-0.469,2.446-0.983,3.635-1.543c0.029-0.028,0.131-0.146-0.021-0.101c-0.172,0.056,0-0.065,0.187-0.131c0.184-0.066,2.267-1.162,3.363-1.608l0.002,0.003c0.394-0.227,0.781-0.455,1.17-0.691L77.807,85.745L77.807,85.745z"/><linearGradient id="SVGID_26_" gradientUnits="userSpaceOnUse" x1="217.6563" y1="-436.751" x2="217.6563" y2="-436.751" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset=".078" stop-color="#F4F4F4"/><stop offset=".3807" stop-color="#CECECE"/><stop offset=".5396" stop-color="#BFBFBF"/><stop offset=".8357" stop-color="#7C7C7C"/><stop offset=".8996" stop-color="#A8A8A8"/><stop offset=".9093" stop-color="#9A9A9A"/><stop offset=".9327" stop-color="#7D7D7D"/><stop offset=".9558" stop-color="#686868"/><stop offset=".9785" stop-color="#5B5B5B"/><stop offset="1" stop-color="#575757"/></linearGradient><path style="&st46;" d="M3.893,50.249L3.893,50.249L3.893,50.249z"/><linearGradient id="SVGID_27_" gradientUnits="userSpaceOnUse" x1="214.3262" y1="-436.5107" x2="322.8717" y2="-424.4851" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset=".078" stop-color="#F4F4F4"/><stop offset=".3807" stop-color="#CECECE"/><stop offset=".5396" stop-color="#BFBFBF"/><stop offset=".8357" stop-color="#7C7C7C"/><stop offset=".8996" stop-color="#A8A8A8"/><stop offset=".9093" stop-color="#9A9A9A"/><stop offset=".9327" stop-color="#7D7D7D"/><stop offset=".9558" stop-color="#686868"/><stop offset=".9785" stop-color="#5B5B5B"/><stop offset="1" stop-color="#575757"/></linearGradient><path style="&st47;" d="M1.193,48.543l0.107,0.98c0.236,0.285,0.579,0.675,1.067,1.181c1.084,1.121,1.428,0.416,1.428,0.416s0.072-0.201,0.092-0.586c-0.042,0.216-0.209,0.403-0.788-0.056c-0.298-0.237-0.688-0.627-1.076-1.049c-0.326-0.326-0.723-0.742-1.021-1.117l0.048,0.065l-0.213,0.526c0,0,0.069,0.115,0.268,0.376L1.193,48.543L1.193,48.543z"/><linearGradient id="SVGID_28_" gradientUnits="userSpaceOnUse" x1="213.8887" y1="-436.4771" x2="336.8819" y2="-422.851" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#FFF"/><stop offset=".078" stop-color="#F4F4F4"/><stop offset=".3807" stop-color="#CECECE"/><stop offset=".5396" stop-color="#BFBFBF"/><stop offset=".8357" stop-color="#7C7C7C"/><stop offset=".8996" stop-color="#A8A8A8"/><stop offset=".9093" stop-color="#9A9A9A"/><stop offset=".9327" stop-color="#7D7D7D"/><stop offset=".9558" stop-color="#686868"/><stop offset=".9785" stop-color="#5B5B5B"/><stop offset="1" stop-color="#575757"/></linearGradient><path style="&st48;" d="M3.741,49.133c-0.006-0.027-0.013-0.054-0.02-0.078c0.012,0.088,0.028,0.179,0.043,0.272c0,0,0.094,0.394,0.12,0.753C3.87,49.813,3.83,49.498,3.741,49.133z"/><linearGradient id="SVGID_29_" gradientUnits="userSpaceOnUse" x1="411.2539" y1="557.002" x2="507.2363" y2="537.6277" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset="1" stop-color="#BFC0C2"/></linearGradient><path style="&st49;" d="M99.696,28.566l0.29,0.316c0.406-0.238,0.654,0.045,0.654,0.045l-0.386-0.494c-0.383,0.082-1.093,0.256-2.233,0.61c0,0-1.353,0.594-1.59,1.532c-0.016,0.332,0.049,0.641,0.116,0.876c0.753,1.429,0.913,1.666,0.913,1.666c0.499,1.091,0.422,1.993,0.25,2.824c-0.188,0.921-1.188,1.668-1.794,1.842c-0.608,0.171-0.953,0-1.14-0.483c-0.188-0.485-0.157-0.845-0.438-2.34c-0.28-1.499-0.653-2.2-1.216-2.372c-0.563-0.173-1.313,0.468-1.749,0.811c-0.438,0.344-2.417,2.152-2.417,2.152s-2.324,2.091-5.743,4.026c-3.417,1.935-7.69,3.418-7.69,3.418s-2.842,1.092-3.525,0.998c-0.688-0.093-0.516-0.718-0.297-1.076c0.219-0.36,0.516-0.937,0.766-1.545c0.313-0.756,0.201-1.654-0.359-1.967c-0.562-0.311-1.248-0.468-3.523,0.094s-3.197,1.076-3.838,1.451c-0.643,0.376-1.576,1.233-1.842,1.716c-0.266,0.484-0.563,0.983,0.126,1.576c0.688,0.594,0.763,0.485,1.56,1.046c0.797,0.562,0.922,0.64,0.969,1.466c0.045,0.827-0.766,1.341-0.766,1.341s-3.123,2.082-6.602,2.777c-2.34,0.469-6.833,0.639-6.833,0.639s-1.327-0.045-5.384,0.547c-4.056,0.594-6.787,1.514-7.738,1.856c-0.952,0.343-2.34,0.81-3.136,1.17c-0.795,0.358-0.375,0.89-0.203,1.015c0.172,0.123,1.185,1.074,1.498,1.354c0.312,0.282,1.466,1.279,0.108,2.108c-1.356,0.826-3.603,1.264-3.603,1.264s-3.121,0.654-4.119,0.234c-1.001-0.422-1.2-0.778-1.452-1.358c-0.313-0.718-0.016-1.263,0.794-1.78c0.77-0.486,0.469-1.199,0.469-1.199c-0.983-1.9-3.058-2.058-4.774-1.936c-2.72,0.198-5.358,0.471-7.425,0.734c-3.059,0.39-4.541-0.063-5.992-0.516c-1.452-0.453-2.997-1.529-3.154-2.498c-0.027-0.097-0.039-0.199-0.042-0.307c-0.078-0.758,0.074-1.146,0.184-1.784c0.108-0.625-0.043-1.532-0.084-1.758c-0.008-0.026-0.016-0.058-0.023-0.085c-0.507-1.304-1.725-1.903-2.668-2.058c-0.953-0.157-0.983,0.857-0.983,0.857s-0.002,0.012-0.006,0.04c0.078-0.208,0.222-0.315,0.444-0.31c0.577,0.02,2.259,0.361,2.781,1.754c0,0,0.218,0.648,0.019,1.479c-0.199,0.832-0.162,1.571-0.019,2.295c0.145,0.725,0.759,1.408,1.465,1.969c0.704,0.562,2.745,1.535,4.734,1.66c1.814,0.117,2.483,0.037,2.587,0.023l0.759-0.768l0.135,0.666c0.81-0.088,2.115-0.229,3.619-0.394c2.529-0.271,4.227-0.541,5.8-0.306c1.572,0.232,2.078,1.463,2.078,1.463s0.107,0.313-0.253,0.542c-0.349,0.226-0.75,0.548-0.947,0.891c-0.2,0.345-0.411,1.066,0.159,2.033c0.572,0.965,2.142,1.595,3.478,1.435c1.336-0.158,3.336-0.672,4.521-0.98c1.286-0.336,2.424-0.969,2.572-1.979c0.148-1.009-1.534-2.297-1.534-2.297s-0.81-0.611-0.909-0.75c-0.1-0.14,0.099-0.197,0.099-0.197s0.95-0.229,1.356-0.416c0.403-0.19,1.523-0.644,3.353-1.217c1.831-0.572,5.609-1.248,5.609-1.248s2.09-0.332,4.694-0.543l0.612-0.705l0.493,0.627c0.406-0.023,0.819-0.045,1.235-0.061c3.572-0.129,5.343-0.555,7.24-0.979c1.897-0.426,4.569-1.979,4.965-2.276c0.396-0.296,1.229-0.662,1.395-1.958c0.17-1.294-1.363-2.157-1.363-2.157s-1.218-0.643-1.476-0.929c-0.256-0.288-0.019-0.562-0.019-0.562s0.689-1.485,2.896-2.355c2.207-0.872,3.69-1.106,4.619-1.207c0.931-0.099,1.247,0.237,1.375,0.395c0.128,0.158,0.128,0.485,0.021,0.821c-0.101,0.308-0.443,1.039-0.644,1.396c-0.199,0.356-0.522,1.216-0.317,1.622c0.211,0.405,0.842,0.592,1.662,0.444c0.822-0.147,2.987-0.761,4.889-1.553c1.897-0.793,5.074-2.344,5.074-2.344s0.01-0.005,0.021-0.013l0.086-0.729l0.729,0.296c1.021-0.562,2.764-1.582,4.01-2.63c1.871-1.574,3.699-3.225,4.166-3.641c0.465-0.415,0.89-0.751,1.305-0.732c0.416,0.021,0.734,0.318,0.99,1.434c0.258,1.119,0.306,2.038,0.426,2.583c0.117,0.542,0.285,1.176,0.929,1.305c0.644,0.128,1.513-0.436,1.841-0.713c0.326-0.277,0.918-1.176,0.879-2.383c0,0,0.068-1.605-0.762-3.127c0,0-0.348-0.614-0.477-0.782c-0.088-0.119-0.155-0.238-0.008-0.523c0.146-0.288,0.465-0.821,1.059-1.157c0.449-0.256,0.881-0.316,1.128-0.396c0,0,0.28-0.069,0.636-0.266L99.696,28.566L99.696,28.566z"/><path style="&st23;" d="M1.547,32.696l-0.05,0.239c0.053-0.041,0.111-0.068,0.17-0.072c0.281-0.018,0.629,0.158,0.629,0.158s1.135,0.61,1.642,0.716c0.507,0.105,0.875-0.065,1.205-0.292c0.25-0.174,0.521-0.434,0.763-0.737c-0.29,0.29-0.725,0.548-1.365,0.595c0,0-0.571-0.049-1.419-0.587c-0.846-0.537-1.327-0.231-1.729,0.105l0,0l-0.249,0.564c-0.001,0.013-0.003,0.023-0.006,0.036l0.009,0.001c0,0,0.087-0.192,0.217-0.352L1.547,32.696L1.547,32.696z"/><path style="&st4;" d="M6.387,31.961c0.059-0.12,0.112-0.238,0.155-0.354c0.05-0.14,0.09-0.334,0.125-0.55c-0.096,0.44-0.223,0.73-0.223,0.73S6.428,31.853,6.387,31.961L6.387,31.961z"/><path style="&st4;" d="M6.807,28.654c-0.038,0.439-0.038,0.987-0.038,1.493l0,0c0.04-0.509,0.052-0.935,0.052-0.935l0.004,0.014c0,0,0-0.421-0.011-0.518C6.811,28.695,6.809,28.677,6.807,28.654z"/><linearGradient id="SVGID_30_" gradientUnits="userSpaceOnUse" x1="413.5137" y1="516.4121" x2="417.999" y2="516.4121" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#E2E3E4"/><stop offset=".5055" stop-color="#FFF"/></linearGradient><path style="&st50;" d="M8.12,16.324l-0.291,0.435c0.087-0.014,0.089-0.007,0.244-0.056c0,0,0.404-0.066,1.112,0.12c0.917,0.244,2.067-0.496,2.067-0.496s0.272-0.164,0.583-0.458c-0.4,0.24-1.385,0.762-2.132,0.585c-0.961-0.229-0.994-0.017-1.336-0.049c-0.292-0.028-0.292-0.11-0.275-0.314c0.002-0.032,0.023-0.054,0.03-0.092c0.05-0.261,0.339-0.689,0.339-0.689l-0.684,0.383c-0.115,0.189-0.227,0.378-0.34,0.569c-0.063,0.146-0.179,0.475,0.044,0.509c0.055,0.009,0.11,0.011,0.163,0.009L8.12,16.324L8.12,16.324z"/><path style="&st23;" d="M17.019,15.036c-1.027,0.278-1.972,0.734-2.494,0.604c-0.438-0.109-0.084-0.76,0.042-0.965c0.069-0.146,0.167-0.292,0.249-0.406c0.31-0.506,0.833-1.351,0.833-1.351s0,0,0-0.002c0.017-0.032,0.033-0.067,0.049-0.102c0.067-0.18,0.12-0.537-0.472-0.597c-0.799-0.082-1.613,0.619-1.613,0.619s-0.547,0.301-0.838,1.417l0.112-0.313c0,0,0.291-0.973,1.105-1.281c0,0,0.317-0.171,0.831-0.177c0.513-0.005,0.392,0.354,0.392,0.354s-0.056,0.233-0.586,0.912c-0.529,0.677-0.671,1.195-0.671,1.195s-0.319,0.723,0.193,0.957c0,0,0.238,0.141,0.939-0.091c0.7-0.233,3.02-0.843,4.438-1.06l0.993-0.506C19.849,14.299,18.012,14.769,17.019,15.036L17.019,15.036z"/><path style="&st23;" d="M-16.122-14.641"/><path style="&st23;" d="M-16.122-14.641"/><path style="&st59;" d="M90.578,74.217c0.006-0.004,0.009-0.008,0.014-0.013C90.587,74.21,90.582,74.213,90.578,74.217z"/><path style="&st59;" d="M90.821,73.951c0.001-0.002,0.002-0.004,0.003-0.004C90.823,73.947,90.822,73.949,90.821,73.951z"/><path style="&st59;" d="M90.738,74.042c0.003-0.004,0.008-0.009,0.011-0.013C90.746,74.033,90.741,74.038,90.738,74.042z"/><path style="&st8;" d="M87.9,76.68l-0.164,0.174c-0.646,0.716-0.969,1.007-0.969,1.007l-0.242,0.269l0,0c-0.002,0.006-0.006,0.012-0.012,0.014c0.008,0.002,0.018,0.004,0.041,0.004c0,0,0.229-0.002,0.588-0.219c-0.072,0.041-0.139,0.068-0.181,0.07c-0.177,0.012,0.431-0.538,0.431-0.538s0.588-0.626,0.967-1.125c0.382-0.497,0.138-0.468,0.138-0.468s-0.087-0.021-0.397,0.125C88.125,76.018,88.268,76.223,87.9,76.68L87.9,76.68z"/><path style="&st59;" d="M90.657,74.133c0.003-0.006,0.007-0.013,0.013-0.017C90.664,74.121,90.662,74.128,90.657,74.133z"/><path style="&st0;" d="M72.945,81.21c0,0,2.215-0.931,3.402-0.79c0,0,0.611,0.059-0.062,0.711c-0.672,0.652-0.892,1.168,0.396,0.752c0,0,0.094-0.033,0.244-0.086c-0.504,0.143-0.734,0.143-0.658,0.033c0.127-0.188,0.461-0.461,0.461-0.461s0.399-0.4,0.399-0.801c0,0,0.128-0.588-1.604-0.225c-1.01,0.209-1.969,0.59-2.588,0.867C72.941,81.211,72.943,81.211,72.945,81.21L72.945,81.21z"/><path style="&st59;" d="M72.234,81.555l-0.004,0.002C72.232,81.557,72.234,81.555,72.234,81.555z"/><path style="&st59;" d="M88.057,76.014c-0.014,0.008-0.026,0.015-0.043,0.021C88.028,76.027,88.043,76.021,88.057,76.014z"/><path style="&st14;" d="M78.305,81.299c1.448-0.521,3.93-1.854,5.023-2.492C82.232,79.442,79.73,80.717,78.305,81.299z"/><path style="&st59;" d="M87.512,76.325c0.026-0.017,0.055-0.032,0.08-0.049C87.566,76.293,87.538,76.309,87.512,76.325z"/><path style="&st59;" d="M91.618,73.084c0.008-0.011,0.019-0.023,0.026-0.029C91.637,73.061,91.626,73.073,91.618,73.084z"/><path style="&st59;" d="M91.434,73.281c0.01-0.012,0.019-0.02,0.023-0.027C91.451,73.264,91.441,73.27,91.434,73.281z"/><path style="&st59;" d="M91.521,73.188c0.01-0.012,0.02-0.022,0.029-0.032C91.539,73.165,91.53,73.178,91.521,73.188z"/><path style="&st59;" d="M90.9,73.863c0.003-0.006,0.007-0.01,0.012-0.016C90.907,73.854,90.903,73.857,90.9,73.863z"/><path style="&st59;" d="M71.246,82.088c-0.014,0.008-0.023,0.018-0.036,0.022C71.221,82.105,71.232,82.096,71.246,82.088z"/><path style="&st59;" d="M91.346,73.375c0.008-0.008,0.014-0.015,0.021-0.021C91.359,73.36,91.354,73.367,91.346,73.375z"/><path style="&st59;" d="M91.077,73.669c0.006-0.006,0.01-0.011,0.013-0.015C91.087,73.659,91.083,73.663,91.077,73.669z"/><path style="&st59;" d="M91.251,73.479c0.007-0.006,0.015-0.012,0.021-0.021C91.266,73.463,91.255,73.473,91.251,73.479z"/><path style="&st59;" d="M90.987,73.768c0.004-0.006,0.01-0.012,0.016-0.021C90.997,73.756,90.991,73.762,90.987,73.768z"/><path style="&st59;" d="M91.161,73.578c0.006-0.006,0.011-0.014,0.017-0.02C91.172,73.564,91.165,73.572,91.161,73.578z"/><path style="&st59;" d="M71.816,81.764c-0.008,0.006-0.02,0.012-0.026,0.017C71.799,81.774,71.809,81.77,71.816,81.764z"/><path style="&st59;" d="M72.044,81.646c-0.006,0.004-0.012,0.006-0.019,0.009C72.032,81.652,72.038,81.649,72.044,81.646z"/><path style="&st59;" d="M71.305,82.055c-0.011,0.008-0.021,0.014-0.031,0.021C71.283,82.067,71.294,82.063,71.305,82.055z"/><path style="&st59;" d="M71.969,81.684c-0.008,0.004-0.015,0.009-0.021,0.014C71.953,81.692,71.961,81.688,71.969,81.684z"/><path style="&st59;" d="M72.109,81.613c-0.004,0.005-0.01,0.006-0.016,0.01C72.102,81.619,72.105,81.617,72.109,81.613z"/><path style="&st59;" d="M72.008,81.665c-0.007,0.004-0.013,0.007-0.021,0.011C71.994,81.672,72.001,81.669,72.008,81.665z"/><path style="&st59;" d="M72.206,81.566c-0.003,0.002-0.005,0.003-0.007,0.004C72.201,81.569,72.203,81.568,72.206,81.566z"/><path style="&st59;" d="M72.148,81.594c-0.008,0.004-0.016,0.01-0.024,0.015C72.135,81.604,72.141,81.598,72.148,81.594z"/><path style="&st59;" d="M71.928,81.707c-0.01,0.003-0.02,0.01-0.027,0.016C71.908,81.715,71.918,81.711,71.928,81.707z"/><path style="&st59;" d="M72.193,81.575c-0.006,0.001-0.01,0.003-0.014,0.004C72.184,81.578,72.189,81.575,72.193,81.575z"/><path style="&st59;" d="M72.172,81.585c-0.004,0.003-0.008,0.005-0.015,0.007C72.164,81.59,72.168,81.585,72.172,81.585z"/><path style="&st59;" d="M72.079,81.631c-0.008,0.002-0.013,0.004-0.019,0.006C72.066,81.635,72.071,81.633,72.079,81.631z"/><path style="&st59;" d="M71.866,81.739c-0.011,0.002-0.021,0.008-0.027,0.013C71.848,81.747,71.857,81.741,71.866,81.739z"/><path style="&st59;" d="M71.555,81.906c-0.018,0.012-0.033,0.02-0.052,0.029C71.521,81.924,71.539,81.918,71.555,81.906z"/><path style="&st59;" d="M72.219,81.561c0,0.002-0.002,0.002-0.002,0.004C72.217,81.563,72.219,81.563,72.219,81.561z"/><path style="&st59;" d="M71.421,81.986c-0.011,0.006-0.022,0.01-0.03,0.02C71.398,81.996,71.41,81.992,71.421,81.986z"/><path style="&st59;" d="M71.363,82.02c-0.012,0.005-0.021,0.013-0.032,0.021C71.342,82.032,71.354,82.024,71.363,82.02z"/><path style="&st59;" d="M71.482,81.948c-0.014,0.006-0.023,0.015-0.036,0.021C71.458,81.963,71.471,81.956,71.482,81.948z"/><path style="&st59;" d="M71.768,81.79c-0.01,0.004-0.018,0.009-0.024,0.017C71.751,81.799,71.758,81.794,71.768,81.79z"/><path style="&st59;" d="M91.708,72.984c0.013-0.014,0.024-0.028,0.04-0.042C91.734,72.956,91.723,72.971,91.708,72.984z"/><path style="&st59;" d="M71.717,81.818c-0.01,0.004-0.019,0.009-0.027,0.015C71.698,81.827,71.707,81.822,71.717,81.818z"/><path style="&st59;" d="M71.665,81.846c-0.011,0.006-0.021,0.014-0.028,0.018C71.645,81.858,71.654,81.852,71.665,81.846z"/><path style="&st59;" d="M71.609,81.875c-0.01,0.008-0.021,0.014-0.03,0.02C71.589,81.889,71.602,81.881,71.609,81.875z"/><path style="&st59;" d="M92.443,72.197c-0.021,0.021-0.037,0.039-0.055,0.061C92.406,72.238,92.423,72.217,92.443,72.197z"/><path style="&st59;" d="M92.359,72.287c-0.021,0.021-0.041,0.044-0.061,0.066C92.318,72.331,92.339,72.309,92.359,72.287z"/><path style="&st59;" d="M92.501,72.135c-0.011,0.015-0.021,0.023-0.028,0.033C92.48,72.157,92.49,72.148,92.501,72.135z"/><path style="&st59;" d="M91.786,72.899c0.022-0.021,0.042-0.042,0.062-0.063C91.828,72.857,91.807,72.878,91.786,72.899z"/><path style="&st59;" d="M92.273,72.379c-0.014,0.016-0.025,0.029-0.041,0.045C92.245,72.409,92.26,72.395,92.273,72.379z"/><path style="&st59;" d="M92.579,72.053c-0.013,0.012-0.021,0.021-0.03,0.032C92.559,72.074,92.569,72.063,92.579,72.053z"/><path style="&st59;" d="M92.762,71.858c-0.002,0-0.002,0-0.002,0.001C92.76,71.858,92.76,71.858,92.762,71.858z"/><path style="&st59;" d="M92.703,71.919c-0.004,0.005-0.01,0.013-0.014,0.017C92.693,71.928,92.699,71.924,92.703,71.919z"/><path style="&st59;" d="M87.938,76.074c-0.017,0.008-0.027,0.016-0.043,0.023C87.907,76.09,87.922,76.082,87.938,76.074z"/><path style="&st59;" d="M92.648,71.98c-0.012,0.011-0.021,0.021-0.029,0.029C92.629,72,92.637,71.991,92.648,71.98z"/><path style="&st59;" d="M87.666,76.229c-0.018,0.013-0.031,0.021-0.051,0.031C87.633,76.25,87.648,76.241,87.666,76.229z"/><path style="&st59;" d="M48.204,91.026c0,0-0.001,0-0.003,0.002C48.203,91.026,48.203,91.026,48.204,91.026z"/><path style="&st59;" d="M48.073,91.03c-0.007,0-0.013,0-0.021,0C48.06,91.03,48.066,91.03,48.073,91.03z"/><path style="&st59;" d="M48.136,91.028c-0.007,0.002-0.013,0.002-0.02,0.002C48.123,91.03,48.129,91.03,48.136,91.028z"/><path style="&st59;" d="M48.005,91.032c-0.003,0-0.007,0-0.012,0C47.998,91.032,48.002,91.032,48.005,91.032z"/><path style="&st59;" d="M47.94,91.035c-0.004,0-0.009,0-0.015,0C47.93,91.035,47.935,91.035,47.94,91.035z"/><path style="&st59;" d="M87.869,76.111c-0.014,0.006-0.021,0.015-0.039,0.021C87.848,76.126,87.857,76.117,87.869,76.111z"/><path style="&st59;" d="M87.807,76.146c-0.014,0.009-0.025,0.018-0.041,0.021C87.779,76.164,87.793,76.155,87.807,76.146z"/><path style="&st59;" d="M87.738,76.186c-0.016,0.011-0.028,0.018-0.044,0.024C87.71,76.203,87.723,76.196,87.738,76.186z"/><path style="&st59;" d="M87.951,76.067c0.02-0.011,0.035-0.021,0.054-0.027C87.986,76.047,87.971,76.057,87.951,76.067z"/><path style="&st59;" d="M87.719,77.52c0,0-0.082,0.064-0.193,0.147C87.592,77.621,87.664,77.566,87.719,77.52z"/><path style="&st59;" d="M92.205,72.452c-0.021,0.022-0.042,0.046-0.064,0.067C92.163,72.498,92.186,72.475,92.205,72.452z"/><path style="&st59;" d="M28.05,87.006c-0.019-0.007-0.037-0.016-0.056-0.021C28.013,86.991,28.031,86.999,28.05,87.006z"/><path style="&st59;" d="M71.051,82.217c-0.013,0.008-0.021,0.017-0.037,0.021C71.027,82.23,71.038,82.223,71.051,82.217z"/><path style="&st59;" d="M45.854,89.871c-0.024,0-0.049-0.004-0.074-0.004C45.806,89.867,45.831,89.871,45.854,89.871z"/><path style="&st59;" d="M27.678,86.883c0.02,0.004,0.039,0.01,0.058,0.019C27.717,86.893,27.696,86.887,27.678,86.883z"/><path style="&st59;" d="M27.555,86.844c0.038,0.012,0.078,0.022,0.119,0.037C27.633,86.869,27.593,86.854,27.555,86.844z"/><path style="&st59;" d="M27.862,86.941c-0.041-0.014-0.082-0.026-0.123-0.04C27.78,86.913,27.82,86.928,27.862,86.941z"/><path style="&st59;" d="M91.88,72.799c0.015-0.016,0.026-0.027,0.04-0.043C91.907,72.771,91.895,72.784,91.88,72.799z"/><path style="&st59;" d="M28.058,87.006c0.04,0.016,0.079,0.026,0.116,0.041C28.137,87.033,28.098,87.021,28.058,87.006z"/><path style="&st59;" d="M91.977,72.695c0.014-0.016,0.026-0.027,0.041-0.044C92.002,72.668,91.989,72.68,91.977,72.695z"/><path style="&st59;" d="M92.057,72.612c0.021-0.022,0.039-0.041,0.061-0.062C92.096,72.571,92.076,72.59,92.057,72.612z"/><path style="&st59;" d="M27.991,86.985c-0.021-0.009-0.041-0.017-0.062-0.022C27.95,86.969,27.97,86.977,27.991,86.985z"/><path style="&st59;" d="M71.133,82.162c0.021-0.013,0.037-0.021,0.055-0.036C71.17,82.139,71.152,82.149,71.133,82.162z"/><path style="&st59;" d="M46.361,89.926c-0.016-0.002-0.035-0.004-0.053-0.008C46.325,89.922,46.345,89.924,46.361,89.926z"/><path style="&st59;" d="M71.122,82.17c-0.019,0.012-0.034,0.021-0.049,0.032C71.088,82.191,71.105,82.18,71.122,82.17z"/><path style="&st59;" d="M46.439,89.939c-0.017-0.002-0.032-0.006-0.049-0.008C46.407,89.934,46.422,89.938,46.439,89.939z"/><path style="&st59;" d="M46.513,89.953c-0.016-0.005-0.031-0.007-0.047-0.011C46.481,89.946,46.497,89.948,46.513,89.953z"/><path style="&st59;" d="M46.096,89.891c-0.031-0.002-0.065-0.006-0.1-0.01C46.031,89.885,46.065,89.889,46.096,89.891z"/><path style="&st59;" d="M46.278,89.913c-0.02-0.002-0.041-0.004-0.061-0.006C46.237,89.909,46.259,89.911,46.278,89.913z"/><path style="&st59;" d="M46.19,89.904c-0.028-0.005-0.054-0.008-0.084-0.012C46.136,89.896,46.163,89.899,46.19,89.904z"/><path style="&st59;" d="M45.971,89.881c-0.025-0.005-0.051-0.006-0.079-0.009C45.92,89.875,45.945,89.877,45.971,89.881z"/><path style="&st59;" d="M27.926,86.961c-0.02-0.004-0.039-0.011-0.058-0.019C27.888,86.953,27.908,86.957,27.926,86.961z"/><path style="&st59;" d="M47.395,90.975c0.001,0.004,0.003,0.004,0.004,0.004C47.398,90.979,47.396,90.979,47.395,90.975z"/><path style="&st59;" d="M47.375,90.969c0.001,0,0.002,0,0.003,0C47.378,90.969,47.376,90.969,47.375,90.969z"/><path style="&st59;" d="M47.418,90.982L47.418,90.982L47.418,90.982z"/><path style="&st59;" d="M47.465,90.996c0.003,0,0.004,0.001,0.006,0.001C47.47,90.997,47.468,90.996,47.465,90.996z"/><path style="&st59;" d="M47.442,90.988c0.001,0,0.002,0.002,0.002,0.002L47.442,90.988z"/><path style="&st59;" d="M47.342,90.955L47.342,90.955L47.342,90.955z"/><path style="&st59;" d="M46.589,89.967c-0.02-0.002-0.036-0.009-0.054-0.013C46.553,89.959,46.57,89.965,46.589,89.967z"/><path style="&st59;" d="M46.764,90.012c-0.011-0.004-0.021-0.008-0.033-0.012C46.742,90.006,46.753,90.008,46.764,90.012z"/><path style="&st59;" d="M49.049,90.953c-0.01,0.001-0.021,0.002-0.032,0.004C49.028,90.955,49.038,90.954,49.049,90.953z"/><path style="&st59;" d="M46.659,89.984c-0.021-0.006-0.039-0.01-0.061-0.014C46.619,89.975,46.639,89.979,46.659,89.984z"/><path style="&st59;" d="M47.767,91.028c0.003,0,0.003,0,0.006,0C47.773,91.028,47.77,91.028,47.767,91.028z"/><path style="&st59;" d="M47.821,91.03c0.003,0,0.007,0,0.013,0C47.828,91.03,47.824,91.03,47.821,91.03z"/><path style="&st59;" d="M45.214,89.855c0.047,0,0.092,0,0.139,0C45.308,89.855,45.261,89.855,45.214,89.855z"/><path style="&st59;" d="M47.716,91.026c0.005,0,0.009,0,0.013,0.002C47.727,91.026,47.722,91.026,47.716,91.026z"/><path style="&st32;" d="M46.772,90.014c0,0,0.158,0.021,0.059,0.338c-0.1,0.313,0.06,0.451,0.475,0.594l0.023,0.006c0,0,0.001,0,0.002,0c-0.079-0.04-0.074-0.08-0.074-0.08s-0.01-0.078,0.078-0.216c0.087-0.136,0.009-0.369-0.293-0.536C47.044,90.118,46.967,90.07,46.772,90.014L46.772,90.014L46.772,90.014z"/><path style="&st59;" d="M47.869,91.032c0.006,0,0.012,0,0.018,0C47.881,91.032,47.875,91.032,47.869,91.032z"/><path style="&st59;" d="M47.495,91.002c0.001,0,0.004,0,0.004,0C47.497,91.002,47.496,91.002,47.495,91.002z"/><path style="&st59;" d="M47.677,91.024c0.004,0,0.007,0,0.01,0C47.684,91.024,47.681,91.024,47.677,91.024z"/><path style="&st59;" d="M47.529,91.006c0.001,0,0.002,0,0.002,0S47.53,91.006,47.529,91.006z"/><path style="&st59;" d="M47.559,91.01c0.002,0.002,0.005,0.002,0.008,0.002C47.566,91.012,47.561,91.01,47.559,91.01z"/><path style="&st59;" d="M47.594,91.016c0.002,0,0.004,0,0.008,0C47.599,91.016,47.596,91.016,47.594,91.016z"/><path style="&st59;" d="M46.711,89.997c-0.011-0.002-0.026-0.007-0.043-0.011C46.685,89.99,46.701,89.995,46.711,89.997z"/><path style="&st59;" d="M28.748,87.256c-0.008-0.003-0.018-0.007-0.025-0.01C28.731,87.25,28.739,87.254,28.748,87.256z"/><path style="&st59;" d="M28.776,87.27c-0.007-0.002-0.016-0.008-0.024-0.012C28.761,87.262,28.769,87.268,28.776,87.27z"/><path style="&st59;" d="M28.681,87.23c-0.008-0.004-0.021-0.006-0.03-0.01C28.66,87.225,28.672,87.227,28.681,87.23z"/><path style="&st59;" d="M45.66,89.862c0.026,0,0.052,0.005,0.074,0.005C45.711,89.865,45.686,89.865,45.66,89.862z"/><path style="&st59;" d="M28.797,87.275c-0.005-0.002-0.013-0.006-0.021-0.008C28.784,87.271,28.792,87.273,28.797,87.275z"/><path style="&st59;" d="M27.38,86.794c0.038,0.011,0.074,0.022,0.112,0.031C27.453,86.816,27.417,86.803,27.38,86.794z"/><path style="&st59;" d="M27.492,86.825c0.021,0.004,0.039,0.011,0.058,0.019C27.53,86.836,27.512,86.829,27.492,86.825z"/><path style="&st59;" d="M28.814,87.284c-0.003-0.002-0.006-0.005-0.012-0.007C28.808,87.279,28.811,87.282,28.814,87.284z"/><path style="&st59;" d="M28.64,87.219c-0.011-0.006-0.021-0.01-0.03-0.014C28.621,87.21,28.629,87.213,28.64,87.219z"/><path style="&st61;" d="M27.687,87.239c-0.014-0.013-0.023-0.022-0.03-0.032c-0.263-0.197-0.343-0.418-0.343-0.418l0.009-0.011c0.017,0.007,0.034,0.011,0.052,0.014c-0.291-0.075-0.5-0.104-0.479-0.018c0.015,0.061,0.131,0.153,0.269,0.245c0.174,0.094,0.346,0.187,0.522,0.279V87.239L27.687,87.239z"/><path style="&st59;" d="M28.716,87.245c-0.009-0.003-0.018-0.006-0.027-0.01C28.699,87.239,28.708,87.242,28.716,87.245z"/><path style="&st59;" d="M28.602,87.202c-0.013-0.004-0.027-0.01-0.042-0.015C28.574,87.192,28.59,87.198,28.602,87.202z"/><path style="&st59;" d="M28.841,87.293c0,0-0.006-0.004-0.022-0.009C28.835,87.29,28.841,87.293,28.841,87.293z"/><path style="&st59;" d="M28.232,87.068c-0.018-0.006-0.031-0.014-0.047-0.018C28.201,87.055,28.215,87.063,28.232,87.068z"/><path style="&st59;" d="M45.534,89.858c0.028,0,0.054,0.002,0.081,0.002C45.587,89.858,45.562,89.858,45.534,89.858z"/><path style="&st59;" d="M45.397,89.855c0.029,0,0.06,0,0.089,0C45.457,89.855,45.427,89.855,45.397,89.855z"/><path style="&st59;" d="M28.348,87.11c-0.034-0.013-0.07-0.025-0.106-0.039C28.278,87.085,28.314,87.098,28.348,87.11z"/><path style="&st59;" d="M28.506,87.168c-0.013-0.005-0.025-0.01-0.037-0.015C28.481,87.158,28.494,87.162,28.506,87.168z"/><path style="&st59;" d="M28.401,87.129c-0.013-0.006-0.028-0.011-0.043-0.015C28.373,87.118,28.388,87.123,28.401,87.129z"/><path style="&st59;" d="M28.557,87.186c-0.013-0.004-0.025-0.012-0.04-0.017C28.531,87.176,28.544,87.182,28.557,87.186z"/><path style="&st59;" d="M28.458,87.15c-0.016-0.008-0.031-0.014-0.047-0.018C28.427,87.137,28.442,87.143,28.458,87.15z"/><path style="&st59;" d="M70.02,84.389c0.004,0,0.006,0,0.006,0C70.023,84.389,70.023,84.389,70.02,84.389z"/><path style="&st59;" d="M70.789,84.087c-0.001,0.003-0.003,0.005-0.004,0.005C70.786,84.09,70.788,84.088,70.789,84.087z"/><path style="&st59;" d="M70.762,84.102c-0.002,0.002-0.004,0.002-0.006,0.004C70.758,84.104,70.76,84.104,70.762,84.102z"/><path style="&st59;" d="M70.732,84.116c-0.002,0.002-0.004,0.003-0.006,0.004C70.729,84.119,70.73,84.118,70.732,84.116z"/><path style="&st59;" d="M70.697,84.133c-0.001,0-0.002,0-0.002,0.002C70.695,84.133,70.696,84.133,70.697,84.133z"/><path style="&st59;" d="M70.417,84.249c0.006-0.001,0.009-0.002,0.011-0.002C70.426,84.247,70.423,84.248,70.417,84.249z"/><path style="&st59;" d="M70.389,84.262h0.002H70.389z"/><path style="&st59;" d="M70.662,84.146L70.662,84.146L70.662,84.146z"/><path style="&st59;" d="M70.316,84.289c0.002-0.002,0.007-0.003,0.009-0.003C70.321,84.286,70.318,84.287,70.316,84.289z"/><path style="&st59;" d="M70.285,84.299c0.003,0,0.005-0.002,0.009-0.004C70.29,84.297,70.288,84.299,70.285,84.299z"/><path style="&st59;" d="M70.354,84.275c0.002-0.002,0.002-0.002,0.002-0.002S70.354,84.273,70.354,84.275z"/><path style="&st59;" d="M48.946,90.965c-0.011,0-0.022,0.004-0.033,0.004C48.924,90.969,48.935,90.965,48.946,90.965z"/><path style="&st59;" d="M70.256,84.311c0.002,0,0.004,0,0.006-0.002C70.26,84.311,70.258,84.311,70.256,84.311z"/><path style="&st59;" d="M70.78,82.41c0.013-0.009,0.026-0.021,0.042-0.032C70.809,82.389,70.793,82.401,70.78,82.41z"/><path style="&st59;" d="M70.956,82.279c0.013-0.008,0.022-0.016,0.033-0.023C70.98,82.264,70.969,82.271,70.956,82.279z"/><path style="&st59;" d="M70.898,82.321c0.012-0.009,0.022-0.017,0.033-0.022C70.923,82.305,70.91,82.313,70.898,82.321z"/><path style="&st2;" d="M70.903,83.794c0.2,0.064,0.106,0.171-0.087,0.278l0.089-0.033c0,0,0.793-0.436,0.458-0.633c-0.338-0.198-1.129-0.275-0.613-0.969l0.02-0.02c-0.442,0.344-0.756,0.727-0.498,1.021C70.27,83.443,70.387,83.629,70.903,83.794z"/><path style="&st59;" d="M70.566,84.191c-0.002,0-0.006,0.002-0.008,0.003C70.561,84.193,70.564,84.191,70.566,84.191z"/><path style="&st59;" d="M70.631,84.163c-0.002,0.001-0.004,0.002-0.006,0.003C70.627,84.165,70.629,84.164,70.631,84.163z"/><path style="&st59;" d="M70.598,84.176c0,0.002-0.004,0.004-0.006,0.004C70.594,84.18,70.598,84.178,70.598,84.176z"/><path style="&st59;" d="M70.493,84.223c-0.003,0-0.003,0-0.007,0.002C70.49,84.223,70.49,84.223,70.493,84.223z"/><path style="&st59;" d="M70.459,84.233c-0.002,0-0.004,0.002-0.008,0.004C70.455,84.235,70.457,84.233,70.459,84.233z"/><path style="&st59;" d="M70.842,82.363c0.012-0.01,0.024-0.018,0.034-0.025C70.866,82.346,70.854,82.354,70.842,82.363z"/><path style="&st59;" d="M48.293,91.024c-0.007,0-0.016,0-0.023,0C48.277,91.024,48.286,91.024,48.293,91.024z"/><path style="&st59;" d="M48.444,91.014c-0.004,0-0.011,0-0.017,0C48.434,91.014,48.44,91.014,48.444,91.014z"/><path style="&st59;" d="M48.369,91.02c-0.009,0-0.017,0-0.027,0C48.352,91.02,48.359,91.02,48.369,91.02z"/><path style="&st8;" d="M50.023,89.904c0,0,0.362,0.225,1.673,0.285c0,0,0.45,0,0.468,0.035c0.016,0.028,0.036,0.056-0.068,0.102l0,0c0.06-0.021,0.793-0.254,0.476-0.391c-0.04-0.019-0.063-0.024-0.074-0.028c-0.006,0-0.013,0-0.019-0.003l0,0c-0.008-0.002-0.016-0.002-0.021-0.004c-0.007,0-0.009-0.001-0.013-0.001c-0.006-0.003-0.014-0.003-0.021-0.005c-0.004,0-0.009,0-0.015-0.002c-0.005,0-0.011-0.002-0.017-0.002c-0.004,0-0.011-0.002-0.017-0.004c-0.005,0-0.012,0-0.015,0c-0.008-0.002-0.014-0.002-0.018-0.004c-0.004,0-0.012,0-0.016-0.002c-0.005,0-0.012,0-0.018,0c-0.002-0.004-0.008-0.004-0.01-0.004c-0.011-0.002-0.015-0.003-0.021-0.003c-0.004,0-0.006-0.001-0.008-0.001c-0.01-0.001-0.021-0.001-0.028-0.002c0,0-0.002,0-0.004-0.002c-0.007,0-0.015,0-0.021,0c-0.005-0.002-0.007-0.002-0.012-0.002s-0.011,0-0.02,0c-0.004,0-0.006,0-0.008,0c-0.008-0.002-0.013-0.002-0.019-0.002c-0.003,0-0.007,0-0.009,0c-0.008,0-0.014-0.002-0.018-0.002c-0.005,0-0.009-0.003-0.012-0.003c-0.006,0-0.014,0-0.021,0c-0.004,0-0.004,0-0.006,0c-0.039-0.004-0.08-0.004-0.128-0.009c-0.002,0-0.004,0-0.004,0c-0.009,0-0.015-0.002-0.022-0.002c-0.002,0-0.007,0-0.011,0c-0.007,0-0.013,0-0.021,0c-0.004-0.002-0.01-0.002-0.014-0.002c-0.006,0-0.013-0.002-0.02-0.002c-0.005,0-0.011,0-0.016-0.002c-0.005,0-0.011,0-0.019,0c-0.01,0-0.02-0.002-0.028-0.004c-0.006,0-0.012,0-0.019,0c-0.008,0-0.018-0.002-0.028-0.002c-0.005,0-0.011-0.002-0.016-0.002c-0.008,0-0.019,0-0.024-0.001c-0.006-0.001-0.013-0.001-0.021-0.001c-0.007-0.002-0.018-0.002-0.026-0.004c-0.005,0-0.013-0.001-0.02-0.001c-0.008-0.001-0.018-0.003-0.026-0.003c-0.007-0.001-0.016-0.001-0.023-0.003c-0.01,0-0.019-0.002-0.027-0.002c-0.007-0.002-0.014-0.002-0.021-0.002c-0.012,0-0.024-0.003-0.035-0.005c-0.007,0-0.014,0-0.02,0c-0.02-0.004-0.037-0.006-0.057-0.006c-0.142-0.019-0.271-0.033-0.378-0.055l-0.187-0.025c0,0-0.47-0.014-0.653-0.316c-0.118-0.197,0.457-0.318,0.457-0.318s0.956-0.193,1.917-0.321c0,0-2.542,0.294-2.777,0.626C49.613,89.737,50.023,89.904,50.023,89.904L50.023,89.904z"/><path style="&st59;" d="M69.986,84.401L69.986,84.401L69.986,84.401z"/><path style="&st59;" d="M69.989,84.399c0.001,0,0.001,0,0.004,0C69.991,84.399,69.99,84.399,69.989,84.399z"/><path style="&st59;" d="M48.839,90.979c-0.007,0-0.015,0.002-0.021,0.002C48.824,90.98,48.831,90.979,48.839,90.979z"/><path style="&st59;" d="M48.727,90.988c-0.009,0-0.017,0.002-0.026,0.002C48.71,90.99,48.718,90.988,48.727,90.988z"/><path style="&st59;" d="M48.637,90.998c-0.009,0-0.019,0.001-0.029,0.003C48.619,90.999,48.628,90.998,48.637,90.998z"/><path style="&st59;" d="M48.55,91.004c-0.009,0-0.018,0.002-0.025,0.004C48.532,91.006,48.54,91.004,48.55,91.004z"/><path style="&st59;" d="M70.139,84.35c0.004,0,0.006-0.002,0.01-0.004C70.145,84.348,70.143,84.35,70.139,84.35z"/><path style="&st59;" d="M70.116,84.359c0.002-0.002,0.004-0.002,0.007-0.002C70.12,84.357,70.118,84.357,70.116,84.359z"/><path style="&st59;" d="M70.193,84.332c0.002,0,0.002-0.002,0.004-0.002C70.195,84.33,70.195,84.332,70.193,84.332z"/><path style="&st59;" d="M70.068,84.374c0.003,0,0.004,0,0.007-0.002C70.072,84.374,70.07,84.374,70.068,84.374z"/><path style="&st59;" d="M70.163,84.342c0.005,0,0.007-0.002,0.011-0.005C70.17,84.34,70.167,84.342,70.163,84.342z"/><path style="&st59;" d="M69.996,84.395c0.002,0,0.002,0,0.004,0C69.998,84.395,69.998,84.395,69.996,84.395z"/><path style="&st59;" d="M70.004,84.395c0.002,0,0.006-0.002,0.008-0.002C70.006,84.395,70.006,84.395,70.004,84.395z"/><path style="&st59;" d="M72.23,81.559c-0.002,0-0.004,0-0.004,0S72.229,81.559,72.23,81.559z"/><path style="&st59;" d="M70.053,84.379c0.002,0,0.002,0,0.004,0C70.053,84.379,70.053,84.379,70.053,84.379z"/><path style="&st59;" d="M70.036,84.385c0.001,0,0.003,0,0.004-0.002C70.039,84.385,70.037,84.385,70.036,84.385z"/><linearGradient id="SVGID_31_" gradientUnits="userSpaceOnUse" x1="414.2451" y1="568.2656" x2="509.0055" y2="545.7273" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset=".9505" stop-color="#B2B4B6"/></linearGradient><path style="&st51;" d="M7.61,68.141c-0.065-0.062-0.112-0.105-0.139-0.131L7.45,68.021L7.61,68.141L7.61,68.141z"/><linearGradient id="SVGID_32_" gradientUnits="userSpaceOnUse" x1="416.6992" y1="578.5645" x2="511.8228" y2="555.9398" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset=".9505" stop-color="#B2B4B6"/></linearGradient><path style="&st62;" d="M90.412,59.954l0.689,0.108c1.976-1.573,3.869-3.571,3.869-3.571s1.258-1.261,1.889-2.356c0.22-0.381,0.281-0.356,0.271-0.177c0.023-0.09,0.103-0.456-0.038-0.714c-0.094-0.176-0.381,0.288-0.83,0.861c0,0-2.013,2.926-5.798,5.816c-3.786,2.891-4.776,3.771-8.083,5.655c0,0-2.309,1.021-3.914,0.669c-1.246-0.271,0-1.547,0.271-2.699c0.271-1.146,0.063-1.58-0.225-1.807c-0.287-0.225-0.91-0.385-2.142-0.109c0,0-4.709,1.264-6.819,3.307c-1.918,1.854,0.478,2.619,1.021,2.875c0,0,0.78,0.338,0.719,0.672c-0.063,0.336-0.496,0.623-0.733,0.783c-0.239,0.16-3.338,1.977-8.324,2.764c-4.039,0.641-3.26,0.255-7.143,0.654c-3.881,0.399-4.952,0.72-8.068,1.453c-3.116,0.734-4.945,1.537-5.352,2.349c-0.336,0.671,0.479,1.103,0.991,1.407c0.511,0.304,1.423,0.781,1.119,1.293c-0.305,0.512-1.631,1.277-4.874,1.391c-3.243,0.114-4.569-0.336-5.16-1.04c-0.548-0.649-0.08-1.323,0.096-1.946c0,0,0.382-0.814,0.16-1.215c-0.224-0.398-0.737-0.494-1.278-0.559c-0.544-0.064-3.245-0.158-5.337-0.271c-2.372-0.127-5.208-0.211-8.611-0.928c0,0-2.237-0.441-3.69-1.262c-0.096-0.055-0.18-0.107-0.25-0.156c-0.11-0.059-0.194-0.122-0.25-0.209c-0.41-0.432-0.047-0.748-0.186-1.168c-0.121-0.359-0.352-0.878-0.896-1.501c-0.176-0.183-0.428-0.437-0.72-0.713c-0.08-0.069-0.165-0.144-0.254-0.214c-1.276-1.037-1.422-1.149-1.964-1.166c-0.542-0.019-0.235,0.895-0.129,1.246c0.041,0.136,0.139,0.328,0.242,0.508c-0.2-0.364-0.336-0.729-0.257-0.915c0.144-0.337,0.309-0.308,0.309-0.308s0.133-0.053,0.595,0.297c0.463,0.35,1.499,1.078,2.012,1.705c0.512,0.625,0.481,1.18,0.481,1.18s-0.103,0.563,0.451,1.17c0.555,0.604,1.733,1.714,5.859,2.349c0.021,0.005,0.041,0.005,0.06,0.009l0.193-0.549l0.568,0.663c0.006,0,0.01,0.001,0.016,0.002c3.592,0.519,5.544,0.563,5.544,0.563s4.709,0.164,5.982,0.164c1.271,0,1.035,0.664,1.035,0.664s-0.072,0.361-0.225,0.647c-0.153,0.288-0.524,1.365-0.144,1.94c0,0,0.585,1.426,4.382,1.527c0,0,3.324,0.267,5.643-0.688c2.317-0.954,0.224-2.277,0.224-2.277s-0.794-0.483-1.129-0.737c-0.308-0.233-0.184-0.48-0.122-0.646c0.061-0.163,0.297-0.355,0.564-0.492c0.265-0.134,1.241-0.652,5.365-1.722c4.124-1.067,6.587-1.183,6.587-1.183s0.021-0.004,0.062-0.006l0.334-0.656l0.845,0.559c0.732-0.061,1.686-0.129,2.537-0.17c1.691-0.083,4.341-0.475,5.879-0.811c1.539-0.342,3.869-1.059,5.591-1.951c1.724-0.891,1.808-1.519,1.808-1.519s0.328-0.472-0.391-0.995c-0.719-0.521-1.037-0.38-1.672-1.024c-0.638-0.646,0.553-1.619,0.553-1.619s0.615-0.865,4.021-2.177c3.408-1.313,3.98-0.873,4.156-0.728c0.175,0.142,0.195,0.613,0.123,0.933c-0.072,0.316-0.494,1.455-0.721,2.055c-0.227,0.592-0.316,1.402,0.604,1.6c0.924,0.193,2.215-0.009,3.427-0.443c2.893-1.033,3.757-2.295,8.535-5.764c0.011-0.01,0.021-0.016,0.029-0.023L90.412,59.954L90.412,59.954z"/><linearGradient id="SVGID_33_" gradientUnits="userSpaceOnUse" x1="415.4736" y1="573.4199" x2="510.5869" y2="550.7977" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset=".9505" stop-color="#B2B4B6"/></linearGradient><path style="&st52;" d="M100.895,47.596c-0.635,1.186-1.164,2.608-1.443,3.5c-0.045,0.213-0.061,0.33-0.061,0.33s-0.119,0.654-0.054,1.036c0.028,0.161,0.069,0.279,0.106,0.375c0.021,0.052,0.039,0.095,0.055,0.134c0.02,0.045,0.031,0.082,0.033,0.111c0.007,0.082-0.044,0.614-0.27,1.23l0,0c0,0,0,0,0,0.002c-0.063,0.176-0.143,0.359-0.24,0.539c-0.024,0.05-0.053,0.095-0.074,0.139c-0.458,0.814-1.098,1.457-1.604,1.532c-0.324,0.049-0.484-0.117-0.557-0.386c0.014,0.369,0.086,0.738,0.289,0.963c0.406,0.441,1.563-0.795,1.563-0.795s0.688-0.789,0.965-2.062c0.406-1.875,0.187-2.248,0.187-2.248s-0.247-0.389-0.093-0.853c0.152-0.461,1.156-3.047,1.979-4.01l0.502-0.562c0-0.009,0.002-0.02,0.002-0.029l-0.211-0.521c-0.129,0.13-0.259,0.284-0.385,0.454C101.405,46.763,101.178,47.129,100.895,47.596L100.895,47.596z"/><linearGradient id="SVGID_34_" gradientUnits="userSpaceOnUse" x1="414.7754" y1="570.4785" x2="509.8697" y2="547.861" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset=".9505" stop-color="#B2B4B6"/></linearGradient><path style="&st53;" d="M10.564,70.807L10.564,70.807c-0.146-0.092-0.315-0.229-0.469-0.356c-0.133-0.112-0.641-0.585-1.18-1.086c-0.212-0.194-0.411-0.382-0.589-0.55c-0.277-0.262-0.524-0.493-0.688-0.646l0.107,0.358c0.017,0.028,0.034,0.06,0.052,0.089c0.183,0.29,0.854,1.264,2.153,2.277c1.549,1.213,1.559,0.729,1.559,0.729s0.062-0.4-0.296-0.84c-0.063-0.076-0.131-0.167-0.202-0.27v0.002C11.011,70.516,12.023,71.998,10.564,70.807z"/><linearGradient id="SVGID_35_" gradientUnits="userSpaceOnUse" x1="414.915" y1="571.0664" x2="510.04" y2="548.4415" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset=".9505" stop-color="#B2B4B6"/></linearGradient><path style="&st54;" d="M10.678,69.98c0.103,0.186,0.219,0.371,0.333,0.533C11,70.501,10.833,70.253,10.678,69.98z"/><linearGradient id="SVGID_36_" gradientUnits="userSpaceOnUse" x1="416.1035" y1="576.0654" x2="511.2286" y2="553.4405" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#EDEDEE"/><stop offset=".4176" stop-color="#FFF"/><stop offset=".6264" stop-color="#F8F9F9"/><stop offset=".9505" stop-color="#B2B4B6"/></linearGradient><path style="&st55;" d="M96.887,55.023c0,0,0.227-0.76,0.243-1.066c-0.003,0.014-0.005,0.021-0.005,0.021s-0.513,1.443-0.333,2.16C96.771,55.579,96.887,55.023,96.887,55.023z"/><path style="&st34;" d="M63.301,4.417l0.728,0.072c1.426-0.402,2.643-0.772,2.643-0.772s1.265-0.41,1.901-0.637c0.635-0.226,1.09-0.313,1.654-0.409c0.565-0.096,1.311-0.14,1.709-0.131c0.4,0.007,0.531,0.122,0.531,0.122s0.166,0.131,0.244,0.27c0.077,0.138,0.74,1.891,2.973,2.005c2.233,0.112,2.263-1.096,2.065-1.464c-0.226-0.427-0.896-0.863-0.896-0.863s-0.899-0.575-1.092-0.847c-0.191-0.27,0.034-0.357,0.104-0.375c0.065-0.017,2.435-0.497,2.729-0.609l0.021-0.021l-0.562-0.171c0,0-0.119,0.134-0.789,0.313c-0.67,0.179-1.235,0.246-1.742,0.313c-0.506,0.066-0.506,0.239-0.506,0.239l-0.086,0.136c-0.025,0.075-0.067,0.321,0.375,0.642c0.528,0.387,1.172,0.75,1.438,1.04s0.586,0.783,0.012,1.137C76.48,4.576,76.27,4.64,75.977,4.671c0.002,0.008,0,0.012,0,0.012c-0.248,0.021-0.457,0.03-0.638,0.03c-0.049,0.002-0.102,0.006-0.155,0.009l-0.017-0.013c-0.506-0.024-0.746-0.142-1.067-0.302c-0.442-0.223-0.758-0.73-0.92-1.087s-0.521-0.662-0.521-0.662c-0.588-0.336-1.695-0.343-2.813-0.15c-1.115,0.193-2.656,0.707-2.925,0.812c-0.268,0.104-1.616,0.551-2.307,0.73c-0.693,0.178-1.222,0.357-1.646,0.47c-0.427,0.111-3.432,1.005-4.556,1.339c-1.126,0.334-1.849,0.46-1.849,0.46c-1.688,0.172-2.193-0.134-2.193-0.134c-0.296-0.124-0.261-0.526-0.261-0.526l0.009-1.147c0,0-0.027-0.433-0.357-0.611c-0.328-0.179-0.779-0.252-1.593-0.29c-0.811-0.038-1.683,0.044-2.093,0.134c-0.408,0.09-1.189,0.313-1.764,0.952c-0.572,0.641-0.481,1.139-0.481,1.139s0.004,0.079,0.01,0.201c0.154,0.245,0.416,0.524,0.862,0.739c1.015,0.485-1.137,1.342-1.137,1.342l0,0c-0.479,0.208-1.191,0.478-2.208,0.777c-2.21,0.647-3.684,0.774-3.684,0.774l0.679,0.254c0,0,5.468-1.016,7.148-2.616c0,0,0.625-0.293,0.021-0.88c-0.606-0.585-0.898-0.761-0.898-0.761s-0.41-0.223,0.02-0.772c0.428-0.546,0.922-0.794,1.352-0.933c0.428-0.135,1.754-0.249,2.925-0.093c0,0,0.491,0.042,0.457,0.407c-0.032,0.365-0.087,0.873-0.077,1.028c0.01,0.157,0.025,0.515,0.399,0.845c0.379,0.332,1.098,0.453,1.098,0.453s1.257,0.228,2.845-0.218c1.586-0.444,3.65-1.141,5.438-1.629L63.301,4.417L63.301,4.417z"/><linearGradient id="SVGID_37_" gradientUnits="userSpaceOnUse" x1="412.6152" y1="535.3994" x2="501.5865" y2="514.8846" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#FFF"/><stop offset=".6538" stop-color="#FFF"/><stop offset="1" stop-color="#CBCCCE"/></linearGradient><path style="&st56;" d="M91.596,12.992l0.271,0.486c-0.021,0.01-0.034,0.014-0.034,0.014c-1.114,0.515-3.999,1.32-4.271,1.398c-0.271,0.08-0.166,0.234-0.166,0.234c0.029,0.078,0.988,1.106,0.988,1.106c1.178,1.249,0.494,2.296,0.494,2.296s-0.852,1.347-2.844,1.12c-1.993-0.227-2.618-1.767-2.729-2.049c-0.111-0.282-0.197-0.768-0.22-1.095c-0.022-0.33-0.272-0.32-0.272-0.32c-1.069-0.03-2.887,1.089-2.887,1.089c-0.824,0.47-1.682,1.147-3.479,1.958c-0.879,0.396-1.694,0.716-2.287,0.936l-0.967-0.173l0.091,0.482c-0.042,0.013-0.063,0.021-0.063,0.021s-2.268,0.822-4.529,1.553c-2.268,0.732-3.65,0.8-3.65,0.8s-1.336,0.12-2.266-0.266c-0.93-0.386-0.959-0.94-0.939-1.415c0.021-0.476,0.483-1.404,0.623-1.958c0.139-0.555-0.683-0.644-0.683-0.644s-1.958-0.236-3.65,0.296c-1.69,0.535-2.54,1.159-2.54,1.159c-0.91,0.512-0.863,0.957-0.863,0.957s-0.012,0.467,0.551,0.869s1.072,0.505,1.736,0.654c0.668,0.149,0.791,0.311,0.791,0.311c1.08,0.894,0.416,1.785,0.047,2.434c-0.631,1.113-3.674,1.653-3.674,1.653c-3.276,0.758-5.12,1.08-7.827,1.452l-0.876-0.46l-0.276,0.615c-7.089,0.936-10.065,1.877-11.065,2.135c-1,0.257-1.261,0.784-1.369,0.904c-0.108,0.12,0.079,0.171,0.079,0.171c0.427,0.137,0.647,0.442,0.647,0.442s1.399,1.697-0.012,3.108c-1.359,1.36-2.785,1.674-2.785,1.674s-2.177,0.737-4.077,0.341c-1.899-0.399-2.439-1.889-2.416-2.395c0.024-0.505,0.176-1.075,0.694-1.661c0.517-0.585,0.654-0.667,0.654-0.667s0.358-0.279,0.421-0.415c0.079-0.172-0.404-0.233-0.404-0.233c-1.034-0.13-3.496-0.097-5.822,0.131c-1.439,0.14-2.769,0.374-3.578,0.518l-0.223-0.48l-0.543,0.625l-3.12,0.504c-1.514,0.222-2.576-0.028-2.576-0.028s-1.331-0.397-1.479-1.252c-0.147-0.852,0.359-1.87,0.49-2.177c0.13-0.307,0.5-0.934,0.5-0.934s0.068-0.13,0.068-0.34c0-0.211-0.233-0.536-0.233-0.536s-0.205-0.396-0.886-0.38c-0.682,0.018-0.866,0.131-1.144,0.364c-0.044,0.038-0.079,0.081-0.108,0.127c0.021-0.064,0.045-0.117,0.073-0.158c0.21-0.309,0.65-0.668,1.401-0.7c0.748-0.034,1.041,0.228,1.041,0.228c0.719,0.82,0.115,1.845-0.351,2.76c-0.057,0.095-0.155,0.271-0.229,0.483c-0.032,0.076-0.062,0.153-0.087,0.227c-0.358,1.06,0.292,1.565,0.668,1.661c0.376,0.097,1.141,0.57,4.269-0.031c3.13-0.603,3.587-0.731,3.587-0.731s6.145-1.087,8.96-0.425l0.023,0.004c0,0,1.297,0.367,0.331,1.334c-0.966,0.966-1.729,1.617-1.504,2.377c0.223,0.762,1.267,1.903,3.646,1.603c0,0,0.842-0.113,1.105-0.165c1.733-0.336,2.899-1.268,2.899-1.268s0.972-0.721,0.782-1.631c-0.187-0.908-1.017-1.189-1.017-1.189s-0.659-0.424-0.141-1.237c0,0,0.141-0.69,2.553-1.317c2.412-0.626,6.813-1.518,10.555-1.989c3.49-0.408,9.652-1.575,10.89-2.08c1.235-0.508,1.497-1.4,1.521-1.708c0.024-0.31,0.072-0.83-1.14-1.09c-1.213-0.259-1.758-0.655-1.931-0.79c-0.172-0.138-0.545-0.483-0.545-1.275c0-0.791,1.607-1.745,3.392-2.35c1.78-0.606,3.927-0.34,3.927-0.34c1.948,0.167,0.936,1.963,0.936,1.963c-0.074,0.322-0.946,1.785,0.5,2.169c1.541,0.409,4.175-0.347,5.188-0.669c0.829-0.261,3.141-1.074,4.688-1.62c0.352-0.122,0.66-0.231,0.908-0.318c1.656-0.577,3.019-1.219,3.785-1.681c0.771-0.462,2.144-1.297,2.144-1.297s1.351-0.744,1.799-0.808c0.451-0.064,1.619-0.346,1.771,0.771c0.155,1.115,0.631,1.899,1.4,2.271c0.771,0.371,2.064,0.538,3.246-0.231c1.182-0.771,0.359-1.901,0.359-1.901c-0.021-0.028-0.039-0.057-0.062-0.085c-0.151-0.27-0.369-0.518-0.487-0.646c-0.388-0.47-0.736-0.822-0.736-0.822c-0.295-0.436,0.053-0.692,0.425-0.834c0.373-0.141,2.351-0.758,2.351-0.758c1.155-0.383,1.592-0.551,2.053-0.988c0.445-0.419-0.189-1.34-0.239-1.412l0.004-0.002l0.608,0.256c0.136,0.182,0.27,0.362,0.4,0.547l-0.007,0.005c0,0,0.226,0.527,0.054,0.799c-0.095,0.149-0.343,0.293-0.545,0.395L91.596,12.992L91.596,12.992z"/><linearGradient id="SVGID_38_" gradientUnits="userSpaceOnUse" x1="390.042" y1="485.6797" x2="390.042" y2="485.6797" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#FFF"/><stop offset=".6538" stop-color="#FFF"/><stop offset="1" stop-color="#CBCCCE"/></linearGradient><path style="&st57;" d="M-16.122-14.641"/><path style="&st34;" d="M57.455,92.28c-0.034-0.042-0.042-0.034-0.012-0.063c0.021-0.021,0.086-0.082,0.115-0.137c0,0-1.17-0.063-2.141,0.077c-0.962,0.137-1.933,0.335-1.933,0.335l0.301,0.146c0,0,0.127-0.055,1.047-0.183c0.921-0.128,1.267-0.128,1.267-0.128s0.808-0.063,0.969-0.063c0.162,0,0.061,0.104,0.061,0.104s-0.078,0.136,0.366,0.124c0,0,0.663-0.027,1.313-0.188C58.809,92.309,57.678,92.544,57.455,92.28z"/><path style="&st34;" d="M54.469,92.691c0,0,0.146,0.266-2.923,0.394c0,0,1.788,0.052,3.31-0.198C55.963,92.707,54.469,92.691,54.469,92.691L54.469,92.691z"/><path style="&st34;" d="M13.114,9.856c0,0-0.005,0.096,0.019,0.131c0.024,0.034,0.107,0.112,0.107,0.112s0.328-0.5,0.194-0.438c0,0-0.119,0.187-0.164,0.23c0,0-0.029,0.04-0.088,0.077C13.123,10.006,13.117,9.991,13.114,9.856L13.114,9.856z"/><path style="&st34;" d="M10.595,12.501c0,0-0.388,0.46,0,0.52l0.528-0.527c0,0,0.139-0.234,0.139-0.398C11.263,12.095,10.752,12.343,10.595,12.501L10.595,12.501z"/><path style="&st12;" d="M-16.122-14.641"/><path style="&st31;" d="M21.093,23.707c1.227,0.146,1.499-0.132,1.527-0.172c0.294-0.003,1.475-0.034,2.865-0.207c1.685-0.21,3.564-0.891,3.564-0.891s1.554-0.568,2.096-1.18l0.016-0.002c0,0-0.693-0.6-1.057-1.122c0,0-0.286-0.557,0.027-1.035c0.316-0.479,0.836-1.008,2.344-1.643c1.506-0.636,2.356-0.514,2.356-0.514s0.594-0.006,1.007,0.45c0.415,0.458,0.649,1.006,0.649,1.006s0.029,0.38-0.115,0.63c-0.141,0.251-0.155,0.277-0.155,0.277s0.049,0.017,0.378-0.007c0.329-0.021,1.165-0.142,2.67-0.506c1.508-0.363,3.407-0.972,3.407-0.972s4.9-1.578,5.407-1.714c0.507-0.135,1.357-0.436,1.357-0.436l0.027,0.059c0,0,0.405,0.663,0.392,1.269V16.94c0,0-0.021,0.301-0.698,0.818c-0.674,0.517-1.226,0.479-1.678,0.442c-0.452-0.039-0.665-0.071-0.794-0.045l-0.72,0.04c-0.787,0.111-1.224,0.407-1.224,0.407c-1.804,1.065,0.731,9.287,0.731,9.287c-3.742,0.47-8.143,1.363-10.555,1.989c-2.412,0.627-2.553,1.317-2.553,1.317c-0.519,0.813,0.141,1.236,0.141,1.236s0.829,0.283,1.017,1.19c0.19,0.91-0.783,1.629-0.783,1.629s-1.159,0.97-2.898,1.268c-1.738,0.298-2.396,0.35-3.429-0.47c-0.91-0.721-0.297-1.864,0.312-2.301c0.612-0.438,0.909-0.91,0.988-1.113c0.079-0.203,0.032-0.376,0.032-0.376l-0.58-0.534c-2.005-1.33-9.884,0.063-9.884,0.063c-0.213-1.169-0.362-1.171-0.282-3.117c0.051-1.244,0.291-1.752,0.291-1.752l0.058-0.164c0,0,0.448-1.443,1.141-2.44c0,0,0.602-0.172,1.364-0.349C20.616,23.793,21.093,23.707,21.093,23.707L21.093,23.707z"/><linearGradient id="SVGID_39_" gradientUnits="userSpaceOnUse" x1="231.2324" y1="-407.8711" x2="263.6191" y2="-407.8711" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#696969"/><stop offset=".3702" stop-color="#2E2E2E"/><stop offset=".4554" stop-color="#424242"/><stop offset=".6014" stop-color="#303030"/><stop offset=".6947" stop-color="#4A4A4A"/><stop offset="1" stop-color="#666666"/></linearGradient><path style="&st26;" d="M49.855,16.94c0,0-4.085,1.326-3.891,1.254c0,0-0.39,0.075-0.686,0.161c-0.294,0.086-0.539,0.247-0.539,0.247s-3.288,1.222-6.438,1.848c-3.148,0.627-2.977-0.361-2.708-0.83c0.232-0.409,0.829-1.112-0.188-1.254c-1.019-0.14-1.788,0.251-2.21,0.439c-0.422,0.189-3.162,1.362-1.251,2.254c0,0,1.423,0.642-0.377,1.755c0,0-1.816,1.16-5.355,1.77c0,0-0.565,0.063-1.88,0.111c-1.316,0.046-2.558,0.213-4.12,0.658c-1.378,0.391-1.992,0.579-2.744,1.065l0.194-0.501l0.2-0.462c1.069-0.533,3.719-1.288,5.717-1.378c1.997-0.089,2.908-0.16,4.721-0.624c2.134-0.546,2.702-1.019,2.93-1.163c0.194-0.123,0.771-0.479,0.493-0.633c-0.359-0.199-0.895-0.729-0.895-0.729c-0.217-0.256-0.39-0.373-0.158-1.046c0.356-1.029,2.196-1.644,2.196-1.644s1.028-0.534,2.334-0.514c1.305,0.021,1.287,0.752,1.287,0.752s0.062,0.34-0.268,0.827c0,0-0.503,0.579-0.049,0.656c0.454,0.081,1.622,0.179,5.48-1.028c3.859-1.207,8.085-2.611,8.085-2.611S49.855,16.66,49.855,16.94L49.855,16.94z"/><linearGradient id="SVGID_40_" gradientUnits="userSpaceOnUse" x1="231.623" y1="-407.063" x2="263.4941" y2="-407.063" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#525252"/><stop offset=".1856" stop-color="#333333"/><stop offset=".354" stop-color="#AEAEAE"/><stop offset=".4199" stop-color="#ADADAD"/><stop offset=".4276" stop-color="#9D9D9D"/><stop offset=".4433" stop-color="#818181"/><stop offset=".4611" stop-color="#6A6A6A"/><stop offset=".4814" stop-color="#585858"/><stop offset=".506" stop-color="#4C4C4C"/><stop offset=".539" stop-color="#444444"/><stop offset=".6166" stop-color="#424242"/><stop offset=".6684" stop-color="#454545"/><stop offset="1" stop-color="#BDBDBD"/></linearGradient><path style="&st58;" d="M31.145,21.257c-0.541,0.612-2.096,1.18-2.096,1.18s-1.88,0.68-3.564,0.891c-1.608,0.201-2.777,0.209-2.777,0.209l-0.082-0.002c-0.175,0.145-0.483,0.188-0.728,0.21c-0.244,0.023-0.806-0.039-0.806-0.039s-2.156,0.432-2.603,0.616c0,0-0.253,0.392-0.331,0.539c-0.08,0.146-0.299,0.594-0.299,0.594c1.069-0.534,3.718-1.289,5.717-1.379c1.997-0.089,2.908-0.159,4.721-0.624c2.134-0.546,2.702-1.019,2.929-1.163c0.195-0.123,0.771-0.479,0.493-0.633c-0.358-0.199-0.894-0.729-0.894-0.729c-0.217-0.256-0.391-0.373-0.158-1.046c0.356-1.029,2.196-1.644,2.196-1.644s1.028-0.533,2.333-0.514c1.306,0.021,1.287,0.753,1.287,0.753s0.062,0.34-0.269,0.826c0,0-0.503,0.579-0.049,0.657c0.455,0.08,1.622,0.178,5.48-1.028c3.858-1.208,8.085-2.612,8.085-2.612c-0.098-0.29-0.296-0.652-0.296-0.652s-0.85,0.301-1.358,0.436c-0.506,0.136-5.407,1.714-5.407,1.714s-1.9,0.608-3.407,0.972c-1.506,0.364-2.342,0.485-2.671,0.508c-0.329,0.021-0.378,0.006-0.378,0.006s0.013-0.027,0.156-0.279c0.144-0.248,0.115-0.629,0.115-0.629s-0.235-0.548-0.649-1.006c-0.414-0.457-1.007-0.45-1.007-0.45s-0.849-0.121-2.355,0.514c-1.508,0.636-2.029,1.164-2.346,1.643c-0.312,0.478-0.026,1.035-0.026,1.035c0.365,0.521,1.057,1.122,1.057,1.122"/><linearGradient id="SVGID_41_" gradientUnits="userSpaceOnUse" x1="236.917" y1="-417.333" x2="235.8882" y2="-410.5272" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)"><stop offset="0" stop-color="#969696"/><stop offset="1" stop-color="#000"/></linearGradient><path style="&st24;" d="M21.606,31.241c0,0-0.064-0.328,0.172-0.939c0.234-0.611,0.908-0.595,1.362-0.503c0.455,0.095,0.846,0.298,1.472-0.124c0.627-0.423,0.47-1.583,0.046-2.852c-0.423-1.267-0.328-2.128-0.328-2.128l-0.608-0.649l-0.237,0.696c0.047,1.316,0.657,3.226,0.829,3.759c0.173,0.533,0.297,0.8-0.735,0.517c-1.034-0.282-1.519,0.125-1.519,0.125c-1.332,0.862-1.082,2.161-1.082,2.161L21.606,31.241z"/><path style="&st60;" d="M27.498,36.633c-0.264-1.763-0.917-2.749-0.917-2.749c-0.25,0.188-0.513,0.693-0.513,0.693s0.179,0.208,0.471,1.568c0,0,0.141,0.106,0.438,0.279C27.273,36.597,27.498,36.633,27.498,36.633z"/><path style="&st60;" d="M33.152,32.881c0,0-0.78,0.907-0.378,2.336c0,0,0.454-0.379,0.585-0.68c0,0-0.145-0.458,0.138-1.017C33.5,33.52,33.37,33.1,33.152,32.881L33.152,32.881z"/><linearGradient id="SVGID_42_" gradientUnits="userSpaceOnUse" x1="428.7803" y1="532.0527" x2="429.5303" y2="524.4692" gradientTransform="matrix(1 0 0 1 -406.1641 -500.3203)"><stop offset="0" stop-color="#333333"/><stop offset=".431" stop-color="#000"/><stop offset="1" stop-color="#2E2E2E"/></linearGradient><path style="&st3;" d="M21.2,31.253c0.017-1.299,0.471-1.492,0.905-1.818c0.436-0.328,1.326-0.024,1.326-0.024s0.678,0.218,1.046-0.1c0.369-0.319-0.017-1.467-0.217-2.123c-0.202-0.653-0.41-1.599-0.445-2.262c-0.025-0.489-0.091-0.707-0.125-0.789l-0.205,0.604c0.047,1.316,0.657,3.226,0.829,3.759c0.173,0.533,0.297,0.8-0.735,0.517c-1.035-0.282-1.519,0.125-1.519,0.125c-1.332,0.862-1.082,2.162-1.082,2.162l0.259-0.027L21.2,31.253L21.2,31.253z"/><path style="&st21;" d="M26.239,34.29c0.045,0.06,0.421,0.597,0.736,2.113l0.005,0.025c0.294,0.17,0.519,0.205,0.519,0.205c-0.264-1.763-0.917-2.749-0.917-2.749C26.46,33.977,26.336,34.143,26.239,34.29L26.239,34.29z"/><path style="&st21;" d="M33.152,32.881c0,0-0.78,0.907-0.378,2.336c0,0,0.125-0.104,0.262-0.248l0.021-0.051c-0.304-1.033,0.283-1.763,0.283-1.763l0.004-0.003C33.291,33.053,33.225,32.957,33.152,32.881z"/><path style="&st10;" d="M17.159,8.189h0.117c-0.16,0.481-0.789,1.141-1.068,1.583c-0.156,0.248-0.252,0.572-0.474,0.751c0.038,0.043-0.003,0.003,0.04,0.04c0.088,0.052,0.813-0.139,0.95-0.236c0.082,0.015,0.076,0.011,0.12,0.039c0.042,0.07-0.481,0.991-0.595,1.109v0.04c0.196-0.023,0.502-0.056,0.634-0.16c0.383-0.299,0.47-0.937,0.75-1.346c-0.013-0.066-0.026-0.132-0.04-0.196c-0.222-0.04-0.681,0.02-0.87,0.157h-0.039c0.091-0.473,0.868-1.346,1.146-1.741c0.454-0.647,0.881-1.269,1.345-1.9c0.243-0.331,0.585-0.622,0.831-0.949c0.276-0.367,0.569-0.85,0.949-1.107V4.194h-0.158c-0.186,0.135-0.675,0.218-0.908,0.354c0.032,0.135,0.019,0.101,0.118,0.158c-0.139,0.386-0.598,0.673-0.832,0.991c-0.371,0.5-0.784,0.968-1.147,1.464c-0.123,0.164-0.205,0.421-0.356,0.553c-0.237,0.208-0.913,0.185-1.185,0.396h-0.08c0.056-0.332,0.907-1.392,1.147-1.622v-0.04c-0.408,0.057-0.724,0.273-0.989,0.473c0.044,0.091,0.037,0.073,0.12,0.12c-0.145,0.238-0.361,0.415-0.515,0.633c-0.197,0.275-0.305,0.602-0.514,0.871c0.014,0.04,0.028,0.077,0.04,0.118C15.948,8.641,17.001,8.307,17.159,8.189L17.159,8.189z M51.936,13.534c0.199,0.066,0.396,0.131,0.596,0.197c0.159,0.002,0.327-0.002,0.432-0.04c-0.009-0.654-0.364-0.913-0.593-1.345c-0.113-0.22-0.175-0.523-0.355-0.673c0.069-0.242,0.727-0.308,0.988-0.396c0.643-0.211,1.371-0.422,2.02-0.633c0.305-0.099,0.664-0.077,0.91-0.236c0.146,0.015,0.22,0.029,0.277,0.118c0.143,0.212,0.26,1.667,0.156,2.097c-0.398,1.663-0.896,2.963-1.938,3.958v0.039c0.385-0.062,0.568-0.436,0.83-0.632c1.051-0.794,1.762-1.972,2.137-3.444c0.221-0.865-0.14-1.713,0.199-2.452h-0.039c-0.074-0.188-1.082-0.553-1.388-0.555c-0.164,0.177-0.399,0.416-0.634,0.515c-0.357,0.152-0.838,0.109-1.146,0.315c-0.287-0.024-0.506-0.57-0.315-0.791c-0.011-0.09-0.009-0.112-0.04-0.158c-0.239-0.191-0.85-0.171-1.268-0.158c-0.133,0.125-0.252,0.15-0.314,0.358h-0.039c-0.021,0.076,0.02,0.05,0.039,0.078c0.025,0.016,0.163-0.007,0.236,0.04c0.449,0.047,0.438,0.566,0.675,0.831c-0.027,0.069-0.011,0.04-0.042,0.08c-0.155,0.123-1.301,0.453-1.543,0.515c-0.185,0.046-0.414-0.068-0.553-0.081c-0.336-0.028-0.633,0.16-0.831,0.277c0.107,0.157,0.434,0.118,0.554,0.276C51.368,12.193,51.556,12.913,51.936,13.534L51.936,13.534z M59.807,12.977c0.187,0.093,0.187,0.332,0.278,0.514c0.185,0.371,0.437,0.82,0.554,1.228v0.316c0.092,0.252,0.396,0.284,0.596,0.435c0.156-0.021,0.214-0.061,0.314-0.118c-0.066-0.753-0.525-1.378-0.791-1.979c-0.08-0.188-0.207-0.452-0.236-0.633c-0.021-0.109,0.063-0.169,0-0.276c-0.051-0.123-0.072-0.085-0.156-0.159c-0.059-0.04-0.031-0.016,0-0.078c0.068-0.144,0.213-0.287,0.275-0.436c0.133-0.313,0.127-0.576,0.396-0.751c-0.04-0.41-0.639-0.457-1.107-0.435c-0.057,0.042-0.156,0.064-0.24,0.077c0.05,0.103,0.082,0.124,0.199,0.157c0.113,1.161-0.699,2.225-1.229,2.928c-0.208,0.279-0.556,0.456-0.75,0.754h-0.04v0.038C58.395,14.473,59.54,13.383,59.807,12.977L59.807,12.977z M12.407,22.83c-0.081,0.017-0.076,0.009-0.117,0.039c-0.288,0.148-0.773,1.426-1.346,1.069c-0.292,0.002-0.319-0.055-0.476-0.16c0.02-0.376,0.659-1.063,0.913-1.226c0.031-0.604,0.187-1.252,0.118-1.819c-0.041-0.014-0.08-0.028-0.118-0.039c-0.14-0.046-0.25,0.168-0.357,0.276c-0.29,0.291-0.648,0.597-0.871,0.949c-0.337-0.003-1.414-0.013-1.623,0.119H8.411c0.099-0.256,0.86-1.096,0.633-1.464c-0.013-0.041-0.025-0.08-0.04-0.12c-0.722,0.002-1.592,1.287-1.82,1.82c-0.115,0.266-0.115,0.573-0.276,0.791v0.04c0.54-0.066,1.082-0.133,1.622-0.199c0.205-0.044,0.487,0.052,0.633-0.039h0.554c0.092-0.118,0.184-0.238,0.277-0.356c0.33-0.349,0.768-0.702,1.028-1.106h0.119v0.551c-0.303,0.273-0.773,0.695-0.91,1.108v0.316c-0.203,0.88,0.223,1.329,0.99,1.267c0.5-0.466,1.324-0.848,1.226-1.779C12.405,22.833,12.444,22.873,12.407,22.83L12.407,22.83z M7.819,22.118H7.58c0.109-0.436,0.537-0.935,1.069-0.95v0.197c-0.185,0.239-0.369,0.475-0.554,0.713C7.982,22.076,7.88,22.076,7.819,22.118z M93.044,22.315c-0.164-0.405-0.294-0.722-0.475-1.068c-0.3-0.574-0.613-1.414-1.464-1.425c-0.211,0.179-0.435,0.322-0.555,0.593c-0.777,1.762,0.819,3.747,1.543,4.71c0.256,0.339,0.557,0.712,0.948,0.908c-0.091,1.376-1.269,1.813-2.53,1.267c-0.899-0.386-1.617-1.237-2.179-1.979c-0.188-0.249-0.481-0.457-0.672-0.713c-0.177-0.239-0.304-0.507-0.515-0.713v-0.039h-0.078c0.107,0.426,0.354,0.815,0.514,1.188c0.669,1.538,1.52,2.614,2.811,3.521c0.608,0.428,1.621,1.104,2.494,0.475C94.412,27.942,93.669,23.851,93.044,22.315L93.044,22.315z M92.928,24.216c-0.104,0.1-0.539-0.419-0.635-0.515c-0.441-0.443-1.329-1.221-0.83-1.979h0.197c0.388,0.403,0.746,0.788,0.99,1.344c0.129,0.299,0.152,0.805,0.313,1.069C92.941,24.205,92.958,24.175,92.928,24.216L92.928,24.216z M66.693,32.128v-0.395c0.179-0.801,0.137-1.765,0.314-2.572c0.241-1.088-0.101-2.148,0.99-2.414c0.021-0.106,0.057-0.148,0-0.238c-0.025-0.067-0.009-0.039-0.04-0.079c-0.043-0.031-0.038-0.024-0.116-0.039c-0.305,0.222-1.131,0.373-1.543,0.474c-0.313,0.076-0.639,0.01-0.871,0.158c-0.039,0.013-0.078,0.027-0.119,0.04c0.014,0.079,0.025,0.159,0.041,0.237c0.451,0.147,0.867-0.031,1.067,0.356c0.13,0.252,0.112,1.157,0.039,1.504c-0.251,1.163-0.146,2.491-0.396,3.64c-0.086,0.397,0.022,1.171-0.157,1.463v0.08c-0.241-0.115-0.397-0.426-0.554-0.633c-0.354-0.467-0.875-0.84-1.229-1.305c-0.213-0.281-0.437-0.617-0.712-0.833c0.037-0.761,0.259-1.56,0.438-2.254c0.131-0.522,0.135-1.005,0.395-1.386c0.148-0.217,0.505-0.355,0.751-0.475c-0.002-0.1-0.004-0.146-0.04-0.198c-0.014-0.04-0.023-0.079-0.037-0.119c-0.543,0.081-1.003,0.341-1.505,0.475c-0.454,0.123-0.911,0.092-1.269,0.276c0.012,0.091,0.01,0.112,0.041,0.158c0.014,0.039,0.024,0.08,0.039,0.118c1.391-0.078,1.18,0.678,0.912,1.742c-0.084,0.326-0.029,0.775-0.199,1.028v0.079h-0.039c-0.285-0.433-0.713-0.852-1.067-1.227c-0.146-0.132-0.291-0.264-0.435-0.395c-0.104-0.137-0.16-0.312-0.278-0.436c0.024-0.437,0.38-0.549,0.713-0.672c-0.015-0.183-0.052-0.206-0.118-0.317c-1.031,0.151-1.927,0.73-3.086,0.791v0.041h-0.04c0.004,0.1,0.004,0.146,0.04,0.197v0.079c0.227,0.039,0.564-0.054,0.831,0.04c0.427,0.15,0.81,0.648,1.067,0.99c0.388,0.513,0.996,0.949,1.384,1.463c0.204,0.274,0.434,0.634,0.713,0.832c-0.038,0.696-0.229,1.428-0.396,2.058c-0.086,0.323-0.035,0.735-0.197,0.988c-0.025,0.069-0.01,0.039-0.041,0.08c-0.377-0.718-1.104-1.265-1.582-1.9c-0.918-1.22-1.938-2.319-2.889-3.521c0-0.167,0.01-0.268,0.08-0.356c0.073-0.229,0.359-0.443,0.633-0.476c0.015-0.12,0.033-0.135-0.039-0.238c-0.016-0.038-0.026-0.077-0.041-0.118c-0.803,0.123-1.521,0.497-2.293,0.714c-0.401,0.112-0.928,0.057-1.229,0.276c-0.04,0.013-0.08,0.026-0.117,0.04c0.021,0.152,0.061,0.176,0.117,0.277c0.314-0.005,0.646-0.092,0.949,0c0.793,0.241,1.361,1.137,1.818,1.742c0.201,0.266,0.513,0.483,0.713,0.751c0.849,1.129,1.808,2.146,2.65,3.285c0.328,0.442,0.771,0.825,1.066,1.304c0.179-0.004,0.216-0.025,0.316-0.079c0.213-0.929,0.332-1.866,0.596-2.81c0.119-0.432,0.269-0.942,0.314-1.424c0.327,0.117,0.592,0.607,0.793,0.871c0.618,0.821,1.491,1.502,2.057,2.373c0.164-0.007,0.182-0.026,0.277-0.078C66.352,34.819,66.521,33.473,66.693,32.128L66.693,32.128z M4.297,38.894c-0.013,2.467-0.142,6.269,1.781,6.806c0.7,0.193,1.087-0.271,1.306-0.595c0.786-1.17,0.565-3.446-0.199-4.43c-0.339,0.034-0.825,0.84-0.988,1.106c-0.082-0.016-0.075-0.011-0.119-0.04c-0.091-0.041-0.085-0.066-0.159-0.118c-0.06-0.933,0.127-1.802,0.159-2.691c1.044,0.102,1.941,0.696,3.007,0.751c-0.001-0.185,0-0.434,0.077-0.552c-0.009-0.092-0.007-0.112-0.04-0.16c-0.145-0.115-0.949-0.306-1.186-0.315v-0.04h-0.04c0.146-1.174-0.186-2.082-0.99-2.414c-0.449-0.08-0.897-0.16-1.346-0.239c-0.229-0.083-0.341-0.266-0.514-0.395c-0.058-0.38-0.133-0.806,0.159-1.029c-0.021-0.142-0.032-0.168-0.119-0.238v-0.039h-0.04c-0.133,0.228-0.245,0.493-0.315,0.792c-0.234,0.983,0.309,1.818,0.909,2.018c0.397,0.065,0.792,0.132,1.188,0.197c0.314,0.122,0.453,0.379,0.671,0.595c-0.009,0.512-0.5,0.568-0.91,0.435c-0.64-0.208-1.321-0.353-1.977-0.592c-0.172-0.064-0.333-0.17-0.555-0.199c-0.027,0.25-0.054,0.501-0.08,0.751c0.554,0.171,1.109,0.343,1.662,0.515c-0.023,1.398-0.574,3.074,0.119,4.153c0.084,0.021,0.143,0.037,0.198,0.08c0.78-0.054,0.943-0.68,1.345-1.108c0.342,0.82,0.086,2.253-0.671,2.453c-0.326,0.224-0.803-0.066-0.989-0.237c-0.648-0.599-0.785-1.511-1.027-2.532c-0.083-0.344,0.033-1.042-0.118-1.307c0.006-0.404,0.092-1.134-0.12-1.344v-0.039L4.297,38.894L4.297,38.894z M99.336,45.543c-0.143-0.666,0.055-1.478-0.08-2.097v-0.633c-0.097-0.453-0.059-1.056-0.156-1.502c-0.189-0.882-0.022-1.926-0.355-2.652c-0.197-0.047-0.393-0.084-0.671-0.08c-0.103,0.104-0.179,0.158-0.159,0.278c0.083,0.359,0.547,0.432,0.673,0.792c0.015,0.172,0.026,0.343,0.04,0.514c0.133,0.561,0.111,1.286,0.236,1.86v0.475c0.063,0.289,0.16,1.036,0.078,1.267c-0.139,0.41-0.584,0.78-0.868,1.068c-0.754,0.755-1.64,1.715-2.97,1.859c-0.025,0.068-0.01,0.039-0.041,0.08c0.022,0.494,0.476,0.396,0.793,0.594c0.08-0.014,0.158-0.028,0.236-0.042c0.122-0.074,0.191-0.242,0.276-0.356c0.2-0.261,0.563-0.399,0.751-0.671h0.04c0.002,1.205,0.028,2.561,0.04,3.718h0.117c0.272-1.172,0.252-2.61,0.238-4.039c0.521-0.486,0.853-1.19,1.385-1.66v-0.078h0.041c0.007,1.251,0.037,2.529,0.037,3.797c0,0.407-0.102,1.378,0,1.544v0.237h0.08c0.106-0.425,0.133-1.023,0.236-1.501v-0.674C99.451,47.107,99.45,46.078,99.336,45.543L99.336,45.543z M28.313,48.073c-0.347-0.144-0.776-0.461-0.989-0.751c-0.637-0.875-1.337-2.948-0.87-4.51c0.379-1.266,1.202-2.127,2.532-2.454c0.673-0.163,1.397,0.062,1.821,0.278c1.208,0.622,1.725,1.506,2.096,2.967c0.48,1.887-0.132,3.619-1.385,4.194c0.078,0.764,0.158,1.529,0.237,2.295c0.444-0.013,0.852-0.105,1.227-0.199c0.629-0.155,1.271-0.176,1.86-0.315c0.431-0.104,1.052-0.015,1.384-0.237c0.079-0.17-0.247-1.35-0.315-1.623c-0.057-0.229-0.009-0.461-0.119-0.633v-0.079c-0.091,0.012-0.185,0.025-0.277,0.039c0.018,1.195-0.834,1.032-1.781,1.267c-0.473,0.119-1.049,0.27-1.581,0.276c0-0.17,0-0.343-0.001-0.514c0.045-0.083,0.739-0.386,0.868-0.476c0.461-0.318,0.931-0.826,1.229-1.304c0.202-0.327,0.366-0.764,0.473-1.149c0.138-0.489,0.154-1.17,0.041-1.662c-0.079-0.338-0.048-0.603-0.158-0.91c-0.427-1.187-1.322-2.054-2.453-2.532c-0.513-0.216-1.093-0.224-1.7-0.356c-0.539-0.116-1.509,0.124-1.901,0.238c-1.905,0.562-3.198,1.48-3.799,3.323c-0.236,0.728-0.163,1.736,0.04,2.414c0.467,1.561,1.773,3.02,3.72,3.047v0.039c0.062,0.088,0.06,0.264,0.118,0.355c-0.024,0.067-0.009,0.039-0.04,0.08c-0.164,0.111-0.404,0.061-0.633,0.117c-0.47,0.118-1.986,0.486-2.334,0.158c-0.222-0.072-0.37-0.363-0.396-0.632c-0.099,0.004-0.146,0.004-0.197,0.039h-0.082c0.146,0.767,0.291,1.53,0.435,2.296h0.041v0.04c1.385-0.239,2.77-0.478,4.154-0.713c-0.198-0.728-0.395-1.451-0.593-2.179C28.873,48.139,28.517,48.159,28.313,48.073L28.313,48.073z M96.014,43.682c0.086,0.218,0.254,0.58,0.435,0.712c0.086,0.063,0.132,0.04,0.198,0.119c1.31,0.113,1.842-2.143,1.308-3.442c-0.095-0.225-0.517-0.885-0.911-0.633h-0.08c0.026-0.069,0.01-0.038,0.04-0.08c-0.001-0.188-0.021-0.25-0.077-0.356c-0.08-0.013-0.156-0.026-0.238-0.038c-0.039,0.031-0.01,0.014-0.078,0.038c0.027,0.24,0.111,0.247,0.119,0.514C96.09,41.099,95.545,42.497,96.014,43.682z M96.446,41.585c0.088-0.213,0.265-0.35,0.396-0.515c0.082-0.015,0.075-0.01,0.117-0.04c0.301-0.001,0.385,0.057,0.555,0.159c0.301,0.711,0.346,1.954-0.156,2.494c-0.077,0.085-0.229,0.116-0.315,0.197C96.214,43.817,96.146,42.305,96.446,41.585L96.446,41.585z M78.092,57.168c-0.445-0.273-0.507-1.675-0.673-2.294c-0.327-1.215-0.483-2.489-0.831-3.72c-0.223-0.788-0.523-1.605-0.435-2.572c0.139-0.138,0.231-0.32,0.396-0.436c0.223-0.154,0.58-0.229,0.752-0.436c0.027-0.051-0.019-0.128-0.041-0.238c-0.459,0.074-0.879,0.35-1.267,0.515c-0.792,0.337-1.567,0.536-2.373,0.87c-0.252,0.104-0.515,0.282-0.833,0.315v0.238c0.027,0.014,0.055,0.025,0.08,0.04c0.042,0.045,1.033-0.392,1.346-0.118c0.356,0.125,0.311,0.59,0.514,0.872c-0.061,0.614-0.672,1.558-0.912,2.097c-0.58,1.326-1.17,2.592-1.816,3.836c-0.248,0.477-0.543,1.334-0.871,1.701v0.039c-0.216-0.296-0.199-1.051-0.314-1.462c-0.353-1.235-0.578-2.591-0.951-3.798c-0.068-0.23-0.305-1.279-0.156-1.503c0.051-0.546,0.822-0.785,1.266-0.95c-0.012-0.092-0.024-0.186-0.039-0.277c-0.701,0.105-1.429,0.479-2.058,0.713c-0.595,0.223-1.14,0.313-1.741,0.516c-0.298,0.102-0.636,0.275-0.986,0.314v0.041h-0.041c0.015,0.112,0.025,0.172,0.078,0.237c0.162,0.107,1.03-0.352,1.386-0.077c0.557,0.19,0.573,1.075,0.752,1.66c0.481,1.579,0.728,3.327,1.187,4.947c0.115,0.404,0.391,1.686,0.119,2.018c-0.148,0.439-0.885,0.615-1.306,0.791c0.014,0.08,0.024,0.159,0.036,0.237c0.609-0.09,1.162-0.373,1.707-0.56c1.063-0.354,2.066-0.65,3.089-1.029c-0.017-0.092-0.027-0.186-0.041-0.275c-0.437,0.116-0.773,0.248-1.386,0.236c-0.08-0.068-0.157-0.133-0.235-0.199c-0.067-0.21-0.134-0.422-0.199-0.632c0.043-0.499,0.683-1.421,0.91-1.86c0.673-1.293,1.262-2.6,1.856-3.955c0.229-0.519,0.754-1.275,0.832-1.857c0.184,0.111,0.133,0.438,0.197,0.672c0.135,0.475,0.211,0.98,0.355,1.503c0.281,1,0.391,2.075,0.673,3.126c0.104,0.387,0.261,1.048,0.08,1.464c-0.179,0.404-0.841,0.673-1.267,0.83c0.017,0.084,0.037,0.183,0.08,0.238c0.004,0.007,0.906-0.288,1.064-0.354c1.104-0.471,2.236-0.959,3.361-1.386c-0.015-0.093-0.024-0.187-0.039-0.274C79.117,57.043,78.477,57.407,78.092,57.168L78.092,57.168z M96.803,60.498c-0.143,0.13-0.354,0.163-0.514,0.277c-0.501,0.359-1.025,0.962-1.385,1.463c-0.288,0.402-0.534,0.843-0.791,1.268c-0.112,0.188-0.137,0.402-0.277,0.553v0.08c0.346-0.059,0.549-0.283,0.792-0.436c0.659-0.408,1.249-0.781,1.858-1.225c0.295-0.217,0.515-0.551,0.83-0.754c0.029-0.473,0.125-0.844-0.077-1.188C97.115,60.512,96.975,60.496,96.803,60.498z M96.329,61.921c-0.239,0.177-0.47,0.423-0.712,0.595c-0.208,0.146-0.458,0.224-0.633,0.396h-0.04c0.13-0.408,0.817-1.107,1.146-1.344c0.17-0.124,0.383-0.157,0.557-0.279h0.156c0.036,0.046,0.034,0.044,0.08,0.08C96.846,61.667,96.523,61.774,96.329,61.921L96.329,61.921z M10.825,63.465c-0.166-0.502-0.278-0.99-0.435-1.465c-0.079-0.246-0.062-0.525-0.199-0.713v-0.118c0.269,0.097,0.679,0.087,0.911,0.238h0.201c-0.045-0.206-0.086-0.552-0.201-0.713c-0.12-0.195-0.886-0.197-1.106-0.354c-0.312-0.244-0.607-0.947-0.832-1.307c-0.56-0.887-1.302-1.832-2.137-2.453c-0.443-0.329-0.751-0.671-1.544-0.673c-0.092,0.065-0.185,0.132-0.276,0.198c-0.178,0.789,0.139,2.248,0.592,2.611v0.078c-0.189-0.051-0.393-0.152-0.514-0.275h-0.04c0.007,0.227,0.051,0.522,0.158,0.672c0.046,0.195,0.362,0.354,0.554,0.396c0.248,1.037,0.592,2.101,0.95,3.05c0.289,0.758,0.436,1.48,0.75,2.213c0.155,0.356,0.522,0.617,0.634,0.99h0.117c-0.089-0.334-0.271-0.646-0.394-0.949c-0.364-0.875-0.653-1.804-0.952-2.688C6.868,61.62,6.734,61.057,6.548,60.5c-0.069-0.21-0.049-0.427-0.158-0.595v-0.039c0.269,0.049,0.43,0.188,0.634,0.276c0.461,0.201,0.903,0.277,1.385,0.476c0.353,0.146,0.796,0.347,1.228,0.396c0.048,0.359,0.253,1.301,0.435,1.545v0.117c-0.602-0.412-0.589-1-1.663-0.91c-0.054,0.063-0.128,0.117-0.197,0.158c-0.098,0.244-0.104,0.646,0,0.909c0.257,0.646,1.072,1.991,1.741,2.179c0.257,0.184,0.634-0.043,0.75-0.24c0.242,0.127,0.293,0.682,0.395,0.951c0.212,0.558,0.522,1.289,1.031,1.543v0.041h0.083c-0.066-0.447-0.318-0.851-0.475-1.229C11.387,65.223,11.113,64.324,10.825,63.465L10.825,63.465z M9.678,60.26C9.26,60.23,8.905,60.067,8.57,59.945c-0.894-0.332-1.703-0.615-2.492-0.991c-0.095-0.358-0.76-1.644-0.396-2.095c0.026-0.04,0.053-0.081,0.079-0.12c0.081-0.019,0.077-0.011,0.119-0.039c1.219,0.146,2.442,1.629,3.046,2.452c0.236,0.32,0.43,0.799,0.752,1.029V60.26L9.678,60.26z M10.311,63.701c-0.12,0.146-0.237,0.291-0.356,0.436c-0.105,0.078-0.223,0.109-0.316,0.198c-0.68-0.021-0.704-0.686-0.989-1.108c0.005-0.389,0.152-0.39,0.315-0.594c0.092-0.007,0.112-0.007,0.158-0.037c0.614,0.004,0.753,0.278,1.109,0.515C10.29,63.344,10.327,63.445,10.311,63.701L10.311,63.701z M33.578,69.794c-0.165-0.271-0.49-0.342-0.713-0.554c-0.069-0.023-0.04-0.007-0.079-0.039c0.51-0.264,1.053-0.555,1.583-0.79c0.142,0.158,0.801,0.792,1.029,0.671c0.04-0.012,0.079-0.023,0.118-0.038c-0.013-0.224-0.025-0.448-0.04-0.673c-0.499-0.498-1.234-0.91-2.059-1.066v0.039h-0.039c0.093,0.273,0.398,0.534,0.636,0.672v0.119c-0.469,0.068-0.885,0.295-1.307,0.437c-0.289,0.093-0.638,0.08-0.873,0.235h-0.117c0.171-0.479,0.737-0.871,1.028-1.267c0.576-0.776,1.033-1.728,1.94-2.176c-0.024-0.365-1.076-1.12-1.464-0.871c-0.097,0.051-0.029-0.021-0.079,0.078c-0.059,0.144,0.137,0.321,0.079,0.554c-0.076,0.305-0.831,1.74-1.029,1.9v0.041c-0.408-0.139-0.718-0.523-1.107-0.713c0.069-0.364,0.375-0.644,0.554-0.91c0.453-0.684,0.816-1.335,1.503-1.782c-0.006-0.526-0.855-1.075-1.425-1.065c0.002,0.242,0.125,0.379,0.08,0.592c-0.14,0.646-0.435,1.297-0.672,1.861c-0.156,0.364-0.226,0.799-0.476,1.065c-0.054,0.03-0.492-0.006-0.594-0.077c-0.149-0.002-0.298,0.005-0.394,0.038v0.079c0.666,0.645,1.387,0.865,2.295,1.268c-0.126,0.655-0.786,1.092-1.108,1.584c-0.166,0-0.3-0.011-0.395-0.08c-0.091,0.017-0.098,0.021-0.158,0.041c0.016,0.582,0.5,1.077,0.987,1.188c0.327-0.366,0.737-0.543,1.228-0.751c0.449,0.468,0.578,1.137,0.751,1.897c0.075,0.332-0.047,0.697,0.04,0.988c0.152,0.514,0.426,0.667,0.672,1.027h0.277c0.174-0.93-0.253-1.832-0.475-2.571C33.71,70.43,33.644,70.111,33.578,69.794L33.578,69.794z M96.09,63.108c-0.238,0.202-0.57,0.296-0.83,0.475c-0.4,0.282-0.758,0.659-1.146,0.95c-0.177,0.134-0.435,0.253-0.556,0.436c-0.199,0.299-0.16,0.806-0.396,1.067v0.157c0.314-0.114,0.464-0.483,0.713-0.672c0.307-0.23,0.563-0.536,0.87-0.754c0.192-0.133,0.411-0.207,0.594-0.355c0.125,0.023,0.115,0.037,0.199,0.081c-0.021,1.005-0.549,1.714-0.871,2.454c-0.093,0.215-0.121,0.551-0.276,0.71c-0.074,0.076-0.229,0.094-0.314,0.157c-0.264,0.291-0.528,0.58-0.794,0.873c-0.25,0.344-0.365,0.803-0.632,1.146c-0.002,0.114-0.002,0.216,0.037,0.276c0.041,0.031,0.11,0.059,0.16,0.08c0.51-0.483,1.004-0.887,1.424-1.465c0.658-0.904,0.986-2.047,1.465-3.125c0.3-0.683,0.734-1.354,0.711-2.334c-0.047-0.045-0.084-0.102-0.117-0.158L96.09,63.108L96.09,63.108z M93.32,69.361V69.4h-0.04c0.069-0.475,0.43-0.606,0.596-0.952h0.079C93.904,68.842,93.605,69.194,93.32,69.361L93.32,69.361z M34.171,69.993c-0.08,0.342,0.76,1.106,1.027,1.308c0.133,0.1,0.312,0.328,0.515,0.235c0.104-0.008,0.136-0.019,0.199-0.04c0.046-0.105,0.115-0.24,0.039-0.354C35.93,70.645,34.64,70.088,34.171,69.993z M37.97,73.037c0.067,0.034,0.122,0.021,0.198-0.039c0.139-0.113,0.063-0.313,0.159-0.475c0.222-0.159,0.615-0.118,0.911-0.199c0.809-0.213,1.753-0.198,2.65-0.396c0.425-0.093,1.128,0.16,1.464-0.037c0.04-0.016,0.081-0.026,0.118-0.043c-0.019-0.517-1.009-0.737-1.545-0.588c-0.237,0.066-0.513,0.213-0.751,0.275c-0.185,0.014-0.37,0.027-0.555,0.038c-0.062-0.644-0.38-1.144-0.395-1.817c0.595-0.013,1.341-0.091,1.739-0.316c-0.008-0.2-0.045-0.2-0.118-0.314c-0.453-0.107-1.23-0.126-1.583,0.116c-0.1-0.004-0.147-0.004-0.197-0.039c-0.221-0.28-0.116-0.851-0.316-1.146v-0.158c0.426-0.092,1.122-0.168,1.345-0.475c0.031-0.041,0.014-0.011,0.039-0.078c-0.036-0.035-0.051-0.068-0.079-0.119c-0.619-0.156-0.887-0.049-1.423,0.158c-0.167-0.535,0.034-0.959-0.514-1.108c0.117-0.203,0.506-0.194,0.751-0.276c0.382-0.126,0.817-0.296,1.148-0.474c0.026-0.068,0.007-0.04,0.04-0.08c-0.022-0.2-0.078-0.193-0.159-0.316c-0.571-0.044-1.027,0.011-1.346,0.316h-0.076c0.047-0.295,0.231-0.718,0.394-0.949c0.112-0.162,0.318-0.14,0.396-0.356h0.04V64.1c-0.081-0.104-0.159-0.211-0.238-0.314c-0.186-0.13-0.454-0.143-0.632-0.279c-0.263-0.004-0.515-0.003-0.672,0.079c0.021,0.152,0.089,0.248,0.119,0.356c0.109,0.408-0.284,1.669-0.436,1.859c-0.123,0.154-1.551,0.672-1.939,0.555c-0.092-0.029-0.36-0.164-0.435-0.239c-0.032-0.039-0.015-0.008-0.04-0.077c0.561-0.527,0.965-1.702,1.741-1.939c0.014-0.064,0.027-0.131,0.041-0.196c-0.194-0.2-1.135-1.188-1.622-0.871c-0.04,0.014-0.079,0.022-0.117,0.038c0,0.338,0.168,0.593,0.078,0.949c-0.182,0.711-0.587,1.556-0.95,2.139c-0.218,0.35-0.693,0.729-0.712,1.229c0.646-0.064,0.802-0.731,1.304-0.912c0.146,0.135,0.29,0.267,0.436,0.396c0.207,0.311,0.168,0.778,0.276,1.186c0.185,0.856,0.371,1.715,0.554,2.571c0.025,0.425,0.052,0.845,0.08,1.269C37.246,72.28,37.561,72.945,37.97,73.037L37.97,73.037z M39.233,70.032c0.031,0.368,0.258,1.407,0.436,1.662c0.001,0.024,0.001,0.054,0.001,0.08c-0.477,0.102-0.973,0.239-1.504,0.237c-0.082-0.564-0.352-1.061-0.355-1.662C38.418,70.338,38.731,70.094,39.233,70.032z M36.939,66.75c0.063-0.107,1.113-0.273,1.228-0.199c0.42,0.195,0.27,0.813,0.514,1.188c-0.083,0.194-1.047,0.487-1.345,0.514C37.283,67.834,37.213,66.977,36.939,66.75L36.939,66.75z M38.76,68.253h0.04c0.076,0.36,0.119,0.978,0.317,1.267c-0.142,0.348-1.016,0.317-1.346,0.516c-0.138-0.083-0.32-1.076-0.316-1.346C37.757,68.662,38.541,68.402,38.76,68.253L38.76,68.253z M31.914,70.506c-0.06,0.135-0.053,0.354-0.117,0.514c-0.342,0.84-0.454,1.015,0.079,1.82c0.237,0,0.269-0.037,0.396-0.119C32.429,72.064,32.454,70.814,31.914,70.506L31.914,70.506z M77.023,70.744c-1.154-0.285-2.125,0.285-3.325,0.199c-0.114-0.121-0.2-0.19-0.275-0.356c-0.835,0.024-1.757,1.886-0.909,2.453c0.453,0.308,1.744,0.129,2.295,0c0.306-0.071,0.783-0.139,1.027,0.038c0.332,0.247,0.273,1.182,0.157,1.703c-0.132,0.975-0.265,1.951-0.396,2.929c-0.117,0.593-0.236,1.185-0.356,1.779c0.606-0.003,1.178-0.623,1.349-1.069c0.1-0.258,0.047-0.502,0.119-0.791c0.209-0.83,0.237-1.82,0.436-2.689c0.127-0.563,0.041-1.1,0.156-1.621c0.086-0.393,0.143-1.696,0.041-2.059C77.281,71.059,77.126,70.901,77.023,70.744z M22.857,82.695c-0.135-0.102-0.229-0.283-0.356-0.395c-0.473-0.42-1.029-0.826-1.543-1.188c-0.426-0.298-1.008-0.476-1.387-0.829c-0.01-0.086,0.123-0.296,0.041-0.516c-0.335-0.896-1.589-1.933-2.374-2.412c-0.363-0.225-0.972-0.328-1.305-0.555c-0.246-0.017-0.374-0.025-0.435,0.155c-0.097,0.218,0.209,0.521,0.315,0.675c0.271,0.381,0.581,0.826,0.95,1.104c0.276,0.209,0.591,0.392,0.83,0.635h0.119c-0.154-0.426-0.609-0.657-0.949-0.909c-0.311-0.229-0.449-0.632-0.712-0.909c0.021-0.125,0.035-0.115,0.08-0.199c1.093,0.009,1.802,1.012,2.294,1.662c0.22,0.291,0.571,0.461,0.594,0.951c-0.116,0-0.216,0-0.276-0.041h-0.119c0.188,0.522,0.824,0.479,1.267,0.754c0.888,0.549,1.603,1.409,2.373,2.094c0.262,0.234,0.719,0.466,0.791,0.873c-0.537-0.028-0.917-0.327-1.261-0.555c-0.614-0.4-1.597-1.1-2.019-1.662c-0.08-0.104-0.106-0.263-0.199-0.355c-0.109-0.111-0.261-0.145-0.355-0.275h-0.158c-0.039,0.41,0.407,0.705,0.671,0.948c0.819,0.75,1.696,1.442,2.73,1.979c0.373,0.191,1.053,0.521,1.465,0.275C23.874,83.434,23.227,82.975,22.857,82.695L22.857,82.695z M47.226,85.307c-2.014-1.379-4.985-2.775-8.427-2.689c-0.167,0.104-0.503,0.021-0.711,0.078c-0.288,0.076-0.464,0.223-0.672,0.355c-0.008,0.971,1.446,1.496,2.255,1.698c0.483,0.123,0.909-0.104,1.188-0.198c0.215-0.82-0.776-0.94-1.227-1.347h-0.081v-0.038c3.036-0.119,5.308,0.729,7.043,2.02c0.433,0.322,0.93,0.783,1.148,1.306c0.081,0.194,0.116,0.515,0,0.674c-0.159,0.44-0.685,0.401-1.188,0.515c-1.162,0.267-2.755-0.391-3.285-0.91c-0.108,0.189,0.049,0.48-0.118,0.674c-0.176,0.478-0.788,0.354-1.346,0.474c-0.917,0.199-2.353-0.271-2.888-0.632c-0.149-0.104-0.257-0.286-0.396-0.396c-0.007-0.103-0.018-0.136-0.041-0.199c0.081-0.073,0.177-0.187,0.237-0.275c1.139-0.085,1.718-0.027,2.376,0.596c-0.017,0.078-0.01,0.073-0.041,0.114c-0.074,0.152-0.245,0.17-0.474,0.161v0.074c0.417,0.004,0.593-0.059,0.83-0.197c0.013-0.079,0.027-0.159,0.04-0.236c-0.136-0.141-0.231-0.328-0.396-0.438c-0.65-0.426-1.991-0.641-2.729-0.156c-0.116,0.561,0.232,0.864,0.554,1.105c0.646,0.488,1.191,0.771,2.098,1.029c0.291,0.082,0.55,0.008,0.871,0.076c0.28,0.064,0.765,0.079,1.068,0c0.504-0.128,1.205-0.658,0.632-1.268v-0.037c0.299,0.109,0.544,0.402,0.831,0.556c0.761,0.397,2.021,0.726,3.167,0.476c0.562-0.125,1.143-0.125,1.303-0.635c0.179-0.277-0.068-0.668-0.156-0.826C48.322,86.151,47.836,85.721,47.226,85.307L47.226,85.307z M39.906,83.485c0.14,0.094,0.22,0.291,0.356,0.396c-0.003,0.1-0.004,0.148-0.04,0.199c-0.257,0.697-1.706,0.182-2.058-0.081c-0.11-0.08-0.153-0.248-0.236-0.354c0.015-0.082,0.01-0.076,0.041-0.116c0.108-0.306,0.417-0.203,0.671-0.354C39.142,83.174,39.596,83.274,39.906,83.485z M76.625,83.881h-0.396c-0.262,0.209-0.692,0.236-0.991,0.396c-0.263,0.141-0.581,0.332-0.829,0.515c-0.207,0.148-0.326,0.418-0.516,0.592c0.004,0.197,0.008,0.229,0.16,0.277c0.039,0.029,0.01,0.018,0.075,0.04c0.042-0.047,0.08-0.063,0.12-0.12c0.033-0.023-0.027-0.104-0.04-0.232c0.384-0.386,0.667-0.598,1.228-0.832c0.144-0.059,0.447-0.233,0.634-0.119h0.079c-0.026,0.391-0.916,1.591-1.188,1.781v0.115c0.729-0.188,1.215-1.643,1.702-2.174c-0.013-0.09-0.01-0.111-0.04-0.157L76.625,83.881L76.625,83.881z M73.459,86.809c-0.234,0.209-0.807,0.229-1.066,0.435h-0.041c0.104-0.149,0.291-0.213,0.396-0.354c0.076-0.104,0.107-0.226,0.197-0.315c-0.018-0.081-0.01-0.075-0.039-0.117v-0.08c-1.155-0.212-3.084,0.784-3.68,1.308c-0.155,0.135-0.248,0.336-0.396,0.477c0.003,0.111,0.016,0.168,0.039,0.236c0.701,0.047,2.016-0.383,2.174-0.949c0.031-0.025,0.012-0.002,0-0.04v-0.079c-0.479-0.027-1.124,0.075-1.422,0.355h-0.039c0.26-0.396,1.223-0.746,1.739-0.91c0.172-0.053,0.55-0.149,0.714-0.039c0.037,0.015,0.077,0.025,0.117,0.039c-0.094,0.396-0.657,0.838-1.029,0.949v0.08c0.607-0.141,1.163-0.416,1.7-0.634c0.368-0.149,0.786-0.188,1.108-0.396c0.229-0.149,1.008-1.207,1.068-1.504C74.086,85.409,74.012,86.313,73.459,86.809L73.459,86.809z M70.333,87.6v0.119c-0.075,0.049-0.129,0.156-0.198,0.196c-0.205,0.12-0.479,0.106-0.674,0.238c-0.09-0.011-0.109-0.009-0.156-0.041h-0.039C69.373,87.775,70.025,87.621,70.333,87.6L70.333,87.6z M53.835,91.317c0.015-0.037,0.025-0.078,0.039-0.117c-0.976-0.04-1.953-0.079-2.927-0.119c-0.123,0.082-0.312,0.035-0.475,0.079c-0.202,0.059-0.426,0.15-0.593,0.239c0.026,0.067,0.008,0.038,0.04,0.077c0.238,0.188,1.624,0.199,1.9,0h0.078v-0.077c-0.419-0.134-1.183,0.2-1.503,0h-0.041v-0.041c1.052-0.073,2.23-0.044,3.325-0.04c-0.105,0.072-0.328,0.051-0.436,0.119c-0.039,0.014-0.078,0.027-0.117,0.039v0.08c0.238,0.037,0.475,0.078,0.711,0.117c0.037,0.041-0.004,0.004,0.039,0.037c-0.35,0.233-1.254,0.139-1.581-0.037v-0.08c-0.178-0.082-0.991,0.084-1.148,0.117c-0.133,0.03-0.27-0.014-0.357,0.039c-0.165,0.01-0.181,0.029-0.276,0.079c0.022,0.128,0.035,0.115,0.08,0.198c0.255,0.06,0.696,0.064,0.987,0.156v-0.039h0.04v-0.039c-0.148-0.057-0.559-0.025-0.713-0.115h-0.079c0.132-0.104,1.425-0.278,1.663-0.119c0.067,0.023,0.039,0.007,0.079,0.039c-0.211,0.038-0.424,0.08-0.634,0.117c0.025,0.066,0.009,0.039,0.04,0.078c0.065,0.045,0.193,0.045,0.316,0.039c-0.04,0.074-0.054,0.109-0.119,0.158c0.013,0.023,0.027,0.051,0.04,0.078c0.561,0,1.031-0.057,1.502-0.156c0.28-0.062,0.624,0.052,0.831-0.08h0.317v-0.078c-0.539-0.002-1.885-0.055-2.215,0.158h-0.117c0.033-0.043-0.004-0.004,0.038-0.041c0.155-0.18,0.471-0.09,0.75-0.156c0.44-0.104,1.168-0.284,1.544,0c0.105,0.064,0.04-0.008,0.039,0.117c0.107-0.002,0.181-0.002,0.236-0.036h0.277v-0.081c-0.359-0.088-0.889-0.251-1.188-0.434C54.057,91.488,54.135,91.344,53.835,91.317L53.835,91.317z M13.635,18.359c-0.088,0.32-0.274,0.593-0.395,0.87c-0.268,0.613-0.507,1.225-0.751,1.822c-0.207,0.496-0.335,1.295-0.633,1.699v0.079c0.416-0.074,0.698-0.493,0.949-0.751c0.617-0.634,1.92-2.22,1.9-3.402c-0.062-0.061-0.119-0.162-0.159-0.237C14.3,18.38,13.982,18.353,13.635,18.359z M13.794,20.022c-0.181,0.298-0.281,0.592-0.476,0.871c-0.178,0.255-0.46,0.452-0.633,0.713h-0.041c0.051-0.302,0.214-0.546,0.319-0.792c0.235-0.561,0.396-1.118,0.671-1.621c0.152,0.003,0.268,0.015,0.356,0.078c0.095,0.052,0.028-0.018,0.079,0.08C14.15,19.548,13.89,19.862,13.794,20.022L13.794,20.022z M84.023,7.875c-0.414-0.416-0.729-0.938-1.147-1.346V6.49c-0.205,0.073-0.899,0.688-1.028,0.871c-0.25-0.095-0.391-0.365-0.594-0.514c-0.676-0.508-1.313-1.167-2.49-1.147c-0.148,0.115-0.367,0.118-0.556,0.197c-0.53,0.23-1.083,0.688-1.305,1.227c-0.249,0.602,0.004,1.491,0.196,1.939c0.392,0.904,1.03,1.667,1.582,2.414c0.457,0.615,0.973,1.252,1.819,1.464c0.956,0.238,1.422-0.884,1.781-1.308c0.37-0.435,1.182-0.539,1.464-1.107c0.104-0.207,0.034-0.615-0.039-0.791c-0.18-0.426-1.066-1.622-1.425-1.859c0.024-0.239,0.135-0.247,0.235-0.396c0.248,0.121,0.338,0.471,0.516,0.673c0.227,0.258,0.546,0.396,0.791,0.632c0.378,0.003,0.604-0.094,0.79-0.277h0.041C84.561,8.243,84.212,8.06,84.023,7.875L84.023,7.875z M81.77,12.148c-0.699,0.165-1.047-0.293-1.424-0.673c-0.938-0.935-1.57-2.093-2.298-3.244c-0.247-0.396-0.885-1.134-0.554-1.702h0.156c0.199,0.299,0.539,0.507,0.754,0.792c0.591,0.784,1.313,1.469,1.898,2.255c0.359,0.485,0.758,0.94,1.106,1.424c0.178,0.249,0.315,0.565,0.556,0.751C81.924,11.931,81.848,12.015,81.77,12.148L81.77,12.148z M82.361,9.339c0.32,0.439,0.755,0.688,0.751,1.463c-0.122,0.116-0.157,0.224-0.356,0.276c-0.039,0.032-0.011,0.015-0.078,0.041c-0.56-0.932-1.367-1.711-2.017-2.573c-0.212-0.282-0.541-0.511-0.752-0.791c-0.362-0.48-0.793-0.864-1.188-1.305c-0.113-0.131-0.168-0.257-0.313-0.357c0.033-0.086,0.031-0.057,0.076-0.118c0.672,0.006,0.994,0.458,1.386,0.753C80.837,7.453,81.648,8.354,82.361,9.339L82.361,9.339z"/><radialGradient id="SVGID_43_" cx="251.8086" cy="-408.3613" r="72.7509" gradientTransform="matrix(1 0 0 -1 -213.7637 -386.502)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#000" stop-opacity="0"/><stop offset=".8022" stop-color="#000" stop-opacity=".08"/><stop offset="1" stop-color="#000" stop-opacity=".3882"/></radialGradient><path style="&st15;" d="M49.885,17.037c0.014-0.606-0.392-1.27-0.392-1.27l-0.025-0.058c0,0-0.487-0.949-1.302-1.228c-0.815-0.278-1.478,0.342-1.478,0.342s-0.114,0.131-0.429,0.494c-0.313,0.364-0.507,0.666-1.198,0.938c-0.692,0.271-1.379,0.204-1.743,0.033c-0.364-0.172-0.457-0.537-0.457-0.537s-0.229-0.722-0.313-1.049c-0.086-0.331-0.309-1.694-0.309-1.694s-0.491-2.747-0.534-3.304c0,0,1.475-0.126,3.687-0.775c2.299-0.673,3.043-1.206,3.043-1.206s-0.432-0.156-0.484-0.662c-0.051-0.507-0.089-1.19-0.089-1.19s-0.089-0.5,0.483-1.139c0.571-0.64,1.354-0.863,1.762-0.953c0.41-0.089,1.281-0.17,2.093-0.134c0.812,0.038,1.267,0.112,1.593,0.291c0.328,0.178,0.357,0.61,0.357,0.61l-0.008,1.146c0,0-0.037,0.402,0.261,0.529c0,0,0.505,0.305,2.196,0.133c0,0,0.72-0.126,1.846-0.46c1.125-0.335,4.129-1.229,4.554-1.341c0.425-0.111,0.953-0.291,1.646-0.469c0.691-0.179,2.039-0.626,2.308-0.73c0.271-0.104,1.812-0.618,2.927-0.81c1.115-0.195,2.227-0.186,2.813,0.149c0,0,0.357,0.304,0.521,0.662c0.163,0.358,0.478,0.863,0.923,1.088c0.454,0.227,0.752,0.371,1.875,0.273c0,0,0.022-0.096-0.395-0.37c-0.417-0.277-0.991-0.701-0.991-0.701S74.29,3.4,74.215,3.198c-0.072-0.202-0.043-0.306-0.043-0.306l0.877-1.406c0,0,0-0.172,0.508-0.238c0.506-0.067,1.071-0.134,1.74-0.313c0.67-0.178,0.788-0.312,0.788-0.312l0.58,0.178c0,0,3.546,2.853,4.655,3.583l0.199-0.239c0,0,0.436,0.018,0.826,0.172c0.394,0.154,0.979,0.562,0.979,0.562s1.612,1.31,2.071,2.2l0.223,0.679l-0.102,0.161c0,0,0.918,1.307,2.096,2.602c0,0,1.227,1.664,1.689,2.09c0,0-0.108-0.399-0.201-0.849l0.336-0.226l0.203-0.144l0.617,0.259c3.573,4.811,6.432,10.424,8.141,16.328l-0.12,0.484l0.395,0.501c1.128,4.212,1.728,8.643,1.728,13.211c0,1.122-0.036,2.236-0.107,3.339l-0.304,0.511l0.225,0.555c-2.231,26.1-24.124,46.584-50.801,46.584c-18.502,0-34.702-9.854-43.637-24.6L7.674,68.2l-0.205-0.153c-3.387-5.742-5.682-12.205-6.595-19.103l0.212-0.525L0.75,47.936c-0.213-1.892-0.322-3.812-0.322-5.756c0-2.985,0.255-5.909,0.748-8.755l0.25-0.562l-0.087-0.328c1.157-6.048,3.383-11.716,6.474-16.799l0.684-0.384l0.081,0.032c0,0,0.233-0.169,0.354-0.217l0.076-0.023c0,0,1.179-1.971,1.625-2.601c0,0,0.542-0.348,0.745-0.407c0,0,0.124-0.016,0.189,0.076c0,0,0.496-0.432,1.699-2.054c0.004-0.005,0.007-0.011,0.012-0.017c0,0-0.114-0.076-0.131-0.174c-0.018-0.097,0.108-0.591,0.173-0.717c0.065-0.126,0.108-0.156,0.108-0.156s1.722-2.032,3.151-3.238c0,0,0.26-0.202,0.678-0.25c0,0,1.472-0.613,3.264-2.184c0,0,0.051-0.289,0.478-0.858c0.428-0.57,1.456-1.163,2.222-1.337c0.764-0.174,0.896-0.038,0.896-0.038l0.064,0.065l0.515,0.766c0,0,0.565-0.316,1.413-0.604c0.847-0.289,0.979-0.262,0.979-0.262l0.825,1.336l-0.987,2c0,0-0.644,1.421-1.655,2.185c0,0-0.472,0.284-1.12,0.127c-0.648-0.157-1.072,0.333-1.072,0.333l-0.17,0.14c0,0,0.14-0.024,0.346-0.103c0,0,0.158,0.065,0.274,0.223c0.114,0.158,0.913,1.175,0.913,1.175s0.005,0.837-0.415,1.938c-0.419,1.1-1.467,2.891-1.467,2.891s-0.733,1.424-1.075,2.253c-0.342,0.829-0.515,1.765-0.488,2.262c0,0,0.187,0.062,0.707-0.202c0.655-0.332,1.083,0.027,1.083,0.027s0.719,0.53,1.041,0.881c0.262,0.289,0.802,1.765,0.209,3.224c0,0-0.402,1.008-1.377,1.724c0,0-0.216,0.332-1.529,0.174c-0.368-0.043-0.585-0.276-1.372-0.2c-0.785,0.077-1.231,0.815-1.231,0.815l0.013-0.024c-0.692,0.999-1.154,2.458-1.154,2.458l-0.057,0.165c0,0-0.241,0.509-0.292,1.752c-0.053,1.284,0.284,3.109,0.284,3.109s7.876-1.387,9.88-0.055l0.58,0.532c0,0,0.046,0.174-0.031,0.376c-0.08,0.204-0.375,0.673-0.987,1.113c-0.611,0.438-1.222,1.583-0.313,2.304c1.034,0.818,1.691,0.766,3.43,0.468c1.74-0.297,2.898-1.269,2.898-1.269s0.972-0.72,0.783-1.628c-0.188-0.908-1.017-1.189-1.017-1.189s-0.658-0.423-0.141-1.238c0,0,0.141-0.689,2.553-1.316c2.414-0.626,6.812-1.52,10.556-1.989c0,0-2.539-8.223-0.737-9.289c0,0,0.438-0.296,1.224-0.408l0.721-0.037c0.131-0.027,0.344,0.005,0.796,0.045c0.452,0.038,1.001,0.076,1.678-0.441c0.676-0.519,0.697-0.819,0.697-0.819"/></svg> \ No newline at end of file diff --git a/modules/home.legacy/conf/firefox/default.nix b/modules/home.legacy/conf/firefox/default.nix deleted file mode 100644 index 663c4978..00000000 --- a/modules/home.legacy/conf/firefox/default.nix +++ /dev/null @@ -1,133 +0,0 @@ -{ - config, - pkgs, - lib, - user_js, - ... -}: let - extensions = - builtins.fromJSON (builtins.readFile ./config/extensions/extensions.json); - - userChrome = builtins.readFile ./config/chrome/userChrome.css; - bookmarks = (import ./config/bookmarks/default.nix) { - inherit - pkgs - lib - ; - }; - engines = (import ./config/search/engines) {inherit pkgs;}; - - native_messaging_hosts = (import ./config/extensions/native_messaging_hosts/default.nix) {inherit pkgs;}; - - policies = (import ./config/policies) {inherit config extensions;}; - - search = { - default = "Brave Search"; - privateDefault = "Brave Search"; - force = true; - order = [ - # DEFAULT - "Brave Search" - - # NIX - "Nix Packages" - "Nix Options" - "Nixpkgs issues" - "Homemanager Options" - "NixOS Wiki" - "Nixpkgs Pull Request Tracker" - - # RUST - "Rust std" - "Rust tokio" - - # OTHER - "Google Scholar" - "Wikipedia" - "Arch Wiki" - ]; - - inherit engines; - }; - - prefConfig = builtins.readFile "${ - (import ./config/prefs) {inherit pkgs lib config bookmarks user_js;} - }/user.js"; - - # Package {{{ - package = import ./package.nix { - inherit config lib pkgs; - extraPolicies = policies; - extraNativeMessagingHosts = native_messaging_hosts; - }; - # }}} - - # Profiles {{{ - profiles = { - "default" = { - inherit search userChrome; - isDefault = true; - id = 0; - name = "default"; - extraConfig = prefConfig; - }; - }; - - taskwarriorProfiles = import ../taskwarrior/firefox { - inherit - config - lib - # options - prefConfig - search - userChrome - ; - profile_size = builtins.length (builtins.attrNames profiles); - }; - # }}} -in { - options.soispha.firefox = { - package = lib.mkOption { - type = lib.types.package; - default = pkgs.firefox; - description = "Firefox package to use."; - defaultText = lib.literalExpression "pkgs.firefox"; - relatedPackages = [ - "firefox" - "firefox-beta-bin" - "firefox-bin" - "firefox-devedition-bin" - "firefox-esr" - ]; - }; - package_version = lib.mkOption { - type = lib.types.str; - default = pkgs.firefox.version; - description = "Firefox version to use"; - }; - }; - - config = { - soispha.firefox.package = package; - soispha.firefox.package_version = pkgs.firefox.version; - home.sessionVariables = { - # improve touch input & make scrolling smother - MOZ_USE_XINPUT2 = "1"; - - # improve wayland support - MOZ_ENABLE_WAYLAND = 1; - - # tell gtk to use portals - GTK_USE_PORTAL = 1; - - BROWSER = "firefox"; - }; - programs.firefox = { - enable = true; - inherit (config.soispha.firefox) package; - profiles = - profiles - // taskwarriorProfiles; - }; - }; -} diff --git a/modules/home.legacy/conf/firefox/package.nix b/modules/home.legacy/conf/firefox/package.nix deleted file mode 100644 index f7e4319b..00000000 --- a/modules/home.legacy/conf/firefox/package.nix +++ /dev/null @@ -1,30 +0,0 @@ -# taken from the NixOS Firefox module: https://github.com/NixOS/nixpkgs/blob/7c9cc5a6e5d38010801741ac830a3f8fd667a7a0/nixos/modules/programs/firefox.nix -{ - config, - lib, - pkgs, - # options - autoConfig ? "", - extraNativeMessagingHosts ? [], - wrapperConfig ? {}, - extraPolicies ? {}, - base_package ? pkgs.firefox, -}: let - pkg = base_package.override (old: { - extraPrefsFiles = - (old.extraPrefsFiles or []) - ++ [ - (pkgs.writeText "autoConfig.js" autoConfig) - ]; - nativeMessagingHosts = old.nativeMessagingHosts or [] ++ extraNativeMessagingHosts; - cfg = (old.cfg or {}) // wrapperConfig; - extraPoliciesFiles = - (old.extraPoliciesFiles or []) - ++ [ - ( - pkgs.writeText "policies.json" (builtins.toJSON extraPolicies) - ) - ]; - }); -in - pkg diff --git a/modules/home.legacy/conf/firefox/scripts/default.nix b/modules/home.legacy/conf/firefox/scripts/default.nix deleted file mode 100644 index 1127662b..00000000 --- a/modules/home.legacy/conf/firefox/scripts/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - pkgs, - sysLib, - ... -}: let - unzip_mozlz4 = pkgs.stdenv.mkDerivation { - name = "unzip_mozlz4"; - propagatedBuildInputs = [ - (pkgs.python3.withPackages (pythonPackages: - with pythonPackages; [ - lz4 - ])) - ]; - dontUnpack = true; - installPhase = "install -Dm755 ${./unzip_mozlz4.py} $out/bin/unzip_mozlz4"; - }; - extract_cookies = sysLib.writeShellScript { - name = "extract_cookies"; - src = ./extract_cookies.sh; - dependencies = with pkgs; [ - bash - sqlite - mktemp - coreutils - ]; - }; -in { - inherit unzip_mozlz4 extract_cookies; -} diff --git a/modules/home.legacy/conf/firefox/scripts/extract_cookies.sh b/modules/home.legacy/conf/firefox/scripts/extract_cookies.sh deleted file mode 100755 index e3d50d43..00000000 --- a/modules/home.legacy/conf/firefox/scripts/extract_cookies.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bash -# copied from https://superuser.com/a/1239036 -# extract_cookies.sh: -# -# Convert from Firefox's cookies.sqlite format to Netscape cookies, -# which can then be used by wget and curl. (Why don't wget and curl -# just use libsqlite if it's installed? Mysteries abound.) -# -# Note: This script reads directly from the standard cookie jar file, -# which means cookies which are kept only in memory ("session cookies") -# will not be extracted. You will need an extension to do that. - -# USAGE: -# -# $ extract_cookies.sh > /tmp/cookies.txt -# or -# $ extract_cookies.sh ~/.mozilla/firefox/*default*/cookies.sqlite > /tmp/cookies.txt - -# USING WITH WGET: -# $ wget --load-cookies=/tmp/cookies.txt http://example.com - -# USING WITH CURL: -# $ curl --cookie /tmp/cookies.txt http://example.com - -# Note: If you do not specify an SQLite filename, this script will -# intelligently find it for you. -# -# A) Usually it will check all profiles under ~/.mozilla/firefox/ and -# use the cookies.sqlite that was updated most recently. -# -# B) If you've redirected stdin (with < or |) , then that will be used. - -# HISTORY: I believe this is circa 2010 from: -# http://slacy.com/blog/2010/02/using-cookies-sqlite-in-wget-or-curl/ -# However, that site is down now. - -# Cleaned up by Hackerb9 (2017) to be more robust and require less typing. - -cleanup() { - rm -f "$TMPFILE" - exit 0 -} -trap cleanup EXIT INT QUIT TERM - -if [ "$#" -ge 1 ]; then - SQLFILE="$1" -else - SQLFILE="$HOME/.mozilla/firefox/default/cookies.sqlite" -fi - -if ! [ -r "$SQLFILE" ]; then - echo "Error. File $SQLFILE is not readable." >&2 - exit 1 -fi - -# We have to copy cookies.sqlite, because FireFox has a lock on it -TMPFILE=$(mktemp /tmp/cookies.sqlite.XXXXXXXXXX) -cat "$SQLFILE" >>"$TMPFILE" - -# This is the format of the sqlite database: -# CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER); - -echo "# Netscape HTTP Cookie File" -sqlite3 -separator $'\t' "$TMPFILE" <<EOF -.mode tabs -.header off -select host, -case substr(host,1,1)='.' when 0 then 'FALSE' else 'TRUE' end, -path, -case isSecure when 0 then 'FALSE' else 'TRUE' end, -expiry, -name, -value -from moz_cookies; -EOF - -cleanup diff --git a/modules/home.legacy/conf/firefox/scripts/unzip_mozlz4.py b/modules/home.legacy/conf/firefox/scripts/unzip_mozlz4.py deleted file mode 100755 index 71e4e6bc..00000000 --- a/modules/home.legacy/conf/firefox/scripts/unzip_mozlz4.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# source: https://unix.stackexchange.com/a/497861 -# Command-line tool to decompress mozLz4 files used for example by Firefox to store various kinds of session backup information. -# Works in both Python 2.7.15 and 3.6.7, as of version 2.1.6 of the LZ4 Python bindings at pypi.org/project/lz4. -# To use in another script, simply cut and paste the import statement and the mozlz4_to_text() function (lines 8 to 17). - -import lz4.block # pip install lz4 --user - - -def mozlz4_to_text(filepath): - # Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file, - # return the uncompressed text. - bytestream = open(filepath, "rb") - bytestream.read(8) # skip past the b"mozLz40\0" header - valid_bytes = bytestream.read() - text = lz4.block.decompress(valid_bytes) - return text - - -def main(args): - # Given command-line arguments of an input filepath for a ".mozlz4" file - # and optionally an output filepath, write the decompressed text to the - # output filepath. - # Default output filepath is the input filepath minus the last three characters - # (e.g. "foo.jsonlz4" becomes "foo.json") - filepath_in = args[0] - if len(args) < 2: - filepath_out = filepath_in[:-3] - else: - filepath_out = args[1] - text = mozlz4_to_text(filepath_in) - with open(filepath_out, "wb") as outfile: - outfile.write(text) - if filepath_out != "/dev/stdout": - print("Wrote decompressed text to {}".format(filepath_out)) - - -if __name__ == "__main__": - import sys - - args = sys.argv[1:] - if args and args[0] not in ("--help", "-h"): - main(args) - else: - print("Usage: mozlz4.py <mozlz4 file to read> <location to write>") diff --git a/modules/home.legacy/conf/firefox/scripts/update_extensions.sh b/modules/home.legacy/conf/firefox/scripts/update_extensions.sh deleted file mode 100755 index 86bd843c..00000000 --- a/modules/home.legacy/conf/firefox/scripts/update_extensions.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -tmp=$(mktemp) -cat <<EOF | awk '!/^\s*#/' >"$tmp" - darkreader:navbar - keepassxc-browser:navbar - vhack-libredirect:navbar - torproject-snowflake:navbar - tridactyl-vim:menupanel - ublock-origin:menupanel -EOF - -# The bin is provided in the devshell; -# The cat execution should be unquoted; -# shellcheck disable=SC2046 -generate_extensions $(cat "$tmp") >"$(dirname "$0")"/../config/extensions/extensions.json - -rm "$tmp" diff --git a/modules/home.legacy/conf/gammastep/default.nix b/modules/home.legacy/conf/gammastep/default.nix index 1ae0550b..b4d8bf84 100644 --- a/modules/home.legacy/conf/gammastep/default.nix +++ b/modules/home.legacy/conf/gammastep/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, nixosConfig, diff --git a/modules/home.legacy/conf/gpg/default.nix b/modules/home.legacy/conf/gpg/default.nix deleted file mode 100644 index 1acdf628..00000000 --- a/modules/home.legacy/conf/gpg/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - programs.gpg = { - enable = true; - homedir = "${config.xdg.dataHome}/gnupg"; - mutableKeys = true; - mutableTrust = true; - - settings = { - default-key = "Benedikt Peetz <benedikt.peetz@b-peetz.de>"; - # TODO: add more - }; - - publicKeys = [ - { - source = ./keys/key_1.asc; - trust = "ultimate"; - } - { - source = ./keys/key_2.asc; - trust = "full"; - } - ]; - }; - services = { - gpg-agent = { - enable = true; - enableZshIntegration = true; - enableScDaemon = true; # smartcards and such things - - # Cache the key passwords - defaultCacheTtl = 60 * 50; - defaultCacheTtlSsh = 60 * 50; - maxCacheTtl = 60 * 50; - maxCacheTtlSsh = 60 * 50; - - pinentryPackage = pkgs.pinentry-curses; - # pinentryPackage = pkgs.pinentry-tty; - - enableSshSupport = true; - sshKeys = let - removeSpace = str: builtins.replaceStrings [" "] [""] str; - in [ - (removeSpace "8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26") - ]; - }; - }; - - programs.zsh.initExtraFirst = lib.mkBefore '' - export GPG_TTY=$(tty) - - # Magic copied from the gpg-agent manual - unset SSH_AGENT_PID - if [ "''${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - fi - - - # Ensure that get gpg agent is started (necessary because ssh does not start it - # automatically and has it's tty updated) - gpg-connect-agent /bye - ''; -} diff --git a/modules/home.legacy/conf/gtk/default.nix b/modules/home.legacy/conf/gtk/default.nix index f5411369..68bef531 100644 --- a/modules/home.legacy/conf/gtk/default.nix +++ b/modules/home.legacy/conf/gtk/default.nix @@ -1,8 +1,15 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, - lib, pkgs, - stdenv, ... }: { gtk = { diff --git a/modules/home.legacy/conf/himalaya/default.nix b/modules/home.legacy/conf/himalaya/default.nix index c072693e..22fbe306 100644 --- a/modules/home.legacy/conf/himalaya/default.nix +++ b/modules/home.legacy/conf/himalaya/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { programs.himalaya = { enable = true; diff --git a/modules/home.legacy/conf/hyfetch/default.nix b/modules/home.legacy/conf/hyfetch/default.nix index aec21dbc..bac0731e 100644 --- a/modules/home.legacy/conf/hyfetch/default.nix +++ b/modules/home.legacy/conf/hyfetch/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { programs.hyfetch = { enable = true; diff --git a/modules/home.legacy/conf/iamb/config.json.license b/modules/home.legacy/conf/iamb/config.json.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/home.legacy/conf/iamb/config.json.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/iamb/default.nix b/modules/home.legacy/conf/iamb/default.nix index 2a93472c..764e2efc 100644 --- a/modules/home.legacy/conf/iamb/default.nix +++ b/modules/home.legacy/conf/iamb/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { xdg.configFile."iamb/config.json".source = ./config.json; } diff --git a/modules/home.legacy/conf/keepassxc/default.nix b/modules/home.legacy/conf/keepassxc/default.nix index 3ac82812..40f61ba0 100644 --- a/modules/home.legacy/conf/keepassxc/default.nix +++ b/modules/home.legacy/conf/keepassxc/default.nix @@ -1,7 +1,12 @@ -{ - config, - pkgs, - ... -}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { xdg.configFile."keepassxc/keepassxc.ini".source = ./keepassxc.ini; } diff --git a/modules/home.legacy/conf/keepassxc/keepassxc.ini b/modules/home.legacy/conf/keepassxc/keepassxc.ini index 288a194b..326f1d99 100644 --- a/modules/home.legacy/conf/keepassxc/keepassxc.ini +++ b/modules/home.legacy/conf/keepassxc/keepassxc.ini @@ -1,3 +1,13 @@ +; nixos-config - My current NixOS configuration +; +; Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +; SPDX-License-Identifier: GPL-3.0-or-later +; +; This file is part of my nixos-config. +; +; You should have received a copy of the License along with this program. +; If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [General] AutoSaveAfterEveryChange=true BackupBeforeSave=true diff --git a/modules/home.legacy/conf/latexindent/default.nix b/modules/home.legacy/conf/latexindent/default.nix index 0d776e14..aeedd411 100644 --- a/modules/home.legacy/conf/latexindent/default.nix +++ b/modules/home.legacy/conf/latexindent/default.nix @@ -1,8 +1,13 @@ -{ - config, - pkgs, - ... -}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { xdg.configFile."latexindent/indentconfig.yaml".source = ./indentconfig.yaml; xdg.configFile."latexindent/mysettings.yaml".source = ./mysettings.yaml; } diff --git a/modules/home.legacy/conf/latexindent/indentconfig.yaml b/modules/home.legacy/conf/latexindent/indentconfig.yaml index d67351f3..6465a17a 100644 --- a/modules/home.legacy/conf/latexindent/indentconfig.yaml +++ b/modules/home.legacy/conf/latexindent/indentconfig.yaml @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + paths: - /home/dt/.config/latexindent/mysettings.yaml diff --git a/modules/home.legacy/conf/latexindent/mysettings.yaml b/modules/home.legacy/conf/latexindent/mysettings.yaml index 9a0f8b2f..122821da 100644 --- a/modules/home.legacy/conf/latexindent/mysettings.yaml +++ b/modules/home.legacy/conf/latexindent/mysettings.yaml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # defaultSettings.yaml for latexindent.pl, version 3.19.1, 2022-12-04 # a script that aims to # beautify .tex, .sty, .cls files diff --git a/modules/home.legacy/conf/mail/accounts/benedikt.nix b/modules/home.legacy/conf/mail/accounts/benedikt.nix index 2fe72fca..e75cb523 100644 --- a/modules/home.legacy/conf/mail/accounts/benedikt.nix +++ b/modules/home.legacy/conf/mail/accounts/benedikt.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs}: { address = "benedikt.peetz@b-peetz.de"; userName = "benedikt.peetz@b-peetz.de"; diff --git a/modules/home.legacy/conf/mail/accounts/soispha.nix b/modules/home.legacy/conf/mail/accounts/soispha.nix index 6e3e6228..6bcb0da6 100644 --- a/modules/home.legacy/conf/mail/accounts/soispha.nix +++ b/modules/home.legacy/conf/mail/accounts/soispha.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs}: { address = "soispha@vhack.eu"; userName = "soispha@vhack.eu"; diff --git a/modules/home.legacy/conf/mail/default.nix b/modules/home.legacy/conf/mail/default.nix index 0ecbe40a..17957c82 100644 --- a/modules/home.legacy/conf/mail/default.nix +++ b/modules/home.legacy/conf/mail/default.nix @@ -1,15 +1,62 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, + lib, ... }: let benedikt = import ./accounts/benedikt.nix {inherit pkgs;}; soispha = import ./accounts/soispha.nix {inherit pkgs;}; accounts = {inherit soispha benedikt;}; + + mkHelper = { + userName, + passwordCommand, + ... + }: + builtins.toString (pkgs.writeShellScript "git-credential-keepassxc-libsecret" + # bash + '' + [ "$1" = "get" ] || { + exit 1 + } + output="$(cat)" + if echo "$output" | grep "username=${userName}" -q; then + if password="$(${passwordCommand})"; then + printf "%s\npassword=%s\n\n" "$output" "$password" + else + # The password command failed (for whatever reason) + exit 1 + fi + else + # Not our business. + exit 1 + fi + ''); + accountCredentials = + # TODO: This will result in only one of them being defined, as we duplicate the + # attribute key <2025-02-03> + lib.mapAttrs' (_: value: { + name = "credential.smtp://${value.smtp.host}:${builtins.toString value.smtp.port}"; + value = { + "helper" = mkHelper value; + }; + }) + accounts; in { accounts.email = { maildirBasePath = "${config.xdg.dataHome}/maildir"; inherit accounts; }; + + programs.git.extraConfig = accountCredentials; } diff --git a/modules/home.legacy/conf/mako/default.nix b/modules/home.legacy/conf/mako/default.nix deleted file mode 100644 index 711457f2..00000000 --- a/modules/home.legacy/conf/mako/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services.mako = { - enable = true; - backgroundColor = "#2e3440"; - borderColor = "#88c0d0"; - borderRadius = 25; - borderSize = 2; - defaultTimeout = 5000; - font = "Source Code Pro 10"; - width = 500; - height = 500; - icons = true; - ignoreTimeout = true; - layer = "overlay"; - markup = true; # TODO: - maxIconSize = 64; - sort = "-time"; - extraConfig = '' - [urgency=low] - border-color=#cccccc - - [urgency=normal] - border-color=#d08770 - - [urgency=high] - border-size=3 - border-color=#bf616a - default-timeout=0 - - [urgency=critical] - border-size=4 - border-color=#bf616a - default-timeout=0 - - [category=mpd] - default-timeout=2000 - group-by=category - ''; - }; -} diff --git a/modules/home.legacy/conf/mbsync/default.nix b/modules/home.legacy/conf/mbsync/default.nix index ac9808c9..058d576c 100644 --- a/modules/home.legacy/conf/mbsync/default.nix +++ b/modules/home.legacy/conf/mbsync/default.nix @@ -1,17 +1,25 @@ -{ - config, - lib, - ... -}: { - # TODO: I have no clue if both are needed, but it looks neat, right? +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{lib, ...}: { + # This configures the program in itself (i.e., sets-up a config file, etc.) programs.mbsync = { enable = true; }; + + # This starts a systemd service to periodically sync mail services.mbsync = { enable = true; - # TODO: enable after isync 1.5 drops - #configFile = "${config.xdg.configHome}/mbsync/mbsync.conf"; }; - # Disable the timer, and only activate it on neomutt start + + # Disable the timer, and only activate the service when neomutt starts + # Otherwise, the password command would prompt me to unlock the keepassxc database every + # time. systemd.user.timers.mbsync = lib.mkForce {}; } diff --git a/modules/home.legacy/conf/mpv/default.nix b/modules/home.legacy/conf/mpv/default.nix deleted file mode 100644 index 6b252a38..00000000 --- a/modules/home.legacy/conf/mpv/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.mpv = { - enable = true; - bindings = { - q = "quit 0"; - "Ctrl+c" = "quit 1"; - "Shift+q" = "quit-watch-later 1"; - }; - }; -} diff --git a/modules/home.legacy/conf/mumble/Mumble.conf.license b/modules/home.legacy/conf/mumble/Mumble.conf.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/home.legacy/conf/mumble/Mumble.conf.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/mumble/default.nix b/modules/home.legacy/conf/mumble/default.nix index 6fa524dc..1c1bc64e 100644 --- a/modules/home.legacy/conf/mumble/default.nix +++ b/modules/home.legacy/conf/mumble/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { xdg.configFile."Mumble/Mumble.conf".source = ./Mumble.conf; } diff --git a/modules/home.legacy/conf/neomutt/default.nix b/modules/home.legacy/conf/neomutt/default.nix index e4fbcb39..5947e675 100644 --- a/modules/home.legacy/conf/neomutt/default.nix +++ b/modules/home.legacy/conf/neomutt/default.nix @@ -1,9 +1,23 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { programs.neomutt = { enable = true; package = pkgs.writeShellScriptBin "neomutt" '' + # Download newest mail systemctl --user start mbsync.service; + ${pkgs.neomutt}/bin/neomutt; + + # Upload changed things (e.g., new mail in Sent) + systemctl --user start mbsync.service; ''; vimKeys = false; # see the modified ones below checkStatsInterval = 60; diff --git a/modules/home.legacy/conf/nix-index/default.nix b/modules/home.legacy/conf/nix-index/default.nix deleted file mode 100644 index eb8132d9..00000000 --- a/modules/home.legacy/conf/nix-index/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{...}: { - programs.nix-index = { - enable = true; - symlinkToCacheHome = true; - - # Handled by myself (and the script is overridden) - enableBashIntegration = false; - enableZshIntegration = false; - enableFishIntegration = false; - }; - programs.nix-index-database = { - comma.enable = false; - }; -} diff --git a/modules/home.legacy/conf/npm/.npmrc b/modules/home.legacy/conf/npm/.npmrc index d0d846bd..ef7db71a 100644 --- a/modules/home.legacy/conf/npm/.npmrc +++ b/modules/home.legacy/conf/npm/.npmrc @@ -1,3 +1,13 @@ +; nixos-config - My current NixOS configuration +; +; Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +; SPDX-License-Identifier: GPL-3.0-or-later +; +; This file is part of my nixos-config. +; +; You should have received a copy of the License along with this program. +; If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + scripts-prepend-node-path=true node_gyp= prefix=${XDG_DATA_HOME}/npm diff --git a/modules/home.legacy/conf/npm/default.nix b/modules/home.legacy/conf/npm/default.nix index 7b4bb6a1..6f17277a 100644 --- a/modules/home.legacy/conf/npm/default.nix +++ b/modules/home.legacy/conf/npm/default.nix @@ -1,7 +1,12 @@ -{ - config, - pkgs, - ... -}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { xdg.configFile."npm/.npmrc".source = ./.npmrc; } diff --git a/modules/home.legacy/conf/prusa_slicer/default.nix b/modules/home.legacy/conf/prusa_slicer/default.nix index 9529e13d..923ebbfc 100644 --- a/modules/home.legacy/conf/prusa_slicer/default.nix +++ b/modules/home.legacy/conf/prusa_slicer/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { xdg.configFile."PrusaSlicer/PrusaSlicer.ini".source = ./prusa_slicer.ini; } diff --git a/modules/home.legacy/conf/prusa_slicer/prusa_slicer.ini b/modules/home.legacy/conf/prusa_slicer/prusa_slicer.ini index 0416a398..c9b7df5c 100644 --- a/modules/home.legacy/conf/prusa_slicer/prusa_slicer.ini +++ b/modules/home.legacy/conf/prusa_slicer/prusa_slicer.ini @@ -1,3 +1,13 @@ +; nixos-config - My current NixOS configuration +; +; Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +; SPDX-License-Identifier: GPL-3.0-or-later +; +; This file is part of my nixos-config. +; +; You should have received a copy of the License along with this program. +; If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + alert_when_supports_needed = 1 allow_auto_color_change = 1 allow_ip_resolve = 1 diff --git a/modules/home.legacy/conf/python/default.nix b/modules/home.legacy/conf/python/default.nix index 09f5c5ce..12764f9f 100644 --- a/modules/home.legacy/conf/python/default.nix +++ b/modules/home.legacy/conf/python/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {config, ...}: { xdg.configFile."python/pythonrc".source = ./pythonrc.py; home.sessionVariables = { diff --git a/modules/home.legacy/conf/python/pythonrc.py b/modules/home.legacy/conf/python/pythonrc.py index 466d9788..b733dc48 100644 --- a/modules/home.legacy/conf/python/pythonrc.py +++ b/modules/home.legacy/conf/python/pythonrc.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + def is_vanilla() -> bool: import sys diff --git a/modules/home.legacy/conf/rclone/default.nix b/modules/home.legacy/conf/rclone/default.nix index bd0c1ac2..87de601b 100644 --- a/modules/home.legacy/conf/rclone/default.nix +++ b/modules/home.legacy/conf/rclone/default.nix @@ -1,7 +1,12 @@ -{ - config, - pkgs, - ... -}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { xdg.configFile."rclone/rclone.conf".source = ./rclone.conf; } diff --git a/modules/home.legacy/conf/rclone/rclone.conf.license b/modules/home.legacy/conf/rclone/rclone.conf.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/home.legacy/conf/rclone/rclone.conf.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/rofi/default.nix b/modules/home.legacy/conf/rofi/default.nix index 10363ab5..3de22ea0 100644 --- a/modules/home.legacy/conf/rofi/default.nix +++ b/modules/home.legacy/conf/rofi/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { programs.rofi = { enable = true; diff --git a/modules/home.legacy/conf/rofi/nord-twoLines.rasi.license b/modules/home.legacy/conf/rofi/nord-twoLines.rasi.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/home.legacy/conf/rofi/nord-twoLines.rasi.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/ssh/default.nix b/modules/home.legacy/conf/ssh/default.nix deleted file mode 100644 index de9b0d90..00000000 --- a/modules/home.legacy/conf/ssh/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{config, ...}: { - programs.ssh = { - enable = true; - compression = true; - hashKnownHosts = false; - serverAliveInterval = 240; - userKnownHostsFile = "${config.xdg.dataHome}/ssh/known_hosts"; - - matchBlocks = { - "codeberg.org" = { - # TODO: Remove this once they fix their ipv6 config - addressFamily = "inet"; - }; - }; - }; -} diff --git a/modules/home.legacy/conf/starship/default.nix b/modules/home.legacy/conf/starship/default.nix index 5db6eb8b..6a6938f7 100644 --- a/modules/home.legacy/conf/starship/default.nix +++ b/modules/home.legacy/conf/starship/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, nixosConfig, @@ -7,15 +16,18 @@ programs.starship = { enable = true; enableZshIntegration = true; + settings = { add_newline = false; format = lib.concatStrings [ "$directory" "$username" + "\${custom.in_nixos_shell}" "$cmd_duration" "$status" "$character" ]; + right_format = lib.concatStrings ( [ "$git_metrics" @@ -29,24 +41,30 @@ nixosConfig.soispha.laptop.enable "$battery" ); + scan_timeout = 20; + character = { # success_symbol = "[❯](bold blue)"; # a = "⬢"; success_symbol = "[](bold blue)"; error_symbol = "[](bold red)"; }; + status = { disabled = false; format = "([($common_meaning )($status)( $signal_name)]($style) )"; }; + time = { disabled = false; format = "[\\[$time\\]]($style)"; }; + username = { format = "as [$user]($style) "; }; + git_branch = { format = "[($symbol$branch(:$remote_branch) )]($style)"; }; @@ -77,22 +95,28 @@ tag_symbol = "v"; format = "[(\\[$tag\\] )]($style)"; }; + directory = { truncate_to_repo = true; read_only = " "; before_repo_root_style = "black bold dimmed"; }; + cmd_duration = { min_time = 2000; # Milliseconds style = "bold white"; }; + custom = { - # status_output = { - # format = "$output"; - # command = "if test $STARSHIP_CMD_STATUS -ne 0; then echo \"bold red\"; else echo \"bold cyan\"; fi"; - # shell = [ "${pkgs.dash}" ]; - # }; + in_nixos_shell = { + symbol = "VM "; + style = "bold white"; + when = ''test "$IN_NIXOS_SHELL" = true ''; + shell = ["${lib.getExe pkgs.dash}"]; + description = "Show if a shell is run in a vm"; + }; }; + battery = { # ' ' # ' ' diff --git a/modules/home.legacy/conf/swayidle/config.license b/modules/home.legacy/conf/swayidle/config.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/home.legacy/conf/swayidle/config.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/conf/swayidle/default.nix b/modules/home.legacy/conf/swayidle/default.nix index 6b8a7d80..4483c8b9 100644 --- a/modules/home.legacy/conf/swayidle/default.nix +++ b/modules/home.legacy/conf/swayidle/default.nix @@ -1,8 +1,14 @@ -{ - config, - pkgs, - ... -}: { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { + # TODO: This fails to hibernate when the hardware swap was not previously activated. <2025-04-04> xdg.configFile."swayidle/config".source = ./config; # services.swayidle = { diff --git a/modules/home.legacy/conf/swaylock/default.nix b/modules/home.legacy/conf/swaylock/default.nix deleted file mode 100644 index d662cb78..00000000 --- a/modules/home.legacy/conf/swaylock/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.swaylock = { - enable = true; - settings = { - image = "${./duwon-lee-tempano-port.jpg}"; - scaling = "center"; - color = "000000"; - }; - }; -} diff --git a/modules/home.legacy/conf/taskwarrior/default.nix b/modules/home.legacy/conf/taskwarrior/default.nix deleted file mode 100644 index d7aec156..00000000 --- a/modules/home.legacy/conf/taskwarrior/default.nix +++ /dev/null @@ -1,125 +0,0 @@ -{ - nixosConfig, - lib, - config, - ... -}: { - imports = [ - ./hooks - ]; - - services.taskwarrior-sync = { - enable = true; - }; - - programs.taskwarrior = let - projects = import ./projects {}; - - mkContext = project: - if builtins.hasAttr "subprojects" project - then - lib.lists.flatten ( - (builtins.map mkContext (builtins.map (mkProject project) project.subprojects)) - ++ (mkContext (builtins.removeAttrs project ["subprojects"])) - ) - else [ - { - inherit (project) name; - value = let - name = - if builtins.hasAttr "pname" project - then project.pname - else project.name; - in { - read = "project:${name}"; - write = "project:${name}"; - rc = { - neorg_path = - if builtins.hasAttr "neorg_path" project - then project.neorg_path - else "${project.prefix}/${project.name}/index.norg"; - }; - }; - } - ]; - mkProject = project: subproject: let - pname = - if builtins.hasAttr "pname" project - then project.pname - else project.name; - in - if builtins.isString subproject - then { - name = "${project.name}_${subproject}"; - pname = "${pname}.${subproject}"; - neorg_path = - if builtins.hasAttr "neorg_path_prefix" project - then "${project.neorg_path_prefix}/${subproject}/index.norg" - else "${project.prefix}/${project.name}/${subproject}/index.norg"; - } - else if builtins.isAttrs subproject - then let - name = builtins.elemAt (builtins.attrNames subproject) 0; - in { - name = "${project.name}_${name}"; - pname = "${pname}.${name}"; - prefix = "${project.prefix}/${project.name}"; - neorg_path_prefix = "${project.prefix}/${project.name}/${name}"; - subprojects = builtins.elemAt (builtins.attrValues subproject) 0; - } - else builtins.throw "Subproject not a string or a attrs: ${subproject}"; - - context = - builtins.listToAttrs (lib.lists.flatten (builtins.map mkContext projects)); - in { - enable = true; - colorTheme = ./nord.theme; - extraConfig = '' - # This include just contains my taskd user credentials - include ${nixosConfig.age.secrets.taskserverCredentials.path} - ''; - config = { - news.version = "2.6.0"; - complete.all.tags = true; - list.all = { - projects = true; - tags = true; - }; - regex = true; - weekstart = "Monday"; - uda = { - total_active_time = { - type = "duration"; - label = "Total active time"; - }; - }; - alias = { - mod = "modify"; - n = "execute neorg --task"; - fstart = "execute neorg fstart"; - }; - color = true; - - hooks.location = "${config.xdg.configHome}/task/hooks"; - - urgency.uda.priority = { - H.coefficient = 6.0; - M.coefficient = 0; - L.coefficient = -1.8; - }; - - inherit context; - - taskd = { - server = "taskserver.vhack.eu:53589"; - trust = "strict"; - ca = - nixosConfig.age.secrets.taskserverCA.path; - key = - nixosConfig.age.secrets.taskserverPrivate.path; - certificate = - nixosConfig.age.secrets.taskserverPublic.path; - }; - }; - }; -} diff --git a/modules/home.legacy/conf/taskwarrior/firefox/default.nix b/modules/home.legacy/conf/taskwarrior/firefox/default.nix deleted file mode 100644 index fb5daaa8..00000000 --- a/modules/home.legacy/conf/taskwarrior/firefox/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - lib, - # options - prefConfig, - profile_size, - search, - userChrome, - ... -}: let - inherit (config.soispha.taskwarrior.projects) projects; - - mkFirefoxProfile = { - name, - id, - }: { - inherit name; - value = { - isDefault = false; - extraConfig = prefConfig; - inherit id name search userChrome; - }; - }; - projects_id = - lib.imap0 (id: project: { - name = project; - id = id + profile_size; - }) - projects; - firefoxProfiles = builtins.listToAttrs (builtins.map mkFirefoxProfile projects_id); -in - firefoxProfiles diff --git a/modules/home.legacy/conf/taskwarrior/hooks/default.nix b/modules/home.legacy/conf/taskwarrior/hooks/default.nix deleted file mode 100644 index ef97e1b5..00000000 --- a/modules/home.legacy/conf/taskwarrior/hooks/default.nix +++ /dev/null @@ -1,114 +0,0 @@ -{ - sysLib, - pkgs, - lib, - config, - ... -}: let - mkProject = project: subproject: - if builtins.isString subproject - then { - name = "${project.name}.${subproject}"; - prefix = null; - } - else let - name = builtins.elemAt (builtins.attrNames subproject) 0; - in { - name = "${project.name}.${name}"; - subprojects = builtins.elemAt (builtins.attrValues subproject) 0; - prefix = null; - }; - - mkProjectName = project: - if builtins.hasAttr "subprojects" project - then - lib.lists.flatten ([project.name] - ++ (builtins.map mkProjectName - (builtins.map (mkProject project) project.subprojects))) - else [project.name]; - projects = lib.lists.unique (lib.lists.naturalSort (lib.lists.flatten (builtins.map mkProjectName (import ../projects {})))); - projects_newline = builtins.concatStringsSep "\n" projects; - projects_comma = builtins.concatStringsSep ", " projects; - projects_pipe = builtins.concatStringsSep "|" projects; - - enforce_policies = sysLib.writeShellScript { - name = "bin"; - src = ./scripts/on-add_enforce-policies.sh; - dependencies = with pkgs; [dash jq taskwarrior gnused gnugrep]; - replacementStrings = { - PROJECTS_NEWLINE = projects_newline; - PROJECTS_COMMA = projects_comma; - }; - }; - track_timewarrior = pkgs.stdenv.mkDerivation { - name = "track_timewarrior.taskwarrior-hook"; - nativeBuildInputs = [ - pkgs.makeWrapper - ]; - buildInputs = [ - pkgs.timewarrior - pkgs.taskwarrior - # TODO: Use a `taskw` package, that actually supports newer python variants <2024-07-13> - (pkgs.python311.withPackages (pythonPackages: - with pythonPackages; [ - taskw - ])) - ]; - dontUnpack = true; - installPhase = '' - install -Dm755 ${./scripts/on-modify_track-timewarrior.py} $out/bin/bin - wrapProgram $out/bin/bin \ - --prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior pkgs.timewarrior]} - ''; - }; - track_total_active_time = pkgs.stdenv.mkDerivation { - name = "track_total_active_time.taskwarrior-hook"; - nativeBuildInputs = [ - pkgs.makeWrapper - ]; - buildInputs = [ - pkgs.taskwarrior - # TODO: Use a `taskw` package, that actually supports newer python variants <2024-07-13> - (pkgs.python311.withPackages (pythonPackages: - with pythonPackages; [ - taskw - ])) - ]; - dontUnpack = true; - installPhase = '' - install -Dm755 ${./scripts/on-modify_track-total-active-time.py} $out/bin/bin - wrapProgram $out/bin/bin \ - --prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior]} - ''; - }; - - mkSyncGitRepo = type: { - name = "${hookPath}/${type}_sync-git-repo"; - value = { - source = "${sysLib.writeShellScript { - name = "bin"; - src = ./scripts + "/${type}_sync-git-repo.sh"; - dependencies = with pkgs; [dash taskwarrior git]; - }}/bin/bin"; - }; - }; - sync_git_repos = - builtins.listToAttrs (builtins.map mkSyncGitRepo ["on-add" "on-modify"]); - hookPath = config.programs.taskwarrior.config.hooks.location; -in { - options.soispha.taskwarrior.projects = lib.mkOption { - type = lib.types.attrs; - }; - config = { - soispha.taskwarrior.projects = { - inherit projects_newline projects_comma projects projects_pipe; - }; - home.file = - { - "${hookPath}/on-add_enforce-policies".source = "${enforce_policies}/bin/bin"; - "${hookPath}/on-modify_track-timewarrior".source = "${track_timewarrior}/bin/bin"; - "${hookPath}/on-modify_track-total-active-time".source = "${track_total_active_time}/bin/bin"; - } - // sync_git_repos; - }; -} diff --git a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-add_enforce-policies.sh b/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-add_enforce-policies.sh deleted file mode 100755 index eaf7f30c..00000000 --- a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-add_enforce-policies.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# override shell lib output to stdout -eprint() { - # shellcheck disable=SC2317 - print "$@" -} -eprintln() { - # shellcheck disable=SC2317 - println "$@" -} - -enable_hook_dbg() { - debug_hooks="$(task _get rc.debug.hooks)" - [ "$debug_hooks" ] && [ "$debug_hooks" -ge 1 ] && dbg_enable -} - -enforce_project() { - project="$(jq '.project' "$(ptmp "$1")")" - [ "$project" = "null" ] && die "No project supplied!" - - if grep -q "^$(echo "$project" | sed 's|"\(.*\)"|\1|')\$" "$(ptmp "%PROJECTS_NEWLINE")"; then - dbg "project('$project') is a valid part of %PROJECTS_COMMA" - else - die "The project '$(echo "$project" | sed 's|"||g')' is not registered with the nix config, registered projects: %PROJECTS_COMMA" - fi -} - -read -r new_task -# We don't change the task, thus immediately return the json -echo "$new_task" - -enable_hook_dbg -enforce_project "$new_task" - -exit 0 - -# vim: ft=sh diff --git a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-add_sync-git-repo.sh b/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-add_sync-git-repo.sh deleted file mode 100755 index dadc96b0..00000000 --- a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-add_sync-git-repo.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# override shell lib output to stdout -eprint() { - # shellcheck disable=SC2317 - print "$@" -} -eprintln() { - # shellcheck disable=SC2317 - println "$@" -} - -enable_hook_dbg() { - debug_hooks="$(task _get rc.debug.hooks)" - [ "$debug_hooks" ] && [ "$debug_hooks" -ge 1 ] && dbg_enable -} - -update_git_repo() { - task_data="$(task _get rc.data.location)" - [ "$task_data" ] || die "Taskwarrior should have a location set" - - cd "$task_data" || die "(BUG?): Your data.location path is not accessable" - - [ -d ./.git/ ] || git init - - git add . - git commit --message="chore: Update" --no-gpg-sign -} - -read -r new_task -# We don't change the task, thus immediately return the json -echo "$new_task" - -enable_hook_dbg -update_git_repo - -exit 0 - -# vim: ft=sh diff --git a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_sync-git-repo.sh b/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_sync-git-repo.sh deleted file mode 100755 index 25813e46..00000000 --- a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_sync-git-repo.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# override shell lib output to stdout -eprint() { - # shellcheck disable=SC2317 - print "$@" -} -eprintln() { - # shellcheck disable=SC2317 - println "$@" -} - -enable_hook_dbg() { - debug_hooks="$(task _get rc.debug.hooks)" - [ "$debug_hooks" ] && [ "$debug_hooks" -ge 1 ] && dbg_enable -} - -update_git_repo() { - task_data="$(task _get rc.data.location)" - [ "$task_data" ] || die "Taskwarrior should have a location set" - - cd "$task_data" || die "(BUG?): Your data.location path is not accessable" - - [ -d ./.git/ ] || git init - - git add . - git commit --message="chore: Update" --no-gpg-sign -} - -read -r _old_task -read -r new_task -# We don't change the task, thus immediately return the json -echo "$new_task" - -enable_hook_dbg -update_git_repo - -exit 0 - -# vim: ft=sh diff --git a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_track-timewarrior.py b/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_track-timewarrior.py deleted file mode 100755 index b482af6a..00000000 --- a/modules/home.legacy/conf/taskwarrior/hooks/scripts/on-modify_track-timewarrior.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright (C) 2016-present Arctic Ice Studio <development@arcticicestudio.com> -# Copyright (C) 2016-present Sven Greb <development@svengreb.de> - -# Project: igloo -# Repository: https://github.com/arcticicestudio/igloo -# License: MIT -# References: -# https://taskwarrior.org/docs -# https://taskwarrior.org/docs/timewarrior -# timew(1) -# task(1) - -"""A Taskwarrior hook to track the time of a active task with Taskwarrior. - -This hook will extract all of the following for use as Timewarrior tags: - -* UUID -* Project -* Tags -* Description -* UDAs - -Note: - This hook requires Python 3 and is only compatible with Taskwarrior version greater or equal to 2.4! - -This hook is a fork from the `official on-modify.timewarrior hook`_. - -.. _`official on-modify.timewarrior hook`: - https://github.com/GothenburgBitFactory/timewarrior/blob/dev/ext/on-modify.timewarrior -""" - -import subprocess -import sys -from json import loads, dumps -from os import system -from sys import stdin -from taskw import TaskWarrior - -# Make no changes to the task, simply observe. -old = loads(stdin.readline()) -new = loads(stdin.readline()) -print(dumps(new)) - - -w = TaskWarrior(config_filename=sys.argv[4].replace("rc:", "")) -config = w.load_config(config_filename=sys.argv[4].replace("rc:", "")) -if "max_active_tasks" in config: - MAX_ACTIVE = int(config["max_active_tasks"]) -else: - MAX_ACTIVE = 1 - - -# Extract attributes for use as tags. -tags = [new["description"]] - -if "project" in new: - project = new["project"] - tags.append(project) - if "." in project: - tags.extend([tag for tag in project.split(".")]) - -if "tags" in new: - tags.extend(new["tags"]) - -combined = " ".join(["'%s'" % tag for tag in tags]).encode("utf-8").strip() - -# Task has been started. -if "start" in new and "start" not in old: - # Prevent this task from starting if "task +ACTIVE count" is greater than "MAX_ACTIVE". - p = subprocess.Popen( - ["task", "+ACTIVE", "status:pending", "count", "rc.verbose:off"], - stdout=subprocess.PIPE, - ) - out, err = p.communicate() - count = int(out.rstrip()) - if count >= MAX_ACTIVE: - print( - "Only %d task(s) can be active at a time. " - "See 'max_active_tasks' in .taskrc." % MAX_ACTIVE - ) - sys.exit(1) - - system("timew start " + combined.decode() + " :yes") - -# Task has been stopped. -elif "start" not in new and "start" in old: - system("timew stop " + combined.decode() + " :yes") - -# Any task that is active, with a non-pending status should not be tracked. -elif "start" in new and new["status"] != "pending": - system("timew stop " + combined.decode() + " :yes") diff --git a/modules/home.legacy/conf/taskwarrior/projects/default.nix b/modules/home.legacy/conf/taskwarrior/projects/default.nix deleted file mode 100644 index c5c55059..00000000 --- a/modules/home.legacy/conf/taskwarrior/projects/default.nix +++ /dev/null @@ -1,123 +0,0 @@ -{}: [ - { - name = "me"; - prefix = ""; - subprojects = ["health" "sweden" "bank" "google"]; - } - { - name = "timesinks"; - prefix = ""; - subprojects = ["youtube" "games" "netflix" "music"]; - } - { - name = "input"; - prefix = "research"; - subprojects = ["read-things" "dotfiles"]; - } - { - name = "book"; - prefix = "book"; - } - { - name = "aoc"; - prefix = "programming/advent_of_code"; - } - { - name = "camera"; - prefix = "programming/zig"; - subprojects = []; - } - { - name = "trinitrix"; - prefix = "programming/rust"; - subprojects = ["testing" "documentation"]; - } - { - name = "serverphone"; - prefix = "programming/rust"; - } - { - name = "latex"; - prefix = "programming/latex"; - } - { - name = "presentation"; - prefix = "research"; - } - { - name = "possible-projects"; - prefix = "research"; - } - { - name = "school"; - prefix = "research"; - subprojects = [ - "biologie" - "chemie" - "deutsch" - "english" - "geographie" - "geschichte" - "infomatik" - "klausuren" - "latein" - "mathematik" - "musik" - "philosophie" - "physik" - "sozialkunde" - "sport" - {extern = ["bwinf" "dsa"];} - {chemie = ["facharbeit"];} # TODO: Remove once the ff tabs are cleared <2024-05-10> - ]; - } - { - name = "hardware"; - prefix = "research"; - } - { - name = "buy"; - prefix = "buy"; - subprojects = ["books" "pc"]; - } - { - name = "system"; - prefix = "config"; - subprojects = [ - "youtube" - "backup" - "bar" - "email" - "firefox" - "gpg" - "keyboard" - "laptop" - "nvim" - "rss" - "shell" - "task" - "wm" - ]; - } - { - name = "server"; - prefix = "config"; - subprojects = [ - "b-peetz" - "email" - "blog" - "nix-sync" - "sudo-less" - "ci" - ]; - } - { - name = "3d-printer"; - prefix = "hardware"; - } - { - name = "smartphone"; - prefix = "hardware"; - subprojects = ["airplay" "airdrop"]; - } -] diff --git a/modules/home.legacy/conf/timewarrior/default.nix b/modules/home.legacy/conf/timewarrior/default.nix deleted file mode 100644 index bcb627f5..00000000 --- a/modules/home.legacy/conf/timewarrior/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{pkgs, ...}: { - home.packages = [ - pkgs.timewarrior - ]; - xdg.configFile."timewarrior/timewarrior.cfg".text = '' - # source: https://github.com/arcticicestudio/igloo - #+----+ - #+ UI + - #+----+ - import ${./nord.theme} - color = true - - #+---------+ - #+ Reports + - #+---------+ - define reports: - day: - lines = 10 - month = true - week = true - ''; -} diff --git a/modules/home.legacy/conf/tridactyl/config.vim b/modules/home.legacy/conf/tridactyl/config.vim index 84e290cb..aa843bc8 100644 --- a/modules/home.legacy/conf/tridactyl/config.vim +++ b/modules/home.legacy/conf/tridactyl/config.vim @@ -1,3 +1,13 @@ +" nixos-config - My current NixOS configuration +" +" Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +" SPDX-License-Identifier: GPL-3.0-or-later +" +" This file is part of my nixos-config. +" +" You should have received a copy of the License along with this program. +" If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + " vim: filetype=vim " This wipes all existing settings. This means that if a setting in this file diff --git a/modules/home.legacy/conf/tridactyl/default.nix b/modules/home.legacy/conf/tridactyl/default.nix index 23307cfe..de92c665 100644 --- a/modules/home.legacy/conf/tridactyl/default.nix +++ b/modules/home.legacy/conf/tridactyl/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { xdg.configFile."tridactyl/tridactylrc".source = ./config.vim; } diff --git a/modules/home.legacy/conf/xdg/default.nix b/modules/home.legacy/conf/xdg/default.nix deleted file mode 100644 index 4099720d..00000000 --- a/modules/home.legacy/conf/xdg/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - sysLib, - pkgs, - config, - ... -}: let - url_handler = sysLib.writeShellScript { - name = "url_handler"; - src = ./url_handler.sh; - keepPath = true; - # Naming dependencies for this will be difficult, as it depend on overridden packages. - dependencies = with pkgs; [ - rofi - libnotify - zathura - ]; - replacementStrings = { - ALL_PROJECTS_PIPE = "${config.soispha.taskwarrior.projects.projects_pipe}"; - }; - }; -in { - imports = [ - ./xdg_vars.nix - ]; - - xdg = { - mimeApps = { - enable = true; - defaultApplications = { - "application/pdf" = ["url_handler.desktop"]; - "application/x-pdf" = ["url_handler.desktop"]; - - "text/html" = ["url_handler.desktop"]; - "text/xml" = ["url_handler.desktop"]; - "x-scheme-handler/http" = ["url_handler.desktop"]; - "x-scheme-handler/https" = ["url_handler.desktop"]; - "x-scheme-handler/about" = ["url_handler.desktop"]; - "x-scheme-handler/unknown" = ["url_handler.desktop"]; - }; - }; - desktopEntries = { - url_handler = { - name = "url_handler"; - genericName = "Web Browser"; - exec = "${url_handler}/bin/url_handler %u"; - terminal = false; - categories = [ - "Application" - "Network" - "WebBrowser" - ]; - mimeType = [ - "text/html" - "text/xml" - "x-scheme-handler/http" - "x-scheme-handler/https" - "x-scheme-handler/about" - "x-scheme-handler/unknown" - ]; - }; - }; - }; -} diff --git a/modules/home.legacy/conf/xdg/url_handler.sh b/modules/home.legacy/conf/xdg/url_handler.sh deleted file mode 100755 index 95eedffb..00000000 --- a/modules/home.legacy/conf/xdg/url_handler.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -project="$(echo "%ALL_PROJECTS_PIPE|nvim|zathura|" | rofi -sep "|" -dmenu)" - -if [ "$project" = "nvim" ]; then - "$TERMINAL" -e nvim "$1" -elif [ "$project" = "zathura" ]; then - zathura "$1" -elif [ "$project" ]; then - firefox -P "$project" "$1" -else - notify-send "(URL HANDLER) No project selected" && exit 1 -fi - -# vim: ft=sh diff --git a/modules/home.legacy/conf/xdg/xdg_vars.nix b/modules/home.legacy/conf/xdg/xdg_vars.nix deleted file mode 100644 index aa2f30d4..00000000 --- a/modules/home.legacy/conf/xdg/xdg_vars.nix +++ /dev/null @@ -1,29 +0,0 @@ -{config, ...}: let - inherit (config.xdg) dataHome; -in { - # FIXME: Move these options in relevant modules, that are connected to their software. - # <2024-10-21> - - # Variables that only have to be set because special applications fail to set reasonable - # defaults (mostly understandable because of backwards-compatibility, but yeah) - home.sessionVariables = { - CARGO_HOME = "${dataHome}/cargo"; - GRADLE_USER_HOME = "${dataHome}/gradle"; - - #_JAVA_OPTIONS = lib.concatStringsSep " " [ - # ''-Djava.util.prefs.userRoot="${config.xdg.configHome}/java"'' - # ''-Djavafx.cachedir="${config.xdg.cacheHome}/openjfx"'' - # ]; - #GOPATH = "${config.xdg.dataHome}/go"; - #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - #RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; - #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; - #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages"; - #XAUTHORITY = "${config.xdg.stateHome}/Xauthority"; - #COMPDUMPFILE = "${config.xdg.dataHome}/zsh/.zcompdump}"; - #IPYTHONDIR = "${config.xdg.configHome}/ipython"; - #PARALLEL_HOME = "${config.xdg.configHome}/parallel"; - #STACK_XDG = "1"; - #WINEPREFIX = "${config.xdg.dataHome}/wine"; - }; -} diff --git a/modules/home.legacy/conf/ytcc/default.nix b/modules/home.legacy/conf/ytcc/default.nix deleted file mode 100644 index 87300ec1..00000000 --- a/modules/home.legacy/conf/ytcc/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."ytcc/ytcc.conf".source = pkgs.substituteAll { - src = ./ytcc.conf; - download_dir = "${config.xdg.userDirs.download}/ytcc"; - xdg_data_home = config.xdg.dataHome; - }; -} diff --git a/modules/home.legacy/conf/ytcc/ytcc.conf b/modules/home.legacy/conf/ytcc/ytcc.conf deleted file mode 100644 index 289843ad..00000000 --- a/modules/home.legacy/conf/ytcc/ytcc.conf +++ /dev/null @@ -1,37 +0,0 @@ -[ytcc] -download_dir = @download_dir@ -mpv_flags = --really-quiet --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best --speed=2.7 -download_subdirs = true -order_by = playlists:asc, publish_date:desc -video_attrs = id, title, publish_date, duration, playlists -playlist_attrs = name, url, tags, reverse -db_path = @xdg_data_home@/ytcc/ytcc.db -date_format = %Y-%m-%d -max_update_fail = 5 -max_update_backlog = 20 -age_limit = 0 - -[tui] -alphabet = sdfervghnuiojkl -default_action = play_video - -[theme] -prompt_download_audio = 2 -prompt_download_video = 4 -prompt_play_audio = 2 -prompt_play_video = 4 -prompt_mark_watched = 1 -table_alternate_background = 245 -plain_label_text = 244 - -[youtube_dl] -format = bestvideo[height<=?1080]+bestaudio/best -output_template = %(title)s.%(ext)s -ratelimit = 0 -retries = 0 -subtitles = off -thumbnail = true -skip_live_stream = true -merge_output_format = mkv -max_duration = 0 -restrict_filenames = false diff --git a/modules/home.legacy/default.nix b/modules/home.legacy/default.nix index de6fec25..fd543661 100644 --- a/modules/home.legacy/default.nix +++ b/modules/home.legacy/default.nix @@ -1,10 +1,14 @@ -{ - nixVim, - nix-index-database, - ... -}: let - username = "soispha"; - homeDirectory = "/home/${username}"; +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{config, ...}: let + inherit (config.home) homeDirectory; # xdg configHome = "${homeDirectory}/.config"; @@ -18,20 +22,11 @@ in { ./conf ./files ./pkgs - ./wms - - nixVim.homeManagerModules.nixvim - nix-index-database.hmModules.nix-index ]; # I don't know what this does, but I've seen it a lot online, so it should be good, right? programs.home-manager.enable = true; - home = { - inherit username homeDirectory; - stateVersion = "23.05"; - enableNixpkgsReleaseCheck = true; - }; xdg = { enable = true; inherit configHome dataHome stateHome cacheHome; #binHome; # TODO: add binHome, when the standard is extended diff --git a/modules/home.legacy/files/default.nix b/modules/home.legacy/files/default.nix index 16fe9afe..5a04ab7a 100644 --- a/modules/home.legacy/files/default.nix +++ b/modules/home.legacy/files/default.nix @@ -1,6 +1,14 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ - ./wallpaper ./manifest_json ]; } diff --git a/modules/home.legacy/files/manifest_json/default.nix b/modules/home.legacy/files/manifest_json/default.nix index af8d85d2..5b4821ac 100644 --- a/modules/home.legacy/files/manifest_json/default.nix +++ b/modules/home.legacy/files/manifest_json/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/home.legacy/files/manifest_json/profile/manifest.json.license b/modules/home.legacy/files/manifest_json/profile/manifest.json.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/home.legacy/files/manifest_json/profile/manifest.json.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/home.legacy/files/wallpaper/default.nix b/modules/home.legacy/files/wallpaper/default.nix deleted file mode 100644 index 119df225..00000000 --- a/modules/home.legacy/files/wallpaper/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{config, ...}: { - home = { - sessionVariables = { - WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper"; - }; - - file = { - wallpaper = { - source = ./abstract-nord.png; - target = "media/pictures/wallpaper"; - }; - }; - }; -} diff --git a/modules/home.legacy/pkgs/default.nix b/modules/home.legacy/pkgs/default.nix index 1a4c4a1b..5ab1e73b 100644 --- a/modules/home.legacy/pkgs/default.nix +++ b/modules/home.legacy/pkgs/default.nix @@ -1,51 +1,31 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, - config, nixosConfig, ... }: -# TODO: Remove this whole file, and move each pkgs to a separate module. <2024-11-16> +# TODO: Remove this whole file, and move each package to a separate module. <2024-11-16> with pkgs; let Gui = { Terminals = [ - # foot # wayland native terminal alacritty # default terminal ]; - Browsers = [ - #ungoogled-chromium # web browser (only for web programming) - #brave - ]; - - ImageManipulation = [ - #krita # new, and better (KDE) - #gimp # conservative, and old (GNOME) - ]; - - Social = [ - mumble # voice chat software (client) - # lutris # multiple game store clients - - # nheko # best matrix client (as of today) - # element-desktop # nheko didn't work - signal-desktop # to avoid encryption problems with signal-bridge - ]; Misc = [ - #kalzium # Periodic Table of Elements (`element` is [sort of] better) keepassxc # password manager - #onlykey # OnlyKey Chrome Desktop App - anki-bin # spaced repetition ]; }; TuiCli = { - EyeCandy = [ - #banner # Print large banners to ASCII terminals - cmatrix # A curses-based scrolling 'Matrix'-like screen - hyfetch # Neofetch with LGBTQ pride flags. - ]; - Social = [ iamb # best tui matrix client (as of today) ]; @@ -55,16 +35,9 @@ with pkgs; let ]; Misc = [ - android-file-transfer # Android MTP client with minimalistic UI - #xdg-ninja # A shell script which checks your $HOME for unwanted files and directories. - xdg-utils # open urls and such things - yokadi # Command line oriented, sqlite powered, todo list killall # kill a application by name - snap-sync-forked # A btrfs based backup solution bc # Smart calculator aumo # Automatic mount - nato # Encodes a string in the standardized spelling alphabet - virsh-del # Delete a libvirt virtual machine (not really used anymore). jq # Json parser ]; @@ -75,58 +48,30 @@ with pkgs; let ]; Firefox = [ - # `neorg` handles the integration between Firefox profiles and task + # `tskm` handles the integration between Firefox profiles and task # contexts - (neorg.override - { - defaultNeorgProjectDir = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces.projects; - allProjectsNewline = config.soispha.taskwarrior.projects.projects_newline; - allProjectsComma = config.soispha.taskwarrior.projects.projects_comma; - allProjectsPipe = config.soispha.taskwarrior.projects.projects_pipe; - allWorkspaces = config.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces; - xdgConfigHome = config.xdg.configHome; - xdgDataHome = config.xdg.dataHome; - }) + pkgs.tskm ]; }; WM = { - river = [river]; # A dynamic tiling wayland compositor - CLITools = [ - lswt # List Wayland toplevels. wl-clipboard # Command-line copy/paste utilities. - swaylock # My current lockscreen implementation. - ]; - - Media = [ - wf-recorder # Screen recorder. - libnotify # a command to send a notification. - screenshot_persistent # Creates a persisting screenshot. - screenshot_temporary # Takes a screenshot and stores it in the clipboard. ]; }; Media = { View = [ - imv # Image viewer zathura # PDF viewer ]; YouTube = [ - yti # Wrapper around `yt-dlp`. yt # A command line YouTube client ]; - - Listen = [ - spodi # Wrapper around `spotdl`. - sort_song # Sorts songs in the current directory. - ]; }; Hardware = { Storage = [ - #compsize # Calculate compression ratio of a set of files on Btrfs # TODO: smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives ]; @@ -144,48 +89,31 @@ with pkgs; let backlightName = nixosConfig.soispha.laptop.backlight; } ); - - Input = [ - #piper # GTK application to configure gaming mice - ]; }; SystemUpdate = [ fupdate # Generic update tool. - update-sys # System update tool (meant to slot into `fupdate`). + fupdate-sys # System update tool (meant to slot into `fupdate`). + fupdate-flake # Nix flake update tool (meant to slot into `fupdate`). ]; FileListers = [ tree # A directory listing program displaying a depth indented list of files fd # Simple, fast and user-friendly alternative to find ripgrep # A search tool that combines the usability of ag with the raw speed of grep - fzf # used to quickly move around with its keybindings file # Show information about a file - ll # Wrapper around `lf` to automatically change the path - lm # Wrapper around `ll` to automatically cd to the last accessed path - ]; - - Editors = [ - ed # A POSIX-compliant line-oriented text editor - #sed # GNU stream editor - vim # The original ex/vi text editor (this is `vim` and not `vi`, as `vi` is unfree) - #neovim # Fork of Vim aiming to improve user experience, plugins, and GUIs ]; Programming = { GeneralTools = [ stamp # Add a license header to a file git # the fast distributed version control system - git-absorb # git commit --fixup, but automatic git-edit-index # Allows you to edit the indexed version of a file git-cm # A wrapper that re-adds the last commit's subject - git-cleanup # An automatic merged branch deleter glow # Command-line markdown renderer ]; }; }; - # TODO: unmaintained, find sth else: - # handlr # Powerful alternative to xdg-utils written in Rust mapFun = x: if builtins.isAttrs x then @@ -194,7 +122,7 @@ with pkgs; let else builtins.attrValues x else [x]; in { - home.packages = + config.home.packages = [] ++ (with builtins; concatLists diff --git a/modules/home.legacy/wms/default.nix b/modules/home.legacy/wms/default.nix deleted file mode 100644 index 610ea2f4..00000000 --- a/modules/home.legacy/wms/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{config, ...}: { - imports = [ - # ./sway - ./river - # ./plasma - ]; -} diff --git a/modules/home.legacy/wms/plasma/default.nix b/modules/home.legacy/wms/plasma/default.nix deleted file mode 100644 index f68ee272..00000000 --- a/modules/home.legacy/wms/plasma/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{config, ...}: { - services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; -} diff --git a/modules/home.legacy/wms/river/default.nix b/modules/home.legacy/wms/river/default.nix deleted file mode 100644 index 9463e94e..00000000 --- a/modules/home.legacy/wms/river/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - pkgs, - sysLib, - river_init_lesser, - nixosConfig, - system, - qmk_firmware, - ... -}: let - inherit (nixosConfig.networking) hostName; - mappings = - if hostName == "tiamat" - then '' - err_fail riverctl keyboard-layout 'us-modified' - err_fail river_init_lesser ~/.config/river/res/moonlander.ron - '' - else if hostName == "lahmu" || hostName == "apzu" || hostName == "mammun" || hostName == "isimud" - then '' - err_fail riverctl keyboard-layout 'dvorak-modified' - err_fail river_init_lesser ~/.config/river/res/keys.ron - '' - else builtins.throw "Host not covered in river mappings"; - screen_setup = - if hostName == "lahmu" - then '' - err_fail wlr-randr --output Virtual-1 --mode 1920x1080 - '' - else if hostName == "tiamat" - then '' - err_fail wlr-randr --output DP-2 --pos 2560,0 - err_fail wlr-randr --output DP-1 --scale 1.5 --pos 0,0 - err_fail gammastep & - '' - else if hostName == "apzu" || hostName == "mammun" || hostName == "isimud" - then '' - err_fail gammastep & - '' - else builtins.throw "Host not covered in river screen setup"; - env_vars = "XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river"; - init_scr = pkgs.substituteAll { - src = ./init.sh; - inherit mappings screen_setup env_vars; - }; -in { - home.sessionVariables = { - WM = "river"; - XDG_CURRENT_DESKTOP = "river"; - DESKTOP_SESSION = "river"; - - # Export Wayland env Vars {{{ - QT_QPA_PLATFORM = "wayland"; - QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct - CLUTTER_BACKEND = "wayland"; - SDL_VIDEODRIVER = "wayland"; # might brake some things - # }}} - }; - - xdg.configFile."river/init".source = - sysLib.writeShellScript { - name = "river_init"; - src = init_scr; - keepPath = true; - dependencies = builtins.attrValues { - river_init_lesser = river_init_lesser.packages.${system}.default; - inherit (qmk_firmware.packages.${system}) qmk_unicode_type; - - inherit - (pkgs) - dash - river - glib # gnome lib - gammastep - wlr-randr - yambar - mako - swaybg - swayidle - swaylock - alacritty - ; - }; - } - + /bin/river_init; - - # TODO: These mappings should be generated in nix. (Which would allow to replace the - # `mpc` pat adding.) <2024-11-16> - - # Needed for the key-mappings. - home.packages = [pkgs.mpc]; - xdg.configFile."river/res".source = ./res; -} diff --git a/modules/home.legacy/wms/river/init.sh b/modules/home.legacy/wms/river/init.sh deleted file mode 100755 index 06a2e2f4..00000000 --- a/modules/home.legacy/wms/river/init.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -err_fail() { - if ! "$@"; then - warning "\"$*\" failed!\n" >>~/river_log - # msg "Executing the safe init!" - # exec ~/.config/river/res/safe_init.sh - fi -} -err_fail rm ~/river_log -exec 1>>"$HOME"/river_log -exec 2>>"$HOME"/river_log - -#trap err_fail ERR - -#Setup of environment variables {{{ -err_fail riverctl spawn "exec dbus-update-activation-environment --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" -export @env_vars@ -#}}} - -# Setup of mappings {{{ -@mappings@ -# }}} - -# Setup of Rules {{{ -err_fail riverctl rule-add -app-id float -title '*' float -err_fail riverctl rule-add -app-id mpv -title '*' float -err_fail riverctl rule-add -app-id ModernGL -title '*' float -err_fail riverctl rule-add -app-id '*' -title 'Manim Slides' float -err_fail riverctl rule-add -app-id '*' -title 'floating please' float - -err_fail riverctl rule-add -app-id '*' -title '*' ssd -err_fail riverctl rule-add -app-id firefox -title '*' csd # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) -# }}} - -# Set riverctl settings {{{ -# background -err_fail riverctl background-color 0x002b36 -err_fail riverctl border-color-focused 0x93a1a1 -err_fail riverctl border-color-unfocused 0x586e75 - -# keyboard repeat rate -err_fail riverctl set-repeat 50 300 - -# Cursor -err_fail riverctl focus-follows-cursor normal -#riverctl hide-cursor timeout 2000 -err_fail riverctl hide-cursor when-typing enabled -err_fail riverctl set-cursor-warp on-output-change -err_fail riverctl xcursor-theme Nordzy-cursors 24 - -err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 pointer-accel 0 -err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 accel-profile none - -err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I pointer-accel 0 -err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I accel-profile none -# }}} - -# Setup of general apps {{{ -@screen_setup@ - -err_fail yambar & - -err_fail mako & -err_fail swaybg -i "$WALLPAPER" & -err_fail swayidle & -err_fail alacritty & -# }}} - -# Setup of layout [acts as exec!] {{{ -err_fail riverctl default-layout rivertile -@env_vars@ rivertile -main-ratio 0.5 -view-padding 1 -outer-padding 0 - -#riverctl default-layout luatile -#river-luatile -# }}} -# vim: ft=sh diff --git a/modules/home.legacy/wms/river/res/keys.ron b/modules/home.legacy/wms/river/res/keys.ron deleted file mode 100644 index a2bc0fa1..00000000 --- a/modules/home.legacy/wms/river/res/keys.ron +++ /dev/null @@ -1,58 +0,0 @@ -#![enable(implicit_some)] -RiverctlCommandArray( - commands: [ - // Focus change - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super", command: "focus-view", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super", command: "focus-view", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Control", command: "focus-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Control", command: "focus-output", command_args: "previous",), - - // Standard program - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super", command: "spawn", command_args: "alacritty",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "q", mods: "Super+Shift", command: "exit", command_args: None,), - - // Screenshot - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Print", mods: "None", command: "spawn", command_args: "screenshot_persistent",), - - // Audio - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "XF86AudioRaiseVolume", mods: "None", command: "spawn", command_args: "pactl set-sink-volume 1 +5%",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioLowerVolume", mods: "None", command: "spawn", command_args: "pactl set-sink-volume 1 -5%",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioMute", mods: "None", command: "spawn", command_args: "mpc toggle",), - - // Launcher - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Super", command: "spawn", command_args: "rofi -show combi -modes combi -combi-modes 'window,drun,run' -show-icons",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F1", mods: "Super", command: "spawn", command_args: "neorg dmenu",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F2", mods: "Super", command: "spawn", command_args: "keepassxc",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F3", mods: "Super", command: "spawn", command_args: "signal-desktop",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F4", mods: "Super", command: "spawn", command_args: "steam",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Super", command: "spawn", command_args: "lock",), - - // Client - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "f", mods: "Super", command: "toggle-fullscreen", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "c", mods: "Super+Shift", command: "close", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "space", mods: "Super+Control", command: "toggle-float", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super+Control", command: "zoom", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "o", mods: "Super", command: "send-to-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Shift", command: "swap", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Shift", command: "swap", command_args: "previous",), - - // Toggle all tags - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super", command: "set-focused-tags", command_args: "4294967295"), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super+Shift", command: "set-view-tags", command_args: "4294967295"), - - // Mouse - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), - - ], - // Set these mappings for the tags 0-8 with key [1-9] - tags_number: 9, - tag_commands: [ - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super", command: "set-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift", command: "set-view-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), - ], -) - -// vim: nolinebreak nowrap textwidth=0 diff --git a/modules/home.legacy/wms/river/res/moonlander.ron b/modules/home.legacy/wms/river/res/moonlander.ron deleted file mode 100644 index 247c1697..00000000 --- a/modules/home.legacy/wms/river/res/moonlander.ron +++ /dev/null @@ -1,66 +0,0 @@ -#![enable(implicit_some)] -RiverctlCommandArray( - // TODO: add toggle-focus mapping - commands: [ - // Movement - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "A", mods: "Alt+Control+Super+Shift", command: "exit", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "B", mods: "Alt+Control+Super+Shift", command: "close", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "C", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "D", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "next",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "E", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "next",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "G", mods: "Alt+Control+Super+Shift", command: "zoom", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "H", mods: "Alt+Control+Super+Shift", command: "toggle-fullscreen", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "I", mods: "Alt+Control+Super+Shift", command: "toggle-float", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "J", mods: "Alt+Control+Super+Shift", command: "send-to-output", command_args: "next",), - - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "K", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "alacritty",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "screenshot_persistent",), - - // Audio - // RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "M", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "video-pause toggle",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "N", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "mpc toggle",), - - // Launcher - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "O", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "rofi -show combi -modes combi -combi-modes 'window,drun,run' -show-icons",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "P", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "neorg dmenu",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Q", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "keepassxc",), - // RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "nheko",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "S", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "signal-desktop",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "lock",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "U", mods: "Alt+Control+Super+Shift", command: "focus-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "V", mods: "Alt+Control+Super+Shift", command: "focus-previous-tags", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "W", mods: "Alt+Control+Super+Shift", command: "send-to-previous-tags",command_args: None,), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "X", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Y", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - - - // Toggle all tags - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Super+Shift", command: "set-focused-tags", command_args: "4294967295"), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Shift", command: "set-view-tags", command_args: "4294967295"), - - // Support Unicode input - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Z", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "qmk-unicode-type 106 65377",), - - // Mouse - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), - ], - - // Set these mappings for the tags 0-8 with key [1-9] - tags_number: 9, - tag_commands: [ - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Super+Shift", command: "set-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Shift", command: "set-view-tags",), - // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), - // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), - ], -) -// vim: nolinebreak nowrap textwidth=0 diff --git a/modules/home.legacy/wms/sway/default.nix b/modules/home.legacy/wms/sway/default.nix deleted file mode 100644 index bb3ddb49..00000000 --- a/modules/home.legacy/wms/sway/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -# also requires: -# security.polkit.enable = true; -{lib, ...}: { - wayland.windowManager.sway = { - enable = true; - config = { - modifier = "Mod4"; - # Use kitty as default terminal - terminal = "kitty"; - startup = [ - # Launch Firefox on start - {command = "firefox";} - ]; - }; - }; -} diff --git a/notes/backup_disk.md b/notes/backup_disk.md index 363bae11..d2e8f12e 100644 --- a/notes/backup_disk.md +++ b/notes/backup_disk.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # How to create a backup disk (for `soispha.services.backup`) ## Find the disk diff --git a/notes/beets_import.md b/notes/beets_import.md index fb9a9ff6..6725192e 100644 --- a/notes/beets_import.md +++ b/notes/beets_import.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # How to import an artist into beets 1. Download said artist (`deerix`) diff --git a/notes/git_crypt.md b/notes/git_crypt.md index b123a77b..8c42bb62 100644 --- a/notes/git_crypt.md +++ b/notes/git_crypt.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # What to do, when nix wants to build the locked repository Simply delete the source path: diff --git a/notes/gpg_keys.md b/notes/gpg_keys.md index 39602e3b..4a6fb5d1 100644 --- a/notes/gpg_keys.md +++ b/notes/gpg_keys.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # How to add a comment to gpg keys Export it as follows: @@ -11,38 +23,38 @@ or add it manually, the supported options include (RFC4880): - "Version", which states the OpenPGP implementation and version used to encode the message. -- "Comment", a user-defined comment. OpenPGP defines all text to - be in UTF-8. A comment may be any UTF-8 string. However, the +- "Comment", a user-defined comment. OpenPGP defines all text to + be in UTF-8. A comment may be any UTF-8 string. However, the whole point of armoring is to provide seven-bit-clean data. Consequently, if a comment has characters that are outside the US-ASCII range of UTF, they may very well not survive transport. -- "MessageID", a 32-character string of printable characters. The +- "MessageID", a 32-character string of printable characters. The string must be the same for all parts of a multi-part message - that uses the "PART X" Armor Header. MessageID strings should be + that uses the "PART X" Armor Header. MessageID strings should be unique enough that the recipient of the mail can associate all - the parts of a message with each other. A good checksum or + the parts of a message with each other. A good checksum or cryptographic hash function is sufficient. The MessageID SHOULD NOT appear unless it is in a multi-part - message. If it appears at all, it MUST be computed from the + message. If it appears at all, it MUST be computed from the finished (encrypted, signed, etc.) message in a deterministic - fashion, rather than contain a purely random value. This is to + fashion, rather than contain a purely random value. This is to allow the legitimate recipient to determine that the MessageID cannot serve as a covert means of leaking cryptographic key information. - "Hash", a comma-separated list of hash algorithms used in this - message. This is used only in cleartext signed messages. + message. This is used only in cleartext signed messages. - "Charset", a description of the character set that the plaintext - is in. Please note that OpenPGP defines text to be in UTF-8. An + is in. Please note that OpenPGP defines text to be in UTF-8. An implementation will get best results by translating into and out - of UTF-8. However, there are many instances where this is easier - said than done. Also, there are communities of users who have no + of UTF-8. However, there are many instances where this is easier + said than done. Also, there are communities of users who have no need for UTF-8 because they are all happy with a character set - like ISO Latin-5 or a Japanese character set. In such instances, + like ISO Latin-5 or a Japanese character set. In such instances, an implementation MAY override the UTF-8 default by using this - header key. An implementation MAY implement this key and any + header key. An implementation MAY implement this key and any translations it cares to; an implementation MAY ignore it and assume all text is UTF-8. diff --git a/notes/laptop.md b/notes/laptop.md index 38ae5a24..bc9ddc86 100644 --- a/notes/laptop.md +++ b/notes/laptop.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # backlight Run `ls /sys/class/backlight` to see possible options. diff --git a/notes/names.md b/notes/names.md index 44339580..6906d29e 100644 --- a/notes/names.md +++ b/notes/names.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # Naming scheme The hosts naming scheme follows two list of Mesopotamian (Babylonian) deities: diff --git a/notes/password.md b/notes/password.md index 96366bae..2717af48 100644 --- a/notes/password.md +++ b/notes/password.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # Password Run `nix run n#mkpasswd -- -m yescrypt -s -R 11` diff --git a/notes/wifi.md b/notes/wifi.md new file mode 100644 index 00000000..d27b11b4 --- /dev/null +++ b/notes/wifi.md @@ -0,0 +1,61 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + +# How to set-up “corporate” Wi-Fi with NetworkManager (`nmcli`) + +```bash +nmcli connection add \ +type wifi \ +connection.id "$name_you_want_to_use" \ +wifi.ssid "$actual_ssid" \ +wifi.mode infrastructure \ +wifi-sec.key-mgmt wpa-eap \ +802-1x.eap peap \ +802-1x.identity "$your_login_name" \ +802-1x.phase2-auth mschapv2 + +# Ask, so that `nmcli` can determine your password. +nmcli connection up "$name_you_want_to_use" --ask +``` + +## This will result in a configuration file, similar to this one: + +```ini +[connection] +id="$name_you_want_to_use" +uuid=aaaaaaaa-aaaa-aaaa-aaaa-deadbeef1245 +type=wifi +interface-name=wlo1 + +[wifi] +mode=infrastructure +ssid="$actual_ssid" + +[wifi-security] +key-mgmt=wpa-eap + +[802-1x] +ca-cert=/home/user_name/.local/share/nm/ca-cert.cer +domain-suffix-match=dnsx.topackt.net +eap=peap; +identity="$identity" +phase2-auth=mschapv2 + +[ipv4] +method=auto + +[ipv6] +addr-gen-mode=stable-privacy +method=auto + +[proxy] +``` diff --git a/pkgs/by-name/at/atuin-dvorak/package.nix b/pkgs/by-name/at/atuin-dvorak/package.nix index c651eb75..d3f92961 100644 --- a/pkgs/by-name/at/atuin-dvorak/package.nix +++ b/pkgs/by-name/at/atuin-dvorak/package.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {atuin}: atuin.overrideAttrs (finalAttrs: previousAttrs: { pname = previousAttrs.pname + "-dvorak"; diff --git a/pkgs/by-name/at/atuin-dvorak/set-dvorak-keybindings.patch.license b/pkgs/by-name/at/atuin-dvorak/set-dvorak-keybindings.patch.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/at/atuin-dvorak/set-dvorak-keybindings.patch.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/au/aumo/aumo.sh b/pkgs/by-name/au/aumo/aumo.sh index 84d39deb..dba5ef63 100755 --- a/pkgs/by-name/au/aumo/aumo.sh +++ b/pkgs/by-name/au/aumo/aumo.sh @@ -1,28 +1,73 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +NAME="aumo" + +error() { + printf "\033[1;91m==> ERROR:\033[0m \033[1;93m%s\033[0m\n" "$*" >&2 +} + +die() { + error "$1" + exit "${2-1}" +} + +usage() { + echo "Usage: $NAME mount|unmount" +} + +get_mounted_labels() { + findmnt --output label --json | jq '.filesystems | map(.label) | sort | unique | map(select(. != null))' +} +get_unmounted_labels() { + first=true + + find /dev/disk/by-label -printf "%P\n" | while read -r label; do + if ! get_mounted_labels | jq 'join("\n")' --raw-output | grep "$label" --quiet; then + if [ "$first" = "true" ]; then + first=false + else + printf "|" + fi + printf "%s" "$label" + fi + done +} unmounting() { - disk_name="$(find /dev/disk/by-label -type l -printf "%P|" | rofi -sep "|" -dmenu -p "Select disk to mount")" + disk_name="$(get_mounted_labels | jq 'join("|")' --join-output | rofi -sep "|" -dmenu -p "Select disk to unmount")" udisksctl unmount --block-device "/dev/disk/by-label/$disk_name" } mounting() { - disk_name="$(find /dev/disk/by-label -type l -printf "%P|" | rofi -sep "|" -dmenu -p "Select disk to mount")" + disk_name="$(get_unmounted_labels | rofi -sep "|" -dmenu -p "Select disk to mount")" udisksctl mount --block-device "/dev/disk/by-label/$disk_name" } -case "$1" in +case "${1-unset}" in "mount") mounting ;; "unmount" | "umount") unmounting ;; +"unset") + usage + die "You need to provide one argument." + ;; *) - die "Usage: $NAME mount|unmount" + usage + die "Unknown command: '$1'" ;; esac diff --git a/pkgs/by-name/au/aumo/package.nix b/pkgs/by-name/au/aumo/package.nix index 20054bb5..8132a15a 100644 --- a/pkgs/by-name/au/aumo/package.nix +++ b/pkgs/by-name/au/aumo/package.nix @@ -1,17 +1,32 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies udisks, findutils, rofi, + jq, + gnugrep, + util-linux, }: -sysLib.writeShellScript { +writeShellApplication { name = "aumo"; - src = ./aumo.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ + text = builtins.readFile ./aumo.sh; + inheritPath = false; + runtimeInputs = [ udisks findutils rofi + jq + gnugrep + util-linux # for findmnt ]; } diff --git a/pkgs/by-name/ba/battery/battery.sh b/pkgs/by-name/ba/battery/battery.sh index e650ba5d..5ccb303d 100755 --- a/pkgs/by-name/ba/battery/battery.sh +++ b/pkgs/by-name/ba/battery/battery.sh @@ -1,7 +1,14 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. capacity="$(cat /sys/class/power_supply/BAT0/capacity)" status="$(cat /sys/class/power_supply/BAT0/status)" diff --git a/pkgs/by-name/ba/battery/package.nix b/pkgs/by-name/ba/battery/package.nix index 9c0e194b..560ec59b 100644 --- a/pkgs/by-name/ba/battery/package.nix +++ b/pkgs/by-name/ba/battery/package.nix @@ -1,9 +1,20 @@ -{sysLib}: -sysLib.writeShellScript { +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + writeShellApplication, + # Dependencies + coreutils, +}: +writeShellApplication { name = "battery"; - src = ./battery.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ - ]; + text = builtins.readFile ./battery.sh; + inheritPath = false; + runtimeInputs = [coreutils]; } diff --git a/pkgs/by-name/be/beetsExtraPlugins/package.nix b/pkgs/by-name/be/beetsExtraPlugins/package.nix index 0da472fa..b310715b 100644 --- a/pkgs/by-name/be/beetsExtraPlugins/package.nix +++ b/pkgs/by-name/be/beetsExtraPlugins/package.nix @@ -1,3 +1,12 @@ -{pkgs, ...}: { - xtractor = pkgs.callPackage ./xtractor.nix {beets = pkgs.beetsPackages.beets-minimal;}; +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{...}: { + # xtractor = pkgs.callPackage ./xtractor.nix {beets = pkgs.beetsPackages.beets-minimal;}; } diff --git a/pkgs/by-name/be/beetsExtraPlugins/xtractor.nix b/pkgs/by-name/be/beetsExtraPlugins/xtractor.nix index 01c6207a..c6b942fd 100644 --- a/pkgs/by-name/be/beetsExtraPlugins/xtractor.nix +++ b/pkgs/by-name/be/beetsExtraPlugins/xtractor.nix @@ -1,54 +1,67 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, fetchFromGitHub, python3Packages, beets, -}: -# FIXME: Find a way to update this derivation <2024-08-11> -let - version = "0.4.2"; - models = builtins.fetchTarball { - url = "https://essentia.upf.edu/svm_models/essentia-extractor-svm_models-v2.1_beta5.tar.gz"; - sha256 = "11ps1l4h8bl4l9rlvkhjs61908l18dh7mpq65brm8ki99hnp9g64"; - }; -in - python3Packages.buildPythonApplication { - inherit version; - pname = "beets-xtractor"; - pyproject = true; +}: {} +# # NOTE: This fails to build now. It didn't work anyways. See +# https://git.sr.ht/~johnhamelink/nix/tree/master/item/home/hosts/sun/beets/beets-plugin-xtractor.nix +# for a possibly working version. <2025-03-29> +# # FIXME: Find a way to update this derivation <2024-08-11> +# let +# version = "0.4.2"; +# models = builtins.fetchTarball { +# url = "https://essentia.upf.edu/svm_models/essentia-extractor-svm_models-v2.1_beta5.tar.gz"; +# sha256 = "11ps1l4h8bl4l9rlvkhjs61908l18dh7mpq65brm8ki99hnp9g64"; +# }; +# in +# python3Packages.buildPythonApplication { +# inherit version; +# pname = "beets-xtractor"; +# pyproject = true; +# +# src = fetchFromGitHub { +# repo = "BeetsPluginXtractor"; +# owner = "adamjakab"; +# rev = "v${version}"; +# hash = "sha256-it4qQ2OS4qBEaGLJK8FVGpjlvg0MQICazV7TAM8lH9s="; +# }; +# +# nativeBuildInputs = [ +# beets +# python3Packages.setuptools +# ]; +# +# passthru = {inherit models;}; +# +# nativeCheckInputs = with python3Packages; [ +# pytestCheckHook +# pytest-cov +# mock +# typeguard +# ]; +# +# preCheck = '' +# export HOME="$(mktemp -d)" +# ''; +# postInstall = '' +# mkdir --parents $out/models +# cp ${models}/* $out/models +# ''; +# +# meta = { +# description = "Obtain low and high level musical information from your song"; +# homepage = "https://github.com/adamjakab/BeetsPluginXtractor/releasesfhhhhh"; +# license = lib.licenses.mit; +# }; +# } - src = fetchFromGitHub { - repo = "BeetsPluginXtractor"; - owner = "adamjakab"; - rev = "v${version}"; - hash = "sha256-it4qQ2OS4qBEaGLJK8FVGpjlvg0MQICazV7TAM8lH9s="; - }; - - nativeBuildInputs = [ - beets - python3Packages.setuptools - ]; - - passthru = {inherit models;}; - - nativeCheckInputs = with python3Packages; [ - pytestCheckHook - pytest-cov - mock - typeguard - ]; - - preCheck = '' - export HOME="$(mktemp -d)" - ''; - postInstall = '' - mkdir --parents $out/models - cp ${models}/* $out/models - ''; - - meta = { - description = "Obtain low and high level musical information from your song"; - homepage = "https://github.com/adamjakab/BeetsPluginXtractor/releasesfhhhhh"; - license = lib.licenses.mit; - }; - } diff --git a/pkgs/by-name/bl/blake3/add_cargo_lock.patch b/pkgs/by-name/bl/blake3/add_cargo_lock.patch deleted file mode 100644 index 19a5d1d0..00000000 --- a/pkgs/by-name/bl/blake3/add_cargo_lock.patch +++ /dev/null @@ -1,431 +0,0 @@ -From 45fd97400c01f39f841f84d43f1d28f8102cd927 Mon Sep 17 00:00:00 2001 -From: Benedikt Peetz <benedikt.peetz@b-peetz.de> -Date: Thu, 22 Aug 2024 11:25:24 +0200 -Subject: [PATCH] build(cargo.lock): Add - ---- - Cargo.lock | 412 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 412 insertions(+) - create mode 100644 Cargo.lock - -diff --git a/Cargo.lock b/Cargo.lock -new file mode 100644 -index 0000000..98b4b7a ---- /dev/null -+++ b/Cargo.lock -@@ -0,0 +1,412 @@ -+# This file is automatically @generated by Cargo. -+# It is not intended for manual editing. -+version = 3 -+ -+[[package]] -+name = "arrayref" -+version = "0.3.8" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" -+ -+[[package]] -+name = "arrayvec" -+version = "0.7.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -+ -+[[package]] -+name = "autocfg" -+version = "1.3.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -+ -+[[package]] -+name = "bitflags" -+version = "2.6.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -+ -+[[package]] -+name = "blake3" -+version = "0.4.1" -+dependencies = [ -+ "blake3 1.5.4", -+ "hex", -+ "pyo3", -+ "rayon", -+] -+ -+[[package]] -+name = "blake3" -+version = "1.5.4" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" -+dependencies = [ -+ "arrayref", -+ "arrayvec", -+ "cc", -+ "cfg-if", -+ "constant_time_eq", -+ "memmap2", -+ "rayon-core", -+] -+ -+[[package]] -+name = "cc" -+version = "1.1.13" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" -+dependencies = [ -+ "shlex", -+] -+ -+[[package]] -+name = "cfg-if" -+version = "1.0.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -+ -+[[package]] -+name = "constant_time_eq" -+version = "0.3.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" -+ -+[[package]] -+name = "crossbeam-deque" -+version = "0.8.5" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -+dependencies = [ -+ "crossbeam-epoch", -+ "crossbeam-utils", -+] -+ -+[[package]] -+name = "crossbeam-epoch" -+version = "0.9.18" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -+dependencies = [ -+ "crossbeam-utils", -+] -+ -+[[package]] -+name = "crossbeam-utils" -+version = "0.8.20" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" -+ -+[[package]] -+name = "either" -+version = "1.13.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -+ -+[[package]] -+name = "heck" -+version = "0.4.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -+ -+[[package]] -+name = "hex" -+version = "0.4.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -+ -+[[package]] -+name = "indoc" -+version = "2.0.5" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" -+ -+[[package]] -+name = "libc" -+version = "0.2.158" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -+ -+[[package]] -+name = "lock_api" -+version = "0.4.12" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -+dependencies = [ -+ "autocfg", -+ "scopeguard", -+] -+ -+[[package]] -+name = "memmap2" -+version = "0.9.4" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" -+dependencies = [ -+ "libc", -+] -+ -+[[package]] -+name = "memoffset" -+version = "0.9.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -+dependencies = [ -+ "autocfg", -+] -+ -+[[package]] -+name = "once_cell" -+version = "1.19.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -+ -+[[package]] -+name = "parking_lot" -+version = "0.12.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -+dependencies = [ -+ "lock_api", -+ "parking_lot_core", -+] -+ -+[[package]] -+name = "parking_lot_core" -+version = "0.9.10" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -+dependencies = [ -+ "cfg-if", -+ "libc", -+ "redox_syscall", -+ "smallvec", -+ "windows-targets", -+] -+ -+[[package]] -+name = "portable-atomic" -+version = "1.7.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" -+ -+[[package]] -+name = "proc-macro2" -+version = "1.0.86" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -+dependencies = [ -+ "unicode-ident", -+] -+ -+[[package]] -+name = "pyo3" -+version = "0.20.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" -+dependencies = [ -+ "cfg-if", -+ "indoc", -+ "libc", -+ "memoffset", -+ "parking_lot", -+ "portable-atomic", -+ "pyo3-build-config", -+ "pyo3-ffi", -+ "pyo3-macros", -+ "unindent", -+] -+ -+[[package]] -+name = "pyo3-build-config" -+version = "0.20.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" -+dependencies = [ -+ "once_cell", -+ "target-lexicon", -+] -+ -+[[package]] -+name = "pyo3-ffi" -+version = "0.20.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" -+dependencies = [ -+ "libc", -+ "pyo3-build-config", -+] -+ -+[[package]] -+name = "pyo3-macros" -+version = "0.20.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" -+dependencies = [ -+ "proc-macro2", -+ "pyo3-macros-backend", -+ "quote", -+ "syn", -+] -+ -+[[package]] -+name = "pyo3-macros-backend" -+version = "0.20.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" -+dependencies = [ -+ "heck", -+ "proc-macro2", -+ "pyo3-build-config", -+ "quote", -+ "syn", -+] -+ -+[[package]] -+name = "quote" -+version = "1.0.36" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -+dependencies = [ -+ "proc-macro2", -+] -+ -+[[package]] -+name = "rayon" -+version = "1.10.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -+dependencies = [ -+ "either", -+ "rayon-core", -+] -+ -+[[package]] -+name = "rayon-core" -+version = "1.12.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -+dependencies = [ -+ "crossbeam-deque", -+ "crossbeam-utils", -+] -+ -+[[package]] -+name = "redox_syscall" -+version = "0.5.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" -+dependencies = [ -+ "bitflags", -+] -+ -+[[package]] -+name = "scopeguard" -+version = "1.2.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -+ -+[[package]] -+name = "shlex" -+version = "1.3.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -+ -+[[package]] -+name = "smallvec" -+version = "1.13.2" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -+ -+[[package]] -+name = "syn" -+version = "2.0.75" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" -+dependencies = [ -+ "proc-macro2", -+ "quote", -+ "unicode-ident", -+] -+ -+[[package]] -+name = "target-lexicon" -+version = "0.12.16" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" -+ -+[[package]] -+name = "unicode-ident" -+version = "1.0.12" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -+ -+[[package]] -+name = "unindent" -+version = "0.2.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" -+ -+[[package]] -+name = "windows-targets" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -+dependencies = [ -+ "windows_aarch64_gnullvm", -+ "windows_aarch64_msvc", -+ "windows_i686_gnu", -+ "windows_i686_gnullvm", -+ "windows_i686_msvc", -+ "windows_x86_64_gnu", -+ "windows_x86_64_gnullvm", -+ "windows_x86_64_msvc", -+] -+ -+[[package]] -+name = "windows_aarch64_gnullvm" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -+ -+[[package]] -+name = "windows_aarch64_msvc" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -+ -+[[package]] -+name = "windows_i686_gnu" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -+ -+[[package]] -+name = "windows_i686_gnullvm" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -+ -+[[package]] -+name = "windows_i686_msvc" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -+ -+[[package]] -+name = "windows_x86_64_gnu" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -+ -+[[package]] -+name = "windows_x86_64_gnullvm" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -+ -+[[package]] -+name = "windows_x86_64_msvc" -+version = "0.52.6" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" --- -2.45.2 - diff --git a/pkgs/by-name/bl/blake3/package.nix b/pkgs/by-name/bl/blake3/package.nix deleted file mode 100644 index d465e856..00000000 --- a/pkgs/by-name/bl/blake3/package.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - python3Packages, - rustPlatform, - fetchFromGitHub, -}: -python3Packages.buildPythonPackage rec { - pname = "blake3"; - version = "0.4.1"; - - src = fetchFromGitHub { - owner = "oconnor663"; - repo = "blake3-py"; - rev = version; - hash = "sha256-Ju40ea8IQMOPg9BiN47BMmr/WU8HptbqqzVI+jNGpA8="; - }; - - patches = [ - ./add_cargo_lock.patch - ]; - - cargoDeps = rustPlatform.fetchCargoTarball { - inherit src patches; - hash = "sha256-GwyGSdmJTgsHWfcS2n2FCFrlwRcuANM8/WteYTTyY6o="; - }; - - format = "pyproject"; - - nativeBuildInputs = with rustPlatform; [cargoSetupHook maturinBuildHook]; -} diff --git a/pkgs/by-name/br/brightness/brightness.sh b/pkgs/by-name/br/brightness/brightness.sh index 887dbb1e..f38bb5a5 100755 --- a/pkgs/by-name/br/brightness/brightness.sh +++ b/pkgs/by-name/br/brightness/brightness.sh @@ -1,24 +1,33 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +die() { + echo "ERROR: $1" + exit 1 +} help() { cat <<EOF This is a system brightness manager USAGE: - $NAME up [VALUE] | down [VALUE] + $NAME set VALUE OPTIONS: --help | -h Output this help and exit. - --version | -v - Output the version and exit. - COMMANDS: - set [VALUE] + set VALUE Set the brightness to the specified percentage. ARGUMENTS: @@ -27,17 +36,14 @@ ARGUMENTS: EOF } -BACKLIGHT="/sys/class/backlight/%BACKLIGHT_NAME" +BACKLIGHT="/sys/class/backlight/$BACKLIGHT_NAME" brightness() { perc="$1" - max="$(cat $BACKLIGHT/max_brightness)" - + max="$(cat "$BACKLIGHT/max_brightness")" new="$(echo | awk --assign=perc="$perc" '{printf (perc / 100)}')" - output="$(echo | awk --assign=new="$new" --assign=max="$max" '{printf max * new}')" - echo "$output" >"$BACKLIGHT/brightness" } @@ -47,10 +53,6 @@ for arg in "$@"; do help exit 0 ;; - "--version" | "-v") - version - exit 0 - ;; esac done diff --git a/pkgs/by-name/br/brightness/package.nix b/pkgs/by-name/br/brightness/package.nix index c2e31a0c..f3797d43 100644 --- a/pkgs/by-name/br/brightness/package.nix +++ b/pkgs/by-name/br/brightness/package.nix @@ -1,14 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Arguments backlightName ? "intel_backlight", # nixosConfig.soispha.laptop.backlight + # Dependencies + gawk, + coreutils, }: -sysLib.writeShellScript { +writeShellApplication { name = "brightness"; - src = ./brightness.sh; - generateCompletions = true; - keepPath = false; + text = builtins.readFile ./brightness.sh; + inheritPath = false; - replacementStrings = {BACKLIGHT_NAME = backlightName;}; + runtimeEnv = {BACKLIGHT_NAME = backlightName;}; - dependencies = []; + runtimeInputs = [ + gawk + coreutils + ]; } diff --git a/pkgs/by-name/co/con2pdf/con2pdf.sh b/pkgs/by-name/co/con2pdf/con2pdf.sh index 27c9d092..ebe35ad3 100755 --- a/pkgs/by-name/co/con2pdf/con2pdf.sh +++ b/pkgs/by-name/co/con2pdf/con2pdf.sh @@ -1,19 +1,18 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# needed for help() and version -# shellcheck disable=2034 -AUTHORS="Soispha" -# shellcheck disable=2034 -YEARS="2023" -# shellcheck disable=2034 -VERSION="1.0.0" - -# NAME is from the wrapper -# shellcheck disable=SC2269 -NAME="$NAME" +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# TODO(@bpeetz): This should probably be rewritten in rust. <2025-04-14> + +NAME="con2pdf" help() { cat <<EOF Scan images and turn them into a pdf. @@ -52,7 +51,7 @@ ARGUMENTS: NUM | *([0-9]) := 0 | 1 | 2 | 3 | 4 Possible numbers of pages, can be more than 4 - DEVICE := [[$(cat %DEVICE_FUNCTION)]] + DEVICE := [[$(cat "$DEVICE_FUNCTION")]] Possible scanner names METHOD := ADF | Flatbed diff --git a/pkgs/by-name/co/con2pdf/package.nix b/pkgs/by-name/co/con2pdf/package.nix index 8eb994fd..11d45ab5 100644 --- a/pkgs/by-name/co/con2pdf/package.nix +++ b/pkgs/by-name/co/con2pdf/package.nix @@ -1,24 +1,34 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, writeText, - # dependencies + # Dependencies sane-backends, imagemagick, coreutils, fd, }: -sysLib.writeShellScript { +writeShellApplication { name = "con2pdf"; - src = ./con2pdf.sh; - generateCompletions = true; - keepPath = false; - dependencies = [ + text = builtins.readFile ./con2pdf.sh; + inheritPath = false; + + runtimeInputs = [ sane-backends imagemagick coreutils fd ]; - replacementStrings = { + + runtimeEnv = { DEVICE_FUNCTION = # This is here, because escaping the whole function, to use it in the shell script # directly just isn't possible diff --git a/pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch.license b/pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/ct/ctpv-64-types/package.nix b/pkgs/by-name/ct/ctpv-64-types/package.nix index 763b0325..087e1d28 100644 --- a/pkgs/by-name/ct/ctpv-64-types/package.nix +++ b/pkgs/by-name/ct/ctpv-64-types/package.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {ctpv}: ctpv.overrideAttrs (finalAttrs: previousAttrs: { pname = previousAttrs.pname + "-64-types"; diff --git a/pkgs/by-name/fd/fd_list/fd_list.sh b/pkgs/by-name/fd/fd_list/fd_list.sh new file mode 100755 index 00000000..568d73c8 --- /dev/null +++ b/pkgs/by-name/fd/fd_list/fd_list.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# Lists all fds in use with their respective associated programs. +# This can be useful, if you need to debug, why your system is out of fds. + +# This script is not POSIX shell compatible, as the `ulimit` flags `-H` and `-n` are not defined by POSIX (thus we use `bash` instead). + +find /proc/ -maxdepth 1 | while read -r path; do + pid="${path#/proc/}" + fd_dir="$path/fd/" + + [ -d "$fd_dir" ] && echo "PID = $pid with $(find "$fd_dir" | wc -l) file descriptors" +done | sort -rn -k5 | head | while read -r _ _ pid _ fdcount _; do + command_execution="$(ps -o cmd -p "$pid" -h)" + + command_arguments="$(echo "$command_execution" | awk '{$1=""; print $0}')" + command_name="$(basename "$(echo "$command_execution" | awk '{print $1}')")" + + command="$command_name$command_arguments" + + printf "PID %8d with %4d file descriptors: %s\n" "$pid" "$fdcount" "$command" +done || true +# ^ Ignore SIGPIPE + +printf "\nThe Kernel has %7d file handles allocated.\n" "$(awk '{print $1}' /proc/sys/fs/file-nr)" +printf " -> The per-process fd maxium is: %d\n" "$(ulimit -Hn)" +printf " -> The per-process fd soft-maximum is: %d\n" "$(ulimit -n)" +printf " -> The global fd maximum is: %d\n" "$(cat /proc/sys/fs/file-max)" + +# vim: ft=sh diff --git a/pkgs/by-name/fd/fd_list/package.nix b/pkgs/by-name/fd/fd_list/package.nix new file mode 100644 index 00000000..34129b10 --- /dev/null +++ b/pkgs/by-name/fd/fd_list/package.nix @@ -0,0 +1,28 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + writeShellApplication, + findutils, + gawk, + coreutils, + procps, +}: +writeShellApplication { + name = "fd_list"; + text = builtins.readFile ./fd_list.sh; + + inheritPath = false; + runtimeInputs = [ + findutils + gawk + coreutils + procps + ]; +} diff --git a/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh b/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh new file mode 100755 index 00000000..5b8d9469 --- /dev/null +++ b/pkgs/by-name/fu/fupdate-flake/fupdate-flake.sh @@ -0,0 +1,194 @@ +#! /usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +UPDATE_SCRIPT_NAME="update.sh" + +info() { + echo "Info: $1" +} +dbg() { + if [ "${DEBUG_ENABLE-unset}" != "unset" ]; then + echo "Debug: $1" >&2 + fi +} +die() { + echo "Error: $1" + exit 1 +} + +# Search for a file “upwards”. +# This will return the relative path from "$1" to the found file. +# +# # Type +# upfind :: Path -> String -> Path +# +# # Arguments +# $1 +# : The directory to use as start of your search. +# +# $2 +# : The file to search for. +# +# # Example +# upfind "/home/user1" "/usr" +# => /usr +upfind() { + starting_directory="$(readlink --canonicalize "$1")" + search_string="$2" + + current_directory="$starting_directory" + + while + search_result=$(fd "$search_string" "$current_directory/" --max-depth 1) + dbg "upfind - search in $current_directory gives: $search_result" + [ -z "$search_result" ] && [ "$current_directory" != "/" ] + do current_directory=$(dirname "$current_directory"); done + + realpath --relative-to="$1" "$search_result" +} + +# Construct the storage path for the update script allowed hashes. +# +# # Type +# get_storage_path :: Path -> Path +# +# # Arguments +# $1 +# : The path to the update script +# +# # Returns +# The constructed storage path. +get_storage_path() { + update_script="$(realpath "$1")" + + storage_path="$XDG_DATA_HOME/fupdate-flake/$update_script" + echo "$storage_path" +} + +# Checks if a given path to the update script is allowed. +# +# # Type +# is_allowed :: Path -> bool +# +# # Arguments +# $1 +# : The path to the update script to check. +# +# # Return exit code +# 0 +# : If the update script is allowed +# +# 1 +# : If it is not. +is_allowed() { + update_script="$(realpath "$1")" + + storage_path="$(get_storage_path "$update_script")" + + # Use this invocation, to also include the path to the `$update_script` + update_script_hash="$(sha256sum "$update_script")" + + if [ -f "$storage_path" ]; then + if [ "$(cat "$storage_path")" = "$update_script_hash" ]; then + return 0 + else + return 1 + fi + else + return 1 + fi +} + +# Asks the user if they want to allow a given script. +# +# # Type +# ask_to_allow_update_script :: Path +# +# # Arguments +# $1 +# : The path to the update script to ask for. +ask_to_allow_update_script() { + update_script="$(realpath "$1")" + + printf "\033[2J" # clear the screen + cat "$update_script" + + printf "Do you want to allow this script?[N/y]: " + read -r allow + + case "$allow" in + [yY]) + info "Update script allowed." + + storage_path="$(get_storage_path "$update_script")" + update_script_hash="$(sha256sum "$update_script")" + + mkdir --parents "$(dirname "$storage_path")" + printf "%s" "$update_script_hash" >"$storage_path" + ;; + *) + info "Update script not allowed." + ;; + esac +} + +# Performs a full update. +# This consists of running an update script. +# Additionally, it also checks for duplicated inputs in a `flake.lock` file, if it exists. +# +# # Type +# update :: Path -> Path -> [String] +# +# # Arguments +# $1 +# : The path to the update script to execute. +# +# $2 +# : The base directory from which to start the update. +# +# $3 +# : Arguments to pass to the update script. +update() { + update_script="$1" + base_directory="$2" + shift 2 + + cd "$base_directory" || die "The provided base directory '$base_directory' cannot be accessed" + dbg "Changed directory to: $base_directory" + + dbg "Executing update script ('$update_script') following args: '$*'" + "$update_script" "$@" + + if [ -f "flake.lock" ] && grep '[^0-9]_[0-9]' flake.lock --quiet; then + batgrep '[^0-9]_[0-9]' flake.lock + die "Your flake.nix contains duplicate inputs!" + fi +} + +main() { + base_directory="$(git rev-parse --show-toplevel)" + update_script="$(upfind "$PWD" "$UPDATE_SCRIPT_NAME")" + dbg "update_script is: $update_script" + + if [ "$update_script" = "" ]; then + die "Failed to find update script." + elif is_allowed "$update_script"; then + update "$update_script" "$base_directory" "$@" + else + ask_to_allow_update_script "$update_script" + is_allowed "$update_script" && main "$@" + fi +} + +main "$@" + +# vim: ft=sh diff --git a/pkgs/by-name/fu/fupdate-flake/package.nix b/pkgs/by-name/fu/fupdate-flake/package.nix new file mode 100644 index 00000000..c8646f26 --- /dev/null +++ b/pkgs/by-name/fu/fupdate-flake/package.nix @@ -0,0 +1,37 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + writeShellApplication, + # Dependencies + coreutils, + fd, + gnugrep, + bat-extras, # For `batgrep` + bat, # used by batgrep + gnused, # required by batgrep + git, +}: +writeShellApplication { + name = "fupdate-flake"; + text = builtins.readFile ./fupdate-flake.sh; + + # The `update.sh` script might actually want to keep the path. + inheritPath = true; + + runtimeInputs = [ + coreutils + fd + gnugrep + bat-extras.batgrep + bat # Used by `batgrep` + gnused # Required by `batgrep` + git + ]; +} diff --git a/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh b/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh new file mode 100755 index 00000000..4ec3e9e8 --- /dev/null +++ b/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# FIXME(@bpeetz): Ideally I could replace this script with a deployment tool. Thus we +# would have the same tool on the server as I use in my config. <2025-04-14> + +# Shell library {{{ +die() { + error "$1" + if [ -n "$2" ]; then + exit "$2" + else + exit 1 + fi +} +print() { + # shellcheck disable=SC2059 + printf "$*" +} +println() { + # shellcheck disable=SC2059 + printf "$*\n" +} +eprint() { + >&2 print "$@" +} +eprintln() { + >&2 println "$@" +} +if [ "${NO_COLOR-unset}" != "unset" ]; then + error() { + eprintln "==> ERROR:" "$*" + } + warning() { + eprintln "==> WARNING:" "$*" + } + debug() { + [ -n "$SHELL_LIBRARY_DEBUG" ] && eprintln "==> [Debug:]" "$*" + } + debug2() { + [ -n "$SHELL_LIBRARY_DEBUG" ] && eprintln " -> [Debug:]" "$*" + } + msg() { + eprintln "==>" "$*" + } + msg2() { + eprintln " ->" "$*" + } + prompt() { + eprint "..>" "$*" + } +else + error() { + eprintln "\033[1;91m==> ERROR:\033[0m" "\033[1;93m$*\033[0m" + } + warning() { + eprintln "\033[1;91m==> WARNING:\033[0m" "\033[1;93m$*\033[0m" + } + debug() { + [ -n "$SHELL_LIBRARY_DEBUG" ] && eprintln "\033[1;94m==> [Debug:]\033[0m" "\033[1;93m$*\033[0m" + } + debug2() { + [ -n "$SHELL_LIBRARY_DEBUG" ] && eprintln "\033[1;94m -> [Debug:]\033[0m" "\033[1;93m$*\033[0m" + } + msg() { + eprintln "\033[1;96m==>\033[0m" "\033[1;93m$*\033[0m" + } + msg2() { + eprintln "\033[1;96m ->\033[0m" "\033[1;93m$*\033[0m" + } + prompt() { + eprint "\033[1;96m..>\033[0m" "\033[1;93m$*\033[0m" + } +fi +# }}} + +NAME="update-sys" +help() { + cat <<EOF +This is a NixOS System flake update manager. + +USAGE: + $NAME [--branch <branchname>] [--help] + +OPTIONS: + --branch | -b BRANCHNAME + select a branch to update from. + + --mode | -m MODE + select a mode to update with + + --help | -h + output this help. +ARGUMENTS: + BRANCHNAME := [[ git branch --list --format '%(refname:short)' ]] + The name of the branch to deploy the config from + + MODE := switch|boot|test|build|dry-build|dry-activate|edit|repl|build-vm|build-vm-with-bootloader + See the 'nixos-rebuild' manpage for more information about these modes. +EOF + exit "$1" +} +BRANCH="" + +while [ "$#" -gt 0 ]; do + case "$1" in + "--help" | "-h") + help 0 + ;; + "--branch" | "-b") + if [ "${2-unset}" != "unset" ]; then + BRANCH="$2" + else + error "$1 requires an argument" + help 1 + fi + shift 2 + ;; + "--mode" | "-m") + if [ "${2-unset}" != "unset" ]; then + MODE="$2" + else + error "$1 requires an argument" + help 1 + fi + shift 2 + ;; + *) + error "the option $1 does not exist!" + help 1 + ;; + esac +done + +cd /etc/nixos || die "No /etc/nixos" +msg "Starting system update..." +git remote update origin --prune >/dev/null 2>&1 +if ! [ "$BRANCH" = "" ]; then + git switch "$BRANCH" >/dev/null 2>&1 && msg2 "Switched to branch '$BRANCH'" +fi +msg2 "Updating git repository..." +git pull --rebase + +# We use a tempfile, to make this truly async. +default_branch=$(mktemp) +cleanup() { + rm "$default_branch" +} +trap cleanup EXIT + +git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' >"$default_branch" & + +msg2 "Updating system..." +nixos-rebuild "${MODE-switch}" + +git switch "$(cat "$default_branch")" >/dev/null 2>&1 && msg2 "Switched to branch '$(cat "$default_branch")'" +msg "Finished Update!" + +# vim: ft=sh diff --git a/pkgs/by-name/fu/fupdate-sys/package.nix b/pkgs/by-name/fu/fupdate-sys/package.nix new file mode 100644 index 00000000..7fd4674b --- /dev/null +++ b/pkgs/by-name/fu/fupdate-sys/package.nix @@ -0,0 +1,38 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + writeShellApplication, + # Dependencies + git, + nixos-rebuild, + sudo, + openssh, + coreutils, + mktemp, + gnugrep, + gnused, + systemd, +}: +writeShellApplication { + name = "fupdate-sys"; + text = builtins.readFile ./fupdate-sys.sh; + inheritPath = false; + runtimeInputs = [ + git + nixos-rebuild + sudo + openssh + coreutils + mktemp + gnugrep + gnused + systemd + ]; +} diff --git a/pkgs/by-name/fu/fupdate/.envrc b/pkgs/by-name/fu/fupdate/.envrc new file mode 100644 index 00000000..294de504 --- /dev/null +++ b/pkgs/by-name/fu/fupdate/.envrc @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use flake diff --git a/pkgs/by-name/fu/fupdate/.gitignore b/pkgs/by-name/fu/fupdate/.gitignore new file mode 100644 index 00000000..f255eebd --- /dev/null +++ b/pkgs/by-name/fu/fupdate/.gitignore @@ -0,0 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +/target +.direnv diff --git a/pkgs/by-name/fu/fupdate/Cargo.lock b/pkgs/by-name/fu/fupdate/Cargo.lock new file mode 100644 index 00000000..d2d07c28 --- /dev/null +++ b/pkgs/by-name/fu/fupdate/Cargo.lock @@ -0,0 +1,310 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +version = 4 + +[[package]] +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "clap" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_complete" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aad5b1b4de04fead402672b48897030eec1f3bfe1550776322f59f6d6e6a5677" +dependencies = [ + "clap", + "clap_lex", + "is_executable", + "shlex", +] + +[[package]] +name = "clap_derive" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "fupdate" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "clap_complete", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_executable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a1b5bad6f9072935961dfbf1cced2f3d129963d091b6f69f007fe04e758ae2" +dependencies = [ + "winapi", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/pkgs/by-name/fu/fupdate/Cargo.toml b/pkgs/by-name/fu/fupdate/Cargo.toml new file mode 100644 index 00000000..3acd3bca --- /dev/null +++ b/pkgs/by-name/fu/fupdate/Cargo.toml @@ -0,0 +1,81 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +[package] +name = "fupdate" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1.0.98" +clap = { version = "4.5.40", features = ["derive"] } +clap_complete = { version = "4.5.54", features = ["unstable-dynamic"] } + +[profile.release] +lto = true +codegen-units = 1 +panic = "abort" +split-debuginfo = "off" + +[lints.rust] +# rustc lint groups https://doc.rust-lang.org/rustc/lints/groups.html +warnings = "warn" +future_incompatible = { level = "warn", priority = -1 } +let_underscore = { level = "warn", priority = -1 } +nonstandard_style = { level = "warn", priority = -1 } +rust_2018_compatibility = { level = "warn", priority = -1 } +rust_2018_idioms = { level = "warn", priority = -1 } +rust_2021_compatibility = { level = "warn", priority = -1 } +unused = { level = "warn", priority = -1 } +# rustc allowed-by-default lints https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html +# missing_docs = "warn" +macro_use_extern_crate = "warn" +meta_variable_misuse = "warn" +missing_abi = "warn" +missing_copy_implementations = "warn" +missing_debug_implementations = "warn" +non_ascii_idents = "warn" +noop_method_call = "warn" +single_use_lifetimes = "warn" +trivial_casts = "warn" +trivial_numeric_casts = "warn" +unreachable_pub = "warn" +unsafe_op_in_unsafe_fn = "warn" +unused_crate_dependencies = "warn" +unused_import_braces = "warn" +unused_lifetimes = "warn" +unused_qualifications = "warn" +variant_size_differences = "warn" + +[lints.rustdoc] +# rustdoc lints https://doc.rust-lang.org/rustdoc/lints.html +broken_intra_doc_links = "warn" +private_intra_doc_links = "warn" +missing_crate_level_docs = "warn" +private_doc_tests = "warn" +invalid_codeblock_attributes = "warn" +invalid_rust_codeblocks = "warn" +bare_urls = "warn" + +[lints.clippy] +# clippy allowed by default +dbg_macro = "warn" +# clippy categories https://doc.rust-lang.org/clippy/ +all = { level = "warn", priority = -1 } +correctness = { level = "warn", priority = -1 } +suspicious = { level = "warn", priority = -1 } +style = { level = "warn", priority = -1 } +complexity = { level = "warn", priority = -1 } +perf = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } +missing_panics_doc = "allow" +missing_errors_doc = "allow" diff --git a/pkgs/by-name/fu/fupdate/flake.lock b/pkgs/by-name/fu/fupdate/flake.lock new file mode 100644 index 00000000..a267d6fb --- /dev/null +++ b/pkgs/by-name/fu/fupdate/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1750731501, + "narHash": "sha256-Ah4qq+SbwMaGkuXCibyg+Fwn00el4KmI3XFX6htfDuk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "69dfebb3d175bde602f612915c5576a41b18486b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/by-name/fu/fupdate/flake.lock.license b/pkgs/by-name/fu/fupdate/flake.lock.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/fu/fupdate/flake.lock.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/fu/fupdate/flake.nix b/pkgs/by-name/fu/fupdate/flake.nix new file mode 100644 index 00000000..0ebceece --- /dev/null +++ b/pkgs/by-name/fu/fupdate/flake.nix @@ -0,0 +1,34 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + description = "This is a Nix flake update manager."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = {nixpkgs, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages."${system}"; + in { + devShells."${system}".default = pkgs.mkShell { + packages = with pkgs; [ + cargo + clippy + rustc + rustfmt + + cargo-edit + ]; + }; + }; +} +# vim: ts=2 + diff --git a/pkgs/by-name/fu/fupdate/fupdate.1.md b/pkgs/by-name/fu/fupdate/fupdate.1.md deleted file mode 100644 index 710e8fb7..00000000 --- a/pkgs/by-name/fu/fupdate/fupdate.1.md +++ /dev/null @@ -1,70 +0,0 @@ -% FUPDATE(1) fupdate 1.0.0 -% Soispha -% May 2023 - -# NAME - -fupdate - updates your flake, while checking for common mistakes - -# SYNOPSIS - -**fupdate** list of \[*flake*|*\<some word>*|*--help*|*-h*\] - -# DESCRIPTION - -Argument can be stacked, this makes it possible to specify multiple targets to be updated in succession. See the Examples section for further details. - -No argument or *flake* -: **fupdate**, when executed without arguments or with *flake*, will update your *flake.lock*, check for duplicate flake inputs, i.e., an input has an input declared, which you have also declared as input, and will run a script called *update.sh*, if you allow it. -The allowance for the script is asked, when you run **fupdate** and the found script is not yet allowed. Furthermore, the allowance is based on the concrete sha256 hash of the script, so any changes will require another allowance. - -**\<some word>** as argument -: If the executable **update-\<some word>** is reachable thought the PATH variable, than this is run. Otherwise, the program will exit. - -# OPTIONS - -**--help**, **-h** -: Displays a help message and exit. - -**--version**, **-v** -: Displays the software version and exit. - -# EXAMPLES - -**fupdate** or **fupdate flake** -: Updates your *flake.lock*. See the Description section for further details. - -**fupdate sys** -: Run the executable **update-sys**, if it exists. See the Description section for further details. - -**fupdate flake sys docs** -: First updates your flake, then, if the command succeeded, runs **update-sys**, afterweich **update-docs** is run. - -# FILES - -*update.sh* -: This is supposed to be a shell script located in your flake base directory, i.e., the directory which contains both a *flake.nix* and a *flake.lock* file. - -*~/.local/share/flake-update/* -: **fupdate** will store the hashes to the allowed *update.sh* files here. - -# BUGS - -Report bugs to <https://codeberg.org/soispha/flake_update/issues>. - -# COPYRIGHT - -Copyright (C) 2023 Soispha - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. diff --git a/pkgs/by-name/fu/fupdate/fupdate.sh b/pkgs/by-name/fu/fupdate/fupdate.sh deleted file mode 100755 index 4322610a..00000000 --- a/pkgs/by-name/fu/fupdate/fupdate.sh +++ /dev/null @@ -1,197 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -UPDATE_SCRIPT_NAME="update.sh" -CONFIG_DIRECTORY_PATH="$HOME/.local/share/flake-update" - -# Both are used in version() -# shellcheck disable=SC2034 -AUTHORS="Soispha" -# shellcheck disable=SC2034 -YEARS="2023" - -UPDATE_SCRIPT_NOT_WANTED=false - -# Searches upward for a `UPDATE_SCRIPT_NAME` script -# Returns a path to the script if it exists, otherwise nothing is returned -check_for_update_script() { - dirname="$(search_upward_files "$UPDATE_SCRIPT_NAME")" - if [ "$dirname" ]; then - printf "%s/%s" "$dirname" "$UPDATE_SCRIPT_NAME" - fi -} - -# Checks if a given path to the update script is allowed. -# Takes the path as input -# Return 0, if allowed, 1 if not. -check_for_allowed_update_script() { - update_script="$1" - config_path="${CONFIG_DIRECTORY_PATH}${update_script}" - update_script_hash="$(sha256sum "$update_script")" - if [ -f "$config_path" ]; then - if [ "$(cat "$config_path")" = "$update_script_hash" ]; then - dbg "Recorded hash matches" - return 0 - else - dbg "Recorded hash \'$(cat "$config_path")\' does not match real hash \'$update_script_hash\', assuming not allowed" - return 1 - fi - else - dbg "Path \'$config_path\' does not exist, assuming not allowed" - return 1 - fi -} - -# Asks the user if they want to allow a given script. -# Takes the path as input -ask_to_allow_update_script() { - update_script="$1" - config_path="${CONFIG_DIRECTORY_PATH}${update_script}" - update_script_hash="$(sha256sum "$update_script")" - println "\033[2J" # clear the screen - cat "$update_script" - readp "Do you want to allow this script?[N/y]: " allow - # shellcheck disable=SC2154 - dbg "allow is: $allow" - case "$allow" in - [yY]) - dbg "allowed script" - dbg "storing contents in: $config_path" - mkdir --parents "$(dirname "$config_path")" - print "$update_script_hash" >"$config_path" - ;; - *) - UPDATE_SCRIPT_NOT_ALLOWED=true - ;; - esac -} - -# Runs the provided script and continues to update the nix flake -# Takes the path to the script and the directory to the flake as arguments -# If the path to the update script is empty, it will be ignored -update() { - update_script="$1" - flake_base_dir="$2" - shift 2 - dbg "Provided following args to update script: '$*'" - - cd "$flake_base_dir" || die "Provided dir \'$flake_base_dir\' can not be accessed" - dbg "changed directory to: $flake_base_dir" - - nix flake update - - if ! [ "$update_script" = "" ] && ! [ "$UPDATE_SCRIPT_NOT_WANTED" = "true" ]; then - "$update_script" "$@" - fi - - if grep '[^0-9]_[0-9]' flake.lock >/dev/null; then - batgrep '[^0-9]_[0-9]' flake.lock - die "Your flake.nix contains duplicate inputs!" - fi -} - -help() { - cat <<EOF -This is a Nix flake update manager. - -USAGE: - $NAME [--help | --version] [flake [--no-script] | <some other command>] - -OPTIONS: - --help | -h - Display this help and exit. - - --version | -v - Display version and copyright information and exit. - - --no-script - Avoid running the 'update.sh' script -COMMANDS: - flake - update the flake project - - <some other command> - runs a executable called "update-<some other command>", if it exists -EOF -} - -main() { - if ! [ "$UPDATE_SCRIPT_NOT_ALLOWED" = true ]; then - update_script="$(check_for_update_script)" - flake_base_dir="$(search_flake_base_dir)" # Assume, that the update script is in the base dir - dbg "update_script is: $update_script" - dbg "flake_base_dir is: $flake_base_dir" - - if [ "$update_script" = "" ]; then - update "" "$flake_base_dir" "$@" - elif check_for_allowed_update_script "$update_script" && ! [ "$update_script" = "" ]; then - update "$update_script" "$flake_base_dir" "$@" - else - ask_to_allow_update_script "$update_script" - main "$@" - fi - fi -} - -if [ "$#" -eq 0 ]; then - main - exit 0 -fi - -for input in "$@"; do - case "$input" in - "--help" | "-h") - help - exit 0 - ;; - "--version" | "-v") - version - exit 0 - ;; - "--no-script" | "-n") - UPDATE_SCRIPT_NOT_WANTED=true - ;; - "--") - end_of_cli_options=true - - # Stop processing args after that marker. - break - ;; - esac - [ "$end_of_cli_options" = "true" ] && break -done - -case "$1" in -"flake") - shift 1 - - # Filter out fupdate specific flags - while [ "$1" != "--" ]; do - # FIXME: This check allows to add a flag multiple times, but this should probably - # not be allowed <2024-03-29> - case "$1" in - "--no-script" | "-n") - shift 1 - ;; - *) - break - ;; - esac - done - - [ "$1" = "--" ] && shift 1 - main "$@" - ;; -*) - command="$1" - shift 1 - [ "$1" = "--" ] && shift 1 - if which update-"$command" >/dev/null 2>&1; then - update-"$command" "$@" - else - die "command \"update-$command\" is not executable, or does not exist" - fi - ;; -esac diff --git a/pkgs/by-name/fu/fupdate/package.nix b/pkgs/by-name/fu/fupdate/package.nix index 66372add..86eccaf7 100644 --- a/pkgs/by-name/fu/fupdate/package.nix +++ b/pkgs/by-name/fu/fupdate/package.nix @@ -1,29 +1,41 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, - dash, - lix, - gnugrep, - fd, - coreutils, - bat, # used by batgrep - bat-extras, - gnused, # required by batgrep - git, # needed to fetch through git + rustPlatform, + installShellFiles, + makeWrapper, }: -sysLib.writeShellScript { - name = "fupdate"; - src = ./fupdate.sh; - generateCompletions = true; - keepPath = true; - dependencies = [ - dash - lix - gnugrep - fd - coreutils - bat # used by batgrep - bat-extras.batgrep - gnused # required by batgrep - git # needed to fetch through git +rustPlatform.buildRustPackage (finalAttrs: { + pname = "fupdate"; + version = "0.1.0"; + + src = ./.; + cargoLock = { + lockFile = ./Cargo.lock; + }; + + buildInputs = []; + + nativeBuildInputs = [ + installShellFiles + makeWrapper ]; -} + + postInstall = '' + installShellCompletion --cmd fupdate \ + --bash <(COMPLETE=bash $out/bin/fupdate) \ + --fish <(COMPLETE=fish $out/bin/fupdate) \ + --zsh <(COMPLETE=zsh $out/bin/fupdate) + ''; + + meta = { + mainProgram = "fupdate"; + }; +}) diff --git a/pkgs/by-name/fu/fupdate/src/cli.rs b/pkgs/by-name/fu/fupdate/src/cli.rs new file mode 100644 index 00000000..6ebd1bc4 --- /dev/null +++ b/pkgs/by-name/fu/fupdate/src/cli.rs @@ -0,0 +1,56 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{env, ffi::OsStr, fs::read_dir}; + +use clap::Parser; +use clap_complete::{engine::ArgValueCompleter, CompletionCandidate}; + +/// This is a Nix flake update manager. +#[derive(Parser, Debug)] +#[command(author, version, about)] +pub struct CliArgs { + /// The command to execute. + #[arg(add = ArgValueCompleter::new(get_fupdate_commands))] + pub command: Vec<String>, +} + +fn get_fupdate_commands(current: &OsStr) -> Vec<CompletionCandidate> { + let mut output = vec![]; + let path = env::var("PATH").unwrap_or_default(); + + let Some(current) = current.to_str() else { + return output; + }; + + for directory in path.split(':') { + if let Ok(mut read) = read_dir(directory) { + for value in read.by_ref().flatten() { + let file_name = value.file_name(); + let name = file_name.to_string_lossy(); + let Some(stripped) = name.strip_prefix("fupdate-") else { + continue; + }; + + if stripped.starts_with(current) { + output.push(CompletionCandidate::new( + value + .file_name() + .to_string_lossy() + .strip_prefix("fupdate-") + .expect("Exists"), + )); + } + } + } + } + + output +} diff --git a/pkgs/by-name/fu/fupdate/src/main.rs b/pkgs/by-name/fu/fupdate/src/main.rs new file mode 100644 index 00000000..b4af6cd6 --- /dev/null +++ b/pkgs/by-name/fu/fupdate/src/main.rs @@ -0,0 +1,57 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::process::Command; + +use anyhow::{bail, Context, Result}; +use clap::{CommandFactory, Parser}; + +pub mod cli; + +use crate::cli::CliArgs; + +fn main() -> Result<(), anyhow::Error> { + clap_complete::CompleteEnv::with_factory(CliArgs::command).complete(); + + let args = CliArgs::parse(); + + let command = args.command.first().map_or("flake", String::as_str); + + { + let args = if args.command.len() > 1 { + &args.command[1..] + } else { + &[] + }; + + // println!("Running: `fupdate-{command} {}`", args.join(" ")); + + let child = Command::new(format!("fupdate-{command}")) + .args(args) + .status() + .with_context(|| format!("Failed to spawn `fupdate-{command}`"))?; + + if !child.success() { + bail!("Command `fupdate-{command} {}` failed!", args.join(" ")); + } + } + + Ok(()) +} + +#[cfg(test)] +mod test { + use clap::CommandFactory; + + #[test] + fn verify_cli() { + super::CliArgs::command().debug_assert(); + } +} diff --git a/pkgs/by-name/fu/fupdate/update.sh b/pkgs/by-name/fu/fupdate/update.sh new file mode 100755 index 00000000..8e36e13e --- /dev/null +++ b/pkgs/by-name/fu/fupdate/update.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +[ "$1" = "upgrade" ] && cargo upgrade +cargo update diff --git a/pkgs/by-name/ge/generate_moz_extension/.envrc b/pkgs/by-name/ge/generate_moz_extension/.envrc deleted file mode 100644 index 2f9f1a81..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/.envrc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -use flake diff --git a/pkgs/by-name/ge/generate_moz_extension/.gitignore b/pkgs/by-name/ge/generate_moz_extension/.gitignore deleted file mode 100644 index f717ddd7..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target -/result -.direnv diff --git a/pkgs/by-name/ge/generate_moz_extension/Cargo.toml b/pkgs/by-name/ge/generate_moz_extension/Cargo.toml deleted file mode 100644 index 876f4943..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "generate_extensions" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -anyhow = "1.0.95" -futures = "0.3.31" -reqwest = "0.12.12" -serde = { version = "1.0.217", features = ["derive"] } -serde_json = "1.0.138" -tokio = { version = "1.43.0", features = ["macros", "rt-multi-thread"] } diff --git a/pkgs/by-name/ge/generate_moz_extension/examples/generate_extensions.sh b/pkgs/by-name/ge/generate_moz_extension/examples/generate_extensions.sh deleted file mode 100755 index 96802992..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/examples/generate_extensions.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -tmp=$(mktemp) -cat <<EOF | awk '!/^\s*#/' >"$tmp" - darkreader:navbar - keepassxc-browser:navbar - vhack-libredirect:navbar - # torproject-snowflake:navbar - tridactyl-vim:menupanel - ublock-origin:menupanel -EOF - -# The cat execution should be unquoted; -# shellcheck disable=SC2046 -cargo run -- $(cat "$tmp") - -rm "$tmp" diff --git a/pkgs/by-name/ge/generate_moz_extension/flake.lock b/pkgs/by-name/ge/generate_moz_extension/flake.lock deleted file mode 100644 index 0fa75ec3..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/flake.lock +++ /dev/null @@ -1,98 +0,0 @@ -{ - "nodes": { - "crane": { - "locked": { - "lastModified": 1737689766, - "narHash": "sha256-ivVXYaYlShxYoKfSo5+y5930qMKKJ8CLcAoIBPQfJ6s=", - "owner": "ipetkov", - "repo": "crane", - "rev": "6fe74265bbb6d016d663b1091f015e2976c4a527", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1738009863, - "narHash": "sha256-KxmFlQ2j9PpDhKRXWu85bv3R2wmfkUqdpJhEwz9JN/E=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "f898cbfddfab52593da301a397a17d0af801bbc3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "crane": "crane", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738117527, - "narHash": "sha256-GFviGfaezjGLFUlxdv3zyC7rSZvTXqwcG/YsF6MDkOw=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "6a3dc6ce4132bd57359214d986db376f2333c14d", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/by-name/ge/generate_moz_extension/flake.nix b/pkgs/by-name/ge/generate_moz_extension/flake.nix deleted file mode 100644 index 5575f90b..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/flake.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ - description = "A simple way to query the mozialla api for extension data"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - - crane = { - url = "github:ipetkov/crane"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - - flake-utils.url = "github:numtide/flake-utils"; - - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; - }; - - outputs = { - self, - nixpkgs, - crane, - flake-utils, - rust-overlay, - ... - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [(import rust-overlay)]; - }; - - rust-stable = pkgs.rust-bin.stable.latest.default; - rust-minimal = pkgs.rust-bin.stable.latest.minimal; - - craneLib = (crane.mkLib pkgs).overrideToolchain rust-minimal; - - buildInputs = [ - pkgs.openssl # needed for openssl - ]; - nativeBuildInputs = [ - pkgs.pkg-config # needed for openssl - ]; - - craneBuild = craneLib.buildPackage { - src = craneLib.cleanCargoSource ./.; - inherit buildInputs nativeBuildInputs; - - doCheck = true; - }; - in { - packages.default = craneBuild; - app.default = { - type = "app"; - program = "${self.packages.${system}.default}/bin/generate_extensions"; - }; - devShells.default = pkgs.mkShell { - packages = with pkgs; [ - cocogitto - - rust-stable - cargo-edit - ]; - inherit buildInputs nativeBuildInputs; - }; - }); -} -# vim: ts=2 - diff --git a/pkgs/by-name/ge/generate_moz_extension/package.nix b/pkgs/by-name/ge/generate_moz_extension/package.nix deleted file mode 100644 index abd95c77..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/package.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - rustPlatform, - openssl, - pkg-config, -}: -rustPlatform.buildRustPackage { - pname = "generate_firefox_extensions"; - version = "0.1.0"; - - src = ./.; - cargoLock = { - lockFile = ./Cargo.lock; - }; - buildInputs = [ - openssl # needed for openssl-sys crate - ]; - nativeBuildInputs = [ - pkg-config # needed for openssl dependency - ]; -} diff --git a/pkgs/by-name/ge/generate_moz_extension/res/generate_extensions.py b/pkgs/by-name/ge/generate_moz_extension/res/generate_extensions.py deleted file mode 100644 index ee8cc966..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/res/generate_extensions.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -# source: https://github.com/etu/nixconfig/blob/ba47d577c8bfb4a1c06927c34ece34118f4a0460/modules/graphical/firefox/generate.py - -from concurrent.futures import ThreadPoolExecutor -import json -import requests - -EXTENSIONS = sorted( - [ - "darkreader", - "firenvim", - "keepassxc-browser", - "simple-tab-groups", - ] -) - - -def index_ext(ext: str): - # print(f"Indexing {ext}...") - - resp = requests.get(f"https://addons.mozilla.org/api/v5/addons/addon/{ext}/").json() - rel = resp["current_version"] - - if not rel["file"]["hash"].startswith("sha256:"): - raise ValueError("Unhandled hash type") - - return { - "pname": ext, - "version": rel["version"], - "addonId": resp["guid"], - "url": rel["file"]["url"], - "sha256": rel["file"]["hash"], - } - - -if __name__ == "__main__": - # outfile = os.path.dirname(os.path.realpath(__file__)) + "/extensions.json" - - with ThreadPoolExecutor() as e: - extensions = {ext: e.submit(index_ext, ext) for ext in EXTENSIONS} - extensions = {k: v.result() for k, v in extensions.items()} - - # with open(outfile, "w") as f: - print(json.dumps(extensions, indent=2)) diff --git a/pkgs/by-name/ge/generate_moz_extension/res/reference.json b/pkgs/by-name/ge/generate_moz_extension/res/reference.json deleted file mode 100644 index f46ea8ec..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/res/reference.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "darkreader": { - "pname": "darkreader", - "version": "4.9.62", - "addonId": "addon@darkreader.org", - "url": "https://addons.mozilla.org/firefox/downloads/file/4053589/darkreader-4.9.62.xpi", - "sha256": "sha256:e537a2cee45ed7c26f79ecd3ed362620e3f00d24c158532a58e163a63a3d60cc" - }, - "firenvim": { - "pname": "firenvim", - "version": "0.2.14", - "addonId": "firenvim@lacamb.re", - "url": "https://addons.mozilla.org/firefox/downloads/file/4026386/firenvim-0.2.14.xpi", - "sha256": "sha256:a8c495a59e30eaabbb3fcd188db9b5e28b40bffefe41a3f0fa22ecc58c80c2b6" - }, - "keepassxc-browser": { - "pname": "keepassxc-browser", - "version": "1.8.4", - "addonId": "keepassxc-browser@keepassxc.org", - "url": "https://addons.mozilla.org/firefox/downloads/file/4045866/keepassxc_browser-1.8.4.xpi", - "sha256": "sha256:cc39aa058cb8915cfc88424e2e1cebe3ccfc3f95d7bddb2abd0c4905d2b17719" - }, - "simple-tab-groups": { - "pname": "simple-tab-groups", - "version": "4.7.2.1", - "addonId": "simple-tab-groups@drive4ik", - "url": "https://addons.mozilla.org/firefox/downloads/file/3873608/simple_tab_groups-4.7.2.1.xpi", - "sha256": "sha256:75077589098ca62c00b86cf9554c6120bf8dc04c5f916fe26f84915f5147b2a4" - } -} diff --git a/pkgs/by-name/ge/generate_moz_extension/res/test.json b/pkgs/by-name/ge/generate_moz_extension/res/test.json deleted file mode 100644 index daa1d19a..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/res/test.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "darkreader": { - "addon_id": "addon@darkreader.org", - "pname": "darkreader", - "sha256": "sha256:e537a2cee45ed7c26f79ecd3ed362620e3f00d24c158532a58e163a63a3d60cc", - "url": "https://addons.mozilla.org/firefox/downloads/file/4053589/darkreader-4.9.62.xpi", - "version": "4.9.62" - }, - "firenvim": { - "addon_id": "firenvim@lacamb.re", - "pname": "firenvim", - "sha256": "sha256:a8c495a59e30eaabbb3fcd188db9b5e28b40bffefe41a3f0fa22ecc58c80c2b6", - "url": "https://addons.mozilla.org/firefox/downloads/file/4026386/firenvim-0.2.14.xpi", - "version": "0.2.14" - }, - "keepassxc-browser": { - "addon_id": "keepassxc-browser@keepassxc.org", - "pname": "keepassxc-browser", - "sha256": "sha256:cc39aa058cb8915cfc88424e2e1cebe3ccfc3f95d7bddb2abd0c4905d2b17719", - "url": "https://addons.mozilla.org/firefox/downloads/file/4045866/keepassxc_browser-1.8.4.xpi", - "version": "1.8.4" - }, - "simple-tab-groups": { - "addon_id": "simple-tab-groups@drive4ik", - "pname": "simple-tab-groups", - "sha256": "sha256:75077589098ca62c00b86cf9554c6120bf8dc04c5f916fe26f84915f5147b2a4", - "url": "https://addons.mozilla.org/firefox/downloads/file/3873608/simple_tab_groups-4.7.2.1.xpi", - "version": "4.7.2.1" - } -} diff --git a/pkgs/by-name/ge/generate_moz_extension/src/main.rs b/pkgs/by-name/ge/generate_moz_extension/src/main.rs deleted file mode 100644 index bde986a3..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/src/main.rs +++ /dev/null @@ -1,138 +0,0 @@ -use std::env::args; - -use anyhow::{bail, Context}; -use futures::StreamExt; -use reqwest::Client; -use serde_json::{json, Map, Value}; - -pub mod types; - -macro_rules! get_json_value { - ($key:expr, $json_value:ident, $type:ident, $get:ident) => { - match $json_value.get($key) { - Some(resp) => { - let resp = resp.to_owned(); - if resp.$type() { - resp.$get().expect( - "The should have been checked in the if guard, so unpacking here is fine", - ).to_owned() - } else { - bail!( - "Value {} => \n{}\n is not of type: {}", - $key, - resp, - stringify!($type) - ); - } - } - None => { - bail!( - "There seems to be no '{}' in your json data (json value: '{}')\n Has the api changend?", - $key, serde_json::to_string_pretty(&$json_value).expect("Will always work") - ); - } - } - }; -} - -use futures::stream::futures_unordered::FuturesUnordered; -use types::{Extension, InputExtension}; - -#[tokio::main] -async fn main() -> anyhow::Result<()> { - let mut extensions: Vec<InputExtension> = vec![]; - for input_extension in args() - .skip(1) - .map(|str| InputExtension::try_from(str)) - .collect::<Vec<anyhow::Result<InputExtension>>>() - { - extensions.push(input_extension?); - } - - let resulting_extensions = process_extensions(extensions).await?; - - let mut output = Map::new(); - for extension in resulting_extensions { - output.insert(extension.pname.clone(), json!(extension)); - } - - println!( - "{}", - serde_json::to_string_pretty(&serde_json::Value::Object(output)).expect( - "This is constructed from json, it should also be possible to serialize it again" - ) - ); - Ok(()) -} - -async fn process_extensions(extensions: Vec<InputExtension>) -> anyhow::Result<Vec<Extension>> { - let mut output = Vec::with_capacity(extensions.len()); - - let client = Client::new(); - for extension in extensions - .iter() - .map(|ext| { - let local_client = &client; - index_extension(ext, local_client) - }) - .collect::<FuturesUnordered<_>>() - .collect::<Vec<_>>() - .await - { - output.push(extension?); - } - Ok(output) -} - -async fn index_extension(extension: &InputExtension, client: &Client) -> anyhow::Result<Extension> { - let response = client - .get(format!( - "https://addons.mozilla.org/api/v5/addons/addon/{}", - extension, - )) - .send() - .await - .context("Accessing the mozzila extenios api failed with error: {e}")?; - - eprintln!("Indexing {} ({})...", extension, response.status()); - let response: Value = serde_json::from_str( - &response - .text() - .await - .context("Turning the response to text fail with error: {e}")?, - ) - .context("Deserializing the response failed! Error: {e}")?; - - if let Some(detail) = response.get("detail") { - if detail == "Not found." { - bail!("Your extension ('{}') was not found!", extension); - } - }; - - let release = { get_json_value!("current_version", response, is_object, as_object) }; - - #[allow(non_snake_case)] - let addonId = { get_json_value!("guid", response, is_string, as_str) }; - - let version = { get_json_value!("version", release, is_string, as_str) }; - let file = { get_json_value!("file", release, is_object, as_object) }; - - let url = { get_json_value!("url", file, is_string, as_str) }; - let sha256 = { - let hash = get_json_value!("hash", file, is_string, as_str); - if hash.starts_with("sha256:") { - hash - } else { - bail!("This hash type is unhandled: {}", hash); - } - }; - - Ok(Extension { - pname: extension.moz_name.clone(), - default_area: extension.default_area, - version, - addonId, - url, - sha256, - }) -} diff --git a/pkgs/by-name/ge/generate_moz_extension/src/types.rs b/pkgs/by-name/ge/generate_moz_extension/src/types.rs deleted file mode 100644 index b830fe0d..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/src/types.rs +++ /dev/null @@ -1,71 +0,0 @@ -use std::fmt::Display; - -use anyhow::anyhow; -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Serialize, Deserialize)] -#[allow(non_snake_case)] -pub struct Extension { - pub pname: String, - pub default_area: DefaultArea, - pub version: String, - pub addonId: String, - pub url: String, - pub sha256: String, -} - -#[derive(Debug, Clone)] -pub struct InputExtension { - pub moz_name: String, - pub default_area: DefaultArea, -} -#[derive(Debug, Clone, Copy, Deserialize, Serialize)] -#[allow(non_camel_case_types)] -pub enum DefaultArea { - navbar, - menupanel, -} - -impl Display for DefaultArea { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - DefaultArea::navbar => f.write_str("navbar"), - DefaultArea::menupanel => f.write_str("menupanel"), - } - } -} - -impl TryFrom<&str> for DefaultArea { - type Error = anyhow::Error; - - fn try_from(value: &str) -> Result<Self, Self::Error> { - match value { - "navbar" => Ok(Self::navbar), - "menupanel" => Ok(Self::menupanel), - _ => Err(anyhow!( - "Your <default_area> needs to be one of 'navbar' or 'menupanel', but is: '{}'", - value - )), - } - } -} - -impl Display for InputExtension { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(&self.moz_name) - } -} -impl TryFrom<String> for InputExtension { - type Error = anyhow::Error; - - fn try_from(value: String) -> Result<Self, Self::Error> { - if let Some((moz_name, default_area)) = value.split_once(':') { - Ok(Self { - moz_name: moz_name.to_owned(), - default_area: default_area.try_into()?, - }) - } else { - Err(anyhow!("Can't parse the input string as a InputExtension!\n Needs to be: '<moz_name>:<default_area>'")) - } - } -} diff --git a/pkgs/by-name/ge/generate_moz_extension/update.sh b/pkgs/by-name/ge/generate_moz_extension/update.sh deleted file mode 100755 index b9404867..00000000 --- a/pkgs/by-name/ge/generate_moz_extension/update.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -[ "$1" = "upgrade" ] && cargo upgrade -cargo update - -# vim: ft=sh diff --git a/pkgs/by-name/gi/git-cleanup/git-cleanup.sh b/pkgs/by-name/gi/git-cleanup/git-cleanup.sh deleted file mode 100755 index f423a9d2..00000000 --- a/pkgs/by-name/gi/git-cleanup/git-cleanup.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -help() { - cat <<EOF -Automatically remove merged branches (remote and local) - -USAGE: - git-cleanup [OPTIONS] - -OPTIONS: - --remote | -r - Act on remote branches - - --help | -h - Display this help and exit. - - --version | -v - Display version and copyright information and exit. -EOF -} - -# This should always be the correct answer. -get_default_branch() { - # source: https://stackoverflow.com/a/50056710 - # We assume, that 'origin' is the remote in use - git remote show origin | sed -n '/HEAD branch/s|.*: ||p' -} - -cleanup() { - default_branch="$(get_default_branch)" - - merged_branches="$(git branch --merged "$default_branch" --no-contains "$default_branch" --format='%(refname:short)')" - - # shellcheck disable=2086 - # We expect the branches to not contain spaces and want git to deal with them - # separately - [ "$merged_branches" ] && git branch --delete $merged_branches -} -cleanup_remote() { - default_branch="$(get_default_branch)" - - merged_branches="$(git branch --remotes --merged "$default_branch" --no-contains "$default_branch" --format='%(refname:short)' | sed 's|origin/||')" - - # shellcheck disable=2086 - # We expect the branches to not contain spaces and want git to deal with them - # separately - [ "$merged_branches" ] && git push --delete origin $merged_branches -} - -remote=false -for arg in "$@"; do - case "$arg" in - "--help" | "-h") - help - exit 0 - ;; - "--version" | "-v") - version - exit 0 - ;; - "--remote" | "-r") - remote=true - ;; - esac -done - -if [ "$remote" = "true" ]; then - cleanup_remote -elif [ "$remote" = "false" ]; then - cleanup -else - die "BUG: 'remote' is not true or false but: '$remote'" -fi - -# vim: ft=sh diff --git a/pkgs/by-name/gi/git-cleanup/package.nix b/pkgs/by-name/gi/git-cleanup/package.nix deleted file mode 100644 index 54b3f2bd..00000000 --- a/pkgs/by-name/gi/git-cleanup/package.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - sysLib, - git, - gnused, - openssh, -}: -sysLib.writeShellScript { - name = "git-cleanup"; - src = ./git-cleanup.sh; - keepPath = false; - generateCompletions = true; - dependencies = [ - git - gnused - openssh - ]; -} diff --git a/pkgs/by-name/gi/git-cm/git-cm.sh b/pkgs/by-name/gi/git-cm/git-cm.sh index 2204e4d6..7ab957df 100755 --- a/pkgs/by-name/gi/git-cm/git-cm.sh +++ b/pkgs/by-name/gi/git-cm/git-cm.sh @@ -1,7 +1,14 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. ROOT="$(git rev-parse --show-toplevel)" @@ -13,6 +20,6 @@ else fi sed '1d' "$(git config commit.template)" >>"$ROOT/.git/COMMIT_TEMPLATE" -git commit --template "$ROOT/.git/COMMIT_TEMPLATE" --verbose "$@" +git commit --template "$ROOT/.git/COMMIT_TEMPLATE" "$@" # vim: ft=sh diff --git a/pkgs/by-name/gi/git-cm/package.nix b/pkgs/by-name/gi/git-cm/package.nix index a9949783..f124ce90 100644 --- a/pkgs/by-name/gi/git-cm/package.nix +++ b/pkgs/by-name/gi/git-cm/package.nix @@ -1,13 +1,26 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies git, gnused, }: -sysLib.writeShellScript { +writeShellApplication { name = "git-cm"; - src = ./git-cm.sh; - keepPath = true; - dependencies = [ + text = builtins.readFile ./git-cm.sh; + + # We need access to the $EDITOR + inheritPath = true; + + runtimeInputs = [ git gnused ]; diff --git a/pkgs/by-name/gi/git-edit-index/git-edit-index.sh b/pkgs/by-name/gi/git-edit-index/git-edit-index.sh index e73dc53c..46fbc9c5 100755 --- a/pkgs/by-name/gi/git-edit-index/git-edit-index.sh +++ b/pkgs/by-name/gi/git-edit-index/git-edit-index.sh @@ -1,19 +1,20 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# needed for help() and version -# shellcheck disable=2034 -AUTHORS="Soispha" -# shellcheck disable=2034 -YEARS="2024" -# shellcheck disable=2034 -VERSION="1.0.0" - -# NAME is from the wrapper -# shellcheck disable=SC2269 -NAME="$NAME" +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +NAME="git-edit-index" + +warn() { + echo "WARNING: $1" +} help() { cat <<EOF @@ -55,37 +56,35 @@ materialize_file() { } edit() { - files_to_add="$(mktmp)" - realpath --relative-to=. "$@" >"$files_to_add" + files_to_add="$(mktemp)" + cleanup() { + rm "$files_to_add" + } + trap cleanup EXIT - index_files="$(mktmp)" - git diff --name-only --cached --diff-filter=AM >"$index_files" + realpath --relative-to=. "$@" >"$files_to_add" - while read -r file; do - if grep -q "$file" "$files_to_add"; then - sed -i "s|$file||" "$files_to_add" - materialize_file "$file" + git diff --name-only --cached --diff-filter=AM | while read -r index_file; do + if grep -q "$index_file" "$files_to_add"; then + sed -i "s|$index_file||" "$files_to_add" + materialize_file "$index_file" fi - done <"$index_files" + done - files_to_check="$(mktmp)" - clean "$files_to_add" >"$files_to_check" - if [ "$(wc -l <"$files_to_check")" -gt 0 ]; then - warn "Could not edit every file:" + unedided_files="$(sed '/^\s*$/d' "$files_to_add" | wc -l)" + if [ "$unedided_files" -gt 0 ]; then + warn "Failed to edit $unedided_files file(s):" cat "$files_to_add" fi } +end_of_cli_options=false for arg in "$@"; do case "$arg" in "--help" | "-h") help exit 0 ;; - "--version" | "-v") - version - exit 0 - ;; "--") end_of_cli_options=true ;; diff --git a/pkgs/by-name/gi/git-edit-index/package.nix b/pkgs/by-name/gi/git-edit-index/package.nix index 8ac085bf..5e855b49 100644 --- a/pkgs/by-name/gi/git-edit-index/package.nix +++ b/pkgs/by-name/gi/git-edit-index/package.nix @@ -1,19 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies + coreutils, git, gnused, }: -sysLib.writeShellScript { +writeShellApplication { name = "git-edit-index"; - src = ./git-edit-index.sh; - generateCompletions = true; + text = builtins.readFile ./git-edit-index.sh; # `git-edit-index` starts neovim, wich might want to shell out from - keepPath = true; + inheritPath = true; - dependencies = [ + runtimeInputs = [ + coreutils git gnused - # $EDITOR ]; } diff --git a/pkgs/by-name/hi/hibernate/hibernate.sh b/pkgs/by-name/hi/hibernate/hibernate.sh index 30868fd1..4a68e0d7 100755 --- a/pkgs/by-name/hi/hibernate/hibernate.sh +++ b/pkgs/by-name/hi/hibernate/hibernate.sh @@ -1,7 +1,16 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# TODO(@bpeetz): This functionality could be moved to `tskm`. <2025-04-14> context="$(task _get rc.context)" [ "$context" ] && task context none diff --git a/pkgs/by-name/hi/hibernate/package.nix b/pkgs/by-name/hi/hibernate/package.nix index 24754f09..c2e8c0b6 100644 --- a/pkgs/by-name/hi/hibernate/package.nix +++ b/pkgs/by-name/hi/hibernate/package.nix @@ -1,15 +1,23 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, systemd, - taskwarrior, + taskwarrior3, }: -sysLib.writeShellScript { +writeShellApplication { name = "hibernate"; - src = ./hibernate.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ + text = builtins.readFile ./hibernate.sh; + inheritPath = false; + runtimeInputs = [ systemd - taskwarrior + taskwarrior3 ]; } diff --git a/pkgs/by-name/i3/i3bar-river-patched/0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch b/pkgs/by-name/i3/i3bar-river-patched/0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch new file mode 100644 index 00000000..7bfdd7bc --- /dev/null +++ b/pkgs/by-name/i3/i3bar-river-patched/0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch @@ -0,0 +1,110 @@ +From 8ae692a461fad2f23231d50b78bb706408facfe6 Mon Sep 17 00:00:00 2001 +From: Benedikt Peetz <benedikt.peetz@b-peetz.de> +Date: Tue, 20 May 2025 19:58:57 +0200 +Subject: [PATCH] feat(crate::bar): Put the leftmost block in the middle of the + bar + +This is a workaround for the limitation in the i3 blocks protocol, as +this does not allow for centred blocks. +--- + src/bar.rs | 63 ++++++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 52 insertions(+), 11 deletions(-) + +diff --git a/src/bar.rs b/src/bar.rs +index 96533e3..76f8025 100644 +--- a/src/bar.rs ++++ b/src/bar.rs +@@ -338,16 +338,55 @@ impl Bar { + } + + // Display the blocks +- render_blocks( +- &cairo_ctx, +- &ss.config, +- palette, +- ss.blocks_cache.get_computed(), +- &mut self.blocks_btns, +- offset_left, +- width_f, +- height_f, +- ); ++ { ++ if !ss.blocks_cache.get_computed().is_empty() { ++ let first_block = &ss.blocks_cache.get_computed()[0]; ++ ++ let blocks = &ss.blocks_cache.get_computed()[1..]; ++ ++ let other_start = render_blocks( ++ &cairo_ctx, ++ &ss.config, ++ palette, ++ blocks, ++ &mut self.blocks_btns, ++ offset_left, ++ width_f, ++ height_f, ++ ); ++ ++ // Draw the first block _after_ the other ones, so that we can nudge it more to the ++ // left, if the others are spanning over the middle. ++ let mut start = (width_f / 2.0) - (first_block.full.width / 2.0); ++ if start + first_block.full.width > other_start { ++ start = other_start ++ - first_block.full.width ++ - first_block.block.separator_block_width as f64; ++ } ++ ++ first_block.full.render( ++ &cairo_ctx, ++ RenderOptions { ++ x_offset: start, ++ bar_height: height_f, ++ fg_color: first_block.block.color.unwrap_or(palette.color), ++ bg_color: first_block.block.background, ++ r_left: ss.config.blocks_r, ++ r_right: ss.config.blocks_r, ++ overlap: ss.config.blocks_overlap, ++ }, ++ ); ++ ++ self.blocks_btns.push( ++ start, ++ first_block.full.width, ++ ( ++ first_block.block.name.clone(), ++ first_block.block.instance.clone(), ++ ), ++ ); ++ } ++ } + + self.viewport + .set_destination(conn, self.width as i32, self.height as i32); +@@ -422,7 +461,7 @@ fn render_blocks( + offset_left: f64, + full_width: f64, + full_height: f64, +-) { ++) -> f64 { + context.rectangle(offset_left, 0.0, full_width - offset_left, full_height); + context.clip(); + +@@ -507,6 +546,7 @@ fn render_blocks( + } + + // Render blocks ++ let leftmost_start = full_width - blocks_width; + buttons.clear(); + for series in blocks_computed { + let s_len = series.blocks.len(); +@@ -550,6 +590,7 @@ fn render_blocks( + } + + context.reset_clip(); ++ leftmost_start + } + + fn layer_surface_cb(ctx: EventCtx<State, ZwlrLayerSurfaceV1>) { +-- +2.49.0 + diff --git a/pkgs/by-name/i3/i3bar-river-patched/package.nix b/pkgs/by-name/i3/i3bar-river-patched/package.nix new file mode 100644 index 00000000..f6c3b5fd --- /dev/null +++ b/pkgs/by-name/i3/i3bar-river-patched/package.nix @@ -0,0 +1,54 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + lib, + fetchFromGitHub, + rustPlatform, + pkg-config, + pango, +}: +rustPlatform.buildRustPackage { + pname = "i3bar-river-patched"; + version = "1.1.0-unstable-2025-05-20"; + + src = fetchFromGitHub { + owner = "bpeetz"; + repo = "i3bar-river"; + rev = "bdaf362f24c143beeb92b783af15d3b99a0490e4"; + hash = "sha256-jOv/DmXBpUCV/zbkWSKSYQ+yXcZZQY+T03rNre9hjn8="; + }; + + cargoHash = "sha256-jIB4XH67FmtPxAatHkuW8v5mNgr/KsyriaBNZ5t2dLo="; + + cargoPatches = [ + # TODO(@bpeetz): Open an issues, whether something like that could be up-streamed. <2025-05-20> + ./0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch + ]; + + # Remove the WMs that I don't use. + buildNoDefaultFeatures = true; + buildFeatures = [ + # "hyprland" + # "niri" + "river" + ]; + + nativeBuildInputs = [pkg-config]; + buildInputs = [pango]; + + meta = with lib; { + description = "Port of i3bar for river"; + homepage = "https://github.com/MaxVerevkin/i3bar-river"; + license = licenses.gpl3Only; + maintainers = with maintainers; [nicegamer7]; + mainProgram = "i3bar-river"; + platforms = platforms.linux; + }; +} diff --git a/pkgs/by-name/i3/i3status-rust-patched/package.nix b/pkgs/by-name/i3/i3status-rust-patched/package.nix new file mode 100644 index 00000000..9f172d49 --- /dev/null +++ b/pkgs/by-name/i3/i3status-rust-patched/package.nix @@ -0,0 +1,34 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + i3status-rust, + fetchpatch2, +}: +i3status-rust.overrideAttrs (final: prev: { + pname = "${prev.pname}-patched"; + + patches = + (prev.patches or []) + ++ [ + # Btrfs support for disk_space block. + (fetchpatch2 { + name = "disk_space: Support btrfs backend"; + url = "https://patch-diff.githubusercontent.com/raw/greshake/i3status-rust/pull/2159.patch"; + hash = "sha256-S2/biX6FTLJNfI9QVgwr+V8IGMRnSFIZnTrhc+1LvqQ="; + }) + + # Correctly calculate the used memory. + (fetchpatch2 { + name = "memory: Avoid estimating available memory, use kernel estimate instead"; + url = "https://patch-diff.githubusercontent.com/raw/greshake/i3status-rust/pull/2160.patch"; + hash = "sha256-1wB2KpXhC/UIxAgRioOYj/bnrzRSuaHAdbeoZ2O5E/Y="; + }) + ]; +}) diff --git a/pkgs/by-name/lf/lf-make-map/.envrc b/pkgs/by-name/lf/lf-make-map/.envrc index 2b742cf6..880b1809 100644 --- a/pkgs/by-name/lf/lf-make-map/.envrc +++ b/pkgs/by-name/lf/lf-make-map/.envrc @@ -1,4 +1,15 @@ #!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + use flake || use nix watch_file flake.nix diff --git a/pkgs/by-name/lf/lf-make-map/.gitignore b/pkgs/by-name/lf/lf-make-map/.gitignore index cb87f36f..8f29eabf 100644 --- a/pkgs/by-name/lf/lf-make-map/.gitignore +++ b/pkgs/by-name/lf/lf-make-map/.gitignore @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + # build /target /result diff --git a/pkgs/by-name/lf/lf-make-map/Cargo.lock b/pkgs/by-name/lf/lf-make-map/Cargo.lock index ff2a1782..05d59f92 100644 --- a/pkgs/by-name/lf/lf-make-map/Cargo.lock +++ b/pkgs/by-name/lf/lf-make-map/Cargo.lock @@ -1,5 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. version = 4 [[package]] @@ -19,9 +28,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -34,91 +43,91 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "cc" -version = "1.2.10" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", ] [[package]] name = "clap" -version = "4.5.27" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -126,9 +135,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -138,9 +147,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck", "proc-macro2", @@ -150,15 +159,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "core-foundation-sys" @@ -174,20 +183,21 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -203,9 +213,9 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi", "libc", @@ -229,11 +239,21 @@ dependencies = [ ] [[package]] +name = "keymaps" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea59e8e461942cf1d6a7ad938848d6fd2e40eb43799c21192c09226ecc86710f" +dependencies = [ + "thiserror", +] + +[[package]] name = "lf-make-map" version = "0.1.0" dependencies = [ "anyhow", "clap", + "keymaps", "log", "stderrlog", "walkdir", @@ -241,15 +261,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "num-traits" @@ -262,33 +282,39 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "same-file" @@ -326,9 +352,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.96" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -345,20 +371,39 @@ dependencies = [ ] [[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "utf8parse" @@ -445,11 +490,61 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-targets", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", ] [[package]] diff --git a/pkgs/by-name/lf/lf-make-map/Cargo.toml b/pkgs/by-name/lf/lf-make-map/Cargo.toml index 2318cf03..57dc61a5 100644 --- a/pkgs/by-name/lf/lf-make-map/Cargo.toml +++ b/pkgs/by-name/lf/lf-make-map/Cargo.toml @@ -1,14 +1,25 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [package] name = "lf-make-map" description = "An automatic lf cd mapping generator" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.95" -clap = { version = "4.5.27", features = ["derive", "env"] } -log = "0.4.25" +anyhow = "1.0.98" +clap = { version = "4.5.40", features = ["derive", "env"] } +keymaps = "1.2.0" +log = "0.4.27" stderrlog = "0.6.0" walkdir = "2.5.0" diff --git a/pkgs/by-name/lf/lf-make-map/README.md b/pkgs/by-name/lf/lf-make-map/README.md index 0c57cede..4d5dc95c 100644 --- a/pkgs/by-name/lf/lf-make-map/README.md +++ b/pkgs/by-name/lf/lf-make-map/README.md @@ -1,3 +1,15 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # Lf make map > An automatic lf cd mapping generator diff --git a/pkgs/by-name/lf/lf-make-map/flake.lock b/pkgs/by-name/lf/lf-make-map/flake.lock index e638dcd2..95f58ef9 100644 --- a/pkgs/by-name/lf/lf-make-map/flake.lock +++ b/pkgs/by-name/lf/lf-make-map/flake.lock @@ -1,63 +1,12 @@ { "nodes": { - "crane": { - "locked": { - "lastModified": 1737689766, - "narHash": "sha256-ivVXYaYlShxYoKfSo5+y5930qMKKJ8CLcAoIBPQfJ6s=", - "owner": "ipetkov", - "repo": "crane", - "rev": "6fe74265bbb6d016d663b1091f015e2976c4a527", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": [ - "systems" - ] - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1738009863, - "narHash": "sha256-KxmFlQ2j9PpDhKRXWu85bv3R2wmfkUqdpJhEwz9JN/E=", + "lastModified": 1750994206, + "narHash": "sha256-3u6rEbIX9CN/5A5/mc3u0wIO1geZ0EhjvPBXmRDHqWM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f898cbfddfab52593da301a397a17d0af801bbc3", + "rev": "80d50fc87924c2a0d346372d242c27973cf8cdbf", "type": "github" }, "original": { @@ -69,68 +18,7 @@ }, "root": { "inputs": { - "crane": "crane", - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay", - "systems": "systems", - "treefmt-nix": "treefmt-nix" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738117527, - "narHash": "sha256-GFviGfaezjGLFUlxdv3zyC7rSZvTXqwcG/YsF6MDkOw=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "6a3dc6ce4132bd57359214d986db376f2333c14d", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1680978846, - "narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=", - "owner": "nix-systems", - "repo": "x86_64-linux", - "rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "x86_64-linux", - "type": "github" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738070913, - "narHash": "sha256-j6jC12vCFsTGDmY2u1H12lMr62fnclNjuCtAdF1a4Nk=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "bebf27d00f7d10ba75332a0541ac43676985dea3", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/pkgs/by-name/lf/lf-make-map/flake.lock.license b/pkgs/by-name/lf/lf-make-map/flake.lock.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/flake.lock.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/lf/lf-make-map/flake.nix b/pkgs/by-name/lf/lf-make-map/flake.nix index dc8c24cc..20925aca 100644 --- a/pkgs/by-name/lf/lf-make-map/flake.nix +++ b/pkgs/by-name/lf/lf-make-map/flake.nix @@ -1,125 +1,34 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { description = "An automatic lf cd mapping generator"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; - treefmt-nix = { - url = "github:numtide/treefmt-nix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - - crane = { - url = "github:ipetkov/crane"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; - - # inputs for following - systems = { - url = "github:nix-systems/x86_64-linux"; # only evaluate for this system - }; - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - flake-utils = { - url = "github:numtide/flake-utils"; - inputs = { - systems.follows = "systems"; - }; + outputs = {nixpkgs, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages."${system}"; + in { + devShells."${system}".default = pkgs.mkShell { + packages = with pkgs; [ + cargo + clippy + rustc + rustfmt + + cargo-edit + ]; }; }; - - outputs = { - self, - nixpkgs, - flake-utils, - treefmt-nix, - crane, - rust-overlay, - ... - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [(import rust-overlay)]; - }; - - nightly = false; - rust_minimal = - if nightly - then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal) - else pkgs.rust-bin.stable.latest.minimal; - rust_default = - if nightly - then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default) - else pkgs.rust-bin.stable.latest.default; - - cargo_toml = craneLib.cleanCargoToml {cargoToml = ./Cargo.toml;}; - pname = cargo_toml.package.name; - - craneLib = (crane.mkLib pkgs).overrideToolchain rust_minimal; - craneBuild = craneLib.buildPackage { - src = craneLib.cleanCargoSource ./.; - - doCheck = true; - }; - - manual = pkgs.stdenv.mkDerivation { - name = "${pname}-manual"; - inherit (cargo_toml.package) version; - - src = ./docs; - nativeBuildInputs = with pkgs; [pandoc]; - - buildPhase = '' - mkdir --parents $out/docs; - - pandoc "./${pname}.1.md" -s -t man > $out/docs/${pname}.1 - ''; - - installPhase = '' - install -D $out/docs/${pname}.1 $out/share/man/man1/${pname}; - ''; - }; - - treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; - in { - packages.default = pkgs.symlinkJoin { - inherit (cargo_toml.package) name; - - paths = [manual craneBuild]; - }; - - checks = { - inherit craneBuild; - formatting = treefmtEval.config.build.check self; - }; - - formatter = treefmtEval.config.build.wrapper; - - devShells.default = pkgs.mkShell { - packages = with pkgs; [ - cocogitto - - rust_default - cargo-edit - - licensure - ]; - }; - }); } # vim: ts=2 diff --git a/pkgs/by-name/lf/lf-make-map/package.nix b/pkgs/by-name/lf/lf-make-map/package.nix index 8404927f..8f77c843 100644 --- a/pkgs/by-name/lf/lf-make-map/package.nix +++ b/pkgs/by-name/lf/lf-make-map/package.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {rustPlatform}: rustPlatform.buildRustPackage { pname = "lf-make-map"; diff --git a/pkgs/by-name/lf/lf-make-map/src/cli.rs b/pkgs/by-name/lf/lf-make-map/src/cli.rs index a398e451..70746984 100644 --- a/pkgs/by-name/lf/lf-make-map/src/cli.rs +++ b/pkgs/by-name/lf/lf-make-map/src/cli.rs @@ -1,3 +1,13 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + use std::path::PathBuf; use clap::{ArgAction, Parser, Subcommand}; diff --git a/pkgs/by-name/lf/lf-make-map/src/main.rs b/pkgs/by-name/lf/lf-make-map/src/main.rs index aaf79b20..d5d934e1 100644 --- a/pkgs/by-name/lf/lf-make-map/src/main.rs +++ b/pkgs/by-name/lf/lf-make-map/src/main.rs @@ -1,13 +1,23 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + use std::path::{Path, PathBuf}; use anyhow::{Context, Result}; use clap::Parser; use cli::{Args, Command}; use log::trace; -use mapping::map_tree::MappingTree; +use mapping::map_key::MapKey; use walkdir::{DirEntry, WalkDir}; -use crate::mapping::MapKey; +use crate::mapping::MappingsTrie; mod cli; mod mapping; @@ -24,7 +34,7 @@ fn main() -> anyhow::Result<()> { .timestamp(stderrlog::Timestamp::Off) .init()?; - let mut mappings = MappingTree::new(); + let mut mappings = MappingsTrie::new(); let relevant_directories = match &args.command { Command::Visualize { options } => &options.relevant_directories, @@ -32,68 +42,62 @@ fn main() -> anyhow::Result<()> { }; for dir in relevant_directories { - trace!("Processing '{}'..", dir.display()); - let path = strip_path(&dir, &args.home_name)?; + trace!("START Processing '{}'..", dir.display()); + let path = strip_path(dir, &args.home_name)?; mappings .include(path_to_str(path)?) .with_context(|| format!("Failed to include path: '{}'", path.display()))?; + trace!("END Finished processing {}.", dir.display()); + } + + trace!("Generated mappings for the relevant directories. Starting expanding to max depth."); + if log::log_enabled!(log::Level::Trace) { + eprintln!("{mappings}"); } let home = path_to_str(&args.home_name)?.to_owned(); let mut current_depth = 1; while current_depth != args.depth { - for (key, value) in mappings.iter(false) { - trace!( - "Adding to child ('{}' -> '{}')", - MapKey::display(&key), - value - ); - - let mut local_mappings = MappingTree::new(); - for dir in WalkDir::new(extend(&home, &value)?) + for (keys, child) in mappings.0.iter().filter(|(_, child)| child.expendable) { + trace!("Adding to child '{}' ('{}')", MapKey::display(&keys), child); + + let mut local_mappings = MappingsTrie::new(); + for dir in WalkDir::new(extend(&home, &child.path)?) .min_depth(1) .max_depth(1) .into_iter() .filter_entry(|e| is_dir(e) && !is_hidden(e)) { - let directory = dir - .with_context(|| format!("Failed to read dir ('{}')", home.clone() + &value))?; - let path_to_strip = &PathBuf::from(extend(&home, &value)?); - let path = strip_path(&directory.path(), &path_to_strip)?; + let directory = dir.with_context(|| { + format!("Failed to read dir ('{}')", home.clone() + &child.path) + })?; + let path_to_strip = &PathBuf::from(extend(&home, &child.path)?); + let path = strip_path(directory.path(), path_to_strip)?; trace!( - "Including: '{}' (after stripping '{}' from '{}' -> '{}' + '/' + '{}')", + "Including: '{}' (after stripping '{}' from '{}')", path.display(), - directory.path().display(), path_to_strip.display(), - home, - value + directory.path().display(), ); let gen_key = MapKey::new_ones_from_path(path_to_str(path)?, 1); local_mappings .insert( &gen_key, - path_to_str(strip_path(&directory.path(), &PathBuf::from(&home))?)?, + path_to_str(strip_path(directory.path(), &PathBuf::from(&home))?)?, ) .with_context(|| format!("Failed to include path: '{}'", path.display()))?; } - trace!("{}", local_mappings); - - trace!( - "'{}' -> '{:#?}'", - MapKey::display(&key), - local_mappings.root_node() - ); - mappings.interleave(&key, local_mappings.root_node().to_owned())?; + mappings.add_trie(&keys, local_mappings)?; } current_depth += 1; } match args.command { - Command::Visualize { .. } => println!("{}", mappings), + Command::Visualize { .. } => println!("{}", mappings.0), Command::Generate { .. } => println!("{}", mappings.to_lf_mappings(args.home_name)), } @@ -120,7 +124,7 @@ fn is_dir(entry: &DirEntry) -> bool { } fn strip_path<'a>(path: &'a Path, to_strip: &Path) -> Result<&'a Path> { - path.strip_prefix(&to_strip).with_context(|| { + path.strip_prefix(to_strip).with_context(|| { format!( "'{}' is not under the specified home path ('{}')!", path.display(), diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/lf_mapping.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/lf_mapping.rs new file mode 100644 index 00000000..f8a6182e --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/lf_mapping.rs @@ -0,0 +1,35 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::path::PathBuf; + +use crate::mapping::MapKey; + +use super::MappingsTrie; + +impl MappingsTrie { + pub fn to_lf_mappings(&self, home_path: PathBuf) -> String { + let mut raw = self + .0 + .iter() + .map(|(key, value)| { + format!( + "map g{} cd \"{}\"\n", + MapKey::display(&key), + home_path.join(&value.path).display() + ) + }) + .collect::<Vec<String>>(); + + raw.sort(); + + raw.into_iter().collect() + } +} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs new file mode 100644 index 00000000..10b612fd --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs @@ -0,0 +1,274 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::fmt::Write; + +use anyhow::bail; +use log::debug; + +#[derive(Clone, Debug)] +pub struct MapKey { + pub key: char, + + pub(crate) resolution: usize, + + /// Part of the path, used to derive the key + pub(crate) part_path: String, +} + +impl std::hash::Hash for MapKey { + fn hash<H: std::hash::Hasher>(&self, state: &mut H) { + self.key.hash(state) + } +} + +impl Eq for MapKey {} +impl PartialEq for MapKey { + fn eq(&self, other: &Self) -> bool { + self.key == other.key + } +} + +impl Ord for MapKey { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.key.cmp(&other.key) + } +} +impl PartialOrd for MapKey { + fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { + Some(self.cmp(other)) + } +} + +impl MapKey { + pub fn new_from_part_path(part_path: &str, resolution: usize) -> Vec<Self> { + let key = Self::part_path_to_key(part_path, resolution); + + key.chars() + .map(|ch| Self { + key: ch, + resolution, + part_path: part_path.to_owned(), + }) + .collect() + } + + pub fn new_ones_from_path(path: &str, number_of_chars: usize) -> Vec<Self> { + let key: Vec<MapKey> = path + .split('/') + .flat_map(|part| Self::new_from_part_path(part, number_of_chars)) + .collect(); + + debug!( + "Generated full MapKeys: '{}' -> '{}'", + path, + MapKey::display(&key) + ); + key + } + + pub fn increment(&self, target_resolution: usize) -> Vec<Self> { + let new_resolution = target_resolution; + + // debug!("Incrementing: '{}' ('{}')", &self, &self.part_path); + + let added_chars = if new_resolution < self.part_path.len() { + MapKey::part_path_to_key(&self.part_path, new_resolution) + } else { + let mut generated_chars = + MapKey::part_path_to_key(&self.part_path, self.part_path.len()); + + generated_chars.extend( + (0..(new_resolution - self.part_path.len())) + .into_iter() + .map(|_| self.part_path.chars().last().expect("This will exists")), + ); + + generated_chars + }; + + let part_path = self.part_path.clone(); + let output: Vec<Self> = added_chars + .chars() + .enumerate() + .map(|(res, ch)| MapKey { + key: ch, + resolution: res + 1, + part_path: part_path.clone(), + }) + .collect(); + + // debug!("Finished increment: '{}' ('{}')", MapKey::display(&output), output[0].part_path); + output + } + + pub fn display(values: &[Self]) -> String { + values.iter().map(|value| value.key.clone()).collect() + } + + fn part_path_to_key(part: &str, number_of_chars: usize) -> String { + fn make(pat: char, part: &str, number_of_chars: usize) -> String { + let mut acc = String::new(); + + if !part.split(pat).all(|part| part.len() > 0) { + panic!( + "\ +Can't turn this path '{}' to a mapping. +This should not happen, please report the bug!", + part + ) + } + + let mut last_working = None; + for i in 0..number_of_chars { + for str in part.split(pat) { + if acc.len() != number_of_chars { + acc.push(match str.chars().nth(i) { + Some(ch) => ch, + None => { + if let Some(last) = last_working { + str.chars().nth(last).expect("This should always exist") + } else { + last_working = Some(i - 1); + str.chars().nth(i - 1).expect("This should always exist") + } + } + }) + } + } + } + + acc + } + + let value = if part.contains('_') && !part.starts_with('_') && !part.ends_with('_') { + make('_', part, number_of_chars) + } else if part.contains('-') && !part.starts_with('-') && !part.ends_with('-') { + make('-', part, number_of_chars) + } else { + part.chars().take(number_of_chars).collect::<String>() + }; + + assert_eq!( + value.len(), + number_of_chars, + "'{}' does not have expected length of: {}", + value, + number_of_chars + ); + value + } + + /// Checks whether a tiebreak via the [`Self::increment`] function can result in unique keys. + pub fn can_tiebreak_with(&self, other: &Self) -> anyhow::Result<()> { + /// Check whether the `input` &str is composed of only one character. + /// If so, returns this character, otherwise returns None. + fn reduce_string(input: &str) -> Option<char> { + let first_char = input + .chars() + .take(1) + .last() + .expect("Should contain one char"); + + if input.chars().all(|ch| ch == first_char) { + Some(first_char) + } else { + None + } + } + + /// Check whether `a` is a subset of `b` or `b` is a subset of `a`. + fn is_subset_either(a: &str, b: &str) -> bool { + /// Checks if `subset` is a subset of `set`. + /// + /// # Examples + /// ``` + /// let a = "a"; + /// let b = "aa"; + /// assert!(is_subset(a, b)) + /// ``` + /// + /// ``` + /// let a = "abc"; + /// let b = "def"; + /// assert!(!is_subset(a, b)) + /// ``` + fn is_subset(subset: &str, set: &str) -> bool { + let prefix: String = set.chars().take(subset.len()).collect(); + let suffix: String = set.chars().skip(subset.len()).collect(); + + if prefix == subset { + let clean_suffix = reduce_string(&suffix); + if let Some(ch) = clean_suffix { + ch == subset.chars().last().expect("Will exists") + } else { + false + } + } else { + false + } + } + + match a.len().cmp(&b.len()) { + std::cmp::Ordering::Less => { + // `b` is the longer string. As such we need to check if `a` is a subset of `b`. + is_subset(a, b) + } + std::cmp::Ordering::Greater => { + // `a` is the longer string. As such we need to check if `b` is a subset of `a`. + is_subset(b, a) + } + std::cmp::Ordering::Equal => a == b, + } + } + + if reduce_string(&other.part_path) + .is_some_and(|a| Some(a) == reduce_string(&self.part_path)) + { + bail!( + "\ +The foreign_key ('{}', path_part: '{}' -> '{}') and our_key ('{}', path_part: '{}' -> '{}') \ +have an identical path_part (when duplicated chars are removed)! +I cannot extended them via incrementation. +Please rename the paths to fix this. + ", + other, + &other.part_path, + reduce_string(&other.part_path).expect("Is some here"), + self, + &self.part_path, + reduce_string(&self.part_path).expect("Is some here"), + ); + } + + if is_subset_either(&other.part_path, &self.part_path) { + bail!( + "\ +The foreign_key ('{}', path_part: '{}') and our_key ('{}', path_part: '{}') \ +are subsets of one another! +A discrimination through incrementation will not work! +Please rename the paths to fix this. + ", + other, + &other.part_path, + self, + &self.part_path, + ); + } + + Ok(()) + } +} + +impl std::fmt::Display for MapKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_char(self.key) + } +} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/display.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/display.rs deleted file mode 100644 index 65302e1e..00000000 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/display.rs +++ /dev/null @@ -1,91 +0,0 @@ -use std::fmt::Display; - -use crate::mapping::{ - map_tree::{Node, NodeValue}, - MapKey, -}; - -use super::MappingTree; - -impl Display for MappingTree { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - fn write_node( - f: &mut std::fmt::Formatter<'_>, - node: &Node, - indention: String, - location: Vec<MapKey>, - is_last: bool, - is_root: bool, - ) -> std::fmt::Result { - let node_value = match &node.value { - NodeValue::Parent { children: _ } => "<Parent>".to_owned(), - NodeValue::Child { path, extandable } => { - path.to_owned() + if *extandable { " [exten.]" } else { " [stop]" } - } - }; - - let new_idention = indention.clone() - + if is_root { - "" - } else { - match is_last { - true => " ", - false => "│ ", - } - }; - - let bullet = match is_last { - true => String::from("└── "), - false => String::from("├── "), - }; - - if is_root { - write!(f, ": {}\n", node_value)?; - } else { - write!( - f, - "{}{}\x1b[1;33m{}\x1b[0m: {}\n", - indention, - bullet, - MapKey::display(&location), - node_value, - )?; - }; - - match &node.value { - NodeValue::Parent { children } => { - let mut children_vec: Vec<(&MapKey, &Node)> = children.iter().collect(); - children_vec.sort_by(|(a, _), (b, _)| a.key.cmp(&b.key)); - - let mut counter = 1; - for (key, child) in &children_vec { - let mut new_location = location.clone(); - new_location.push((*key).to_owned()); - - write_node( - f, - child, - new_idention.clone(), - new_location.clone(), - counter == children_vec.len(), - false, - )?; - counter += 1; - } - } - NodeValue::Child { - path: _, - extandable: _, - } => { - // Do nothing and stop the recursion - } - } - - Ok(()) - } - - write_node(f, &self.root, String::new(), vec![], false, true)?; - - Ok(()) - } -} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/iterator.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/iterator.rs deleted file mode 100644 index 4364bb2b..00000000 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/iterator.rs +++ /dev/null @@ -1,53 +0,0 @@ -use crate::mapping::MapKey; - -use super::{MappingTree, Node, NodeValue}; - -pub struct MappingTreeIterator { - children: Vec<(Vec<MapKey>, String)>, -} - -impl MappingTreeIterator { - pub fn new(tree: &MappingTree, ignore_extendable: bool) -> Self { - let children = extract_child(vec![], &tree.root, ignore_extendable); - - Self { children } - } -} - -fn extract_child( - current_key: Vec<MapKey>, - node: &Node, - ignore_extendable: bool, -) -> Vec<(Vec<MapKey>, String)> { - match &node.value { - NodeValue::Parent { children } => children - .iter() - .map(|(key, value)| { - let mut new_key = current_key.clone(); - new_key.push(key.to_owned()); - - extract_child(new_key, value, ignore_extendable) - }) - .flatten() - .collect(), - NodeValue::Child { path, extandable } => { - if ignore_extendable { - vec![(current_key, path.to_string())] - } else { - if *extandable { - vec![(current_key, path.to_string())] - } else { - vec![] - } - } - } - } -} - -impl Iterator for MappingTreeIterator { - type Item = (Vec<MapKey>, String); - - fn next(&mut self) -> Option<Self::Item> { - self.children.pop() - } -} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs deleted file mode 100644 index ba485dc2..00000000 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs +++ /dev/null @@ -1,24 +0,0 @@ -use std::path::PathBuf; - -use crate::mapping::MapKey; - -use super::MappingTree; - -impl MappingTree { - pub fn to_lf_mappings(self, home_path: PathBuf) -> String { - let mut raw = self - .iter(true) - .map(|(key, value)| { - format!( - "map g{} cd \"{}\"\n", - MapKey::display(&key), - home_path.join(&value).display() - ) - }) - .collect::<Vec<String>>(); - - raw.sort(); - - raw.into_iter().collect() - } -} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/mod.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/mod.rs deleted file mode 100644 index 35e6d91d..00000000 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/mod.rs +++ /dev/null @@ -1,402 +0,0 @@ -use std::{collections::HashMap, mem}; - -use anyhow::{bail, Result}; -use log::debug; - -use self::iterator::MappingTreeIterator; - -use super::MapKey; - -pub mod display; -pub mod iterator; -pub mod lf_mapping; - -/// A prefix tree -#[derive(Debug)] -pub struct MappingTree { - root: Node, -} - -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum NodeValue { - Parent { children: HashMap<MapKey, Node> }, - Child { path: String, extandable: bool }, -} - -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct Node { - value: NodeValue, -} - -impl MappingTree { - pub fn new() -> Self { - Self { - root: Node::new_parent(), - } - } - - pub fn root_node(&self) -> &Node { - &self.root - } - - pub fn iter(&self, ignore_extendable: bool) -> MappingTreeIterator { - MappingTreeIterator::new(&self, ignore_extendable) - } - - /// Returns the node at the key, otherwise None. The node can be changed - pub fn get_mut(&mut self, key: &[MapKey]) -> Option<&mut Node> { - let mut current_node = &mut self.root; - for ch in key.iter() { - if let NodeValue::Parent { children } = &mut current_node.value { - current_node = children.get_mut(&ch)? - } else { - return None; - } - } - - Some(current_node) - } - - /// Returns the node at the key, otherwise the last node that matched. - pub fn try_get(&self, key: &[MapKey]) -> (&Node, Vec<MapKey>) { - let mut current_node = &self.root; - let mut current_key = vec![]; - - for ch in key.iter() { - if let NodeValue::Parent { children } = ¤t_node.value { - current_node = if let Some(node) = children.get(&ch) { - let (key, _value) = children - .get_key_value(&ch) - .expect("This exists, we checked"); - current_key.push(key.clone()); - - node - } else { - return (current_node, current_key); - }; - } else { - return (current_node, current_key); - } - } - - (current_node, current_key) - } - - pub fn include(&mut self, path: &str) -> Result<()> { - let associated_key = MapKey::new_ones_from_path(path, 1); - self.insert(&associated_key, path) - } - - pub fn insert(&mut self, key: &[MapKey], path: &str) -> Result<()> { - self.insert_node(key, Node::new_child(path.to_owned())) - } - - pub fn interleave(&mut self, key: &[MapKey], node: Node) -> Result<()> { - let want_to_be_parent = self.get_mut(&key).expect("This value exists"); - let (parent_value, _parent_children) = if let NodeValue::Parent { children } = node.value { - ( - NodeValue::Parent { - children: children.clone(), - }, - children, - ) - } else { - unreachable!("This value will be a parent") - }; - - let child_value = mem::replace(&mut want_to_be_parent.value, parent_value); - assert!(matches!( - child_value, - NodeValue::Child { - path: _, - extandable: _ - } - )); - - let child_value = if let NodeValue::Child { - path, - extandable: _, - } = child_value - { - NodeValue::Child { - path, - extandable: false, - } - } else { - unreachable!("This is only a child value") - }; - - let child = Node { value: child_value }; - - let mut new_key = key.to_vec(); - new_key.push(MapKey { - key: '.', - part_path: ".".to_owned(), - resolution: 1, - }); - self.insert_node(&new_key, child)?; - Ok(()) - } - - pub fn insert_node(&mut self, key: &[MapKey], node: Node) -> Result<()> { - let (_node, found_key) = self.try_get(key).clone(); - - if found_key != key { - let needed_nodes_key = key - .strip_prefix(&found_key[..]) - .expect("The node's location is a prefix"); - - let needed_nodes_length = needed_nodes_key.iter().count(); - - let mut current_node = self - .get_mut(&found_key[..]) - .expect("This should always exists"); - let mut current_location = found_key.clone(); - let mut counter = 1; - - for ch in needed_nodes_key.iter() { - current_location.push(ch.to_owned()); - - let next_node = if counter == needed_nodes_length { - node.clone() - } else { - Node::new_parent() - }; - - current_node = match ¤t_node.value { - NodeValue::Parent { children } => { - assert_eq!(children.get(&ch), None); - - let children = - if let NodeValue::Parent { children } = &mut current_node.value { - children - } else { - unreachable!("This is a parent, we cheched") - }; - - children.insert(ch.to_owned(), next_node); - children.get_mut(&ch).expect("Was just inserted") - } - NodeValue::Child { - path, - extandable: _, - } => { - // A node that should be a parent was classified - // as child before: - // - // 1. Remove the child node and replace it with a parent one. - // 2. Add the child node to the parent node as child, but with a '.' as MapKey. - // 3. Add the original node also as child to the parent node. - - let mut children = HashMap::new(); - let move_child_node = Node::new_child(path.to_owned()); - - children.insert( - MapKey { - key: '.', - part_path: ".".to_owned(), - resolution: 1, - }, - move_child_node, - ); - children.insert(ch.to_owned(), next_node); - - current_node.value = NodeValue::Parent { children }; - - let children = - if let NodeValue::Parent { children } = &mut current_node.value { - children - } else { - unreachable!("We just inserted the parent value.") - }; - - children.get_mut(&ch).expect("Was just inserted") - } - }; - - counter += 1; - } - } else { - fn reduce_string(a: &str) -> Option<char> { - let first_char = a.chars().take(1).last().expect("Should contain one char"); - - if a.chars().all(|ch| ch == first_char) { - return Some(first_char); - } else { - return None; - } - } - fn check_subset(a: &str, b: &str) -> bool { - if a.len() > b.len() { - let a_prefix: String = a.chars().take(b.len()).collect(); - let a_suffix: String = a.chars().skip(b.len()).collect(); - - if a_prefix == b { - let clean_suffix = reduce_string(&a_suffix); - if let Some(ch) = clean_suffix { - ch == b.chars().last().expect("Will match") - } else { - false - } - } else { - false - } - } else if b.len() > a.len() { - let b_prefix: String = b.chars().take(a.len()).collect(); - let b_suffix: String = b.chars().skip(a.len()).collect(); - - if b_prefix == a { - let clean_suffix = reduce_string(&b_suffix); - if let Some(ch) = clean_suffix { - ch == a.chars().last().expect("Will match") - } else { - false - } - } else { - false - } - } else { - a == b - } - } - - // Another node was already inserted with the same key! - // So we simple increase the resolution of the other node and this node, until their - // keys are not the same anymore. - // This only includes the last segment of the `MapKey` - // - // 1. Change both keys, until they are not equal any more - // 2. Move the wrongly placed node to the new place. - // 3. Insert our node. - let mut foreign_key = vec![found_key.last().expect("This will exist").clone()]; - let mut our_key = vec![key.last().expect("This will exist").clone()]; - - debug!( - "'{}' ('{}') and '{}' ('{}') are the same, try to find a better combination!", - MapKey::display(&our_key), - our_key[0].part_path, - MapKey::display(&foreign_key), - foreign_key[0].part_path, - ); - - // The 'a' and 'b' stuff is here, to ensure that both returning None will not match - // this condition. - if reduce_string(&foreign_key[0].part_path).unwrap_or('a') - == reduce_string(&our_key[0].part_path).unwrap_or('b') - { - bail!( - "\ -The foreign_key ('{}', path_part: '{}' -> '{}') and our_key ('{}', path_part: '{}' -> '{}') \ -have an identical path_part (when duplicated chars are removed)! -I cannot extended them via incrementation. -Please rename the paths to fix this. - ", - MapKey::display(&foreign_key), - &foreign_key[0].part_path, - reduce_string(&foreign_key[0].part_path).expect("Is some here"), - MapKey::display(&our_key), - &our_key[0].part_path, - reduce_string(&our_key[0].part_path).expect("Is some here"), - ); - } - - if check_subset(&foreign_key[0].part_path, &our_key[0].part_path) { - bail!( - "\ -The foreign_key ('{}', path_part: '{}') and our_key ('{}', path_part: '{}') \ -are subsets of one another! -A discrimination through incrementation will not work! -Please rename the paths to fix this. - ", - MapKey::display(&foreign_key), - &foreign_key[0].part_path, - MapKey::display(&our_key), - &our_key[0].part_path, - ); - } - - while our_key == foreign_key { - our_key = our_key[0].increment(our_key[our_key.len() - 1].resolution + 1); - foreign_key = - foreign_key[0].increment(foreign_key[foreign_key.len() - 1].resolution + 1); - debug!( - "Now its: '{}' ('{}') and '{}' ('{}')", - MapKey::display(&our_key), - our_key[0].part_path, - MapKey::display(&foreign_key), - foreign_key[0].part_path, - ); - } - - debug!( - "Found a better one: '{}' ('{}') and '{}' ('{}')", - MapKey::display(&our_key), - our_key[0].part_path, - MapKey::display(&foreign_key), - foreign_key[0].part_path, - ); - - let parent = self - .get_mut(&found_key[..&found_key.len() - 1]) - .expect("This will exist"); - - if let NodeValue::Parent { children } = &mut parent.value { - if let NodeValue::Child { - path: _, - extandable: _, - } = children - .get(found_key.last().expect("Exists")) - .expect("This node also exists") - .value - { - let old = children - .remove(found_key.last().expect("This will exist")) - .expect("This will be there"); - - let full_foreign_key: Vec<_> = found_key - .clone() - .into_iter() - .rev() - .skip(1) - .rev() - .chain(foreign_key.clone().into_iter()) - .collect(); - self.insert_node(&full_foreign_key, old.clone())?; - } - - let full_our_key: Vec<_> = key - .to_vec() - .into_iter() - .rev() - .skip(1) - .rev() - .chain(our_key.clone().into_iter()) - .collect(); - - self.insert_node(&full_our_key, node.clone())?; - } else { - unreachable!("This node will be a parent"); - } - } - - Ok(()) - } -} - -impl Node { - pub fn new_child(path: String) -> Self { - Self { - value: NodeValue::Child { - path, - extandable: true, - }, - } - } - pub fn new_parent() -> Self { - Self { - value: NodeValue::Parent { - children: HashMap::new(), - }, - } - } -} diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/mod.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/mod.rs index 114fdca0..21392388 100644 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/mod.rs +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/mod.rs @@ -1,156 +1,231 @@ -use std::{ - fmt::{Display, Write}, - hash::Hash, -}; - -use log::debug; - -pub mod map_tree; - -#[derive(Clone, Debug, Eq)] -pub struct MapKey { - pub key: char, +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use anyhow::Result; +use keymaps::map_tree::{Node, Trie}; +use log::{Level, debug, log_enabled, trace}; +use map_key::MapKey; + +pub mod lf_mapping; +pub mod map_key; + +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +pub struct MapChild { + pub path: String, + pub expendable: bool, +} - resolution: usize, +impl std::fmt::Display for MapChild { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(&self.path)?; + if !self.expendable { + f.write_str(" [stop]")?; + } - /// Part of the path, used to derive the key - part_path: String, + Ok(()) + } } -impl Hash for MapKey { - fn hash<H: std::hash::Hasher>(&self, state: &mut H) { - self.key.hash(state) +pub struct MappingsTrie(pub Trie<MapKey, MapChild>); +impl std::fmt::Display for MappingsTrie { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) } } -impl PartialEq for MapKey { - fn eq(&self, other: &Self) -> bool { - self.key == other.key +impl MappingsTrie { + pub fn new() -> Self { + Self(Trie::new()) } -} -impl MapKey { - pub fn new_from_part_path(part_path: &str, resolution: usize) -> Vec<Self> { - let key = Self::part_path_to_key(&part_path, resolution); - - key.chars() - .map(|ch| Self { - key: ch, - resolution, - part_path: part_path.to_owned(), - }) - .collect() + pub(crate) fn include(&mut self, path: &str) -> Result<()> { + let associated_key = MapKey::new_ones_from_path(path, 1); + self.insert(&associated_key, path) } - pub fn new_ones_from_path(path: &str, number_of_chars: usize) -> Vec<Self> { - let key: Vec<MapKey> = path - .split('/') - .map(|part| Self::new_from_part_path(part, number_of_chars)) - .flatten() - .collect(); - - debug!( - "Generated full MapKeys: '{}' -> '{}'", - path, - MapKey::display(&key) - ); - key + pub(crate) fn insert(&mut self, keys: &[MapKey], path: &str) -> Result<()> { + let value = Node::new_child(MapChild { + path: path.to_owned(), + expendable: true, + }); + self.insert_node(keys, value) } - pub fn increment(&self, target_resolution: usize) -> Vec<Self> { - let new_resolution = target_resolution; + pub(crate) fn insert_node( + &mut self, + keys: &[MapKey], + node: Node<MapKey, MapChild>, + ) -> Result<()> { + if let Err(err) = self.0.insert_node(keys, &node) { + match err { + keymaps::error::TrieInsert::KeyAlreadySet(found_keys) => { + // Another node was already inserted with the same key! + // So we simple increase the resolution of the other node and this node, until their + // keys are no longer equal. + // This only includes the last segment of the `MapKey` + // + // 1. Change both keys, until they are not equal any more + // 2. Move the wrongly placed node to the new place. + // 3. Insert our node. + assert_eq!(keys, found_keys); + + let mut foreign_keys = + vec![found_keys.last().expect("This will exist").clone()]; + let mut our_keys = vec![keys.last().expect("This will exist").clone()]; + + debug!( + "'{}' ('{}') and '{}' ('{}') are the same, trying to find a better combination!", + MapKey::display(&our_keys), + our_keys[0].part_path, + MapKey::display(&foreign_keys), + foreign_keys[0].part_path, + ); + + our_keys[0].can_tiebreak_with(&foreign_keys[0])?; + + while our_keys == foreign_keys { + our_keys = + our_keys[0].increment(our_keys[our_keys.len() - 1].resolution + 1); + foreign_keys = foreign_keys[0] + .increment(foreign_keys[foreign_keys.len() - 1].resolution + 1); + debug!( + "Now its: '{}' ('{}') and '{}' ('{}')", + MapKey::display(&our_keys), + our_keys[0].part_path, + MapKey::display(&foreign_keys), + foreign_keys[0].part_path, + ); + } + debug!( + "Found a better one: '{}' ('{}') and '{}' ('{}')", + MapKey::display(&our_keys), + our_keys[0].part_path, + MapKey::display(&foreign_keys), + foreign_keys[0].part_path, + ); + + let parent_keys = &found_keys[..&found_keys.len() - 1]; + + { + if self + .0 + .get(&found_keys) + .expect("This will exist") + .value() + .is_some() + { + // This is a child, we must replace it with a parent. + let other_node = self + .0 + .replace_node(&found_keys, Node::new_parent()) + .expect("This node exists"); + + { + let mut full_foreign_keys = parent_keys.to_vec(); + full_foreign_keys.append(&mut foreign_keys); + self.insert_node(&full_foreign_keys, other_node)?; + } + } + } - // debug!("Incrementing: '{}' ('{}')", &self, &self.part_path); + { + let mut full_our_keys = parent_keys.to_vec(); + full_our_keys.append(&mut our_keys); + self.insert_node(&full_our_keys, node)?; + } - let added_chars = if new_resolution < self.part_path.len() { - MapKey::part_path_to_key(&self.part_path, new_resolution) + Ok(()) + } + keymaps::error::TrieInsert::KeyIncludesChild { + child_key: key, + child_value, + } => { + // A node that should be a parent was classified + // as child before: + // + // 1. Remove the child node and replace it with a parent one. + // 2. Add the child node to the parent node as child, but with a '.' as MapKey. + // 3. Add the original node also as child to the parent node. + + assert_eq!(key, keys); + + let (fetched_child_value, mut child_key) = self.0.try_get(keys); + assert_eq!(fetched_child_value.value(), Some(&child_value)); + + trace!( + "Replacing child ('{}') with a parent, so that we can continue from this point.", + MapKey::display(&child_key) + ); + + let child = self + .0 + .replace_node(&child_key, Node::new_parent()) + .expect("Node exists"); + assert_eq!(child.value(), Some(&child_value)); + + child_key.push(MapKey { + key: '.', + part_path: ".".to_owned(), + resolution: 1, + }); + self.0 + .insert_node(&child_key, &child) + .expect("We just created a parent here"); + + // Recursive call, because this key could have hit the previous child directly + // (thus it will now trigger the `KeyAlreadySet` error.) + self.insert_node(keys, node) + } + } } else { - let mut generated_chars = - MapKey::part_path_to_key(&self.part_path, self.part_path.len()); - - generated_chars.extend( - (0..(new_resolution - self.part_path.len())) - .into_iter() - .map(|_| self.part_path.chars().last().expect("This will exists")), - ); - - generated_chars - }; - - let part_path = self.part_path.clone(); - let output: Vec<Self> = added_chars - .chars() - .enumerate() - .map(|(res, ch)| MapKey { - key: ch, - resolution: res + 1, - part_path: part_path.clone(), - }) - .collect(); - - // debug!("Finished increment: '{}' ('{}')", MapKey::display(&output), output[0].part_path); - output + Ok(()) + } } - pub fn display(values: &[Self]) -> String { - values.iter().map(|value| value.key.clone()).collect() - } - fn part_path_to_key(part: &str, number_of_chars: usize) -> String { - fn make(pat: char, part: &str, number_of_chars: usize) -> String { - let mut acc = String::new(); - - if !part.split(pat).all(|part| part.len() > 0) { - panic!( - "\ -Can't turn this path '{}' to a mapping. -This should not happen, please report the bug!", - part - ) - } + /// Add a new [`MappingsTrie`] at the position `keys` into this Trie. + pub(crate) fn add_trie(&mut self, keys: &[MapKey], trie: Self) -> Result<()> { + if log_enabled!(Level::Trace) { + trace!("Adding mappings under '{}':", MapKey::display(keys)); + eprintln!("{trie}"); - let mut last_working = None; - for i in 0..number_of_chars { - for str in part.split(pat) { - if acc.len() != number_of_chars { - acc.push(match str.chars().nth(i) { - Some(ch) => ch, - None => { - if let Some(last) = last_working { - str.chars().nth(last).expect("This should always exist") - } else { - last_working = Some(i - 1); - str.chars().nth(i - 1).expect("This should always exist") - } - } - }) - } - } - } + trace!("Self is:"); + eprintln!("{self}"); + } + + let replaced = self + .0 + .replace_node(keys, trie.0.root_node().to_owned()) + .expect("This value exists"); - acc + if log_enabled!(Level::Trace) { + trace!("After replace adding the new trie"); + eprintln!("{self}"); } - let value = if part.contains('_') && !part.starts_with('_') && !part.ends_with('_') { - make('_', part, number_of_chars) - } else if part.contains('-') && !part.starts_with('-') && !part.ends_with('-') { - make('-', part, number_of_chars) - } else { - part.chars().take(number_of_chars).collect::<String>() - }; - - assert_eq!( - value.len(), - number_of_chars, - "'{}' does not have expected length of: {}", - value, - number_of_chars - ); - value - } -} + { + let mut new_keys = keys.to_vec(); + new_keys.push(MapKey { + key: '.', + part_path: ".".to_owned(), + resolution: 1, + }); + + let mut value = replaced.value().expect("Is a child").clone(); + value.expendable = false; + + trace!("Re-inserting '{}' into self.", MapKey::display(keys)); + self.0 + .insert_node(&new_keys, &Node::new_child(value)) + .expect("This key is not used."); + } -impl Display for MapKey { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_char(self.key) + Ok(()) } } diff --git a/pkgs/by-name/lf/lf-make-map/tests/base.sh b/pkgs/by-name/lf/lf-make-map/tests/base.sh new file mode 100755 index 00000000..c7694985 --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/tests/base.sh @@ -0,0 +1,25 @@ +#! /usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +cd "$(dirname "$0")" || exit 2 + +cargo build +execute_make_maps() { + ../target/debug/lf-make-map "$@" +} + +fd . cases --max-depth 1 --type directory | while read -r case; do + echo "Executing '$case/test.sh'" + + # shellcheck source=/dev/null + LOCATION="$case/test.sh" . "$case/test.sh" +done diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh b/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh new file mode 100755 index 00000000..90ebe1ce --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh @@ -0,0 +1,27 @@ +#! /usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +test="$(mktemp --directory)" + +cleanup() { + rm --recursive "$test" +} +trap cleanup EXIT + +cat <<EOF | while read -r name; do mkdir --parents "$test/media/books/${name}"; done +Andre A +Anton B +Andon C +Anton D +EOF + +execute_make_maps --home-name "$test" --depth 100 generate "$test"/* >/dev/null diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/simple/output.old b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/output.old new file mode 100644 index 00000000..90591f16 --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/output.old @@ -0,0 +1,46 @@ +map gdd. cd "/tmp/tmp.DfcgjemfCG/d" +map gddcc. cd "/tmp/tmp.DfcgjemfCG/d/c" +map gddccb. cd "/tmp/tmp.DfcgjemfCG/d/c/b" +map gddccbc. cd "/tmp/tmp.DfcgjemfCG/d/c/b/c" +map gddccbcf. cd "/tmp/tmp.DfcgjemfCG/d/c/b/c/file.test" +map gddccd. cd "/tmp/tmp.DfcgjemfCG/d/c/d" +map gddccdf. cd "/tmp/tmp.DfcgjemfCG/d/c/d/f" +map gddccdff. cd "/tmp/tmp.DfcgjemfCG/d/c/d/f/file.test2" +map gddcco. cd "/tmp/tmp.DfcgjemfCG/d/c/other" +map gddccof. cd "/tmp/tmp.DfcgjemfCG/d/c/other/file.test3" +map gddct. cd "/tmp/tmp.DfcgjemfCG/d/cll_the-things" +map gddcto. cd "/tmp/tmp.DfcgjemfCG/d/cll_the-things/other" +map gddctof. cd "/tmp/tmp.DfcgjemfCG/d/cll_the-things/other/file.test4" +map gddm. cd "/tmp/tmp.DfcgjemfCG/d/mcybe some whitespcce" +map gddmt. cd "/tmp/tmp.DfcgjemfCG/d/mcybe some whitespcce/test.file5" +map gdi. cd "/tmp/tmp.DfcgjemfCG/dir" +map gdicc. cd "/tmp/tmp.DfcgjemfCG/dir/c" +map gdiccb. cd "/tmp/tmp.DfcgjemfCG/dir/c/b" +map gdiccbc. cd "/tmp/tmp.DfcgjemfCG/dir/c/b/c" +map gdiccbcf. cd "/tmp/tmp.DfcgjemfCG/dir/c/b/c/file.test" +map gdiccd. cd "/tmp/tmp.DfcgjemfCG/dir/c/d" +map gdiccdf. cd "/tmp/tmp.DfcgjemfCG/dir/c/d/f" +map gdiccdff. cd "/tmp/tmp.DfcgjemfCG/dir/c/d/f/file.test2" +map gdicco. cd "/tmp/tmp.DfcgjemfCG/dir/c/other" +map gdiccof. cd "/tmp/tmp.DfcgjemfCG/dir/c/other/file.test3" +map gdict. cd "/tmp/tmp.DfcgjemfCG/dir/cll_the-things" +map gdicto. cd "/tmp/tmp.DfcgjemfCG/dir/cll_the-things/other" +map gdictof. cd "/tmp/tmp.DfcgjemfCG/dir/cll_the-things/other/file.test4" +map gdim. cd "/tmp/tmp.DfcgjemfCG/dir/mcybe some whitespcce" +map gdimt. cd "/tmp/tmp.DfcgjemfCG/dir/mcybe some whitespcce/test.file5" +map gdo. cd "/tmp/tmp.DfcgjemfCG/dor" +map gdocc. cd "/tmp/tmp.DfcgjemfCG/dor/c" +map gdoccb. cd "/tmp/tmp.DfcgjemfCG/dor/c/b" +map gdoccbc. cd "/tmp/tmp.DfcgjemfCG/dor/c/b/c" +map gdoccbcf. cd "/tmp/tmp.DfcgjemfCG/dor/c/b/c/file.test" +map gdoccd. cd "/tmp/tmp.DfcgjemfCG/dor/c/d" +map gdoccdf. cd "/tmp/tmp.DfcgjemfCG/dor/c/d/f" +map gdoccdff. cd "/tmp/tmp.DfcgjemfCG/dor/c/d/f/file.test2" +map gdocco. cd "/tmp/tmp.DfcgjemfCG/dor/c/other" +map gdoccof. cd "/tmp/tmp.DfcgjemfCG/dor/c/other/file.test3" +map gdoct. cd "/tmp/tmp.DfcgjemfCG/dor/cll_the-things" +map gdocto. cd "/tmp/tmp.DfcgjemfCG/dor/cll_the-things/other" +map gdoctof. cd "/tmp/tmp.DfcgjemfCG/dor/cll_the-things/other/file.test4" +map gdom. cd "/tmp/tmp.DfcgjemfCG/dor/mcybe some whitespcce" +map gdomt. cd "/tmp/tmp.DfcgjemfCG/dor/mcybe some whitespcce/test.file5" + diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/simple/output.old.license b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/output.old.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/output.old.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh new file mode 100755 index 00000000..6e127d28 --- /dev/null +++ b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh @@ -0,0 +1,49 @@ +#! /usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# We need to hard code this, so that our output matches the golden sample. +base="/tmp/tmp.DfcgjemfCG" +test="$(mktemp --directory)" + +[ -d "$base" ] && { + echo "$base already exists!" + exit 1 +} + +mkdir "$base" + +cleanup() { + rm --recursive "$base" "$test" +} +trap cleanup EXIT + +mkdir --parents "$base/dir/c/b/c/file.test" +mkdir --parents "$base/dir/c/d/f/file.test2" +mkdir --parents "$base/dir/c/other/file.test3" +mkdir --parents "$base/dir/cll_the-things/other/file.test4" +mkdir --parents "$base/dir/mcybe some whitespcce/test.file5" + +mkdir --parents "$base/dor/c/b/c/file.test" +mkdir --parents "$base/dor/c/d/f/file.test2" +mkdir --parents "$base/dor/c/other/file.test3" +mkdir --parents "$base/dor/cll_the-things/other/file.test4" +mkdir --parents "$base/dor/mcybe some whitespcce/test.file5" + +mkdir --parents "$base/d/c/b/c/file.test" +mkdir --parents "$base/d/c/d/f/file.test2" +mkdir --parents "$base/d/c/other/file.test3" +mkdir --parents "$base/d/cll_the-things/other/file.test4" +mkdir --parents "$base/d/mcybe some whitespcce/test.file5" + +execute_make_maps --home-name "$base" --depth 100 generate "$base"/* >"$test/output.new" + +diff "$test/output.new" "$(dirname "$LOCATION")/output.old" diff --git a/pkgs/by-name/lf/lf-make-map/update.sh b/pkgs/by-name/lf/lf-make-map/update.sh index 7d517e8b..23d90a86 100755 --- a/pkgs/by-name/lf/lf-make-map/update.sh +++ b/pkgs/by-name/lf/lf-make-map/update.sh @@ -1,4 +1,14 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + [ "$1" = "upgrade" ] && cargo upgrade cargo update diff --git a/pkgs/by-name/ll/ll/ll.sh b/pkgs/by-name/ll/ll/ll.sh deleted file mode 100755 index 73328e3e..00000000 --- a/pkgs/by-name/ll/ll/ll.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -last_directory="$(mktemp)" - -command lf -last-dir-path="$last_directory" "$@" - -dir="$(cat "$last_directory")" -if cd "$dir"; then - [ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" - echo "$dir" >"$XDG_RUNTIME_DIR/ll/last_directory" -else - die "$dir does not exist!" -fi - -rm "$last_directory" -# vim: ft=sh diff --git a/pkgs/by-name/ll/ll/package.nix b/pkgs/by-name/ll/ll/package.nix deleted file mode 100644 index 4c13b40e..00000000 --- a/pkgs/by-name/ll/ll/package.nix +++ /dev/null @@ -1,9 +0,0 @@ -{sysLib}: -sysLib.writeShellScript { - name = "ll"; - src = ./ll.sh; - generateCompletions = false; - - # `ll` must be able to change the path of the running shell. - wrap = false; -} diff --git a/pkgs/by-name/lm/lm/lm.sh b/pkgs/by-name/lm/lm/lm.sh deleted file mode 100755 index d5fdca10..00000000 --- a/pkgs/by-name/lm/lm/lm.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -if [ -f "$XDG_RUNTIME_DIR/ll/last_directory" ]; then - last_dir="$(cat "$XDG_RUNTIME_DIR/ll/last_directory")" - cd "$last_dir" || die "$last_dir does not exist!" -else - msg "No last directory saved (try using ll instead)." -fi -# vim: ft=sh diff --git a/pkgs/by-name/lm/lm/package.nix b/pkgs/by-name/lm/lm/package.nix deleted file mode 100644 index ef417cd2..00000000 --- a/pkgs/by-name/lm/lm/package.nix +++ /dev/null @@ -1,9 +0,0 @@ -{sysLib}: -sysLib.writeShellScript { - name = "lm"; - src = ./lm.sh; - generateCompletions = false; - - # `ll` must be able to change the path of the running shell. - wrap = false; -} diff --git a/pkgs/by-name/lo/lock/lock.sh b/pkgs/by-name/lo/lock/lock.sh index 3101ef9a..1c068e57 100755 --- a/pkgs/by-name/lo/lock/lock.sh +++ b/pkgs/by-name/lo/lock/lock.sh @@ -1,18 +1,25 @@ -#!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=bash context="$(task _get rc.context)" -[ "$context" ] && task context none +[ -n "$context" ] && task context none # We have ensured that only one task is active active="$(task +ACTIVE _ids)" -[ "$active" ] && task stop "$active" +[ -n "$active" ] && task stop "$active" swaylock -[ "$active" ] && task start "$active" +[ -n "$active" ] && task start "$active" -[ "$context" ] && task context "$context" +[ -n "$context" ] && task context "$context" # vim: ft=sh diff --git a/pkgs/by-name/lo/lock/package.nix b/pkgs/by-name/lo/lock/package.nix index 0e6e38d0..572ebb0b 100644 --- a/pkgs/by-name/lo/lock/package.nix +++ b/pkgs/by-name/lo/lock/package.nix @@ -1,15 +1,25 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, - taskwarrior, + writeShellApplication, + taskwarrior3, swaylock, }: -sysLib.writeShellScript { +writeShellApplication { name = "lock"; - src = ./lock.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ - taskwarrior + text = builtins.readFile ./lock.sh; + runtimeInputs = [ + taskwarrior3 swaylock ]; + meta = { + mainProgram = "lock"; + }; } diff --git a/pkgs/by-name/mp/mpp-beetrm/mpp-beetrm.sh b/pkgs/by-name/mp/mpp-beetrm/mpp-beetrm.sh index 3209503c..83784743 100755 --- a/pkgs/by-name/mp/mpp-beetrm/mpp-beetrm.sh +++ b/pkgs/by-name/mp/mpp-beetrm/mpp-beetrm.sh @@ -1,7 +1,14 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. beet remove --delete \ title:"$(mpc --format '%title%' current)" \ diff --git a/pkgs/by-name/mp/mpp-beetrm/package.nix b/pkgs/by-name/mp/mpp-beetrm/package.nix index 24b56606..00672838 100644 --- a/pkgs/by-name/mp/mpp-beetrm/package.nix +++ b/pkgs/by-name/mp/mpp-beetrm/package.nix @@ -1,15 +1,24 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies mpc, beets, }: -sysLib.writeShellScript { +writeShellApplication { name = "mpp-beetrm"; - src = ./mpp-beetrm.sh; - generateCompletions = false; - keepPath = false; + text = builtins.readFile ./mpp-beetrm.sh; + inheritPath = false; - dependencies = [ + runtimeInputs = [ mpc beets ]; diff --git a/pkgs/by-name/mp/mpp-lyrics/mpp-lyrics.sh b/pkgs/by-name/mp/mpp-lyrics/mpp-lyrics.sh index 004c67c7..fa1cac49 100755 --- a/pkgs/by-name/mp/mpp-lyrics/mpp-lyrics.sh +++ b/pkgs/by-name/mp/mpp-lyrics/mpp-lyrics.sh @@ -1,11 +1,21 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -( - cd "%MPD_MUSIC_DIR" || die "No music dir!" - exiftool "$(mpc --format '%file%' current)" -json | jq '.[0].Lyrics' -r | less -) +die() { + echo "Error: $1" + exit 1 +} + +cd "$XDG_MUSIC_DIR/beets" || die "No music dir!" +exiftool "$(mpc --format '%file%' current)" -json | jq '.[0].Lyrics' --raw-output | less # vim: ft=sh diff --git a/pkgs/by-name/mp/mpp-lyrics/package.nix b/pkgs/by-name/mp/mpp-lyrics/package.nix index 76b590c7..0b6d8993 100644 --- a/pkgs/by-name/mp/mpp-lyrics/package.nix +++ b/pkgs/by-name/mp/mpp-lyrics/package.nix @@ -1,23 +1,27 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies exiftool, mpc, jq, less, locale, # dependency of less - mpd_music_dir ? "\${XDG_MUSIC_DIR}", }: -sysLib.writeShellScript { +writeShellApplication { name = "mpp-lyrics"; - src = ./mpp-lyrics.sh; - generateCompletions = false; - keepPath = false; + text = builtins.readFile ./mpp-lyrics.sh; + inheritPath = false; - replacementStrings = { - MPD_MUSIC_DIR = mpd_music_dir; - }; - - dependencies = [ + runtimeInputs = [ exiftool mpc jq diff --git a/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh b/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh index 3fe9a6b6..d76e73b8 100755 --- a/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh +++ b/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh @@ -1,14 +1,18 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -tracks="$(mktmp)" -beet list "$@" --path >"$tracks" - -while read -r track; do +beet list "$@" --path | while read -r track; do mpc add "$track" -done <"$tracks" +done mpc playlist # vim: ft=sh diff --git a/pkgs/by-name/mp/mpp-searchadd/package.nix b/pkgs/by-name/mp/mpp-searchadd/package.nix index a98472d1..91ff05e9 100644 --- a/pkgs/by-name/mp/mpp-searchadd/package.nix +++ b/pkgs/by-name/mp/mpp-searchadd/package.nix @@ -1,15 +1,24 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies. mpc, beets, }: -sysLib.writeShellScript { +writeShellApplication { name = "mpp-searchadd"; - src = ./mpp-searchadd.sh; - generateCompletions = false; - keepPath = false; + text = builtins.readFile ./mpp-searchadd.sh; + inheritPath = false; - dependencies = [ + runtimeInputs = [ mpc beets ]; diff --git a/pkgs/by-name/mp/mpp/mpp.sh b/pkgs/by-name/mp/mpp/mpp.sh index 538a56ee..3ac98ddb 100755 --- a/pkgs/by-name/mp/mpp/mpp.sh +++ b/pkgs/by-name/mp/mpp/mpp.sh @@ -1,9 +1,16 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -case "$1" in +case "${1-}" in "searchadd") shift 1 mpp-searchadd "$@" diff --git a/pkgs/by-name/mp/mpp/package.nix b/pkgs/by-name/mp/mpp/package.nix index 9c5315b0..f0e454f7 100644 --- a/pkgs/by-name/mp/mpp/package.nix +++ b/pkgs/by-name/mp/mpp/package.nix @@ -1,20 +1,35 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, - mpc, - fd, + writeShellApplication, symlinkJoin, stdenv, + # Dependencies + mpc, + mpp-searchadd, + mpp-lyrics, + mpp-beetrm, + # Build dependencies + fd, zsh, }: let - script = sysLib.writeShellScript { + script = writeShellApplication { name = "mpp"; - src = ./mpp.sh; - generateCompletions = false; - # We source the wrappers from the environment, to ensure that they have the same - # configurations (e.g. MPD_MUSIC_DIR in `mpc-lyrics`) - keepPath = true; - dependencies = [ + text = builtins.readFile ./mpp.sh; + inheritPath = false; + + runtimeInputs = [ mpc + mpp-searchadd + mpp-lyrics + mpp-beetrm ]; }; @@ -55,6 +70,8 @@ fd "." --hidden --type file | while read -r file_path; do sed --in-place 's/mpc/mpp/g' "$file_path" done + + # TODO(@bpeetz): Also change this in man-pages. <2025-05-20> ''; installPhase = '' @@ -64,6 +81,8 @@ }; in symlinkJoin { - name = "mpp-merged"; + name = "mpp"; paths = [script mpcShare]; + + inherit (script) meta; } diff --git a/pkgs/by-name/na/nato/nato.py b/pkgs/by-name/na/nato/nato.py deleted file mode 100755 index e9d15f56..00000000 --- a/pkgs/by-name/na/nato/nato.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 -# originally from here: https://cgit.pacien.net/desktop-utilities/ - -import sys - -alphabet = { - "nato": { - "A": "Alfa", # No idea why this is not just 'Alpha' .. - "B": "Bravo", - "C": "Charlie", - "D": "Delta", - "E": "Echo", - "F": "Foxtrot", - "G": "Golf", - "H": "Hotel", - "I": "India", - "J": "Juliett", - "K": "Kilo", - "L": "Lima", - "M": "Mike", - "N": "November", - "O": "Oscar", - "P": "Papa", - "Q": "Quebec", - "R": "Romeo", - "S": "Sierra", - "T": "Tango", - "U": "Uniform", - "V": "Victor", - "W": "Whiskey", - "X": "X-ray", - "Y": "Yankee", - "Z": "Zulu", - "0": "Nadazero", - "1": "Unaone", - "2": "Bissotwo", - "3": "Terrathree", - "4": "Kartefour", - "5": "Pantafive", - "6": "Soxisix", - "7": "Setteseven", - "8": "Oktoeight", - "9": "Novenine", - ",": "Comma", - "/": "Forward slash", - ".": "Stop/Decimal", - }, - "german": { - "A": "Aachen", - "Ä": "Umlaut Aachen", - "B": "Berlin", - "C": "Chemnitz", - "D": "Düsseldorf", - "E": "Essen", - "F": "Frankfurt", - "G": "Goslar", - "H": "Hamburg", - "I": "Ingelheim", - "J": "Jena", - "K": "Köln", - "L": "Leipzig", - "M": "München", - "N": "Nürnberg", - "O": "Offenbach", - "Ö": "Umlaut Offenbach", - "P": "Potsdam", - "Q": "Quickborn", - "R": "Rostock", - "S": "Salzwedel", - "ẞ": "Eszett", - "T": "Tübingen", - "U": "Unna", - "Ü": "Umlaut Unna", - "V": "Völklingen", - "W": "Wuppertal", - "X": "Xanten", - "Y": "Ypsilon", - "Z": "Zwickau", - }, -} - - -def str_to_telephony(phrase, language): - language_alphabet = alphabet[language] - - return [ - language_alphabet[c] if c in language_alphabet else c for c in phrase.upper() - ] - - -language = sys.argv[1] -if language not in ["nato", "german"]: - print( - f"Langugae '{language}' is not a valid language, only 'nato' and 'german' are!", - file=sys.stderr, - ) - exit(1) - -print( - "\n".join( - str_to_telephony( - " ".join(sys.argv[2:]), - language, - ) - ) -) diff --git a/pkgs/by-name/na/nato/package.nix b/pkgs/by-name/na/nato/package.nix deleted file mode 100644 index 17fe7d1a..00000000 --- a/pkgs/by-name/na/nato/package.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - lib, - python3, - runCommandLocal, - makeWrapper, -}: let - write_python = { - name, - dependencies_system ? [], - dependencies_python ? _: [], - keepPath ? false, - }: let - src = ./${name}.py; - dependencies = - [(python3.withPackages dependencies_python)] - ++ dependencies_system; - path_setting = - if keepPath - then "--prefix PATH :" - else "--set PATH"; - in - runCommandLocal name { - nativeBuildInputs = [makeWrapper] ++ dependencies; - } - '' - install -m755 ${src} -D "$out/bin/${name}" - patchShebangs "$out/bin/${name}" - wrapProgram "$out/bin/${name}" ${path_setting} ${lib.makeBinPath dependencies}; - ''; -in - write_python { - name = "nato"; - dependencies_python = ps: []; - } diff --git a/pkgs/by-name/ne/neorg/functions/add.sh b/pkgs/by-name/ne/neorg/functions/add.sh deleted file mode 100644 index 5a830a10..00000000 --- a/pkgs/by-name/ne/neorg/functions/add.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env dash - -add0open_taskwarrior_project_file() { - task_project_file="%TASK_PROJECT_FILE" - - cd "$(dirname $task_project_file)" || die "BUG: task_project_file ('$task_project_file') can't be accessed" - - git_dir="$(search_flake_base_dir)" - [ "$git_dir" ] || die "(BUG): No git directory?" - cd "$git_dir" || die "Unreachable, this MUST exists" - - nvim "$task_project_file" - git add "$task_project_file" - - base_task_project_file_path="$(awk "{ gsub(\"$git_dir/\", \"\", \$0); print }" "$(ptmp "$task_project_file")")" - git add $task_project_file - - # Check that only the project file has been added (and that our file is actually - # modified) - if git status --porcelain=v2 | awk -v path="$base_task_project_file_path" 'BEGIN { hit = 0 } { if ($2 ~ /A./ || $2 ~ /M./) { if ($NF ~ path) { hit = 1 } else { hit = 0; exit 1 } } } END { if (hit == 1) { exit 0 } else { exit 1 } }'; then - git commit --verbose --message="chore($(dirname "$base_task_project_file_path")): Update" - fi -} diff --git a/pkgs/by-name/ne/neorg/functions/context.sh b/pkgs/by-name/ne/neorg/functions/context.sh deleted file mode 100644 index 7095847d..00000000 --- a/pkgs/by-name/ne/neorg/functions/context.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env dash - -context0open_current_task_context() { - current_context="$(utils0get_current_context)" - - if [ "$current_context" ]; then - context_path="$(utils0get_current_context_path "$current_context")" - - extended_neorg_project_dir="$(utils0get_neorg_project_dir)" - cd "$extended_neorg_project_dir" || die "(BUG?): Can not access the project dir: $extended_neorg_project_dir" - - nvim "$extended_neorg_project_dir/$context_path" - - git add . - git commit --message="chore($(dirname "$context_path")): Update" --no-gpg-sign - else - warn "No context active" - fi -} - -context0open_current_task_context_at_task_id() { - task_id="$1" - current_context="$(utils0get_current_context)" - - if [ "$current_context" ]; then - context_path="$(utils0get_current_context_path "$current_context")" - extended_neorg_project_dir="$(utils0get_neorg_project_dir)" - task_uuid="$(task "$task_id" uuids)" - - cd "$extended_neorg_project_dir" || die "(BUG?): Can not access the project dir: $extended_neorg_project_dir" - - if ! grep -q "% $task_uuid" "$extended_neorg_project_dir/$context_path"; then - echo "* TITLE (% $task_uuid)" >>"$extended_neorg_project_dir/$context_path" - fi - - nvim "$extended_neorg_project_dir/$context_path" -c "/% $task_uuid" - - git add . - git commit --message="chore($(dirname "$context_path")): Update" --no-gpg-sign - else - warn "No context active" - fi -} diff --git a/pkgs/by-name/ne/neorg/functions/dmenu.sh b/pkgs/by-name/ne/neorg/functions/dmenu.sh deleted file mode 100644 index 5a138982..00000000 --- a/pkgs/by-name/ne/neorg/functions/dmenu.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env dash - -dmenu0open_context_in_browser() { - project="$(echo "%ALL_PROJECTS_PIPE" | rofi -sep "|" -dmenu)" - - if [ "$project" ]; then - [ -d "%NEORG_REVIEW_PATH" ] || mkdir --parents "%NEORG_REVIEW_PATH" - [ -f "%NEORG_REVIEW_PATH/$project.lock" ] || touch "%NEORG_REVIEW_PATH/$project.lock" - project0open_project_in_browser "$project" - else - notify-send "(neorg/dmenu) No project selected" - exit 1 - fi -} diff --git a/pkgs/by-name/ne/neorg/functions/f_start.sh b/pkgs/by-name/ne/neorg/functions/f_start.sh deleted file mode 100644 index 2423dd44..00000000 --- a/pkgs/by-name/ne/neorg/functions/f_start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env dash - -fstart0start_new_task() { - task_id="$1" - fstop0stop_current_task - task start "$task_id" -} diff --git a/pkgs/by-name/ne/neorg/functions/f_stop.sh b/pkgs/by-name/ne/neorg/functions/f_stop.sh deleted file mode 100644 index e4ff0b94..00000000 --- a/pkgs/by-name/ne/neorg/functions/f_stop.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env dash - -fstop0stop_current_task() { - # we ensured that only one task may be active - active="$(task +ACTIVE _ids)" - [ "$active" ] && task stop "$active" -} diff --git a/pkgs/by-name/ne/neorg/functions/inputs.sh b/pkgs/by-name/ne/neorg/functions/inputs.sh deleted file mode 100644 index d47b129a..00000000 --- a/pkgs/by-name/ne/neorg/functions/inputs.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env dash - -_git_commit() { - message="$1" - - cd "$(dirname "%NEORG_INPUTS_STORAGE_FILE")" || die "BUG. This should exist." - [ -d .git ] || git init - git add . - git commit --message "$message" --no-gpg-sign -} - -inputs0add() { - url_file="$1" - - mkdir --parents "$(dirname "%NEORG_INPUTS_STORAGE_FILE")" - - { - # Add another newline - echo "" - # echo "# $url_file " - - clean "$url_file" - } >>"%NEORG_INPUTS_STORAGE_FILE" && - msg2 "Successfully added file '$url_file' with $(clean "$url_file" | wc -l) entries to the url list" - - _git_commit "Add entries from '$url_file' ($(clean "$url_file" | wc -l))" -} - -inputs0review() { - base_profile="$1" - - [ -f "%NEORG_INPUTS_STORAGE_FILE" ] || die "'%NEORG_INPUTS_STORAGE_FILE' is not a file. Have you added something with 'inputs_add' yet?" - - done_urls="$(mktmp)" - - # We assume that the project is not yet open. - firefox -P "$base_profile" & - # Give it some time to start up. - sleep 2 - - if [ "$(wc -l <"%NEORG_INPUTS_STORAGE_FILE")" -gt 100 ]; then - echo "Your would want to review more than 100 inputs. Limiting it to the first 100 entries." - fi - - head --lines=100 "%NEORG_INPUTS_STORAGE_FILE" | while read -r url; do - echo "-> '$url'" - firefox -P "$base_profile" "$url" - - echo "$url" >>"$done_urls" - done - - # Wait for the Firefox process from above to finish. - wait - - tmp="$(mktmp)" - # source: https://stackoverflow.com/a/24324455 - awk 'NR==FNR {a[$0]=1; next} !a[$0]' "$done_urls" "%NEORG_INPUTS_STORAGE_FILE" >"$tmp" - - mv "$tmp" "%NEORG_INPUTS_STORAGE_FILE" - - _git_commit "Dump entries into firefox profile '$base_profile'" -} diff --git a/pkgs/by-name/ne/neorg/functions/list.sh b/pkgs/by-name/ne/neorg/functions/list.sh deleted file mode 100644 index 10659457..00000000 --- a/pkgs/by-name/ne/neorg/functions/list.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env dash - -list0list_all_contexts_newline() { - print "%ALL_PROJECTS_NEWLINE" -} -list0list_all_contexts_comma() { - print "%ALL_PROJECTS_COMMA" -} diff --git a/pkgs/by-name/ne/neorg/functions/project.sh b/pkgs/by-name/ne/neorg/functions/project.sh deleted file mode 100644 index 64591850..00000000 --- a/pkgs/by-name/ne/neorg/functions/project.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env dash - -project0open_current_context_in_browser() { - current_context="$(utils0get_current_context)" - [ "$current_context" ] || die "No current context to use" - project0open_context_in_browser "$(utils0context2project "$current_context")" -} - -project0open_project_in_browser() { - project="$1" - [ "$project" ] || die "BUG: No context supplied to project0open_context_in_browser" - - old_context="$(utils0get_current_context)" - # We have ensured that only one task may be active - old_started_task="$(task +ACTIVE _ids)" - - tracking="$(mktmp)" - task "project:$project" _ids | xargs --no-run-if-empty task _zshids >"$tracking" - task context "$(utils0project2context "$project")" - - while read -r description; do - desc="$(echo "$description" | awk -F: '{print $2}')" - if [ "$desc" = "tracking" ]; then - task_id="$(echo "$description" | awk -F: '{print $1}')" - notify-send "(Neorg)" "Starting task $project -> $desc" - task start "$task_id" - break - fi - done <"$tracking" - - firefox -P "$project" - - task stop "$task_id" - [ "$old_started_task" ] && task start "$old_started_task" - - if [ "$old_context" ]; then - task context "$old_context" - else - task context none - fi -} diff --git a/pkgs/by-name/ne/neorg/functions/review.sh b/pkgs/by-name/ne/neorg/functions/review.sh deleted file mode 100644 index a0a9ab8d..00000000 --- a/pkgs/by-name/ne/neorg/functions/review.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env dash - -review0start() { - for project in $(list0list_all_contexts_newline); do - if [ -f "%NEORG_REVIEW_PATH/$project.lock" ]; then - msg "Reviewing '$project'" - notify-send "Neorg" "Reviewing '$project'" - firefox -P "$project" - rm "%NEORG_REVIEW_PATH/$project.lock" - fi - done -} diff --git a/pkgs/by-name/ne/neorg/functions/utils.sh b/pkgs/by-name/ne/neorg/functions/utils.sh deleted file mode 100644 index c3843e8e..00000000 --- a/pkgs/by-name/ne/neorg/functions/utils.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env dash - -# Runs it's first argument and then the second, regardless if the first failed or -# succeeded -utils0chain() { - eval "$1" - eval "$2" -} - -utils0get_current_context() { - current_context="$(task _get rc.context)" - printf "%s\n" "$current_context" -} - -utils0get_current_context_path() { - current_context="$1" - context_path="$(task _get rc.context."$current_context".rc.neorg_path 2>/dev/null)" - if ! [ "$context_path" ]; then - context_path="$(grep "context.$current_context.rc.neorg_path" "%HOME_TASKRC" | awk 'BEGIN {FS="="} {print $2}')" - [ "$context_path" ] || die "All contexts should have a 'neorg_path' set!" - fi - printf "%s\n" "$context_path" -} - -utils0get_neorg_project_dir() { - # Perform shell expansion of Tilde - neorg_project_dir="$(sed "s|^~|$HOME|" "$(ptmp "%DEFAULT_NEORG_PROJECT_DIR")")" - printf "%s\n" "$neorg_project_dir" -} - -utils0project2context() { - project="$1" - context="$(sed 's|\.|_|g' "$(ptmp "$project")")" - printf "%s\n" "$context" -} -utils0context2project() { - context="$1" - project="$(sed 's|_|\.|g' "$(ptmp "$context")")" - printf "%s\n" "$project" -} diff --git a/pkgs/by-name/ne/neorg/functions/workspace.sh b/pkgs/by-name/ne/neorg/functions/workspace.sh deleted file mode 100644 index d5eb2fca..00000000 --- a/pkgs/by-name/ne/neorg/functions/workspace.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env dash - -workspace0open_neorg_workspace() { - workspace="$1" - nvim -c "NeorgStart" -s "$(ptmp ":Neorg workspace $workspace\n")" -} -workspace0open_neorg_workspace_prompt() { - nvim -c "NeorgStart" -s "$(ptmp ":Neorg workspace ")" -} diff --git a/pkgs/by-name/ne/neorg/main.sh b/pkgs/by-name/ne/neorg/main.sh deleted file mode 100755 index b4f0f0e6..00000000 --- a/pkgs/by-name/ne/neorg/main.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# load dependencies -. ./functions/add.sh -. ./functions/context.sh -. ./functions/dmenu.sh -. ./functions/f_start.sh -. ./functions/f_stop.sh -. ./functions/inputs.sh -. ./functions/list.sh -. ./functions/project.sh -. ./functions/review.sh -. ./functions/utils.sh -. ./functions/workspace.sh - -# these are used in version() -# shellcheck disable=2034 -AUTHORS="Soispha" -# shellcheck disable=2034 -YEARS="2023" - -NAME="neorg" - -help() { - cat <<EOF -This is the core interface to the system-integrated task management - -USAGE: - $NAME [OPTIONS] [COMMAND] - -OPTIONS: - --help | -h - Display this help and exit. - - --version | -v - Display version and copyright information and exit. -COMMANDS: - task [ID] - Open the neorg context associated with the current context and - the uuid of the task with id ID. Without ID, it'll open the - current context's norg file. - If no context is set, drops you to the selection prompt - - dmenu - Select a project in dmenu mode. This will give you all projects - and exectute the selected one as in 'neorg projects <selected>' - - workspace [WS] - The neorg workspace (WS) to open at startup, an empty value drops - you at a prompt to enter the workspace yourself. - - project [P] - Opens the webbrowser with either the context (P) or - the current active context as argument if no context is supplied - - list - Lists all available contexts - - add - Allows you to quickly add projects - - fstart ID - Starts the task (ID) but only after it stooped - the previous active task, if it existed. - - fstop - Stops the current active task - - review - Review all firefox tabs - - inputs_add F - Add all urls from the file F as inputs to be catogorized - - inputs_review P - Like 'review', but for the inputs that have previously been added. - It takes a project in which to open the urls. -ARGUMENTS: - ID | *([0-9]) := [[%ID_GENERATION_FUNCTION]] - The function displays all possible IDs of the eligable tasks. - - WS := %ALL_WORKSPACES - All possible workspaces. - - P := %ALL_PROJECTS_PIPE - The possible project. - - F := [[fd . --max-depth 3]] - A URL-Input file to use as source. - -EOF -} - -for arg in "$@"; do - case "$arg" in - "--help" | "-h") - help - exit 0 - ;; - "--version" | "-v") - version - exit 0 - ;; - esac -done - -while [ "$#" -ne 0 ]; do - case "$1" in - "t"*) # task - shift 1 - task_id="$1" - [ "$task_id" ] || utils0chain context0open_current_task_context "exit 0" - context0open_current_task_context_at_task_id "$task_id" - exit 0 - ;; - "w"*) # workspace - shift 1 - workspace_to_open="$1" - # TODO: Exit with 1 on error, instead of the 0 <2023-10-20> - [ "$workspace_to_open" ] || utils0chain workspace0open_neorg_workspace_prompt "exit 0" - workspace0open_neorg_workspace "$workspace_to_open" - exit 0 - ;; - "p"*) # project - shift 1 - project_to_open="$1" - # TODO: Exit with 1 on error, instead of the 0 <2023-10-20> - [ "$project_to_open" ] || utils0chain project0open_current_context_in_browser "exit 0" - if ! grep -q "$project_to_open" "$(ptmp "%ALL_PROJECTS_NEWLINE")"; then - die "Your project ('$project_to_open') is not in the list of available projects: -%ALL_PROJECTS_COMMA" - fi - project0open_project_in_browser "$project_to_open" - exit 0 - ;; - "l"*) # list - list0list_all_contexts_newline - exit 0 - ;; - "a"*) # add-project - add0open_taskwarrior_project_file - exit 0 - ;; - "d"*) # dmenu - dmenu0open_context_in_browser - exit 0 - ;; - "fsta"*) # fstart - shift 1 - task_id="$1" - [ "$task_id" ] || die "No task id provided to fstart" - fstart0start_new_task "$task_id" - exit 0 - ;; - "fsto"*) # fstop - fstop0stop_current_task - exit 0 - ;; - "r"*) # review - shift 1 - review0start - exit 0 - ;; - "inputs_a"*) # inputs_add - shift 1 - url_file="$1" - [ -f "$url_file" ] || die "Url file ('$url_file') is not a valid file." - inputs0add "$url_file" - exit 0 - ;; - "inputs_r"*) # inputs_review - shift 1 - base_project="$1" - [ -z "$base_project" ] && die "'inputs_review' requires a project." - inputs0review "$base_project" - exit 0 - ;; - *) - die "Command '$1' does not exist! Please look at:\n $NAME --help" - exit 0 - ;; - esac -done - -context0open_current_task_context -# vim: ft=sh diff --git a/pkgs/by-name/ne/neorg/neorg_id_function.sh b/pkgs/by-name/ne/neorg/neorg_id_function.sh deleted file mode 100755 index 865ecacf..00000000 --- a/pkgs/by-name/ne/neorg/neorg_id_function.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -context="$(task _get rc.context)" -if [ "$context" ]; then - filter="project:$context" -else - filter="0-10000" -fi -tasks="$(task "$filter" _ids)" - -if [ "$tasks" ]; then - echo "$tasks" | xargs task _zshids | awk -F: -v q="'" '{gsub(/'\''/, q "\\" q q ); print $1 ":" q $2 q}' -fi diff --git a/pkgs/by-name/ne/neorg/package.nix b/pkgs/by-name/ne/neorg/package.nix deleted file mode 100644 index 3d26d1fb..00000000 --- a/pkgs/by-name/ne/neorg/package.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - lib, - sysLib, - # dependencies - cocogitto, - rofi, - libnotify, - taskwarrior, - gawk, - findutils, - # config - defaultNeorgProjectDir ? "/no-default-dir", # homeConfig.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces.projects - allProjectsNewline ? "", # homeConfig.soispha.taskwarrior.projects.projects_newline - allProjectsComma ? "", # homeConfig.soispha.taskwarrior.projects.projects_comma - allProjectsPipe ? "", # homeConfig.soispha.taskwarrior.projects.projects_pipe - allWorkspaces ? {}, # homeConfig.programs.nixvim.plugins.neorg.settings.load."core.dirman".config.workspaces - xdgConfigHome ? builtins.getEnv "XDG_CONFIG_HOME", - xdgDataHome ? builtins.getEnv "XDG_DATA_HOME", -}: -sysLib.writeShellScriptMultiPart { - name = "neorg"; - src = ./.; - generateCompletions = true; - keepPath = true; - - baseName = "main.sh"; - cmdPrefix = "functions"; - cmdNames = [ - "add.sh" - "context.sh" - "dmenu.sh" - "f_start.sh" - "f_stop.sh" - "inputs.sh" - "list.sh" - "project.sh" - "review.sh" - "utils.sh" - "workspace.sh" - ]; - - dependencies = [ - cocogitto - rofi - libnotify - ]; - replacementStrings = { - DEFAULT_NEORG_PROJECT_DIR = defaultNeorgProjectDir; - HOME_TASKRC = "${xdgConfigHome}/task/home-manager-taskrc"; - NEORG_REVIEW_PATH = "${xdgDataHome}/neorg/review"; - - NEORG_INPUTS_STORAGE_FILE = "${xdgDataHome}/neorg/inputs/url_list.txt"; - - ALL_PROJECTS_NEWLINE = allProjectsNewline; - ALL_PROJECTS_COMMA = allProjectsComma; - ALL_PROJECTS_PIPE = allProjectsPipe; - ALL_WORKSPACES = "${lib.strings.concatStringsSep "|" (builtins.attrNames allWorkspaces)}"; - - ID_GENERATION_FUNCTION = "${sysLib.writeShellScript { - name = "neorg_id_function"; - src = ./neorg_id_function.sh; - dependencies = [ - taskwarrior - gawk - findutils # source of xargs - ]; - }}/bin/neorg_id_function"; - - # TODO: Replace the hard-coded path here with some reference <2023-10-20> - TASK_PROJECT_FILE = "/home/soispha/repos/nix/nixos-config/hm/soispha/conf/taskwarrior/projects/default.nix"; - }; -} diff --git a/pkgs/by-name/qu/qutebrowser-patched/0001-fix-standardpaths-Continue-to-work-with-xdg-while-ba.patch b/pkgs/by-name/qu/qutebrowser-patched/0001-fix-standardpaths-Continue-to-work-with-xdg-while-ba.patch new file mode 100644 index 00000000..fa2e2482 --- /dev/null +++ b/pkgs/by-name/qu/qutebrowser-patched/0001-fix-standardpaths-Continue-to-work-with-xdg-while-ba.patch @@ -0,0 +1,54 @@ +From 8a0aa0e244fa565b8c55aab38cc5e84323c3b481 Mon Sep 17 00:00:00 2001 +From: Benedikt Peetz <benedikt.peetz@b-peetz.de> +Date: Tue, 3 Jun 2025 12:43:44 +0200 +Subject: [PATCH] fix(standardpaths): Continue to work with xdg, while + `--basedir` is set + +This can be used to simulate firefox's profiles feature (i.e., completely separated +data/runtime/cache dirs), while still keeping to the xdg basedir standard. +--- + qutebrowser/utils/standarddir.py | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/qutebrowser/utils/standarddir.py b/qutebrowser/utils/standarddir.py +index b82845a96..61319daed 100644 +--- a/qutebrowser/utils/standarddir.py ++++ b/qutebrowser/utils/standarddir.py +@@ -285,12 +285,11 @@ def _from_args( + The overridden path, or None if there is no override. + """ + basedir_suffix = { +- QStandardPaths.StandardLocation.ConfigLocation: 'config', +- QStandardPaths.StandardLocation.AppDataLocation: 'data', +- QStandardPaths.StandardLocation.AppLocalDataLocation: 'data', +- QStandardPaths.StandardLocation.CacheLocation: 'cache', +- QStandardPaths.StandardLocation.DownloadLocation: 'download', +- QStandardPaths.StandardLocation.RuntimeLocation: 'runtime', ++ QStandardPaths.StandardLocation.ConfigLocation: ('config', False), ++ QStandardPaths.StandardLocation.AppDataLocation: ('data', False), ++ QStandardPaths.StandardLocation.AppLocalDataLocation: ('data', False), ++ QStandardPaths.StandardLocation.CacheLocation: ('cache', True), ++ QStandardPaths.StandardLocation.RuntimeLocation: ('runtime', True), + } + + if getattr(args, 'basedir', None) is None: +@@ -298,10 +297,14 @@ def _from_args( + assert args is not None + + try: +- suffix = basedir_suffix[typ] ++ (suffix, extend) = basedir_suffix[typ] + except KeyError: # pragma: no cover + return None +- return os.path.abspath(os.path.join(args.basedir, suffix)) ++ ++ if extend: ++ return os.path.abspath(os.path.join(_writable_location(typ), os.path.basename(args.basedir))) ++ else: ++ return os.path.abspath(os.path.join(args.basedir, suffix)) + + + def _create(path: str) -> None: +-- +2.49.0 + diff --git a/pkgs/by-name/qu/qutebrowser-patched/package.nix b/pkgs/by-name/qu/qutebrowser-patched/package.nix new file mode 100644 index 00000000..1f2ea889 --- /dev/null +++ b/pkgs/by-name/qu/qutebrowser-patched/package.nix @@ -0,0 +1,6 @@ +{qutebrowser}: +qutebrowser.overrideAttrs (final: prev: { + pname = "${prev.pname}-patched"; + + patches = (prev.patches or []) ++ [./0001-fix-standardpaths-Continue-to-work-with-xdg-while-ba.patch]; +}) diff --git a/pkgs/by-name/ri/river-mk-keymap/.envrc b/pkgs/by-name/ri/river-mk-keymap/.envrc new file mode 100644 index 00000000..294de504 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/.envrc @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use flake diff --git a/pkgs/by-name/ri/river-mk-keymap/.gitignore b/pkgs/by-name/ri/river-mk-keymap/.gitignore new file mode 100644 index 00000000..f255eebd --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/.gitignore @@ -0,0 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +/target +.direnv diff --git a/pkgs/by-name/ri/river-mk-keymap/Cargo.lock b/pkgs/by-name/ri/river-mk-keymap/Cargo.lock new file mode 100644 index 00000000..5640dc9b --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/Cargo.lock @@ -0,0 +1,1011 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +version = 4 + +[[package]] +name = "ab_glyph" +version = "0.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0f4f6fbdc5ee39f2ede9f5f3ec79477271a6d6a2baff22310d51736bda6cea" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2187590a23ab1e3df8681afdf0987c48504d80291f002fcdb651f0ef5e25169" + +[[package]] +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "clap" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "core-text" +version = "20.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d2790b5c08465d49f8dc05c8bcae9fea467855947db39b0f8145c091aaced5" +dependencies = [ + "core-foundation", + "core-graphics", + "foreign-types", + "libc", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.60.2", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dwrote" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfe1f192fcce01590bd8d839aca53ce0d11d803bf291b2a6c4ad925a8f0024be" +dependencies = [ + "lazy_static", + "libc", + "winapi", + "wio", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "float-ord" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d" + +[[package]] +name = "font-kit" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7e611d49285d4c4b2e1727b72cf05353558885cc5252f93707b845dfcaf3d3" +dependencies = [ + "bitflags 2.9.1", + "byteorder", + "core-foundation", + "core-graphics", + "core-text", + "dirs", + "dwrote", + "float-ord", + "freetype-sys", + "lazy_static", + "libc", + "log", + "pathfinder_geometry", + "pathfinder_simd", + "walkdir", + "winapi", + "yeslogic-fontconfig-sys", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "freetype-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7edc5b9669349acfda99533e9e0bcf26a51862ab43b08ee7745c55d28eb134" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "keymaps" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea59e8e461942cf1d6a7ad938848d6fd2e40eb43799c21192c09226ecc86710f" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libredox" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "owned_ttf_parser" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "pathfinder_geometry" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" +dependencies = [ + "log", + "pathfinder_simd", +] + +[[package]] +name = "pathfinder_simd" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf9027960355bf3afff9841918474a81a5f972ac6d226d518060bba758b5ad57" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "river-mk-keymap" +version = "0.1.0" +dependencies = [ + "ab_glyph", + "anyhow", + "clap", + "font-kit", + "keymaps", + "memmap2", + "rustix 1.0.7", + "serde", + "serde_json", + "shlex", + "thiserror", + "vte", + "wayland-client", + "wayland-protocols-wlr", + "wayland-scanner", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vte" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5924018406ce0063cd67f8e008104968b74b563ee1b85dde3ed1f7cb87d3dbd" +dependencies = [ + "arrayvec", + "memchr", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wayland-backend" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe770181423e5fc79d3e2a7f4410b7799d5aab1de4372853de3c6aa13ca24121" +dependencies = [ + "cc", + "downcast-rs", + "rustix 0.38.44", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978fa7c67b0847dbd6a9f350ca2569174974cd4082737054dbb7fbb79d7d9a61" +dependencies = [ + "bitflags 2.9.1", + "rustix 0.38.44", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779075454e1e9a521794fed15886323ea0feda3f8b0fc1390f5398141310422a" +dependencies = [ + "bitflags 2.9.1", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb6cdc73399c0e06504c437fe3cf886f25568dd5454473d565085b36d6a8bbf" +dependencies = [ + "bitflags 2.9.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + +[[package]] +name = "yeslogic-fontconfig-sys" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "503a066b4c037c440169d995b869046827dbc71263f6e8f3be6d77d4f3229dbd" +dependencies = [ + "dlib", + "once_cell", + "pkg-config", +] diff --git a/pkgs/by-name/ri/river-mk-keymap/Cargo.toml b/pkgs/by-name/ri/river-mk-keymap/Cargo.toml new file mode 100644 index 00000000..9d8d2bba --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/Cargo.toml @@ -0,0 +1,91 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +[package] +name = "river-mk-keymap" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +ab_glyph = "0.2.30" +anyhow = "1.0.98" +clap = { version = "4.5.40", features = ["derive"] } +font-kit = "0.14.3" +keymaps = { version = "1.2.0", features = ["serde", "mouse-keys", "modifier-keys"] } +memmap2 = "0.9.5" +rustix = { version = "1.0.7", features = ["fs", "shm"] } +serde = { version = "1.0.219", features = ["derive"] } +serde_json = "1.0.140" +shlex = "1.3.0" +thiserror = "2.0.12" +vte = "0.15.0" +wayland-client = {version = "0.31.10", default-features = false} +wayland-protocols-wlr = { version = "0.3.8", features = ["client"] } +wayland-scanner = {version = "0.31.6", default-features = false} + +[profile.release] +lto = true +codegen-units = 1 +panic = "abort" +split-debuginfo = "off" + +[lints.rust] +# rustc lint groups https://doc.rust-lang.org/rustc/lints/groups.html +warnings = "warn" +future_incompatible = { level = "warn", priority = -1 } +let_underscore = { level = "warn", priority = -1 } +nonstandard_style = { level = "warn", priority = -1 } +rust_2018_compatibility = { level = "warn", priority = -1 } +rust_2018_idioms = { level = "warn", priority = -1 } +rust_2021_compatibility = { level = "warn", priority = -1 } +unused = { level = "warn", priority = -1 } +# rustc allowed-by-default lints https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html +# missing_docs = "warn" +macro_use_extern_crate = "warn" +meta_variable_misuse = "warn" +missing_abi = "warn" +missing_copy_implementations = "warn" +missing_debug_implementations = "warn" +non_ascii_idents = "warn" +noop_method_call = "warn" +single_use_lifetimes = "warn" +trivial_casts = "warn" +trivial_numeric_casts = "warn" +unreachable_pub = "warn" +unsafe_op_in_unsafe_fn = "warn" +unused_crate_dependencies = "warn" +unused_import_braces = "warn" +unused_lifetimes = "warn" +unused_qualifications = "warn" +variant_size_differences = "warn" + +[lints.rustdoc] +# rustdoc lints https://doc.rust-lang.org/rustdoc/lints.html +broken_intra_doc_links = "warn" +private_intra_doc_links = "warn" +missing_crate_level_docs = "warn" +private_doc_tests = "warn" +invalid_codeblock_attributes = "warn" +invalid_rust_codeblocks = "warn" +bare_urls = "warn" + +[lints.clippy] +# clippy allowed by default +dbg_macro = "warn" +# clippy categories https://doc.rust-lang.org/clippy/ +all = { level = "warn", priority = -1 } +correctness = { level = "warn", priority = -1 } +suspicious = { level = "warn", priority = -1 } +style = { level = "warn", priority = -1 } +complexity = { level = "warn", priority = -1 } +perf = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } diff --git a/pkgs/by-name/ri/river-mk-keymap/contrib/example.json b/pkgs/by-name/ri/river-mk-keymap/contrib/example.json new file mode 100644 index 00000000..bddd61c0 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/contrib/example.json @@ -0,0 +1,8 @@ +{ + "Kbad": { + "command": ["spawn", "/nix/store/1xfyw9c5ala73y8sayrsf98vcrr3jrww-libnotify-0.8.6/bin/notify-send hi"] + }, + "Kbae": { + "command": ["e"] + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/contrib/example.json.license b/pkgs/by-name/ri/river-mk-keymap/contrib/example.json.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/contrib/example.json.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/ri/river-mk-keymap/contrib/init.json b/pkgs/by-name/ri/river-mk-keymap/contrib/init.json new file mode 100644 index 00000000..a5f24307 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/contrib/init.json @@ -0,0 +1,261 @@ +{ + "<Alt+Ctrl+Super+Shift-Z>": [ + "spawn", + "/nix/store/h71ca2rxlnlcyv4604ih2b2gla5ly27d-qmk-unicode-type-1.0.0/bin/qmk-unicode-type 106 65377" + ], + "<MEDIA_LOWERVOLUME>": { + "allow_locked": true, + "command": [ + "spawn", + "/nix/store/7h9w2sycqj3i2lp61nibgv7qhvwy3pi9-wireplumber-0.5.10/bin/wpctl set-volume @DEFAULT_SINK@ 5%-" + ] + }, + "<MEDIA_MUTEVOLUME>": { + "allow_locked": true, + "command": [ + "spawn", + "/nix/store/08bgv5x7gfhkczf0lgrpim1rw51jlxvn-mpp/bin/mpp toggle" + ] + }, + "<MEDIA_RAISEVOLUME>": { + "allow_locked": true, + "command": [ + "spawn", + "/nix/store/7h9w2sycqj3i2lp61nibgv7qhvwy3pi9-wireplumber-0.5.10/bin/wpctl set-volume @DEFAULT_SINK@ 5%+" + ] + }, + "<LEFT_SUPER>": { + "c": { + "<ENTER>": [ + "zoom" + ], + " ": [ + "toggle-float" + ], + "c": [ + "close" + ], + "f": [ + "toggle-fullscreen" + ], + "n": [ + "swap", + "previous" + ], + "o": [ + "send-to-output", + "next" + ], + "t": [ + "swap", + "next" + ] + }, + "f": { + "0": [ + "set-focused-tags", + "4294967295" + ], + "1": [ + "set-focused-tags", + "1" + ], + "2": [ + "set-focused-tags", + "2" + ], + "3": [ + "set-focused-tags", + "4" + ], + "4": [ + "set-focused-tags", + "8" + ], + "5": [ + "set-focused-tags", + "16" + ], + "6": [ + "set-focused-tags", + "32" + ], + "7": [ + "set-focused-tags", + "64" + ], + "8": [ + "set-focused-tags", + "128" + ], + "9": [ + "set-focused-tags", + "256" + ], + "<Ctrl-n>": [ + "focus-output", + "previous" + ], + "<Ctrl-t>": [ + "focus-output", + "next" + ], + "n": [ + "focus-view", + "previous" + ], + "p": [ + "focus-previous-tags" + ], + "t": [ + "focus-view", + "next" + ] + }, + "m": { + "l": { + "command": [ + "spawn", + "/nix/store/7h9w2sycqj3i2lp61nibgv7qhvwy3pi9-wireplumber-0.5.10/bin/wpctl set-volume @DEFAULT_SINK@ 5%-" + ], + "description": "wpctl set-volume @DEFAULT_SINK@ 5%-" + }, + "m": [ + "spawn", + "/nix/store/08bgv5x7gfhkczf0lgrpim1rw51jlxvn-mpp/bin/mpp toggle" + ], + "r": [ + "spawn", + "/nix/store/7h9w2sycqj3i2lp61nibgv7qhvwy3pi9-wireplumber-0.5.10/bin/wpctl set-volume @DEFAULT_SINK@ 5%+" + ] + }, + "r": { + "a": [ + "spawn", + "/nix/store/h601phmb09d9dwwziwsim6m0r31qajr3-alacritty-0.15.1/bin/alacritty" + ], + "b": [ + "spawn", + "/nix/store/k8gfhk1lglwr8k6477ygkr9hh037a4kw-tskm-0.1.0/bin/tskm open select" + ], + "k": [ + "spawn", + "/nix/store/xpinf75gxhl8aglw2z7631k89iiml7rz-keepassxc-2.7.10/bin/keepassxc" + ], + "p": [ + "spawn", + "/nix/store/skgvjhmqp3jbmaw70xlz86a66lg13395-screenshot_persistent/bin/screenshot_persistent" + ], + "s": [ + "spawn", + "/nix/store/zvzr8cj57jhxyrzjym2rv3w95w7zw901-signal-desktop-7.56.1/bin/signal-desktop" + ] + }, + "v": { + "0": [ + "set-view-tags", + "4294967295" + ], + "1": [ + "set-view-tags", + "1" + ], + "2": [ + "set-view-tags", + "2" + ], + "3": [ + "set-view-tags", + "4" + ], + "4": [ + "set-view-tags", + "8" + ], + "5": [ + "set-view-tags", + "16" + ], + "6": [ + "set-view-tags", + "32" + ], + "7": [ + "set-view-tags", + "64" + ], + "8": [ + "set-view-tags", + "128" + ], + "9": [ + "set-view-tags", + "256" + ], + "a": { + "1": [ + "toggle-view-tags", + "1" + ], + "2": [ + "toggle-view-tags", + "2" + ], + "3": [ + "toggle-view-tags", + "4" + ], + "4": [ + "toggle-view-tags", + "8" + ], + "5": [ + "toggle-view-tags", + "16" + ], + "6": [ + "toggle-view-tags", + "32" + ], + "7": [ + "toggle-view-tags", + "64" + ], + "8": [ + "toggle-view-tags", + "128" + ], + "9": [ + "toggle-view-tags", + "256" + ] + }, + "p": [ + "send-to-previous-tags" + ] + }, + "x": { + "l": [ + "spawn", + "/nix/store/4gp8yj8cz3d78hn01firv7dlqf4ap1fj-lock/bin/lock" + ], + "q": [ + "exit" + ] + } + }, + "<Super-<MOUSE_LEFT>>": [ + "move-view" + ], + "<Super-<MOUSE_RIGHT>>": [ + "resize-view" + ], + "<Super-L>": [ + "spawn", + "/nix/store/4gp8yj8cz3d78hn01firv7dlqf4ap1fj-lock/bin/lock" + ], + "<PRINTSCREEN>": [ + "spawn", + "/nix/store/skgvjhmqp3jbmaw70xlz86a66lg13395-screenshot_persistent/bin/screenshot_persistent" + ] +} diff --git a/pkgs/by-name/ri/river-mk-keymap/flake.lock b/pkgs/by-name/ri/river-mk-keymap/flake.lock new file mode 100644 index 00000000..95f58ef9 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1750994206, + "narHash": "sha256-3u6rEbIX9CN/5A5/mc3u0wIO1geZ0EhjvPBXmRDHqWM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "80d50fc87924c2a0d346372d242c27973cf8cdbf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/by-name/ri/river-mk-keymap/flake.lock.license b/pkgs/by-name/ri/river-mk-keymap/flake.lock.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/flake.lock.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/ri/river-mk-keymap/flake.nix b/pkgs/by-name/ri/river-mk-keymap/flake.nix new file mode 100644 index 00000000..b7e2a0c4 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/flake.nix @@ -0,0 +1,46 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + description = "A smart way to configure river keybindings"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = {nixpkgs, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages."${system}"; + + nativeBuildInputs = [ + pkgs.pkg-config + ]; + + buildInputs = [ + pkgs.wayland + pkgs.libxkbcommon + pkgs.fontconfig + ]; + in { + devShells."${system}".default = pkgs.mkShell { + inherit nativeBuildInputs buildInputs; + + packages = with pkgs; [ + cargo + clippy + rustc + rustfmt + + cargo-edit + ]; + }; + }; +} +# vim: ts=2 + diff --git a/pkgs/by-name/ri/river-mk-keymap/package.nix b/pkgs/by-name/ri/river-mk-keymap/package.nix new file mode 100644 index 00000000..bb3dc285 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/package.nix @@ -0,0 +1,39 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + rustPlatform, + pkg-config, + wayland, + libxkbcommon, + fontconfig, +}: +rustPlatform.buildRustPackage { + pname = "river-mk-keymap"; + version = "0.1.0"; + + src = ./.; + cargoLock = { + lockFile = ./Cargo.lock; + }; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + wayland + libxkbcommon + fontconfig + ]; + + meta = { + mainProgram = "river-mk-keymap"; + }; +} diff --git a/pkgs/by-name/ri/river-mk-keymap/resources/river-control-unstable-v1.xml b/pkgs/by-name/ri/river-mk-keymap/resources/river-control-unstable-v1.xml new file mode 100644 index 00000000..aa5fc4dc --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/resources/river-control-unstable-v1.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<protocol name="river_control_unstable_v1"> + <copyright> + Copyright 2020 The River Developers + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + </copyright> + + <interface name="zriver_control_v1" version="1"> + <description summary="run compositor commands"> + This interface allows clients to run compositor commands and receive a + success/failure response with output or a failure message respectively. + + Each command is built up in a series of add_argument requests and + executed with a run_command request. The first argument is the command + to be run. + + A complete list of commands should be made available in the man page of + the compositor. + </description> + + <request name="destroy" type="destructor"> + <description summary="destroy the river_control object"> + This request indicates that the client will not use the + river_control object any more. Objects that have been created + through this instance are not affected. + </description> + </request> + + <request name="add_argument"> + <description summary="add an argument to the current command"> + Arguments are stored by the server in the order they were sent until + the run_command request is made. + </description> + <arg name="argument" type="string" summary="the argument to add"/> + </request> + + <request name="run_command"> + <description summary="run the current command"> + Execute the command built up using the add_argument request for the + given seat. + </description> + <arg name="seat" type="object" interface="wl_seat"/> + <arg name="callback" type="new_id" interface="zriver_command_callback_v1" + summary="callback object"/> + </request> + </interface> + + <interface name="zriver_command_callback_v1" version="1"> + <description summary="callback object"> + This object is created by the run_command request. Exactly one of the + success or failure events will be sent. This object will be destroyed + by the compositor after one of the events is sent. + </description> + + <event name="success" type="destructor"> + <description summary="command successful"> + Sent when the command has been successfully received and executed by + the compositor. Some commands may produce output, in which case the + output argument will be a non-empty string. + </description> + <arg name="output" type="string" summary="the output of the command"/> + </event> + + <event name="failure" type="destructor"> + <description summary="command failed"> + Sent when the command could not be carried out. This could be due to + sending a non-existent command, no command, not enough arguments, too + many arguments, invalid arguments, etc. + </description> + <arg name="failure_message" type="string" + summary="a message explaining why failure occurred"/> + </event> + </interface> +</protocol> diff --git a/pkgs/by-name/ri/river-mk-keymap/resources/river-status-unstable-v1.xml b/pkgs/by-name/ri/river-mk-keymap/resources/river-status-unstable-v1.xml new file mode 100644 index 00000000..e9629dde --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/resources/river-status-unstable-v1.xml @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8"?> +<protocol name="river_status_unstable_v1"> + <copyright> + Copyright 2020 The River Developers + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + </copyright> + + <interface name="zriver_status_manager_v1" version="4"> + <description summary="manage river status objects"> + A global factory for objects that receive status information specific + to river. It could be used to implement, for example, a status bar. + </description> + + <request name="destroy" type="destructor"> + <description summary="destroy the river_status_manager object"> + This request indicates that the client will not use the + river_status_manager object any more. Objects that have been created + through this instance are not affected. + </description> + </request> + + <request name="get_river_output_status"> + <description summary="create an output status object"> + This creates a new river_output_status object for the given wl_output. + </description> + <arg name="id" type="new_id" interface="zriver_output_status_v1"/> + <arg name="output" type="object" interface="wl_output"/> + </request> + + <request name="get_river_seat_status"> + <description summary="create a seat status object"> + This creates a new river_seat_status object for the given wl_seat. + </description> + <arg name="id" type="new_id" interface="zriver_seat_status_v1"/> + <arg name="seat" type="object" interface="wl_seat"/> + </request> + </interface> + + <interface name="zriver_output_status_v1" version="4"> + <description summary="track output tags and focus"> + This interface allows clients to receive information about the current + windowing state of an output. + </description> + + <request name="destroy" type="destructor"> + <description summary="destroy the river_output_status object"> + This request indicates that the client will not use the + river_output_status object any more. + </description> + </request> + + <event name="focused_tags"> + <description summary="focused tags of the output"> + Sent once binding the interface and again whenever the tag focus of + the output changes. + </description> + <arg name="tags" type="uint" summary="32-bit bitfield"/> + </event> + + <event name="view_tags"> + <description summary="tag state of an output's views"> + Sent once on binding the interface and again whenever the tag state + of the output changes. + </description> + <arg name="tags" type="array" summary="array of 32-bit bitfields"/> + </event> + + <event name="urgent_tags" since="2"> + <description summary="tags of the output with an urgent view"> + Sent once on binding the interface and again whenever the set of + tags with at least one urgent view changes. + </description> + <arg name="tags" type="uint" summary="32-bit bitfield"/> + </event> + + <event name="layout_name" since="4"> + <description summary="name of the layout"> + Sent once on binding the interface should a layout name exist and again + whenever the name changes. + </description> + <arg name="name" type="string" summary="layout name"/> + </event> + + <event name="layout_name_clear" since="4"> + <description summary="name of the layout"> + Sent when the current layout name has been removed without a new one + being set, for example when the active layout generator disconnects. + </description> + </event> + </interface> + + <interface name="zriver_seat_status_v1" version="3"> + <description summary="track seat focus"> + This interface allows clients to receive information about the current + focus of a seat. Note that (un)focused_output events will only be sent + if the client has bound the relevant wl_output globals. + </description> + + <request name="destroy" type="destructor"> + <description summary="destroy the river_seat_status object"> + This request indicates that the client will not use the + river_seat_status object any more. + </description> + </request> + + <event name="focused_output"> + <description summary="the seat focused an output"> + Sent on binding the interface and again whenever an output gains focus. + </description> + <arg name="output" type="object" interface="wl_output"/> + </event> + + <event name="unfocused_output"> + <description summary="the seat unfocused an output"> + Sent whenever an output loses focus. + </description> + <arg name="output" type="object" interface="wl_output"/> + </event> + + <event name="focused_view"> + <description summary="information on the focused view"> + Sent once on binding the interface and again whenever the focused + view or a property thereof changes. The title may be an empty string + if no view is focused or the focused view did not set a title. + </description> + <arg name="title" type="string" summary="title of the focused view"/> + </event> + + <event name="mode" since="3"> + <description summary="the active mode changed"> + Sent once on binding the interface and again whenever a new mode + is entered (e.g. with riverctl enter-mode foobar). + </description> + <arg name="name" type="string" summary="name of the mode"/> + </event> + </interface> +</protocol> diff --git a/pkgs/by-name/ri/river-mk-keymap/src/cli.rs b/pkgs/by-name/ri/river-mk-keymap/src/cli.rs new file mode 100644 index 00000000..ad872cc9 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/cli.rs @@ -0,0 +1,35 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::path::PathBuf; + +use clap::Parser; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +/// A tool to manage your key mappings for the river window manager +pub(super) struct Args { + #[command(subcommand)] + pub command: SubCommand, + + #[arg(long, short)] + /// Path to mapping config JSON file + pub keymap: PathBuf, +} + +#[derive(clap::Subcommand, Clone, Debug)] +pub(super) enum SubCommand { + Init { + #[arg(short, long, default_value_t = false)] + /// Only show what would be done, don't actually perform the init. + dry_run: bool, + }, + ShowHelp {}, +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs new file mode 100644 index 00000000..058606c9 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs @@ -0,0 +1,299 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{env::current_exe, path::Path, process::Command}; + +use anyhow::{bail, Result}; +use keymaps::key_repr::{Key, KeyValue, Keys, MediaKeyCode, ModifierKeyCode, MouseKeyValue}; +use rustix::path::Arg; + +use super::KeyMap; + +impl KeyMap { + /// # Errors + /// If impossible requests are made. + /// + /// # Panics + /// If internal assertions fail. + #[allow(clippy::too_many_lines)] + pub fn to_commands(self, keymap_path: &Path) -> Result<Vec<Command>> { + self.0.iter().try_for_each(|(keys, value)| { + let (prefix, last) = keys.split_at(keys.len() - 1); + let prefix = prefix.to_owned(); + + if value.allow_locked && !prefix.is_empty() { + bail!( + "Only single key mappings can be used \ + in locked mode, but '{}' contains multiple ('{}').", + Keys::from(keys), + Keys::from(prefix), + ) + } + + if !prefix.is_empty() + && [ + "<ESC>".parse().expect("hardcoded"), + "<BACKSPACE>".parse().expect("hardcoded"), + ] + .contains(&last[0]) + { + bail!( + "You cannot use <ESC> or <BACKSPACE> as the final part of a \ + prefixed mapping, as that is used to return \ + to 'normal' or the upper mode; found in '{}'", + Keys::from(keys), + ) + } + + Ok(()) + })?; + + let mut output: Vec<_> = self + .0 + .into_iter() + .flat_map(|(keys, value)| { + let (prefix, mapping) = keys.split_at(keys.len() - 1); + + let (final_mode, mut base): (Option<String>, _) = + prefix + .iter() + .fold((None, vec![]), |(acc_mode, mut acc_vec), key| { + // Declare intermediate modes for each key. + let mode_name: String = { + let base = key.to_string_repr(); + + if let Some(result) = &acc_mode { + result.to_owned() + base.as_str() + } else { + base + } + }; + + let mut riverctl = Command::new("riverctl"); + riverctl.args(["declare-mode", mode_name.as_str()]); + + let mut output = vec![riverctl]; + + // Provide keymaps for entering and leaving the mode + if let Some(acc_mode) = acc_mode.clone() { + output.extend(key_to_command( + key.to_owned(), + &["enter-mode".to_owned(), mode_name.clone()], + &acc_mode, + false, + )); + } else { + // Also spawn the help display if we start from the “normal” mode. + output.extend(key_to_command( + key.to_owned(), + &[ + "spawn".to_owned(), + format!( + "{} && sleep 1 && {}", + shlex::try_join([ + "riverctl", + "enter-mode", + mode_name.as_str() + ]) + .expect("Should work"), + shlex::try_join([ + current_exe() + .expect("Should have a current exe") + .as_os_str() + .as_str() + .expect("Should be valid utf8"), + "--keymap", + keymap_path.to_str().expect("Should be valid utf8"), + "show-help", + ]) + .expect("Should work"), + ), + ], + "normal", + false, + )); + } + + // Provide a mapping for going up a mode + output.extend(key_to_command( + "<BACKSPACE>".parse().expect("Hardcoded"), + &[ + "enter-mode".to_owned(), + acc_mode.unwrap_or("normal".to_owned()), + ], + &mode_name, + false, + )); + + // Another one for going back to normal. + output.extend(key_to_command( + "<ESC>".parse().expect("Hardcoded"), + &["enter-mode".to_owned(), "normal".to_owned()], + &mode_name, + false, + )); + + acc_vec.extend(output); + + (Some(mode_name), acc_vec) + }); + + base.extend(key_to_command( + mapping[0], + &value.command, + final_mode.as_ref().map_or("normal", |v| v.as_str()), + value.allow_locked, + )); + + base + }) + .collect(); + + output.sort_by_cached_key(|cmd| format!("{cmd:?}")); + output.dedup_by_key(|cmd| format!("{cmd:?}")); + + Ok(output) + } +} + +fn key_value_to_xkb_common_name(value: KeyValue) -> (String, Vec<&'static str>) { + let mut extra_modifiers = vec![]; + + let output = match value { + KeyValue::Backspace => "BackSpace".to_owned(), + KeyValue::Enter => "Return".to_owned(), + KeyValue::Left => "Left".to_owned(), + KeyValue::Right => "Right".to_owned(), + KeyValue::Up => "Up".to_owned(), + KeyValue::Down => "Down".to_owned(), + KeyValue::Home => "Home".to_owned(), + KeyValue::End => "End".to_owned(), + KeyValue::PageUp => "Page_Up".to_owned(), + KeyValue::PageDown => "Page_Down".to_owned(), + KeyValue::Tab => "Tab".to_owned(), + KeyValue::BackTab => "BackTab".to_owned(), + KeyValue::Delete => "Delete".to_owned(), + KeyValue::Insert => "Insert".to_owned(), + KeyValue::F(num) => format!("F{num}"), + KeyValue::Char(a) => { + // River does not differentiate between 'a' and 'A', + // so we need to do it beforehand. + if a.is_ascii_uppercase() { + extra_modifiers.push("Shift"); + } + + if a == ' ' { + "Space".to_string() + } else { + a.to_string() + } + } + KeyValue::Null => "Null".to_owned(), + KeyValue::Esc => "Escape".to_owned(), + KeyValue::CapsLock => "CapsLock".to_owned(), + KeyValue::ScrollLock => "ScrollLock".to_owned(), + KeyValue::NumLock => "NumLock".to_owned(), + KeyValue::PrintScreen => "Print".to_owned(), + KeyValue::Pause => "Pause".to_owned(), + KeyValue::Menu => "Menu".to_owned(), + KeyValue::KeypadBegin => "KeypadBegin".to_owned(), + KeyValue::Media(media_key_code) => match media_key_code { + MediaKeyCode::Play => "XF86AudioPlay".to_owned(), + MediaKeyCode::Pause => "XF86AudioPause".to_owned(), + MediaKeyCode::PlayPause => "XF86AudioPlayPause".to_owned(), + MediaKeyCode::Reverse => "XF86AudioReverse".to_owned(), + MediaKeyCode::Stop => "XF86AudioStop".to_owned(), + MediaKeyCode::FastForward => "XF86AudioFastForward".to_owned(), + MediaKeyCode::Rewind => "XF86AudioRewind".to_owned(), + MediaKeyCode::TrackNext => "XF86AudioTrackNext".to_owned(), + MediaKeyCode::TrackPrevious => "XF86AudioTrackPrevious".to_owned(), + MediaKeyCode::Record => "XF86AudioRecord".to_owned(), + MediaKeyCode::LowerVolume => "XF86AudioLowerVolume".to_owned(), + MediaKeyCode::RaiseVolume => "XF86AudioRaiseVolume".to_owned(), + MediaKeyCode::MuteVolume => "XF86AudioMute".to_owned(), + }, + KeyValue::MouseKey(mouse_key_value) => match mouse_key_value { + MouseKeyValue::Left => "BTN_LEFT".to_owned(), + MouseKeyValue::Right => "BTN_RIGHT".to_owned(), + MouseKeyValue::Middle => "BTN_MIDDLE".to_owned(), + }, + KeyValue::ModifierKey(modifier_key_code) => match modifier_key_code { + ModifierKeyCode::LeftAlt => "ALT_L".to_owned(), + ModifierKeyCode::RightAlt => "ALT_R".to_owned(), + ModifierKeyCode::LeftCtrl => "CTRL_L".to_owned(), + ModifierKeyCode::RightCtrl => "CTRL_R".to_owned(), + ModifierKeyCode::LeftMeta => "SUPER_L".to_owned(), + ModifierKeyCode::RightMeta => "SUPER_R".to_owned(), + ModifierKeyCode::LeftShift => "SHIFT_L".to_owned(), + ModifierKeyCode::RightShift => "SHIFT_R".to_owned(), + }, + other => todo!("Key value: {other} not known."), + }; + + (output, extra_modifiers) +} + +fn key_to_command(key: Key, command: &[String], mode: &str, allow_locked: bool) -> Vec<Command> { + let mut modifiers = { + let modifiers = key.modifiers(); + let mut output = vec![]; + + if modifiers.alt() { + output.push("Alt"); + } + if modifiers.ctrl() { + output.push("Control"); + } + if modifiers.meta() { + output.push("Super"); + } + if modifiers.shift() { + output.push("Shift"); + } + output + }; + + let (key_value, extra_modifiers) = key_value_to_xkb_common_name(key.value()); + modifiers.extend(extra_modifiers); + + let map_mode = if let KeyValue::MouseKey(_) = key.value() { + "map-pointer" + } else { + "map" + }; + + let modifiers = if modifiers.is_empty() { + "None".to_owned() + } else { + modifiers.join("+") + }; + + let mut output = vec![{ + let mut riverctl = Command::new("riverctl"); + riverctl.args([map_mode, mode, &modifiers, &key_value]); + + riverctl.args(command.iter().map(String::as_str)); + + riverctl + }]; + + if allow_locked { + output.push({ + let mut riverctl = Command::new("riverctl"); + riverctl.args([map_mode, "locked", &modifiers, &key_value]); + + riverctl.args(command.iter().map(String::as_str)); + + riverctl + }); + } + + output +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs new file mode 100644 index 00000000..5c89c2e2 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs @@ -0,0 +1,130 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{fmt::Display, ops::Deref, str::FromStr}; + +use anyhow::{anyhow, bail, Context, Result}; +use keymaps::{ + key_repr::{Key, Keys}, + map_tree::MapTrie, +}; +use serde::{Deserialize, Serialize}; +use serde_json::{Map, Value}; + +pub mod commands; + +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, PartialOrd)] +/// What values to use for: `riverctl <command..>` +#[serde(deny_unknown_fields)] +pub struct KeyConfig { + command: Vec<String>, + + /// Whether to allow this key mapping in the “locked” mode. + #[serde(default)] + allow_locked: bool, + + /// Use a different description to display this command, instead of the `command`. + description: Option<String>, +} + +impl FromStr for KeyMap { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + fn decode_value( + output: &mut MapTrie<KeyConfig>, + current_key: Vec<Key>, + value: &Value, + ) -> Result<()> { + let key_config = if let Some(value) = value.as_array() { + KeyConfig { + command: value + .iter() + .map(|v| v.as_str().map(ToOwned::to_owned)) + .collect::<Option<_>>() + .ok_or(anyhow!("A array contained a non-string value: {value:#?}"))?, + allow_locked: false, + description: None, + } + } else if let Some(object) = value.as_object() { + if object.contains_key("command") { + serde_json::from_value(value.to_owned()) + .with_context(|| format!("Failed to parse key config: {value:#?}"))? + } else { + for (key, value) in object { + let mut local_current_key = current_key.clone(); + local_current_key.push( + Key::from_str(key) + .with_context(|| format!("Failed to parse key '{key}'"))?, + ); + + decode_value(output, local_current_key, value)?; + } + return Ok(()); + } + } else { + bail!("Value ({}) is invalid (not array or object).", value) + }; + + output + .insert(¤t_key, key_config.clone()) + .with_context(|| { + format!( + "Failed to insert mapping {} -> {key_config}", + Keys::from(current_key) + ) + })?; + + Ok(()) + } + + let mut out = MapTrie::<KeyConfig>::new(); + + let raw: Map<String, Value> = + serde_json::from_str(s).context("Failed to parse the keymap config file as json.")?; + + for (key, value) in raw { + decode_value( + &mut out, + vec![Key::from_str(&key) + .with_context(|| format!("Failed to parse key ('{key}')"))?], + &value, + )?; + } + + Ok(Self(out)) + } +} +impl Display for KeyConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if let Some(desc) = &self.description { + f.write_str(desc) + } else { + f.write_str(self.command.join(" ").as_str()) + } + } +} + +#[derive(Debug)] +pub struct KeyMap(MapTrie<KeyConfig>); + +impl Display for KeyMap { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } +} + +impl Deref for KeyMap { + type Target = MapTrie<KeyConfig>; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/main.rs b/pkgs/by-name/ri/river-mk-keymap/src/main.rs new file mode 100644 index 00000000..18c291cf --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/main.rs @@ -0,0 +1,70 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::fs; + +use anyhow::Context; +use clap::Parser; + +pub mod cli; +pub mod key_map; +pub mod wayland; + +use crate::{cli::Args, key_map::KeyMap}; + +fn main() -> Result<(), anyhow::Error> { + let args = Args::parse(); + + let keymap_path = &args.keymap.canonicalize().with_context(|| { + format!( + "Failed to canonicalize kepmay path: '{}'", + args.keymap.display() + ) + })?; + + let config = { + let keymap_file = fs::read_to_string(keymap_path).with_context(|| { + format!( + "Failed to open keymap file at: '{}'.", + keymap_path.display() + ) + })?; + + let keymap: KeyMap = keymap_file.parse().with_context(|| { + format!("Failed to parse keymap file at: {}", keymap_path.display()) + })?; + + keymap + }; + + match args.command { + cli::SubCommand::Init { dry_run } => { + println!("{config}"); + for mut command in config.to_commands(keymap_path)? { + if dry_run { + println!("{command:?}"); + } else { + let status = command + .status() + .with_context(|| format!("Failed to run command: '{command:?}'"))?; + + if !status.success() { + eprintln!( + "Command ('{command:?}') returned with non zero exit code: {status}" + ); + } + } + } + } + cli::SubCommand::ShowHelp {} => wayland::main(config)?, + } + + Ok(()) +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/ansi/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/ansi/mod.rs new file mode 100644 index 00000000..0517ecf2 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/ansi/mod.rs @@ -0,0 +1,173 @@ +use std::mem; + +use vte::{Params, Parser, Perform}; + +#[derive(Debug, Clone, Copy)] +pub(crate) enum Color { + Black, + Red, + Green, + Yellow, + Blue, + Purple, + Cyan, + White, +} + +#[derive(Debug)] +struct Cleaner { + current_color: Option<Color>, + styles: StyledString, + current: String, +} + +#[derive(Debug)] +struct StyledStringInner { + val: String, + color: Option<Color>, +} + +pub(crate) struct StyledChar { + ch: char, + color: Option<Color>, +} + +impl StyledChar { + pub(crate) fn as_char(&self) -> char { + self.ch + } + + pub(crate) fn is_bold(&self) -> bool { + self.color.is_some() + } + + pub(crate) fn color(&self) -> Option<Color> { + self.color + } +} + +#[derive(Debug)] +pub(crate) struct StyledString { + inner: Vec<StyledStringInner>, +} + +impl StyledString { + fn push(&mut self, val: StyledStringInner) { + self.inner.push(val); + } + + pub(crate) fn chars(&self) -> impl Iterator<Item = StyledChar> + use<'_> { + self.inner.iter().flat_map(|inner| { + inner.val.chars().map(|ch| StyledChar { + ch, + color: inner.color, + }) + }) + } +} + +impl Cleaner { + fn reset_color(&mut self) { + self.styles.push(StyledStringInner { + val: mem::take(&mut self.current), + color: mem::take(&mut self.current_color), + }); + } + + fn set_color(&mut self, color: Color) { + self.current_color = Some(color); + } + + fn add_char(&mut self, c: char) { + self.current.push(c); + } +} + +impl Perform for Cleaner { + fn print(&mut self, c: char) { + self.add_char(c); + } + + fn execute(&mut self, byte: u8) { + if byte == b'\n' { + self.reset_color(); + self.add_char('\n'); + self.reset_color(); + } else { + eprintln!("Unknown [execute]: {byte:02x}"); + } + } + + fn hook(&mut self, params: &Params, intermediates: &[u8], ignore: bool, c: char) { + eprintln!( + "Unknown [hook] params={params:?}, intermediates={intermediates:?}, ignore={ignore:?}, char={c:?}" + ); + } + + fn put(&mut self, byte: u8) { + eprintln!("Unknonw [put] {byte:02x}"); + } + + fn unhook(&mut self) { + eprintln!("Unknown [unhook]"); + } + + fn osc_dispatch(&mut self, params: &[&[u8]], bell_terminated: bool) { + eprintln!("Unkown [osc_dispatch] params={params:?} bell_terminated={bell_terminated}"); + } + + fn csi_dispatch(&mut self, params: &Params, _: &[u8], _: bool, c: char) { + let params: Vec<u16> = params.iter().flatten().copied().collect(); + + if c != 'm' { + return; + } + + // See: https://gist.github.com/JBlond/2fea43a3049b38287e5e9cefc87b2124 + match params[..] { + [0] => self.reset_color(), + // [0, regular] if matches!(regular, 30..=37) => {} + [1, bold] if matches!(bold, 30..=37) => match bold { + 30 => self.set_color(Color::Black), + 31 => self.set_color(Color::Red), + 32 => self.set_color(Color::Green), + 36 => self.set_color(Color::Yellow), + 34 => self.set_color(Color::Blue), + 35 => self.set_color(Color::Purple), + 33 => self.set_color(Color::Cyan), + 37 => self.set_color(Color::White), + _ => unreachable!("Was filtered out"), + }, + // [4, underline] if matches!(underline, 30..=37) => {} + // [background] if matches!(background, 40..=47) => {} + _ => todo!(), + } + + // println!( + // "[csi_dispatch] params={:#?}, intermediates={:?}, ignore={:?}, char={:?}", + // params, intermediates, ignore, c + // ); + } + + fn esc_dispatch(&mut self, intermediates: &[u8], ignore: bool, byte: u8) { + eprintln!( + "Unkown [esc_dispatch] intermediates={intermediates:?}, ignore={ignore:?}, byte={byte:02x}" + ); + } +} + +pub(crate) fn parse(input: &str) -> StyledString { + let mut statemachine = Parser::new(); + let mut performer = Cleaner { + current_color: None, + styles: StyledString { inner: vec![] }, + current: String::new(), + }; + + let buf: Vec<_> = input.bytes().collect(); + + statemachine.advance(&mut performer, &buf[..]); + + assert!(performer.current.is_empty() && performer.current_color.is_none()); + performer.styles +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs new file mode 100644 index 00000000..c6e04fdf --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs @@ -0,0 +1,214 @@ +use std::num::NonZero; + +use keymaps::key_repr::Key; +use wayland_client::{ + globals::GlobalListContents, + protocol::{ + wl_buffer::WlBuffer, wl_compositor::WlCompositor, wl_registry, wl_seat::WlSeat, + wl_shm::WlShm, wl_shm_pool::WlShmPool, wl_surface::WlSurface, + }, + Connection, Dispatch, QueueHandle, +}; + +use wayland_protocols_wlr::layer_shell::v1::client::{ + zwlr_layer_shell_v1::ZwlrLayerShellV1, + zwlr_layer_surface_v1::{self, ZwlrLayerSurfaceV1}, +}; + +use crate::wayland::{ + ansi, render, + river::protocols::river_protocols::{ + zriver_seat_status_v1::{self, ZriverSeatStatusV1}, + zriver_status_manager_v1::ZriverStatusManagerV1, + }, + AppData, +}; + +impl Dispatch<ZriverSeatStatusV1, ()> for AppData { + fn event( + state: &mut Self, + _: &ZriverSeatStatusV1, + event: <ZriverSeatStatusV1 as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + if let zriver_seat_status_v1::Event::Mode { name } = event { + let new_text = { + if name == "normal" { + // We are back at the normal mode. + // There is no need to display the mappings anymore, exit. + state.should_exit = true; + return; + } else if let Ok(keys) = Key::parse_multiple(&name) { + if let Some(val) = state.config.get(&keys) { + ansi::parse(val.to_string().as_str()) + } else { + // Mode name not know, do nothing. + return; + } + } else { + // Mode name not valid, do nothing. + return; + } + }; + + let px_height; + (state.pixel_data, (state.max_px_width, px_height)) = + render::text(&new_text).expect("Works?"); + + // We add the `5` here, so that our letters don't stop exactly at the border. + state + .window + .0 + .set_size(state.max_px_width + 5, px_height + 5); + state.window.1.commit(); + + if state.configured { + state.draw(); + } + } + } +} + +impl Dispatch<ZwlrLayerSurfaceV1, ()> for AppData { + fn event( + state: &mut Self, + proxy: &ZwlrLayerSurfaceV1, + event: <ZwlrLayerSurfaceV1 as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + match event { + zwlr_layer_surface_v1::Event::Configure { + serial, + width, + height, + } => { + state.buffer = None; + + proxy.ack_configure(serial); + + state.width = NonZero::new(width).map_or_else(|| state.width, NonZero::get); + state.height = NonZero::new(height).map_or_else(|| state.height, NonZero::get); + + state.draw(); + + state.configured = true; + } + zwlr_layer_surface_v1::Event::Closed => { + state.should_exit = true; + } + _ => (), + } + } +} + +impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for AppData { + fn event( + _: &mut AppData, + _: &wl_registry::WlRegistry, + _: wl_registry::Event, + _: &GlobalListContents, + _: &Connection, + _: &QueueHandle<AppData>, + ) { + } +} + +impl Dispatch<WlShmPool, ()> for AppData { + fn event( + _: &mut Self, + _: &WlShmPool, + _: <WlShmPool as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<WlShm, ()> for AppData { + fn event( + _: &mut Self, + _: &WlShm, + _: <WlShm as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<WlSurface, ()> for AppData { + fn event( + _: &mut Self, + _: &WlSurface, + _: <WlSurface as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<WlCompositor, ()> for AppData { + fn event( + _: &mut Self, + _: &WlCompositor, + _: <WlCompositor as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<WlSeat, ()> for AppData { + fn event( + _: &mut Self, + _: &WlSeat, + _: <WlSeat as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<WlBuffer, ()> for AppData { + fn event( + _: &mut Self, + _: &WlBuffer, + _: <WlBuffer as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<ZriverStatusManagerV1, ()> for AppData { + fn event( + _: &mut Self, + _: &ZriverStatusManagerV1, + _: <ZriverStatusManagerV1 as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} + +impl Dispatch<ZwlrLayerShellV1, ()> for AppData { + fn event( + _: &mut Self, + _: &ZwlrLayerShellV1, + _: <ZwlrLayerShellV1 as wayland_client::Proxy>::Event, + (): &(), + _: &Connection, + _: &QueueHandle<Self>, + ) { + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs new file mode 100644 index 00000000..44c010d5 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs @@ -0,0 +1,272 @@ +#![allow( + clippy::cast_sign_loss, + clippy::cast_possible_wrap, + clippy::cast_precision_loss, + clippy::cast_possible_truncation +)] + +use anyhow::Result; +use wayland_client::{ + globals::registry_queue_init, + protocol::{ + wl_compositor::WlCompositor, + wl_seat::WlSeat, + wl_shm::{self, WlShm}, + wl_surface::WlSurface, + }, + Connection, +}; +use wayland_protocols_wlr::layer_shell::v1::client::{ + zwlr_layer_shell_v1::{self, ZwlrLayerShellV1}, + zwlr_layer_surface_v1::{self, ZwlrLayerSurfaceV1}, +}; + +use crate::{ + key_map::KeyMap, + wayland::{ + ansi::Color, + river::protocols::river_protocols::zriver_status_manager_v1::ZriverStatusManagerV1, + shm::slot::{Buffer, SlotPool}, + }, +}; + +mod ansi; +mod render; +mod river; +mod shm; + +mod dispatches; + +struct AppData { + pool: SlotPool, + window: (ZwlrLayerSurfaceV1, WlSurface), + + configured: bool, + buffer: Option<Buffer>, + + width: u32, + height: u32, + + max_px_width: u32, + pixel_data: (Vec<f32>, Vec<Option<Color>>), + + config: KeyMap, + should_exit: bool, +} + +impl AppData { + #[allow(clippy::too_many_lines)] + fn draw(&mut self) { + let width = self.width; + let height = self.height; + let stride = self.width as i32 * 4; + + let buffer = self.buffer.get_or_insert_with(|| { + self.pool + .create_buffer( + width as i32, + height as i32, + stride, + wl_shm::Format::Argb8888, + ) + .expect("Works?") + .0 + }); + + let canvas = if let Some(canvas) = self.pool.canvas(buffer) { + canvas + } else { + // This should be rare, but if the compositor has not released the previous + // buffer, we need double-buffering. + let (second_buffer, canvas) = self + .pool + .create_buffer( + self.width as i32, + self.height as i32, + stride, + wl_shm::Format::Argb8888, + ) + .expect("create buffer"); + *buffer = second_buffer; + canvas + }; + + // Draw to the window. + { + canvas + .chunks_exact_mut(stride as usize) + .enumerate() + .for_each(|(row_index, row)| { + // let row_slice = row_slice(self.height, row_index as u32, 0.97); + // let allowed_columns = (f64::from(self.width) * row_slice).ceil() as usize; + + row.chunks_exact_mut(4) + .enumerate() + .for_each(|(column_index, chunk)| { + // const BACKGROUND_COLOR: u32 = 0xee58_5b70; + const BACKGROUND_COLOR: u32 = 0xee00_0000; + + assert!(column_index as u32 <= self.width); + + // if column_index > allowed_columns + // || column_index < (self.width as usize - allowed_columns) + // { + // let array: &mut [u8; 4] = chunk.try_into().unwrap(); + // *array = 0u32.to_le_bytes(); + // return; + // } + + if column_index >= (self.max_px_width as usize) { + let array: &mut [u8; 4] = chunk.try_into().unwrap(); + *array = BACKGROUND_COLOR.to_le_bytes(); + } else { + assert!(column_index < self.max_px_width as usize); + + let position = + column_index + row_index * self.max_px_width as usize; + + if let Some(coverage) = &self.pixel_data.0.get(position) { + let a = (BACKGROUND_COLOR & (0xff << (6 * 4))) >> 24; + + let (r, g, b) = if let Some(color) = self + .pixel_data + .1 + .get(position) + .expect("If the pixel is set, the color will too") + { + let (r, g, b) = match color { + Color::Black => (0, 0, 0), + Color::Red => (0xff, 0, 0), + Color::Green => (0, 0xff, 0), + Color::Yellow => (0xff, 0xff, 0), + Color::Blue => (0, 0, 0xff), + Color::Purple => (0x80, 0, 0x80), + Color::Cyan => (0, 0xff, 0xff), + Color::White => (0xff, 0xff, 0xff), + }; + + let r = (r as f32 * **coverage).ceil() as u32; + let g = (g as f32 * **coverage).ceil() as u32; + let b = (b as f32 * **coverage).ceil() as u32; + + (r, g, b) + } else { + let r = (255.0 * **coverage).ceil() as u32; + let g = (255.0 * **coverage).ceil() as u32; + let b = (255.0 * **coverage).ceil() as u32; + + (r, g, b) + }; + + let color: u32 = (a << 24) + (r << 16) + (g << 8) + b; + + let array: &mut [u8; 4] = chunk.try_into().unwrap(); + *array = color.to_le_bytes(); + } else { + let array: &mut [u8; 4] = chunk.try_into().unwrap(); + *array = BACKGROUND_COLOR.to_le_bytes(); + } + } + }); + }); + } + + self.window + .1 + .damage_buffer(0, 0, self.width as i32, self.height as i32); + + buffer.attach_to(&self.window.1).expect("works"); + self.window.1.commit(); + } +} + +/// # Errors +/// If a protocol error arises. +pub fn main(config: KeyMap) -> Result<()> { + let conn = Connection::connect_to_env()?; + let (globals, mut queue) = registry_queue_init::<AppData>(&conn)?; + let qh = queue.handle(); + + let seat: WlSeat = globals.bind(&qh, 9..=9, ())?; + let status_manager: ZriverStatusManagerV1 = globals.bind(&qh, 4..=4, ())?; + let _seat_status = status_manager.get_river_seat_status(&seat, &qh, ()); + + let compositor: WlCompositor = globals.bind(&qh, 6..=6, ())?; + let shm: WlShm = globals.bind(&qh, 1..=1, ())?; + // let xdg_wm: XdgWmBase = globals.bind(&qh, 5..=5, ())?; + + let surface = compositor.create_surface(&qh, ()); + let pool = SlotPool::new(1024 * 1024, &shm)?; + + let zwlr_layer_shell: ZwlrLayerShellV1 = globals.bind(&qh, 4..=4, ())?; + let layer_surface = zwlr_layer_shell.get_layer_surface( + &surface, + None, + zwlr_layer_shell_v1::Layer::Overlay, + "river-mk-keymap which-key".to_owned(), + &qh, + (), + ); + + layer_surface.set_size(256, 256); + layer_surface + .set_anchor(zwlr_layer_surface_v1::Anchor::Left | zwlr_layer_surface_v1::Anchor::Top); + + surface.commit(); + + let mut me = AppData { + config, + should_exit: false, + + configured: false, + buffer: None, + + width: 256, + height: 256, + + max_px_width: 0, + pixel_data: (vec![], vec![]), + + window: (layer_surface, surface), + + pool, + }; + + loop { + queue.blocking_dispatch(&mut me)?; + + if me.should_exit { + break; + } + } + + Ok(()) +} + +// /// Calculate which amount of the current row (`i`) should be painted, if we want a corner +// /// rounding of percent `p` and have an total of `n` rows. +// fn row_slice(n_u32: u32, i_u32: u32, p: f64) -> f64 { +// fn within_tolerance(a: f64, b: f64) -> bool { +// const ALLOWED_ERROR: f64 = 0.000_000_1; +// +// (a - b).abs() < ALLOWED_ERROR +// } +// +// let i = f64::from(i_u32); +// let n = f64::from(n_u32); +// +// let out = p + (1.0 - p) * (PI * i / n).sin(); +// +// assert!(out >= 0.0); +// assert!(out <= 1.0); +// +// if i_u32 == 0 || i_u32 == n_u32 { +// assert!(within_tolerance(out, p)); +// } +// +// if i_u32 < n_u32 / 2 { +// assert!(within_tolerance(out, row_slice(n_u32, n_u32 - i_u32, p))); +// } +// +// out +// } diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs new file mode 100644 index 00000000..7f0aaec9 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs @@ -0,0 +1,57 @@ +use ab_glyph::{point, Font, Glyph, Point, ScaleFont}; + +use crate::wayland::ansi::{StyledChar, StyledString}; + +/// Simple paragraph layout for glyphs into `target`. +/// Starts at position `(0, ascent)`. +/// +/// This is for testing and examples. +pub(super) fn layout_paragraph<F, SF, BF, BSF>( + font: SF, + bold_font: BSF, + position: Point, + max_width: f32, + text: &StyledString, + target: &mut Vec<(Glyph, StyledChar)>, +) where + F: Font, + SF: ScaleFont<F>, + BF: Font, + BSF: ScaleFont<BF>, +{ + let v_advance = font.height() + font.line_gap(); + let mut caret = position + point(0.0, font.ascent()); + let mut last_glyph: Option<Glyph> = None; + + for c in text.chars() { + if c.as_char().is_control() { + if c.as_char() == '\n' { + caret = point(position.x, caret.y + v_advance); + last_glyph = None; + } + continue; + } + + let mut glyph = if c.is_bold() { + bold_font.scaled_glyph(c.as_char()) + } else { + font.scaled_glyph(c.as_char()) + }; + + if let Some(previous) = last_glyph.take() { + caret.x += font.kern(previous.id, glyph.id); + } + glyph.position = caret; + + last_glyph = Some(glyph.clone()); + caret.x += font.h_advance(glyph.id); + + if !c.as_char().is_whitespace() && caret.x > position.x + max_width { + caret = point(position.x, caret.y + v_advance); + glyph.position = caret; + last_glyph = None; + } + + target.push((glyph, c)); + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs new file mode 100644 index 00000000..e92def3c --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs @@ -0,0 +1,129 @@ +use std::{fs::File, io::Read}; + +use ab_glyph::{point, Font, FontVec, PxScale, ScaleFont}; +use anyhow::{Context, Result}; +use font_kit::{ + family_name::FamilyName, handle::Handle, properties::Properties, source::SystemSource, +}; + +use crate::wayland::ansi::{Color, StyledString}; + +mod layout; + +fn get_font(weight: f32) -> Result<impl Font> { + let handle = SystemSource::new() + .select_best_match( + &[FamilyName::Monospace], + Properties::new().weight(font_kit::properties::Weight(weight)), + ) + .context("Failed to find a monospace font")?; + + match handle { + Handle::Path { path, font_index } => { + let data = { + let mut buffer = vec![]; + + let mut file = File::open(&path)?; + file.read_to_end(&mut buffer)?; + buffer + }; + + FontVec::try_from_vec_and_index(data, font_index).with_context(|| { + format!( + "Failed to load font at '{}' with index {}", + path.display(), + font_index + ) + }) + } + Handle::Memory { .. } => unimplemented!(), + } +} + +pub(super) type ColorVec = (Vec<f32>, Vec<Option<Color>>); +pub(super) fn text(input: &StyledString) -> Result<(ColorVec, (u32, u32))> { + let normal_font = get_font(400.0)?; + let bold_font = get_font(600.0)?; + + let height: f32 = 15.0; + let px_height = height.ceil() as usize; + + let scale = PxScale { + x: height, + y: height, + }; + + let scaled_font = normal_font.into_scaled(scale); + let bold_scaled_font = bold_font.into_scaled(scale); + + let mut glyphs = Vec::new(); + layout::layout_paragraph( + &scaled_font, + &bold_scaled_font, + point(0.0, 0.0), + 9999.0, + input, + &mut glyphs, + ); + + let px_width = glyphs + .iter() + .fold(0.0, |acc, (g, c)| { + let next = g.position.x + + if c.is_bold() { + bold_scaled_font.h_advance(g.id) + } else { + scaled_font.h_advance(g.id) + }; + + if next > acc { + next + } else { + acc + } + }) + .ceil() as usize; + + // Rasterise to a f32 alpha vec + let mut pixel_data = vec![0.0; px_width * px_height]; + let mut color_data = vec![None; px_width * px_height]; + for (g, c) in glyphs { + let maybe_glyph = if c.is_bold() { + bold_scaled_font.outline_glyph(g) + } else { + scaled_font.outline_glyph(g) + }; + + if let Some(og) = maybe_glyph { + let bounds = og.px_bounds(); + og.draw(|x, y, v| { + let x = x as f32 + bounds.min.x; + let y = y as f32 + bounds.min.y; + let next_idx = x as usize + y as usize * px_width; + + assure_idx(&mut pixel_data, next_idx, 0.0); + assure_idx(&mut color_data, next_idx, None); + + // save the coverage alpha + pixel_data[next_idx] += v; + color_data[next_idx] = c.color(); + }); + } + } + + let len = pixel_data.len(); + Ok(( + (pixel_data, color_data), + (px_width as u32, (len / px_width) as u32), + )) +} + +fn assure_idx<T: Copy + Clone>(pixel_data: &mut Vec<T>, next_idx: usize, fill: T) { + let last = pixel_data.len() - 1; + + if next_idx > last { + let needed = next_idx - last; + + pixel_data.extend(vec![fill; needed]); + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/mod.rs new file mode 100644 index 00000000..f17c7ac8 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/mod.rs @@ -0,0 +1 @@ +pub(crate) mod protocols; diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs new file mode 100644 index 00000000..e54b65e1 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs @@ -0,0 +1,28 @@ +pub(crate) mod river_protocols { + use wayland_client; + // import objects from the core protocol if needed + use wayland_client::protocol::{wl_output, wl_seat}; + + // This module hosts a low-level representation of the protocol objects + // you will not need to interact with it yourself, but the code generated + // by the generate_client_code! macro will use it + // import the interfaces from the core protocol if needed + + #[allow(non_upper_case_globals)] + pub(crate) mod __status { + use wayland_client::backend as wayland_backend; + use wayland_client::protocol::__interfaces::{ + wl_output_interface, wl_seat_interface, WL_OUTPUT_INTERFACE, WL_SEAT_INTERFACE, + }; + wayland_scanner::generate_interfaces!("./resources/river-status-unstable-v1.xml"); + } + + use self::__status::{ + ZRIVER_OUTPUT_STATUS_V1_INTERFACE, ZRIVER_SEAT_STATUS_V1_INTERFACE, + ZRIVER_STATUS_MANAGER_V1_INTERFACE, + }; + + // This macro generates the actual types that represent the wayland objects of + // your custom protocol + wayland_scanner::generate_client_code!("./resources/river-status-unstable-v1.xml"); +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/mod.rs new file mode 100644 index 00000000..65d3c590 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/mod.rs @@ -0,0 +1,21 @@ +#![allow(dead_code)] + +pub(crate) mod multi; +pub(crate) mod raw; +pub(crate) mod slot; + +use std::io; + +use wayland_client::globals::GlobalError; + +/// An error that may occur when creating a pool. +#[derive(Debug, thiserror::Error)] +pub enum CreatePoolError { + /// The [`wl_shm`] global is not bound. + #[error(transparent)] + Global(#[from] GlobalError), + + /// Error while allocating the shared memory. + #[error(transparent)] + Create(#[from] io::Error), +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs new file mode 100644 index 00000000..0b1fdc1b --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs @@ -0,0 +1,437 @@ +//! A pool implementation which automatically manage buffers. +//! +//! This pool is built on the [`RawPool`]. +//! +//! The [`MultiPool`] takes a key which is used to identify buffers and tries to return the buffer associated to the key +//! if possible. If no buffer in the pool is associated to the key, it will create a new one. +//! +//! # Example +//! +//! ```rust +//! use smithay_client_toolkit::reexports::client::{ +//! QueueHandle, +//! protocol::wl_surface::WlSurface, +//! protocol::wl_shm::Format, +//! }; +//! use smithay_client_toolkit::shm::multi::MultiPool; +//! +//! struct WlFoo { +//! // The surface we'll draw on and the index of buffer associated to it +//! surface: (WlSurface, usize), +//! pool: MultiPool<(WlSurface, usize)> +//! } +//! +//! impl WlFoo { +//! fn draw(&mut self, qh: &QueueHandle<WlFoo>) { +//! let surface = &self.surface.0; +//! // We'll increment "i" until the pool can create a new buffer +//! // if there's no buffer associated with our surface and "i" or if +//! // a buffer with the obuffer associated with our surface and "i" is free for use. +//! // +//! // There's no limit to the amount of buffers we can allocate to our surface but since +//! // shm buffers are released fairly fast, it's unlikely we'll need more than double buffering. +//! for i in 0..2 { +//! self.surface.1 = i; +//! if let Ok((offset, buffer, slice)) = self.pool.create_buffer( +//! 100, +//! 100 * 4, +//! 100, +//! &self.surface, +//! Format::Argb8888, +//! ) { +//! /* +//! insert drawing code here +//! */ +//! surface.attach(Some(buffer), 0, 0); +//! surface.commit(); +//! // We exit the function after the draw. +//! return; +//! } +//! } +//! /* +//! If there's no buffer available we can for example request a frame callback +//! and trigger a redraw when it fires. +//! (not shown in this example) +//! */ +//! } +//! } +//! +//! fn draw(slice: &mut [u8]) { +//! todo!() +//! } +//! +//! ``` +//! + +use std::borrow::Borrow; +use std::io; +use std::os::unix::io::OwnedFd; + +use std::sync::{ + atomic::{AtomicBool, Ordering}, + Arc, +}; +use wayland_client::backend::protocol::Message; +use wayland_client::backend::{Backend, ObjectData, ObjectId}; +use wayland_client::{ + protocol::{wl_buffer, wl_shm}, + Proxy, +}; + +use crate::wayland::shm::CreatePoolError; + +use super::raw::RawPool; + +#[derive(Debug, thiserror::Error)] +pub(crate) enum PoolError { + #[error("buffer is currently used")] + InUse, + #[error("buffer is overlapping another")] + Overlap, + #[error("buffer could not be found")] + NotFound, +} + +/// This pool manages buffers associated with keys. +/// Only one buffer can be attributed to a given key. +#[derive(Debug)] +pub(crate) struct MultiPool<K> { + buffer_list: Vec<BufferSlot<K>>, + pub(crate) inner: RawPool, +} + +#[derive(Debug, thiserror::Error)] +pub(crate) struct BufferSlot<K> { + free: Arc<AtomicBool>, + size: usize, + used: usize, + offset: usize, + buffer: Option<wl_buffer::WlBuffer>, + key: K, +} + +impl<K> Drop for BufferSlot<K> { + fn drop(&mut self) { + self.destroy().ok(); + } +} + +impl<K> BufferSlot<K> { + pub(crate) fn destroy(&self) -> Result<(), PoolError> { + self.buffer + .as_ref() + .ok_or(PoolError::NotFound) + .and_then(|buffer| { + self.free + .load(Ordering::Relaxed) + .then(|| buffer.destroy()) + .ok_or(PoolError::InUse) + }) + } +} + +impl<K> MultiPool<K> { + pub(crate) fn new(shm: &wl_shm::WlShm) -> Result<Self, CreatePoolError> { + Ok(Self { + inner: RawPool::new(4096, shm)?, + buffer_list: Vec::new(), + }) + } + + /// Resizes the memory pool, notifying the server the pool has changed in size. + /// + /// The [`wl_shm`] protocol only allows the pool to be made bigger. If the new size is smaller than the + /// current size of the pool, this function will do nothing. + pub(crate) fn resize(&mut self, size: usize) -> io::Result<()> { + self.inner.resize(size) + } + + /// Removes the buffer with the given key from the pool and rearranges the others. + pub(crate) fn remove<Q>(&mut self, key: &Q) -> Option<BufferSlot<K>> + where + Q: PartialEq, + K: Borrow<Q>, + { + self.buffer_list + .iter() + .enumerate() + .find(|(_, slot)| slot.key.borrow().eq(key)) + .map(|(i, _)| i) + .map(|i| self.buffer_list.remove(i)) + } + + /// Insert a buffer into the pool. + /// + /// The parameters are: + /// + /// - `width`: the width of this buffer (in pixels) + /// - `height`: the height of this buffer (in pixels) + /// - `stride`: distance (in bytes) between the beginning of a row and the next one + /// - `key`: a borrowed form of the stored key type + /// - `format`: the encoding format of the pixels. + pub(crate) fn insert<Q>( + &mut self, + width: i32, + stride: i32, + height: i32, + key: &Q, + format: wl_shm::Format, + ) -> Result<usize, PoolError> + where + K: Borrow<Q>, + Q: PartialEq + ToOwned<Owned = K>, + { + let mut offset = 0; + let mut found_key = false; + let size = (stride * height) as usize; + let mut index = Err(PoolError::NotFound); + + for (i, buf_slot) in self.buffer_list.iter_mut().enumerate() { + if buf_slot.key.borrow().eq(key) { + found_key = true; + if buf_slot.free.load(Ordering::Relaxed) { + // Destroys the buffer if it's resized + if size != buf_slot.used { + if let Some(buffer) = buf_slot.buffer.take() { + buffer.destroy(); + } + } + // Increases the size of the Buffer if it's too small and add 5% padding. + // It is possible this buffer overlaps the following but the else if + // statement prevents this buffer from being returned if that's the case. + buf_slot.size = buf_slot.size.max(size + size / 20); + index = Ok(i); + } else { + index = Err(PoolError::InUse); + } + // If a buffer is resized, it is likely that the followings might overlap + } else if offset > buf_slot.offset { + // When the buffer is free, it's safe to shift it because we know the compositor won't try to read it. + if buf_slot.free.load(Ordering::Relaxed) { + if offset != buf_slot.offset { + if let Some(buffer) = buf_slot.buffer.take() { + buffer.destroy(); + } + } + buf_slot.offset = offset; + } else { + // If one of the overlapping buffers is busy, then no buffer can be returned because it could result in a data race. + index = Err(PoolError::InUse); + } + } else if found_key { + break; + } + let size = (buf_slot.size + 63) & !63; + offset += size; + } + + if !found_key { + if let Err(err) = index { + return self + .dyn_resize(offset, width, stride, height, key.to_owned(), format) + .map(|()| self.buffer_list.len() - 1) + .ok_or(err); + } + } + + index + } + + /// Retreives the buffer associated with the given key. + /// + /// The parameters are: + /// + /// - `width`: the width of this buffer (in pixels) + /// - `height`: the height of this buffer (in pixels) + /// - `stride`: distance (in bytes) between the beginning of a row and the next one + /// - `key`: a borrowed form of the stored key type + /// - `format`: the encoding format of the pixels. + pub(crate) fn get<Q>( + &mut self, + width: i32, + stride: i32, + height: i32, + key: &Q, + format: wl_shm::Format, + ) -> Option<(usize, &wl_buffer::WlBuffer, &mut [u8])> + where + Q: PartialEq, + K: Borrow<Q>, + { + let len = self.inner.len(); + let size = (stride * height) as usize; + let buf_slot = self + .buffer_list + .iter_mut() + .find(|buf_slot| buf_slot.key.borrow().eq(key))?; + + if buf_slot.size >= size { + return None; + } + + buf_slot.used = size; + let offset = buf_slot.offset; + if buf_slot.buffer.is_none() { + if offset + size > len { + self.inner.resize(offset + size + size / 20).ok()?; + } + let free = Arc::new(AtomicBool::new(true)); + let data = BufferObjectData { free: free.clone() }; + let buffer = self.inner.create_buffer_raw( + offset as i32, + width, + height, + stride, + format, + Arc::new(data), + ); + buf_slot.free = free; + buf_slot.buffer = Some(buffer); + } + let buf = buf_slot.buffer.as_ref()?; + buf_slot.free.store(false, Ordering::Relaxed); + Some((offset, buf, &mut self.inner.mmap()[offset..][..size])) + } + + /// Returns the buffer associated with the given key and its offset (usize) in the mempool. + /// + /// The parameters are: + /// + /// - `width`: the width of this buffer (in pixels) + /// - `height`: the height of this buffer (in pixels) + /// - `stride`: distance (in bytes) between the beginning of a row and the next one + /// - `key`: a borrowed form of the stored key type + /// - `format`: the encoding format of the pixels. + /// + /// The offset can be used to determine whether or not a buffer was moved in the mempool + /// and by consequence if it should be damaged partially or fully. + pub(crate) fn create_buffer<Q>( + &mut self, + width: i32, + stride: i32, + height: i32, + key: &Q, + format: wl_shm::Format, + ) -> Result<(usize, &wl_buffer::WlBuffer, &mut [u8]), PoolError> + where + K: Borrow<Q>, + Q: PartialEq + ToOwned<Owned = K>, + { + let index = self.insert(width, stride, height, key, format)?; + self.get_at(index, width, stride, height, format) + } + + /// Retreives the buffer at the given index. + fn get_at( + &mut self, + index: usize, + width: i32, + stride: i32, + height: i32, + format: wl_shm::Format, + ) -> Result<(usize, &wl_buffer::WlBuffer, &mut [u8]), PoolError> { + let len = self.inner.len(); + let size = (stride * height) as usize; + let buf_slot = self.buffer_list.get_mut(index).ok_or(PoolError::NotFound)?; + + if size > buf_slot.size { + return Err(PoolError::Overlap); + } + + buf_slot.used = size; + let offset = buf_slot.offset; + if buf_slot.buffer.is_none() { + if offset + size > len { + self.inner + .resize(offset + size + size / 20) + .map_err(|_| PoolError::Overlap)?; + } + let free = Arc::new(AtomicBool::new(true)); + let data = BufferObjectData { free: free.clone() }; + let buffer = self.inner.create_buffer_raw( + offset as i32, + width, + height, + stride, + format, + Arc::new(data), + ); + buf_slot.free = free; + buf_slot.buffer = Some(buffer); + } + buf_slot.free.store(false, Ordering::Relaxed); + let buf = buf_slot.buffer.as_ref().unwrap(); + Ok((offset, buf, &mut self.inner.mmap()[offset..][..size])) + } + + /// Calcule the offet and size of a buffer based on its stride. + fn offset(mut offset: i32, stride: i32, height: i32) -> (usize, usize) { + // bytes per pixel + let size = stride * height; + // 5% padding. + offset += offset / 20; + offset = (offset + 63) & !63; + (offset as usize, size as usize) + } + + #[allow(clippy::too_many_arguments)] + /// Resizes the pool and appends a new buffer. + fn dyn_resize( + &mut self, + offset: usize, + width: i32, + stride: i32, + height: i32, + key: K, + format: wl_shm::Format, + ) -> Option<()> { + let (offset, size) = Self::offset(offset as i32, stride, height); + if self.inner.len() < offset + size { + self.resize(offset + size + size / 20).ok()?; + } + let free = Arc::new(AtomicBool::new(true)); + let data = BufferObjectData { free: free.clone() }; + let buffer = self.inner.create_buffer_raw( + offset as i32, + width, + height, + stride, + format, + Arc::new(data), + ); + self.buffer_list.push(BufferSlot { + offset, + used: 0, + free, + buffer: Some(buffer), + size, + key, + }); + Some(()) + } +} + +struct BufferObjectData { + free: Arc<AtomicBool>, +} + +impl ObjectData for BufferObjectData { + fn event( + self: Arc<Self>, + _backend: &Backend, + msg: Message<ObjectId, OwnedFd>, + ) -> Option<Arc<dyn ObjectData>> { + debug_assert!(wayland_client::backend::protocol::same_interface( + msg.sender_id.interface(), + wl_buffer::WlBuffer::interface() + )); + debug_assert!(msg.opcode == 0); + + // wl_buffer only has a single event: wl_buffer.release + self.free.store(true, Ordering::Relaxed); + + None + } + + fn destroyed(&self, _: ObjectId) {} +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs new file mode 100644 index 00000000..a12afaa0 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs @@ -0,0 +1,290 @@ +//! A raw shared memory pool handler. +//! +//! This is intended as a safe building block for higher level shared memory pool abstractions and is not +//! encouraged for most library users. + +use rustix::{ + io::Errno, + shm::{Mode, OFlags}, +}; +use std::{ + fs::File, + io, + ops::Deref, + os::unix::prelude::{AsFd, BorrowedFd, OwnedFd}, + sync::Arc, + time::{SystemTime, UNIX_EPOCH}, +}; + +use memmap2::MmapMut; +use wayland_client::{ + backend::ObjectData, + protocol::{wl_buffer, wl_shm, wl_shm_pool}, + Dispatch, Proxy, QueueHandle, WEnum, +}; + +use super::CreatePoolError; + +/// A raw handler for file backed shared memory pools. +/// +/// This type of pool will create the SHM memory pool and provide a way to resize the pool. +/// +/// This pool does not release buffers. If you need this, use one of the higher level pools. +#[derive(Debug)] +pub struct RawPool { + pool: DestroyOnDropPool, + len: usize, + mem_file: File, + mmap: MmapMut, +} + +impl RawPool { + pub fn new(len: usize, shm: &wl_shm::WlShm) -> Result<RawPool, CreatePoolError> { + let shm_fd = RawPool::create_shm_fd()?; + let mem_file = File::from(shm_fd); + mem_file.set_len(len as u64)?; + + let pool = shm + .send_constructor( + wl_shm::Request::CreatePool { + fd: mem_file.as_fd(), + size: len as i32, + }, + Arc::new(ShmPoolData), + ) + .unwrap_or_else(|_| Proxy::inert(shm.backend().clone())); + let mmap = unsafe { MmapMut::map_mut(&mem_file)? }; + + Ok(RawPool { + pool: DestroyOnDropPool(pool), + len, + mem_file, + mmap, + }) + } + + /// Resizes the memory pool, notifying the server the pool has changed in size. + /// + /// The [`wl_shm`] protocol only allows the pool to be made bigger. If the new size is smaller than the + /// current size of the pool, this function will do nothing. + pub fn resize(&mut self, size: usize) -> io::Result<()> { + if size > self.len { + self.len = size; + self.mem_file.set_len(size as u64)?; + self.pool.resize(size as i32); + self.mmap = unsafe { MmapMut::map_mut(&self.mem_file) }?; + } + + Ok(()) + } + + /// Returns a reference to the underlying shared memory file using the memmap2 crate. + pub fn mmap(&mut self) -> &mut MmapMut { + &mut self.mmap + } + + /// Returns the size of the mempool + #[allow(clippy::len_without_is_empty)] + pub fn len(&self) -> usize { + self.len + } + + /// Create a new buffer to this pool. + /// + /// ## Parameters + /// - `offset`: the offset (in bytes) from the beginning of the pool at which this buffer starts. + /// - `width` and `height`: the width and height of the buffer in pixels. + /// - `stride`: distance (in bytes) between the beginning of a row and the next one. + /// - `format`: the encoding format of the pixels. + /// + /// The encoding format of the pixels must be supported by the compositor or else a protocol error is + /// risen. You can ensure the format is supported by listening to [`Shm::formats`](crate::shm::Shm::formats). + /// + /// Note this function only creates the [`wl_buffer`] object, you will need to write to the pixels using the + /// [`io::Write`] implementation or [`RawPool::mmap`]. + #[allow(clippy::too_many_arguments)] + pub fn create_buffer<D, U>( + &mut self, + offset: i32, + width: i32, + height: i32, + stride: i32, + format: wl_shm::Format, + udata: U, + qh: &QueueHandle<D>, + ) -> wl_buffer::WlBuffer + where + D: Dispatch<wl_buffer::WlBuffer, U> + 'static, + U: Send + Sync + 'static, + { + self.pool + .create_buffer(offset, width, height, stride, format, qh, udata) + } + + /// Create a new buffer to this pool. + /// + /// This is identical to [`Self::create_buffer`], but allows using a custom [`ObjectData`] + /// implementation instead of relying on the [Dispatch] interface. + #[allow(clippy::too_many_arguments)] + pub fn create_buffer_raw( + &mut self, + offset: i32, + width: i32, + height: i32, + stride: i32, + format: wl_shm::Format, + data: Arc<dyn ObjectData + 'static>, + ) -> wl_buffer::WlBuffer { + self.pool + .send_constructor( + wl_shm_pool::Request::CreateBuffer { + offset, + width, + height, + stride, + format: WEnum::Value(format), + }, + data, + ) + .unwrap_or_else(|_| Proxy::inert(self.pool.backend().clone())) + } + + /// Returns the pool object used to communicate with the server. + pub fn pool(&self) -> &wl_shm_pool::WlShmPool { + &self.pool + } +} + +impl AsFd for RawPool { + fn as_fd(&self) -> BorrowedFd<'_> { + self.mem_file.as_fd() + } +} + +impl From<RawPool> for OwnedFd { + fn from(pool: RawPool) -> Self { + pool.mem_file.into() + } +} + +impl io::Write for RawPool { + fn write(&mut self, buf: &[u8]) -> io::Result<usize> { + io::Write::write(&mut self.mem_file, buf) + } + + fn flush(&mut self) -> io::Result<()> { + io::Write::flush(&mut self.mem_file) + } +} + +impl io::Seek for RawPool { + fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> { + io::Seek::seek(&mut self.mem_file, pos) + } +} + +impl RawPool { + fn create_shm_fd() -> io::Result<OwnedFd> { + #[cfg(target_os = "linux")] + { + match RawPool::create_memfd() { + Ok(fd) => return Ok(fd), + + // Not supported, use fallback. + Err(Errno::NOSYS) => (), + + Err(err) => return Err(Into::<io::Error>::into(err)), + } + } + + let time = SystemTime::now(); + let mut mem_file_handle = format!( + "/smithay-client-toolkit-{}", + time.duration_since(UNIX_EPOCH).unwrap().subsec_nanos() + ); + + loop { + let flags = OFlags::CREATE | OFlags::EXCL | OFlags::RDWR; + + let mode = Mode::RUSR | Mode::WUSR; + + match rustix::shm::open(mem_file_handle.as_str(), flags, mode) { + Ok(fd) => match rustix::shm::unlink(mem_file_handle.as_str()) { + Ok(()) => return Ok(fd), + + Err(errno) => { + return Err(errno.into()); + } + }, + + Err(Errno::EXIST) => { + // Change the handle if we happen to be duplicate. + let time = SystemTime::now(); + + mem_file_handle = format!( + "/smithay-client-toolkit-{}", + time.duration_since(UNIX_EPOCH).unwrap().subsec_nanos() + ); + } + + Err(Errno::INTR) => (), + + Err(err) => return Err(err.into()), + } + } + } + + #[cfg(target_os = "linux")] + fn create_memfd() -> rustix::io::Result<OwnedFd> { + use rustix::fs::{MemfdFlags, SealFlags}; + + loop { + let name = c"smithay-client-toolkit"; + let flags = MemfdFlags::ALLOW_SEALING | MemfdFlags::CLOEXEC; + + match rustix::fs::memfd_create(name, flags) { + Ok(fd) => { + // We only need to seal for the purposes of optimization, ignore the errors. + let _ = rustix::fs::fcntl_add_seals(&fd, SealFlags::SHRINK | SealFlags::SEAL); + return Ok(fd); + } + + Err(Errno::INTR) => (), + + Err(err) => return Err(err), + } + } + } +} + +#[derive(Debug)] +struct DestroyOnDropPool(wl_shm_pool::WlShmPool); + +impl Deref for DestroyOnDropPool { + type Target = wl_shm_pool::WlShmPool; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl Drop for DestroyOnDropPool { + fn drop(&mut self) { + self.0.destroy(); + } +} + +#[derive(Debug)] +struct ShmPoolData; + +impl ObjectData for ShmPoolData { + fn event( + self: Arc<Self>, + _: &wayland_client::backend::Backend, + _: wayland_client::backend::protocol::Message<wayland_client::backend::ObjectId, OwnedFd>, + ) -> Option<Arc<(dyn ObjectData + 'static)>> { + unreachable!("wl_shm_pool has no events") + } + + fn destroyed(&self, _: wayland_client::backend::ObjectId) {} +} diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs new file mode 100644 index 00000000..ab52c5f6 --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs @@ -0,0 +1,596 @@ +//! A pool implementation based on buffer slots + +use std::io; +use std::{ + os::unix::io::{AsRawFd, OwnedFd}, + sync::{ + atomic::{AtomicU8, AtomicUsize, Ordering}, + Arc, Mutex, Weak, + }, +}; + +use wayland_client::backend::protocol::Message; +use wayland_client::backend::{ObjectData, ObjectId}; +use wayland_client::{ + protocol::{wl_buffer, wl_shm, wl_surface}, + Proxy, +}; + +use crate::wayland::shm::raw::RawPool; +use crate::wayland::shm::CreatePoolError; + +#[derive(Debug, thiserror::Error)] +pub(crate) enum CreateBufferError { + /// Slot creation error. + #[error(transparent)] + Io(#[from] io::Error), + + /// Pool mismatch. + #[error("Incorrect pool for slot")] + PoolMismatch, + + /// Slot size mismatch + #[error("Requested buffer size is too large for slot")] + SlotTooSmall, +} + +#[derive(Debug, thiserror::Error)] +pub(crate) enum ActivateSlotError { + /// Buffer was already active + #[error("Buffer was already active")] + AlreadyActive, +} + +#[derive(Debug)] +pub(crate) struct SlotPool { + pub(crate) inner: RawPool, + free_list: Arc<Mutex<Vec<FreelistEntry>>>, +} + +#[derive(Debug)] +struct FreelistEntry { + offset: usize, + len: usize, +} + +/// A chunk of memory allocated from a [`SlotPool`] +/// +/// Retaining this object is only required if you wish to resize or change the buffer's format +/// without changing the contents of the backing memory. +#[derive(Debug)] +pub(crate) struct Slot { + inner: Arc<SlotInner>, +} + +#[derive(Debug)] +struct SlotInner { + free_list: Weak<Mutex<Vec<FreelistEntry>>>, + offset: usize, + len: usize, + active_buffers: AtomicUsize, + /// Count of all "real" references to this slot. This includes all Slot objects and any + /// [`BufferData`] object that is not in the DEAD state. When this reaches zero, the memory for + /// this slot will return to the [`free_list`]. It is not possible for it to reach zero and have a + /// Slot or Buffer referring to it. + all_refs: AtomicUsize, +} + +/// A wrapper around a [`wl_buffer::WlBuffer`] which has been allocated via a [`SlotPool`]. +/// +/// When this object is dropped, the buffer will be destroyed immediately if it is not active, or +/// upon the server's release if it is. +#[derive(Debug)] +pub(crate) struct Buffer { + inner: wl_buffer::WlBuffer, + height: i32, + stride: i32, + slot: Slot, +} + +/// [`ObjectData`] for the [`WlBuffer`] +#[derive(Debug)] +struct BufferData { + inner: Arc<SlotInner>, + state: AtomicU8, +} + +// These constants define the value of BufferData::state, since AtomicEnum does not exist. +impl BufferData { + /// Buffer is counted in [`active_buffers`] list; will return to INACTIVE on Release. + const ACTIVE: u8 = 0; + + /// Buffer is not counted in [`active_buffers`] list, but also has not been destroyed. + const INACTIVE: u8 = 1; + + /// Buffer is counted in [`active_buffers`] list; will move to DEAD on Release + const DESTROY_ON_RELEASE: u8 = 2; + + /// Buffer has been destroyed + const DEAD: u8 = 3; + + /// Value that is [`ORed`] on buffer release to transition to the next state + const RELEASE_SET: u8 = 1; + + /// Value that is [`ORed`] on buffer destroy to transition to the next state + const DESTROY_SET: u8 = 2; + + /// Call after successfully transitioning the state to DEAD + fn record_death(&self) { + drop(Slot { + inner: self.inner.clone(), + }); + } +} + +impl SlotPool { + pub(crate) fn new(len: usize, shm: &wl_shm::WlShm) -> Result<Self, CreatePoolError> { + let inner = RawPool::new(len, shm)?; + let free_list = Arc::new(Mutex::new(vec![FreelistEntry { + offset: 0, + len: inner.len(), + }])); + Ok(SlotPool { inner, free_list }) + } + + /// Create a new buffer in a new slot. + /// + /// This returns the buffer and the canvas. The parameters are: + /// + /// - `width`: the width of this buffer (in pixels) + /// - `height`: the height of this buffer (in pixels) + /// - `stride`: distance (in bytes) between the beginning of a row and the next one + /// - `format`: the encoding format of the pixels. Using a format that was not + /// advertised to the `wl_shm` global by the server is a protocol error and will + /// terminate your connection. + /// + /// The [Slot] for this buffer will have exactly the size required for the data. It can be + /// accessed via [`Buffer::slot`] to create additional buffers that point to the same data. This + /// is required if you wish to change formats, buffer dimensions, or attach a canvas to + /// multiple surfaces. + /// + /// For more control over sizing, use [`Self::new_slot`] and [`Self::create_buffer_in`]. + pub(crate) fn create_buffer( + &mut self, + width: i32, + height: i32, + stride: i32, + format: wl_shm::Format, + ) -> Result<(Buffer, &mut [u8]), CreateBufferError> { + let len = (height as usize) * (stride as usize); + let slot = self.new_slot(len)?; + let buffer = self.create_buffer_in(&slot, width, height, stride, format)?; + let canvas = self.raw_data_mut(&slot); + Ok((buffer, canvas)) + } + + /// Get the bytes corresponding to a given slot or buffer if drawing to the slot is permitted. + /// + /// Returns `None` if there are active buffers in the slot or if the slot does not correspond + /// to this pool. + pub(crate) fn canvas(&mut self, key: &impl CanvasKey) -> Option<&mut [u8]> { + key.canvas(self) + } + + /// Returns the size, in bytes, of this pool. + #[allow(clippy::len_without_is_empty)] + pub(crate) fn len(&self) -> usize { + self.inner.len() + } + + /// Resizes the memory pool, notifying the server the pool has changed in size. + /// + /// This is an optimization; the pool automatically resizes when you allocate new slots. + pub(crate) fn resize(&mut self, size: usize) -> io::Result<()> { + let old_len = self.inner.len(); + self.inner.resize(size)?; + let new_len = self.inner.len(); + if old_len == new_len { + return Ok(()); + } + // add the new memory to the freelist + let mut free = self.free_list.lock().unwrap(); + if let Some(FreelistEntry { offset, len }) = free.last_mut() { + if *offset + *len == old_len { + *len += new_len - old_len; + return Ok(()); + } + } + free.push(FreelistEntry { + offset: old_len, + len: new_len - old_len, + }); + Ok(()) + } + + fn alloc(&mut self, size: usize) -> io::Result<usize> { + let mut free = self.free_list.lock().unwrap(); + for FreelistEntry { offset, len } in free.iter_mut() { + if *len >= size { + let rv = *offset; + *len -= size; + *offset += size; + return Ok(rv); + } + } + let mut rv = self.inner.len(); + let mut pop_tail = false; + if let Some(FreelistEntry { offset, len }) = free.last() { + if offset + len == self.inner.len() { + rv -= len; + pop_tail = true; + } + } + // resize like Vec::reserve, always at least doubling + let target = std::cmp::max(rv + size, self.inner.len() * 2); + self.inner.resize(target)?; + // adjust the end of the freelist here + if pop_tail { + free.pop(); + } + if target > rv + size { + free.push(FreelistEntry { + offset: rv + size, + len: target - rv - size, + }); + } + Ok(rv) + } + + fn free(free_list: &Mutex<Vec<FreelistEntry>>, mut offset: usize, mut len: usize) { + let mut free = free_list.lock().unwrap(); + let mut nf = Vec::with_capacity(free.len() + 1); + for &FreelistEntry { + offset: ioff, + len: ilen, + } in free.iter() + { + if ioff + ilen == offset { + offset = ioff; + len += ilen; + continue; + } + if ioff == offset + len { + len += ilen; + continue; + } + if ioff > offset + len && len != 0 { + nf.push(FreelistEntry { offset, len }); + len = 0; + } + if ilen != 0 { + nf.push(FreelistEntry { + offset: ioff, + len: ilen, + }); + } + } + if len != 0 { + nf.push(FreelistEntry { offset, len }); + } + *free = nf; + } + + /// Create a new slot with the given size in bytes. + pub(crate) fn new_slot(&mut self, mut len: usize) -> io::Result<Slot> { + len = (len + 63) & !63; + let offset = self.alloc(len)?; + + Ok(Slot { + inner: Arc::new(SlotInner { + free_list: Arc::downgrade(&self.free_list), + offset, + len, + active_buffers: AtomicUsize::new(0), + all_refs: AtomicUsize::new(1), + }), + }) + } + + /// Get the bytes corresponding to a given slot. + /// + /// Note: prefer using [`Self::canvas`], which will prevent drawing to a buffer that has not been + /// released by the server. + /// + /// Returns an empty buffer if the slot does not belong to this pool. + pub(crate) fn raw_data_mut(&mut self, slot: &Slot) -> &mut [u8] { + if slot.inner.free_list.as_ptr() == Arc::as_ptr(&self.free_list) { + &mut self.inner.mmap()[slot.inner.offset..][..slot.inner.len] + } else { + &mut [] + } + } + + /// Create a new buffer corresponding to a slot. + /// + /// The parameters are: + /// + /// - `width`: the width of this buffer (in pixels) + /// - `height`: the height of this buffer (in pixels) + /// - `stride`: distance (in bytes) between the beginning of a row and the next one + /// - `format`: the encoding format of the pixels. Using a format that was not + /// advertised to the `wl_shm` global by the server is a protocol error and will + /// terminate your connection + pub(crate) fn create_buffer_in( + &mut self, + slot: &Slot, + width: i32, + height: i32, + stride: i32, + format: wl_shm::Format, + ) -> Result<Buffer, CreateBufferError> { + let offset = slot.inner.offset as i32; + let len = (height as usize) * (stride as usize); + if len > slot.inner.len { + return Err(CreateBufferError::SlotTooSmall); + } + + if slot.inner.free_list.as_ptr() != Arc::as_ptr(&self.free_list) { + return Err(CreateBufferError::PoolMismatch); + } + + let slot = slot.clone(); + // take a ref for the BufferData, which will be destroyed by BufferData::record_death + slot.inner.all_refs.fetch_add(1, Ordering::Relaxed); + let data = Arc::new(BufferData { + inner: slot.inner.clone(), + state: AtomicU8::new(BufferData::INACTIVE), + }); + let buffer = self + .inner + .create_buffer_raw(offset, width, height, stride, format, data); + Ok(Buffer { + inner: buffer, + height, + stride, + slot, + }) + } +} + +impl Clone for Slot { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + inner.all_refs.fetch_add(1, Ordering::Relaxed); + Slot { inner } + } +} + +impl Drop for Slot { + fn drop(&mut self) { + if self.inner.all_refs.fetch_sub(1, Ordering::Relaxed) == 1 { + if let Some(free_list) = self.inner.free_list.upgrade() { + SlotPool::free(&free_list, self.inner.offset, self.inner.len); + } + } + } +} + +impl Drop for SlotInner { + fn drop(&mut self) { + debug_assert_eq!(*self.all_refs.get_mut(), 0); + } +} + +/// A helper trait for [`SlotPool::canvas`]. +pub(crate) trait CanvasKey { + fn canvas<'pool>(&self, pool: &'pool mut SlotPool) -> Option<&'pool mut [u8]>; +} + +impl Slot { + /// Return true if there are buffers referencing this slot whose contents are being accessed + /// by the server. + pub(crate) fn has_active_buffers(&self) -> bool { + self.inner.active_buffers.load(Ordering::Relaxed) != 0 + } + + /// Returns the size, in bytes, of this slot. + #[allow(clippy::len_without_is_empty)] + pub(crate) fn len(&self) -> usize { + self.inner.len + } + + /// Get the bytes corresponding to a given slot if drawing to the slot is permitted. + /// + /// Returns `None` if there are active buffers in the slot or if the slot does not correspond + /// to this pool. + pub(crate) fn canvas<'pool>(&self, pool: &'pool mut SlotPool) -> Option<&'pool mut [u8]> { + if self.has_active_buffers() { + return None; + } + if self.inner.free_list.as_ptr() == Arc::as_ptr(&pool.free_list) { + Some(&mut pool.inner.mmap()[self.inner.offset..][..self.inner.len]) + } else { + None + } + } +} + +impl CanvasKey for Slot { + fn canvas<'pool>(&self, pool: &'pool mut SlotPool) -> Option<&'pool mut [u8]> { + self.canvas(pool) + } +} + +impl Buffer { + /// Attach a buffer to a surface. + /// + /// This marks the slot as active until the server releases the buffer, which will happen + /// automatically assuming the surface is committed without attaching a different buffer. + /// + /// Note: if you need to ensure that [`canvas()`](Buffer::canvas) calls never return data that + /// could be attached to a surface in a multi-threaded client, make this call while you have + /// exclusive access to the corresponding [`SlotPool`]. + pub(crate) fn attach_to(&self, surface: &wl_surface::WlSurface) -> Result<(), ActivateSlotError> { + self.activate()?; + surface.attach(Some(&self.inner), 0, 0); + Ok(()) + } + + /// Get the inner buffer. + pub(crate) fn wl_buffer(&self) -> &wl_buffer::WlBuffer { + &self.inner + } + + pub(crate) fn height(&self) -> i32 { + self.height + } + + pub(crate) fn stride(&self) -> i32 { + self.stride + } + + fn data(&self) -> Option<&BufferData> { + self.inner.object_data()?.downcast_ref() + } + + /// Get the bytes corresponding to this buffer if drawing is permitted. + /// + /// This may be smaller than the canvas associated with the slot. + pub(crate) fn canvas<'pool>(&self, pool: &'pool mut SlotPool) -> Option<&'pool mut [u8]> { + let len = (self.height as usize) * (self.stride as usize); + if self.slot.inner.active_buffers.load(Ordering::Relaxed) != 0 { + return None; + } + if self.slot.inner.free_list.as_ptr() == Arc::as_ptr(&pool.free_list) { + Some(&mut pool.inner.mmap()[self.slot.inner.offset..][..len]) + } else { + None + } + } + + /// Get the slot corresponding to this buffer. + pub(crate) fn slot(&self) -> Slot { + self.slot.clone() + } + + /// Manually mark a buffer as active. + /// + /// An active buffer prevents drawing on its slot until a Release event is received or until + /// manually deactivated. + pub(crate) fn activate(&self) -> Result<(), ActivateSlotError> { + let data = self.data().expect("UserData type mismatch"); + + // This bitwise AND will transition INACTIVE -> ACTIVE, or do nothing if the buffer was + // already ACTIVE. No other ordering is required, as the server will not send a Release + // until we send our attach after returning Ok. + match data + .state + .fetch_and(!BufferData::RELEASE_SET, Ordering::Relaxed) + { + BufferData::INACTIVE => { + data.inner.active_buffers.fetch_add(1, Ordering::Relaxed); + Ok(()) + } + BufferData::ACTIVE => Err(ActivateSlotError::AlreadyActive), + _ => unreachable!("Invalid state in BufferData"), + } + } + + /// Manually mark a buffer as inactive. + /// + /// This should be used when the buffer was manually marked as active or when a buffer was + /// attached to a surface but not committed. Calling this function on a buffer that was + /// committed to a surface risks making the surface contents undefined. + pub(crate) fn deactivate(&self) -> Result<(), ActivateSlotError> { + let data = self.data().expect("UserData type mismatch"); + + // Same operation as the Release event, but we know the Buffer was not dropped. + match data + .state + .fetch_or(BufferData::RELEASE_SET, Ordering::Relaxed) + { + BufferData::ACTIVE => { + data.inner.active_buffers.fetch_sub(1, Ordering::Relaxed); + Ok(()) + } + BufferData::INACTIVE => Err(ActivateSlotError::AlreadyActive), + _ => unreachable!("Invalid state in BufferData"), + } + } +} + +impl CanvasKey for Buffer { + fn canvas<'pool>(&self, pool: &'pool mut SlotPool) -> Option<&'pool mut [u8]> { + self.canvas(pool) + } +} + +impl Drop for Buffer { + fn drop(&mut self) { + if let Some(data) = self.data() { + match data + .state + .fetch_or(BufferData::DESTROY_SET, Ordering::Relaxed) + { + BufferData::ACTIVE => { + // server is using the buffer, let ObjectData handle the destroy + } + BufferData::INACTIVE => { + data.record_death(); + self.inner.destroy(); + } + _ => unreachable!("Invalid state in BufferData"), + } + } + } +} + +impl ObjectData for BufferData { + fn event( + self: Arc<Self>, + handle: &wayland_client::backend::Backend, + msg: Message<ObjectId, OwnedFd>, + ) -> Option<Arc<dyn ObjectData>> { + debug_assert!(wayland_client::backend::protocol::same_interface( + msg.sender_id.interface(), + wl_buffer::WlBuffer::interface() + )); + debug_assert!(msg.opcode == 0); + + match self + .state + .fetch_or(BufferData::RELEASE_SET, Ordering::Relaxed) + { + BufferData::ACTIVE => { + self.inner.active_buffers.fetch_sub(1, Ordering::Relaxed); + } + BufferData::INACTIVE => { + // possible spurious release, or someone called deactivate incorrectly + eprintln!("Unexpected WlBuffer::Release on an inactive buffer"); + } + BufferData::DESTROY_ON_RELEASE => { + self.record_death(); + self.inner.active_buffers.fetch_sub(1, Ordering::Relaxed); + + // The Destroy message is identical to Release message (no args, same ID), so just reply + handle + .send_request(msg.map_fd(|x| x.as_raw_fd()), None, None) + .expect("Unexpected invalid ID"); + } + BufferData::DEAD => { + // no-op, this object is already unusable + } + _ => unreachable!("Invalid state in BufferData"), + } + + None + } + + fn destroyed(&self, _: ObjectId) {} +} + +impl Drop for BufferData { + fn drop(&mut self) { + let state = *self.state.get_mut(); + if state == BufferData::ACTIVE || state == BufferData::DESTROY_ON_RELEASE { + // Release the active-buffer count + self.inner.active_buffers.fetch_sub(1, Ordering::Relaxed); + } + + if state != BufferData::DEAD { + // nobody has ever transitioned state to DEAD, so we are responsible for freeing the + // extra reference + self.record_death(); + } + } +} diff --git a/pkgs/by-name/ri/river-mk-keymap/update.sh b/pkgs/by-name/ri/river-mk-keymap/update.sh new file mode 100755 index 00000000..8e36e13e --- /dev/null +++ b/pkgs/by-name/ri/river-mk-keymap/update.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +[ "$1" = "upgrade" ] && cargo upgrade +cargo update diff --git a/pkgs/by-name/sc/screenshot_persistent/package.nix b/pkgs/by-name/sc/screenshot_persistent/package.nix index f79315a1..34054b0f 100644 --- a/pkgs/by-name/sc/screenshot_persistent/package.nix +++ b/pkgs/by-name/sc/screenshot_persistent/package.nix @@ -1,5 +1,14 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, grim, slurp, alacritty, @@ -7,12 +16,10 @@ libnotify, lf, # TODO: add llp }: -sysLib.writeShellScript { +writeShellApplication { name = "screenshot_persistent"; - src = ./screenshot_persistent.sh; - generateCompletions = false; - keepPath = true; - dependencies = [ + text = builtins.readFile ./screenshot_persistent.sh; + runtimeInputs = [ grim slurp alacritty @@ -20,4 +27,7 @@ sysLib.writeShellScript { libnotify lf # TODO: add llp ]; + meta = { + mainProgram = "screenshot_persistent"; + }; } diff --git a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh index 4308b8d2..0eeb75c0 100755 --- a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh +++ b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh @@ -1,10 +1,16 @@ -#! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# shellcheck shell=bash -# only generate a path (this could lead to a time-of-check/time-of-use bug) -tmp="$(mktmp --dry-run)" +tmp="$(mktemp)" if grim -g "$(slurp)" "$tmp"; then name="$(rofi -dmenu -p "Name of screenshot: " -l 0)" @@ -16,7 +22,7 @@ if grim -g "$(slurp)" "$tmp"; then done mv "$tmp" "$screen_shot_path" - alacritty -e lf -command ":{{ set sortby atime; set reverse!; }}" + alacritty --title "floating please" --command lf -command ":{{ set sortby atime; set reverse!; set info time; }}" "$screen_shot_path" fi # vim: ft=sh diff --git a/pkgs/by-name/sc/screenshot_temporary/package.nix b/pkgs/by-name/sc/screenshot_temporary/package.nix index f3739b01..49bbeeb7 100644 --- a/pkgs/by-name/sc/screenshot_temporary/package.nix +++ b/pkgs/by-name/sc/screenshot_temporary/package.nix @@ -1,15 +1,24 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, + writeShellApplication, + # Dependencies grim, slurp, wl-clipboard, }: -sysLib.writeShellScript { +writeShellApplication { name = "screenshot_temporary"; - src = ./screenshot_temporary.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ + text = builtins.readFile ./screenshot_temporary.sh; + inheritPath = false; + runtimeInputs = [ grim slurp wl-clipboard diff --git a/pkgs/by-name/sc/screenshot_temporary/screenshot_temporary.sh b/pkgs/by-name/sc/screenshot_temporary/screenshot_temporary.sh index 8968ca79..db1a79b7 100755 --- a/pkgs/by-name/sc/screenshot_temporary/screenshot_temporary.sh +++ b/pkgs/by-name/sc/screenshot_temporary/screenshot_temporary.sh @@ -1,7 +1,14 @@ #! /usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. grim -g "$(slurp)" | wl-copy diff --git a/pkgs/by-name/sn/snap-sync-forked/package.nix b/pkgs/by-name/sn/snap-sync-forked/package.nix deleted file mode 100644 index b3f40b24..00000000 --- a/pkgs/by-name/sn/snap-sync-forked/package.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - sysLib, - bash, - btrfs-progs, - coreutils, - gawk, - gnugrep, - snapper, - util-linux, - # optional - libnotify, - openssh, - pv, - rsync, - sudo, -}: -sysLib.writeShellScript { - name = "snap-sync-forked"; - src = ./snap-sync-forked.sh; - dependencies = [ - bash - btrfs-progs - coreutils - gawk - gnugrep - snapper - util-linux - - # optional: - libnotify - openssh - pv - rsync - sudo - ]; -} diff --git a/pkgs/by-name/sn/snap-sync-forked/snap-sync-forked.sh b/pkgs/by-name/sn/snap-sync-forked/snap-sync-forked.sh deleted file mode 100755 index 3d9c1ac9..00000000 --- a/pkgs/by-name/sn/snap-sync-forked/snap-sync-forked.sh +++ /dev/null @@ -1,534 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# -# snap-sync -# https://github.com/wesbarnett/snap-sync -# Copyright (C) 2016-2021 Wes Barnett - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., - -# ------------------------------------------------------------------------- - -# Takes snapshots of each snapper configuration. It then sends the snapshot to -# a location on an external drive. After the initial transfer, it does -# incremental snapshots on later calls. It's important not to delete the -# snapshot created on your system since that will be used to determine the -# difference for the next incremental snapshot. - -set -o errtrace - -version="0.7" -name="snap-sync" - -printf "\nsnap-sync version %s, Copyright (C) 2016-2021 Wes Barnett\n" "$version" -printf "snap-sync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the license for more information. \n\n" - -# The following line is modified by the Makefile or -# find_snapper_config script -SNAPPER_CONFIG=/etc/sysconfig/snapper - -donotify=0 -if ! command -v notify-send &>/dev/null; then - donotify=1 -fi - -doprogress=0 -if ! command -v pv &>/dev/null; then - doprogress=1 -fi - -error() { - printf "==> ERROR: %s\n" "$@" - notify_error 'Error' 'Check journal for more information.' -} >&2 - -die() { - error "$@" - exit 1 -} - -traperror() { - printf "Exited due to error on line %s.\n" "$1" - printf "exit status: %s\n" "$2" - printf "command: %s\n" "$3" - printf "bash line: %s\n" "$4" - printf "function name: %s\n" "$5" - exit 1 -} - -trapkill() { - die "Exited due to user intervention." -} - -trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR -trap trapkill SIGTERM SIGINT - -usage() { - cat <<EOF -$name $version -Usage: $name [options] - -Options: - -c, --config <config> snapper configuration to backup - -d, --description <desc> snapper description - -h, --help print this message - -n, --noconfirm do not ask for confirmation - -k, --keepold keep old incremental snapshots instead of deleting them - after backup is performed - -p, --port <port> remote port; used with '--remote'. - -q, --quiet do not send notifications; instead print them. - -r, --remote <address> ip address of a remote machine to backup to - --sudo use sudo on the remote machine - -s, --subvolid <subvlid> subvolume id of the mounted BTRFS subvolume to back up to - -u, --UUID <UUID> UUID of the mounted BTRFS subvolume to back up to - -See 'man snap-sync' for more details. -EOF -} - -ssh="" -sudo=0 -while [[ $# -gt 0 ]]; do - key="$1" - case $key in - -d | --description) - description="$2" - shift 2 - ;; - -c | --config) - selected_configs="$2" - shift 2 - ;; - -u | --UUID) - uuid_cmdline="$2" - shift 2 - ;; - -s | --subvolid) - subvolid_cmdline="$2" - shift 2 - ;; - -k | --keepold) - keep="yes" - shift - ;; - -n | --noconfirm) - noconfirm="yes" - shift - ;; - -h | --help) - usage - exit 1 - ;; - -q | --quiet) - donotify=1 - shift - ;; - -r | --remote) - remote=$2 - shift 2 - ;; - -p | --port) - port=$2 - shift 2 - ;; - --sudo) - sudo=1 - shift - ;; - *) - die "Unknown option: '$key'. Run '$name -h' for valid options." - ;; - esac -done - -notify() { - for u in $(users | tr ' ' '\n' | sort -u); do - sudo -u "$u" DISPLAY=:0 \ - DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(sudo -u "$u" id -u)/bus" \ - notify-send -a $name "$1" "$2" --icon="dialog-$3" - done -} - -notify_info() { - if [[ $donotify -eq 0 ]]; then - notify "$1" "$2" "information" - else - printf '%s\n' "$1: $2" - fi -} - -notify_error() { - if [[ $donotify -eq 0 ]]; then - notify "$1" "$2" "error" - else - printf '%s\n' "$1: $2" - fi -} - -[[ $EUID -ne 0 ]] && die "Script must be run as root. See '$name -h' for a description of options" -! [[ -f $SNAPPER_CONFIG ]] && die "$SNAPPER_CONFIG does not exist." - -description=${description:-"latest incremental backup"} -uuid_cmdline=${uuid_cmdline:-"none"} -subvolid_cmdline=${subvolid_cmdline:-"5"} -noconfirm=${noconfirm:-"no"} - -if [[ -z $remote ]]; then - if ! command -v rsync &>/dev/null; then - die "--remote specified but rsync command not found" - fi -fi - -if [[ $uuid_cmdline != "none" ]]; then - if [[ -z $remote ]]; then - notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid=$subvolid_cmdline..." - else - notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid $subvolid_cmdline at $remote..." - fi -else - if [[ -z $remote ]]; then - notify_info "Backup started" "Starting backups. Use command line menu to select disk." - else - notify_info "Backup started" "Starting backups. Use command line menu to select disk on $remote." - fi -fi - -if [[ -n $remote ]]; then - ssh="ssh $remote" - if [[ -n $port ]]; then - ssh="$ssh -p $port" - fi - if [[ $sudo -eq 1 ]]; then - ssh="$ssh sudo" - fi -fi - -if [[ "$($ssh findmnt -n -v --target / -o FSTYPE)" == "btrfs" ]]; then - EXCLUDE_UUID=$($ssh findmnt -n -v -t btrfs --target / -o UUID) - TARGETS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v "$EXCLUDE_UUID" | awk '{print $2}') - UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v "$EXCLUDE_UUID" | awk '{print $1}') -else - TARGETS=$($ssh findmnt -n -v -t btrfs -o TARGET --list) - UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID --list) -fi - -declare -a TARGETS_ARRAY -declare -a UUIDS_ARRAY -declare -a SUBVOLIDS_ARRAY - -i=0 -for x in $TARGETS; do - SUBVOLIDS_ARRAY[i]=$($ssh btrfs subvolume show "$x" | awk '/Subvolume ID:/ { print $3 }') - TARGETS_ARRAY[i]=$x - i=$((i + 1)) -done - -i=0 -disk=-1 -disk_count=0 -for x in $UUIDS; do - UUIDS_ARRAY[i]=$x - if [[ $x == "$uuid_cmdline" && ${SUBVOLIDS_ARRAY[$((i))]} == "$subvolid_cmdline" ]]; then - disk=$i - disk_count=$((disk_count + 1)) - fi - i=$((i + 1)) -done - -if [[ ${#UUIDS_ARRAY[$@]} -eq 0 ]]; then - die "No external btrfs subvolumes found to backup to. Run '$name -h' for more options." -fi - -if [[ $disk_count -gt 1 ]]; then - printf "Multiple mount points were found with UUID %s and subvolid %s.\n" "$uuid_cmdline" "$subvolid_cmdline" - disk="-1" -fi - -if [[ $disk == -1 ]]; then - if [[ $disk_count == 0 && $uuid_cmdline != "none" ]]; then - error "A device with UUID $uuid_cmdline and subvolid $subvolid_cmdline was not found to be mounted, or it is not a BTRFS device." - fi - if [[ -z $ssh ]]; then - printf "Select a mounted BTRFS device on your local machine to backup to.\nFor more options, exit and run '%s -h'.\n" "$name" - else - printf "Select a mounted BTRFS device on %s to backup to.\nFor more options, exit and run '%s -h'.\n" "$remote" "$name" - fi - while [[ $disk -lt 0 || $disk -gt $i ]]; do - for x in "${!TARGETS_ARRAY[@]}"; do - printf "%4s) %s (uuid=%s, subvolid=%s)\n" "$((x + 1))" "${TARGETS_ARRAY[$x]}" "${UUIDS_ARRAY[$x]}" "${SUBVOLIDS_ARRAY[$x]}" - done - printf "%4s) Exit\n" "0" - read -e -r -p "Enter a number: " disk - if ! [[ $disk == ?(-)+([0-9]) ]] || [[ $disk -lt 0 || $disk -gt $i ]]; then - printf "\nNo disk selected. Select a disk to continue.\n" - disk=-1 - fi - done - if [[ $disk == 0 ]]; then - exit 0 - fi - disk=$((disk - 1)) -fi - -selected_subvolid="${SUBVOLIDS_ARRAY[$((disk))]}" -selected_uuid="${UUIDS_ARRAY[$((disk))]}" -selected_mnt="${TARGETS_ARRAY[$((disk))]}" -printf "\nYou selected the disk with uuid=%s, subvolid=%s.\n" "$selected_uuid" "$selected_subvolid" -if [[ -z $ssh ]]; then - printf "The disk is mounted at '%s'.\n" "$selected_mnt" -else - printf "The disk is mounted at '%s:%s'.\n" "$remote" "$selected_mnt" -fi - -# shellcheck source=/dev/null -source "$SNAPPER_CONFIG" - -if [[ -z $selected_configs ]]; then - printf "\nInteractively cycling through all snapper configurations...\n" -fi -selected_configs=${selected_configs:-$SNAPPER_CONFIGS} - -declare -a BACKUPDIRS_ARRAY -declare -a MYBACKUPDIR_ARRAY -declare -a OLD_NUM_ARRAY -declare -a OLD_SNAP_ARRAY -declare -a NEW_NUM_ARRAY -declare -a NEW_SNAP_ARRAY -declare -a NEW_INFO_ARRAY -declare -a BACKUPLOC_ARRAY -declare -a CONT_BACKUP_ARRAY - -# Initial configuration of where backup directories are -i=0 -for x in $selected_configs; do - - if [[ "$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {cnt++} END {print cnt}')" -gt 1 ]]; then - error "More than one snapper entry found with UUID $selected_uuid subvolid $selected_subvolid for configuration $x. Skipping configuration $x." - continue - fi - - if [[ "$(snapper -c "$x" list --disable-used-space -t single | awk '/'$name' backup in progress/ {cnt++} END {print cnt}')" -gt 0 ]]; then - printf "\nNOTE: Previous failed %s backup snapshots found for '%s'.\n" "$name" "$x" - if [[ $noconfirm == "yes" ]]; then - printf "'noconfirm' option passed. Failed backups will not be deleted.\n" - else - read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N]? " delete_failed - while [[ -n $delete_failed && $delete_failed != [Yy]"es" && - $delete_failed != [Yy] && $delete_failed != [Nn]"o" && - $delete_failed != [Nn] ]]; do - read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N] " delete_failed - if [[ -n $delete_failed && $delete_failed != [Yy]"es" && - $delete_failed != [Yy] && $delete_failed != [Nn]"o" && - $delete_failed != [Nn] ]]; then - printf "Select 'y' or 'N'.\n" - fi - done - if [[ $delete_failed == [Yy]"es" || $delete_failed == [Yy] ]]; then - # explicit split list of snapshots (on whitespace) into multiple arguments - # shellcheck disable=SC2046 - snapper -c "$x" delete $(snapper -c "$x" list --disable-used-space | awk '/'$name' backup in progress/ {print $1}') - fi - fi - fi - - SNAP_SYNC_EXCLUDE=no - - if [[ -f "/etc/snapper/configs/$x" ]]; then - # shellcheck source=/dev/null - source "/etc/snapper/configs/$x" - else - die "Selected snapper configuration $x does not exist." - fi - - if [[ $SNAP_SYNC_EXCLUDE == "yes" ]]; then - continue - fi - - printf "\n" - - old_num=$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $1}') - old_snap=$SUBVOLUME/.snapshots/$old_num/snapshot - - OLD_NUM_ARRAY[i]=$old_num - OLD_SNAP_ARRAY[i]=$old_snap - - if [[ -z $old_num ]]; then - printf "No backups have been performed for '%s' on this disk.\n" "$x" - read -e -r -p "Enter name of subvolume to store backups, relative to $selected_mnt (to be created if not existing): " mybackupdir - printf "This will be the initial backup for snapper configuration '%s' to this disk. This could take awhile.\n" "$x" - BACKUPDIR="$selected_mnt/$mybackupdir" - $ssh test -d "$BACKUPDIR" || $ssh btrfs subvolume create "$BACKUPDIR" - else - mybackupdir=$(snapper -c "$x" list --disable-used-space -t single | awk -F"|" '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $5}' | awk -F "," '/backupdir/ {print $1}' | awk -F"=" '{print $2}') - BACKUPDIR="$selected_mnt/$mybackupdir" - $ssh test -d "$BACKUPDIR" || die "%s is not a directory on %s.\n" "$BACKUPDIR" "$selected_uuid" - fi - BACKUPDIRS_ARRAY[i]="$BACKUPDIR" - MYBACKUPDIR_ARRAY[i]="$mybackupdir" - - printf "Creating new local snapshot for '%s' configuration...\n" "$x" - new_num=$(snapper -c "$x" create --print-number -d "$name backup in progress") - new_snap=$SUBVOLUME/.snapshots/$new_num/snapshot - new_info=$SUBVOLUME/.snapshots/$new_num/info.xml - sync - backup_location=$BACKUPDIR/$x/$new_num/ - if [[ -z $ssh ]]; then - printf "Will backup %s to %s\n" "$new_snap" "$backup_location/snapshot" - else - printf "Will backup %s to %s\n" "$new_snap" "$remote":"$backup_location/snapshot" - fi - - if ($ssh test -d "$backup_location/snapshot"); then - printf "WARNING: Backup directory '%s' already exists. This configuration will be skipped!\n" "$backup_location/snapshot" - printf "Move or delete destination directory and try backup again.\n" - fi - - NEW_NUM_ARRAY[i]="$new_num" - NEW_SNAP_ARRAY[i]="$new_snap" - NEW_INFO_ARRAY[i]="$new_info" - BACKUPLOC_ARRAY[i]="$backup_location" - - cont_backup="K" - CONT_BACKUP_ARRAY[i]="yes" - if [[ $noconfirm == "yes" ]]; then - cont_backup="yes" - else - while [[ -n $cont_backup && $cont_backup != [Yy]"es" && - $cont_backup != [Yy] && $cont_backup != [Nn]"o" && - $cont_backup != [Nn] ]]; do - read -e -r -p "Proceed with backup of '$x' configuration [Y/n]? " cont_backup - if [[ -n $cont_backup && $cont_backup != [Yy]"es" && - $cont_backup != [Yy] && $cont_backup != [Nn]"o" && - $cont_backup != [Nn] ]]; then - printf "Select 'Y' or 'n'.\n" - fi - done - fi - - if [[ $cont_backup != [Yy]"es" && $cont_backup != [Yy] && -n $cont_backup ]]; then - CONT_BACKUP_ARRAY[i]="no" - printf "Not backing up '%s' configuration.\n" "$x" - snapper -c "$x" delete "$new_num" - fi - - i=$((i + 1)) - -done - -# Actual backing up -printf "\nPerforming backups...\n" -i=-1 -for x in $selected_configs; do - - i=$((i + 1)) - - SNAP_SYNC_EXCLUDE=no - - if [[ -f "/etc/snapper/configs/$x" ]]; then - # shellcheck source=/dev/null - source "/etc/snapper/configs/$x" - else - die "Selected snapper configuration $x does not exist." - fi - - cont_backup=${CONT_BACKUP_ARRAY[$i]} - if [[ $cont_backup == "no" || $SNAP_SYNC_EXCLUDE == "yes" ]]; then - notify_info "Backup in progress" "NOTE: Skipping $x configuration." - continue - fi - - notify_info "Backup in progress" "Backing up $x configuration." - - printf "\n" - - old_num="${OLD_NUM_ARRAY[$i]}" - old_snap="${OLD_SNAP_ARRAY[$i]}" - BACKUPDIR="${BACKUPDIRS_ARRAY[$i]}" - mybackupdir="${MYBACKUPDIR_ARRAY[$i]}" - new_num="${NEW_NUM_ARRAY[$i]}" - new_snap="${NEW_SNAP_ARRAY[$i]}" - new_info="${NEW_INFO_ARRAY[$i]}" - backup_location="${BACKUPLOC_ARRAY[$i]}" - - if ($ssh test -d "$backup_location/snapshot"); then - printf "ERROR: Backup directory '%s' already exists. Skipping backup of this configuration!\n" "$backup_location/snapshot" - continue - fi - - $ssh mkdir -p "$backup_location" - - if [[ -z $old_num ]]; then - printf "Sending first snapshot for '%s' configuration...\n" "$x" - if [[ $doprogress -eq 0 ]]; then - btrfs send "$new_snap" | pv | $ssh btrfs receive "$backup_location" &>/dev/null - else - btrfs send "$new_snap" | $ssh btrfs receive "$backup_location" &>/dev/null - fi - else - - printf "Sending incremental snapshot for '%s' configuration...\n" "$x" - # Sends the difference between the new snapshot and old snapshot to the - # backup location. Using the -c flag instead of -p tells it that there - # is an identical subvolume to the old snapshot at the receiving - # location where it can get its data. This helps speed up the transfer. - - if [[ $doprogress -eq 0 ]]; then - btrfs send -c "$old_snap" "$new_snap" | pv | $ssh btrfs receive "$backup_location" - else - btrfs send -c "$old_snap" "$new_snap" | $ssh btrfs receive "$backup_location" - fi - - if [[ $keep == "yes" ]]; then - printf "Modifying data for old local snapshot for '%s' configuration...\n" "$x" - snapper -v -c "$x" modify -d "old snap-sync snapshot (you may remove)" -u "backupdir=,subvolid=,uuid=" -c "number" "$old_num" - else - printf "Deleting old snapshot for %s...\n" "$x" - snapper -c "$x" delete "$old_num" - fi - - fi - - if [[ -z $remote ]]; then - cp "$new_info" "$backup_location" - else - if [[ -z $port ]]; then - rsync -avzq "$new_info" "$remote":"$backup_location" - else - rsync -avzqe "ssh -p $port" "$new_info" "$remote":"$backup_location" - fi - fi - - # It's important not to change this userdata in the snapshots, since that's how - # we find the previous one. - - userdata="backupdir=$mybackupdir, subvolid=$selected_subvolid, uuid=$selected_uuid" - - # Tag new snapshot as the latest - printf "Tagging local snapshot as latest backup for '%s' configuration...\n" "$x" - snapper -v -c "$x" modify -d "$description" -u "$userdata" "$new_num" - - printf "Backup complete for '%s' configuration.\n" "$x" - -done - -printf "\nDone!\n" - -if [[ $uuid_cmdline != "none" ]]; then - notify_info "Finished" "Backups to $uuid_cmdline complete!" -else - notify_info "Finished" "Backups complete!" -fi diff --git a/pkgs/by-name/so/sort_song/package.nix b/pkgs/by-name/so/sort_song/package.nix deleted file mode 100644 index f74ba57f..00000000 --- a/pkgs/by-name/so/sort_song/package.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - sysLib, - mediainfo, - jq, - gawk, -}: -sysLib.writeShellScript { - name = "sort_song"; - src = ./sort_song.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ - mediainfo - jq - gawk - ]; -} diff --git a/pkgs/by-name/so/sort_song/sort_song.sh b/pkgs/by-name/so/sort_song/sort_song.sh deleted file mode 100755 index e2978507..00000000 --- a/pkgs/by-name/so/sort_song/sort_song.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -case "$("$1" | tr '[:upper:]' '[:lower:]')" in -"lyrics") - filter="LYRICS" - directory="lyrics" - ;; -"instrumental") - filter="INSTRUMENTAL" - directory="instrumental" - ;; -*) - die "Expected 'instrumental|lyrics' but got '$1'" - ;; -esac - -process() { - mediainfo --Output=JSON "$1" | jq '.media.track | map(.Lyrics) | join("")' -} - -mkdir "../$directory" - -fd . --extension=opus | while read -r file; do - if [ "$(process "$file")" = '""' ] || [ "$(process "$file")" = '"Instrumental"' ] || [ "$(process "$file")" = '"instrumental"' ]; then - echo "INSTRUMENTAL::$file" - else - echo "LYRICS::$file" - fi -done | grep "$filter" | awk 'BEGIN {FS="::"}{print $2}' | while read -r file; do ln -s "../all/$file" "../$directory/$file"; done - -# vim: ft=sh diff --git a/pkgs/by-name/sp/spodi/package.nix b/pkgs/by-name/sp/spodi/package.nix deleted file mode 100644 index 83540a21..00000000 --- a/pkgs/by-name/sp/spodi/package.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - sysLib, - # dependencies - gawk, - expect, - spotdl, - fd, - coreutils, - # config - xdgCacheHome ? builtins.getEnv "XDG_CACHE_HOME", - xdgUserDirsMusic ? builtins.getEnv "XDG_MUSIC_HOME", -}: -sysLib.writeShellScriptMultiPart { - name = "spodi"; - src = ./.; - - generateCompletions = true; - keepPath = false; - - baseName = "spodi.sh"; - cmdPrefix = "sh"; - cmdNames = [ - "download.sh" - "update.sh" - ]; - - dependencies = [ - gawk - expect - spotdl - fd - coreutils - ]; - - replacementStrings = { - XDG_CACHE_HOME = xdgCacheHome; - XDG_MUSIC_DIR = xdgUserDirsMusic; - }; -} diff --git a/pkgs/by-name/sp/spodi/sh/download.sh b/pkgs/by-name/sp/spodi/sh/download.sh deleted file mode 100755 index fe9746c8..00000000 --- a/pkgs/by-name/sp/spodi/sh/download.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env dash - -download_to_down() { - DOWNLOAD_DIRECTORY="%XDG_MUSIC_DIR/down/spotify" - - already_downloaded_files="$(mktmp)" - fd . "$DOWNLOAD_DIRECTORY" --exclude spotdl.log --exclude spotdl-errors.log >"$already_downloaded_files" - if [ -z "$NO_CHECK" ] && [ "$(wc -l <"$already_downloaded_files")" -ne 0 ]; then - die "something is already downloaded" - fi - # [ -e "$DOWNLOAD_DIRECTORY/spotdl.log" ] && rm "$DOWNLOAD_DIRECTORY/spotdl.log" - - download "$1" "$DOWNLOAD_DIRECTORY" -} - -download() { - download_url="$1" - output_path="$2" - - config="$(mktmp)" - cat <<EOF | clean >"$config" -# Main options ---audio slider-kz bandcamp youtube-music piped youtube soundcloud ---lyrics genius musixmatch azlyrics synced - -# FFmpeg options ---ffmpeg ffmpeg ---threads 16 ---bitrate 256k - -# Spotify options ---cache-path %XDG_CACHE_HOME/spotdl/.spotipy - -# Output options ---preload ---format opus ---output {artists}_-_{title} ---print-errors ---save-errors $output_path/spotdl-errors.log -# TODO: Reactive whence spotdl support for these has improved <2023-12-19> -# --generate-lrc ---overwrite skip - -# Misc options ---log-level INFO -EOF - - cd "$output_path" || die "BUG: no $output_path" - touch "$output_path/spotdl-errors.log" - - # The sub shell needs to be unquoted, as the arguments may not be treated as one. - # shellcheck disable=2046 - unbuffer spotdl $(cat "$config") download "$download_url" | tee "$output_path/spotdl.log" - - [ -d ~/.spotdl ] && rm -r ~/.spotdl -} - -# vim: ft=sh diff --git a/pkgs/by-name/sp/spodi/sh/update.sh b/pkgs/by-name/sp/spodi/sh/update.sh deleted file mode 100755 index a289cf58..00000000 --- a/pkgs/by-name/sp/spodi/sh/update.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env dash - -update() { - UPDATE_DIRECTORY="%XDG_MUSIC_DIR/artists" - UPDATE_CONFIG_FILE="%XDG_MUSIC_DIR/artists/update.conf" - - if ! [ -f "$UPDATE_CONFIG_FILE" ]; then - error="$( - cat <<EOF -Please provide an update config file at: '$UPDATE_CONFIG_FILE'. - -The 'update.conf' file should follow this pattern: -<path_to_artist>/<artist_name>|<spotify_url> - -All comments and empty lines are ignored -EOF - )" - die "$error" - fi - - config_file="$(mktmp)" - clean "$UPDATE_CONFIG_FILE" >"$config_file" - - while IFS="|" read -r artist url; do - full_artist="$UPDATE_DIRECTORY/$artist" - [ -d "$full_artist" ] || mkdir --parents "$full_artist" - [ -d "$full_artist/update" ] || mkdir --parents "$full_artist/update" - [ -d "$full_artist/all" ] || mkdir --parents "$full_artist/all" - [ -d "$full_artist/filtered" ] || mkdir --parents "$full_artist/filtered" - - while read -r file; do - ln --symbolic --relative "$file" "$full_artist/update/$(basename "$file")" - done <"$(tmp fd --type file --extension opus . "$full_artist/all")" - - msg2 "Updating $artist with url: '$url'" - download "$url" "$full_artist/update" - - while read -r file; do - mv "$file" "$full_artist/all" - ln --symbolic --relative "$full_artist/all/$(basename "$file")" "$full_artist/filtered/$(basename "$file")" - done <"$(tmp fd --type file --extension opus . "$full_artist/update")" - - while read -r file; do - rm "$file" - done <"$(tmp fd --type symlink --extension opus . "$full_artist/update")" - - cp "$full_artist/update/spotdl.log" "$full_artist/all/spotdl.$(date +%Y_%m_%d).log" - cp "$full_artist/update/spotdl-errors.log" "$full_artist/all/spotdl-errors.$(date +%Y_%m_%d).log" - done <"$config_file" -} - -# vim: ft=sh diff --git a/pkgs/by-name/sp/spodi/spodi.sh b/pkgs/by-name/sp/spodi/spodi.sh deleted file mode 100755 index 475fd48a..00000000 --- a/pkgs/by-name/sp/spodi/spodi.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# these are used in version() -# shellcheck disable=2034 -AUTHORS="Soispha" -# shellcheck disable=2034 -YEARS="2023" - -# load dependencies -. ./sh/update.sh -. ./sh/download.sh - -help() { - cat <<EOF -This is a small wrapper around downloading things from spotify - -USAGE: - $NAME [OPTIONS] COMMAND - -OPTIONS: - --help | -h - Display this help and exit. - - --version | -v - Display version and copyright information and exit. -COMMANDS: - update - Read the artist.conf file and download all newly released things - - download URL - Download a specific url to the DOWNLOAD_DIRECTORY -EOF -} - -for arg in "$@"; do - case "$arg" in - "--help" | "-h") - help - exit 0 - ;; - "--version" | "-v") - version - exit 0 - ;; - esac -done - -case "$1" in -"update") - shift 1 - update - exit 0 - ;; -"download") - shift 1 - download_url="$1" - [ -z "$download_url" ] && die "You need to provide a download url" - download_to_down "$download_url" - exit 0 - ;; -*) - die "Command '$1' is not know" - help - exit 1 - ;; -esac - -# vim: ft=sh diff --git a/pkgs/by-name/st/stamp/package.nix b/pkgs/by-name/st/stamp/package.nix index 703f73e3..871d531c 100644 --- a/pkgs/by-name/st/stamp/package.nix +++ b/pkgs/by-name/st/stamp/package.nix @@ -1,20 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, - findutils, + writeShellApplication, + # Dependencies + coreutils, fd, - reuse, git, + reuse, }: -sysLib.writeShellScript { +writeShellApplication { name = "stamp"; - src = ./stamp.sh; - generateCompletions = false; - keepPath = false; + text = builtins.readFile ./stamp.sh; + inheritPath = false; - dependencies = [ - findutils + runtimeInputs = [ + coreutils fd - reuse git + reuse ]; } diff --git a/pkgs/by-name/st/stamp/stamp.sh b/pkgs/by-name/st/stamp/stamp.sh index 0fced956..5f17b2aa 100755 --- a/pkgs/by-name/st/stamp/stamp.sh +++ b/pkgs/by-name/st/stamp/stamp.sh @@ -1,7 +1,19 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +die() { + echo "Error: $1" + exit 1 +} help() { cat <<EOF @@ -93,7 +105,7 @@ done for file in "$@"; do if [ -d "$file" ]; then - fd . "$file" --type file --hidden | while read -r path_file; do + fd . "$file" --type file --hidden --exclude '/.git/*' | while read -r path_file; do reuse_run "$path_file" done else diff --git a/pkgs/by-name/tr/tree-sitter-yts/package.nix b/pkgs/by-name/tr/tree-sitter-yts/package.nix index 3a97530d..62ecf063 100644 --- a/pkgs/by-name/tr/tree-sitter-yts/package.nix +++ b/pkgs/by-name/tr/tree-sitter-yts/package.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. # taken from nixpgks: pkgs/development/tools/parsing/tree-sitter/grammar.nix { yt, diff --git a/pkgs/by-name/ts/tskm/.envrc b/pkgs/by-name/ts/tskm/.envrc new file mode 100644 index 00000000..a84d550d --- /dev/null +++ b/pkgs/by-name/ts/tskm/.envrc @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +export TSKM_PROJECT_FILE=/home/soispha/repos/nix/config/modules/common/projects.json + +use flake + +PATH_add ./target/debug +PATH_add ./target/release diff --git a/pkgs/by-name/ts/tskm/.gitignore b/pkgs/by-name/ts/tskm/.gitignore new file mode 100644 index 00000000..f255eebd --- /dev/null +++ b/pkgs/by-name/ts/tskm/.gitignore @@ -0,0 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +/target +.direnv diff --git a/pkgs/by-name/ge/generate_moz_extension/Cargo.lock b/pkgs/by-name/ts/tskm/Cargo.lock index 834f69a0..a7395090 100644 --- a/pkgs/by-name/ge/generate_moz_extension/Cargo.lock +++ b/pkgs/by-name/ts/tskm/Cargo.lock @@ -1,466 +1,429 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. version = 4 [[package]] -name = "addr2line" -version = "0.24.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ - "gimli", + "cfg-if", + "once_cell", + "version_check", + "zerocopy", ] [[package]] -name = "adler2" -version = "2.0.0" +name = "android-tzdata" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] -name = "anyhow" -version = "1.0.95" +name = "android_system_properties" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] [[package]] -name = "atomic-waker" -version = "1.1.2" +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] -name = "autocfg" -version = "1.4.0" +name = "anstyle-parse" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] [[package]] -name = "backtrace" -version = "0.3.74" +name = "anstyle-query" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", + "windows-sys 0.59.0", ] [[package]] -name = "base64" -version = "0.22.1" +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arraydeque" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] -name = "bytes" -version = "1.9.0" +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.2.10" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "chrono" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ - "core-foundation-sys", - "libc", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", ] [[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "displaydoc" -version = "0.2.5" +name = "clap" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ - "proc-macro2", - "quote", - "syn", + "clap_builder", + "clap_derive", ] [[package]] -name = "encoding_rs" -version = "0.8.35" +name = "clap_builder" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ - "cfg-if", + "anstream", + "anstyle", + "clap_lex", + "strsim", ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "clap_complete" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "aad5b1b4de04fead402672b48897030eec1f3bfe1550776322f59f6d6e6a5677" dependencies = [ - "libc", - "windows-sys 0.59.0", + "clap", + "clap_lex", + "is_executable", + "shlex", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "clap_derive" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "fnv" -version = "1.0.7" +name = "clap_lex" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] -name = "foreign-types" -version = "0.3.2" +name = "colorchoice" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "core-foundation-sys" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "crc32fast" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "percent-encoding", + "cfg-if", ] [[package]] -name = "futures" -version = "0.3.31" +name = "dirs" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "dirs-sys", ] [[package]] -name = "futures-channel" -version = "0.3.31" +name = "dirs-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ - "futures-core", - "futures-sink", + "libc", + "option-ext", + "redox_users", + "windows-sys 0.60.2", ] [[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "futures-core", - "futures-task", - "futures-util", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" +name = "encoding_rs" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if", ] [[package]] -name = "futures-sink" -version = "0.3.31" +name = "fallible-iterator" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] -name = "futures-task" -version = "0.3.31" +name = "fallible-streaming-iterator" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] -name = "futures-util" -version = "0.3.31" +name = "flate2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "crc32fast", + "miniz_oxide", ] [[package]] -name = "generate_extensions" -version = "0.1.0" +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "anyhow", - "futures", - "reqwest", - "serde", - "serde_json", - "tokio", + "percent-encoding", ] [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "h2" -version = "0.4.7" +name = "hashbrown" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", + "ahash", ] [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "http" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ - "bytes", - "fnv", - "itoa", + "foldhash", ] [[package]] -name = "http-body" -version = "1.0.1" +name = "hashlink" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "bytes", - "http", + "hashbrown 0.14.5", ] [[package]] -name = "http-body-util" -version = "0.1.2" +name = "hashlink" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", + "hashbrown 0.15.4", ] [[package]] -name = "httparse" -version = "1.10.0" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "hyper" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.5" +name = "hermit-abi" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" -dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", -] +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] -name = "hyper-tls" -version = "0.6.0" +name = "iana-time-zone" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", ] [[package]] -name = "hyper-util" -version = "0.1.10" +name = "iana-time-zone-haiku" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", + "cc", ] [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -470,30 +433,10 @@ dependencies = [ ] [[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -501,68 +444,55 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] [[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] name = "idna" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -575,35 +505,45 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] -name = "indexmap" -version = "2.7.1" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "equivalent", - "hashbrown", + "hermit-abi", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "ipnet" -version = "2.11.0" +name = "is_executable" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +checksum = "d4a1b5bad6f9072935961dfbf1cced2f3d129963d091b6f69f007fe04e758ae2" +dependencies = [ + "winapi", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" @@ -617,135 +557,89 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] -name = "linux-raw-sys" -version = "0.4.15" +name = "libredox" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "pkg-config", + "vcpkg", +] [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] -name = "memchr" -version = "2.7.4" +name = "md5" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] -name = "mime" -version = "0.3.17" +name = "memchr" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.13" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", + "autocfg", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "openssl" -version = "0.10.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "openssl-macros" -version = "0.1.1" +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.104" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "percent-encoding" @@ -754,216 +648,104 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" +name = "pkg-config" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] -name = "pkg-config" -version = "0.3.31" +name = "potential_utf" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] -name = "reqwest" -version = "0.12.12" +name = "r-efi" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-registry", -] +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] -name = "ring" -version = "0.17.8" +name = "redox_users" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.15", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", + "getrandom 0.2.16", + "libredox", + "thiserror", ] [[package]] -name = "rustc-demangle" -version = "0.1.24" +name = "rusqlite" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" dependencies = [ "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustls" -version = "0.23.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" -dependencies = [ - "once_cell", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" - -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink 0.9.1", + "libsqlite3-sys", + "smallvec", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" - -[[package]] -name = "schannel" -version = "0.1.27" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] -name = "security-framework-sys" -version = "2.14.0" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "core-foundation-sys", - "libc", + "winapi-util", ] [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -972,9 +754,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -983,91 +765,76 @@ dependencies = [ ] [[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "slab" -version = "0.4.9" +name = "smallvec" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] -name = "smallvec" -version = "1.13.2" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "socket2" -version = "0.5.8" +name = "stderrlog" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "61c910772f992ab17d32d6760e167d2353f4130ed50e796752689556af07dc6b" dependencies = [ - "libc", - "windows-sys 0.52.0", + "is-terminal", + "log", + "termcolor", + "thread_local", ] [[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "subtle" -version = "2.6.1" +name = "strum" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" [[package]] -name = "syn" -version = "2.0.96" +name = "strum_macros" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ + "heck", "proc-macro2", "quote", - "unicode-ident", + "rustversion", + "syn", ] [[package]] -name = "sync_wrapper" -version = "1.0.2" +name = "syn" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ - "futures-core", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1075,71 +842,48 @@ dependencies = [ ] [[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.16.0" +name = "taskchampion" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +checksum = "b010f5ebe51e88ae490691ed2a43b699e3468c8e3838e244accd8526aca7751b" dependencies = [ - "cfg-if", - "fastrand", - "getrandom 0.3.1", - "once_cell", - "rustix", - "windows-sys 0.59.0", + "anyhow", + "byteorder", + "chrono", + "flate2", + "log", + "rusqlite", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror", + "uuid", ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "termcolor" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ - "displaydoc", - "zerovec", + "winapi-util", ] [[package]] -name = "tokio" -version = "1.43.0" +name = "thiserror" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", + "thiserror-impl", ] [[package]] -name = "tokio-macros" -version = "2.5.0" +name = "thiserror-impl" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -1147,101 +891,48 @@ dependencies = [ ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "thread_local" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", + "cfg-if", ] [[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.41" +name = "tinystr" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ - "pin-project-lite", - "tracing-core", + "displaydoc", + "zerovec", ] [[package]] -name = "tracing-core" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +name = "tskm" +version = "0.1.0" dependencies = [ - "once_cell", + "anyhow", + "clap", + "clap_complete", + "dirs", + "log", + "md5", + "serde", + "serde_json", + "stderrlog", + "taskchampion", + "url", + "walkdir", + "yaml-rust2", ] [[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "url" @@ -1252,46 +943,66 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "want" -version = "0.3.1" +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ - "try-lock", + "same-file", + "winapi-util", ] [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -1323,19 +1034,6 @@ dependencies = [ ] [[package]] -name = "wasm-bindgen-futures" -version = "0.4.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" -dependencies = [ - "cfg-if", - "js-sys", - "once_cell", - "wasm-bindgen", - "web-sys", -] - -[[package]] name = "wasm-bindgen-macro" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1368,61 +1066,111 @@ dependencies = [ ] [[package]] -name = "web-sys" -version = "0.3.77" +name = "winapi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "js-sys", - "wasm-bindgen", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] -name = "windows-registry" -version = "0.2.0" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", "windows-result", "windows-strings", - "windows-targets", ] [[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-targets", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-result", - "windows-targets", + "windows-link", ] [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets", + "windows-targets 0.53.2", ] [[package]] @@ -1431,14 +1179,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -1448,73 +1212,126 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags", ] [[package]] -name = "write16" -version = "1.0.0" +name = "writeable" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] -name = "writeable" -version = "0.5.5" +name = "yaml-rust2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "4ce2a4ff45552406d02501cea6c18d8a7e50228e7736a872951fe2fe75c91be7" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink 0.10.0", +] [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -1524,9 +1341,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -1535,19 +1352,39 @@ dependencies = [ ] [[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -1556,16 +1393,21 @@ dependencies = [ ] [[package]] -name = "zeroize" -version = "1.8.1" +name = "zerotrie" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -1574,9 +1416,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/pkgs/by-name/ts/tskm/Cargo.toml b/pkgs/by-name/ts/tskm/Cargo.toml new file mode 100644 index 00000000..2655254b --- /dev/null +++ b/pkgs/by-name/ts/tskm/Cargo.toml @@ -0,0 +1,91 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +[package] +name = "tskm" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = { version = "1.0.98", default-features = false } +clap = { version = "4.5.40", features = [ "derive", "std", "color", "help", "usage", "error-context", "suggestions", ], default-features = false } +clap_complete = { version = "4.5.54", features = ["unstable-dynamic"] } +dirs = { version = "6.0.0", default-features = false } +log = { version = "0.4.27", default-features = false } +serde = { version = "1.0.219", features = ["derive"], default-features = false } +serde_json = { version = "1.0.140", default-features = false } +stderrlog = { version = "0.6.0", default-features = false } +taskchampion = { version = "2.0.3", default-features = false } +url = { version = "2.5.4", features = ["serde"], default-features = false } +walkdir = { version = "2.5.0", default-features = false } +md5 = { version = "0.7.0", default-features = false } +yaml-rust2 = "0.10.3" + +[profile.release] +lto = true +codegen-units = 1 +panic = "abort" +split-debuginfo = "off" + +[lints.rust] +# rustc lint groups https://doc.rust-lang.org/rustc/lints/groups.html +warnings = "warn" +future_incompatible = { level = "warn", priority = -1 } +let_underscore = { level = "warn", priority = -1 } +nonstandard_style = { level = "warn", priority = -1 } +rust_2018_compatibility = { level = "warn", priority = -1 } +rust_2018_idioms = { level = "warn", priority = -1 } +rust_2021_compatibility = { level = "warn", priority = -1 } +unused = { level = "warn", priority = -1 } +# rustc allowed-by-default lints https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html +# missing_docs = "warn" +macro_use_extern_crate = "warn" +meta_variable_misuse = "warn" +missing_abi = "warn" +missing_copy_implementations = "warn" +missing_debug_implementations = "warn" +non_ascii_idents = "warn" +noop_method_call = "warn" +single_use_lifetimes = "warn" +trivial_casts = "warn" +trivial_numeric_casts = "warn" +unreachable_pub = "warn" +unsafe_op_in_unsafe_fn = "warn" +unused_crate_dependencies = "warn" +unused_import_braces = "warn" +unused_lifetimes = "warn" +unused_qualifications = "warn" +variant_size_differences = "warn" + +[lints.rustdoc] +# rustdoc lints https://doc.rust-lang.org/rustdoc/lints.html +broken_intra_doc_links = "warn" +private_intra_doc_links = "warn" +missing_crate_level_docs = "warn" +private_doc_tests = "warn" +invalid_codeblock_attributes = "warn" +invalid_rust_codeblocks = "warn" +bare_urls = "warn" + +[lints.clippy] +# clippy allowed by default +dbg_macro = "warn" +# clippy categories https://doc.rust-lang.org/clippy/ +all = { level = "warn", priority = -1 } +correctness = { level = "warn", priority = -1 } +suspicious = { level = "warn", priority = -1 } +style = { level = "warn", priority = -1 } +complexity = { level = "warn", priority = -1 } +perf = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } +missing_panics_doc = "allow" +missing_errors_doc = "allow" diff --git a/pkgs/by-name/ts/tskm/flake.lock b/pkgs/by-name/ts/tskm/flake.lock new file mode 100644 index 00000000..95f58ef9 --- /dev/null +++ b/pkgs/by-name/ts/tskm/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1750994206, + "narHash": "sha256-3u6rEbIX9CN/5A5/mc3u0wIO1geZ0EhjvPBXmRDHqWM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "80d50fc87924c2a0d346372d242c27973cf8cdbf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/by-name/ts/tskm/flake.lock.license b/pkgs/by-name/ts/tskm/flake.lock.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/pkgs/by-name/ts/tskm/flake.lock.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/pkgs/by-name/ts/tskm/flake.nix b/pkgs/by-name/ts/tskm/flake.nix new file mode 100644 index 00000000..583d4923 --- /dev/null +++ b/pkgs/by-name/ts/tskm/flake.nix @@ -0,0 +1,38 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + description = "This is the core interface to the system-integrated task management"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = {nixpkgs, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages."${system}"; + in { + devShells."${system}".default = pkgs.mkShell { + buildInputs = [ + pkgs.sqlite + ]; + + packages = with pkgs; [ + cargo + clippy + rustc + rustfmt + + cargo-edit + ]; + }; + }; +} +# vim: ts=2 + diff --git a/pkgs/by-name/ts/tskm/package.nix b/pkgs/by-name/ts/tskm/package.nix new file mode 100644 index 00000000..ad10865f --- /dev/null +++ b/pkgs/by-name/ts/tskm/package.nix @@ -0,0 +1,56 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + rustPlatform, + installShellFiles, + makeWrapper, + lib, + # Dependencies + taskwarrior3, + git, + rofi, + sqlite, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "tskm"; + version = "0.1.0"; + + src = ./.; + cargoLock = { + lockFile = ./Cargo.lock; + }; + + buildInputs = [ + taskwarrior3 + git + rofi + sqlite + ]; + + nativeBuildInputs = [ + installShellFiles + makeWrapper + ]; + + postInstall = '' + installShellCompletion --cmd tskm \ + --bash <(COMPLETE=bash $out/bin/tskm) \ + --fish <(COMPLETE=fish $out/bin/tskm) \ + --zsh <(COMPLETE=zsh $out/bin/tskm) + + # NOTE: We cannot clear the path, because we need access to the $EDITOR. <2025-04-04> + wrapProgram $out/bin/tskm \ + --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs} + ''; + + meta = { + mainProgram = "tskm"; + }; +}) diff --git a/pkgs/by-name/ts/tskm/src/browser/mod.rs b/pkgs/by-name/ts/tskm/src/browser/mod.rs new file mode 100644 index 00000000..29abfcbd --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/browser/mod.rs @@ -0,0 +1,172 @@ +use std::{ + env, + io::Write, + os::unix::net::UnixStream, + path::PathBuf, + process::{self, ExitStatus}, +}; + +use anyhow::{Context, Result}; +use log::{error, info}; +use serde_json::json; +use url::Url; + +use crate::{state::State, task}; + +#[allow(clippy::too_many_lines)] +pub fn open_in_browser( + selected_project: &task::Project, + state: &mut State, + urls: Option<Vec<Url>>, +) -> Result<()> { + let old_project: Option<task::Project> = + task::Project::get_current().context("Failed to get currently active project")?; + let old_task: Option<task::Task> = + task::Task::get_current(state).context("Failed to get currently active task")?; + + selected_project.activate().with_context(|| { + format!( + "Failed to active project: '{}'", + selected_project.to_project_display() + ) + })?; + + let tracking_task = { + let all_tasks = selected_project.get_tasks(state).with_context(|| { + format!( + "Failed to get assoctiated tasks for project: '{}'", + selected_project.to_project_display() + ) + })?; + + let tracking_task = all_tasks.into_iter().find(|t| { + let maybe_desc = t.description(state); + if let Ok(desc) = maybe_desc { + desc == "tracking" + } else { + error!( + "Getting task description returned error: {}", + maybe_desc.expect_err("We already check for Ok") + ); + false + } + }); + + if let Some(task) = tracking_task { + info!( + "Starting task {} -> tracking", + selected_project.to_project_display() + ); + task.start(state) + .with_context(|| format!("Failed to start task {task}"))?; + } + tracking_task + }; + + let status = { + // #!/bin/sh + // # initial idea: Florian Bruhin (The-Compiler) + // # author: Thore Bödecker (foxxx0) + // + // _url="$1" + // _qb_version='1.0.4' + // _proto_version=1 + // _ipc_socket="${XDG_RUNTIME_DIR}/qutebrowser/ipc-$(printf '%s' "$USER" | md5sum | cut -d' ' -f1)" + // _qute_bin="/usr/bin/qutebrowser" + // + // printf '{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n' \ + // "${_url}" \ + // "${_qb_version}" \ + // "${_proto_version}" \ + // "${PWD}" | socat -lf /dev/null - UNIX-CONNECT:"${_ipc_socket}" || "$_qute_bin" "$@" & + + let ipc_socket_path = PathBuf::from( + env::var("XDG_RUNTIME_DIR").context("Failed to access XDG_RUNTIME_DIR var")?, + ) + .join("qutebrowser") + .join(selected_project.to_project_display()) + .join(format!("ipc-{:x}", { + let user_name = env::var("USER").context("Failed to get USER var")?; + let base_dir = env::var("XDG_DATA_HOME").context("Failed to get XDG_DATA_HOME")?; + + md5::compute( + format!( + "{user_name}-{}", + PathBuf::from(base_dir) + .join("qutebrowser") + .join(selected_project.to_project_display()) + .display() + ) + .as_bytes(), + ) + })); + + if ipc_socket_path.exists() { + let mut stream = UnixStream::connect(ipc_socket_path)?; + + let real_url = if let Some(urls) = urls { + urls.into_iter().map(|url| url.to_string()).collect() + } else { + // Always add a new tab, so that qutebrowser is marked as “urgent”. + vec!["qute://start".to_owned()] + }; + + stream.write_all( + json! { + { + "args": real_url, + "target_arg": null, + "version": "1.0.4", + "protocol_version": 1, + "cwd": "/" + } + } + .to_string() + .as_bytes(), + )?; + stream.write_all(b"\n")?; + + ExitStatus::default() + } else { + let args = if let Some(urls) = urls { + urls.iter().map(|url| url.to_string()).collect() + } else { + vec![] + }; + + process::Command::new(format!( + "qutebrowser-{}", + selected_project.to_project_display() + )) + .args(args) + .status() + .context("Failed to start qutebrowser")? + } + }; + + if !status.success() { + error!("Qutebrowser run exited with error."); + } + + if let Some(task) = tracking_task { + task.stop(state) + .with_context(|| format!("Failed to stop task {task}"))?; + } + if let Some(task) = old_task { + task.start(state) + .with_context(|| format!("Failed to start task {task}"))?; + } + + if let Some(project) = old_project { + project.activate().with_context(|| { + format!( + "Failed to activate project {}", + project.to_project_display() + ) + })?; + } else { + task::Project::clear().context("Failed to clear currently focused project")?; + } + + Ok(()) +} diff --git a/pkgs/by-name/ts/tskm/src/cli.rs b/pkgs/by-name/ts/tskm/src/cli.rs new file mode 100644 index 00000000..23d9545f --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/cli.rs @@ -0,0 +1,332 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{ffi::OsStr, path::PathBuf}; + +use anyhow::{bail, Result}; +use clap::{builder::StyledStr, ArgAction, Parser, Subcommand, ValueEnum}; +use clap_complete::{ArgValueCompleter, CompletionCandidate}; +use url::Url; + +use crate::{ + interface::{ + input::{Input, Tag}, + project::ProjectName, + }, + state, task, +}; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about, verbatim_doc_comment)] +/// This is the core interface to the system-integrated task management +/// +/// `tskm` effectively combines multiple applications together: +/// - `taskwarrior` projects are connected to `qutebrowser` profiles, making it possible to “open” +/// a project. +/// +/// - Every `taskwarrior` project has a determined `neorg` path, so that extra information for a +/// `project` can be stored in this `norg` file. +/// +/// - `tskm` can track inputs for you. These are URLs with optional tags which you can that +/// “review” to open tasks based on them. +pub struct CliArgs { + #[command(subcommand)] + pub command: Command, + + /// Increase message verbosity + #[arg(long="verbose", short = 'v', action = ArgAction::Count, default_value_t = 2)] + pub verbosity: u8, + + /// Silence all output + #[arg(long, short = 'q')] + pub quiet: bool, +} + +#[derive(Subcommand, Debug)] +pub enum Command { + /// Interact with projects. + Projects { + #[command(subcommand)] + command: ProjectCommand, + }, + + /// Manage the input queue. + Inputs { + #[command(subcommand)] + command: InputCommand, + }, + + /// Access the associated `neorg` workspace for the project/task. + Neorg { + #[command(subcommand)] + command: NeorgCommand, + }, + + /// Interface with the Qutebrowser profile of each project. + Open { + #[command(subcommand)] + command: OpenCommand, + }, +} + +#[derive(Subcommand, Debug)] +pub enum ProjectCommand { + /// Lists all available projects. + List, + + /// Allows you to quickly add projects. + Add { + /// The name of the new project. + #[arg(value_parser = ProjectName::try_from_project)] + new_project_name: ProjectName, + }, +} + +#[derive(Subcommand, Debug, Clone, Copy)] +pub enum NeorgCommand { + /// Open the `neorg` project associated with id of the task. + Task { + /// The working set id of the task + #[arg(value_name = "ID", value_parser = task_from_working_set_id, add = ArgValueCompleter::new(complete_task_id))] + task: task::Task, + }, +} + +fn task_from_working_set_id(id: &str) -> Result<task::Task> { + let id: usize = id.parse()?; + let mut state = state::State::new_ro()?; + + let Some(task) = task::Task::from_working_set(id, &mut state)? else { + bail!("Working set id '{id}' is not valid!") + }; + Ok(task) +} + +#[derive(Subcommand, Debug)] +pub enum OpenCommand { + /// Open each project's Qutebrowser profile consecutively, that was opened since the last review. + /// + /// This allows you to remove stale opened tabs and to commit open tabs to the `inputs`. + Review { + /// Review all projects, if they contain tabs + #[arg(short, long, default_value_t)] + non_empty: bool, + }, + + /// Opens Qutebrowser with either the supplied project or the currently active project profile. + Project { + /// The project to open. + #[arg(value_parser = task::Project::from_project_string, add = ArgValueCompleter::new(complete_project))] + project: task::Project, + + /// The URLs to open. + urls: Option<Vec<Url>>, + }, + + /// Open a selected project in it's Qutebrowser profile. + /// + /// This will use rofi's dmenu mode to select one project from the list of all registered + /// projects. + Select { + /// The URLs to open. + urls: Option<Vec<Url>>, + }, + + /// List all open tabs in the project. + ListTabs { + /// The projects to open. + #[arg(value_parser = task::Project::from_project_string, add = ArgValueCompleter::new(complete_project))] + projects: Option<Vec<task::Project>>, + + /// Only show the tabs, that are in this mode + #[arg(short, long, conflicts_with = "projects")] + mode: Option<ListMode>, + }, +} + +#[derive(Clone, Copy, ValueEnum, Debug)] +pub enum ListMode { + // The tab contains no tabs. + Empty, + + // The tab contains tabs. + NonEmpty, +} + +#[derive(Subcommand, Debug)] +pub enum InputCommand { + /// Add URLs as inputs to be categorized. + Add { inputs: Vec<Input> }, + /// Remove URLs + Remove { + #[arg(add = ArgValueCompleter::new(complete_input_url))] + inputs: Vec<Input>, + }, + + /// Add all URLs in the file as inputs to be categorized. + /// + /// This expects each line to contain one URL. + File { + /// The file to read from. + file: PathBuf, + + /// Additional tags to apply to every read URL in the file. + #[arg(add = ArgValueCompleter::new(complete_tag))] + tags: Vec<Tag>, + }, + + /// Like 'review', but for the inputs that have previously been added. + /// It takes a project in which to open the URLs. + Review { + /// Opens all the URLs in this project. + #[arg(value_parser = task::Project::from_project_string, add = ArgValueCompleter::new(complete_project))] + project: task::Project, + }, + + /// List all the previously added inputs. + List { + /// Only list the inputs that have all the specified tags + #[arg(add = ArgValueCompleter::new(complete_tag))] + tags: Vec<Tag>, + }, + + /// Show all the available tags. + Tags {}, +} + +fn complete_task_id(current: &OsStr) -> Vec<CompletionCandidate> { + fn format_task( + task: task::Task, + current: &str, + state: &mut state::State, + ) -> Option<CompletionCandidate> { + let id = { + let Ok(base) = task.working_set_id(state) else { + return None; + }; + base.to_string() + }; + + if !id.starts_with(current) { + return None; + } + + let description = { + let Ok(base) = task.description(state) else { + return None; + }; + StyledStr::from(base) + }; + + Some(CompletionCandidate::new(id).help(Some(description))) + } + + let mut output = vec![]; + + let Some(current) = current.to_str() else { + return output; + }; + + let Ok(mut state) = state::State::new_ro() else { + return output; + }; + + let Ok(pending) = state.replica().pending_tasks() else { + return output; + }; + + let Ok(current_project) = task::Project::get_current() else { + return output; + }; + + if let Some(current_project) = current_project { + for t in pending { + let task = task::Task::from(&t); + if let Ok(project) = task.project(&mut state) { + if project == current_project { + if let Some(out) = format_task(task, current, &mut state) { + output.push(out); + } + } + } + } + } else { + for t in pending { + let task = task::Task::from(&t); + if let Some(out) = format_task(task, current, &mut state) { + output.push(out); + } + } + } + + output +} +fn complete_project(current: &OsStr) -> Vec<CompletionCandidate> { + let mut output = vec![]; + + let Some(current) = current.to_str() else { + return output; + }; + + let Ok(all) = task::Project::all() else { + return output; + }; + + for a in all { + if a.to_project_display().starts_with(current) { + output.push(CompletionCandidate::new(a.to_project_display())); + } + } + + output +} +fn complete_input_url(current: &OsStr) -> Vec<CompletionCandidate> { + let mut output = vec![]; + + let Some(current) = current.to_str() else { + return output; + }; + + let Ok(all) = Input::all() else { + return output; + }; + + for a in all { + if a.to_string().starts_with(current) { + output.push(CompletionCandidate::new(a.to_string())); + } + } + + output +} +fn complete_tag(current: &OsStr) -> Vec<CompletionCandidate> { + let mut output = vec![]; + + let Some(current) = current.to_str() else { + return output; + }; + + if !current.starts_with('+') { + output.push(CompletionCandidate::new(format!("+{current}"))); + } + + output +} + +#[cfg(test)] +mod test { + use clap::CommandFactory; + + use super::CliArgs; + #[test] + fn verify_cli() { + CliArgs::command().debug_assert(); + } +} diff --git a/pkgs/by-name/ts/tskm/src/interface/input/handle.rs b/pkgs/by-name/ts/tskm/src/interface/input/handle.rs new file mode 100644 index 00000000..76eea6dc --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/input/handle.rs @@ -0,0 +1,148 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{ + collections::{HashMap, HashSet}, + fs, + str::FromStr, +}; + +use anyhow::{Context, Result}; +use log::info; + +use crate::{browser::open_in_browser, cli::InputCommand, state::State}; + +use super::{Input, Tag}; + +/// # Errors +/// When command handling fails. +/// +/// # Panics +/// When internal assertions fail. +#[allow(clippy::too_many_lines)] +pub fn handle(command: InputCommand, state: &mut State) -> Result<()> { + match command { + InputCommand::Add { inputs } => { + for input in inputs { + input.commit().with_context(|| { + format!("Failed to add input ('{input}') to the input storage.") + })?; + } + } + InputCommand::Remove { inputs } => { + for input in inputs { + input.remove().with_context(|| { + format!("Failed to remove input ('{input}') from the input storage.") + })?; + } + } + InputCommand::File { file, tags } => { + let file = fs::read_to_string(&file) + .with_context(|| format!("Failed to read input file '{}'", file.display()))?; + + let mut tag_set = HashSet::with_capacity(tags.len()); + for tag in tags { + tag_set.insert(tag); + } + + for line in file.lines().map(str::trim) { + if line.is_empty() { + continue; + } + + let mut input = Input::from_str(line)?; + input.tags = input.tags.union(&tag_set).cloned().collect(); + + input.commit().with_context(|| { + format!("Failed to add input ('{input}') to the input storage.") + })?; + } + } + InputCommand::Review { project } => { + 'outer: for all in Input::all()?.chunks(100) { + info!("Starting review for the first hundred URLs."); + + open_in_browser( + &project, + state, + Some(all.iter().map(|f| f.url.clone()).collect()), + )?; + + { + use std::io::{stdin, stdout, Write}; + + let mut s = String::new(); + eprint!("Continue? (y/N) "); + stdout().flush()?; + + stdin() + .read_line(&mut s) + .expect("Did not enter a correct string"); + + if let Some('\n') = s.chars().next_back() { + s.pop(); + } + if let Some('\r') = s.chars().next_back() { + s.pop(); + } + + if s != "y" { + break 'outer; + } + } + } + } + InputCommand::List { tags } => { + let mut tag_set = HashSet::with_capacity(tags.len()); + for tag in tags { + tag_set.insert(tag); + } + + for url in Input::all()? + .iter() + .filter(|input| tag_set.is_subset(&input.tags)) + { + println!("{url}"); + } + } + InputCommand::Tags {} => { + let mut without_tags = 0; + let mut tag_set: HashMap<Tag, u64> = HashMap::new(); + + for input in Input::all()? { + if input.tags.is_empty() { + without_tags += 1; + } + + for tag in input.tags { + if let Some(number) = tag_set.get_mut(&tag) { + *number += 1; + } else { + tag_set.insert(tag, 1); + } + } + } + + let mut tags: Vec<(Tag, u64)> = tag_set.into_iter().collect(); + tags.sort_by_key(|(_, number)| *number); + tags.reverse(); + + for (tag, number) in tags { + println!("{tag} {number}"); + } + + if without_tags != 0 { + println!(); + println!("Witohut tags: {without_tags}"); + } + } + } + Ok(()) +} diff --git a/pkgs/by-name/ts/tskm/src/interface/input/mod.rs b/pkgs/by-name/ts/tskm/src/interface/input/mod.rs new file mode 100644 index 00000000..1d1d67f4 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/input/mod.rs @@ -0,0 +1,260 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{ + collections::{HashMap, HashSet}, + fmt::Display, + fs, + io::Write, + path::PathBuf, + process::Command, + str::FromStr, +}; + +use anyhow::{bail, Context, Result}; +use url::Url; +use walkdir::WalkDir; + +pub mod handle; +pub use handle::handle; + +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct Tag(String); + +impl Tag { + pub fn new(input: &str) -> Result<Self> { + Self::from_str(input) + } +} + +impl FromStr for Tag { + type Err = anyhow::Error; + + fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { + if let Some(tag) = s.strip_prefix('+') { + if tag.contains(' ') { + bail!("Your tag '{s}' should not whitespace.") + } + + Ok(Self(tag.to_owned())) + } else { + bail!("Your tag '{s}' does not start with the required '+'"); + } + } +} + +impl Display for Tag { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "+{}", self.0) + } +} + +impl Tag { + #[must_use] + pub fn as_str(&self) -> &str { + &self.0 + } +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Input { + url: Url, + tags: HashSet<Tag>, +} + +impl FromStr for Input { + type Err = anyhow::Error; + + fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { + if s.contains(' ') { + let (url, tags) = s.split_once(' ').expect("Should work"); + Ok(Self { + url: Url::from_str(url)?, + tags: { + tags.trim() + .split(' ') + .map(Tag::new) + .collect::<Result<_, _>>()? + }, + }) + } else { + Ok(Self { + url: Url::from_str(s)?, + tags: HashSet::new(), + }) + } + } +} + +impl Display for Input { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if self.tags.is_empty() { + self.url.fmt(f) + } else { + write!( + f, + "{} {}", + self.url, + self.tags + .iter() + .map(ToString::to_string) + .collect::<Vec<_>>() + .join(" ") + ) + } + } +} + +impl Input { + fn base_path() -> PathBuf { + dirs::data_local_dir() + .expect("This should be set") + .join("tskm/inputs") + } + + fn url_path(url: &Url) -> Result<PathBuf> { + let base_path = Self::base_path(); + + let url_path = base_path + .join(url.scheme()) + .join(url.host_str().unwrap_or("<No Host>")) + .join(url.path().trim_matches('/')); + fs::create_dir_all(&url_path) + .with_context(|| format!("Failed to open file: '{}'", url_path.display()))?; + + Ok(url_path.join("url_value")) + } + + #[must_use] + pub fn url(&self) -> &Url { + &self.url + } + + /// Commit this constructed [`Input`] to storage. + /// + /// # Errors + /// If IO operations fail. + pub fn commit(&self) -> Result<()> { + let url_path = Self::url_path(&self.url)?; + + let mut file = fs::OpenOptions::new() + .create(true) + .append(true) + .open(&url_path) + .with_context(|| format!("Failed to open file: '{}'", url_path.display()))?; + writeln!(file, "{self}")?; + + Self::git_commit(&format!("Add new url: '{self}'"))?; + + Ok(()) + } + + /// Remove this constructed [`Input`] to storage. + /// + /// Beware that this does not take tags into account. + /// + /// # Errors + /// If IO operations fail. + pub fn remove(&self) -> Result<()> { + let url_path = Self::url_path(&self.url)?; + + fs::remove_file(&url_path) + .with_context(|| format!("Failed to remove file: '{}'", url_path.display()))?; + + let mut url_path = url_path.as_path(); + while let Some(parent) = url_path.parent() { + if fs::read_dir(parent)?.count() == 0 { + fs::remove_dir(parent)?; + } + url_path = parent; + } + + Self::git_commit(&format!("Remove url: '{self}'"))?; + Ok(()) + } + + /// Get all previously [committed][`Self::commit`] inputs. + /// + /// # Errors + /// When IO handling fails. + /// + /// # Panics + /// If internal assertions fail. + pub fn all() -> Result<Vec<Self>> { + let mut output = vec![]; + for entry in WalkDir::new(Self::base_path()) + .min_depth(1) + .into_iter() + .filter_entry(|e| { + let s = e.file_name().to_str(); + s != Some(".git") + }) + { + let entry = entry?; + + if !entry.file_type().is_file() { + continue; + } + + let url_value_file = entry.path(); + assert!(url_value_file.ends_with("url_value")); + + let url_values = fs::read_to_string(PathBuf::from(url_value_file))?; + + let mut inputs: HashMap<Url, Self> = HashMap::new(); + for input in url_values + .lines() + .map(Self::from_str) + .collect::<Result<Vec<Self>, _>>()? + { + if let Some(found) = inputs.get_mut(&input.url) { + found.tags = found.tags.union(&input.tags).cloned().collect(); + } else { + assert_eq!(inputs.insert(input.url.clone(), input), None); + } + } + + output.extend(inputs.drain().map(|(_, value)| value)); + } + + Ok(output) + } + + /// Commit your changes + fn git_commit(message: &str) -> Result<()> { + if !Self::base_path().join(".git").exists() { + let status = Command::new("git") + .args(["init"]) + .current_dir(Self::base_path()) + .status()?; + if !status.success() { + bail!("Git init failed!"); + } + } + + let status = Command::new("git") + .args(["add", "."]) + .current_dir(Self::base_path()) + .status()?; + if !status.success() { + bail!("Git add . failed!"); + } + + let status = Command::new("git") + .args(["commit", "--message", message, "--no-gpg-sign"]) + .current_dir(Self::base_path()) + .status()?; + if !status.success() { + bail!("Git commit failed!"); + } + + Ok(()) + } +} diff --git a/pkgs/by-name/ts/tskm/src/interface/mod.rs b/pkgs/by-name/ts/tskm/src/interface/mod.rs new file mode 100644 index 00000000..513ca317 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/mod.rs @@ -0,0 +1,14 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +pub mod input; +pub mod neorg; +pub mod open; +pub mod project; diff --git a/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs b/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs new file mode 100644 index 00000000..ea3a89ae --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs @@ -0,0 +1,100 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{ + env, + fs::{self, read_to_string, File, OpenOptions}, + io::Write, + process::Command, +}; + +use anyhow::{bail, Context, Result}; + +use crate::{cli::NeorgCommand, state::State}; + +pub fn handle(command: NeorgCommand, state: &mut State) -> Result<()> { + match command { + NeorgCommand::Task { task } => { + let project = task.project(state)?; + let base = dirs::data_local_dir() + .expect("This should exists") + .join("tskm/notes"); + let path = base.join(project.get_neorg_path()?); + + fs::create_dir_all(path.parent().expect("This should exist"))?; + + { + let contents = if path.exists() { + read_to_string(&path) + .with_context(|| format!("Failed to read file: '{}'", path.display()))? + } else { + File::create(&path) + .with_context(|| format!("Failed to create file: '{}'", path.display()))?; + String::new() + }; + + if !contents.contains(format!("% {}", task.uuid()).as_str()) { + let mut options = OpenOptions::new(); + options.append(true).create(false); + + let mut file = options.open(&path)?; + file.write_all( + format!("* {} (% {})", task.description(state)?, task.uuid()).as_bytes(), + ) + .with_context(|| { + format!("Failed to write task uuid to file: '{}'", path.display()) + })?; + file.flush() + .with_context(|| format!("Failed to flush file: '{}'", path.display()))?; + } + } + + let editor = env::var("EDITOR").unwrap_or("nvim".to_owned()); + let status = Command::new(editor) + .args([ + path.to_str().expect("Should be a utf-8 str"), + "-c", + format!("/% {}", task.uuid()).as_str(), + ]) + .status()?; + if !status.success() { + bail!("$EDITOR fail with error code: {status}"); + } + + { + let status = Command::new("git") + .args(["add", "."]) + .current_dir(path.parent().expect("Will exist")) + .status()?; + if !status.success() { + bail!("Git add . failed!"); + } + + let status = Command::new("git") + .args([ + "commit", + "--message", + format!("chore({}): Update", project.get_neorg_path()?.display()).as_str(), + "--no-gpg-sign", + ]) + .current_dir(path.parent().expect("Will exist")) + .status()?; + if !status.success() { + bail!("Git commit failed!"); + } + } + + { + task.mark_neorg_data(state)?; + } + } + } + Ok(()) +} diff --git a/pkgs/by-name/ts/tskm/src/interface/neorg/mod.rs b/pkgs/by-name/ts/tskm/src/interface/neorg/mod.rs new file mode 100644 index 00000000..6bed1e39 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/neorg/mod.rs @@ -0,0 +1,35 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::path::PathBuf; + +use anyhow::Result; + +use crate::task::{Project, run_task}; + +pub mod handle; +pub use handle::handle; + +impl Project { + /// Return the stored neorg path of this project. + /// The returned path will never start with a slash (/). + pub(super) fn get_neorg_path(&self) -> Result<PathBuf> { + let project_path = run_task(&[ + "_get", + format!("rc.context.{}.rc.neorg_path", self.to_context_display()).as_str(), + ])?; + + let final_path = project_path + .strip_prefix('/') + .unwrap_or(project_path.as_str()); + + Ok(PathBuf::from(final_path)) + } +} diff --git a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs new file mode 100644 index 00000000..0cf60b41 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs @@ -0,0 +1,190 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::str::FromStr; + +use anyhow::{bail, Context, Result}; +use log::{error, info}; +use url::Url; + +use crate::{browser::open_in_browser, cli::OpenCommand, rofi, state::State, task}; + +fn is_empty(project: &task::Project) -> Result<bool> { + let tabs = get_tabs(project)?; + + if tabs.is_empty() { + Ok(true) + } else if tabs.len() > 1 { + Ok(false) + } else { + let url = &tabs[0].1; + + Ok(url == &Url::from_str("qute://start/").expect("Hardcoded")) + } +} + +#[allow(clippy::too_many_lines)] +pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { + match command { + OpenCommand::Review { non_empty } => { + for project in task::Project::all().context("Failed to get all project files")? { + let is_empty = is_empty(project)?; + + if project.is_touched() || (non_empty && !is_empty) { + info!( + "Reviewing project: '{}' ({})", + project.to_project_display(), + if is_empty { "is empty" } else { "is not empty" } + ); + open_in_browser(project, state, None).with_context(|| { + format!( + "Failed to open project ('{}') in qutebrowser", + project.to_project_display() + ) + })?; + + if project.is_touched() { + project.untouch().with_context(|| { + format!( + "Failed to untouch project ('{}')", + project.to_project_display() + ) + })?; + } + } + } + } + OpenCommand::Project { project, urls } => { + project.touch().context("Failed to touch project")?; + open_in_browser(&project, state, urls).with_context(|| { + format!("Failed to open project: {}", project.to_project_display()) + })?; + } + OpenCommand::Select { urls } => { + let selected_project: task::Project = task::Project::from_project_string( + &rofi::select( + task::Project::all() + .context("Failed to get all registered projects")? + .iter() + .map(task::Project::to_project_display) + .collect::<Vec<_>>() + .as_slice(), + ) + .context("Failed to get selected project")?, + ) + .expect("This should work, as we send only projects in"); + + selected_project + .touch() + .context("Failed to touch project")?; + + open_in_browser(&selected_project, state, urls).context("Failed to open project")?; + } + OpenCommand::ListTabs { projects, mode } => { + let projects = { + if let Some(p) = projects { + p + } else if mode.is_some() { + task::Project::all() + .context("Failed to get all projects")? + .to_owned() + } else if let Some(p) = task::Project::get_current() + .context("Failed to get currently focused project")? + { + vec![p] + } else { + bail!("You need to either select projects or pass --mode"); + } + }; + + for project in &projects { + if let Some(mode) = mode { + match mode { + crate::cli::ListMode::Empty => { + if !is_empty(project)? { + continue; + } + + // We do not need to print, tabs they are always empty. + if projects.len() > 1 { + println!("/* {} */", project.to_project_display()); + } + continue; + } + crate::cli::ListMode::NonEmpty => { + if is_empty(project)? { + continue; + } + } + } + } + + if projects.len() > 1 { + println!("/* {} */", project.to_project_display()); + } + + let tabs = match get_tabs(project) { + Ok(ok) => ok, + Err(err) => { + if projects.len() > 1 { + error!( + "While trying to get the sessionstore for {}: {:?}", + project.to_project_display(), + err + ); + continue; + } + + return Err(err).with_context(|| { + format!( + "While trying to get the sessionstore for {}", + project.to_project_display() + ) + }); + } + }; + + for (active, url) in tabs { + let is_selected = { + if active { + "🔻 " + } else { + " " + } + }; + println!("{is_selected}{url}"); + } + } + } + } + + Ok(()) +} + +fn get_tabs(project: &task::Project) -> Result<Vec<(bool, Url)>> { + let session_store = project.get_sessionstore()?; + + let tabs = session_store + .windows + .iter() + .flat_map(|window| window.tabs.iter()) + .filter_map(|tab| { + tab.history + .iter() + .find(|hist| hist.active) + .map(|hist| (tab.active, hist)) + }) + .collect::<Vec<_>>(); + + Ok(tabs + .into_iter() + .map(|(active, hist)| (active, hist.url.clone())) + .collect()) +} diff --git a/pkgs/by-name/ts/tskm/src/interface/open/mod.rs b/pkgs/by-name/ts/tskm/src/interface/open/mod.rs new file mode 100644 index 00000000..e302c7d1 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/open/mod.rs @@ -0,0 +1,170 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{fs::File, io::Read, str::FromStr}; + +use anyhow::{anyhow, Context, Result}; +use taskchampion::chrono::NaiveDateTime; +use url::Url; +use yaml_rust2::Yaml; + +use crate::task::Project; + +pub mod handle; +pub use handle::handle; + +impl Project { + pub(super) fn get_sessionstore(&self) -> Result<SessionStore> { + let path = dirs::data_local_dir() + .context("Failed to get data dir")? + .join("qutebrowser") + .join(self.to_project_display()) + .join("data/sessions/default.yml"); + + let mut file = File::open(&path) + .with_context(|| format!("Failed to open path '{}'", path.display()))?; + + let mut yaml_str = String::new(); + file.read_to_string(&mut yaml_str) + .context("Failed to read _autosave.yml path")?; + let yaml = yaml_rust2::YamlLoader::load_from_str(&yaml_str)?; + + let store = qute_store_from_yaml(&yaml).context("Failed to read yaml store")?; + + Ok(store) + } +} + +fn qute_store_from_yaml(yaml: &[Yaml]) -> Result<SessionStore> { + assert_eq!(yaml.len(), 1); + let doc = &yaml[0]; + + let hash = doc.as_hash().context("Invalid yaml")?; + let windows = hash + .get(&Yaml::String("windows".to_owned())) + .ok_or(anyhow!("Missing windows"))? + .as_vec() + .ok_or(anyhow!("Windows not vector"))?; + + Ok(SessionStore { + windows: windows + .iter() + .map(|window| { + let hash = window.as_hash().ok_or(anyhow!("Windows not hashmap"))?; + + Ok::<_, anyhow::Error>(Window { + geometry: hash + .get(&Yaml::String("geometry".to_owned())) + .ok_or(anyhow!("Missing window geometry"))? + .as_str() + .ok_or(anyhow!("geometry not string"))? + .to_owned(), + tabs: hash + .get(&Yaml::String("tabs".to_owned())) + .ok_or(anyhow!("Missing window tabs"))? + .as_vec() + .ok_or(anyhow!("Tabs not vec"))? + .iter() + .map(|tab| { + let hash = tab.as_hash().ok_or(anyhow!("Tab not hashmap"))?; + + Ok::<_, anyhow::Error>(Tab { + history: hash + .get(&Yaml::String("history".to_owned())) + .ok_or(anyhow!("Missing tab history"))? + .as_vec() + .ok_or(anyhow!("tab history not vec"))? + .iter() + .map(|history| { + let hash = history + .as_hash() + .ok_or(anyhow!("Tab history not hashmap"))?; + + Ok::<_, anyhow::Error>(TabHistory { + active: hash + .get(&Yaml::String("active".to_owned())) + .unwrap_or(&Yaml::Boolean(false)) + .as_bool() + .ok_or(anyhow!("tab history active not bool"))?, + last_visited: NaiveDateTime::from_str( + hash.get(&Yaml::String("last_visited".to_owned())) + .ok_or(anyhow!( + "Missing tab history last_visited" + ))? + .as_str() + .ok_or(anyhow!( + "tab history last_visited not string" + ))?, + ) + .context("Failed to parse last_visited")?, + pinned: hash + .get(&Yaml::String("pinned".to_owned())) + .ok_or(anyhow!("Missing tab history pinned"))? + .as_bool() + .ok_or(anyhow!("tab history pinned not bool"))?, + title: hash + .get(&Yaml::String("title".to_owned())) + .ok_or(anyhow!("Missing tab history title"))? + .as_str() + .ok_or(anyhow!("tab history title not string"))? + .to_owned(), + url: Url::parse( + hash.get(&Yaml::String("url".to_owned())) + .ok_or(anyhow!("Missing tab history url"))? + .as_str() + .ok_or(anyhow!("tab history url not string"))?, + ) + .context("Failed to parse url")?, + zoom: hash + .get(&Yaml::String("zoom".to_owned())) + .unwrap_or(&Yaml::Real("1.0".to_owned())) + .as_f64() + .ok_or(anyhow!("tab history zoom not 64"))?, + }) + }) + .collect::<Result<Vec<_>, _>>()?, + active: hash + .get(&Yaml::String("active".to_owned())) + .unwrap_or(&Yaml::Boolean(false)) + .as_bool() + .ok_or(anyhow!("active not bool"))?, + }) + }) + .collect::<Result<Vec<_>, _>>()?, + }) + }) + .collect::<Result<Vec<_>, _>>()?, + }) +} + +#[derive(Debug)] +pub struct SessionStore { + pub windows: Vec<Window>, +} +#[derive(Debug)] +pub struct Window { + pub geometry: String, + pub tabs: Vec<Tab>, +} +#[derive(Debug)] +pub struct Tab { + pub history: Vec<TabHistory>, + pub active: bool, +} +#[derive(Debug)] +pub struct TabHistory { + pub active: bool, + pub last_visited: NaiveDateTime, + pub pinned: bool, + // pub scroll-pos: + pub title: String, + pub url: Url, + pub zoom: f64, +} diff --git a/pkgs/by-name/ts/tskm/src/interface/project/handle.rs b/pkgs/by-name/ts/tskm/src/interface/project/handle.rs new file mode 100644 index 00000000..6d44b340 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/project/handle.rs @@ -0,0 +1,99 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{env, fs::File, io::Write}; + +use anyhow::{Context, Result, anyhow}; +use log::trace; + +use crate::{cli::ProjectCommand, task}; + +use super::{ProjectDefinition, ProjectList, SortAlphabetically}; + +/// # Panics +/// If internal expectations fail. +/// +/// # Errors +/// If IO operations fail. +pub fn handle(command: ProjectCommand) -> Result<()> { + match command { + ProjectCommand::List => { + for project in task::Project::all()? { + println!("{}", project.to_project_display()); + } + } + ProjectCommand::Add { + mut new_project_name, + } => { + let project_file = env::var("TSKM_PROJECT_FILE") + .map_err(|err| anyhow!("The `TSKM_PROJECT_FILE` env var is unset: {err}"))?; + + let mut projects_content: ProjectList = + serde_json::from_reader(File::open(&project_file).with_context(|| { + format!("Failed to open project file ('{project_file:?}') for reading") + })?)?; + + let first = new_project_name.project_segments.remove(0); + if let Some(mut definition) = projects_content.0.get_mut(&first) { + for segment in new_project_name.project_segments { + if definition.subprojects.contains_key(&segment) { + definition = definition + .subprojects + .get_mut(&segment) + .expect("We checked"); + } else { + let new_definition = ProjectDefinition::default(); + let output = definition + .subprojects + .insert(segment.clone(), new_definition); + + assert_eq!(output, None); + + definition = definition + .subprojects + .get_mut(&segment) + .expect("Was just inserted"); + } + } + } else { + let mut orig_definition = ProjectDefinition::default(); + let mut definition = &mut orig_definition; + for segment in new_project_name.project_segments { + trace!("Adding segment: {segment}"); + + let new_definition = ProjectDefinition::default(); + + assert!( + definition + .subprojects + .insert(segment.clone(), new_definition) + .is_none() + ); + + definition = definition + .subprojects + .get_mut(&segment) + .expect("Was just inserted"); + } + assert!(projects_content.0.insert(first, orig_definition).is_none()); + }; + + let mut file = File::create(&project_file).with_context(|| { + format!("Failed to open project file ('{project_file:?}') for writing") + })?; + serde_json::to_writer_pretty( + &file, + &SortAlphabetically::<ProjectList>(projects_content), + )?; + writeln!(file)?; + } + } + Ok(()) +} diff --git a/pkgs/by-name/ts/tskm/src/interface/project/mod.rs b/pkgs/by-name/ts/tskm/src/interface/project/mod.rs new file mode 100644 index 00000000..8a7fa1b0 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/interface/project/mod.rs @@ -0,0 +1,83 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::collections::HashMap; + +use anyhow::Result; +use serde::{Deserialize, Serialize}; + +pub mod handle; +pub use handle::handle; + +#[derive(Deserialize, Serialize)] +struct ProjectList(HashMap<String, ProjectDefinition>); + +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)] +struct ProjectDefinition { + #[serde(default)] + #[serde(skip_serializing_if = "is_default")] + name: String, + + #[serde(default)] + #[serde(skip_serializing_if = "is_default")] + prefix: String, + + #[serde(default)] + #[serde(skip_serializing_if = "is_default")] + subprojects: HashMap<String, ProjectDefinition>, +} + +fn is_default<T: Default + PartialEq>(input: &T) -> bool { + input == &T::default() +} + +#[derive(Debug, Clone)] +pub struct ProjectName { + project_segments: Vec<String>, +} + +impl ProjectName { + #[must_use] + pub fn segments(&self) -> &[String] { + &self.project_segments + } + + /// # Errors + /// Never. + pub fn try_from_project(s: &str) -> Result<Self> { + Ok(Self::from_project(s)) + } + pub fn from_project(s: &str) -> Self { + let me = Self { + project_segments: s.split('.').map(ToOwned::to_owned).collect(), + }; + me + } + pub fn from_context(s: &str) -> Self { + let me = Self { + project_segments: s.split('_').map(ToOwned::to_owned).collect(), + }; + me + } +} + +// Source: https://stackoverflow.com/a/67792465 +fn sort_alphabetically<T: Serialize, S: serde::Serializer>( + value: &T, + serializer: S, +) -> Result<S::Ok, S::Error> { + let value = serde_json::to_value(value).map_err(serde::ser::Error::custom)?; + value.serialize(serializer) +} + +#[derive(Serialize)] +pub(super) struct SortAlphabetically<T: Serialize>( + #[serde(serialize_with = "sort_alphabetically")] T, +); diff --git a/pkgs/by-name/ts/tskm/src/main.rs b/pkgs/by-name/ts/tskm/src/main.rs new file mode 100644 index 00000000..e6113111 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/main.rs @@ -0,0 +1,51 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use anyhow::Result; +use clap::{CommandFactory, Parser}; + +use crate::{ + cli::{CliArgs, Command}, + interface::{input, neorg, open, project}, + state::State, +}; + +pub mod browser; +pub mod cli; +pub mod interface; +pub mod rofi; +pub mod state; +pub mod task; + +fn main() -> Result<(), anyhow::Error> { + clap_complete::CompleteEnv::with_factory(CliArgs::command).complete(); + + let args = CliArgs::parse(); + + stderrlog::new() + .module(module_path!()) + .quiet(args.quiet) + .show_module_names(true) + .color(stderrlog::ColorChoice::Auto) + .verbosity(usize::from(args.verbosity)) + .init() + .expect("Let's just hope that this does not panic"); + + let mut state = State::new_rw()?; + + match args.command { + Command::Inputs { command } => input::handle(command, &mut state)?, + Command::Neorg { command } => neorg::handle(command, &mut state)?, + Command::Open { command } => open::handle(command, &mut state)?, + Command::Projects { command } => project::handle(command)?, + } + + Ok(()) +} diff --git a/pkgs/by-name/ts/tskm/src/rofi/mod.rs b/pkgs/by-name/ts/tskm/src/rofi/mod.rs new file mode 100644 index 00000000..37c2eafa --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/rofi/mod.rs @@ -0,0 +1,47 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{ + io::Write, + process::{Command, Stdio}, +}; + +use anyhow::{Context, Result}; + +pub fn select(options: &[String]) -> Result<String> { + let mut child = Command::new("rofi") + .args(["-sep", "\n", "-dmenu"]) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .context("Failed to spawn rofi")?; + + let mut stdin = child + .stdin + .take() + .expect("We piped this, so should be available"); + + stdin + .write_all(options.join("\n").as_bytes()) + .context("Failed to write to rofi's stdin")?; + + let output = child + .wait_with_output() + .context("Failed to wait for rofi's output")?; + + let selected = String::from_utf8(output.stdout.clone()).with_context(|| { + format!( + "Failed to decode '{}' as utf8", + String::from_utf8_lossy(&output.stdout) + ) + })?; + + Ok(selected.trim_end().to_owned()) +} diff --git a/pkgs/by-name/ts/tskm/src/state.rs b/pkgs/by-name/ts/tskm/src/state.rs new file mode 100644 index 00000000..ae71764e --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/state.rs @@ -0,0 +1,55 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::path::PathBuf; + +use anyhow::Result; +use taskchampion::{Replica, StorageConfig, storage::AccessMode}; + +pub struct State { + replica: Replica, +} + +impl std::fmt::Debug for State { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "State") + } +} + +impl State { + fn taskdb_dir() -> PathBuf { + dirs::data_local_dir().expect("Should exist").join("task") + } + + fn new(taskdb_dir: PathBuf, access_mode: AccessMode) -> Result<Self> { + let storage = StorageConfig::OnDisk { + taskdb_dir, + create_if_missing: false, + access_mode, + } + .into_storage()?; + + let replica = Replica::new(storage); + + Ok(Self { replica }) + } + + pub fn new_ro() -> Result<Self> { + Self::new(Self::taskdb_dir(), AccessMode::ReadOnly) + } + pub fn new_rw() -> Result<Self> { + Self::new(Self::taskdb_dir(), AccessMode::ReadWrite) + } + + #[must_use] + pub fn replica(&mut self) -> &mut Replica { + &mut self.replica + } +} diff --git a/pkgs/by-name/ts/tskm/src/task/mod.rs b/pkgs/by-name/ts/tskm/src/task/mod.rs new file mode 100644 index 00000000..9c671273 --- /dev/null +++ b/pkgs/by-name/ts/tskm/src/task/mod.rs @@ -0,0 +1,367 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of my nixos-config. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use std::{ + fmt::Display, + fs::{self, read_to_string, File}, + path::PathBuf, + process::Command, + str::FromStr, + sync::OnceLock, +}; + +use anyhow::{bail, Context, Result}; +use log::{debug, info, trace}; +use taskchampion::Tag; + +use crate::{interface::project::ProjectName, state::State}; + +/// The `taskwarrior` id of a task. +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] +pub struct Task { + uuid: taskchampion::Uuid, +} + +impl From<&taskchampion::Task> for Task { + fn from(value: &taskchampion::Task) -> Self { + Self { + uuid: value.get_uuid(), + } + } +} +impl From<&taskchampion::TaskData> for Task { + fn from(value: &taskchampion::TaskData) -> Self { + Self { + uuid: value.get_uuid(), + } + } +} + +impl Task { + pub fn from_working_set(id: usize, state: &mut State) -> Result<Option<Self>> { + Ok(state + .replica() + .working_set()? + .by_index(id) + .map(|uuid| Self { uuid })) + } + + pub fn get_current(state: &mut State) -> Result<Option<Self>> { + let tasks = state + .replica() + .pending_tasks()? + .into_iter() + .filter(taskchampion::Task::is_active) + .collect::<Vec<_>>(); + + assert!( + tasks.len() <= 1, + "We have ensured that only one task may be active, via a hook" + ); + if let Some(active) = tasks.first() { + Ok(Some(Self::from(active))) + } else { + Ok(None) + } + } + + #[must_use] + pub fn uuid(&self) -> &taskchampion::Uuid { + &self.uuid + } + pub fn working_set_id(&self, state: &mut State) -> Result<usize> { + Ok(state + .replica() + .working_set()? + .by_uuid(self.uuid) + .expect("The task should be in the working set")) + } + + fn as_task(&self, state: &mut State) -> Result<taskchampion::Task> { + Ok(state + .replica() + .get_task(self.uuid)? + .expect("We have the task from this replica, it should still be in it")) + } + + /// Adds a tag to the task, to show the user that it has additional neorg data. + pub fn mark_neorg_data(&self, state: &mut State) -> Result<()> { + let mut ops = vec![]; + self.as_task(state)? + .add_tag(&Tag::from_str("neorg_data").expect("Is valid"), &mut ops)?; + state.replica().commit_operations(ops)?; + Ok(()) + } + + /// Try to start this task. + /// It will stop previously active tasks. + pub fn start(&self, state: &mut State) -> Result<()> { + info!("Activating {self}"); + + if let Some(active) = Self::get_current(state)? { + active.stop(state)?; + } + + let mut ops = vec![]; + self.as_task(state)?.start(&mut ops)?; + state.replica().commit_operations(ops)?; + Ok(()) + } + + /// Stops this task. + pub fn stop(&self, state: &mut State) -> Result<()> { + info!("Stopping {self}"); + + let mut ops = vec![]; + self.as_task(state)?.stop(&mut ops)?; + state.replica().commit_operations(ops)?; + Ok(()) + } + + pub fn description(&self, state: &mut State) -> Result<String> { + Ok(self.as_task(state)?.get_description().to_owned()) + } + + pub fn project(&self, state: &mut State) -> Result<Project> { + let output = { + let task = self.as_task(state)?; + let task_data = task.into_task_data(); + task_data + .get("project") + .expect("Every task should have a project") + .to_owned() + }; + let project = Project::from_project_string(output.as_str().trim()) + .expect("This comes from tw, it should be valid"); + Ok(project) + } +} + +impl Display for Task { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.uuid.fmt(f) + } +} + +impl FromStr for Task { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + let uuid = taskchampion::Uuid::from_str(s)?; + Ok(Self { uuid }) + } +} + +/// A registered task Project +#[derive(Debug, Clone, PartialEq)] +pub struct Project { + /// The project name. + /// For example: + /// ```no_run + /// &["trinitrix", "testing", "infra"] + /// ``` + name: Vec<String>, +} + +static ALL_CACHE: OnceLock<Vec<Project>> = OnceLock::new(); +impl Project { + #[must_use] + pub fn to_project_display(&self) -> String { + self.name.join(".") + } + #[must_use] + pub fn to_context_display(&self) -> String { + self.name.join("_") + } + + /// # Errors + /// - When the string does not encode a previously registered project. + /// - When the string does not adhere to the project syntax. + pub fn from_project_string(s: &str) -> Result<Self> { + Self::from_input(s, ProjectName::from_project) + } + + /// # Errors + /// - When the string does not encode a previously registered project. + /// - When the string does not adhere to the context syntax. + pub fn from_context_string(s: &str) -> Result<Self> { + Self::from_input(s, ProjectName::from_context) + } + + fn from_input<F>(s: &str, f: F) -> Result<Self> + where + F: Fn(&str) -> ProjectName, + { + if s.is_empty() { + bail!("Your project is empty") + } + + let all = Self::all()?; + let me = Self::from_project_name_unchecked(&f(s)); + if all.contains(&me) { + Ok(me) + } else { + bail!( + "Your project '{}' is not registered!", + me.to_project_display() + ); + } + } + fn from_project_name_unchecked(pn: &ProjectName) -> Self { + Self { + name: pn.segments().to_owned(), + } + } + + /// Return all known valid projects. + /// + /// # Errors + /// When file operations fail. + /// + /// # Panics + /// Only when internal assertions fail. + pub fn all<'a>() -> Result<&'a [Project]> { + // Inlined from `OnceLock::get_or_try_init` + { + let this = &ALL_CACHE; + let f = || { + let file = dirs::config_local_dir() + .expect("Should be some") + .join("tskm/projects.list"); + let contents = read_to_string(&file) + .with_context(|| format!("Failed to read file: '{}'", file.display()))?; + + Ok::<_, anyhow::Error>( + contents + .lines() + .map(|s| Self::from_project_name_unchecked(&ProjectName::from_project(s))) + .collect::<Vec<_>>(), + ) + }; + + // Fast path check + // NOTE: We need to perform an acquire on the state in this method + // in order to correctly synchronize `LazyLock::force`. This is + // currently done by calling `self.get()`, which in turn calls + // `self.is_initialized()`, which in turn performs the acquire. + if let Some(value) = this.get() { + return Ok(value); + } + + this.set(f()?).expect( + "This should always be able to take our value, as we initialize only once.", + ); + + Ok(this.get().expect("This was initialized")) + } + } + + fn touch_dir(&self) -> PathBuf { + let lock_dir = dirs::data_dir() + .expect("Should be found") + .join("tskm/review"); + lock_dir.join(format!("{}.opened", self.to_project_display())) + } + + /// Mark this project as having been interacted with. + /// + /// # Errors + /// When IO operations fail. + pub fn touch(&self) -> Result<()> { + let lock_file = self.touch_dir(); + + File::create(&lock_file) + .with_context(|| format!("Failed to create lock_file at: {}", lock_file.display()))?; + + Ok(()) + } + /// Returns [`true`] if it was previously [`Self::touch`]ed. + #[must_use] + pub fn is_touched(&self) -> bool { + let lock_file = self.touch_dir(); + lock_file.exists() + } + /// Mark this project as having not been interacted with. + /// + /// # Errors + /// When IO operations fail. + pub fn untouch(&self) -> Result<()> { + let lock_file = self.touch_dir(); + + fs::remove_file(&lock_file) + .with_context(|| format!("Failed to create lock_file at: {}", lock_file.display()))?; + + Ok(()) + } + + /// # Errors + /// When `task` execution fails. + pub fn get_tasks(&self, state: &mut State) -> Result<Vec<Task>> { + Ok(state + .replica() + .pending_task_data()? + .into_iter() + .filter(|t| t.get("project").expect("Is set") == self.to_project_display()) + .map(|t| Task::from(&t)) + .collect()) + } + + /// # Errors + /// When `task` execution fails. + pub fn activate(&self) -> Result<()> { + debug!("Setting project {}", self.to_context_display()); + + run_task(&["context", self.to_context_display().as_str()]).map(|_| ()) + } + /// # Errors + /// When `task` execution fails. + pub fn clear() -> Result<()> { + debug!("Clearing active project"); + + run_task(&["context", "none"]).map(|_| ()) + } + + /// # Errors + /// When `task` execution fails. + pub fn get_current() -> Result<Option<Self>> { + let self_str = run_task(&["_get", "rc.context"])?; + + if self_str.is_empty() { + Ok(None) + } else { + Self::from_context_string(&self_str).map(Some) + } + } +} + +pub(crate) fn run_task(args: &[&str]) -> Result<String> { + debug!("Running task command: `task {}`", args.join(" ")); + + let output = Command::new("task") + .args(args) + .output() + .with_context(|| format!("Failed to run `task {}`", args.join(" ")))?; + + let stdout = String::from_utf8(output.stdout).context("Failed to read task output as utf8")?; + let stderr = String::from_utf8(output.stderr).context("Failed to read task output as utf8")?; + + trace!("Output (stdout): '{}'", stdout.trim()); + trace!("Output (stderr): '{}'", stderr.trim()); + + if !output.status.success() { + bail!( + "Command `task {}` failed with status: {}", + args.join(" "), + output.status + ); + } + + Ok(stdout.trim().to_owned()) +} diff --git a/pkgs/by-name/ts/tskm/update.sh b/pkgs/by-name/ts/tskm/update.sh new file mode 100755 index 00000000..8e36e13e --- /dev/null +++ b/pkgs/by-name/ts/tskm/update.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +[ "$1" = "upgrade" ] && cargo upgrade +cargo update diff --git a/pkgs/by-name/up/update-sys/package.nix b/pkgs/by-name/up/update-sys/package.nix deleted file mode 100644 index 8777f82d..00000000 --- a/pkgs/by-name/up/update-sys/package.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - sysLib, - git, - nixos-rebuild, - sudo, - openssh, - coreutils, - mktemp, - gnugrep, - gnused, - systemd, -}: -sysLib.writeShellScript { - name = "update-sys"; - src = ./update-sys.sh; - generateCompletions = true; - keepPath = false; - dependencies = [ - git - nixos-rebuild - sudo - openssh - coreutils - mktemp - gnugrep - gnused - systemd - ]; -} diff --git a/pkgs/by-name/up/update-sys/update-sys.sh b/pkgs/by-name/up/update-sys/update-sys.sh deleted file mode 100755 index d28247f6..00000000 --- a/pkgs/by-name/up/update-sys/update-sys.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -help() { - cat <<EOF -This is a NixOS System flake update manager. - -USAGE: - $NAME [--branch <branchname>] [--help] - -OPTIONS: - --branch | -b BRANCHNAME - select a branch to update from. - - --mode | -m MODE - select a mode to update with - - --help | -h - output this help. -ARGUMENTS: - BRANCHNAME := [[ git branch --list --format '%(refname:short)' ]] - The name of the branch to deploy the config from - - MODE := switch|boot|test|build|dry-build|dry-activate|edit|repl|build-vm|build-vm-with-bootloader - See the 'nixos-rebuild' manpage for more information about these modes. -EOF - exit "$1" -} -default_branch=$(mktmp) -BRANCH="" - -while [ "$#" -gt 0 ]; do - case "$1" in - "--help" | "-h") - help 0 - ;; - "--branch" | "-b") - if [ -n "$2" ]; then - BRANCH="$2" - else - error "$1 requires an argument" - help 1 - fi - shift 2 - ;; - "--mode" | "-m") - if [ -n "$2" ]; then - MODE="$2" - else - error "$1 requires an argument" - help 1 - fi - shift 2 - ;; - *) - error "the option $1 does not exist!" - help 1 - ;; - esac -done - -cd /etc/nixos || die "No /etc/nixos" -msg "Starting system update..." -git remote update origin --prune >/dev/null 2>&1 -if ! [ "$BRANCH" = "" ]; then - git switch "$BRANCH" >/dev/null 2>&1 && msg2 "Switched to branch '$BRANCH'" -fi -msg2 "Updating git repository..." -git pull --rebase - -git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' >"$default_branch" & - -msg2 "Updating system..." -if [ -n "$MODE" ]; then - nixos-rebuild "$MODE" -else - nixos-rebuild switch -fi - -git switch "$(cat "$default_branch")" >/dev/null 2>&1 && msg2 "Switched to branch '$(cat "$default_branch")'" -msg "Finished Update!" - -# vim: ft=sh diff --git a/pkgs/by-name/up/update-vim-plugins/.envrc b/pkgs/by-name/up/update-vim-plugins/.envrc deleted file mode 100644 index 2f9f1a81..00000000 --- a/pkgs/by-name/up/update-vim-plugins/.envrc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -use flake diff --git a/pkgs/by-name/up/update-vim-plugins/check-duplicates.sh b/pkgs/by-name/up/update-vim-plugins/check-duplicates.sh deleted file mode 100755 index 781b8aeb..00000000 --- a/pkgs/by-name/up/update-vim-plugins/check-duplicates.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -plugins="$(grep -E "^ [a-zA-Z-]+ =" ./pkgs/vim-plugins.nix | sed -E 's/^ ([a-zA-Z-]+) =.*$/\1/' | sort)" -count=$(echo "$plugins" | uniq -d | wc -l) - -echo "duplicates count: $count" - -if [ "$count" -gt 0 ]; then - filtered_plugins=$(echo "$plugins" | uniq -d) - - if [ "$1" == "check-only" ]; then - echo "$filtered_plugins" - exit 1 - else - known_issues=$(gh issue list --state "open" --label "bot" --json "body" | jq -r ".[].body") - - echo "known_issues: $known_issues" - - # iterate over plugins we found missing and - # compare them to all open issues. - # We no matching issue was found, we create a new one - for f in $filtered_plugins; do # do not add " " here. It would break the plugin - found=false - - for k in $known_issues; do - if [[ $f == "$k" ]]; then - found=true - break - fi - done - - # test if matching issue was found - if ! $found; then - echo "Did not find an issue for $f. Creating a new one ..." - gh issue create --title "Detected broken plugin: $f" --label "bot" --body "$f" - else - echo "Issue for $f already exists" - fi - done - fi -else - echo "No duplicates found" -fi diff --git a/pkgs/by-name/up/update-vim-plugins/flake.lock b/pkgs/by-name/up/update-vim-plugins/flake.lock deleted file mode 100644 index 33ed6941..00000000 --- a/pkgs/by-name/up/update-vim-plugins/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/by-name/up/update-vim-plugins/flake.nix b/pkgs/by-name/up/update-vim-plugins/flake.nix deleted file mode 100644 index ef440af0..00000000 --- a/pkgs/by-name/up/update-vim-plugins/flake.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - description = "update_vim_plugins"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: (flake-utils.lib.eachDefaultSystem (system: let - pkgs = nixpkgs.legacyPackages.${system}; - in { - devShells.default = pkgs.mkShell { - packages = [ - pkgs.python3 - pkgs.poetry - ]; - }; - })); -} diff --git a/pkgs/by-name/up/update-vim-plugins/package.nix b/pkgs/by-name/up/update-vim-plugins/package.nix deleted file mode 100644 index e74a29b1..00000000 --- a/pkgs/by-name/up/update-vim-plugins/package.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - python3, - # dependencies - nix, - alejandra, - nix-prefetch-git, -}: -python3.pkgs.buildPythonApplication { - pname = "update-vim-plugins"; - version = "0.1.0"; - format = "pyproject"; - - src = ./.; - - # NOTE: The test are not really meant to work <2023-12-09> - doCheck = false; - - nativeBuildInputs = [ - python3.pkgs.poetry-core - ]; - buildInputs = [ - alejandra - nix-prefetch-git - nix - ]; - propagatedBuildInputs = with python3.pkgs; [ - requests - cleo - jsonpickle - dateparser - ]; - nativeCheckInputs = with python3.pkgs; [ - pytestCheckHook - - pytest-cov - pytest-mock - ]; - pytestFlagsArray = [ - "--cov" - "update_vim_plugins" - "--cov-report" - "term-missing:skip-covered" - "--cov-fail-under" - "50" - "update_vim_plugins/tests" - ]; -} diff --git a/pkgs/by-name/up/update-vim-plugins/poetry.lock b/pkgs/by-name/up/update-vim-plugins/poetry.lock deleted file mode 100644 index c2c9ff5f..00000000 --- a/pkgs/by-name/up/update-vim-plugins/poetry.lock +++ /dev/null @@ -1,770 +0,0 @@ -# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand. - -[[package]] -name = "certifi" -version = "2024.12.14" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56"}, - {file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"}, -] - -[[package]] -name = "charset-normalizer" -version = "3.4.1" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"}, - {file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"}, - {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, -] - -[[package]] -name = "cleo" -version = "2.1.0" -description = "Cleo allows you to create beautiful and testable command-line interfaces." -optional = false -python-versions = ">=3.7,<4.0" -groups = ["main"] -files = [ - {file = "cleo-2.1.0-py3-none-any.whl", hash = "sha256:4a31bd4dd45695a64ee3c4758f583f134267c2bc518d8ae9a29cf237d009b07e"}, - {file = "cleo-2.1.0.tar.gz", hash = "sha256:0b2c880b5d13660a7ea651001fb4acb527696c01f15c9ee650f377aa543fd523"}, -] - -[package.dependencies] -crashtest = ">=0.4.1,<0.5.0" -rapidfuzz = ">=3.0.0,<4.0.0" - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["test"] -markers = "sys_platform == \"win32\"" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "coverage" -version = "7.6.10" -description = "Code coverage measurement for Python" -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "coverage-7.6.10-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5c912978f7fbf47ef99cec50c4401340436d200d41d714c7a4766f377c5b7b78"}, - {file = "coverage-7.6.10-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a01ec4af7dfeb96ff0078ad9a48810bb0cc8abcb0115180c6013a6b26237626c"}, - {file = "coverage-7.6.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3b204c11e2b2d883946fe1d97f89403aa1811df28ce0447439178cc7463448a"}, - {file = "coverage-7.6.10-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:32ee6d8491fcfc82652a37109f69dee9a830e9379166cb73c16d8dc5c2915165"}, - {file = "coverage-7.6.10-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675cefc4c06e3b4c876b85bfb7c59c5e2218167bbd4da5075cbe3b5790a28988"}, - {file = "coverage-7.6.10-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f4f620668dbc6f5e909a0946a877310fb3d57aea8198bde792aae369ee1c23b5"}, - {file = "coverage-7.6.10-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:4eea95ef275de7abaef630c9b2c002ffbc01918b726a39f5a4353916ec72d2f3"}, - {file = "coverage-7.6.10-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e2f0280519e42b0a17550072861e0bc8a80a0870de260f9796157d3fca2733c5"}, - {file = "coverage-7.6.10-cp310-cp310-win32.whl", hash = "sha256:bc67deb76bc3717f22e765ab3e07ee9c7a5e26b9019ca19a3b063d9f4b874244"}, - {file = "coverage-7.6.10-cp310-cp310-win_amd64.whl", hash = "sha256:0f460286cb94036455e703c66988851d970fdfd8acc2a1122ab7f4f904e4029e"}, - {file = "coverage-7.6.10-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ea3c8f04b3e4af80e17bab607c386a830ffc2fb88a5484e1df756478cf70d1d3"}, - {file = "coverage-7.6.10-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:507a20fc863cae1d5720797761b42d2d87a04b3e5aeb682ef3b7332e90598f43"}, - {file = "coverage-7.6.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d37a84878285b903c0fe21ac8794c6dab58150e9359f1aaebbeddd6412d53132"}, - {file = "coverage-7.6.10-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a534738b47b0de1995f85f582d983d94031dffb48ab86c95bdf88dc62212142f"}, - {file = "coverage-7.6.10-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d7a2bf79378d8fb8afaa994f91bfd8215134f8631d27eba3e0e2c13546ce994"}, - {file = "coverage-7.6.10-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6713ba4b4ebc330f3def51df1d5d38fad60b66720948112f114968feb52d3f99"}, - {file = "coverage-7.6.10-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ab32947f481f7e8c763fa2c92fd9f44eeb143e7610c4ca9ecd6a36adab4081bd"}, - {file = "coverage-7.6.10-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7bbd8c8f1b115b892e34ba66a097b915d3871db7ce0e6b9901f462ff3a975377"}, - {file = "coverage-7.6.10-cp311-cp311-win32.whl", hash = "sha256:299e91b274c5c9cdb64cbdf1b3e4a8fe538a7a86acdd08fae52301b28ba297f8"}, - {file = "coverage-7.6.10-cp311-cp311-win_amd64.whl", hash = "sha256:489a01f94aa581dbd961f306e37d75d4ba16104bbfa2b0edb21d29b73be83609"}, - {file = "coverage-7.6.10-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:27c6e64726b307782fa5cbe531e7647aee385a29b2107cd87ba7c0105a5d3853"}, - {file = "coverage-7.6.10-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c56e097019e72c373bae32d946ecf9858fda841e48d82df7e81c63ac25554078"}, - {file = "coverage-7.6.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7827a5bc7bdb197b9e066cdf650b2887597ad124dd99777332776f7b7c7d0d0"}, - {file = "coverage-7.6.10-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:204a8238afe787323a8b47d8be4df89772d5c1e4651b9ffa808552bdf20e1d50"}, - {file = "coverage-7.6.10-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e67926f51821b8e9deb6426ff3164870976fe414d033ad90ea75e7ed0c2e5022"}, - {file = "coverage-7.6.10-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e78b270eadb5702938c3dbe9367f878249b5ef9a2fcc5360ac7bff694310d17b"}, - {file = "coverage-7.6.10-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:714f942b9c15c3a7a5fe6876ce30af831c2ad4ce902410b7466b662358c852c0"}, - {file = "coverage-7.6.10-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:abb02e2f5a3187b2ac4cd46b8ced85a0858230b577ccb2c62c81482ca7d18852"}, - {file = "coverage-7.6.10-cp312-cp312-win32.whl", hash = "sha256:55b201b97286cf61f5e76063f9e2a1d8d2972fc2fcfd2c1272530172fd28c359"}, - {file = "coverage-7.6.10-cp312-cp312-win_amd64.whl", hash = "sha256:e4ae5ac5e0d1e4edfc9b4b57b4cbecd5bc266a6915c500f358817a8496739247"}, - {file = "coverage-7.6.10-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:05fca8ba6a87aabdd2d30d0b6c838b50510b56cdcfc604d40760dae7153b73d9"}, - {file = "coverage-7.6.10-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9e80eba8801c386f72e0712a0453431259c45c3249f0009aff537a517b52942b"}, - {file = "coverage-7.6.10-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a372c89c939d57abe09e08c0578c1d212e7a678135d53aa16eec4430adc5e690"}, - {file = "coverage-7.6.10-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ec22b5e7fe7a0fa8509181c4aac1db48f3dd4d3a566131b313d1efc102892c18"}, - {file = "coverage-7.6.10-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26bcf5c4df41cad1b19c84af71c22cbc9ea9a547fc973f1f2cc9a290002c8b3c"}, - {file = "coverage-7.6.10-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4e4630c26b6084c9b3cb53b15bd488f30ceb50b73c35c5ad7871b869cb7365fd"}, - {file = "coverage-7.6.10-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2396e8116db77789f819d2bc8a7e200232b7a282c66e0ae2d2cd84581a89757e"}, - {file = "coverage-7.6.10-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:79109c70cc0882e4d2d002fe69a24aa504dec0cc17169b3c7f41a1d341a73694"}, - {file = "coverage-7.6.10-cp313-cp313-win32.whl", hash = "sha256:9e1747bab246d6ff2c4f28b4d186b205adced9f7bd9dc362051cc37c4a0c7bd6"}, - {file = "coverage-7.6.10-cp313-cp313-win_amd64.whl", hash = "sha256:254f1a3b1eef5f7ed23ef265eaa89c65c8c5b6b257327c149db1ca9d4a35f25e"}, - {file = "coverage-7.6.10-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:2ccf240eb719789cedbb9fd1338055de2761088202a9a0b73032857e53f612fe"}, - {file = "coverage-7.6.10-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:0c807ca74d5a5e64427c8805de15b9ca140bba13572d6d74e262f46f50b13273"}, - {file = "coverage-7.6.10-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2bcfa46d7709b5a7ffe089075799b902020b62e7ee56ebaed2f4bdac04c508d8"}, - {file = "coverage-7.6.10-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4e0de1e902669dccbf80b0415fb6b43d27edca2fbd48c74da378923b05316098"}, - {file = "coverage-7.6.10-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f7b444c42bbc533aaae6b5a2166fd1a797cdb5eb58ee51a92bee1eb94a1e1cb"}, - {file = "coverage-7.6.10-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b330368cb99ef72fcd2dc3ed260adf67b31499584dc8a20225e85bfe6f6cfed0"}, - {file = "coverage-7.6.10-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:9a7cfb50515f87f7ed30bc882f68812fd98bc2852957df69f3003d22a2aa0abf"}, - {file = "coverage-7.6.10-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6f93531882a5f68c28090f901b1d135de61b56331bba82028489bc51bdd818d2"}, - {file = "coverage-7.6.10-cp313-cp313t-win32.whl", hash = "sha256:89d76815a26197c858f53c7f6a656686ec392b25991f9e409bcef020cd532312"}, - {file = "coverage-7.6.10-cp313-cp313t-win_amd64.whl", hash = "sha256:54a5f0f43950a36312155dae55c505a76cd7f2b12d26abeebbe7a0b36dbc868d"}, - {file = "coverage-7.6.10-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:656c82b8a0ead8bba147de9a89bda95064874c91a3ed43a00e687f23cc19d53a"}, - {file = "coverage-7.6.10-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ccc2b70a7ed475c68ceb548bf69cec1e27305c1c2606a5eb7c3afff56a1b3b27"}, - {file = "coverage-7.6.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5e37dc41d57ceba70956fa2fc5b63c26dba863c946ace9705f8eca99daecdc4"}, - {file = "coverage-7.6.10-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0aa9692b4fdd83a4647eeb7db46410ea1322b5ed94cd1715ef09d1d5922ba87f"}, - {file = "coverage-7.6.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa744da1820678b475e4ba3dfd994c321c5b13381d1041fe9c608620e6676e25"}, - {file = "coverage-7.6.10-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c0b1818063dc9e9d838c09e3a473c1422f517889436dd980f5d721899e66f315"}, - {file = "coverage-7.6.10-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:59af35558ba08b758aec4d56182b222976330ef8d2feacbb93964f576a7e7a90"}, - {file = "coverage-7.6.10-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7ed2f37cfce1ce101e6dffdfd1c99e729dd2ffc291d02d3e2d0af8b53d13840d"}, - {file = "coverage-7.6.10-cp39-cp39-win32.whl", hash = "sha256:4bcc276261505d82f0ad426870c3b12cb177752834a633e737ec5ee79bbdff18"}, - {file = "coverage-7.6.10-cp39-cp39-win_amd64.whl", hash = "sha256:457574f4599d2b00f7f637a0700a6422243b3565509457b2dbd3f50703e11f59"}, - {file = "coverage-7.6.10-pp39.pp310-none-any.whl", hash = "sha256:fd34e7b3405f0cc7ab03d54a334c17a9e802897580d964bd8c2001f4b9fd488f"}, - {file = "coverage-7.6.10.tar.gz", hash = "sha256:7fb105327c8f8f0682e29843e2ff96af9dcbe5bab8eeb4b398c6a33a16d80a23"}, -] - -[package.dependencies] -tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} - -[package.extras] -toml = ["tomli"] - -[[package]] -name = "crashtest" -version = "0.4.1" -description = "Manage Python errors with ease" -optional = false -python-versions = ">=3.7,<4.0" -groups = ["main"] -files = [ - {file = "crashtest-0.4.1-py3-none-any.whl", hash = "sha256:8d23eac5fa660409f57472e3851dab7ac18aba459a8d19cbbba86d3d5aecd2a5"}, - {file = "crashtest-0.4.1.tar.gz", hash = "sha256:80d7b1f316ebfbd429f648076d6275c877ba30ba48979de4191714a75266f0ce"}, -] - -[[package]] -name = "dateparser" -version = "1.2.0" -description = "Date parsing library designed to parse dates from HTML pages" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "dateparser-1.2.0-py2.py3-none-any.whl", hash = "sha256:0b21ad96534e562920a0083e97fd45fa959882d4162acc358705144520a35830"}, - {file = "dateparser-1.2.0.tar.gz", hash = "sha256:7975b43a4222283e0ae15be7b4999d08c9a70e2d378ac87385b1ccf2cffbbb30"}, -] - -[package.dependencies] -python-dateutil = "*" -pytz = "*" -regex = "<2019.02.19 || >2019.02.19,<2021.8.27 || >2021.8.27" -tzlocal = "*" - -[package.extras] -calendars = ["convertdate", "hijri-converter"] -fasttext = ["fasttext"] -langdetect = ["langdetect"] - -[[package]] -name = "exceptiongroup" -version = "1.2.2" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -groups = ["test"] -markers = "python_version < \"3.11\"" -files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, -] - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "idna" -version = "3.10" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, -] - -[package.extras] -all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] - -[[package]] -name = "iniconfig" -version = "2.0.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.7" -groups = ["test"] -files = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] - -[[package]] -name = "jsonpickle" -version = "4.0.1" -description = "jsonpickle encodes/decodes any Python object to/from JSON" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "jsonpickle-4.0.1-py3-none-any.whl", hash = "sha256:2973c0b0d988c6792ed6c446fa582c48352e79c2880fa2c013f1abde15905555"}, - {file = "jsonpickle-4.0.1.tar.gz", hash = "sha256:b5336144d902958b92cb08bc1e76bfa47199b8afd454303693894defd2fa50c5"}, -] - -[package.extras] -cov = ["pytest-cov"] -dev = ["black", "pyupgrade"] -docs = ["furo", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -packaging = ["build", "setuptools (>=61.2)", "setuptools-scm[toml] (>=6.0)", "twine"] -testing = ["PyYAML", "atheris (>=2.3.0,<2.4.0)", "bson", "ecdsa", "feedparser", "gmpy2", "numpy", "pandas", "pymongo", "pytest (>=6.0,!=8.1.*)", "pytest-benchmark", "pytest-benchmark[histogram]", "pytest-checkdocs (>=1.2.3)", "pytest-enabler (>=1.0.1)", "pytest-ruff (>=0.2.1)", "scikit-learn", "scipy", "scipy (>=1.9.3)", "simplejson", "sqlalchemy", "ujson"] - -[[package]] -name = "packaging" -version = "24.2" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, - {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, -] - -[[package]] -name = "pluggy" -version = "1.5.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pytest" -version = "7.4.4" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.7" -groups = ["test"] -files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} - -[package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-cov" -version = "4.1.0" -description = "Pytest plugin for measuring coverage." -optional = false -python-versions = ">=3.7" -groups = ["test"] -files = [ - {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, - {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, -] - -[package.dependencies] -coverage = {version = ">=5.2.1", extras = ["toml"]} -pytest = ">=4.6" - -[package.extras] -testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] - -[[package]] -name = "pytest-mock" -version = "3.14.0" -description = "Thin-wrapper around the mock package for easier use with pytest" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "pytest-mock-3.14.0.tar.gz", hash = "sha256:2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0"}, - {file = "pytest_mock-3.14.0-py3-none-any.whl", hash = "sha256:0b72c38033392a5f4621342fe11e9219ac11ec9d375f8e2a0c164539e0d70f6f"}, -] - -[package.dependencies] -pytest = ">=6.2.5" - -[package.extras] -dev = ["pre-commit", "pytest-asyncio", "tox"] - -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["main"] -files = [ - {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, - {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "pytz" -version = "2024.2" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -groups = ["main"] -files = [ - {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"}, - {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"}, -] - -[[package]] -name = "rapidfuzz" -version = "3.11.0" -description = "rapid fuzzy string matching" -optional = false -python-versions = ">=3.9" -groups = ["main"] -files = [ - {file = "rapidfuzz-3.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eb8a54543d16ab1b69e2c5ed96cabbff16db044a50eddfc028000138ca9ddf33"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:231c8b2efbd7f8d2ecd1ae900363ba168b8870644bb8f2b5aa96e4a7573bde19"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54e7f442fb9cca81e9df32333fb075ef729052bcabe05b0afc0441f462299114"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:906f1f2a1b91c06599b3dd1be207449c5d4fc7bd1e1fa2f6aef161ea6223f165"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8ed59044aea9eb6c663112170f2399b040d5d7b162828b141f2673e822093fa8"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1cb1965a28b0fa64abdee130c788a0bc0bb3cf9ef7e3a70bf055c086c14a3d7e"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b488b244931d0291412917e6e46ee9f6a14376625e150056fe7c4426ef28225"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f0ba13557fec9d5ffc0a22826754a7457cc77f1b25145be10b7bb1d143ce84c6"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3871fa7dfcef00bad3c7e8ae8d8fd58089bad6fb21f608d2bf42832267ca9663"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:b2669eafee38c5884a6e7cc9769d25c19428549dcdf57de8541cf9e82822e7db"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:ffa1bb0e26297b0f22881b219ffc82a33a3c84ce6174a9d69406239b14575bd5"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:45b15b8a118856ac9caac6877f70f38b8a0d310475d50bc814698659eabc1cdb"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-win32.whl", hash = "sha256:22033677982b9c4c49676f215b794b0404073f8974f98739cb7234e4a9ade9ad"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:be15496e7244361ff0efcd86e52559bacda9cd975eccf19426a0025f9547c792"}, - {file = "rapidfuzz-3.11.0-cp310-cp310-win_arm64.whl", hash = "sha256:714a7ba31ba46b64d30fccfe95f8013ea41a2e6237ba11a805a27cdd3bce2573"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8724a978f8af7059c5323d523870bf272a097478e1471295511cf58b2642ff83"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8b63cb1f2eb371ef20fb155e95efd96e060147bdd4ab9fc400c97325dfee9fe1"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82497f244aac10b20710448645f347d862364cc4f7d8b9ba14bd66b5ce4dec18"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:339607394941801e6e3f6c1ecd413a36e18454e7136ed1161388de674f47f9d9"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84819390a36d6166cec706b9d8f0941f115f700b7faecab5a7e22fc367408bc3"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eea8d9e20632d68f653455265b18c35f90965e26f30d4d92f831899d6682149b"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5b659e1e2ea2784a9a397075a7fc395bfa4fe66424042161c4bcaf6e4f637b38"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1315cd2a351144572e31fe3df68340d4b83ddec0af8b2e207cd32930c6acd037"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:a7743cca45b4684c54407e8638f6d07b910d8d811347b9d42ff21262c7c23245"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:5bb636b0150daa6d3331b738f7c0f8b25eadc47f04a40e5c23c4bfb4c4e20ae3"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:42f4dd264ada7a9aa0805ea0da776dc063533917773cf2df5217f14eb4429eae"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:51f24cb39e64256221e6952f22545b8ce21cacd59c0d3e367225da8fc4b868d8"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-win32.whl", hash = "sha256:aaf391fb6715866bc14681c76dc0308f46877f7c06f61d62cc993b79fc3c4a2a"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:ebadd5b8624d8ad503e505a99b8eb26fe3ea9f8e9c2234e805a27b269e585842"}, - {file = "rapidfuzz-3.11.0-cp311-cp311-win_arm64.whl", hash = "sha256:d895998fec712544c13cfe833890e0226585cf0391dd3948412441d5d68a2b8c"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f382fec4a7891d66fb7163c90754454030bb9200a13f82ee7860b6359f3f2fa8"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:dfaefe08af2a928e72344c800dcbaf6508e86a4ed481e28355e8d4b6a6a5230e"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:92ebb7c12f682b5906ed98429f48a3dd80dd0f9721de30c97a01473d1a346576"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9a1b3ebc62d4bcdfdeba110944a25ab40916d5383c5e57e7c4a8dc0b6c17211a"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9c6d7fea39cb33e71de86397d38bf7ff1a6273e40367f31d05761662ffda49e4"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:99aebef8268f2bc0b445b5640fd3312e080bd17efd3fbae4486b20ac00466308"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4469307f464ae3089acf3210b8fc279110d26d10f79e576f385a98f4429f7d97"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:eb97c53112b593f89a90b4f6218635a9d1eea1d7f9521a3b7d24864228bbc0aa"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:ef8937dae823b889c0273dfa0f0f6c46a3658ac0d851349c464d1b00e7ff4252"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:d95f9e9f3777b96241d8a00d6377cc9c716981d828b5091082d0fe3a2924b43e"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:b1d67d67f89e4e013a5295e7523bc34a7a96f2dba5dd812c7c8cb65d113cbf28"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d994cf27e2f874069884d9bddf0864f9b90ad201fcc9cb2f5b82bacc17c8d5f2"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-win32.whl", hash = "sha256:ba26d87fe7fcb56c4a53b549a9e0e9143f6b0df56d35fe6ad800c902447acd5b"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:b1f7efdd7b7adb32102c2fa481ad6f11923e2deb191f651274be559d56fc913b"}, - {file = "rapidfuzz-3.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:ed78c8e94f57b44292c1a0350f580e18d3a3c5c0800e253f1583580c1b417ad2"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e60814edd0c9b511b5f377d48b9782b88cfe8be07a98f99973669299c8bb318a"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3f28952da055dbfe75828891cd3c9abf0984edc8640573c18b48c14c68ca5e06"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e8f93bc736020351a6f8e71666e1f486bb8bd5ce8112c443a30c77bfde0eb68"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76a4a11ba8f678c9e5876a7d465ab86def047a4fcc043617578368755d63a1bc"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc0e0d41ad8a056a9886bac91ff9d9978e54a244deb61c2972cc76b66752de9c"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e8ea35f2419c7d56b3e75fbde2698766daedb374f20eea28ac9b1f668ef4f74"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd340bbd025302276b5aa221dccfe43040c7babfc32f107c36ad783f2ffd8775"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:494eef2c68305ab75139034ea25328a04a548d297712d9cf887bf27c158c388b"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5a167344c1d6db06915fb0225592afdc24d8bafaaf02de07d4788ddd37f4bc2f"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:8c7af25bda96ac799378ac8aba54a8ece732835c7b74cfc201b688a87ed11152"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d2a0f7e17f33e7890257367a1662b05fecaf56625f7dbb6446227aaa2b86448b"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4d0d26c7172bdb64f86ee0765c5b26ea1dc45c52389175888ec073b9b28f4305"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-win32.whl", hash = "sha256:6ad02bab756751c90fa27f3069d7b12146613061341459abf55f8190d899649f"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:b1472986fd9c5d318399a01a0881f4a0bf4950264131bb8e2deba9df6d8c362b"}, - {file = "rapidfuzz-3.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:c408f09649cbff8da76f8d3ad878b64ba7f7abdad1471efb293d2c075e80c822"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1bac4873f6186f5233b0084b266bfb459e997f4c21fc9f029918f44a9eccd304"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4f9f12c2d0aa52b86206d2059916153876a9b1cf9dfb3cf2f344913167f1c3d4"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8dd501de6f7a8f83557d20613b58734d1cb5f0be78d794cde64fe43cfc63f5f2"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4416ca69af933d4a8ad30910149d3db6d084781d5c5fdedb713205389f535385"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f0821b9bdf18c5b7d51722b906b233a39b17f602501a966cfbd9b285f8ab83cd"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d0edecc3f90c2653298d380f6ea73b536944b767520c2179ec5d40b9145e47aa"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4513dd01cee11e354c31b75f652d4d466c9440b6859f84e600bdebfccb17735a"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d9727b85511b912571a76ce53c7640ba2c44c364e71cef6d7359b5412739c570"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ab9eab33ee3213f7751dc07a1a61b8d9a3d748ca4458fffddd9defa6f0493c16"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6b01c1ddbb054283797967ddc5433d5c108d680e8fa2684cf368be05407b07e4"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:3857e335f97058c4b46fa39ca831290b70de554a5c5af0323d2f163b19c5f2a6"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d98a46cf07c0c875d27e8a7ed50f304d83063e49b9ab63f21c19c154b4c0d08d"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-win32.whl", hash = "sha256:c36539ed2c0173b053dafb221458812e178cfa3224ade0960599bec194637048"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:ec8d7d8567e14af34a7911c98f5ac74a3d4a743cd848643341fc92b12b3784ff"}, - {file = "rapidfuzz-3.11.0-cp39-cp39-win_arm64.whl", hash = "sha256:62171b270ecc4071be1c1f99960317db261d4c8c83c169e7f8ad119211fe7397"}, - {file = "rapidfuzz-3.11.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:f06e3c4c0a8badfc4910b9fd15beb1ad8f3b8fafa8ea82c023e5e607b66a78e4"}, - {file = "rapidfuzz-3.11.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fe7aaf5a54821d340d21412f7f6e6272a9b17a0cbafc1d68f77f2fc11009dcd5"}, - {file = "rapidfuzz-3.11.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25398d9ac7294e99876a3027ffc52c6bebeb2d702b1895af6ae9c541ee676702"}, - {file = "rapidfuzz-3.11.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9a52eea839e4bdc72c5e60a444d26004da00bb5bc6301e99b3dde18212e41465"}, - {file = "rapidfuzz-3.11.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c87319b0ab9d269ab84f6453601fd49b35d9e4a601bbaef43743f26fabf496c"}, - {file = "rapidfuzz-3.11.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:3048c6ed29d693fba7d2a7caf165f5e0bb2b9743a0989012a98a47b975355cca"}, - {file = "rapidfuzz-3.11.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:b04f29735bad9f06bb731c214f27253bd8bedb248ef9b8a1b4c5bde65b838454"}, - {file = "rapidfuzz-3.11.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7864e80a0d4e23eb6194254a81ee1216abdc53f9dc85b7f4d56668eced022eb8"}, - {file = "rapidfuzz-3.11.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3794df87313dfb56fafd679b962e0613c88a293fd9bd5dd5c2793d66bf06a101"}, - {file = "rapidfuzz-3.11.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d71da0012face6f45432a11bc59af19e62fac5a41f8ce489e80c0add8153c3d1"}, - {file = "rapidfuzz-3.11.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff38378346b7018f42cbc1f6d1d3778e36e16d8595f79a312b31e7c25c50bd08"}, - {file = "rapidfuzz-3.11.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:6668321f90aa02a5a789d4e16058f2e4f2692c5230252425c3532a8a62bc3424"}, - {file = "rapidfuzz-3.11.0.tar.gz", hash = "sha256:a53ca4d3f52f00b393fab9b5913c5bafb9afc27d030c8a1db1283da6917a860f"}, -] - -[package.extras] -all = ["numpy"] - -[[package]] -name = "regex" -version = "2024.11.6" -description = "Alternative regular expression module, to replace re." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "regex-2024.11.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ff590880083d60acc0433f9c3f713c51f7ac6ebb9adf889c79a261ecf541aa91"}, - {file = "regex-2024.11.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:658f90550f38270639e83ce492f27d2c8d2cd63805c65a13a14d36ca126753f0"}, - {file = "regex-2024.11.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:164d8b7b3b4bcb2068b97428060b2a53be050085ef94eca7f240e7947f1b080e"}, - {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3660c82f209655a06b587d55e723f0b813d3a7db2e32e5e7dc64ac2a9e86fde"}, - {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d22326fcdef5e08c154280b71163ced384b428343ae16a5ab2b3354aed12436e"}, - {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac758ef6aebfc8943560194e9fd0fa18bcb34d89fd8bd2af18183afd8da3a2"}, - {file = "regex-2024.11.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:997d6a487ff00807ba810e0f8332c18b4eb8d29463cfb7c820dc4b6e7562d0cf"}, - {file = "regex-2024.11.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:02a02d2bb04fec86ad61f3ea7f49c015a0681bf76abb9857f945d26159d2968c"}, - {file = "regex-2024.11.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f02f93b92358ee3f78660e43b4b0091229260c5d5c408d17d60bf26b6c900e86"}, - {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06eb1be98df10e81ebaded73fcd51989dcf534e3c753466e4b60c4697a003b67"}, - {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:040df6fe1a5504eb0f04f048e6d09cd7c7110fef851d7c567a6b6e09942feb7d"}, - {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabbfc59f2c6edba2a6622c647b716e34e8e3867e0ab975412c5c2f79b82da2"}, - {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8447d2d39b5abe381419319f942de20b7ecd60ce86f16a23b0698f22e1b70008"}, - {file = "regex-2024.11.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:da8f5fc57d1933de22a9e23eec290a0d8a5927a5370d24bda9a6abe50683fe62"}, - {file = "regex-2024.11.6-cp310-cp310-win32.whl", hash = "sha256:b489578720afb782f6ccf2840920f3a32e31ba28a4b162e13900c3e6bd3f930e"}, - {file = "regex-2024.11.6-cp310-cp310-win_amd64.whl", hash = "sha256:5071b2093e793357c9d8b2929dfc13ac5f0a6c650559503bb81189d0a3814519"}, - {file = "regex-2024.11.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5478c6962ad548b54a591778e93cd7c456a7a29f8eca9c49e4f9a806dcc5d638"}, - {file = "regex-2024.11.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c89a8cc122b25ce6945f0423dc1352cb9593c68abd19223eebbd4e56612c5b7"}, - {file = "regex-2024.11.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94d87b689cdd831934fa3ce16cc15cd65748e6d689f5d2b8f4f4df2065c9fa20"}, - {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1062b39a0a2b75a9c694f7a08e7183a80c63c0d62b301418ffd9c35f55aaa114"}, - {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:167ed4852351d8a750da48712c3930b031f6efdaa0f22fa1933716bfcd6bf4a3"}, - {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d548dafee61f06ebdb584080621f3e0c23fff312f0de1afc776e2a2ba99a74f"}, - {file = "regex-2024.11.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2a19f302cd1ce5dd01a9099aaa19cae6173306d1302a43b627f62e21cf18ac0"}, - {file = "regex-2024.11.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bec9931dfb61ddd8ef2ebc05646293812cb6b16b60cf7c9511a832b6f1854b55"}, - {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9714398225f299aa85267fd222f7142fcb5c769e73d7733344efc46f2ef5cf89"}, - {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:202eb32e89f60fc147a41e55cb086db2a3f8cb82f9a9a88440dcfc5d37faae8d"}, - {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:4181b814e56078e9b00427ca358ec44333765f5ca1b45597ec7446d3a1ef6e34"}, - {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:068376da5a7e4da51968ce4c122a7cd31afaaec4fccc7856c92f63876e57b51d"}, - {file = "regex-2024.11.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f2c4184420d881a3475fb2c6f4d95d53a8d50209a2500723d831036f7c45"}, - {file = "regex-2024.11.6-cp311-cp311-win32.whl", hash = "sha256:c36f9b6f5f8649bb251a5f3f66564438977b7ef8386a52460ae77e6070d309d9"}, - {file = "regex-2024.11.6-cp311-cp311-win_amd64.whl", hash = "sha256:02e28184be537f0e75c1f9b2f8847dc51e08e6e171c6bde130b2687e0c33cf60"}, - {file = "regex-2024.11.6-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:52fb28f528778f184f870b7cf8f225f5eef0a8f6e3778529bdd40c7b3920796a"}, - {file = "regex-2024.11.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fdd6028445d2460f33136c55eeb1f601ab06d74cb3347132e1c24250187500d9"}, - {file = "regex-2024.11.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:805e6b60c54bf766b251e94526ebad60b7de0c70f70a4e6210ee2891acb70bf2"}, - {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b85c2530be953a890eaffde05485238f07029600e8f098cdf1848d414a8b45e4"}, - {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb26437975da7dc36b7efad18aa9dd4ea569d2357ae6b783bf1118dabd9ea577"}, - {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abfa5080c374a76a251ba60683242bc17eeb2c9818d0d30117b4486be10c59d3"}, - {file = "regex-2024.11.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b7fa6606c2881c1db9479b0eaa11ed5dfa11c8d60a474ff0e095099f39d98e"}, - {file = "regex-2024.11.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0c32f75920cf99fe6b6c539c399a4a128452eaf1af27f39bce8909c9a3fd8cbe"}, - {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:982e6d21414e78e1f51cf595d7f321dcd14de1f2881c5dc6a6e23bbbbd68435e"}, - {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a7c2155f790e2fb448faed6dd241386719802296ec588a8b9051c1f5c481bc29"}, - {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:149f5008d286636e48cd0b1dd65018548944e495b0265b45e1bffecce1ef7f39"}, - {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e5364a4502efca094731680e80009632ad6624084aff9a23ce8c8c6820de3e51"}, - {file = "regex-2024.11.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0a86e7eeca091c09e021db8eb72d54751e527fa47b8d5787caf96d9831bd02ad"}, - {file = "regex-2024.11.6-cp312-cp312-win32.whl", hash = "sha256:32f9a4c643baad4efa81d549c2aadefaeba12249b2adc5af541759237eee1c54"}, - {file = "regex-2024.11.6-cp312-cp312-win_amd64.whl", hash = "sha256:a93c194e2df18f7d264092dc8539b8ffb86b45b899ab976aa15d48214138e81b"}, - {file = "regex-2024.11.6-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a6ba92c0bcdf96cbf43a12c717eae4bc98325ca3730f6b130ffa2e3c3c723d84"}, - {file = "regex-2024.11.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:525eab0b789891ac3be914d36893bdf972d483fe66551f79d3e27146191a37d4"}, - {file = "regex-2024.11.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:086a27a0b4ca227941700e0b31425e7a28ef1ae8e5e05a33826e17e47fbfdba0"}, - {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bde01f35767c4a7899b7eb6e823b125a64de314a8ee9791367c9a34d56af18d0"}, - {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b583904576650166b3d920d2bcce13971f6f9e9a396c673187f49811b2769dc7"}, - {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c4de13f06a0d54fa0d5ab1b7138bfa0d883220965a29616e3ea61b35d5f5fc7"}, - {file = "regex-2024.11.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cde6e9f2580eb1665965ce9bf17ff4952f34f5b126beb509fee8f4e994f143c"}, - {file = "regex-2024.11.6-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d7f453dca13f40a02b79636a339c5b62b670141e63efd511d3f8f73fba162b3"}, - {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:59dfe1ed21aea057a65c6b586afd2a945de04fc7db3de0a6e3ed5397ad491b07"}, - {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b97c1e0bd37c5cd7902e65f410779d39eeda155800b65fc4d04cc432efa9bc6e"}, - {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f9d1e379028e0fc2ae3654bac3cbbef81bf3fd571272a42d56c24007979bafb6"}, - {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:13291b39131e2d002a7940fb176e120bec5145f3aeb7621be6534e46251912c4"}, - {file = "regex-2024.11.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f51f88c126370dcec4908576c5a627220da6c09d0bff31cfa89f2523843316d"}, - {file = "regex-2024.11.6-cp313-cp313-win32.whl", hash = "sha256:63b13cfd72e9601125027202cad74995ab26921d8cd935c25f09c630436348ff"}, - {file = "regex-2024.11.6-cp313-cp313-win_amd64.whl", hash = "sha256:2b3361af3198667e99927da8b84c1b010752fa4b1115ee30beaa332cabc3ef1a"}, - {file = "regex-2024.11.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:3a51ccc315653ba012774efca4f23d1d2a8a8f278a6072e29c7147eee7da446b"}, - {file = "regex-2024.11.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ad182d02e40de7459b73155deb8996bbd8e96852267879396fb274e8700190e3"}, - {file = "regex-2024.11.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ba9b72e5643641b7d41fa1f6d5abda2c9a263ae835b917348fc3c928182ad467"}, - {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40291b1b89ca6ad8d3f2b82782cc33807f1406cf68c8d440861da6304d8ffbbd"}, - {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cdf58d0e516ee426a48f7b2c03a332a4114420716d55769ff7108c37a09951bf"}, - {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a36fdf2af13c2b14738f6e973aba563623cb77d753bbbd8d414d18bfaa3105dd"}, - {file = "regex-2024.11.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1cee317bfc014c2419a76bcc87f071405e3966da434e03e13beb45f8aced1a6"}, - {file = "regex-2024.11.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50153825ee016b91549962f970d6a4442fa106832e14c918acd1c8e479916c4f"}, - {file = "regex-2024.11.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea1bfda2f7162605f6e8178223576856b3d791109f15ea99a9f95c16a7636fb5"}, - {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:df951c5f4a1b1910f1a99ff42c473ff60f8225baa1cdd3539fe2819d9543e9df"}, - {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:072623554418a9911446278f16ecb398fb3b540147a7828c06e2011fa531e773"}, - {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f654882311409afb1d780b940234208a252322c24a93b442ca714d119e68086c"}, - {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:89d75e7293d2b3e674db7d4d9b1bee7f8f3d1609428e293771d1a962617150cc"}, - {file = "regex-2024.11.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:f65557897fc977a44ab205ea871b690adaef6b9da6afda4790a2484b04293a5f"}, - {file = "regex-2024.11.6-cp38-cp38-win32.whl", hash = "sha256:6f44ec28b1f858c98d3036ad5d7d0bfc568bdd7a74f9c24e25f41ef1ebfd81a4"}, - {file = "regex-2024.11.6-cp38-cp38-win_amd64.whl", hash = "sha256:bb8f74f2f10dbf13a0be8de623ba4f9491faf58c24064f32b65679b021ed0001"}, - {file = "regex-2024.11.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5704e174f8ccab2026bd2f1ab6c510345ae8eac818b613d7d73e785f1310f839"}, - {file = "regex-2024.11.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:220902c3c5cc6af55d4fe19ead504de80eb91f786dc102fbd74894b1551f095e"}, - {file = "regex-2024.11.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5e7e351589da0850c125f1600a4c4ba3c722efefe16b297de54300f08d734fbf"}, - {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5056b185ca113c88e18223183aa1a50e66507769c9640a6ff75859619d73957b"}, - {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e34b51b650b23ed3354b5a07aab37034d9f923db2a40519139af34f485f77d0"}, - {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5670bce7b200273eee1840ef307bfa07cda90b38ae56e9a6ebcc9f50da9c469b"}, - {file = "regex-2024.11.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08986dce1339bc932923e7d1232ce9881499a0e02925f7402fb7c982515419ef"}, - {file = "regex-2024.11.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93c0b12d3d3bc25af4ebbf38f9ee780a487e8bf6954c115b9f015822d3bb8e48"}, - {file = "regex-2024.11.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:764e71f22ab3b305e7f4c21f1a97e1526a25ebdd22513e251cf376760213da13"}, - {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f056bf21105c2515c32372bbc057f43eb02aae2fda61052e2f7622c801f0b4e2"}, - {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:69ab78f848845569401469da20df3e081e6b5a11cb086de3eed1d48f5ed57c95"}, - {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:86fddba590aad9208e2fa8b43b4c098bb0ec74f15718bb6a704e3c63e2cef3e9"}, - {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:684d7a212682996d21ca12ef3c17353c021fe9de6049e19ac8481ec35574a70f"}, - {file = "regex-2024.11.6-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a03e02f48cd1abbd9f3b7e3586d97c8f7a9721c436f51a5245b3b9483044480b"}, - {file = "regex-2024.11.6-cp39-cp39-win32.whl", hash = "sha256:41758407fc32d5c3c5de163888068cfee69cb4c2be844e7ac517a52770f9af57"}, - {file = "regex-2024.11.6-cp39-cp39-win_amd64.whl", hash = "sha256:b2837718570f95dd41675328e111345f9b7095d821bac435aac173ac80b19983"}, - {file = "regex-2024.11.6.tar.gz", hash = "sha256:7ab159b063c52a0333c884e4679f8d7a85112ee3078fe3d9004b2dd875585519"}, -] - -[[package]] -name = "requests" -version = "2.32.3" -description = "Python HTTP for Humans." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, - {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = ">=2,<4" -idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<3" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] - -[[package]] -name = "six" -version = "1.17.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["main"] -files = [ - {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, - {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, -] - -[[package]] -name = "tomli" -version = "2.2.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.8" -groups = ["test"] -markers = "python_full_version <= \"3.11.0a6\"" -files = [ - {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, - {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, - {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, - {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, - {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, - {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, - {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, - {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, - {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, - {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, -] - -[[package]] -name = "tzdata" -version = "2025.1" -description = "Provider of IANA time zone data" -optional = false -python-versions = ">=2" -groups = ["main"] -markers = "platform_system == \"Windows\"" -files = [ - {file = "tzdata-2025.1-py2.py3-none-any.whl", hash = "sha256:7e127113816800496f027041c570f50bcd464a020098a3b6b199517772303639"}, - {file = "tzdata-2025.1.tar.gz", hash = "sha256:24894909e88cdb28bd1636c6887801df64cb485bd593f2fd83ef29075a81d694"}, -] - -[[package]] -name = "tzlocal" -version = "5.2" -description = "tzinfo object for the local timezone" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "tzlocal-5.2-py3-none-any.whl", hash = "sha256:49816ef2fe65ea8ac19d19aa7a1ae0551c834303d5014c6d5a62e4cbda8047b8"}, - {file = "tzlocal-5.2.tar.gz", hash = "sha256:8d399205578f1a9342816409cc1e46a93ebd5755e39ea2d85334bea911bf0e6e"}, -] - -[package.dependencies] -tzdata = {version = "*", markers = "platform_system == \"Windows\""} - -[package.extras] -devenv = ["check-manifest", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3)", "zest.releaser"] - -[[package]] -name = "urllib3" -version = "2.3.0" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=3.9" -groups = ["main"] -files = [ - {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, - {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] -h2 = ["h2 (>=4,<5)"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] - -[metadata] -lock-version = "2.1" -python-versions = "^3.10" -content-hash = "f65cd66387236673e2a5afb3b2a75362c97815cdde592a86712737fb9ca71695" diff --git a/pkgs/by-name/up/update-vim-plugins/pyproject.toml b/pkgs/by-name/up/update-vim-plugins/pyproject.toml deleted file mode 100644 index 38caf76d..00000000 --- a/pkgs/by-name/up/update-vim-plugins/pyproject.toml +++ /dev/null @@ -1,45 +0,0 @@ -[tool.poetry] -name = "update_vim_plugins" -version = "0.1.0" -description = "" -authors = ["Your Name <you@example.com>"] -packages = [{ include = "update_vim_plugins" }] - -[tool.poetry.scripts] -update-vim-plugins = "update_vim_plugins.__main__:main" - -[tool.poetry.dependencies] -python = "^3.10" -requests = "^2.28.2" -cleo = "^2.0.1" -jsonpickle = "*" -dateparser = "^1.1.8" - -[tool.poetry.group.test.dependencies] -pytest-cov = "^4.0.0" -pytest = "^7.3.1" -pytest-mock = "^3.10.0" - -[tool.poetry.group.dev] -optional = true - -[tool.poetry.group.dev.dependencies] -# black = "^23.3.0" -# ruff-lsp = "^0.0.24" -# mypy = "^1.2.0" -# types-requests = "^2.28.11.17" -# isort = "^5.12.0" -# ruff = "^0.0.262" - -[tool.isort] -profile = "black" - -[tool.black] -line-length = 120 - -[tool.ruff] -line-length = 120 - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/pkgs/by-name/up/update-vim-plugins/update.sh b/pkgs/by-name/up/update-vim-plugins/update.sh deleted file mode 100755 index 1bad12a9..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -poetry update --lock - -# vim: ft=sh diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/__init__.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/__init__.py +++ /dev/null diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/__main__.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/__main__.py deleted file mode 100644 index a8d9e06f..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/__main__.py +++ /dev/null @@ -1,15 +0,0 @@ -from cleo.application import Application - -from .update import UpdateCommand -from .cleanup import CleanUpCommand - - -def main(): - application = Application() - application.add(UpdateCommand()) - application.add(CleanUpCommand()) - application.run() - - -if __name__ == "__main__": - main() diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/cleanup.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/cleanup.py deleted file mode 100644 index fd313ed0..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/cleanup.py +++ /dev/null @@ -1,100 +0,0 @@ -from cleo.commands.command import Command -from cleo.helpers import argument - -from .helpers import read_manifest_to_spec, read_blacklist_to_spec, write_manifest_from_spec - - -class CleanUpCommand(Command): - name = "cleanup" - description = "Clean up manifest" - arguments = [argument("plug_dir", description="Path to the plugin directory", optional=False)] - - def handle(self): - """Main command function""" - - plug_dir = self.argument("plug_dir") - self.line("<comment>Checking manifest file</comment>") - # all cleaning up will be done during reading and writing automatically - manifest = read_manifest_to_spec(plug_dir) - blacklist = read_blacklist_to_spec(plug_dir) - - new_manifest = [spec for spec in manifest if spec not in blacklist] - - new_manifest_filterd = self.filter_renamed(new_manifest) - - write_manifest_from_spec(new_manifest_filterd, plug_dir) - - self.line("<comment>Done</comment>") - - def filter_renamed(self, specs): - """Filter specs that define the same plugin (same owner and same repo) but with different properties. - This could be a different name, source, or branch - """ - - error = False - for i, p in enumerate(specs): - for p2 in specs: - same_owner = p.owner.lower() == p2.owner.lower() - same_repo = p.repo.lower() == p2.repo.lower() - different_specs = p != p2 - marked_duplicate = p.marked_duplicate or p2.marked_duplicate - - if same_owner and same_repo and different_specs and not marked_duplicate: - self.line("<info>The following lines appear to define the same plugin</info>") - - p_props_defined = p.branch is not None or p.custom_name is not None - p2_props_defined = p2.branch is not None or p2.custom_name is not None - p_is_lower_case = p.owner == p.owner.lower() and p.name == p.name.lower() - p2_is_lower_case = p2.owner == p2.owner.lower() and p2.name == p2.name.lower() - - # list of conditions for selecting p - select_p = p_props_defined and not p2_props_defined or p2_is_lower_case and not p_is_lower_case - # list of conditions for selecting p2 - select_p2 = p2_props_defined and not p_props_defined or p_is_lower_case and not p2_is_lower_case - - # one is more defined and is all lower, but the other is not all lower - # (we assume the not all lower case is the correct naming) - error_props_lower = ( - p_props_defined and p_is_lower_case and not p2_props_defined and not p2_is_lower_case - ) - error_props_lower2 = ( - p2_props_defined and p2_is_lower_case and not p_props_defined and not p_is_lower_case - ) - - # both props are defined - error_props = p_props_defined and p2_props_defined - - # the sources are different - error_source = p.repository_host != p2.repository_host - - if error_props_lower or error_props_lower2 or error_props or error_source: - self.line(" • <error>Cannot determine which is the correct plugin</error>") - self.line(f" - {p.line}") - self.line(f" - {p2.line}") - error = True - # remove second spec to not encounter the error twice - # this will not be written to the manifest.txt because we set - # the error flag and will exit after the loop - specs.remove(p2) - elif select_p: - self.line(f" - <comment>{p.line}</comment>") - self.line(f" - {p2.line}") - specs.remove(p2) - elif select_p2: - self.line(f" - {p.line}") - self.line(f" - <comment>{p2.line}</comment>") - specs.remove(p) - else: - self.line(" • <error>Logic error in correct spec determination</error>") - self.line(f" - {p.line}") - self.line(f" - {p2.line}") - error = True - # remove second spec to not encounter the error twice - # this will not be written to the manifest.txt because we set - # the error flag and will exit after the loop - specs.remove(p) - if error: - # exit after all errors have been found - exit(1) - - return specs diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/helpers.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/helpers.py deleted file mode 100644 index 8a28b0e8..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/helpers.py +++ /dev/null @@ -1,61 +0,0 @@ -from .spec import PluginSpec - -MANIFEST_FILE = "manifest.txt" -BLACKLIST_FILE = "blacklist.txt" -PKGS_FILE = "default.nix" -JSON_FILE = ".plugins.json" -PLUGINS_LIST_FILE = "plugins.md" - - -def get_const(const: str, plug_dir: str) -> str: - out = plug_dir + "/" + const - return out - - -def read_manifest(plug_dir: str) -> list[str]: - with open(get_const(MANIFEST_FILE, plug_dir), "r") as file: - specs = set([spec.strip() for spec in file.readlines()]) - - return sorted(specs) - - -def read_manifest_to_spec(plug_dir: str) -> list[PluginSpec]: - manifest = read_manifest(plug_dir) - specs = [PluginSpec.from_spec(spec.strip()) for spec in manifest] - - return sorted(specs) - - -def read_blacklist(plug_dir: str) -> list[str]: - with open(get_const(BLACKLIST_FILE, plug_dir), "r") as file: - if len(file.readlines()) == 0: - return [""] - else: - blacklisted_specs = set([spec.strip() for spec in file.readlines()]) - - return sorted(blacklisted_specs) - - -def read_blacklist_to_spec(plug_dir: str) -> list[PluginSpec]: - blacklist = read_blacklist(plug_dir) - specs = [PluginSpec.from_spec(spec.strip()) for spec in blacklist] - - return sorted(specs) - - -def write_manifest(specs: list[str] | set[str], plug_dir: str): - """write specs to manifest file. Does some cleaning up""" - - with open(get_const(MANIFEST_FILE, plug_dir), "w") as file: - specs = sorted(set(specs), key=lambda x: x.lower()) - specs = [p for p in specs] - - for s in specs: - file.write(f"{s}\n") - - -def write_manifest_from_spec(specs: list[PluginSpec], plug_dir: str): - """write specs to manifest file. Does some cleaning up""" - - strings = [f"{spec}" for spec in specs] - write_manifest(strings, plug_dir) diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/nix.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/nix.py deleted file mode 100644 index 66a8df4c..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/nix.py +++ /dev/null @@ -1,121 +0,0 @@ -import abc -import enum -import json -import subprocess - - -def nix_prefetch_url(url): - """Return the sha256 hash of the given url.""" - subprocess_output = subprocess.check_output( - ["nix-prefetch-url", "--type", "sha256", url], - stderr=subprocess.DEVNULL, - ) - sha256 = subprocess_output.decode("utf-8").strip() - return sha256 - - -def nix_prefetch_git(url): - """Return the sha256 hash of the given git url.""" - subprocess_output = subprocess.check_output(["nix-prefetch-git", url], stderr=subprocess.DEVNULL) - sha256 = json.loads(subprocess_output)["sha256"] - return sha256 - - -class Source(abc.ABC): - """Abstract base class for sources.""" - - url: str - sha256: str - - @abc.abstractmethod - def __init__(self, url: str) -> None: - """Initialize a Source.""" - - @abc.abstractmethod - def get_nix_expression(self): - """Return the nix expression for this source.""" - - def __repr__(self): - """Return the representation of this source.""" - return self.get_nix_expression() - - -class UrlSource(Source): - """A source that is a url.""" - - def __init__(self, url: str) -> None: - """Initialize a UrlSource.""" - self.url = url - self.sha256 = nix_prefetch_url(url) - - def get_nix_expression(self): - """Return the nix expression for this source.""" - return f'fetchurl {{ url = "{self.url}"; sha256 = "{self.sha256}"; }}' - - -class GitSource(Source): - """A source that is a git repository.""" - - def __init__(self, url: str, rev: str) -> None: - """Initialize a GitSource.""" - self.url = url - self.rev = rev - self.sha256 = nix_prefetch_git(url) - - def get_nix_expression(self): - """Return the nix expression for this source.""" - return f'fetchgit {{ url = "{self.url}"; rev = "{self.rev}"; sha256 = "{self.sha256}"; }}' - - -class License(enum.Enum): - """An enumeration of licenses.""" - - AGPL_3_0 = "agpl3Only" - APACHE_2_0 = "asf20" - BSD_2_CLAUSE = "bsd2" - BSD_3_CLAUSE = "bsd3" - BSL_1_0 = "bsl1_0" - CC0_1_0 = "cc0" - EPL_2_0 = "epl20" - GPL_2_0 = "gpl2Only" - GPL_3_0 = "gpl3Only" - ISCLGPL_2_1 = "lgpl21Only" - MIT = "mit" - MPL_2_0 = "mpl20" - UNLUNLICENSE = "unlicense" - WTFPL = "wtfpl" - UNFREE = "unfree" - UNKNOWN = "" - - @classmethod - def from_spdx_id(cls, spdx_id: str | None) -> "License": - """Return the License from the given spdx_id.""" - mapping = { - "AGPL-3.0": cls.AGPL_3_0, - "AGPL-3.0-only": cls.AGPL_3_0, - "Apache-2.0": cls.APACHE_2_0, - "BSD-2-Clause": cls.BSD_2_CLAUSE, - "BSD-3-Clause": cls.BSD_3_CLAUSE, - "BSL-1.0": cls.BSL_1_0, - "CC0-1.0": cls.CC0_1_0, - "EPL-2.0": cls.EPL_2_0, - "GPL-2.0": cls.GPL_2_0, - "GPL-2.0-only": cls.GPL_2_0, - "GPL-3.0": cls.GPL_3_0, - "GPL-3.0-only": cls.GPL_3_0, - "LGPL-2.1-only": cls.ISCLGPL_2_1, - "MIT": cls.MIT, - "MPL-2.0": cls.MPL_2_0, - "Unlicense": cls.UNLUNLICENSE, - "WTFPL": cls.WTFPL, - } - - if spdx_id is None: - return cls.UNKNOWN - - spdx_id = spdx_id.upper() - return mapping.get(spdx_id, cls.UNKNOWN) - - def __str__(self): - """Return the string representation of this license.""" - return self.value diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/plugin.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/plugin.py deleted file mode 100644 index 8334ad53..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/plugin.py +++ /dev/null @@ -1,182 +0,0 @@ -import logging -import os -import urllib - -import requests -import jsonpickle -from datetime import datetime, date -from dateparser import parse - -from .nix import GitSource, License, Source, UrlSource -from .spec import PluginSpec, RepositoryHost - - -logger = logging.getLogger(__name__) - - -class VimPlugin: - """Abstract base class for vim plugins.""" - - name: str - owner: str - repo: str - version: date - source: Source - description: str = "No description" - homepage: str - license: License - source_line: str - checked: date = datetime.now().date() - - def to_nix(self): - """Return the nix expression for this plugin.""" - meta = f'with lib; {{ description = "{self.description}"; homepage = "{self.homepage}"; license = with licenses; [ {self.license.value} ]; }}' - return f'/* Generated from: {self.source_line} */ {self.name} = buildVimPlugin {{ pname = "{self.name}"; version = "{self.version}"; src = {self.source.get_nix_expression()}; meta = {meta}; }};' - - def to_json(self): - """Serizalize the plugin to json""" - return jsonpickle.encode(self) - - def to_markdown(self): - link = f"[{self.source_line}]({self.homepage})" - version = f"{self.version}" - package_name = f"{self.name}" - checked = f"{self.checked}" - - return f"| {link} | {version} | `{package_name}` | {checked} |" - - def __lt__(self, o: object) -> bool: - if not isinstance(o, VimPlugin): - return False - - return self.name.lower() < o.name.lower() - - def __repr__(self): - """Return the representation of this plugin.""" - return f"VimPlugin({self.name!r}, {self.version.strftime('%Y-%m-%d')})" - - -def _get_github_token(): - token = os.environ.get("GITHUB_TOKEN") - if token is None: - # NOTE: This should never use more than the free api requests <2023-12-09> - pass - # logger.warning("GITHUB_TOKEN environment variable not set") - return token - - -class GitHubPlugin(VimPlugin): - def __init__(self, plugin_spec: PluginSpec) -> None: - """Initialize a GitHubPlugin.""" - - full_name = f"{plugin_spec.owner}/{plugin_spec.repo}" - repo_info = self._api_call(f"repos/{full_name}") - default_branch = plugin_spec.branch or repo_info["default_branch"] - api_callback = self._api_call(f"repos/{full_name}/commits/{default_branch}") - latest_commit = api_callback["commit"] - sha = api_callback["sha"] - - self.name = plugin_spec.name - self.owner = plugin_spec.owner - self.version = parse(latest_commit["committer"]["date"]).date() - self.source = UrlSource(f"https://github.com/{full_name}/archive/{sha}.tar.gz") - self.description = (repo_info.get("description") or "").replace('"', '\\"') - self.homepage = repo_info["html_url"] - self.license = plugin_spec.license or License.from_spdx_id((repo_info.get("license") or {}).get("spdx_id")) - self.source_line = plugin_spec.line - - def _api_call(self, path: str, token: str | None = _get_github_token()): - """Call the GitHub API.""" - url = f"https://api.github.com/{path}" - headers = {"Content-Type": "application/json"} - if token is not None: - headers["Authorization"] = f"token {token}" - response = requests.get(url, headers=headers) - if response.status_code != 200: - raise RuntimeError(f"GitHub API call failed: {response.text}") - return response.json() - - -class GitlabPlugin(VimPlugin): - def __init__(self, plugin_spec: PluginSpec) -> None: - """Initialize a GitlabPlugin.""" - - full_name = urllib.parse.quote(f"{plugin_spec.owner}/{plugin_spec.repo}", safe="") - repo_info = self._api_call(f"projects/{full_name}") - default_branch = plugin_spec.branch or repo_info["default_branch"] - api_callback = self._api_call(f"projects/{full_name}/repository/branches/{default_branch}") - latest_commit = api_callback["commit"] - sha = latest_commit["id"] - - self.name = plugin_spec.name - self.owner = plugin_spec.owner - self.version = parse(latest_commit["created_at"]).date() - self.source = UrlSource(f"https://gitlab.com/api/v4/projects/{full_name}/repository/archive.tar.gz?sha={sha}") - self.description = (repo_info.get("description") or "").replace('"', '\\"') - self.homepage = repo_info["web_url"] - self.license = plugin_spec.license or License.from_spdx_id(repo_info.get("license", {}).get("key")) - self.source_line = plugin_spec.line - - def _api_call(self, path: str) -> dict: - """Call the Gitlab API.""" - url = f"https://gitlab.com/api/v4/{path}" - response = requests.get(url) - if response.status_code != 200: - raise RuntimeError(f"Gitlab API call failed: {response.text}") - return response.json() - - -def _get_sourcehut_token(): - token = os.environ.get("SOURCEHUT_TOKEN") - if token is None: - # NOTE: This should never use more than the free requests <2023-12-09> - pass - # logger.warning("SOURCEHUT_TOKEN environment variable not set") - return token - - -class SourceHutPlugin(VimPlugin): - def __init__(self, plugin_spec: PluginSpec) -> None: - """Initialize a SourceHutPlugin.""" - - repo_info = self._api_call(f"~{plugin_spec.owner}/repos/{plugin_spec.repo}") - if plugin_spec.branch is None: - commits = self._api_call(f"~{plugin_spec.owner}/repos/{plugin_spec.repo}/log") - else: - commits = self._api_call(f"~{plugin_spec.owner}/repos/{plugin_spec.repo}/log/{plugin_spec.branch}") - latest_commit = commits["results"][0] - sha = latest_commit["id"] - - self.name = plugin_spec.name - self.owner = plugin_spec.owner - self.version = parse(latest_commit["timestamp"]).date() - self.description = (repo_info.get("description") or "").replace('"', '\\"') - self.homepage = f"https://git.sr.ht/~{plugin_spec.owner}/{plugin_spec.repo}" - self.source = GitSource(self.homepage, sha) - self.license = plugin_spec.license or License.UNKNOWN # cannot be determined via API - self.source_line = plugin_spec.line - - def _api_call(self, path: str, token: str | None = _get_sourcehut_token()): - """Call the SourceHut API.""" - - url = f"https://git.sr.ht/api/{path}" - headers = {"Content-Type": "application/json"} - if token is not None: - headers["Authorization"] = f"token {token}" - response = requests.get(url, headers=headers) - if response.status_code != 200: - raise RuntimeError(f"SourceHut API call failed: {response.json()}") - return response.json() - - -def plugin_from_spec(plugin_spec: PluginSpec) -> VimPlugin: - """Initialize a VimPlugin.""" - - if plugin_spec.repository_host == RepositoryHost.GITHUB: - return GitHubPlugin(plugin_spec) - elif plugin_spec.repository_host == RepositoryHost.GITLAB: - return GitlabPlugin(plugin_spec) - elif plugin_spec.repository_host == RepositoryHost.SOURCEHUT: - return SourceHutPlugin(plugin_spec) - else: - raise NotImplementedError(f"Unsupported source: {plugin_spec.repository_host}") diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/spec.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/spec.py deleted file mode 100644 index 0f2fb29c..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/spec.py +++ /dev/null @@ -1,143 +0,0 @@ -import enum -import re - -from .nix import License - - -class RepositoryHost(enum.Enum): - """A repository host.""" - - GITHUB = "github" - GITLAB = "gitlab" - SOURCEHUT = "sourcehut" - - -class PluginSpec: - """A Vim plugin Spec.""" - - @classmethod - def from_spec(cls, spec): - """The spec line must be in the format: - [<repository_host>:]<owner>/<repo>[:<branch>][:name]. - - repository_host is one of github (default), gitlab, or sourcehut. - owner is the repository owner. - repo is the repository name. - branch is the git branch. - name is the name to use for the plugin (default is value of repo). - """ - repository_host = RepositoryHost.GITHUB - # gitref = "master" - - repository_host_regex = r"((?P<repository_host>[^:]+):)" - owner_regex = r"(?P<owner>[^/:]+)" - repo_regex = r"(?P<repo>[^:]+)" - branch_regex = r"(:(?P<branch>[^:]+)?)" - name_regex = r"(:(?P<name>[^:]+)?)" - license_regex = r"(:(?P<license>[^:]+)?)" - marked_duplicate_regex = r"(:(?P<duplicate>duplicate))" - - spec_regex = re.compile( - f"^{repository_host_regex}?{owner_regex}/{repo_regex}{branch_regex}?{name_regex}?{license_regex}?{marked_duplicate_regex}?$", - ) - - match = spec_regex.match(spec) - if match is None: - raise ValueError(f"Invalid spec: {spec}") - - group_dict = match.groupdict() - - repository_host = RepositoryHost(group_dict.get("repository_host") or "github") - - owner = group_dict.get("owner") - if owner is None: - raise RuntimeError("Could not get owner") - - repo = group_dict.get("repo") - if repo is None: - raise RuntimeError("Could not get repo") - - branch = group_dict.get("branch") - name = group_dict.get("name") - license = group_dict.get("license") - marked_duplicate = bool(group_dict.get("duplicate")) # True if 'duplicate', False if None - - line = spec - - return cls(repository_host, owner, repo, line, branch, name, license, marked_duplicate) - - def __init__( - self, - repository_host: RepositoryHost, - owner: str, - repo: str, - line: str, - branch: str | None = None, - name: str | None = None, - license: str | None = None, - marked_duplicate: bool = False, - ) -> None: - """Initialize a VimPluginSpec.""" - self.repository_host = repository_host - self.owner = owner - self.repo = repo - self.branch = branch - self.custom_name = name - self.name = name or repo.replace(".", "-").replace("_", "-") - self.license = License(license) if license else None - self.line = line - self.marked_duplicate = marked_duplicate - - def __str__(self) -> str: - """Return a string representation of a VimPluginSpec.""" - spec = "" - - if self.repository_host != RepositoryHost.GITHUB: - spec += f"{self.repository_host.value}:" - - spec += f"{self.owner}/{self.repo}" - - spec += ":" - if self.branch is not None: - spec += self.branch - - spec += ":" - if self.custom_name is not None: - spec += self.custom_name - - spec += ":" - if self.license is not None: - spec += str(self.license) - - spec += ":" - if self.marked_duplicate: - spec += "duplicate" - - return spec.rstrip(":") - - def __repr__(self): - """Return the representation of the specs""" - return f"PluginSpec({self.owner}/{self.repo}, {self.name})" - - def to_spec(self): - """Return a spec line for a VimPluginSpec.""" - return str(self) - - def __lt__(self, o: object) -> bool: - if not isinstance(o, PluginSpec): - return False - - return self.name.lower() < o.name.lower() - - def __eq__(self, o: object) -> bool: - """Return True if the two specs are equal.""" - if not isinstance(o, PluginSpec): - return False - - return ( - self.repository_host == o.repository_host - and self.owner == o.owner - and self.repo == o.repo - and self.branch == o.branch - and self.name == o.name - ) diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/__init__.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/__init__.py +++ /dev/null diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/fixtures.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/fixtures.py deleted file mode 100644 index 75dd251a..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/fixtures.py +++ /dev/null @@ -1,44 +0,0 @@ -import json - -import pytest -from pytest_mock import MockerFixture - -from update_vim_plugins.nix import GitSource, UrlSource - - -@pytest.fixture() -def url(): - return "https://example.com" - - -@pytest.fixture() -def rev(): - return "1234567890abcdef" - - -@pytest.fixture() -def sha256(): - return "sha256-1234567890abcdef" - - -@pytest.fixture() -def url_source(mocker: MockerFixture, url: str, sha256: str): - mocker.patch("subprocess.check_output", return_value=bytes(sha256, "utf-8")) - return UrlSource(url) - - -@pytest.fixture() -def git_source(mocker: MockerFixture, url: str, rev: str, sha256: str): - return_value = { - "url": url, - "rev": rev, - "date": "1970-01-01T00:00:00+00:00", - "path": "", - "sha256": sha256, - "fetchLFS": False, - "fetchSubmodules": False, - "deepClone": False, - "leaveDotGit": False, - } - mocker.patch("subprocess.check_output", return_value=json.dumps(return_value).encode("utf-8")) - return GitSource(url, rev) diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_nix.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_nix.py deleted file mode 100644 index 46e59f76..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_nix.py +++ /dev/null @@ -1,32 +0,0 @@ -from update_vim_plugins.nix import GitSource, License, UrlSource - - -def test_url_source(url_source: UrlSource, url: str, sha256: str): - assert url_source.url == url - assert url_source.sha256 == sha256 - - -def test_url_source_nix_expression(url_source: UrlSource, url: str, sha256: str): - assert url_source.get_nix_expression() == f'fetchurl {{ url = "{url}"; sha256 = "{sha256}"; }}' - - -def test_git_source(git_source: GitSource, url: str, rev: str, sha256: str): - assert git_source.url == url - assert git_source.sha256 == sha256 - assert git_source.rev == rev - - -def test_git_source_nix_expression(git_source: GitSource, url: str, rev: str, sha256: str): - assert git_source.get_nix_expression() == f'fetchgit {{ url = "{url}"; rev = "{rev}"; sha256 = "{sha256}"; }}' - - -def test_license_github(): - github_license = "MIT" - license = License.from_spdx_id(github_license) - assert license == License.MIT - - -def test_license_gitlab(): - gitlab_license = "mit" - license = License.from_spdx_id(gitlab_license) - assert license == License.MIT diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_plugin.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_plugin.py deleted file mode 100644 index 32377e24..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_plugin.py +++ /dev/null @@ -1,144 +0,0 @@ -import json -from typing import Callable - -import pytest -from pytest_mock import MockFixture - -from update_vim_plugins.nix import License, UrlSource -from update_vim_plugins.plugin import GitHubPlugin, VimPlugin -from update_vim_plugins.spec import PluginSpec - - -@pytest.fixture() -def mock_source(sha256: str): - class MockSource: - def __init__(self, *args, **kwargs): - pass - - def get_nix_expression(self): - return "src" - - return MockSource() - - -@pytest.fixture() -def mock_plugin(mock_source): - class MockVimPlugin(VimPlugin): - def __init__(self): - self.name = "test" - self.version = "1.0.0" - self.source = mock_source - self.description = "No description" - self.homepage = "https://example.com" - self.license = License.UNKNOWN - - return MockVimPlugin() - - -def test_vim_plugin_nix_expression(mock_plugin): - assert ( - mock_plugin.get_nix_expression() - == 'test = buildVimPluginFrom2Nix { pname = "test"; version = "1.0.0"; src = src; meta = with lib; { description = "No description"; homepage = "https://example.com"; license = with licenses; [ ]; }; };' - ) - - -class MockResponse: - def __init__(self, status_code: int, content: bytes): - self.status_code = status_code - self.content = content - - def json(self): - return json.loads(self.content) - - -def mock_request_get(repsonses: dict[str, MockResponse]): - respones_not_found = MockResponse(404, b'{"message": "Not Found"}') - - def mock_get(url: str, *args, **kwargs): - return repsonses.get(url, respones_not_found) - - return mock_get - - -@pytest.fixture() -def github_commits_response(): - return MockResponse( - 200, - json.dumps( - { - "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", - "commit": { - "committer": { - "date": "2011-04-14T16:00:49Z", - }, - }, - } - ), - ) - - -@pytest.fixture() -def github_get(github_commits_response: MockResponse): - repos_response = MockResponse( - 200, - json.dumps( - { - "html_url": "https://github.com/octocat/Hello-World", - "description": "This your first repo!", - "fork": False, - "default_branch": "master", - "license": { - "spdx_id": "MIT", - }, - } - ), - ) - responses = { - "https://api.github.com/repos/octocat/Hello-World": repos_response, - "https://api.github.com/repos/octocat/Hello-World/commits/master": github_commits_response, - } - return mock_request_get(responses) - - -@pytest.fixture() -def github_get_no_license(github_commits_response: MockResponse): - repos_response = MockResponse( - 200, - json.dumps( - { - "html_url": "https://github.com/octocat/Hello-World", - "description": "This your first repo!", - "fork": False, - "default_branch": "master", - } - ), - ) - responses = { - "https://api.github.com/repos/octocat/Hello-World": repos_response, - "https://api.github.com/repos/octocat/Hello-World/commits/master": github_commits_response, - } - return mock_request_get(responses) - - -def test_github_plugin(mocker: MockFixture, github_get: Callable, url_source: UrlSource): - mocker.patch("requests.get", github_get) - url_source = mocker.patch("update_vim_plugins.nix.UrlSource", url_source) - - spec = PluginSpec.from_spec("octocat/Hello-World") - plugin = GitHubPlugin(spec) - - assert plugin.name == "Hello-World" - assert plugin.version == "2011-04-14" - assert plugin.description == "This your first repo!" - assert plugin.homepage == "https://github.com/octocat/Hello-World" - assert plugin.license == License.MIT - - -def test_github_plugin_no_license(mocker: MockFixture, github_get_no_license: Callable, url_source: UrlSource): - mocker.patch("requests.get", github_get_no_license) - url_source = mocker.patch("update_vim_plugins.nix.UrlSource", url_source) - - spec = PluginSpec.from_spec("octocat/Hello-World") - plugin = GitHubPlugin(spec) - - assert plugin.license == License.UNKNOWN diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_spec.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_spec.py deleted file mode 100644 index 2b9a1d24..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/tests/test_spec.py +++ /dev/null @@ -1,136 +0,0 @@ -import pytest - -from update_vim_plugins.spec import PluginSpec, RepositoryHost - - -@pytest.fixture() -def owner(): - return "owner" - - -@pytest.fixture() -def repo(): - return "repo.nvim" - - -@pytest.fixture() -def branch(): - return "main" - - -@pytest.fixture() -def name(): - return "repo-nvim" - - -@pytest.fixture() -def license(): - return "mit" - - -def test_from_spec_simple(owner: str, repo: str): - vim_plugin = PluginSpec.from_spec(f"{owner}/{repo}") - - assert vim_plugin.owner == owner - assert vim_plugin.repo == repo - - -def test_from_spec_with_gitref(owner: str, repo: str, branch: str): - vim_plugin = PluginSpec.from_spec(f"{owner}/{repo}:{branch}") - - assert vim_plugin.branch == branch - - -def test_from_spec_with_name(owner: str, repo: str, name: str): - vim_plugin = PluginSpec.from_spec(f"{owner}/{repo}::{name}") - - assert vim_plugin.name == name - - -@pytest.mark.parametrize("host", RepositoryHost) -def test_from_spec_with_repository_host(owner: str, repo: str, host: RepositoryHost): - vim_plugin = PluginSpec.from_spec(f"{host.value}:{owner}/{repo}") - - assert vim_plugin.repository_host == host - - -def test_from_spec_without_repository_host(owner: str, repo: str): - vim_plugin = PluginSpec.from_spec(f"{owner}/{repo}") - - assert vim_plugin.repository_host == RepositoryHost.GITHUB - - -def test_from_spec_complex(owner: str, repo: str, branch: str, name: str): - vim_plugin = PluginSpec.from_spec(f"gitlab:{owner}/{repo}:{branch}:{name}") - - assert vim_plugin.repository_host == RepositoryHost.GITLAB - assert vim_plugin.owner == owner - assert vim_plugin.repo == repo - assert vim_plugin.branch == branch - assert vim_plugin.name == name - - -def test_from_spec_invalid_spec(): - with pytest.raises(ValueError): - PluginSpec.from_spec("invalid_spec") - - -def test_to_spec_simple(owner: str, repo: str): - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo) - - assert vim_plugin.to_spec() == f"{owner}/{repo}" - - -def test_to_spec_with_branch(owner: str, repo: str, branch: str): - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo, branch=branch) - assert vim_plugin.to_spec() == f"{owner}/{repo}:{branch}" - - -def test_to_spec_with_name(owner: str, repo: str, name: str): - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo, name=name) - - assert vim_plugin.to_spec() == f"{owner}/{repo}::{name}" - - -@pytest.mark.parametrize("host", [RepositoryHost.GITLAB, RepositoryHost.SOURCEHUT]) -def test_to_spec_with_repository_host(host: RepositoryHost, owner: str, repo: str): - vim_plugin = PluginSpec(host, owner, repo) - - assert vim_plugin.to_spec() == f"{host.value}:{owner}/{repo}" - - -def test_to_spec_complex(owner: str, repo: str, branch: str, name: str, license: str): - vim_plugin = PluginSpec(RepositoryHost.GITLAB, owner, repo, branch=branch, name=name, license=license) - - assert vim_plugin.to_spec() == f"gitlab:{owner}/{repo}:{branch}:{name}:{license}" - - -def test_spec_equal(owner: str, repo: str): - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo) - vim_plugin2 = PluginSpec(RepositoryHost.GITHUB, owner, repo) - - assert vim_plugin == vim_plugin2 - - -def test_spec_not_equal_different_branch(owner: str, repo: str): - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo) - vim_plugin2 = PluginSpec(RepositoryHost.GITHUB, owner, repo, branch="main") - - assert vim_plugin != vim_plugin2 - - -def test_spec_not_equal_different_name(owner: str, repo: str): - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo) - vim_plugin2 = PluginSpec(RepositoryHost.GITHUB, owner, repo, name="renamed") - - assert vim_plugin != vim_plugin2 - - -def test_spec_equal_same_normalized_name(owner: str): - repo = "repo.nvim" - name = "repo-nvim" - - vim_plugin = PluginSpec(RepositoryHost.GITHUB, owner, repo) - vim_plugin2 = PluginSpec(RepositoryHost.GITHUB, owner, repo, name=name) - - assert vim_plugin == vim_plugin2 diff --git a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py b/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py deleted file mode 100644 index 7eb3eeb4..00000000 --- a/pkgs/by-name/up/update-vim-plugins/update_vim_plugins/update.py +++ /dev/null @@ -1,212 +0,0 @@ -import subprocess -from random import shuffle -from cleo.helpers import argument, option -from cleo.commands.command import Command -from concurrent.futures import ThreadPoolExecutor, as_completed - -from pprint import pprint - -from .plugin import plugin_from_spec - -from .helpers import read_manifest_to_spec, get_const -from .helpers import JSON_FILE, PLUGINS_LIST_FILE, PKGS_FILE - -import json -import jsonpickle - -jsonpickle.set_encoder_options("json", sort_keys=True) - - -class UpdateCommand(Command): - name = "update" - description = "Generate nix module from input file" - arguments = [argument("plug_dir", description="Path to the plugin directory", optional=False)] - options = [ - option("all", "a", description="Update all plugins. Else only update new plugins", flag=True), - option("dry-run", "d", description="Show which plugins would be updated", flag=True), - ] - - def handle(self): - """Main command function""" - - plug_dir = self.argument("plug_dir") - self.specs = read_manifest_to_spec(plug_dir) - - if self.option("all"): - # update all plugins - spec_list = self.specs - known_plugins = [] - else: - # filter plugins we already know - spec_list = self.specs - - with open(get_const(JSON_FILE, plug_dir), "r") as json_file: - data = json.load(json_file) - - known_specs = list(filter(lambda x: x.line in data, spec_list)) - known_plugins = [jsonpickle.decode(data[x.line]) for x in known_specs] - - spec_list = list(filter(lambda x: x.line not in data, spec_list)) - - if self.option("dry-run"): - self.line("<comment>These plugins would be updated</comment>") - pprint(spec_list) - self.line(f"<info>Total:</info> {len(spec_list)}") - exit(0) - - processed_plugins, failed_plugins, failed_but_known = self.process_manifest(spec_list, plug_dir) - - processed_plugins += known_plugins # add plugins from .plugins.json - processed_plugins: list = sorted(set(processed_plugins)) # remove duplicates based only on source line - - self.check_duplicates(processed_plugins) - - if failed_plugins != []: - self.line("<error>Not processed:</error> The following plugins could not be updated") - for s, e in failed_plugins: - self.line(f" - {s!r} - {e}") - - if failed_but_known != []: - self.line( - "<error>Not updated:</error> The following plugins could not be updated but an older version is known" - ) - for s, e in failed_but_known: - self.line(f" - {s!r} - {e}") - - # update plugin "database" - self.write_plugins_json(processed_plugins, plug_dir) - - # generate output - self.write_plugins_nix(processed_plugins, plug_dir) - - self.write_plugins_markdown(processed_plugins, plug_dir) - - self.line("<comment>Done</comment>") - - def write_plugins_markdown(self, plugins, plug_dir): - """Write the list of all plugins to PLUGINS_LIST_FILE in markdown""" - - plugins.sort() - - self.line("<info>Updating plugins.md</info>") - - header = f" - Plugin count: {len(plugins)}\n\n| Repo | Last Update | Nix package name | Last checked |\n|:---|:---|:---|:---|\n" - - with open(get_const(PLUGINS_LIST_FILE, plug_dir), "w") as file: - file.write(header) - for plugin in plugins: - file.write(f"{plugin.to_markdown()}\n") - - def write_plugins_nix(self, plugins, plug_dir): - self.line("<info>Generating nix output</info>") - - plugins.sort() - - header = "{ lib, buildVimPlugin, fetchurl, fetchgit }: {" - footer = "}" - - with open(get_const(PKGS_FILE, plug_dir), "w") as file: - file.write(header) - for plugin in plugins: - file.write(f"{plugin.to_nix()}\n") - file.write(footer) - - self.line("<info>Formatting nix output</info>") - - subprocess.run( - ["alejandra", get_const(PKGS_FILE, plug_dir)], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - - def write_plugins_json(self, plugins, plug_dir): - self.line("<info>Storing results in .plugins.json</info>") - - plugins.sort() - - with open(get_const(JSON_FILE, plug_dir), "r+") as json_file: - data = json.load(json_file) - - for plugin in plugins: - data.update({f"{plugin.source_line}": plugin.to_json()}) - - json_file.seek(0) - json_file.write(json.dumps(data, indent=2, sort_keys=True)) - json_file.truncate() - - def check_duplicates(self, plugins): - """check for duplicates in proccesed_plugins""" - error = False - for i, plugin in enumerate(plugins): - for p in plugins[i + 1 :]: - if plugin.name == p.name: - self.line( - f"<error>Error:</error> The following two lines produce the same plugin name:\n - {plugin.source_line}\n - {p.source_line}\n -> {p.name}" - ) - error = True - - # We want to exit if the resulting nix file would be broken - # But we want to go through all plugins before we do so - if error: - exit(1) - - def generate_plugin(self, spec, i, size, plug_dir): - debug_string = "" - - processed_plugin = None - failed_but_known = None - failed_plugin = None - try: - debug_string += f" - <info>({i+1}/{size}) Processing</info> {spec!r}\n" - vim_plugin = plugin_from_spec(spec) - debug_string += f" • <comment>Success</comment> {vim_plugin!r}\n" - processed_plugin = vim_plugin - except Exception as e: - debug_string += f" • <error>Error:</error> Could not update <info>{spec.name}</info>. Keeping old values. Reason: {e}\n" - with open(get_const(JSON_FILE, plug_dir), "r") as json_file: - data = json.load(json_file) - - plugin_json = data.get(spec.line) - if plugin_json: - vim_plugin = jsonpickle.decode(plugin_json) - processed_plugin = vim_plugin - failed_but_known = (vim_plugin, e) - else: - debug_string += f" • <error>Error:</error> No entries for <info>{spec.name}</info> in '.plugins.json'. Skipping...\n" - failed_plugin = (spec, e) - - self.line(debug_string.strip()) - - return processed_plugin, failed_plugin, failed_but_known - - def process_manifest(self, spec_list, plug_dir): - """Read specs in 'spec_list' and generate plugins""" - - size = len(spec_list) - - # We have to assume that we will reach an api limit. Therefore - # we randomize the spec list to give every entry the same change to be updated and - # not favor those at the start of the list - shuffle(spec_list) - - with ThreadPoolExecutor() as executor: - futures = [ - executor.submit(self.generate_plugin, spec, i, size, plug_dir) for i, spec in enumerate(spec_list) - ] - results = [future.result() for future in as_completed(futures)] - - processed_plugins = [r[0] for r in results] - failed_plugins = [r[1] for r in results] - failed_but_known = [r[2] for r in results] - - processed_plugins = list(filter(lambda x: x is not None, processed_plugins)) - failed_plugins = list(filter(lambda x: x is not None, failed_plugins)) - failed_but_known = list(filter(lambda x: x is not None, failed_but_known)) - - processed_plugins.sort() - failed_plugins.sort() - failed_but_known.sort() - - assert len(processed_plugins) == len(spec_list) - len(failed_plugins) - - return processed_plugins, failed_plugins, failed_but_known diff --git a/pkgs/by-name/vi/vimExtraPlugins/README.md b/pkgs/by-name/vi/vimExtraPlugins/README.md deleted file mode 100644 index e8169951..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Fork - -All files in this repository where forked form [here](https://github.com/NixNeovim/NixNeovimPlugins) on commit `5010b91eb03696574c3c293f072a090618227e87`. -Below the original README. They were licensed under the MIT license. - -# All vim plugins, ready to go - -This repo auto generates nix packages for vim/neovim plugins. -Packages are automatically updated twice per week using a GitHub Actions. -Plugins are fetched from the `manifest.txt` and [awesome-neovim][0] repo. - -This is a fork of [this repo](https://github.com/m15a/nixpkgs-vim-extra-plugins); however, we fetch all additions from the original repo, so we will never have less plugins. -Further, the original deletes plugins that are available in the nixpkgs. We, instead, try to assemble a list of all available plugins. -Therefore, to access plugins you will never have to search in two places. - -This repo can be used as a stand-alone, by adding it to your inputs. -However, we recommend to use [NixNeovim](https://github.com/NixNeovim/NixNeovim) modules instead, and use this only when you need a plugins, which does not have a module, yet. - -## Available plugins - -The [plugins.md](plugins.md) contains an auto-generated list of all available plugins. - -## Usage - -- We recommend using [NixNeovim](https://github.com/NixNeovim/NixNeovim), and only access the plugins directly when they do not have a module in NixNeovim. - -However, you can also use this repo without NixNeovim: -To access the plugins, you need to add the overlay. -The overlay adds extra Vim plugins to `pkgs.vimExtraPlugins`. -First, add this repo to your inputs: - -``` -inputs.nixneovimplugins.url = github:jooooscha/nixpkgs-vim-extra-plugins -``` - -Next, apply the provided overlay: - -``` -nixpkgs.overlays = [ - inputs.nixneovimplugins.overlays.default -]; -``` - -Finally, you can add the packages to your vim/neovim config. For example you can use [NixNeovim](https://github.com/NixNeovim/Nixneovim) or you can add the plugins directly: - -``` - programs.neovim = { - plugins = [ - pkgs.vimExtraPlugins.nvim-colorizer-lua - ]; - } -``` - -More info on using neovim with nix can be found here: [NixOS Neovim](https://nixos.wiki/wiki/Neovim) - -## Contribution - -### How to add a new plugin - -#### 1. Add the plugin to manifest.txt: - -``` -# Examples - -haringsrob/nvim_context_vt -sourcehut:henriquehbr/ataraxis.lua -gitlab:yorickpeterse/nvim-pqf -williamboman/mason.nvim:45b9a4da776d9fb017960b3ac7241161fb7bc578 -foo/bar::baz --> renamed to baz -foo/bar:dev --> using dev branch -``` - -Supported are Github (default), SourceHut, and GitLab. - -#### 2. Create a Pull Request - -- Create a pull request with the changed manifest.txt (and blacklist.txt if neccessary). -- A GitHub action will check your contribution and generate all neccessary nix code for your new plugin. It will also take care of sorting and cleaning the manifest.txt -- After all checks have passed, I will merge your change. - -I am happy for any contribution. :) - -### How to remove a new plugin - -Copy the entry from manifest.txt to blacklist.txt and create a PR. -The GitHub Actions will do the rest, including removing the entry from manifest.txt - -## Credits - -This is originally based on work by [m15a](https://github.com/m15a/nixpkgs-vim-extra-plugins) - -[0]: https://github.com/rockerBOO/awesome-neovim diff --git a/pkgs/by-name/vi/vimExtraPlugins/check.nix b/pkgs/by-name/vi/vimExtraPlugins/check.nix deleted file mode 100644 index ad23e2c7..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/check.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - # checks if a plugin has a license - hasLicense = _: pkg: let - warn = x: lib.warn x x; - - msg = - if builtins.hasAttr "license" pkg.meta - then "${pkg.name} has license" - else warn "${pkg.name} has no license"; - - msg' = lib.replaceStrings [" "] ["-"] msg; - in - pkgs.runCommandNoCC msg' {} "echo : > $out "; - - # function to check License for all packages - check-missing-licenses = let - buildInputs = - lib.mapAttrsToList - hasLicense - pkgs.vimExtraPlugins; - in - pkgs.runCommandNoCC - "check-missing-licenses" - {inherit buildInputs;} - "echo : > $out"; -in { - checks = - pkgs.vimExtraPlugins - // { - inherit check-missing-licenses; - inherit (pkgs) update-vim-plugins; - }; -} diff --git a/pkgs/by-name/vi/vimExtraPlugins/overrides.nix b/pkgs/by-name/vi/vimExtraPlugins/overrides.nix deleted file mode 100644 index e03a78b1..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/overrides.nix +++ /dev/null @@ -1,34 +0,0 @@ -final: prev: let - inherit (final) lib; - - /* - * Mark broken packages here. - */ - markBrokenPackages = self: super: - lib.mapAttrs (attrName: broken: - super.${attrName}.overrideAttrs (old: { - meta = old.meta // {inherit broken;}; - })) - { - # <name> = true; - }; - - /* - * Add licenses if missing or incorrect in generated ./pkgs/vim-plugins.nix. - */ - fixLicenses = self: super: - lib.mapAttrs (attrName: license: - super.${attrName}.overrideAttrs (old: { - meta = old.meta // {inherit license;}; - })) (with lib.licenses; { - /* - * Example: - * plugin-name = [<licenses>] - */ - }); -in { - vimExtraPlugins = prev.vimExtraPlugins.extend (lib.composeManyExtensions [ - markBrokenPackages - fixLicenses - ]); -} diff --git a/pkgs/by-name/vi/vimExtraPlugins/package.nix b/pkgs/by-name/vi/vimExtraPlugins/package.nix deleted file mode 100644 index e2e4a117..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/package.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - fetchurl, - fetchgit, - vimUtils, -}: let - origin = import ./plugins { - inherit - (vimUtils) - buildVimPlugin - ; - inherit - lib - fetchurl - fetchgit - ; - }; -in - origin diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json b/pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json deleted file mode 100644 index b080b069..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ThePrimeagen/harpoon:master": "{\"description\": \"\", \"homepage\": \"https://github.com/ThePrimeagen/harpoon\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"harpoon\", \"owner\": \"ThePrimeagen\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1pzj8wgzskv2pq9576clisjazcgi0f8w1bmsfy6c3lr69qdcpkwi\", \"url\": \"https://github.com/ThePrimeagen/harpoon/archive/1bc17e3e42ea3c46b33c0bbad6a880792692a1b3.tar.gz\"}, \"source_line\": \"ThePrimeagen/harpoon:master\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gIHQ==\"]], \"py/object\": \"datetime.date\"}}", - "akinsho/toggleterm.nvim": "{\"description\": \"A neovim lua plugin to help easily manage multiple terminal windows\", \"homepage\": \"https://github.com/akinsho/toggleterm.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"gpl3Only\"]}]}, \"name\": \"toggleterm-nvim\", \"owner\": \"akinsho\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"0nx69q9597vy7lzvvh58fnjyin23ns6apmyp532sgf547bw7mld6\", \"url\": \"https://github.com/akinsho/toggleterm.nvim/archive/cbd041d91b90cd3c02df03fe6133208888f8e008.tar.gz\"}, \"source_line\": \"akinsho/toggleterm.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cMBg==\"]], \"py/object\": \"datetime.date\"}}", - "andrewferrier/debugprint.nvim": "{\"description\": \"Debugging in NeoVim the print() way!\", \"homepage\": \"https://github.com/andrewferrier/debugprint.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"debugprint-nvim\", \"owner\": \"andrewferrier\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"06r1jhx7jd15q8wvnw0xqwk3bkx39pm4pbv70hf9ggd6zsnmsrmn\", \"url\": \"https://github.com/andrewferrier/debugprint.nvim/archive/54297dd0a4f318b279a1cb954e7714f3942df123.tar.gz\"}, \"source_line\": \"andrewferrier/debugprint.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gDHQ==\"]], \"py/object\": \"datetime.date\"}}", - "lmburns/lf.nvim": "{\"description\": \"Lf file manager for Neovim (in Lua)\", \"homepage\": \"https://github.com/lmburns/lf.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"lf-nvim\", \"owner\": \"lmburns\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1nwf90bnzqhlgs007gg6xpx0vf4r1d19586nld78ipi1ch7nz4px\", \"url\": \"https://github.com/lmburns/lf.nvim/archive/69ab1efcffee6928bf68ac9bd0c016464d9b2c8b.tar.gz\"}, \"source_line\": \"lmburns/lf.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cKAw==\"]], \"py/object\": \"datetime.date\"}}", - "nvim-telescope/telescope-bibtex.nvim": "{\"description\": \"A telescope.nvim extension to search and paste bibtex entries into your TeX files.\", \"homepage\": \"https://github.com/nvim-telescope/telescope-bibtex.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"telescope-bibtex-nvim\", \"owner\": \"nvim-telescope\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1sd6p8cvv3dckgrhc7grlyfcibjxhxbfyh0w7p5m4mdcazhy1kqs\", \"url\": \"https://github.com/nvim-telescope/telescope-bibtex.nvim/archive/289a6f86ebec06e8ae1590533b732b9981d84900.tar.gz\"}, \"source_line\": \"nvim-telescope/telescope-bibtex.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gDHA==\"]], \"py/object\": \"datetime.date\"}}" -} \ No newline at end of file diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt b/pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt deleted file mode 100644 index 8b137891..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix b/pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix deleted file mode 100644 index 59c08c5e..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - lib, - buildVimPlugin, - fetchurl, - fetchgit, -}: { - /* - Generated from: lmburns/lf.nvim - */ - lf-nvim = buildVimPlugin { - pname = "lf-nvim"; - version = "2023-10-03"; - src = fetchurl { - url = "https://github.com/lmburns/lf.nvim/archive/69ab1efcffee6928bf68ac9bd0c016464d9b2c8b.tar.gz"; - sha256 = "1nwf90bnzqhlgs007gg6xpx0vf4r1d19586nld78ipi1ch7nz4px"; - }; - meta = with lib; { - description = "Lf file manager for Neovim (in Lua)"; - homepage = "https://github.com/lmburns/lf.nvim"; - license = with licenses; [mit]; - }; - }; - /* - Generated from: nvim-telescope/telescope-bibtex.nvim - */ - telescope-bibtex-nvim = buildVimPlugin { - pname = "telescope-bibtex-nvim"; - version = "2024-03-28"; - src = fetchurl { - url = "https://github.com/nvim-telescope/telescope-bibtex.nvim/archive/289a6f86ebec06e8ae1590533b732b9981d84900.tar.gz"; - sha256 = "1sd6p8cvv3dckgrhc7grlyfcibjxhxbfyh0w7p5m4mdcazhy1kqs"; - }; - meta = with lib; { - description = "A telescope.nvim extension to search and paste bibtex entries into your TeX files."; - homepage = "https://github.com/nvim-telescope/telescope-bibtex.nvim"; - license = with licenses; [mit]; - }; - }; -} diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt b/pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt deleted file mode 100644 index 02333b9a..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -lmburns/lf.nvim -nvim-telescope/telescope-bibtex.nvim diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md b/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md deleted file mode 100644 index bc620f4e..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md +++ /dev/null @@ -1,6 +0,0 @@ -- Plugin count: 2 - -| Repo | Last Update | Nix package name | Last checked | -|:---|:---|:---|:---| -| [lmburns/lf.nvim](https://github.com/lmburns/lf.nvim) | 2023-10-03 | `lf-nvim` | 2025-01-29 | -| [nvim-telescope/telescope-bibtex.nvim](https://github.com/nvim-telescope/telescope-bibtex.nvim) | 2024-03-28 | `telescope-bibtex-nvim` | 2025-01-29 | diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/whitelist.txt b/pkgs/by-name/vi/vimExtraPlugins/plugins/whitelist.txt deleted file mode 100644 index e69de29b..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/plugins/whitelist.txt +++ /dev/null diff --git a/pkgs/by-name/vi/vimExtraPlugins/update.sh b/pkgs/by-name/vi/vimExtraPlugins/update.sh deleted file mode 100755 index 6a0d3452..00000000 --- a/pkgs/by-name/vi/vimExtraPlugins/update.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env sh - -BASE_DIR="$(readlink -f "$(dirname "$0")/plugins")" - -# Fetch plugins -cd "$BASE_DIR" || (echo "BUG: No '$BASE_DIR'" && exit 1) - -# Cleanup manifest -sort -o "$BASE_DIR/manifest.txt" "$BASE_DIR/manifest.txt" -sort -o "$BASE_DIR/blacklist.txt" "$BASE_DIR/blacklist.txt" -## Remove all plugins, which are on the blacklist -# The same file is read and written to -# shellcheck disable=SC2005 -echo "$(comm -23 "$BASE_DIR/manifest.txt" "$BASE_DIR/blacklist.txt")" >"$BASE_DIR/manifest.txt" - -# Backup vim-plugins.nix -mv "$BASE_DIR/default.nix" "$BASE_DIR/default.nix.bak" -echo "{...} : {}" >"$BASE_DIR/default.nix" - -# Generate derivations for new plugins (this binary is provided by the dev-environment) -update-vim-plugins cleanup "$BASE_DIR" - -# Restore vim-plugins.nix -mv "$BASE_DIR/default.nix.bak" "$BASE_DIR/default.nix" - -# Update new plugins -update-vim-plugins update "$BASE_DIR" --all diff --git a/pkgs/by-name/vi/virsh-del/package.nix b/pkgs/by-name/vi/virsh-del/package.nix deleted file mode 100644 index 3f27e2be..00000000 --- a/pkgs/by-name/vi/virsh-del/package.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - sysLib, - libvirt, -}: -sysLib.writeShellScript { - name = "virsh-del"; - src = ./virsh-del.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ - libvirt - ]; -} diff --git a/pkgs/by-name/vi/virsh-del/virsh-del.sh b/pkgs/by-name/vi/virsh-del/virsh-del.sh deleted file mode 100755 index c3de5484..00000000 --- a/pkgs/by-name/vi/virsh-del/virsh-del.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -virsh destroy "$1" -virsh undefine "$1" --nvram -virsh vol-delete --pool default "$1".qcow2 - -# vim: ft=sh diff --git a/pkgs/by-name/ya/yambar-modules/.envrc b/pkgs/by-name/ya/yambar-modules/.envrc deleted file mode 100644 index 2f9f1a81..00000000 --- a/pkgs/by-name/ya/yambar-modules/.envrc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -use flake diff --git a/pkgs/by-name/ya/yambar-modules/.gitignore b/pkgs/by-name/ya/yambar-modules/.gitignore deleted file mode 100644 index ea8c4bf7..00000000 --- a/pkgs/by-name/ya/yambar-modules/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/pkgs/by-name/ya/yambar-modules/Cargo.lock b/pkgs/by-name/ya/yambar-modules/Cargo.lock deleted file mode 100644 index 6b689d29..00000000 --- a/pkgs/by-name/ya/yambar-modules/Cargo.lock +++ /dev/null @@ -1,131 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "libc" -version = "0.2.167" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" - -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "sysinfo" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" -dependencies = [ - "cfg-if", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "rayon", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "yambar-modules" -version = "0.1.0" -dependencies = [ - "sysinfo", -] diff --git a/pkgs/by-name/ya/yambar-modules/Cargo.toml b/pkgs/by-name/ya/yambar-modules/Cargo.toml deleted file mode 100644 index 8e3995fe..00000000 --- a/pkgs/by-name/ya/yambar-modules/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "yambar-modules" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -sysinfo = "0.28.4" diff --git a/pkgs/by-name/ya/yambar-modules/flake.lock b/pkgs/by-name/ya/yambar-modules/flake.lock deleted file mode 100644 index 8043448e..00000000 --- a/pkgs/by-name/ya/yambar-modules/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1732617236, - "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/by-name/ya/yambar-modules/flake.nix b/pkgs/by-name/ya/yambar-modules/flake.nix deleted file mode 100644 index e3d0cd49..00000000 --- a/pkgs/by-name/ya/yambar-modules/flake.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - description = "Extension modules for yambar(1)"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - nixpkgs, - flake-utils, - ... - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = nixpkgs.legacyPackages."${system}"; - in { - devShells.default = pkgs.mkShell { - packages = with pkgs; [ - # rust stuff - cargo - clippy - rustc - rustfmt - - cargo-edit - cargo-expand - ]; - }; - }); -} -# vim: ts=2 - diff --git a/pkgs/by-name/ya/yambar-modules/package.nix b/pkgs/by-name/ya/yambar-modules/package.nix deleted file mode 100644 index 79281429..00000000 --- a/pkgs/by-name/ya/yambar-modules/package.nix +++ /dev/null @@ -1,14 +0,0 @@ -{rustPlatform}: -rustPlatform.buildRustPackage { - pname = "yambar-modules"; - version = "0.1.0"; - - src = ./.; - cargoLock = { - lockFile = ./Cargo.lock; - }; - - meta = { - mainProgram = "yambar-modules"; - }; -} diff --git a/pkgs/by-name/ya/yambar-modules/src/cpu.rs b/pkgs/by-name/ya/yambar-modules/src/cpu.rs deleted file mode 100644 index 5a6dd084..00000000 --- a/pkgs/by-name/ya/yambar-modules/src/cpu.rs +++ /dev/null @@ -1,21 +0,0 @@ -use std::{thread, time::Duration}; - -use sysinfo::{CpuExt, System, SystemExt}; - -pub fn cpu() { - let mut sys = System::new(); - - loop { - sys.refresh_cpu(); - let cpu_usage: f32 = sys.cpus().iter().map(|cpu| cpu.cpu_usage()).sum(); - println!( - "cpu|range:0-100|{:.0}", - cpu_usage / sys.cpus().iter().count() as f32 - ); - println!(); - - // Sleeping to give the system time to run for long - // enough to have useful information. - thread::sleep(Duration::from_secs(3)); - } -} diff --git a/pkgs/by-name/ya/yambar-modules/src/main.rs b/pkgs/by-name/ya/yambar-modules/src/main.rs deleted file mode 100644 index 315c3be7..00000000 --- a/pkgs/by-name/ya/yambar-modules/src/main.rs +++ /dev/null @@ -1,26 +0,0 @@ -use std::{env::args, process}; - -mod cpu; -mod memory; - -fn main() { - let args: Vec<String> = args().collect(); - - if args.len() != 2 { - eprintln!("Usage: yambar-modules cpu|memory"); - process::exit(1); - } - - match args[1].as_str() { - "cpu" => { - cpu::cpu(); - } - "memory" => { - memory::memory(); - } - other => { - eprintln!("'{other}' is not a valid command. Only 'cpu' or 'memory'."); - process::exit(1); - } - } -} diff --git a/pkgs/by-name/ya/yambar-modules/src/memory.rs b/pkgs/by-name/ya/yambar-modules/src/memory.rs deleted file mode 100644 index 6da714cc..00000000 --- a/pkgs/by-name/ya/yambar-modules/src/memory.rs +++ /dev/null @@ -1,29 +0,0 @@ -use std::{thread, time::Duration}; - -use sysinfo::{System, SystemExt}; - -pub fn memory() { - let mut sys = System::new(); - - loop { - sys.refresh_memory(); - - let memory_percentage: f64 = - 100 as f64 * (sys.used_memory() as f64 / sys.total_memory() as f64); - - println!("memperc|string|{:.0}", memory_percentage); - if sys.total_swap() > 0 { - let swap_percentage: f64 = - 100 as f64 * (sys.used_swap() as f64 / sys.total_swap() as f64); - println!("swapperc|string|{:.0}", swap_percentage); - println!("swapstate|bool|true"); - } else { - println!("swapstate|bool|false"); - } - println!(""); - - // Sleeping to give the system time to run for long - // enough to have useful information. - thread::sleep(Duration::from_secs(3)); - } -} diff --git a/pkgs/by-name/yt/yt/package.nix b/pkgs/by-name/yt/yt/package.nix index 90a70473..63a37a47 100644 --- a/pkgs/by-name/yt/yt/package.nix +++ b/pkgs/by-name/yt/yt/package.nix @@ -1,38 +1,71 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { + lib, + rustPlatform, + installShellFiles, fetchgit, - ffmpeg, gitUpdater, - glibc, - lib, - llvmPackages_latest, - makeWrapper, + # buildInputs mpv-unwrapped, + python3Packages, python3, - rustPlatform, + ffmpeg, + openssl, + libffi, + zlib, + curl, + # NativeBuildInputs + makeWrapper, + llvmPackages_latest, + glibc, + mold-wrapped, sqlite, - blake3, + fd, + pkg-config, + SDL2, }: let - version = "1.4.1"; - - src = fetchgit { - url = "https://git.foss-syndicate.org/bpeetz/clients/yt"; - rev = "v${version}"; - hash = "sha256-Zuc3hrhvYdz2ktQhfMcLX7E5W/ZneMMLJ6+CoJ/JZMs="; - }; - - buildInputs = [ - (python3.withPackages (ps: [ps.yt-dlp blake3])) - mpv-unwrapped.dev - ffmpeg - ]; + version = "1.7.1"; in - rustPlatform.buildRustPackage { - inherit version src buildInputs; + rustPlatform.buildRustPackage (finalAttrs: { + inherit version; pname = "yt"; + src = fetchgit { + url = "https://git.foss-syndicate.org/bpeetz/clients/yt"; + tag = "v${version}"; + hash = "sha256-FKEMbxJI7OOXakY/JMyoz1rVU57xPuJ49m/JsB2b5Cc="; + }; + + buildInputs = [ + python3Packages.yt-dlp + mpv-unwrapped.dev + ffmpeg + openssl + libffi + zlib + curl.dev + ]; + nativeBuildInputs = [ + installShellFiles makeWrapper sqlite + fd + pkg-config + mold-wrapped + ]; + + checkInputs = [ + # Needed for the tests in `libmpv2` + SDL2 ]; passthru.updateScript = gitUpdater {rev-prefix = "v";}; @@ -42,32 +75,56 @@ in lib.versions.major llvmPackages_latest.clang-unwrapped.version; in { + # Needed for the compile time sqlite checks. + DATABASE_URL = "sqlite://database.sqlx"; + + # Required by yt_dlp FFMPEG_LOCATION = "${lib.getExe ffmpeg}"; - PYO3_PYTHON = lib.getExe (python3.withPackages (ps: [ps.yt-dlp])); + # Needed for the libmpv2. C_INCLUDE_PATH = "${glibc.dev}/include"; - DATABASE_URL = "sqlite://target/database.sqlite"; LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include"; LIBCLANG_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so"; }; - # Some tests depend on network access, others require a special library. - doCheck = false; + doCheck = true; prePatch = '' - echo "$PATH" + # Generate the sqlite db, so that we can run the comp-time sqlite checks. bash ./scripts/mkdb.sh ''; - cargoHash = "sha256-QIAZb8twLxLm3TJOtb++pTWz98v49pt13auAEAeYFSk="; + cargoHash = "sha256-E5kMlXIoagidovGonTqbz9SMmvgKitJ9+zZW9U8WK7s="; - postBuild = '' - install -m755 ./python_update/raw_update.py -D "$out/bin/raw_update.py" - patchShebangs "$out/bin/raw_update.py" - ''; + postInstall = let + collectDeps = pkg: let + next = pkg.propagatedBuildInputs or []; + in + [pkg] + ++ next + ++ (lib.flatten (builtins.map collectDeps next)); + + loadPythonDep = der: "${der}/lib/python${lib.versions.majorMinor python3.version}/site-packages"; + + pythonPath = builtins.concatStringsSep ":" (lib.lists.unique ( + builtins.map loadPythonDep ( + (collectDeps python3Packages.yt-dlp) + ++ [ + # HACK(@bpeetz): These packages are not picked up in the traversal up top. <2025-06-16> + python3Packages.chardet + ] + ) + )); + in '' + installShellCompletion --cmd yt \ + --bash <(COMPLETE=bash $out/bin/yt) \ + --fish <(COMPLETE=fish $out/bin/yt) \ + --zsh <(COMPLETE=zsh $out/bin/yt) - postInstall = '' + # NOTE: We cannot clear the path, because we need access to the $EDITOR. <2025-04-04> wrapProgram $out/bin/yt \ - --prefix PATH : ${lib.makeBinPath buildInputs}:$out/bin + --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs} \ + --set YTDLP_NO_PLUGINS 1 \ + --set PYTHONPATH ${pythonPath} ''; - } + }) diff --git a/pkgs/by-name/yt/yti/package.nix b/pkgs/by-name/yt/yti/package.nix deleted file mode 100644 index 5a39512a..00000000 --- a/pkgs/by-name/yt/yti/package.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - sysLib, - gawk, - expect, - yt-dlp, -}: -sysLib.writeShellScript { - name = "yti"; - src = ./yti.sh; - generateCompletions = false; - keepPath = false; - dependencies = [ - gawk - expect - yt-dlp - ]; -} diff --git a/pkgs/by-name/yt/yti/yti.sh b/pkgs/by-name/yt/yti/yti.sh deleted file mode 100755 index a69ffa74..00000000 --- a/pkgs/by-name/yt/yti/yti.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -DOWN_DIR=/home/soispha/media/music/down/youtube - -tmp=$(mktmp) -config=$(mktmp) - -for e in "$DOWN_DIR"/*.opus; do echo "$e" >>"$tmp"; done -[ "$(wc -l "$tmp" | awk '{print $1}')" -gt 2 ] && die "something is already downloaded" - -cat <<EO >"$config" ---paths home:"$DOWN_DIR" -#--output %(fulltitle) ---restrict-filenames ---no-overwrites ---no-write-info-json ---clean-info-json ---prefer-free-formats -#--format mp3 ---extract-audio ---audio-quality 0 ---audio-format best -EO - -rm "$DOWN_DIR/yt-dlp.log" -cd "$DOWN_DIR" || die "BUG: no $DOWN_DIR" - -unbuffer yt-dlp --config-location "$config" "$1" | tee "$DOWN_DIR/yt-dlp.log" - -# vim: ft=sh diff --git a/pkgs/default.nix b/pkgs/default.nix index 41bb654f..9a3ac842 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,23 +1,21 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, - sysLib, - nixLib, + libraries, }: let inherit (pkgs) lib; - maybeMergeMessage = "the ./pkgs/by-name set"; - mMM = maybeMergeMessage; - callPackage = - lib.callPackageWith - (nixLib.warnMerge - (nixLib.warnMerge - pkgs - myPkgs - mMM) - {inherit sysLib;} - mMM); + callPackage = lib.callPackageWith (libraries.extra.warnMerge pkgs myPkgs "the ./pkgs/by-name set"); - myPkgs = nixLib.mkByName { + myPkgs = libraries.extra.mkByName { baseDirectory = ./by-name; fileName = "package.nix"; finalizeFunction = name: value: callPackage value {}; diff --git a/pkgs/update_pkgs.sh b/pkgs/update_pkgs.sh index 3e33b720..d046ee76 100755 --- a/pkgs/update_pkgs.sh +++ b/pkgs/update_pkgs.sh @@ -1,5 +1,15 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + die() { printf "\033[31;1mError: \033[0m%s\n" "$1" exit 1 diff --git a/secrets.nix b/secrets.nix index d64f99c3..fc5a9249 100644 --- a/secrets.nix +++ b/secrets.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. let soispha = "age1mshh4ynzhhzhff25tqwkg4j054g3xwrfznh98ycchludj9wjj48qn2uffn"; @@ -6,11 +15,12 @@ let in { "modules/by-name/at/atuin/secrets/encryption_key.age".publicKeys = [soispha tiamat apzu]; + "modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age".publicKeys = [soispha tiamat apzu]; + + "modules/by-name/ba/backup/secrets/storagebox/ssh_key.age".publicKeys = [soispha tiamat apzu]; + "modules/by-name/ba/backup/secrets/storagebox/repository_password.age".publicKeys = [soispha tiamat apzu]; + "modules/by-name/ba/backup/secrets/local/repository_password.age".publicKeys = [soispha tiamat apzu]; + "modules/by-name/se/serverphone/private_keys/ca.key".publicKeys = [soispha tiamat apzu]; "modules/by-name/se/serverphone/private_keys/server.key".publicKeys = [soispha tiamat apzu]; - - "modules/by-name/ta/taskwarrior/secrets/private.key".publicKeys = [soispha tiamat apzu]; - "modules/by-name/ta/taskwarrior/secrets/public.cert".publicKeys = [soispha tiamat apzu]; - "modules/by-name/ta/taskwarrior/secrets/ca.cert".publicKeys = [soispha tiamat apzu]; - "modules/by-name/ta/taskwarrior/secrets/credentials".publicKeys = [soispha tiamat apzu]; } diff --git a/tests/README.md b/tests/README.md index f789c990..34dc9255 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,18 @@ +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + # How to write a test -Test are simple derivations, put into the `by-name` directory. As you +Test are simple derivations, put into the `by-name` directory. As you often want to test configuration, the 'standard' nixos-vm-test function starts a vm with the specified configuration and lets you run a python test script. @@ -78,7 +90,7 @@ Sleep for `ARGS` seconds. #### `Expect` -Grep the currently visible screen for the regex `ARGS`. This regex +Grep the currently visible screen for the regex `ARGS`. This regex must match. #### `ExpectNot` diff --git a/tests/by-name/le/less/data/test.file.license b/tests/by-name/le/less/data/test.file.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/le/less/data/test.file.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/le/less/test.desc.license b/tests/by-name/le/less/test.desc.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/le/less/test.desc.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/le/less/test.nix b/tests/by-name/le/less/test.nix index cdd8209c..c9716ffc 100644 --- a/tests/by-name/le/less/test.nix +++ b/tests/by-name/le/less/test.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {mkTest, ...}: mkTest { name = "less"; diff --git a/tests/by-name/nv/nvim-checkhealth/test.desc.license b/tests/by-name/nv/nvim-checkhealth/test.desc.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/nv/nvim-checkhealth/test.desc.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/nv/nvim-checkhealth/test.nix b/tests/by-name/nv/nvim-checkhealth/test.nix index 399a25ff..cb04e758 100644 --- a/tests/by-name/nv/nvim-checkhealth/test.nix +++ b/tests/by-name/nv/nvim-checkhealth/test.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { mkTest, extraModules, diff --git a/tests/by-name/nv/nvim-neorg/data/index.norg.license b/tests/by-name/nv/nvim-neorg/data/index.norg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/nv/nvim-neorg/data/index.norg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/nv/nvim-neorg/data/reference.norg.license b/tests/by-name/nv/nvim-neorg/data/reference.norg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/nv/nvim-neorg/data/reference.norg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/nv/nvim-neorg/test.desc b/tests/by-name/nv/nvim-neorg/test.desc index bd7b7312..bd1e8f49 100644 --- a/tests/by-name/nv/nvim-neorg/test.desc +++ b/tests/by-name/nv/nvim-neorg/test.desc @@ -61,7 +61,7 @@ Sleep 0.5 Type 10t -Sleep 0.5 +Sleep 1.0 Expect ^11\s*◉ Some other content$ diff --git a/tests/by-name/nv/nvim-neorg/test.desc.license b/tests/by-name/nv/nvim-neorg/test.desc.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/nv/nvim-neorg/test.desc.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/nv/nvim-neorg/test.nix b/tests/by-name/nv/nvim-neorg/test.nix index ee0e1b52..9f160df5 100644 --- a/tests/by-name/nv/nvim-neorg/test.nix +++ b/tests/by-name/nv/nvim-neorg/test.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { mkTest, extraModules, diff --git a/tests/by-name/ya/yambar/test.desc.license b/tests/by-name/ya/yambar/test.desc.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/tests/by-name/ya/yambar/test.desc.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/tests/by-name/ya/yambar/test.nix b/tests/by-name/ya/yambar/test.nix index c0e94110..0e4d0033 100644 --- a/tests/by-name/ya/yambar/test.nix +++ b/tests/by-name/ya/yambar/test.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {mkTest, ...}: mkTest { name = "yambar"; diff --git a/tests/default.nix b/tests/default.nix index c36a5906..d13723b4 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, nixLib, @@ -6,6 +15,8 @@ nixpkgs_as_input, sysLib, extraModules, + nixpkgs_open_prs, + system, }: let mkTest = import ./infrastructure { inherit @@ -15,6 +26,8 @@ myPkgs extraModules sysLib + nixpkgs_open_prs + system ; }; diff --git a/tests/infrastructure/clean.awk b/tests/infrastructure/clean.awk index 1208b1ef..0362d38b 100644 --- a/tests/infrastructure/clean.awk +++ b/tests/infrastructure/clean.awk @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + { # Shell like comments gsub(/^#.*$/, "", $0) diff --git a/tests/infrastructure/default.nix b/tests/infrastructure/default.nix index e0ad6889..cd21198c 100644 --- a/tests/infrastructure/default.nix +++ b/tests/infrastructure/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, myPkgs, @@ -5,7 +14,8 @@ nixos-lib, extraModules, sysLib, - ... + nixpkgs_open_prs, + system, }: { name, configuration, @@ -22,7 +32,12 @@ nixos-lib.runTest { node = { specialArgs = { - inherit myPkgs sysLib; + inherit + myPkgs + sysLib + nixpkgs_open_prs + system + ; }; # Use the nixpkgs as constructed by the `nixpkgs.*` options pkgs = null; diff --git a/tests/infrastructure/driver.sh b/tests/infrastructure/driver.sh index 4992b5bc..a8b241d2 100644 --- a/tests/infrastructure/driver.sh +++ b/tests/infrastructure/driver.sh @@ -1,4 +1,15 @@ #! /usr/bin/env bash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + set -e msg() { diff --git a/tests/infrastructure/run.nix b/tests/infrastructure/run.nix index 5bab3dc4..3148a2d9 100644 --- a/tests/infrastructure/run.nix +++ b/tests/infrastructure/run.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/update.sh b/update.sh index 77cb9482..8f7d338e 100755 --- a/update.sh +++ b/update.sh @@ -1,18 +1,32 @@ #!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + __update_sh_run() { __update_sh_command="$1" shift 1 - printf "\033[35;1m> \033[0m\033[35;1m%s\033[0m\n" "Running '$(basename "$__update_sh_command")' .." + printf "\033[35;1m> \033[0m\033[35;1m%s\033[0m\n" "Running '$(basename "$__update_sh_command") $*' .." "$__update_sh_command" "$@" unset __update_sh_command } -__update_sh_run ./modules/home.legacy/conf/firefox/scripts/update_extensions.sh "$@" +__update_sh_run nix flake update __update_sh_run ./pkgs/update_pkgs.sh "$@" -echo "Also update out-of tree dependencies, like yt!" 2>&1 +# __update_sh_run nix flake check +__update_sh_run ./build.sh + +printf "\033[31;1m%s\033[0m\033[33;1m%s\033[0m\n" "Also update out-of-tree dependencies, like " "yt" 2>&1 # vim: ft=sh |