First commit upon an unsuspecting world.
This commit is contained in:
commit
8468627d87
46 changed files with 2552 additions and 0 deletions
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
/result
|
||||
121
LICENSES/CC0-1.0.txt
Normal file
121
LICENSES/CC0-1.0.txt
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
9
LICENSES/MIT.txt
Normal file
9
LICENSES/MIT.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
373
LICENSES/MPL-2.0.txt
Normal file
373
LICENSES/MPL-2.0.txt
Normal file
|
|
@ -0,0 +1,373 @@
|
|||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
233
flake.lock
generated
Normal file
233
flake.lock
generated
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717285511,
|
||||
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1659877975,
|
||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"haumea": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708375098,
|
||||
"narHash": "sha256-DaFJp3wDHgOqx98U0SF57bXaH2Orp106c+jSdPCVu1E=",
|
||||
"owner": "nix-community",
|
||||
"repo": "haumea",
|
||||
"rev": "ec6350fd9353e7f27ce0e85d31f82e3ed73e4d70",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "haumea",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717527182,
|
||||
"narHash": "sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "845a5c4c073f74105022533907703441e0464bc3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-24.05",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-index-database": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719111455,
|
||||
"narHash": "sha256-rnIxHx+fLpydjMQsbpZ21kblUr/lMqSaAtMA4+qMMEE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "4293f532d0107dfb7e6f8b34a0421dc8111320e6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-index-database",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixGL": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1713543440,
|
||||
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
|
||||
"owner": "guibou",
|
||||
"repo": "nixGL",
|
||||
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "guibou",
|
||||
"repo": "nixGL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1717281328,
|
||||
"narHash": "sha256-evZPzpf59oNcDUXxh2GHcxHkTEG4fjae2ytWP85jXRo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1718276985,
|
||||
"narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3f84a279f1a6290ce154c5531378acc827836fbb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nurpkgs-yushyin": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711542466,
|
||||
"narHash": "sha256-3k0mgDAzQJOYO4ktwjc8Pmr/Wu5vSSqn3d/FWaZbXps=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "871f36f2d630b26a00b6bdea4c01b2bdb60eac2c",
|
||||
"revCount": 2,
|
||||
"type": "git",
|
||||
"url": "https://git.forge.nihilum.space/~yushyin/nurpkgs-yushyin"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.forge.nihilum.space/~yushyin/nurpkgs-yushyin"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"haumea": "haumea",
|
||||
"home-manager": "home-manager",
|
||||
"nix-index-database": "nix-index-database",
|
||||
"nixGL": "nixGL",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nurpkgs-yushyin": "nurpkgs-yushyin",
|
||||
"theming": "theming"
|
||||
}
|
||||
},
|
||||
"theming": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"haumea": [
|
||||
"haumea"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1704399705,
|
||||
"narHash": "sha256-hSD/ID2KCdTk3vLF4AXEKPhjdYeQT9OFWPzxXkTs6t8=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "4549b273a4d40cbae875a256e7234f2b92317ef0",
|
||||
"revCount": 4,
|
||||
"type": "git",
|
||||
"url": "https://git.forge.nihilum.space/~yushyin/theming-yushyin"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.forge.nihilum.space/~yushyin/theming-yushyin"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
3
flake.lock.license
Normal file
3
flake.lock.license
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
52
flake.nix
Normal file
52
flake.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{
|
||||
description = "yushyin's shelter";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
|
||||
haumea.url = "github:nix-community/haumea";
|
||||
haumea.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
theming.url = "git+https://git.forge.nihilum.space/~yushyin/theming-yushyin";
|
||||
theming.inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-parts.follows = "flake-parts";
|
||||
haumea.follows = "haumea";
|
||||
};
|
||||
|
||||
nurpkgs-yushyin.url = "git+https://git.forge.nihilum.space/~yushyin/nurpkgs-yushyin";
|
||||
nurpkgs-yushyin.inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-parts.follows = "flake-parts";
|
||||
};
|
||||
|
||||
nix-index-database.url = "github:nix-community/nix-index-database";
|
||||
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
nixGL.url = "github:guibou/nixGL";
|
||||
nixGL.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-parts, ... }@inputs:
|
||||
flake-parts.lib.mkFlake
|
||||
{
|
||||
inherit inputs;
|
||||
specialArgs = { lib = nixpkgs.lib.extend (_: _: { dotfiles = self.lib; }); };
|
||||
}
|
||||
{
|
||||
systems = nixpkgs.lib.systems.flakeExposed;
|
||||
imports = [ ./home/flake-module.nix ./lib/flake-module.nix ];
|
||||
};
|
||||
}
|
||||
15
home/configs/minimal@unknown/default.nix
Normal file
15
home/configs/minimal@unknown/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ inputs, ... }:
|
||||
{
|
||||
home = {
|
||||
username = builtins.getEnv "USER";
|
||||
homeDirectory = builtins.getEnv "HOME";
|
||||
stateVersion = "23.05";
|
||||
};
|
||||
targets.genericLinux.enable = true;
|
||||
|
||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
}
|
||||
32
home/configs/yushyin@saga/default.nix
Normal file
32
home/configs/yushyin@saga/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.nix-index-database.hmModules.nix-index
|
||||
];
|
||||
|
||||
programs.nix-index-database.comma.enable = true;
|
||||
|
||||
home.stateVersion = "23.05";
|
||||
|
||||
profiles.base.enable = true;
|
||||
|
||||
profiles.shell.enable = true;
|
||||
profiles.graphical.enable = true;
|
||||
|
||||
profiles.esd.enable = true;
|
||||
|
||||
profiles.dev.enable = true;
|
||||
profiles.dev.lang.lua.enable = true;
|
||||
profiles.dev.lang.nix.enable = true;
|
||||
profiles.dev.lang.haskell.enable = true;
|
||||
profiles.dev.lang.purescript.enable = true;
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [ inputs.nurpkgs-yushyin.overlays.default ];
|
||||
}
|
||||
48
home/flake-module-options.nix
Normal file
48
home/flake-module-options.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ self, config, lib, inputs, withSystem, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkOption
|
||||
;
|
||||
homeConfigsOptions =
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
system = mkOption {
|
||||
type = types.nonEmptyStr;
|
||||
default = lib.throwIf lib.inPureEvalMode "needs --impure" builtins.currentSystem;
|
||||
};
|
||||
modules = mkOption {
|
||||
type = with types; listOf deferredModule;
|
||||
default = [
|
||||
self.homeModules.home
|
||||
(lib.dotfiles.fs.toTreeModule ./configs/${name})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.shelter.homeConfigs = mkOption {
|
||||
type = types.attrsOf (types.submodule homeConfigsOptions);
|
||||
};
|
||||
|
||||
config.flake.homeConfigurations = lib.mapAttrs
|
||||
(
|
||||
_: cfg: withSystem cfg.system
|
||||
({ pkgs, ... }:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs lib;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
flake = self;
|
||||
};
|
||||
modules = cfg.modules;
|
||||
})
|
||||
)
|
||||
config.shelter.homeConfigs;
|
||||
}
|
||||
20
home/flake-module.nix
Normal file
20
home/flake-module.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ lib, ... }:
|
||||
{
|
||||
flake.homeModules.home = lib.dotfiles.fs.toFringeModule ./modules;
|
||||
|
||||
imports = [ ./flake-module-options.nix ];
|
||||
|
||||
perSystem = { pkgs, ... }: {
|
||||
apps.hm = {
|
||||
type = "app";
|
||||
program = "${pkgs.home-manager}/bin/home-manager";
|
||||
};
|
||||
};
|
||||
|
||||
shelter.homeConfigs."yushyin@saga".system = "x86_64-linux";
|
||||
shelter.homeConfigs."minimal@unknown" = { };
|
||||
}
|
||||
16
home/modules/by-name/alacritty/default.nix
Normal file
16
home/modules/by-name/alacritty/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, ... }:
|
||||
lib.mkIf config.programs.alacritty.enable {
|
||||
programs.alacritty.settings = {
|
||||
font = {
|
||||
normal.family = "monospace";
|
||||
size = 10.0;
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables.TERMINAL = "alacritty";
|
||||
home.sessionVariables.WINIT_X11_SCALE_FACTOR = 1;
|
||||
}
|
||||
46
home/modules/by-name/firefox/default.nix
Normal file
46
home/modules/by-name/firefox/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, ... }:
|
||||
lib.mkIf config.programs.firefox.enable {
|
||||
programs.firefox.policies = {
|
||||
|
||||
DisableFeedbackCommands = true;
|
||||
DisableFirefoxAccounts = true;
|
||||
DisableFirefoxStudies = true;
|
||||
DisablePocket = true;
|
||||
DisableSetDesktopBackground = true;
|
||||
DisableTelemetry = true;
|
||||
DontCheckDefaultBrowser = true;
|
||||
HardwareAcceleration = true;
|
||||
OverrideFirstRunPage = "about:blank";
|
||||
OverridePostUpdatePage = "about:blank";
|
||||
PasswordManagerEnabled = false;
|
||||
DefaultDownloadDirectory = "\${home}/.cache/downloads";
|
||||
|
||||
FirefoxHome = {
|
||||
SponsoredTopSites = false;
|
||||
Pocket = false;
|
||||
SponsoredPocket = false;
|
||||
Snippets = false;
|
||||
};
|
||||
|
||||
FirefoxSuggest.SponsoredSuggestions = false;
|
||||
|
||||
# See https://mozilla.github.io/policy-templates/#extensionsettings
|
||||
ExtensionSettings =
|
||||
let
|
||||
mkAddOn = name: id: {
|
||||
"${id}" = {
|
||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
|
||||
installation_mode = "force_installed";
|
||||
};
|
||||
};
|
||||
in lib.mkMerge [
|
||||
(mkAddOn "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}")
|
||||
(mkAddOn "blocktube" "{58204f8b-01c2-4bbc-98f8-9a90458fd9ef}")
|
||||
(mkAddOn "ublock-origin" "uBlock0@raymondhill.net")
|
||||
];
|
||||
};
|
||||
}
|
||||
24
home/modules/by-name/fonts/default.nix
Normal file
24
home/modules/by-name/fonts/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config = lib.mkIf config.fonts.fontconfig.enable {
|
||||
home.packages = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "Hack" ]; })
|
||||
noto-fonts-emoji
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
];
|
||||
|
||||
xdg.configFile."fontconfig/conf.d/20-hm-fonts-extra.conf".text = ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<alias> <family>monospace</family> <prefer> <family>Hack Nerd Font Mono</family> </prefer> </alias>
|
||||
<alias> <family>monospace</family> <prefer> <family>Hack</family> </prefer> </alias>
|
||||
</fontconfig>
|
||||
'';
|
||||
};
|
||||
}
|
||||
87
home/modules/by-name/git/config
Normal file
87
home/modules/by-name/git/config
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
[pretty]
|
||||
log = %C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(auto)%d%C(reset)
|
||||
oldlog = %C(blue)%h%C(reset) - %C(white)(%ar)%C(reset) %s %C(red)%d%C(reset) %C(bold blue)— %an%C(reset)
|
||||
|
||||
[alias]
|
||||
lg = log --graph --abbrev-commit --color --pretty=log
|
||||
|
||||
l = lg -n 15
|
||||
ll = lg --all
|
||||
lf = lg --name-status
|
||||
lp = lg --first-parent
|
||||
|
||||
s = status -s
|
||||
ss = status
|
||||
a = add
|
||||
ai = add -i
|
||||
p = push
|
||||
pu = pull
|
||||
f = fetch
|
||||
fa = fetch --all
|
||||
c = commit
|
||||
dt = difftool
|
||||
dtg = difftool -g
|
||||
b = branch
|
||||
bv = branch -v
|
||||
bva = branch -va
|
||||
co = checkout
|
||||
cb = checkout -b
|
||||
d = diff --stat
|
||||
dd = diff
|
||||
m = merge --no-ff
|
||||
r = remote
|
||||
rv = remote -v
|
||||
rb = rebase
|
||||
rbi = rebase -i
|
||||
fap = fetch --all -p -t
|
||||
stash-all = stash save --include-untracked
|
||||
|
||||
# List every branch, local and remote, in order of most recent to oldest commit, showing the branch's last commit and some last commit meta-data
|
||||
br = for-each-ref --sort=-committerdate refs/heads/ refs/remotes/origin/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))' -
|
||||
|
||||
# ff [<args>]
|
||||
# if no <args> are given, tries to fast-forward with the upstream branch
|
||||
ff = !"perl -MGit -E' \
|
||||
push @ARGV, Git::command_oneline(qw/rev-parse --abbrev-ref --symbolic-full-name @{u}/) unless @ARGV; \
|
||||
Git::command_noisy(qw{merge --ff-only}, @ARGV); \
|
||||
'"
|
||||
# ff = merge --ff-only
|
||||
|
||||
# tomerge [<branch> [<regex>]] tells you which branches matching <regex> have not been merged into <branch> yet
|
||||
# <branch> defaults to HEAD
|
||||
# <regex> defaults to .
|
||||
tomerge = !"perl -MGit -E' \
|
||||
my ($br, $rx) = (shift // q{HEAD}, shift // qr{.}); \
|
||||
say for grep { \
|
||||
/$rx/ && !/\\b(master|maint|next)/; \
|
||||
} Git::command(qw{branch -r --no-merged}, $br); \
|
||||
'"
|
||||
|
||||
# topics [<regex>]
|
||||
# show topics (branches) matching the ai/description format or <regex>
|
||||
topics = !"perl -MGit -MList::Util=uniq -E' \
|
||||
my $rx = shift // qr{[a-z]{1,3}/.}; \
|
||||
say for uniq map { \
|
||||
$_ = (split /\\s/)[2]; \
|
||||
s!(remotes|origin)/!!g; \
|
||||
/$rx/ && !/HEAD/ ? $_ : () \
|
||||
} Git::command(qw/branch --sort=committerdate -r/) \
|
||||
'"
|
||||
|
||||
# rmbranch [<repository>] <branchname> deletes local and remote branch
|
||||
# <repository> defaults to origin
|
||||
rmbranch = !"perl -MGit -E' \
|
||||
my ($re, $br) = (@ARGV > 1? shift : q{origin}, shift // q{}); \
|
||||
Git::command_noisy(qw{branch -d}, $br); \
|
||||
Git::command_noisy(qw{push -d}, $re, $br); \
|
||||
'"
|
||||
[user]
|
||||
name = yushyin
|
||||
email = yushyin@saga
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
13
home/modules/by-name/git/default.nix
Normal file
13
home/modules/by-name/git/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
lib.mkIf config.programs.git.enable {
|
||||
xdg.configFile."git/extra.inc".source = ./config;
|
||||
programs.git.includes = [{ path = "${config.xdg.configHome}/git/extra.inc"; }];
|
||||
|
||||
home.packages = with pkgs; [ git-absorb ];
|
||||
|
||||
programs.zsh.shellAliases."g" = "git";
|
||||
}
|
||||
27
home/modules/by-name/gtk/default.nix
Normal file
27
home/modules/by-name/gtk/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
themeCss = builtins.readFile config.shelter.themes.base16.adw-colors;
|
||||
in
|
||||
lib.mkIf config.gtk.enable {
|
||||
gtk.theme = {
|
||||
name = "adw-gtk3";
|
||||
package = pkgs.adw-gtk3;
|
||||
};
|
||||
|
||||
gtk.iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
};
|
||||
|
||||
gtk.gtk3.extraCss = lib.mkMerge [
|
||||
themeCss
|
||||
];
|
||||
|
||||
gtk.gtk4.extraCss = lib.mkMerge [
|
||||
themeCss
|
||||
];
|
||||
}
|
||||
32
home/modules/by-name/herbstluftwm/default.nix
Normal file
32
home/modules/by-name/herbstluftwm/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
scripts = pkgs.callPackage ./scripts {};
|
||||
in
|
||||
lib.mkIf config.xsession.windowManager.herbstluftwm.enable {
|
||||
xsession.windowManager.herbstluftwm = {
|
||||
keybinds = {
|
||||
Mod4-x = "spawn ${pkgs.rofi}/bin/rofi -show run";
|
||||
Mod4-w = "spawn ${pkgs.rofi}/bin/rofi -window-command 'herbstclient bring {window}' -show window";
|
||||
Mod4-m = "spawn ${pkgs.herbstluftwm.doc}/share/doc/herbstluftwm/examples/maximize.sh";
|
||||
XF86AudioPlay = "spawn ${pkgs.playerctl}/bin/playerctl -i firefox play-pause";
|
||||
};
|
||||
|
||||
# TODO: maybe move as much from extraConfig.sh to attrset-settings as possible
|
||||
extraConfig = ''
|
||||
herbstclient spawn ${./extraConfig.sh}
|
||||
herbstclient spawn ${config.shelter.themes.base16.herbstluftwm}
|
||||
herbstclient spawn ${scripts}/bin/hlwm-polybar-restart-panels
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."polybar/config.ini".text = import ./polybar-config.nix {
|
||||
inherit scripts;
|
||||
theme = config.shelter.themes.base16.polybar;
|
||||
};
|
||||
|
||||
programs.zsh.shellAliases."hc" = "herbstclient";
|
||||
}
|
||||
147
home/modules/by-name/herbstluftwm/extraConfig.sh
Executable file
147
home/modules/by-name/herbstluftwm/extraConfig.sh
Executable file
|
|
@ -0,0 +1,147 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# this is a simple config for herbstluftwm
|
||||
|
||||
# keybindings
|
||||
Mod=Mod4 # Super key is Mod4
|
||||
|
||||
herbstclient keybind $Mod-Shift-q quit
|
||||
herbstclient keybind $Mod-Shift-r reload
|
||||
herbstclient keybind $Mod-Shift-c close
|
||||
herbstclient keybind $Mod-Return spawn "${TERMINAL:-alacritty}" # use your $TERMINAL with termite as fallback
|
||||
|
||||
# basic movement
|
||||
# focusing clients
|
||||
herbstclient keybind $Mod-Left focus left
|
||||
herbstclient keybind $Mod-Down focus down
|
||||
herbstclient keybind $Mod-Up focus up
|
||||
herbstclient keybind $Mod-Right focus right
|
||||
herbstclient keybind $Mod-h focus left
|
||||
herbstclient keybind $Mod-j focus down
|
||||
herbstclient keybind $Mod-k focus up
|
||||
herbstclient keybind $Mod-l focus right
|
||||
|
||||
# moving clients
|
||||
herbstclient keybind $Mod-Shift-Left shift left
|
||||
herbstclient keybind $Mod-Shift-Down shift down
|
||||
herbstclient keybind $Mod-Shift-Up shift up
|
||||
herbstclient keybind $Mod-Shift-Right shift right
|
||||
herbstclient keybind $Mod-Shift-h shift left
|
||||
herbstclient keybind $Mod-Shift-j shift down
|
||||
herbstclient keybind $Mod-Shift-k shift up
|
||||
herbstclient keybind $Mod-Shift-l shift right
|
||||
|
||||
# splitting frames
|
||||
# create an empty frame at the specified direction
|
||||
herbstclient keybind $Mod-u split bottom 0.5
|
||||
herbstclient keybind $Mod-o split right 0.5
|
||||
# let the current frame explode into subframes
|
||||
herbstclient keybind $Mod-Control-space split explode
|
||||
|
||||
# resizing frames
|
||||
resizestep=0.05
|
||||
herbstclient keybind $Mod-Control-h resize left +$resizestep
|
||||
herbstclient keybind $Mod-Control-j resize down +$resizestep
|
||||
herbstclient keybind $Mod-Control-k resize up +$resizestep
|
||||
herbstclient keybind $Mod-Control-l resize right +$resizestep
|
||||
herbstclient keybind $Mod-Control-Left resize left +$resizestep
|
||||
herbstclient keybind $Mod-Control-Down resize down +$resizestep
|
||||
herbstclient keybind $Mod-Control-Up resize up +$resizestep
|
||||
herbstclient keybind $Mod-Control-Right resize right +$resizestep
|
||||
|
||||
# tags
|
||||
tag_names=( eins zwei drei vier )
|
||||
tag_keys=( {1..9} 0 )
|
||||
|
||||
herbstclient rename default "${tag_names[0]}" || true
|
||||
for i in "${!tag_names[@]}" ; do
|
||||
herbstclient add "${tag_names[$i]}"
|
||||
key="${tag_keys[$i]}"
|
||||
if ! [ -z "$key" ] ; then
|
||||
herbstclient keybind "$Mod-$key" substitute PRE tags.focus.index chain + use_index "$i" + or , compare tags.focus.index != PRE , use_previous
|
||||
herbstclient keybind "$Mod-Shift-$key" move_index "$i"
|
||||
fi
|
||||
done
|
||||
|
||||
# cycle through tags
|
||||
herbstclient keybind $Mod-period use_index +1 --skip-visible
|
||||
herbstclient keybind $Mod-comma use_index -1 --skip-visible
|
||||
|
||||
# layouting
|
||||
herbstclient keybind $Mod-r remove
|
||||
herbstclient keybind $Mod-s floating toggle
|
||||
herbstclient keybind $Mod-f fullscreen toggle
|
||||
herbstclient keybind $Mod-p pseudotile toggle
|
||||
# The following cycles through the available layouts within a frame, but skips
|
||||
# layouts, if the layout change wouldn't affect the actual window positions.
|
||||
# I.e. if there are two windows within a frame, the grid layout is skipped.
|
||||
herbstclient keybind $Mod-space \
|
||||
or , and . compare tags.focus.curframe_wcount = 2 \
|
||||
. cycle_layout +1 vertical horizontal max vertical grid \
|
||||
, cycle_layout +1
|
||||
|
||||
# mouse
|
||||
herbstclient mouseunbind --all
|
||||
herbstclient mousebind $Mod-Button1 move
|
||||
herbstclient mousebind $Mod-Button2 zoom
|
||||
herbstclient mousebind $Mod-Button3 resize
|
||||
|
||||
# focus
|
||||
herbstclient keybind $Mod-BackSpace cycle_monitor
|
||||
herbstclient keybind $Mod-Tab cycle_all +1
|
||||
herbstclient keybind $Mod-Shift-Tab cycle_all -1
|
||||
herbstclient keybind $Mod-c cycle
|
||||
herbstclient keybind $Mod-i jumpto urgent
|
||||
|
||||
herbstclient set auto_detect_monitors 1
|
||||
|
||||
herbstclient set frame_border_width 1
|
||||
herbstclient set frame_bg_transparent 1
|
||||
herbstclient set frame_transparent_width 5
|
||||
herbstclient set frame_gap 4
|
||||
herbstclient set frame_padding 2
|
||||
|
||||
herbstclient set window_border_width 3
|
||||
herbstclient set window_border_inner_width 1
|
||||
herbstclient set always_show_frame 1
|
||||
herbstclient set window_gap -2
|
||||
|
||||
herbstclient set smart_window_surroundings 0
|
||||
herbstclient set smart_frame_surroundings 1
|
||||
|
||||
herbstclient set mouse_recenter_gap 0
|
||||
|
||||
herbstclient set_attr settings.tabbed_max true
|
||||
herbstclient set_attr theme.title_font 'monospace:pixelsize=12'
|
||||
herbstclient set_attr theme.padding_top 1
|
||||
herbstclient set_attr theme.title_height 13
|
||||
herbstclient set_attr theme.title_depth 3
|
||||
|
||||
herbstclient chain , \
|
||||
, attr theme.color '#272822' \
|
||||
, attr theme.background_color '#49483e' \
|
||||
, attr theme.normal.color '#383831' \
|
||||
, attr theme.active.color '#fd971f' \
|
||||
, attr theme.active.background_color '#f4bf75' \
|
||||
, attr theme.urgent.color '#f92672' \
|
||||
, attr theme.floating.active.color '#66d9ef' \
|
||||
, attr theme.floating.urgent.color '#ae81ff' \
|
||||
, attr theme.floating.background_color '#a1efe4' \
|
||||
, attr settings.frame_bg_normal_color '#49483e' \
|
||||
, attr settings.frame_bg_active_color '#f4bf75' \
|
||||
, attr settings.frame_border_normal_color '#272822' \
|
||||
, attr settings.frame_border_active_color '#75715e' \
|
||||
, attr theme.title_color white \
|
||||
, attr theme.active.title_color black
|
||||
|
||||
# rules
|
||||
herbstclient rule focus=off # normally do not focus new clients
|
||||
herbstclient rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
|
||||
herbstclient rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
|
||||
herbstclient rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
|
||||
|
||||
herbstclient set tree_style '╾│ ├└╼─┐'
|
||||
65
home/modules/by-name/herbstluftwm/polybar-config.nix
Normal file
65
home/modules/by-name/herbstluftwm/polybar-config.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ scripts, theme }: ''
|
||||
|
||||
include-file = ${theme}
|
||||
|
||||
[variables]
|
||||
screen = ''${env:POLYBAR_SCREEN:eDP-1}
|
||||
|
||||
[bar/hlwm/main]
|
||||
|
||||
monitor = ''${variables.screen}
|
||||
|
||||
modules-left = hlwm-tagstatus xwindow
|
||||
modules-right= date
|
||||
|
||||
font-0 = "regular:size=13;2"
|
||||
font-1 = "monospace:size=13;2"
|
||||
dpi=72
|
||||
|
||||
height = 18px
|
||||
;;offset-y = 2px
|
||||
|
||||
bottom = false
|
||||
separator = ''${theme.bar-separator}
|
||||
|
||||
background = ''${theme.background}
|
||||
line-size = 0
|
||||
line-color = #f00
|
||||
|
||||
padding-right = 2
|
||||
module-margin-left = 1
|
||||
|
||||
tray-detached = false
|
||||
tray-offset-x = 2
|
||||
tray-offset-y = 0
|
||||
tray-padding = 2
|
||||
tray-maxsize = 20
|
||||
tray-scale = 1.0
|
||||
tray-position = right
|
||||
tray-background = ''${theme.background}
|
||||
|
||||
[bar/hlwm/sub]
|
||||
inherit = bar/hlwm/main
|
||||
tray-position= ""
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
|
||||
interval = 7.0
|
||||
date = %Y-%m-%d%
|
||||
time = %H:%M
|
||||
|
||||
label = ''${theme.date-label}
|
||||
|
||||
[module/hlwm-tagstatus]
|
||||
type = custom/script
|
||||
exec = ${scripts}/bin/hlwm-polybar-tagstatus
|
||||
tail=true
|
||||
''
|
||||
25
home/modules/by-name/herbstluftwm/scripts/default.nix
Normal file
25
home/modules/by-name/herbstluftwm/scripts/default.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ lib, pkgs, stdenvNoCC, perl, makeWrapper }:
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "hlwm-scripts";
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
dontUnpack = true;
|
||||
buildInputs = [ perl ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${./hlwm-polybar-restart-panels.pl} $out/bin/hlwm-polybar-restart-panels \
|
||||
--prefix PATH : ${lib.makeBinPath (with pkgs; [ perl procps psmisc polybar ])}
|
||||
|
||||
makeWrapper ${./hlwm-polybar-tagstatus.pl} $out/bin/hlwm-polybar-tagstatus \
|
||||
--prefix PATH : ${lib.makeBinPath (with pkgs; [ perl herbstluftwm ])}
|
||||
|
||||
makeWrapper ${./rofi-powermenu.pl} $out/bin/rofi-powermenu \
|
||||
--prefix PATH : ${lib.makeBinPath (with pkgs; [ perl herbstluftwm rofi i3lock playerctl ])}
|
||||
'';
|
||||
}
|
||||
|
||||
51
home/modules/by-name/herbstluftwm/scripts/hlwm-polybar-restart-panels.pl
Executable file
51
home/modules/by-name/herbstluftwm/scripts/hlwm-polybar-restart-panels.pl
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
use List::Util qw/first/;
|
||||
|
||||
sub panel {
|
||||
local $ENV{POLYBAR_SCREEN} = shift;
|
||||
local $ENV{POLYBAR_MONITOR} = shift;
|
||||
{local $"=' '; system qq(polybar --log=error @_ & disown)}
|
||||
}
|
||||
|
||||
sub hc { local $"=' '; qx(herbstclient @_) }
|
||||
|
||||
sub isrunning_polybar { qx(pgrep -cx polybar) != 0 }
|
||||
|
||||
sub monitor_configuration {
|
||||
my %mons;
|
||||
|
||||
for (qx(polybar -m)) {
|
||||
my ($screen, $geo, $pri) = $_ =~ /([^:]+): ([0-9x+]+)( \(primary\))?/;
|
||||
$mons{$geo} = {screengeo => $geo, screen => $screen, pri => (defined $pri? 1 : 0)}
|
||||
}
|
||||
|
||||
for (hc qw/list_monitors/) {
|
||||
my ($mon, $geo) = $_ =~ /([^:]+): ([0-9x+]+)/;
|
||||
$mons{$geo} = {%{$mons{$geo}}, mon => $mon, mongeo => $geo};
|
||||
}
|
||||
|
||||
map {
|
||||
my $bar = defined $_->{pri} && $_->{pri} == 1? 'hlwm/main' : 'hlwm/sub';
|
||||
[ $_->{screen}, $_->{mon}, $bar]
|
||||
} values %mons;
|
||||
}
|
||||
|
||||
sub run {
|
||||
hc qw/emit_hook quit_panel/;
|
||||
|
||||
qx(killall -q polybar) if isrunning_polybar;
|
||||
{my $timeout = 10; sleep 1 while (isrunning_polybar and $timeout--)}
|
||||
|
||||
do { panel @$_ for monitor_configuration } unless isrunning_polybar;
|
||||
}
|
||||
|
||||
run;
|
||||
60
home/modules/by-name/herbstluftwm/scripts/hlwm-polybar-tagstatus.pl
Executable file
60
home/modules/by-name/herbstluftwm/scripts/hlwm-polybar-tagstatus.pl
Executable file
|
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use v5.36;
|
||||
use List::Util qw/tail/;
|
||||
|
||||
sub hc {local $" = ' '; $_ = qx(herbstclient @_); chomp; $_}
|
||||
|
||||
sub with_hc_idle {
|
||||
my $cb = pop;
|
||||
|
||||
my $fh;
|
||||
{ local $" = " "; open($fh, '-|', qq(herbstclient --idle @_)) or die $!; }
|
||||
|
||||
do { $cb->() } while <$fh>;
|
||||
}
|
||||
|
||||
sub run {
|
||||
my $monitor = $ENV{POLYBAR_MONITOR} // 0;
|
||||
my %colors = (
|
||||
#nor_fg => hc(qw/get_attr theme.title_color/),
|
||||
nor_fg => '#ababab',
|
||||
nor_bg => hc(qw/get_attr settings.frame_border_normal_color/),
|
||||
sel_fg => '#101010',
|
||||
sel_bg => hc(qw/get_attr theme.active.color/),
|
||||
urg_bg => hc(qw/get_attr theme.urgent.color/),
|
||||
unf_fg => '#141414',
|
||||
unf_bg => hc(qw/get_attr theme.active.background_color/),
|
||||
);
|
||||
|
||||
with_hc_idle qw/tag_/, sub {
|
||||
my @tags = tail -1, split /\t/, hc qw/tag_status/, $monitor;
|
||||
|
||||
for my $tag (@tags) {
|
||||
my ($idx, $name) = (substr($tag, 0, 1), substr($tag, 1));
|
||||
|
||||
for ($idx) {
|
||||
# states:
|
||||
# : the tag is not empty
|
||||
# + the tag is viewed on the specified MONITOR, but this monitor is not focused
|
||||
# # the tag is viewed on the specified MONITOR and it is focused
|
||||
# ! the tag contains an urgent window
|
||||
if (/^:/) { print "%{F$colors{nor_fg}}"; last}
|
||||
if (/^\+/) { print "%{F$colors{unf_fg}}%{B$colors{unf_bg}}"; last}
|
||||
if (/^#/) { print "%{F$colors{sel_fg}}%{B$colors{sel_bg}}"; last}
|
||||
if (/^!/) { print "%{F#141414}%{B$colors{urg_bg}}"; last}
|
||||
print "%{F#ababab}%{B-}"
|
||||
}
|
||||
|
||||
print "%{A1:herbstclient chain , focus_monitor $monitor , use $name:} $name %{A -u -o F- B-}";
|
||||
}
|
||||
print "\n";
|
||||
STDOUT->flush;
|
||||
};
|
||||
}
|
||||
|
||||
run;
|
||||
48
home/modules/by-name/herbstluftwm/scripts/rofi-powermenu.pl
Executable file
48
home/modules/by-name/herbstluftwm/scripts/rofi-powermenu.pl
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
exec qw/rofi -show powermenu -selected-row 2 -matching fuzzy/
|
||||
, '-modes', 'powermenu:' . __FILE__
|
||||
, '-theme-str'
|
||||
, <<~'EOF'
|
||||
* { icon-font: "monospace 18"; }
|
||||
window { width: 33%; }
|
||||
inputbar { children: [ textbox-icon, prompt, entry ]; border: 0 0 0; }
|
||||
textbox-icon { str: "⏻"; text-color: @red; font: @icon-font; }
|
||||
prompt { enabled: false; }
|
||||
listview {
|
||||
scrollbar: true;
|
||||
layout: horizontal;
|
||||
}
|
||||
element {
|
||||
padding: 30px;
|
||||
background-color: @lightbg;
|
||||
}
|
||||
element.selected {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @background;
|
||||
}
|
||||
EOF
|
||||
, @ARGV
|
||||
unless defined $ENV{ROFI_RETV};
|
||||
|
||||
my @entry = ("Reboot", "Lock", "Sleep", "Logout", "Reload");
|
||||
|
||||
do {; print join "\n", @entry; exit 0} if $ENV{ROFI_RETV} == 0;
|
||||
|
||||
sub sctl { system 'systemctl', @_; }
|
||||
|
||||
for (@ARGV) {
|
||||
if (/^Reboot/) { sctl qw/reboot/; exit 0 }
|
||||
if (/^Lock/) { system qw/i3lock/; exit 0 }
|
||||
if (/^Sleep/) { system qw/playerctl -a stop/; sctl qw/suspend/; exit 0; }
|
||||
if (/^Logout/) { system qw/herbsluftwm quit/; exit 0 }
|
||||
if (/^Reload/) { system qw/herbsluftwm reload/; exit 0 }
|
||||
exit 1;
|
||||
}
|
||||
|
||||
__END__
|
||||
# vim: set ft=perl:
|
||||
11
home/modules/by-name/logseq/default.nix
Normal file
11
home/modules/by-name/logseq/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }: {
|
||||
options.programs.logseq.enable = lib.mkEnableOption "Whether to enable logseq";
|
||||
|
||||
config = lib.mkIf config.programs.logseq.enable {
|
||||
home.packages = with pkgs; [ logseq ];
|
||||
};
|
||||
}
|
||||
15
home/modules/by-name/mpv/default.nix
Normal file
15
home/modules/by-name/mpv/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }: lib.mkIf config.programs.mpv.enable
|
||||
{
|
||||
programs.mpv.config = {
|
||||
hwdec = "auto";
|
||||
ytdl-format = "bestvideo[height<=1080][vcodec !^= vp9]+bestaudio/best";
|
||||
};
|
||||
|
||||
programs.mpv.package = lib.mkDefault (pkgs.wrapMpv pkgs.mpv-unwrapped {
|
||||
scripts = with pkgs.mpvScripts; [ uosc webtorrent-mpv-hook ];
|
||||
});
|
||||
}
|
||||
93
home/modules/by-name/neovim/default.nix
Normal file
93
home/modules/by-name/neovim/default.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
let
|
||||
inherit (inputs.theming.lib.base16) getAppThemesPath;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.programs.neovim.enable {
|
||||
programs.neovim.defaultEditor = true;
|
||||
|
||||
programs.neovim.extraLuaConfig = ''
|
||||
vim.opt.rtp:prepend("${pkgs.vimPlugins.lazy-nvim}")
|
||||
require("lazy").setup("plugins",{
|
||||
install = { missing = false },
|
||||
})
|
||||
require("config")
|
||||
'';
|
||||
|
||||
xdg.configFile."nvim/lua/config/init.lua".source = ./lua/config/init.lua;
|
||||
xdg.configFile."nvim/lua/utils/lsp/init.lua".source = ./lua/utils/lsp/init.lua;
|
||||
xdg.configFile."nvim/lua/plugins/init.lua".source = ./lua/plugins/init.lua;
|
||||
|
||||
xdg.configFile."nvim/colors".source = getAppThemesPath "nvim";
|
||||
|
||||
xdg.configFile."nvim/lua/hm-extra.lua".text =
|
||||
let
|
||||
toLua = lib.generators.toLua { };
|
||||
langs = config.profiles.dev.lang;
|
||||
servers = lib.attrValues (lib.filterAttrs (n: _: langs.${n}.enable) {
|
||||
haskell = "hls";
|
||||
nix = "nixd";
|
||||
purescript = "purescriptls";
|
||||
lua = "lua_ls";
|
||||
});
|
||||
in
|
||||
''
|
||||
local M = {}
|
||||
|
||||
M.lspconf = {}
|
||||
|
||||
M.lspconf.servers = ${toLua servers}
|
||||
|
||||
M.colorscheme = {}
|
||||
|
||||
M.colorscheme.setup = function()
|
||||
vim.o.background = 'dark'
|
||||
vim.cmd [[colorscheme base16-${config.shelter.themes.base16}]]
|
||||
end
|
||||
|
||||
return M
|
||||
'';
|
||||
|
||||
xdg.configFile."nvim/lua/hm-plugins-rtps.lua".text =
|
||||
let
|
||||
rtps = lib.mapAttrs (_: v: "${v}") {
|
||||
inherit (pkgs.vimPlugins)
|
||||
cmp-buffer
|
||||
cmp-nvim-lsp
|
||||
cmp-nvim-lsp-signature-help
|
||||
cmp_luasnip
|
||||
lspkind-nvim
|
||||
lualine-nvim
|
||||
luasnip
|
||||
mini-nvim
|
||||
null-ls-nvim
|
||||
base16-nvim
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
nvim-web-devicons
|
||||
plenary-nvim
|
||||
purescript-vim
|
||||
telescope-file-browser-nvim
|
||||
telescope-nvim
|
||||
;
|
||||
# inherit (inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.vimPlugins) nvim-lspconfig;
|
||||
nvim-treesitter = pkgs.symlinkJoin {
|
||||
name = "nvim-treesitter-with-all-grammars";
|
||||
paths = let ts = pkgs.vimPlugins.nvim-treesitter.withAllGrammars; in [ ts ] ++ ts.dependencies;
|
||||
};
|
||||
};
|
||||
in
|
||||
"return ${lib.generators.toLua {} rtps}";
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
vim = "nvim";
|
||||
v = "nvim";
|
||||
vimdiff = "nvim -d";
|
||||
nvimdiff = "nvim -d";
|
||||
};
|
||||
};
|
||||
}
|
||||
64
home/modules/by-name/neovim/lua/config/init.lua
Normal file
64
home/modules/by-name/neovim/lua/config/init.lua
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
-- SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
--
|
||||
-- SPDX-License-Identifier: MIT
|
||||
|
||||
vim.api.nvim_create_user_command('LspShowCapabilities', function(_)
|
||||
local caps = vim.tbl_map(
|
||||
function(i) return { [i.name] = i.resolved_capabilities()} end,
|
||||
vim.lsp.buf_get_clients()
|
||||
)
|
||||
|
||||
print(vim.inspect(vim.tbl_extend('keep', {}, unpack(caps))))
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = {'c','cpp'},
|
||||
command = 'setl cin cino+=:0,(s,l1',
|
||||
desc = 'C,C++ specific settings'
|
||||
})
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = {'plaintex', 'tex'},
|
||||
callback = function()
|
||||
vim.wo.linebreak = true
|
||||
|
||||
local opts = {expr = true, silent = true }
|
||||
vim.keymap.set({'n', 'v'}, 'j', "v:count ? 'j' : 'gj'", opts)
|
||||
vim.keymap.set({'n', 'v'}, 'k', "v:count ? 'k' : 'gk'", opts)
|
||||
end,
|
||||
desc = 'LaTeX specific settings'
|
||||
})
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
-- https://downloads.haskell.org/ghc/latest/docs/html/users_guide/using-warnings.html#ghc-flag--Wtabs
|
||||
-- https://peps.python.org/pep-0008/
|
||||
-- https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/guide.md#indentation-and-line-width
|
||||
pattern = {'cabal', 'haskell', 'purescript', 'python', 'rust'},
|
||||
command = 'setl ts=8 sts=4 et sr'
|
||||
})
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
-- https://github.com/NixOS/nixpkgs/blob/master/doc/contributing/coding-conventions.chapter.md
|
||||
pattern = {'cabal', 'elm', 'nix'},
|
||||
command = 'setl ts=8 sts=2 sw=2 et sr'
|
||||
})
|
||||
|
||||
-- options
|
||||
vim.opt.colorcolumn = '80,120'
|
||||
vim.opt.foldmethod = 'syntax'
|
||||
vim.opt.laststatus = 2
|
||||
vim.opt.lazyredraw = true
|
||||
vim.opt.listchars:append { eol = "¬", tab = "│ ", trail = "·" }
|
||||
vim.opt.pumblend = 20
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.smarttab = true
|
||||
vim.opt.tabstop = 4
|
||||
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
291
home/modules/by-name/neovim/lua/plugins/init.lua
Normal file
291
home/modules/by-name/neovim/lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
-- SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
--
|
||||
-- SPDX-License-Identifier: MIT
|
||||
|
||||
local rtps = require("hm-plugins-rtps");
|
||||
|
||||
return {
|
||||
-- https://github.com/purescript-contrib/purescript-vim
|
||||
{ dir = rtps["purescript-vim"], name = "purescript-vim", lazy = false },
|
||||
|
||||
|
||||
-- https://github.com/RRethy/base16-nvim
|
||||
{
|
||||
dir = rtps["base16-nvim"],
|
||||
name = "base16-nvim",
|
||||
lazy = false,
|
||||
enabled = true,
|
||||
config = function()
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
require'hm-extra'.colorscheme.setup()
|
||||
|
||||
local colors = require'base16-colorscheme'.colors
|
||||
local function hl(...) return vim.api.nvim_set_hl(0, ...) end
|
||||
|
||||
hl('CmpDocumentationBorder', {fg = colors.base05, bg = colors.base00})
|
||||
hl('CmpDocumentation', {fg = colors.base05, bg = colors.base00})
|
||||
hl('CmpItemAbbr', {fg = colors.base05, bg = colors.base01})
|
||||
hl('CmpItemAbbrDeprecated', {fg = colors.base03, strikethrough = true})
|
||||
hl('CmpItemAbbrMatch', {fg = colors.base0D})
|
||||
hl('CmpItemAbbrMatchFuzzy', {fg = colors.base0D})
|
||||
hl('CmpItemKindDefault', {fg = colors.base05})
|
||||
hl('CmpItemMenu', {fg = colors.base04})
|
||||
hl('CmpItemKindKeyword', {fg = colors.base0E})
|
||||
hl('CmpItemKindVariable', {fg = colors.base08})
|
||||
hl('CmpItemKindConstant', {fg = colors.base09})
|
||||
hl('CmpItemKindReference', {fg = colors.base08})
|
||||
hl('CmpItemKindValue', {fg = colors.base09})
|
||||
hl('CmpItemKindFunction', {fg = colors.base0D})
|
||||
hl('CmpItemKindMethod', {fg = colors.base0D})
|
||||
hl('CmpItemKindConstructor', {fg = colors.base0D})
|
||||
hl('CmpItemKindClass', {fg = colors.base0A})
|
||||
hl('CmpItemKindInterface', {fg = colors.base0A})
|
||||
hl('CmpItemKindStruct', {fg = colors.base0A})
|
||||
hl('CmpItemKindEvent', {fg = colors.base0A})
|
||||
hl('CmpItemKindEnum', {fg = colors.base0A})
|
||||
hl('CmpItemKindUnit', {fg = colors.base0A})
|
||||
hl('CmpItemKindModule', {fg = colors.base05})
|
||||
hl('CmpItemKindProperty', {fg = colors.base08})
|
||||
hl('CmpItemKindField', {fg = colors.base08})
|
||||
hl('CmpItemKindTypeParameter', {fg = colors.base0A})
|
||||
hl('CmpItemKindEnumMember', {fg = colors.base0A})
|
||||
hl('CmpItemKindOperator', {fg = colors.base05})
|
||||
hl('CmpItemKindSnippet', {fg = colors.base04})
|
||||
end
|
||||
},
|
||||
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
{
|
||||
dir = rtps["telescope-nvim"],
|
||||
name = "telescope-nvim",
|
||||
dependencies = { { dir = rtps["plenary-nvim"], name = "plenary-nvim" } },
|
||||
cmd = 'Telescope',
|
||||
init = function()
|
||||
vim.keymap.set('n', '[Telescope]', '<Nop>')
|
||||
vim.keymap.set('n', '<leader>f', '[Telescope]', {remap = true})
|
||||
|
||||
vim.keymap.set('n', '[Telescope]f', '<cmd>Telescope find_files<cr>')
|
||||
vim.keymap.set('n', '[Telescope]b', '<cmd>Telescope buffers<cr>')
|
||||
vim.keymap.set('n', '[Telescope]h', '<cmd>Telescope help_tags<cr>')
|
||||
vim.keymap.set('n', '[Telescope]q', '<cmd>Telescope builtin<cr>')
|
||||
|
||||
vim.keymap.set('n', '[Telescope]gg', '<cmd>Telescope live_grep<cr>')
|
||||
vim.keymap.set('n', '[Telescope]gs', '<cmd>Telescope grep_string<cr>')
|
||||
end
|
||||
},
|
||||
|
||||
-- https://github.com/nvim-telescope/telescope-file-browser.nvim
|
||||
{
|
||||
dir = rtps['telescope-file-browser-nvim'],
|
||||
name = "telescope-file-browser-nvim",
|
||||
-- after = 'telescope.nvim',
|
||||
init = function()
|
||||
vim.keymap.set('n', '[Telescope]B', '<cmd>Telescope file_browser<cr>')
|
||||
end,
|
||||
config = function() require'telescope'.load_extension 'file_browser' end
|
||||
},
|
||||
|
||||
{
|
||||
dir = rtps["nvim-treesitter"],
|
||||
name = "nvim-treesitter",
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
highlight = { enable = true }
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
{
|
||||
dir = rtps["nvim-cmp"],
|
||||
name = "nvim-cmp",
|
||||
dependencies = {
|
||||
{ dir = rtps["cmp-buffer"], name = "cmp-buffer" },
|
||||
{ dir = rtps["cmp-nvim-lsp-signature-help"], name = "cmp-nvim-lsp-signature-help" },
|
||||
{ dir = rtps["cmp-nvim-lsp"], name = "cmp-nvim-lsp" },
|
||||
{ dir = rtps["cmp_luasnip"], name = "cmp_luasnip" },
|
||||
{ dir = rtps["lspkind-nvim"], name = "lspkind-nvim" },
|
||||
{ dir = rtps["luasnip"], name = "luasnip" },
|
||||
{ dir = rtps["nvim-web-devicons"], name = "nvim-web-devicons" },
|
||||
},
|
||||
config = function()
|
||||
|
||||
vim.opt.pumheight = 10
|
||||
vim.opt.pumwidth = 10
|
||||
|
||||
local lspkind_ok, lspkind = pcall(require, 'lspkind')
|
||||
|
||||
local format = function (entry, item)
|
||||
item.menu = ({
|
||||
buffer = "[Bf]",
|
||||
nvim_lsp = "[LS]",
|
||||
luasnip = "[Sp]"
|
||||
})[entry.source.name] or ("[" .. entry.source.name .. "]")
|
||||
|
||||
return lspkind_ok and (
|
||||
lspkind.cmp_format({ mode = "symbol" })(entry, item)
|
||||
) or item
|
||||
end
|
||||
|
||||
-- local prevchar_isnot_space = function()
|
||||
-- local _, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
-- return not (col == 0 or vim.api.nvim_get_current_line():sub(col, col):match('%s') ~= nil)
|
||||
-- end
|
||||
|
||||
local cmp = require'cmp'
|
||||
local luasnip = require'luasnip'
|
||||
|
||||
cmp.setup({
|
||||
completion = { completeopt = 'menu,menueone,noinsert' },
|
||||
-- mappings from preset:
|
||||
-- <Down> select_next_item
|
||||
-- <Up> select_prev_item
|
||||
-- <C-y> confirm
|
||||
-- <C-e> abort
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-n>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
-- -- useful it you use <Tab>
|
||||
-- elseif prevchar_isnot_space() then
|
||||
-- cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
['<C-p>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'}),
|
||||
['<Cr>'] = cmp.mapping(function(fallback)
|
||||
if cmp.get_active_entry() then
|
||||
cmp.confirm()
|
||||
elseif cmp.visible() then
|
||||
cmp.abort()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {'i', 's'})
|
||||
}),
|
||||
snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
|
||||
sources = {
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'luasnip'},
|
||||
},
|
||||
formatting = {
|
||||
fields = { cmp.ItemField.Kind, cmp.ItemField.Abbr, cmp.ItemField.Menu },
|
||||
format = format
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
},
|
||||
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
{
|
||||
dir = rtps['nvim-lspconfig'],
|
||||
name = "nvim-lspconfig",
|
||||
enabled = true,
|
||||
config = function()
|
||||
local lspconf = require'lspconfig'
|
||||
local on_attach = require'utils.lsp'.common_on_attach
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local capabilities = false;
|
||||
|
||||
pcall(function() capabilities = require('cmp_nvim_lsp').default_capabilities() end)
|
||||
|
||||
local configs = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = vim.split(package.path, ';')
|
||||
},
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
telemetry = { enable = false }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setmetatable(configs, { __index = function () return {} end })
|
||||
|
||||
lspconf.util.default_config = vim.tbl_extend(
|
||||
"force",
|
||||
lspconf.util.default_config,
|
||||
{ on_attach = on_attach, capabilities = capabilities }
|
||||
)
|
||||
|
||||
local servers = require('hm-extra').lspconf.servers
|
||||
|
||||
for _,server in ipairs(servers) do
|
||||
lspconf[server].setup(configs[server])
|
||||
end
|
||||
|
||||
end
|
||||
},
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim
|
||||
{
|
||||
dir = rtps['null-ls-nvim'],
|
||||
name = "null-ls-nvim",
|
||||
dependencies = { { dir = rtps["nvim-lspconfig"], name = "nvim-lspconfig" } },
|
||||
config = function()
|
||||
local nls = require'null-ls'
|
||||
nls.setup({
|
||||
on_attach = require'utils.lsp'.common_on_attach,
|
||||
sources = {
|
||||
nls.builtins.code_actions.shellcheck,
|
||||
nls.builtins.diagnostics.shellcheck
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
{
|
||||
dir = rtps['lualine-nvim'],
|
||||
name = "lualine-nvim",
|
||||
dependencies = {
|
||||
{ dir = rtps["nvim-web-devicons"], name = "nvim-web-devicons" },
|
||||
{ dir = rtps["base16-nvim"], name = "base16-nvim" },
|
||||
},
|
||||
config = function() require'lualine'.setup {
|
||||
options = { theme = 'base16'},
|
||||
} end
|
||||
},
|
||||
|
||||
-- https://github.com/echasnovski/mini.nvim
|
||||
{
|
||||
dir = rtps['mini-nvim'],
|
||||
name = "mini-nvim",
|
||||
event = 'VeryLazy',
|
||||
config = function ()
|
||||
require('mini.ai').setup()
|
||||
require('mini.splitjoin').setup()
|
||||
require('mini.surround').setup()
|
||||
require('mini.align').setup()
|
||||
require('mini.indentscope').setup({
|
||||
symbol = '│',
|
||||
draw = { animation = require('mini.indentscope').gen_animation.none() },
|
||||
})
|
||||
require('mini.comment').setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
24
home/modules/by-name/neovim/lua/utils/lsp/init.lua
Normal file
24
home/modules/by-name/neovim/lua/utils/lsp/init.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
-- SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
--
|
||||
-- SPDX-License-Identifier: MIT
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.common_on_attach(_, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
local opts = {buffer = bufnr, silent = true}
|
||||
vim.keymap.set('n', '[Lsp]', '[Nop]', opts)
|
||||
vim.keymap.set('n', '<leader>l', '[Lsp]', {remap = true, unpack(opts)})
|
||||
|
||||
vim.keymap.set('n', '[Lsp]dd', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '[Lsp]ds', vim.lsp.buf.document_symbol, opts)
|
||||
vim.keymap.set('n', '[Lsp]r', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set('n', '[Lsp]a', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', '[Lsp]h', vim.lsp.buf.hover, opts)
|
||||
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
end
|
||||
|
||||
return M
|
||||
10
home/modules/by-name/redshift/default.nix
Normal file
10
home/modules/by-name/redshift/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, ... }:
|
||||
lib.mkIf config.services.redshift.enable {
|
||||
services.redshift.provider = lib.mkDefault "manual";
|
||||
services.redshift.latitude = lib.mkDefault 50.115;
|
||||
services.redshift.longitude = lib.mkDefault 8.684;
|
||||
}
|
||||
34
home/modules/by-name/tmux/config
Normal file
34
home/modules/by-name/tmux/config
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# vim: ft=tmux
|
||||
|
||||
# Styles
|
||||
setw -g mode-style fg=yellow,bg=default,bright
|
||||
setw -g window-status-style fg=default,bg=default,dim
|
||||
setw -g window-status-current-style fg=yellow,bg=default,dim
|
||||
|
||||
set -g message-style fg=default,bg=red,bright
|
||||
set -g status-style fg=default,bg=black,bright
|
||||
set -g pane-active-border-style fg=default,bg=black
|
||||
|
||||
# Options
|
||||
set -g bell-action any
|
||||
set -g history-limit 50000
|
||||
set -g status on
|
||||
#set -g status-keys vi
|
||||
set -g set-titles on
|
||||
|
||||
set -g default-terminal "tmux-256color"
|
||||
|
||||
# https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
|
||||
set -as terminal-features ",alacritty*:RGB"
|
||||
|
||||
set -g set-titles-string "tmux:#{=/8/..:session_name}:#{window_index} [#{=/8/..:window_name};#{pane_title}]"
|
||||
set -g base-index 1
|
||||
|
||||
setw -g automatic-rename on
|
||||
setw -g clock-mode-style 24
|
||||
|
||||
bind r source-file ~/.config/tmux/tmux.conf
|
||||
13
home/modules/by-name/tmux/default.nix
Normal file
13
home/modules/by-name/tmux/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.programs.tmux.enable {
|
||||
programs.tmux.sensibleOnTop = false;
|
||||
programs.tmux.extraConfig = builtins.readFile ./config + ''
|
||||
source-file ${config.shelter.themes.base16.tmux}
|
||||
'';
|
||||
};
|
||||
}
|
||||
8
home/modules/by-name/zathura/default.nix
Normal file
8
home/modules/by-name/zathura/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, ... }:
|
||||
lib.mkIf config.programs.zathura.enable {
|
||||
programs.zathura.extraConfig = builtins.readFile config.shelter.themes.base16.zathura;
|
||||
}
|
||||
41
home/modules/by-name/zsh/default.nix
Normal file
41
home/modules/by-name/zsh/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
lib.mkIf config.programs.zsh.enable {
|
||||
programs.zsh = {
|
||||
dotDir = ".config/zsh";
|
||||
history.path = "${config.xdg.dataHome}/zsh/zsh_history";
|
||||
initExtra = builtins.readFile ./zshrc + ''
|
||||
# too lazy to configure my own prompt, thus just use pure-prompt for now
|
||||
fpath+=(${pkgs.pure-prompt}/share/zsh/site-functions)
|
||||
autoload -U promptinit; promptinit
|
||||
prompt pure
|
||||
|
||||
# function _set_title() { print -Pn "\e]0;sh:''${1:+" $1"} (%1~)\a" }; _set_title
|
||||
# autoload -Uz add-zsh-hook
|
||||
# add-zsh-hook preexec _set_title
|
||||
|
||||
# base16-shell
|
||||
base16_shell_theme_script=${config.shelter.themes.base16.shell}
|
||||
[ -n "$PS1" ] && [ -s $base16_shell_theme_script ] && . $base16_shell_theme_script
|
||||
unset base16_shell_theme_script
|
||||
'';
|
||||
|
||||
profileExtra = lib.mkOrder 3000 ''
|
||||
# eval "$(api_ver=$(perl -MConfig -e'print $Config{api_version}') && perl -I$HOME/.local/perl5.''${api_ver}/lib/perl5/ -Mlocal::lib=--deactivate-all,$HOME/.local/perl5.''${api_ver})"
|
||||
|
||||
# Start xorg on tty1 if it is not already running
|
||||
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
|
||||
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
"_" = "sudo ";
|
||||
l = "ls -l";
|
||||
ll = "ls -la";
|
||||
sc = "systemctl";
|
||||
};
|
||||
};
|
||||
}
|
||||
55
home/modules/by-name/zsh/zshrc
Normal file
55
home/modules/by-name/zsh/zshrc
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
# Input/Output
|
||||
setopt interactive_comments
|
||||
|
||||
# Expansion and Globbing
|
||||
setopt extended_glob nomatch
|
||||
|
||||
# Job Control
|
||||
unsetopt notify
|
||||
|
||||
# History
|
||||
setopt append_history hist_ignore_dups hist_ignore_space
|
||||
HISTFILE=~/.cache/zsh/histfile
|
||||
HISTSIZE=100000
|
||||
SAVEHIST=1000000
|
||||
|
||||
# Zle
|
||||
setopt beep
|
||||
autoload -z edit-command-line
|
||||
zle -N edit-command-line
|
||||
|
||||
# Keybinds
|
||||
bindkey -e
|
||||
bindkey \^U backward-kill-line
|
||||
bindkey \^X\^E edit-command-line
|
||||
|
||||
# Changing Directories
|
||||
setopt auto_cd auto_pushd
|
||||
DIRSTACKSIZE=30
|
||||
|
||||
# Completion
|
||||
setopt always_to_end list_ambiguous
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' use-perl on
|
||||
zstyle ':completion:*' use-cache on
|
||||
zstyle ':completion:*' cache-path $HOME/.cache/zsh/complcache
|
||||
zstyle ':completion:*:*:kill:*' command 'ps --forest -u$USER -o pid,%cpu,tty,cputime,cmd'
|
||||
zstyle :compinstall filename "$HOME/.config/zsh/.zshrc"
|
||||
autoload -Uz compinit
|
||||
compinit -d $HOME/.cache/zsh/zcompdump
|
||||
|
||||
# Misc
|
||||
typeset -U path
|
||||
path+=(~/.local/bin)
|
||||
path+=(~/.ghcup/bin ~/.cabal/bin)
|
||||
|
||||
function _set_title() { print -Pn "\e]0;sh:${1:+" $1"} (%1~)\a" }; _set_title
|
||||
autoload -Uz add-zsh-hook
|
||||
add-zsh-hook preexec _set_title
|
||||
|
||||
# Aliases
|
||||
alias chat="ssh karif -t 'TERM=\"xterm\" /usr/bin/bash -l -c \"tmux attach -t weechat\"'"
|
||||
35
home/modules/profiles/base.nix
Normal file
35
home/modules/profiles/base.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config.home) homeDirectory;
|
||||
in
|
||||
{
|
||||
options.profiles.base.enable = lib.mkEnableOption "Enable profiles.base";
|
||||
|
||||
config = lib.mkIf config.profiles.base.enable {
|
||||
home = {
|
||||
username = lib.mkDefault "yushyin";
|
||||
homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
|
||||
# move go clutter from home
|
||||
# see https://pkg.go.dev/cmd/go#hdr-Environment_variables
|
||||
GOPATH = "${homeDirectory}/.local/share/go";
|
||||
GOMODCACHE = "${homeDirectory}/.cache/go/mod";
|
||||
|
||||
# see https://doc.rust-lang.org/cargo/guide/cargo-home.html
|
||||
CARGO_HOME = "${homeDirectory}/.local/share/cargo";
|
||||
|
||||
TEXMFVAR = "${homeDirectory}/.cache/texlive";
|
||||
TEXMFHOME = "${homeDirectory}/.local/share/texlive";
|
||||
TEXMFCONFIG = "${homeDirectory}/.config/texlive";
|
||||
};
|
||||
|
||||
shelter.themes.base16 = "monokai";
|
||||
};
|
||||
}
|
||||
49
home/modules/profiles/dev.nix
Normal file
49
home/modules/profiles/dev.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, inputs, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib.dotfiles.module) mkBoolOpt;
|
||||
cfg = config.profiles.dev;
|
||||
in
|
||||
{
|
||||
options.profiles.dev = {
|
||||
enable = mkBoolOpt false "Enable profiles.dev";
|
||||
|
||||
lang = {
|
||||
haskell.enable = mkBoolOpt false "Enable profiles.dev.lang.haskell";
|
||||
lua.enable = mkBoolOpt true "Enable profiles.dev.lang.lua";
|
||||
nix.enable = mkBoolOpt true "Enable profiles.dev.lang.nix";
|
||||
purescript.enable = mkBoolOpt false "Enable profiles.dev.lang.purescript";
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
langs = lib.attrValues (lib.mapAttrs (n: v: lib.mkIf cfg.lang.${n}.enable v) {
|
||||
lua = {
|
||||
home.packages = with pkgs; [ lua-language-server ];
|
||||
};
|
||||
haskell = {
|
||||
home.packages = with pkgs; [ cabal-install ghc haskell-language-server ];
|
||||
};
|
||||
nix = {
|
||||
home.packages = (with pkgs; [ nixpkgs-fmt ]) ++ (with inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}; [ nixd ]);
|
||||
};
|
||||
purescript = {
|
||||
home.packages = with pkgs; [ nodePackages.purescript-language-server ];
|
||||
};
|
||||
});
|
||||
in
|
||||
lib.mkIf cfg.enable (lib.mkMerge (langs ++ [
|
||||
{
|
||||
home.packages = with pkgs; [ reuse shellcheck picocom ];
|
||||
programs.direnv.enable = true;
|
||||
programs.direnv = {
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
||||
]));
|
||||
}
|
||||
14
home/modules/profiles/esd.nix
Normal file
14
home/modules/profiles/esd.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
inherit (lib.dotfiles.module) mkBoolOpt;
|
||||
in
|
||||
{
|
||||
options.profiles.esd.enable = mkBoolOpt false "Enable profiles.esd (electronic system design)";
|
||||
config = lib.mkIf config.profiles.esd.enable {
|
||||
home.packages = with pkgs; [ kicad ];
|
||||
};
|
||||
}
|
||||
89
home/modules/profiles/graphical/default.nix
Normal file
89
home/modules/profiles/graphical/default.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }: {
|
||||
options.profiles.graphical.enable = lib.mkEnableOption "Enable profiles.graphical";
|
||||
|
||||
config = lib.mkIf config.profiles.graphical.enable {
|
||||
|
||||
xdg.enable = true;
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
xdg.userDirs =
|
||||
let
|
||||
inherit (config.home) homeDirectory;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
download = "${homeDirectory}/.cache/downloads";
|
||||
desktop = null;
|
||||
documents = null;
|
||||
music = null;
|
||||
pictures = null;
|
||||
publicShare = null;
|
||||
templates = null;
|
||||
videos = null;
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d %h/.cache/downloads 0755 - - 90d"
|
||||
];
|
||||
|
||||
programs.rofi.theme = "base16-monokai";
|
||||
|
||||
home.language.base = "en_IE.utf8";
|
||||
|
||||
xsession.enable = true;
|
||||
xsession.windowManager.herbstluftwm.enable = true;
|
||||
|
||||
gtk.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
fb-client
|
||||
gajim
|
||||
gimp
|
||||
inkscape
|
||||
libreoffice-fresh
|
||||
mumble
|
||||
pavucontrol
|
||||
spotify
|
||||
sxiv
|
||||
xclip
|
||||
];
|
||||
|
||||
programs.alacritty.enable = true;
|
||||
programs.firefox.enable = true;
|
||||
programs.logseq.enable = true;
|
||||
programs.mpv.enable = true;
|
||||
programs.rofi.enable = true;
|
||||
programs.zathura.enable = true;
|
||||
|
||||
services.redshift.enable = true;
|
||||
services.redshift.provider = "manual";
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
spotify = prev.spotify.overrideAttrs (prevAttrs: {
|
||||
preInstall = (prevAttrs.preInstall or "") + ''
|
||||
mkdir -p $out/lib/spotify
|
||||
ln -s ${pkgs.spotify-adblock}/lib/libspotifyadblock.so $out/lib/spotify
|
||||
'';
|
||||
postInstall = (prevAttrs.postInstall or "") + ''
|
||||
wrapProgram $out/bin/spotify \
|
||||
--set LD_PRELOAD "${pkgs.spotify-adblock}/lib/libspotifyadblock.so"
|
||||
|
||||
# Hide placeholder for advert banner
|
||||
${pkgs.unzip}/bin/unzip -p $out/share/spotify/Apps/xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > $out/share/spotify/Apps/xpui.js
|
||||
${pkgs.zip}/bin/zip --junk-paths --update $out/share/spotify/Apps/xpui.spa $out/share/spotify/Apps/xpui.js
|
||||
rm $out/share/spotify/Apps/xpui.js
|
||||
'';
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"spotify"
|
||||
];
|
||||
};
|
||||
}
|
||||
32
home/modules/profiles/shell/default.nix
Normal file
32
home/modules/profiles/shell/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
options.profiles.shell.enable = lib.mkEnableOption "Enable profiles.shell";
|
||||
|
||||
config = lib.mkIf config.profiles.shell.enable {
|
||||
programs.aria2.enable = true;
|
||||
programs.git.enable = true;
|
||||
programs.home-manager.enable = true;
|
||||
programs.neovim.enable = true;
|
||||
programs.tmux.enable = true;
|
||||
programs.zsh.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
fzf
|
||||
htop
|
||||
jq
|
||||
mtr
|
||||
ncdu
|
||||
pwgen
|
||||
rink
|
||||
ripgrep
|
||||
rsync
|
||||
speedtest-cli
|
||||
tree
|
||||
yt-dlp
|
||||
];
|
||||
};
|
||||
}
|
||||
60
home/modules/profiles/targets/genericLinux.nix
Normal file
60
home/modules/profiles/targets/genericLinux.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ config, pkgs, lib, inputs, ... }:
|
||||
let
|
||||
nixGLWrap = pkg: pkg.overrideAttrs (old: {
|
||||
name = "nixgl-${pkg.name}";
|
||||
|
||||
# Using `buildCommand` replaces the original packages build phases.
|
||||
buildCommand = ''
|
||||
set -euo pipefail
|
||||
${
|
||||
# Copy original files, for each split-output (`out`, `dev` etc.).
|
||||
# E.g. `${package.dev}` to `$dev`, and so on. If none, just "out".
|
||||
# Symlink all files from the original package to here (`cp -rs`),
|
||||
# to save disk space.
|
||||
lib.concatStringsSep "\n" (map (outputName: ''
|
||||
echo "Copying output ${outputName}"
|
||||
set -x
|
||||
cp -rs --no-preserve=mode "${pkg.${outputName}}" "''$${outputName}"
|
||||
set +x
|
||||
'') (old.outputs or ["out"]))
|
||||
}
|
||||
|
||||
rm -rf $out/bin/*
|
||||
shopt -s nullglob # Prevent loop from running if no files
|
||||
for file in ${pkg.out}/bin/*; do
|
||||
echo "#!${pkgs.bash}/bin/bash" > "$out/bin/$(basename $file)"
|
||||
echo "exec -a \"\$0\" ${lib.getExe pkgs.nixgl.nixGLMesa} $file \"\$@\"" >> "$out/bin/$(basename $file)"
|
||||
chmod +x "$out/bin/$(basename $file)"
|
||||
done
|
||||
shopt -u nullglob # Revert nullglob back to its normal default state
|
||||
'';
|
||||
});
|
||||
in
|
||||
lib.mkIf config.targets.genericLinux.enable {
|
||||
|
||||
systemd.user.systemctlPath = lib.mkDefault "/usr/bin/systemctl";
|
||||
|
||||
programs.mpv.package = nixGLWrap (pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = with pkgs.mpvScripts; [ uosc ]; });
|
||||
|
||||
programs.firefox.package = nixGLWrap pkgs.firefox;
|
||||
|
||||
# depend on the host installation, because it freezes with nixGL.
|
||||
# https://github.com/alacritty/alacritty/issues/6972 this might be the issue in question
|
||||
programs.alacritty.package = pkgs.emptyDirectory;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
inputs.nixGL.overlay
|
||||
(final: prev: lib.flip lib.genAttrs (name: nixGLWrap prev.${name})
|
||||
[
|
||||
# "alacritty"
|
||||
]
|
||||
)
|
||||
];
|
||||
|
||||
home.packages = [ pkgs.nixgl.nixGLMesa ];
|
||||
|
||||
}
|
||||
16
home/modules/themes/default.nix
Normal file
16
home/modules/themes/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ lib, inputs, ... }:
|
||||
let
|
||||
inherit (inputs.theming.lib.base16) getAllThemePaths;
|
||||
in
|
||||
{
|
||||
options.shelter.themes = {
|
||||
base16 = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
apply = name: { __toString = _: name; } // getAllThemePaths name;
|
||||
};
|
||||
};
|
||||
}
|
||||
11
lib/flake-module.nix
Normal file
11
lib/flake-module.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.lib = inputs.haumea.lib.load {
|
||||
src = ./src;
|
||||
inputs = { inherit (inputs.nixpkgs) lib; inherit inputs; };
|
||||
};
|
||||
}
|
||||
26
lib/src/fs.nix
Normal file
26
lib/src/fs.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ self, lib, inputs }:
|
||||
let
|
||||
haumea = inputs.haumea.lib;
|
||||
in
|
||||
{
|
||||
listNixFilesRecTilDef = dir:
|
||||
lib.collect (e: !lib.isAttrs e) (haumea.load {
|
||||
src = dir;
|
||||
loader = haumea.loaders.path;
|
||||
transformer = (_: v: v.default or v);
|
||||
});
|
||||
|
||||
toFringeModule = src: {
|
||||
imports = self.listNixFilesRecTilDef src;
|
||||
};
|
||||
|
||||
toTreeModule = src: { pkgs, ... }@args: haumea.load {
|
||||
inherit src;
|
||||
inputs = args;
|
||||
transformer = [ haumea.transformers.liftDefault ];
|
||||
};
|
||||
}
|
||||
9
lib/src/module.nix
Normal file
9
lib/src/module.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# SPDX-FileCopyrightText: 2024 yushyin <https://forge.nihilum.space/~yushyin/>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
{ lib }:
|
||||
{
|
||||
mkBoolOpt = default: description:
|
||||
lib.mkOption { inherit default description; type = lib.types.bool; };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue