From 49eb199550c2acb4e1a9dc8bd2f6c67bebec0d32 Mon Sep 17 00:00:00 2001 From: Adam0 Date: Wed, 06 May 2026 22:52:13 +0000 Subject: [PATCH] dendritic migration 2026-05-06 --- LICENSE | 661 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 89 ----------------------------------------------------------------------------------------- THIRD_PARTY_NOTICES.md | 37 ------------------------------------- flake.lock | 463 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 32 ++++++++++++++++++++++++++++++-- plan.md | 205 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- todo.md | 19 ++++++++++--------- modules/devshell.nix | 18 ++++++++++++++++++ modules/treefmt.nix | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/desktop/tuigreet.nix | 10 +++++++--- modules/nix/determinate.nix | 11 +++++------ modules/nix/home-manager.nix | 6 ++++-- modules/nix/sops.nix | 8 ++++++-- modules/nix/vars.nix | 4 ++-- modules/profiles/personal.nix | 23 +++++++++++++++++++++++ modules/profiles/slim.nix | 40 ---------------------------------------- modules/profiles/tweaks.nix | 182 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- modules/services/flatpak.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ modules/pkgs/os-age/default.nix | 9 +++++++++ modules/pkgs/os-age/os-age.nix | 16 ++++++++++++++++ modules/pkgs/ripgrep-all-adapters/default.nix | 15 +++++++++++++++ modules/pkgs/ripgrep-all-adapters/djvutorga-adapter.nix | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/pkgs/ripgrep-all-adapters/pptx2md-adapter.nix | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/profiles/common/slim.nix | 40 ++++++++++++++++++++++++++++++++++++++++ modules/profiles/common/tweaks.nix | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/programs/cli/bat.nix | 17 +++++++++++++++-- modules/programs/cli/bun.nix | 41 +++++++++++++++++++++++++++++++++++++++++ modules/programs/cli/fastfetch.nix | 395 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- modules/programs/cli/gitfetch.nix | 13 +++++++++++++ modules/programs/cli/nix-index.nix | 17 +++++++++++++++++ modules/programs/cli/onefetch.nix | 13 +++++++++++++ modules/programs/cli/sshfs.nix | 5 +++++ modules/programs/cli/ripgrep-all/adapters.nix | 36 ++++++++++++++++++++++++++++++++++++ modules/programs/cli/ripgrep-all/default.nix | 5 +++++ modules/programs/cli/ripgrep-all/adapters/gron.nix | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/programs/cli/ripgrep-all/adapters/other.nix | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 36 file(s) changed, 2190 insertion(s)(+), 781 deletion(s)(-) diff --git a/LICENSE b/LICENSE new file mode 100644 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are 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. + + 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. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + 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 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 work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero 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 Affero 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 Affero 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 Affero 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. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + 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 AGPL, see +. diff --git a/README.md b/README.md deleted file mode 100644 --- a/README.md +++ /dev/null @@ -1,89 +0,0 @@ -
- Avatar - Nix logo - - # adam0's NixOS configuration - - Modular multi-host NixOS and Home Manager flake for desktop, laptop, and virtual machine systems. - - [![CI](https://img.shields.io/github/actions/workflow/status/adam01110/nixos/ci.yml?branch=main&style=flat-square&label=CI&labelColor=504945&color=cc241d)](https://github.com/adam01110/nixos/actions/workflows/ci.yml) - [![Repo Size](https://img.shields.io/github/repo-size/adam01110/nixos?style=flat-square&label=repo%20size&labelColor=504945&color=3c3836)](https://github.com/adam01110/nixos) -
- [![NixOS](https://img.shields.io/badge/NixOS-unstable-458588?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://nixos.org) - [![Flakes](https://img.shields.io/badge/Nix-flakes-689d6a?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://nixos.wiki/wiki/Flakes) - [![Home Manager](https://img.shields.io/badge/Home%20Manager-managed-b16286?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/nix-community/home-manager) - [![Stylix](https://img.shields.io/badge/Stylix-theming-8f3f71?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/danth/stylix) - [![SOPS Nix](https://img.shields.io/badge/SOPS%20Nix-secrets-fe8019?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/Mic92/sops-nix) - [![Disko](https://img.shields.io/badge/Disko-managed%20storage-98971a?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/nix-community/disko) - [![Lanzaboote](https://img.shields.io/badge/Lanzaboote-secure%20boot-458588?style=flat-square&labelColor=504945&logo=nixos&logoColor=ebdbb2)](https://github.com/nix-community/lanzaboote) - - [Overview](#overview) - [Hosts](#hosts) - [Usage](#usage) - [Secrets](#secrets) - [Customization](#Customization) - [Tooling](#Tooling) -
- -This repository contains a personal NixOS setup built around `flake-parts`, `Home Manager`, and a heavily modular directory layout. It shares a common base across multiple machines, then layers host-specific hardware, service, and desktop overrides on top. - -## Overview - -- Shared NixOS modules under `modules/system`, Home Manager modules under `modules/home`, and per-host overrides under `modules/hosts`. -- Three flake outputs: `desktop`, `laptop`, and `vm`, all created from the same module stack in `flake/nixos.nix`. -- Declarative storage with `Disko`, encrypted secrets with `Sops-nix`, Secure Boot with `Lanzaboote`, and theming through `Stylix`. -- Desktop built on `Hyprland`, `UWSM`, `greetd` + `tuigreet`, and `Noctalia Shell`. - -## Hosts - -| Host | Purpose | Notable differences | -| --- | --- | --- | -| `desktop` | Main workstation | ROCm enabled, dual-monitor Hyprland layout, Wooting and Roccat support, AMD + Intel GPU monitoring | -| `laptop` | Mobile system | Wi-Fi, Bluetooth, TLP, SCX, lid switch handling, battery-oriented tuning, touch support | -| `vm` | QEMU/KVM guest | `/dev/vda` Disko target, SSH enabled, guest agents, simplified display setup | - -## Usage - -From the repository root: - -```bash -# Inspect flake outputs -nix flake show - -# Apply a host configuration -sudo nixos-rebuild switch --flake .#desktop - -# Format the repository -nix fmt - -# Enter the dev shell -nix develop -``` - -> [!IMPORTANT] -> The host modules point at real installation devices such as `/dev/nvme0n1` and `/dev/vda`, and the configuration expects an Age key at `/var/lib/sops-nix/key.txt`. Review `modules/hosts/*/default.nix`, `modules/system/disk.nix`, and `modules/system/sops.nix` before using this on a new machine. - -## Secrets - -- Secrets live in `secrets/secrets.yaml` and are managed with Sops-nix. -- Recipient rules are defined in `.sops.yaml` for one user key and three host Age keys. - -Edit flow: - -```bash -sops secrets/secrets.yaml -``` - -## Customization - -- Edit shared identity, locale, and Git metadata in `vars.nix`. -- Adjust host-specific hardware and service choices in `modules/hosts//`. -- Add or override shared behavior in `modules/system/` and `modules/home/`. -- Extend package selection through `pkgs/` and `overlays/`. - -## Tooling - -- Formatting and linting are wired through `treefmt` in `flake/treefmt.nix`. -- The repository uses `import-tree` extensively to auto-discover modules, overlays, and local packages. - -## Licensing - -- This repository is mixed-license. The root `LICENSE` file contains the `AGPL-3.0-or-later` text intended for original work authored for this repository, unless a file says otherwise. -- Files derived from Nixpkgs are kept under MIT-compatible treatment with upstream attribution preserved. See `pkgs/lutris.nix`, `pkgs/zaread.nix`, and `THIRD_PARTY_NOTICES.md`. -- Adapter scripts adapted from `ripgrep-all` discussion posts are marked as adapted third-party material with provenance notices. They are not being confidently relabeled as `AGPL-3.0-or-later` without a clearer relicensing basis. -- Other copied or vendored third-party material keeps its own attribution and should be reviewed under `THIRD_PARTY_NOTICES.md` rather than assumed to follow the repo default. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md deleted file mode 100644 --- a/THIRD_PARTY_NOTICES.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# Third-Party Notices - -This repository is mixed-license. - -Unless a file says otherwise, original repository code and configuration authored for this repository are intended to be licensed under `AGPL-3.0-or-later`. - -Third-party and mixed-provenance files must keep their own attribution and license treatment. - -## Derived From Nixpkgs - -These files are derived from Nixpkgs package expressions and should continue to carry Nixpkgs attribution and MIT treatment. - -| Path | Upstream | Treatment | -| --- | --- | --- | -| `pkgs/lutris.nix` | Nixpkgs `pkgs/applications/misc/lutris/fhsenv.nix` | Keep `Copyright (c) Nixpkgs contributors` and `SPDX-License-Identifier: MIT`. Do not relabel as solely AGPL. | -| `pkgs/zaread.nix` | Nixpkgs package expression for `zaread` | Keep `Copyright (c) Nixpkgs contributors` and `SPDX-License-Identifier: MIT`. Do not relabel as solely AGPL. | - -Nixpkgs is distributed under the MIT license. The required MIT notice must remain with substantial copied or adapted material from Nixpkgs. - -## Adapted From ripgrep-all Discussions - -These files were adapted from code posted in GitHub Discussions associated with `phiresky/ripgrep-all`. - -| Path | Provenance | Treatment | -| --- | --- | --- | -| `pkgs/scripts/ripgrep-all-adapters/djvutorga-adapter.nix` | `https://github.com/phiresky/ripgrep-all/discussions/166` | Keep provenance and adaptation notice. Do not assert a new SPDX identifier until the licensing basis for the discussion-posted code is confirmed. | -| `pkgs/scripts/ripgrep-all-adapters/pptx2md-adapter.nix` | `https://github.com/phiresky/ripgrep-all/discussions/199` | Keep provenance and adaptation notice. Do not assert a new SPDX identifier until the licensing basis for the discussion-posted code is confirmed. | - -The `ripgrep-all` repository itself is `AGPL-3.0-or-later`, but these snippets were copied from discussion posts rather than from the main source tree. That is not a strong enough basis, by itself, to confidently relabel the adapted copies here as `AGPL-3.0-or-later`. - -## Other Third-Party Material - -| Path | Provenance | Treatment | -| --- | --- | --- | -| `modules/home/gui/discord/themes/system24.css` | `https://github.com/refact0r/system24` | Upstream repository is MIT-licensed. Preserve existing attribution block and keep MIT notice in mind when redistributing substantial copied copies. | diff --git a/flake.lock b/flake.lock new file mode 100644 --- /dev/null +++ b/flake.lock @@ -0,0 +1,463 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1777830388, + "narHash": "sha256-2uoQAqUk2H0ijQtGiWAyNeQYGYc6yfAcRRLlJAz4Gp8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "d459c1350e96ce1a7e3859c513ef5e9869d67d6f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "determinate": { + "inputs": { + "determinate-nixd-aarch64-darwin": "determinate-nixd-aarch64-darwin", + "determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux", + "determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux", + "nix": "nix", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1777920462, + "narHash": "sha256-LcwRttYxf2u6WUQC53alL0mdEoAJjOZ3AVMVXj2SdgI=", + "rev": "f3e0ac2fd392912b6af164b61b9aeadb7a4c1ef1", + "revCount": 415, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.19.1/019df455-18df-7300-905f-4cd973ae848d/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/determinate/3" + } + }, + "determinate-nixd-aarch64-darwin": { + "flake": false, + "locked": { + "narHash": "sha256-+d0XZPSqqTSPrSMSf1Vz/ipsZhnW+p27RH0d6XywOMU=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.19.1/macOS" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.19.1/macOS" + } + }, + "determinate-nixd-aarch64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-oCCfgSQZBdiNBRolKQHap9En1JU+62pZd1M7kkvpqQ8=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.19.1/aarch64-linux" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.19.1/aarch64-linux" + } + }, + "determinate-nixd-x86_64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-F/Csmk0KQas8anb9nepMyqMptMHMoShmOljomLEK5Wo=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.19.1/x86_64-linux" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.19.1/x86_64-linux" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-file": { + "locked": { + "lastModified": 1777679829, + "narHash": "sha256-zQxY90pq7BDbeimAiOfuK2U0huzo6oHOiC8zEpRgsbQ=", + "owner": "vic", + "repo": "flake-file", + "rev": "04ca28cf570276e70a9a5f694791ab2a60f1f300", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "flake-file", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "determinate", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748821116, + "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", + "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", + "revCount": 377, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/hercules-ci/flake-parts/0.1.377%2Brev-49f0870db23e8c1ca0b5259734a02cd9e1e371a1/01972f28-554a-73f8-91f4-d488cc502f08/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777988971, + "narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": [ + "determinate", + "nix" + ], + "nixpkgs": [ + "determinate", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747372754, + "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", + "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", + "revCount": 1026, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/cachix/git-hooks.nix/0.1.1026%2Brev-80479b6ec16fefd9c1db3ea13aeb038c60530f46/0196d79a-1b35-7b8e-a021-c894fb62163d/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/cachix/git-hooks.nix/0.1.941" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778009629, + "narHash": "sha256-nUoQtf4Zq7DRYJrfv904hjrxjAlWVP6a1pNNFKx3FCg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "00ed86e58bb6979a7921859fd1615d19382eac5c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "import-tree": { + "locked": { + "lastModified": 1773693634, + "narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=", + "owner": "vic", + "repo": "import-tree", + "rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, + "nix": { + "inputs": { + "flake-parts": "flake-parts", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": "nixpkgs", + "nixpkgs-23-11": "nixpkgs-23-11", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1777918043, + "narHash": "sha256-Zl229Ynd484malKv6UPbbjIgRZHThLH3NugvUD63M6M=", + "rev": "35185ec4d4dcdfe34e08f0e48f6a66afd3b95007", + "revCount": 25846, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.19.1/019df44d-015e-7013-9fce-a0a4d4a95c7b/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/nix-src/%2A" + } + }, + "nix-flatpak": { + "locked": { + "lastModified": 1777402031, + "narHash": "sha256-6gkfl9y3+ti0Z6dgby8/R4/DRT8sWU0I0TLCIxwWtjk=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "22a3adbe7c5c8c8a10a635d32c9ef7fc01a6e4b8", + "type": "github" + }, + "original": { + "owner": "gmodena", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777787189, + "narHash": "sha256-2KUbS/HhzWW3kkkY1+RiWj9mJ76VEXw8lBJzcCFKzfY=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "2dea2b920e7127b3afa8506713f23536651de312", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773222311, + "narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=", + "rev": "0590cd39f728e129122770c029970378a79d076a", + "revCount": 909248, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2511.909248%2Brev-0590cd39f728e129122770c029970378a79d076a/019ce32b-8ace-7339-b129-cceaa8dd10c6/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2511" + } + }, + "nixpkgs-23-11": { + "locked": { + "lastModified": 1717159533, + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1776949667, + "narHash": "sha256-GMSVw35Q+294GlrTUKlx087E31z7KurReQ1YHSKp5iw=", + "rev": "01fbdeef22b76df85ea168fbfe1bfd9e63681b30", + "revCount": 985930, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.985930%2Brev-01fbdeef22b76df85ea168fbfe1bfd9e63681b30/019dd2c0-665a-7740-8096-1a0c0d7a8d1f/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1778036283, + "narHash": "sha256-GW2cEd/cLcVbbCes8iQuoY2qGIeCA7UiaD351hpkXfI=", + "rev": "ed67bc86e84e51d4a88e73c7fd36006dc876476f", + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre993032.ed67bc86e84e/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" + } + }, + "root": { + "inputs": { + "determinate": "determinate", + "flake-file": "flake-file", + "flake-parts": "flake-parts_2", + "home-manager": "home-manager", + "import-tree": "import-tree", + "nix-flatpak": "nix-flatpak", + "nix-index-database": "nix-index-database", + "nixpkgs": "nixpkgs_3", + "sops-nix": "sops-nix", + "treefmt-nix": "treefmt-nix", + "tuigreet": "tuigreet", + "zen-browser": "zen-browser" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "tuigreet", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777346187, + "narHash": "sha256-oVxyGjpiIsrXhWTJVUOs38fZQkLjd0nZGOY9K7Kfot8=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "146e7bf7569b8288f24d41d806b9f584f7cfd5b5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777944972, + "narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "c591bf665727040c6cc5cb409079acb22dcce33c", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "tuigreet": { + "inputs": { + "crane": "crane", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1777962859, + "narHash": "sha256-uQ3n+OHXOIasEireYS+zTSHzxKYZL+CRF4VSz/mA99M=", + "owner": "notashelf", + "repo": "tuigreet", + "rev": "83b2b88d72ad067be1eb8556168321c4afc45898", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "tuigreet", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777564084, + "narHash": "sha256-O9VRkxg+2j+sh+c73wi4VeIBECoqW2PlnCR9Qe1nQKA=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "d93443c0f6fdb3b179bed68856f322dba4842612", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "ref": "beta", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix --- a/flake.nix +++ b/flake.nix @@ -4,13 +4,41 @@ outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); inputs = { + determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; flake-file.url = "github:vic/flake-file"; flake-parts = { url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs-lib"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; import-tree.url = "github:vic/import-tree"; + nix-flatpak.url = "github:gmodena/nix-flatpak"; + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; - nixpkgs-lib.follows = "nixpkgs"; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + tuigreet = { + url = "github:notashelf/tuigreet"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + zen-browser = { + url = "github:0xc000022070/zen-browser-flake?ref=beta"; + inputs = { + home-manager.follows = "home-manager"; + nixpkgs.follows = "nixpkgs"; + }; + }; }; } diff --git a/plan.md b/plan.md deleted file mode 100644 --- a/plan.md +++ /dev/null @@ -1,205 +0,0 @@ -Migration Plan -flake-file: - -- flake.nix should become generated output, not hand-maintained. -- Source-of-truth lives under modules/. -- Use inputs.flake-file.flakeModules.dendritic for the dendritic setup. -- Declare inputs through flake-file.inputs, preferably close to the module that needs them. -- Generate with nix run .#write-flake after bootstrapping, or bootstrap with write-flake --arg modules ./modules. - -flake-parts: - -- Each file under modules/ should be a flake-parts module. -- Use perSystem for packages, dev shells, formatter, checks. -- Use flake.nixosConfigurations for hosts. -- Use flake.modules.nixos.* and flake.modules.homeManager.* for reusable feature/aspect modules. -- Use withSystem when host construction needs per-system packages or inputs. - -import-tree: - -- Keep it incidental. It is mainly the recursive loader behind the dendritic pattern. -- Paths prefixed with _ are ignored by import-tree. - -Target Layout -Based on the current ~/Infra template and your existing /home/adam0/Nixos structure: -~/Infra/ - assets/ - face.png - logo.png - modules/ - nix/ - dendritic.nix - inputs.nix - systems.nix - treefmt.nix - devshell.nix - hosts/ - desktop.nix - laptop.nix - vm.nix - profiles/ - base.nix - desktop.nix - laptop.nix - vm.nix - nixos/ - boot.nix - disk.nix - locale.nix - nix.nix - sops.nix - user.nix - tweaks.nix - nixos/services/ - ananicy.nix - avahi.nix - bluetooth.nix - geoclue.nix - gnome-keyring.nix - gvfs.nix - locate.nix - logind.nix - network.nix - other.nix - pipewire.nix - podman.nix - printing.nix - scx.nix - ssh.nix - timesyncd.nix - timezone.nix - tlp.nix - zram.nix - nixos/desktop/ - hyprland.nix - stylix.nix - tablet.nix - tuigreet.nix - xdg-portal.nix - nixos/gui/ - lsfg.nix - other.nix - steam.nix - virt-manager.nix - nixos/cli/ - man.nix - nh.nix - other.nix - sudo-rs.nix - home/ - base.nix - desktop.nix - laptop.nix - vm.nix - packages/ - default.nix - scripts.nix - lutris.nix - nocheatsheet-nvim.nix - telescope-all-recent-nvim.nix - zaread.nix - lib/ - default.nix - keys/ - secrets/ - vars.nix - .sops.yaml - .envrc - README.md - THIRD_PARTY_NOTICES.md -Phase 1: Bootstrap Flake-File - -1. Keep ~/Infra/flake.nix temporary until generation works. -2. Move optional inputs closer to usage later: - - Hyprland-related inputs near Hyprland modules. - - Stylix near Stylix module. - - Nixcord/spicetify/zen/noctalia near home modules. - - Kernel/boot inputs near boot modules. -Phase 2: Move Flake-Parts Infrastructure -3. Move existing /home/adam0/Nixos/flake/treefmt.nix to modules/nix/treefmt.nix. -4. Move existing /home/adam0/Nixos/flake/devshell.nix to modules/nix/devshell.nix. -5. Convert package wiring from /home/adam0/Nixos/pkgs/default.nix into modules/packages/default.nix as perSystem.packages. -6. Keep systems = import inputs.systems in a small modules/nix/systems.nix. -Phase 3: Convert NixOS Modules Into Dendritic Aspects -7. Current modules/system/*.nix files should stop being imported as one big tree. -8. Each should become a named exported module: - - flake.modules.nixos.base - - flake.modules.nixos.nix - - flake.modules.nixos.sops - - flake.modules.nixos.hyprland - - flake.modules.nixos.pipewire - - etc. -9. Preserve most module bodies as-is. The migration is mostly wrapping each module under flake.modules.nixos. = { ... };. -10. Avoid large rewrites while migrating. First goal is equivalent behavior. -Phase 4: Split Host Composition -11. Replace current mkHost style from /home/adam0/Nixos/flake/nixos.nix with one host file per host: - - modules/hosts/desktop.nix - - modules/hosts/laptop.nix - - modules/hosts/vm.nix -12. Each host file defines flake.nixosConfigurations.. -13. Each host composes modules from inputs.self.modules.nixos. -14. Host-specific hardware stays host-local. -15. Host-specific home-manager overrides move to modules/home/.nix or inline host composition. -Example composition shape: -{ - - inputs, - withSystem, - ... -}: { - - flake.nixosConfigurations.laptop = withSystem "x86_64-linux" ({config, ...}: - inputs.nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with inputs.self.modules.nixos; [ - base - nix - sops - disk - user - hyprland - pipewire - bluetooth - tlp - laptop - ]; - }); -} -Phase 5: Home-Manager Dendritic Modules - -18. Convert home-manager settings into flake.modules.homeManager.*. -19. Keep user identity defaults in one user module. -20. Move host-specific home settings from: - - modules/hosts/laptop/home.nix - - modules/hosts/vm/home.nix - - modules/hosts/desktop/home.nix -21. Compose home-manager modules from the NixOS host module through home-manager.users.${username}.imports. -Phase 6: Input Locality Cleanup -After equivalent behavior works: -22. Move hyprland, hyprland-plugins, hyprsplit, and tuigreet input declarations into desktop/Hyprland-related modules. -23. Move stylix into modules/nixos/desktop/stylix.nix. -24. Move nix-index-database into shell/CLI module. -25. Move nix-flatpak, millennium, spicetify-nix, nixcord, zen-browser, noctalia, oxicord, etc. into the feature module that consumes each input. -26. Keep only foundational inputs in modules/nix/inputs.nix. -Phase 7: Generated Flake Workflow -27. Treat flake.nix as generated. -28. Generate it from modules/ using flake-file. -29. Verify generated flake.nix contains only inputs and generated outputs glue. -30. Add a check or workflow expectation that generated flake.nix is up to date. -Commands for execution phase: -nix run .#write-flake -nix flake check -Bootstrap fallback if .#write-flake is not available yet: -nix-shell \ - -A flake-file.sh --run write-flake --arg modules ./modules -Migration Order -31. Establish flake-file dendritic bootstrap in ~/Infra/modules/nix. -32. Port systems, treefmt, and devshell. -33. Port package outputs. -34. Export current NixOS modules as flake.modules.nixos.*. -35. Build laptop, desktop, and vm host compositions. -36. Port home-manager modules. -37. Move input declarations close to usage. -38. Generate flake.nix. -39. Run nix flake check. -40. Compare host builds against the old repo with nixos-rebuild build --flake .#. diff --git a/todo.md b/todo.md --- a/todo.md +++ b/todo.md @@ -57,16 +57,16 @@ (moved to modules/programs/cli) -- [x] bat.nix +- [ ] bat.nix (todo, fish shell pager export) - [x] bonsai.nix - [x] cpond.nix - [x] direnv.nix - [x] eza.nix - [x] fd.nix - [x] gh.nix -- [ ] npm.nix (look at what to set in config) +- [x] npm.nix - [x] nys.nix -- [ ] other.nix +- [x] other.nix - [x] pipes.nix - [x] rumdl.nix - [x] systeroid.nix @@ -76,7 +76,8 @@ ### New files - [x] ripgrep.nix -- [ ] bun.nix (look at what to set in config) +- [x] bun.nix +- [x] speedtest.nix ## modules/home/cli/fastfetch/ @@ -109,13 +110,13 @@ ## modules/home/cli/ripgrep-all/ -- [ ] adapters.nix -- [ ] default.nix +- [x] adapters.nix +- [x] default.nix ## modules/home/cli/ripgrep-all/adapters/ -- [ ] gron.nix -- [ ] other.nix +- [x] gron.nix +- [x] other.nix ## modules/home/cli/starship/ @@ -262,7 +263,7 @@ ## modules/home/services/ -- [ ] flatpak.nix +- [x] flatpak.nix ## modules/home/tui/ diff --git a/modules/devshell.nix b/modules/devshell.nix new file mode 100644 --- /dev/null +++ b/modules/devshell.nix @@ -0,0 +1,18 @@ +_: { + perSystem = {pkgs, ...}: let + inherit (builtins) attrValues; + inherit (pkgs) mkShell; + in { + devShells.default = mkShell { + packages = attrValues { + inherit + (pkgs) + # keep-sorted start + sops + tokei + # keep-sorted end + ; + }; + }; + }; +} diff --git a/modules/treefmt.nix b/modules/treefmt.nix new file mode 100644 --- /dev/null +++ b/modules/treefmt.nix @@ -0,0 +1,60 @@ +{inputs, ...}: { + flake-file.inputs.treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + imports = [inputs.treefmt-nix.flakeModule]; + + perSystem = _: { + treefmt = { + # keep-sorted start block=yes newline_separated=yes + programs = { + # keep-sorted start + alejandra.enable = true; + deadnix.enable = true; + nixf-diagnose.enable = true; + statix.enable = true; + # keep-sorted end + + # keep-sorted start block=yes + shellcheck = { + enable = true; + severity = "style"; + }; + shfmt.enable = true; + # keep-sorted end + + # keep-sorted start + keep-sorted.enable = true; + oxfmt.enable = true; + rumdl-format.enable = true; + stylua.enable = true; + yamllint.enable = true; + # keep-sorted end + }; + + projectRootFile = "flake.nix"; + + settings = { + # keep-sorted start block=yes newline_separated=yes + # Keep markdown on rumdl-format. + formatter.oxfmt.excludes = [ + "*.md" + "*.mdx" + ]; + + # Keep sops and direnv files out of formatting and linting. + global.excludes = [ + # keep-sorted start + ".direnv/*" + ".sops.yaml" + "secrets/secrets.yaml" + # keep-sorted end + ]; + # keep-sorted end + }; + # keep-sorted end + }; + }; +} diff --git a/modules/desktop/tuigreet.nix b/modules/desktop/tuigreet.nix --- a/modules/desktop/tuigreet.nix +++ b/modules/desktop/tuigreet.nix @@ -1,4 +1,8 @@ -{inputs, ...}: { +{ + inputs, + self, + ... +}: { flake-file.inputs.tuigreet = { url = "github:notashelf/tuigreet"; inputs.nixpkgs.follows = "nixpkgs"; @@ -30,7 +34,7 @@ inherit (vars) username; tomlFormat = pkgs.formats.toml {}; in { - imports = [inputs.self.modules.generic.vars]; + imports = [self.modules.generic.vars]; # keep-sorted start block=yes newline_separated=yes environment = { @@ -102,7 +106,7 @@ settings.default_session.command = getExe pkgs.tuigreet; }; - nixpkgs.overlays = [inputs.self.overlays.tuigreet]; + nixpkgs.overlays = [self.overlays.tuigreet]; # keep-sorted end }; # keep-sorted end diff --git a/modules/nix/determinate.nix b/modules/nix/determinate.nix --- a/modules/nix/determinate.nix +++ b/modules/nix/determinate.nix @@ -1,12 +1,11 @@ {inputs, ...}: { flake-file.inputs = { - determinate = { - url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; - inputs.flake-parts.follows = "flake-parts"; - }; + determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; }; - flake.overlays.determinate = final: _prev: { - nix = inputs.determinate.packages.${final.stdenv.hostPlatform.system}.default; + flake.overlays.determinate = final: _prev: let + inherit (final.stdenv.hostPlatform) system; + in { + nix = inputs.determinate.packages.${system}.default; }; } diff --git a/modules/nix/home-manager.nix b/modules/nix/home-manager.nix --- a/modules/nix/home-manager.nix +++ b/modules/nix/home-manager.nix @@ -1,7 +1,9 @@ {inputs, ...}: { flake-file.inputs = { - url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; imports = [inputs.home-manager.flakeModules.home-manager]; diff --git a/modules/nix/sops.nix b/modules/nix/sops.nix --- a/modules/nix/sops.nix +++ b/modules/nix/sops.nix @@ -1,7 +1,11 @@ -{inputs, ...}: let +{ + inputs, + self, + ... +}: let sopsConfig = { # Keep the shared secret inventory in the repository copy. - defaultSopsFile = "${inputs.self}/secrets/secrets.yaml"; + defaultSopsFile = "${self}/secrets/secrets.yaml"; defaultSopsFormat = "yaml"; validateSopsFiles = false; diff --git a/modules/nix/vars.nix b/modules/nix/vars.nix --- a/modules/nix/vars.nix +++ b/modules/nix/vars.nix @@ -1,5 +1,5 @@ -{inputs, ...}: let - vars = import "${inputs.self}/vars.nix"; +{self, ...}: let + vars = import "${self}/vars.nix"; in { flake.vars = vars; diff --git a/modules/profiles/personal.nix b/modules/profiles/personal.nix new file mode 100644 --- /dev/null +++ b/modules/profiles/personal.nix @@ -0,0 +1,23 @@ +{self, ...}: { + flake.modules.nixos.personal = { + imports = with self.modules.nixos; [ + # Import user vars. + self.modules.generic.vars + + # Profile common. + # keep-sorted start + slim + tweaks + # keep-sorted end + ]; + + nixpkgs.overlays = [self.overlays.determinate]; + }; + + flake.modules.homeManager.personal = { + imports = [ + # Import user vars. + self.modules.generic.vars + ]; + }; +} diff --git a/modules/profiles/slim.nix b/modules/profiles/slim.nix deleted file mode 100644 --- a/modules/profiles/slim.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - flake.modules.nixos.slim = {lib, ...}: let - inherit (builtins) filter; - inherit (lib) mkForce; - in { - # keep-sorted start block=yes newline_separated=yes - documentation = { - # keep-sorted start - doc.enable = mkForce false; - info.enable = mkForce false; - # keep-sorted end - }; - - # Drop the default package seed so profiles start empty. - environment.defaultPackages = mkForce []; - - # Slim xdg-desktop-portal-gtk globally to avoid duplicate user units. - nixpkgs.overlays = [ - (_final: prev: { - xdg-desktop-portal-gtk = prev.xdg-desktop-portal-gtk.overrideAttrs (old: { - buildInputs = - filter ( - pkg: pkg != prev.gnome-desktop && pkg != prev.gnome-settings-daemon - ) - old.buildInputs; - mesonFlags = (old.mesonFlags or []) ++ ["-Dwallpaper=disabled"]; - }); - }) - ]; - - services = { - # Disable speech stack. - # keep-sorted start - orca.enable = mkForce false; - speechd.enable = mkForce false; - # keep-sorted end - }; - # keep-sorted end - }; -} diff --git a/modules/profiles/tweaks.nix b/modules/profiles/tweaks.nix deleted file mode 100644 --- a/modules/profiles/tweaks.nix +++ /dev/null @@ -1,182 +0,0 @@ -{ - flake.modules.nixos.tweaks = { - # keep-sorted start - config, - lib, - pkgs, - # keep-sorted end - ... - }: let - inherit (builtins) attrValues; - inherit - (lib) - # keep-sorted start - getExe - getExe' - mkEnableOption - optional - # keep-sorted end - ; - in { - options.optTweaks.rcuLazy.enable = mkEnableOption "Enable RCU lazy mode."; - - config = { - # keep-sorted start block=yes newline_separated=yes - # Kernel parameters aimed at low latency desktops. - boot = { - # Audio power management: disable power saving for continuous audio availability. - extraModprobeConfig = '' - options snd_hda_intel power_save=0 - - # Disable hardware watchdogs for lower latency. - blacklist iTCO_wdt - blacklist wdat_wdt - ''; - - # Enable nt sync for better wine/proton performance. - kernelModules.ntsync = true; - - # Memory and system tuning for desktop responsiveness. - kernel.sysctl = { - # Prefer compressed swap sooner to keep file cache and anonymous memory flexible. - # keep-sorted start - "vm.swappiness" = 100; - "vm.vfs_cache_pressure" = 50; - # keep-sorted end - - # Cap dirty data in bytes so writeback starts predictably across ram sizes. - # keep-sorted start - "vm.dirty_background_bytes" = 67108864; - "vm.dirty_bytes" = 268435456; - "vm.dirty_writeback_centisecs" = 1500; - "vm.page-cluster" = 0; - # keep-sorted end - - # Drop watchdog and console noise that can add scheduler jitter. - # keep-sorted start - "kernel.nmi_watchdog" = 0; - "kernel.printk" = "3 3 3 3"; - "kernel.unprivileged_userns_clone" = 1; - # keep-sorted end - - # Keep kernel address exposure and kexec locked down despite the performance focus. - # keep-sorted start - "kernel.kexec_load_disabled" = 1; - "kernel.kptr_restrict" = 2; - # keep-sorted end - - # Leave headroom for heavier desktop and gaming network bursts. - # keep-sorted start - "fs.file-max" = 2097152; - "net.core.netdev_max_backlog" = 4096; - "net.ipv4.ip_forward" = 1; - "net.ipv4.tcp_mtu_probing" = 1; - "net.ipv4.tcp_tw_reuse" = 1; - # keep-sorted end - - # Remove the global rt throttle so audio workloads can hold cpu time when needed. - "kernel.sched_rt_runtime_us" = -1; - }; - - # Kernel boot parameters for additional tuning. - kernelParams = - [ - # Enable lru page generation for better memory management. - "lru_gen=y" - ] - # Optionally enable rcu lazy mode for battery life on laptops. - ++ optional config.optTweaks.rcuLazy.enable "rcutree.enable_rcu_lazy=1"; - }; - - # Assorted low-level tweaks and helper tools. - environment.systemPackages = attrValues { - inherit - (pkgs) - # keep-sorted start - bash - coreutils - hdparm - # keep-sorted end - ; - }; - - # Systemd limits and tmpfiles overrides. - systemd = { - tmpfiles.rules = [ - "e /var/lib/systemd/coredump - - - 3d" - - "w! /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none - - - - 409" - "w! /sys/kernel/mm/transparent_hugepage/defrag - - - - defer+madvise" - ]; - - user.extraConfig = '' - [Manager] - DefaultLimitNOFILE=1024:1048576 - ''; - - settings.Manager = { - # keep-sorted start - DefaultLimitNOFILE = "2048:2097152"; - DefaultTimeoutStartSec = "15s"; - DefaultTimeoutStopSec = "10s"; - # keep-sorted end - }; - }; - # keep-sorted end - - # Udev rules for audio power saving and disk scheduler tuning. - services.udev.extraRules = let - # keep-sorted start - bash = getExe pkgs.bash; - hdparm = getExe pkgs.hdparm; - # keep-sorted end - - # keep-sorted start - cat = getExe' pkgs.coreutils "cat"; - echo = getExe' pkgs.coreutils "echo"; - touch = getExe' pkgs.coreutils "touch"; - # keep-sorted end - in '' - ACTION=="add", SUBSYSTEM=="sound", KERNEL=="card*", DRIVERS=="snd_hda_intel", TEST!="/run/udev/snd-hda-intel-powersave", \ - RUN+="${bash} -c '${touch} /run/udev/snd-hda-intel-powersave; \ - [[ $$((${cat} /sys/class/power_supply/BAT0/status 2>/dev/null) != \"Discharging\" ]] && \ - ${echo} $$((${cat} /sys/module/snd_hda_intel/parameters/power_save) > /run/udev/snd-hda-intel-powersave && \ - ${echo} 0 > /sys/module/snd_hda_intel/parameters/power_save'" - - SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", TEST=="/sys/module/snd_hda_intel", \ - RUN+="${bash} -c '${echo} $$((${cat} /run/udev/snd-hda-intel-powersave 2>/dev/null || \ - ${echo} 10) > /sys/module/snd_hda_intel/parameters/power_save'" - - SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", TEST=="/sys/module/snd_hda_intel", \ - RUN+="${bash} -c '[[ $$((${cat} /sys/module/snd_hda_intel/parameters/power_save) != 0 ]] && \ - ${echo} $$(${cat} /sys/module/snd_hda_intel/parameters/power_save) > /run/udev/snd-hda-intel-powersave; \ - ${echo} 0 > /sys/module/snd_hda_intel/parameters/power_save'" - - ACTION=="change", KERNEL=="zram0", ATTR{initstate}=="1", SYSCTL{vm.swappiness}="150", \ - RUN+="${bash} -c '${echo} N > /sys/module/zswap/parameters/enabled'" - - KERNEL=="rtc0", GROUP="audio" - KERNEL=="hpet", GROUP="audio" - - ACTION=="add", SUBSYSTEM=="scsi_host", KERNEL=="host*", \ - ATTR{link_power_management_policy}=="*", \ - ATTR{link_power_management_supported}=="1", \ - ATTR{link_power_management_policy}="max_performance" - - ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", \ - ATTR{queue/scheduler}="bfq" - - ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", \ - ATTR{queue/scheduler}="adios" - - ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/rotational}=="0", \ - ATTR{queue/scheduler}="adios" - - ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", \ - ATTRS{id/bus}=="ata", RUN+="${hdparm} -B 254 -S 0 /dev/%k" - - DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" - ''; - }; - }; -} diff --git a/modules/services/flatpak.nix b/modules/services/flatpak.nix new file mode 100644 --- /dev/null +++ b/modules/services/flatpak.nix @@ -0,0 +1,42 @@ +{inputs, ...}: { + flake-file.inputs.nix-flatpak.url = "github:gmodena/nix-flatpak"; + + flake.modules.nixos.flatpak = _: { + services.flatpak.enable = true; + }; + + flake.modules.homeManager.flatpak = {config, ...}: let + home = config.home.homeDirectory; + in { + imports = [inputs.nix-flatpak.homeManagerModules.nix-flatpak]; + + services.flatpak.overrides.global = { + # keep-sorted start block=yes newline_separated=yes + # Add icons and dconf to the extra files. + Context.filesystems = [ + # keep-sorted start + "${home}/.icons" + "xdg-config/dconf:ro" + # keep-sorted end + ]; + + # Export gtk, gdk, and qt variables. + Environment = { + # keep-sorted start + GDK_BACKEND = "wayland,x11,*"; + GDK_DEBUG = "portals"; + GDK_SCALE = "1"; + GSK_RENDERER = "vulkan"; + GTK_USE_PORTAL = "1"; + # keep-sorted end + + # keep-sorted start + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + # keep-sorted end + }; + # keep-sorted end + }; + }; +} diff --git a/modules/pkgs/os-age/default.nix b/modules/pkgs/os-age/default.nix new file mode 100644 --- /dev/null +++ b/modules/pkgs/os-age/default.nix @@ -0,0 +1,9 @@ +{self, ...}: { + flake.overlays.os-age = final: _prev: let + inherit (final.stdenv.hostPlatform) system; + + packages = self.packages.${system}; + in { + inherit (packages) os-age; + }; +} diff --git a/modules/pkgs/os-age/os-age.nix b/modules/pkgs/os-age/os-age.nix new file mode 100644 --- /dev/null +++ b/modules/pkgs/os-age/os-age.nix @@ -0,0 +1,16 @@ +{ + perSystem = {pkgs, ...}: { + packages.os-age = pkgs.writeShellApplication { + name = "os-age"; + runtimeInputs = [pkgs.coreutils]; + text = '' + birth_install="$(stat -c %W /)" + current="$(date +%s)" + time_progression="$((current - birth_install))" + days_difference="$((time_progression / 86400))" + + echo "$days_difference days" + ''; + }; + }; +} diff --git a/modules/pkgs/ripgrep-all-adapters/default.nix b/modules/pkgs/ripgrep-all-adapters/default.nix new file mode 100644 --- /dev/null +++ b/modules/pkgs/ripgrep-all-adapters/default.nix @@ -0,0 +1,15 @@ +{self, ...}: { + flake.overlays.ripgrep-all-adapters = final: _prev: let + inherit (final.stdenv.hostPlatform) system; + + packages = self.packages.${system}; + in { + inherit + (packages) + # keep-sorted start + djvutorga-adapter + pptx2md-adapter + # keep-sorted end + ; + }; +} diff --git a/modules/pkgs/ripgrep-all-adapters/djvutorga-adapter.nix b/modules/pkgs/ripgrep-all-adapters/djvutorga-adapter.nix new file mode 100644 --- /dev/null +++ b/modules/pkgs/ripgrep-all-adapters/djvutorga-adapter.nix @@ -0,0 +1,53 @@ +let + inherit (builtins) attrValues; +in { + perSystem = {pkgs, ...}: { + packages.djvutorga-adapter = pkgs.writeShellApplication { + name = "djvutorga"; + runtimeInputs = attrValues { + inherit + (pkgs) + # keep-sorted start + coreutils + djvulibre + # keep-sorted end + ; + }; + text = '' + set -o errtrace -o errexit -o nounset -o pipefail + [[ "''${TRACE:-0}" == "1" ]] && set -o xtrace + + shopt -s inherit_errexit + IFS=$'\n\t' + PS4='+\t ' + + temp_file="$(mktemp "''${TMPDIR:-/tmp}/tempXXXXXXXXXX.djvu")" + cleanup() { + rm -f "''${temp_file}" + } + trap cleanup EXIT + + cat > "''${temp_file}" + + declare -a file_to_page=() + while IFS= read -r file_info; do + page="''${file_info%% [APIT]*}" + page="''${page// /}" + file_to_page+=("''${page}") + done < <(djvused "''${temp_file}" -e 'ls') + + file=0 + page="" + while IFS= read -r line; do + if [[ "''${line}" == *$'\f'* ]]; then + pagebreaks="''${line//[^$'\f']/}" + file=$((file + ''${#pagebreaks})) + page="''${file_to_page[$file]:-}" + line="''${line//$'\f'/}" + fi + printf 'Page %s: %s\n' "''${page}" "''${line}" + done < <(djvused "''${temp_file}" -e 'print-pure-txt') + ''; + }; + }; +} diff --git a/modules/pkgs/ripgrep-all-adapters/pptx2md-adapter.nix b/modules/pkgs/ripgrep-all-adapters/pptx2md-adapter.nix new file mode 100644 --- /dev/null +++ b/modules/pkgs/ripgrep-all-adapters/pptx2md-adapter.nix @@ -0,0 +1,53 @@ +{ + perSystem = {pkgs, ...}: { + packages.pptx2md-adapter = pkgs.writeShellApplication { + name = "pptx2md.sh"; + runtimeInputs = [pkgs.coreutils]; + text = '' + set -o errtrace -o errexit -o nounset -o pipefail + [[ "''${TRACE:-0}" == "1" ]] && set -o xtrace + + shopt -s inherit_errexit + IFS=$'\n\t' + PS4='+\t ' + + error_handler() { cat >&2 "Error: In ''${BASH_SOURCE[0]} Line ''${1} exited with Status ''${2}"; } + trap 'error_handler ''${LINENO} $?' ERR + + if ! command -v pptx2md >/dev/null 2>&1; then + cat >&2 "pptx2md is required in PATH for the pptx adapter." + exit 127 + fi + + output_file="$(mktemp "''${TMPDIR:-/tmp}/tempXXXXXXXXXX.md")" + cleanup_output() { + rm -f "$output_file" + } + trap cleanup_output EXIT + + for arg; do :; done + if [ "$arg" = "-" ]; then + input_file="$(mktemp "''${TMPDIR:-/tmp}/tempXXXXXXXXXX.pptx")" + cleanup_input() { + rm -f "$input_file" + } + trap cleanup_input EXIT + + cat > "$input_file" + + if [ $# -gt 1 ]; then + args=("$@") + unset "args[$((''${#args[@]} - 1))]" + pptx2md "''${args[@]}" "$input_file" --output "$output_file" >/dev/null + else + pptx2md "$input_file" --output "$output_file" >/dev/null + fi + else + pptx2md "$@" --output "$output_file" >/dev/null + fi + + cat --squeeze-blank "$output_file" + ''; + }; + }; +} diff --git a/modules/profiles/common/slim.nix b/modules/profiles/common/slim.nix new file mode 100644 --- /dev/null +++ b/modules/profiles/common/slim.nix @@ -0,0 +1,40 @@ +{ + flake.modules.nixos.slim = {lib, ...}: let + inherit (builtins) filter; + inherit (lib) mkForce; + in { + # keep-sorted start block=yes newline_separated=yes + documentation = { + # keep-sorted start + doc.enable = mkForce false; + info.enable = mkForce false; + # keep-sorted end + }; + + # Drop the default package seed so profiles start empty. + environment.defaultPackages = mkForce []; + + # Slim xdg-desktop-portal-gtk globally to avoid duplicate user units. + nixpkgs.overlays = [ + (_final: prev: { + xdg-desktop-portal-gtk = prev.xdg-desktop-portal-gtk.overrideAttrs (old: { + buildInputs = + filter ( + pkg: pkg != prev.gnome-desktop && pkg != prev.gnome-settings-daemon + ) + old.buildInputs; + mesonFlags = (old.mesonFlags or []) ++ ["-Dwallpaper=disabled"]; + }); + }) + ]; + + services = { + # Disable speech stack. + # keep-sorted start + orca.enable = mkForce false; + speechd.enable = mkForce false; + # keep-sorted end + }; + # keep-sorted end + }; +} diff --git a/modules/profiles/common/tweaks.nix b/modules/profiles/common/tweaks.nix new file mode 100644 --- /dev/null +++ b/modules/profiles/common/tweaks.nix @@ -0,0 +1,182 @@ +{ + flake.modules.nixos.tweaks = { + # keep-sorted start + config, + lib, + pkgs, + # keep-sorted end + ... + }: let + inherit (builtins) attrValues; + inherit + (lib) + # keep-sorted start + getExe + getExe' + mkEnableOption + optional + # keep-sorted end + ; + in { + options.optTweaks.rcuLazy.enable = mkEnableOption "Enable RCU lazy mode."; + + config = { + # keep-sorted start block=yes newline_separated=yes + # Kernel parameters aimed at low latency desktops. + boot = { + # Audio power management: disable power saving for continuous audio availability. + extraModprobeConfig = '' + options snd_hda_intel power_save=0 + + # Disable hardware watchdogs for lower latency. + blacklist iTCO_wdt + blacklist wdat_wdt + ''; + + # Enable nt sync for better wine/proton performance. + kernelModules.ntsync = true; + + # Memory and system tuning for desktop responsiveness. + kernel.sysctl = { + # Prefer compressed swap sooner to keep file cache and anonymous memory flexible. + # keep-sorted start + "vm.swappiness" = 100; + "vm.vfs_cache_pressure" = 50; + # keep-sorted end + + # Cap dirty data in bytes so writeback starts predictably across ram sizes. + # keep-sorted start + "vm.dirty_background_bytes" = 67108864; + "vm.dirty_bytes" = 268435456; + "vm.dirty_writeback_centisecs" = 1500; + "vm.page-cluster" = 0; + # keep-sorted end + + # Drop watchdog and console noise that can add scheduler jitter. + # keep-sorted start + "kernel.nmi_watchdog" = 0; + "kernel.printk" = "3 3 3 3"; + "kernel.unprivileged_userns_clone" = 1; + # keep-sorted end + + # Keep kernel address exposure and kexec locked down despite the performance focus. + # keep-sorted start + "kernel.kexec_load_disabled" = 1; + "kernel.kptr_restrict" = 2; + # keep-sorted end + + # Leave headroom for heavier desktop and gaming network bursts. + # keep-sorted start + "fs.file-max" = 2097152; + "net.core.netdev_max_backlog" = 4096; + "net.ipv4.ip_forward" = 1; + "net.ipv4.tcp_mtu_probing" = 1; + "net.ipv4.tcp_tw_reuse" = 1; + # keep-sorted end + + # Remove the global rt throttle so audio workloads can hold cpu time when needed. + "kernel.sched_rt_runtime_us" = -1; + }; + + # Kernel boot parameters for additional tuning. + kernelParams = + [ + # Enable lru page generation for better memory management. + "lru_gen=y" + ] + # Optionally enable rcu lazy mode for battery life on laptops. + ++ optional config.optTweaks.rcuLazy.enable "rcutree.enable_rcu_lazy=1"; + }; + + # Assorted low-level tweaks and helper tools. + environment.systemPackages = attrValues { + inherit + (pkgs) + # keep-sorted start + bash + coreutils + hdparm + # keep-sorted end + ; + }; + + # Systemd limits and tmpfiles overrides. + systemd = { + tmpfiles.rules = [ + "e /var/lib/systemd/coredump - - - 3d" + + "w! /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none - - - - 409" + "w! /sys/kernel/mm/transparent_hugepage/defrag - - - - defer+madvise" + ]; + + user.extraConfig = '' + [Manager] + DefaultLimitNOFILE=1024:1048576 + ''; + + settings.Manager = { + # keep-sorted start + DefaultLimitNOFILE = "2048:2097152"; + DefaultTimeoutStartSec = "15s"; + DefaultTimeoutStopSec = "10s"; + # keep-sorted end + }; + }; + # keep-sorted end + + # Udev rules for audio power saving and disk scheduler tuning. + services.udev.extraRules = let + # keep-sorted start + bash = getExe pkgs.bash; + hdparm = getExe pkgs.hdparm; + # keep-sorted end + + # keep-sorted start + cat = getExe' pkgs.coreutils "cat"; + echo = getExe' pkgs.coreutils "echo"; + touch = getExe' pkgs.coreutils "touch"; + # keep-sorted end + in '' + ACTION=="add", SUBSYSTEM=="sound", KERNEL=="card*", DRIVERS=="snd_hda_intel", TEST!="/run/udev/snd-hda-intel-powersave", \ + RUN+="${bash} -c '${touch} /run/udev/snd-hda-intel-powersave; \ + [[ $$((${cat} /sys/class/power_supply/BAT0/status 2>/dev/null) != \"Discharging\" ]] && \ + ${echo} $$((${cat} /sys/module/snd_hda_intel/parameters/power_save) > /run/udev/snd-hda-intel-powersave && \ + ${echo} 0 > /sys/module/snd_hda_intel/parameters/power_save'" + + SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", TEST=="/sys/module/snd_hda_intel", \ + RUN+="${bash} -c '${echo} $$((${cat} /run/udev/snd-hda-intel-powersave 2>/dev/null || \ + ${echo} 10) > /sys/module/snd_hda_intel/parameters/power_save'" + + SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", TEST=="/sys/module/snd_hda_intel", \ + RUN+="${bash} -c '[[ $$((${cat} /sys/module/snd_hda_intel/parameters/power_save) != 0 ]] && \ + ${echo} $$(${cat} /sys/module/snd_hda_intel/parameters/power_save) > /run/udev/snd-hda-intel-powersave; \ + ${echo} 0 > /sys/module/snd_hda_intel/parameters/power_save'" + + ACTION=="change", KERNEL=="zram0", ATTR{initstate}=="1", SYSCTL{vm.swappiness}="150", \ + RUN+="${bash} -c '${echo} N > /sys/module/zswap/parameters/enabled'" + + KERNEL=="rtc0", GROUP="audio" + KERNEL=="hpet", GROUP="audio" + + ACTION=="add", SUBSYSTEM=="scsi_host", KERNEL=="host*", \ + ATTR{link_power_management_policy}=="*", \ + ATTR{link_power_management_supported}=="1", \ + ATTR{link_power_management_policy}="max_performance" + + ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", \ + ATTR{queue/scheduler}="bfq" + + ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", \ + ATTR{queue/scheduler}="adios" + + ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/rotational}=="0", \ + ATTR{queue/scheduler}="adios" + + ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", \ + ATTRS{id/bus}=="ata", RUN+="${hdparm} -B 254 -S 0 /dev/%k" + + DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" + ''; + }; + }; +} diff --git a/modules/programs/cli/bat.nix b/modules/programs/cli/bat.nix --- a/modules/programs/cli/bat.nix +++ b/modules/programs/cli/bat.nix @@ -1,6 +1,15 @@ { - flake.modules.homeManager.bat = {pkgs, ...}: { - # Enable bat with manuals. + flake.modules.homeManager.bat = { + # keep-sorted start + lib, + config, + pkgs, + # keep-sorted end + ... + }: let + inherit (lib) getExe; + bat = getExe config.programs.bat.package; + in { programs.bat = { enable = true; @@ -11,5 +20,9 @@ file = "Just.sublime-syntax"; }; }; + + home.shellAliases.cat = bat; + + # TODO: Fish init batman export. }; } diff --git a/modules/programs/cli/bun.nix b/modules/programs/cli/bun.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/bun.nix @@ -0,0 +1,41 @@ +{ + flake.modules.homeManager.bun = { + # keep-sorted start + lib, + config, + # keep-sorted end + ... + }: let + inherit + (lib) + # keep-sorted start + getExe + getExe' + # keep-sorted end + ; + + # keep-sorted start + bun = getExe config.programs.bun.package; + bunx = getExe' config.programs.bun.package "bunx"; + # keep-sorted end + in { + programs.bun = { + enable = true; + + # Why the fuck would javascript need telementry. + settings.telementry = false; + }; + + home.shellAliases = { + # keep-sorted start + inherit bunx; + npm = bun; + npx = bunx; + pnpm = bun; + pnpx = bunx; + yarn = bun; + yarnpkg = bun; + # keep-sorted end + }; + }; +} diff --git a/modules/programs/cli/fastfetch.nix b/modules/programs/cli/fastfetch.nix --- a/modules/programs/cli/fastfetch.nix +++ b/modules/programs/cli/fastfetch.nix @@ -1,207 +1,202 @@ { - # keep-sorted start - lib, - pkgs, - # keep-sorted end - ... -}: let - inherit (builtins) fromJSON; - inherit (lib) getExe; - inherit (pkgs) writeShellApplication; + flake.modules.homeManager.fastfetch = { + # keep-sorted start + lib, + pkgs, + self, + # keep-sorted end + ... + }: let + inherit (builtins) fromJSON; + inherit (lib) getExe; - # Escape code for fastfetch color formatting. - esc = fromJSON "\"\\u001b\""; -in { - programs.fastfetch = { - enable = true; + # Escape code for fastfetch color formatting. + esc = fromJSON "\"\\u001b\""; + in { + nixpkgs.overlays = [self.overlays.os-age]; - settings = { - # Use custom logo and kitty terminal image display. - logo = { - source = ./logo.png; - type = "kitty"; - height = 15; - width = 35; + programs.fastfetch = { + enable = true; + + settings = { + # Use custom logo and kitty terminal image display. + logo = { + source = "${self}/assets/nix.png"; + type = "kitty"; + height = 15; + width = 35; + }; + + # Configure display formatting and binary prefix standards. + display = { + separator = " "; + size.binaryPrefix = "jedec"; + }; + + # Define information modules to show in system overview. + modules = [ + "break" + + { + type = "os"; + key = "{#7}  DISTRO "; + keyColor = "blue"; + format = "${esc}[34m{#1}{#7} {3} "; + } + + { + type = "kernel"; + key = "│ ├ KERNEL"; + keyColor = "34"; + format = "{2}"; + } + + { + type = "packages"; + key = "│ ├󰏖 PACKAGES"; + keyColor = "34"; + } + + { + type = "shell"; + key = "│ ├ SHELL"; + keyColor = "34"; + } + + { + type = "command"; + key = "│ ├󰅐 OS-AGE"; + keyColor = "34"; + + # Calculate system installation age from root filesystem birth time. + text = getExe pkgs.os-age; + } + + { + type = "uptime"; + key = "│ └󰅐 UPTIME"; + keyColor = "34"; + } + + { + type = "custom"; + format = "{#1}${esc}[34m└─────────────────────────────────────────────────────────────"; + } + + { + type = "wm"; + key = "{#7}  DE/WM "; + keyColor = "36"; + format = "${esc}[36m{#1}{#7} {2} {3} "; + } + + { + type = "de"; + key = "│ ├󰧨 DE"; + keyColor = "cyan"; + } + + { + type = "lm"; + key = "│ ├󰧨 LM"; + keyColor = "cyan"; + } + + { + type = "theme"; + key = "│ ├󰉼 THEME"; + keyColor = "cyan"; + } + + { + type = "icons"; + key = "│ ├󰀻 ICONS"; + keyColor = "cyan"; + } + + { + type = "terminal"; + key = "│ ├ TERMINAL"; + keyColor = "cyan"; + } + + { + type = "terminalfont"; + key = "│ └ FONT"; + keyColor = "cyan"; + } + + { + type = "custom"; + format = "{#1}${esc}[36m└─────────────────────────────────────────────────────────────"; + } + + { + type = "board"; + key = "{#7}  HARDWARE "; + keyColor = "31"; + format = "${esc}[31m{#1}{#7} {1} ({2}) "; + } + + { + type = "cpu"; + key = "│ ├ CPU"; + keyColor = "red"; + } + + { + type = "gpu"; + key = "│ ├󰍛 GPU"; + keyColor = "red"; + format = "{2} {3}"; + } + + { + type = "memory"; + key = "│ ├󰑭 RAM"; + keyColor = "red"; + format = "{4} {1} / {2} ({3})"; + } + + { + type = "disk"; + key = "│ ├ DISKS"; + keyColor = "red"; + } + + { + type = "custom"; + format = "{#1}${esc}[31m└─────────────────────────────────────────────────────────────"; + } + + { + type = "display"; + key = "{#7} 󰍹 DISPLAY "; + keyColor = "38"; + format = "{#1}{#7}${esc}[32m {6} {1}x{2} @{3}Hz ({7}) "; + } + + { + type = "media"; + key = "│ ├󰝚 TRACK"; + keyColor = "38"; + format = "{3} - {1} ({5})"; + } + + { + type = "sound"; + key = "│ └ VOLUME"; + keyColor = "38"; + } + + { + type = "custom"; + format = "{#1}${esc}[37m└─────────────────────────────────────────────────────────────"; + } + ]; }; - - # Configure display formatting and binary prefix standards. - display = { - separator = " "; - size.binaryPrefix = "jedec"; - }; - - # Define information modules to show in system overview. - modules = [ - "break" - - { - type = "os"; - key = "{#7}  DISTRO "; - keyColor = "blue"; - format = "${esc}[34m{#1}{#7} {3} "; - } - - { - type = "kernel"; - key = "│ ├ KERNEL"; - keyColor = "34"; - format = "{2}"; - } - - { - type = "packages"; - key = "│ ├󰏖 PACKAGES"; - keyColor = "34"; - } - - { - type = "shell"; - key = "│ ├ SHELL"; - keyColor = "34"; - } - - { - type = "command"; - key = "│ ├󰅐 OS-AGE"; - keyColor = "34"; - - # Calculate system installation age from root filesystem birth time. - text = getExe (writeShellApplication { - name = "os-age"; - runtimeInputs = [pkgs.coreutils]; - text = '' - birth_install="$(stat -c %W /)" - current="$(date +%s)" - time_progression="$((current - birth_install))" - days_difference="$((time_progression / 86400))" - - echo "$days_difference days" - ''; - }); - } - - { - type = "uptime"; - key = "│ └󰅐 UPTIME"; - keyColor = "34"; - } - - { - type = "custom"; - format = "{#1}${esc}[34m└─────────────────────────────────────────────────────────────"; - } - - { - type = "wm"; - key = "{#7}  DE/WM "; - keyColor = "36"; - format = "${esc}[36m{#1}{#7} {2} {3} "; - } - - { - type = "de"; - key = "│ ├󰧨 DE"; - keyColor = "cyan"; - } - - { - type = "lm"; - key = "│ ├󰧨 LM"; - keyColor = "cyan"; - } - - { - type = "theme"; - key = "│ ├󰉼 THEME"; - keyColor = "cyan"; - } - - { - type = "icons"; - key = "│ ├󰀻 ICONS"; - keyColor = "cyan"; - } - - { - type = "terminal"; - key = "│ ├ TERMINAL"; - keyColor = "cyan"; - } - - { - type = "terminalfont"; - key = "│ └ FONT"; - keyColor = "cyan"; - } - - { - type = "custom"; - format = "{#1}${esc}[36m└─────────────────────────────────────────────────────────────"; - } - - { - type = "board"; - key = "{#7}  HARDWARE "; - keyColor = "31"; - format = "${esc}[31m{#1}{#7} {1} ({2}) "; - } - - { - type = "cpu"; - key = "│ ├ CPU"; - keyColor = "red"; - } - - { - type = "gpu"; - key = "│ ├󰍛 GPU"; - keyColor = "red"; - format = "{2} {3}"; - } - - { - type = "memory"; - key = "│ ├󰑭 RAM"; - keyColor = "red"; - format = "{4} {1} / {2} ({3})"; - } - - { - type = "disk"; - key = "│ ├ DISKS"; - keyColor = "red"; - } - - { - type = "custom"; - format = "{#1}${esc}[31m└─────────────────────────────────────────────────────────────"; - } - - { - type = "display"; - key = "{#7} 󰍹 DISPLAY "; - keyColor = "38"; - format = "{#1}{#7}${esc}[32m {6} {1}x{2} @{3}Hz ({7}) "; - } - - { - type = "media"; - key = "│ ├󰝚 TRACK"; - keyColor = "38"; - format = "{3} - {1} ({5})"; - } - - { - type = "sound"; - key = "│ └ VOLUME"; - keyColor = "38"; - } - - { - type = "custom"; - format = "{#1}${esc}[37m└─────────────────────────────────────────────────────────────"; - } - ]; }; + + programs.fish.shellAbbrs.ff = "fastfetch"; }; } diff --git a/modules/programs/cli/gitfetch.nix b/modules/programs/cli/gitfetch.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/gitfetch.nix @@ -0,0 +1,13 @@ +{ + flake.modules.homeManager.gitfetch = { + # keep-sorted start + pkgs, + # keep-sorted end + ... + }: let + gitfetch = pkgs.gitfetch; + in { + home.packages = [gitfetch]; + programs.fish.shellAbbrs.gf = "gitfetch"; + }; +} diff --git a/modules/programs/cli/nix-index.nix b/modules/programs/cli/nix-index.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/nix-index.nix @@ -0,0 +1,17 @@ +{inputs, ...}: { + flake-file.inputs = { + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + flake.modules.homeManager.nix-index = { + imports = [inputs.nix-index-database.homeModules.nix-index]; + + programs = { + nix-index-database.comma.enable = true; + nix-index.enable = true; + }; + }; +} diff --git a/modules/programs/cli/onefetch.nix b/modules/programs/cli/onefetch.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/onefetch.nix @@ -0,0 +1,13 @@ +{ + flake.modules.homeManager.onefetch = { + # keep-sorted start + pkgs, + # keep-sorted end + ... + }: let + onefetch = pkgs.onefetch; + in { + home.packages = [onefetch]; + programs.fish.shellAbbrs.of = "onefetch"; + }; +} diff --git a/modules/programs/cli/sshfs.nix b/modules/programs/cli/sshfs.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/sshfs.nix @@ -0,0 +1,5 @@ +{ + flake.modules.homeManager.sshfs = {pkgs, ...}: { + home.packages = [pkgs.sshfs]; + }; +} diff --git a/modules/programs/cli/ripgrep-all/adapters.nix b/modules/programs/cli/ripgrep-all/adapters.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/ripgrep-all/adapters.nix @@ -0,0 +1,36 @@ +{ + flake.modules.homeManager.ripgrep-all = { + # keep-sorted start + lib, + pkgs, + # keep-sorted end + ... + }: let + inherit (builtins) attrValues; + inherit (lib) makeBinPath; + inherit (pkgs) symlinkJoin; + in { + programs.ripgrep-all = { + # Wrap rga so adapters can find their runtime tools. + package = symlinkJoin { + name = "ripgrep-all-wrapped"; + paths = [pkgs.ripgrep-all]; + nativeBuildInputs = [pkgs.makeWrapper]; + postBuild = '' + wrapProgram $out/bin/rga \ + --prefix PATH : ${makeBinPath (attrValues { + inherit + (pkgs) + # keep-sorted start + csvkit + fastgron + # keep-sorted end + ; + + inherit (pkgs.nur.repos.adam0) qq-jfryy; + })} + ''; + }; + }; + }; +} diff --git a/modules/programs/cli/ripgrep-all/default.nix b/modules/programs/cli/ripgrep-all/default.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/ripgrep-all/default.nix @@ -0,0 +1,5 @@ +{ + flake.modules.homeManager.ripgrep-all = _: { + programs.ripgrep-all.enable = true; + }; +} diff --git a/modules/programs/cli/ripgrep-all/adapters/gron.nix b/modules/programs/cli/ripgrep-all/adapters/gron.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/ripgrep-all/adapters/gron.nix @@ -0,0 +1,84 @@ +{ + flake.modules.homeManager.ripgrep-all = { + # keep-sorted start + lib, + pkgs, + # keep-sorted end + ... + }: let + inherit (lib) getExe; + + # keep-sorted start + fastgron = getExe pkgs.fastgron; + qq = getExe pkgs.nur.repos.adam0.qq-jfryy; + # keep-sorted end + in { + programs.ripgrep-all.custom_adapters = [ + # keep-sorted start block=yes newline_separated=yes + # Convert JSON into line-oriented assignments for grep. + { + name = "json"; + version = 1; + description = "Transform JSON into discrete JS assignments"; + extensions = ["json"]; + mimetypes = ["application/json" "text/json"]; + binary = fastgron; + disabled_by_default = false; + match_only_by_mime = false; + } + + # Convert JSONC into fastgron-style assignments through qq. + { + name = "jsonc"; + version = 1; + description = "Transform Markup files into greppable assignments"; + extensions = ["jsonc"]; + mimetypes = ["application/jsonc" "text/jsonc"]; + binary = qq; + args = ["--monochrome-output" "--output" "${fastgron}" "--input" "jsonc"]; + disabled_by_default = false; + match_only_by_mime = false; + } + + # Convert TOML into fastgron-style assignments through qq. + { + name = "toml"; + version = 1; + description = "Transform Markup files into greppable assignments"; + extensions = ["toml"]; + mimetypes = ["application/toml" "text/toml"]; + binary = qq; + args = ["--monochrome-output" "--output" "${fastgron}" "--input" "toml"]; + disabled_by_default = false; + match_only_by_mime = false; + } + + # Convert XML into fastgron-style assignments through qq. + { + name = "xml"; + version = 1; + description = "Transform Markup files into greppable assignments"; + extensions = ["xml"]; + mimetypes = ["application/xml" "text/xml"]; + binary = qq; + args = ["--monochrome-output" "--output" "${fastgron}" "--input" "xml"]; + disabled_by_default = false; + match_only_by_mime = false; + } + + # Convert YAML into fastgron-style assignments through qq. + { + name = "yaml"; + version = 1; + description = "Transform Markup files into greppable assignments"; + extensions = ["yml" "yaml"]; + mimetypes = ["application/yaml" "text/yaml"]; + binary = qq; + args = ["--monochrome-output" "--output" "${fastgron}" "--input" "yaml"]; + disabled_by_default = false; + match_only_by_mime = false; + } + # keep-sorted end + ]; + }; +} diff --git a/modules/programs/cli/ripgrep-all/adapters/other.nix b/modules/programs/cli/ripgrep-all/adapters/other.nix new file mode 100644 --- /dev/null +++ b/modules/programs/cli/ripgrep-all/adapters/other.nix @@ -0,0 +1,67 @@ +{ + flake.modules.homeManager.ripgrep-all = { + # keep-sorted start + lib, + pkgs, + self, + # keep-sorted end + ... + }: let + inherit + (lib) + # keep-sorted start + getExe + getExe' + # keep-sorted end + ; + # keep-sorted start + djvutorga = getExe pkgs.djvutorga-adapter; + in2csv = getExe' pkgs.csvkit "in2csv"; + pptx2md = getExe pkgs.pptx2md-adapter; + # keep-sorted end + in { + nixpkgs.overlays = [self.overlays.ripgrep-all-adapters]; + + programs.ripgrep-all.custom_adapters = [ + # keep-sorted start block=yes newline_separated=yes + # Extract plain text from DjVu files with a local wrapper. + { + name = "djvu"; + version = 1; + description = "Uses djvused to extract plain text from DJVU files"; + extensions = ["djvu"]; + mimetypes = ["image/vnd.djvu"]; + binary = djvutorga; + disabled_by_default = false; + match_only_by_mime = false; + } + + # Convert PPTX presentations with the local markdown adapter. + { + name = "pptx"; + version = 1; + description = "Uses an adapter wrapper to convert PPTX files to markdown"; + extensions = ["pptx"]; + mimetypes = ["application/vnd.openxmlformats-officedocument.presentationml.presentation"]; + binary = pptx2md; + args = ["--disable-image" "--disable-wmf" "-"]; + disabled_by_default = false; + match_only_by_mime = false; + } + + # Extract text from XLSX spreadsheets with in2csv. + { + name = "xlsx"; + version = 1; + description = "Uses in2csv to extract text from XLSX files"; + extensions = ["xlsx"]; + mimetypes = ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]; + binary = in2csv; + args = ["\${input_virtual_path}"]; + disabled_by_default = false; + match_only_by_mime = false; + } + # keep-sorted end + ]; + }; +} -- tangled.sh