diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 613def6..1a26681 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,6 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + # style: switch to `nixfmt-rfc-style` 02e3e3a7accee3cd32ea1d6b946fb8da20555fa5 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 718572b..40c744c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + version: 2 updates: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb3b9cb..59d675c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + name: Build on: @@ -6,24 +10,30 @@ on: pull_request: branches: ["main"] +permissions: + contents: read + jobs: build: strategy: matrix: label: - - Ryans-MacBook-Pro + - caladan include: - - label: Ryans-MacBook-Pro - path: darwinConfigurations.Ryans-MacBook-Pro.config.system.build.toplevel + - label: caladan + attr: darwinConfigurations.caladan.config.system.build.toplevel runner: macos-14 runs-on: ${{ matrix.runner }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 + with: + persist-credentials: false + - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v15 + uses: cachix/install-nix-action@d1ca217b388ee87b2507a9a93bf01368bde7cec2 # ratchet:cachix/install-nix-action@v31 - name: Build - run: nix build -L --show-trace .#${{ matrix.path }} + run: nix build -L --show-trace .#${{ matrix.attr }} diff --git a/.github/workflows/check-inputs.yml b/.github/workflows/check-inputs.yml deleted file mode 100644 index ed87769..0000000 --- a/.github/workflows/check-inputs.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Check flake inputs" - -on: - push: - branches: ["main"] - pull_request: - branches: ["main"] - -jobs: - check-inputs: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v15 - - - name: Check Nix flake Nixpkgs inputs - uses: DeterminateSystems/flake-checker-action@v9 - with: - send-statistics: false diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..8c39c6a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +name: Check + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +permissions: + contents: read + +jobs: + nixfmt: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Nix + uses: cachix/install-nix-action@d1ca217b388ee87b2507a9a93bf01368bde7cec2 # ratchet:cachix/install-nix-action@v31 + + - name: Check + run: nix build --print-build-logs '.#checks.x86_64-linux.nixfmt' + + reuse: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Nix + uses: cachix/install-nix-action@d1ca217b388ee87b2507a9a93bf01368bde7cec2 # ratchet:cachix/install-nix-action@v31 + + - name: Check + run: nix build --print-build-logs '.#checks.x86_64-linux.reuse' diff --git a/.gitignore b/.gitignore index 91e1f4c..94d7c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + .DS_Store result* diff --git a/LICENSE b/LICENSE index aa50e5a..137069b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,73 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - 1. Definitions. +1. Definitions. - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - END OF TERMS AND CONDITIONS +END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. +APPENDIX: How to apply the Apache License to your work. - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 Ryan Cao +Copyright [yyyy] [name of copyright owner] - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 +http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000..137069b --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSES/CC0-1.0.txt @@ -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. diff --git a/checks/default.nix b/checks/default.nix new file mode 100644 index 0000000..ab4380a --- /dev/null +++ b/checks/default.nix @@ -0,0 +1,49 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ self, ... }: +{ + perSystem = + { pkgs, config, ... }: + let + mkFlakeCheck = + args: + pkgs.stdenv.mkDerivation ( + { + name = "check-${args.name}"; + src = self; + + buildPhase = '' + ${args.command} + touch "$out" + ''; + + doCheck = false; + dontInstall = true; + dontFixup = true; + } + // (removeAttrs args [ + "name" + "command" + ]) + ); + in + { + checks = { + nixfmt = mkFlakeCheck { + name = "nixfmt"; + command = "find . -name '*.nix' -exec nixfmt --check {} +"; + + nativeBuildInputs = with pkgs; [ nixfmt-rfc-style ]; + }; + + reuse = mkFlakeCheck { + name = "reuse"; + command = "reuse lint"; + + nativeBuildInputs = with pkgs; [ reuse ]; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index badeb83..f865efb 100644 --- a/flake.lock +++ b/flake.lock @@ -2,19 +2,16 @@ "nodes": { "am": { "inputs": { - "nix-filter": [ - "nix-filter" - ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1731927628, - "narHash": "sha256-IqBX3qvvxR94mC6DePsTye6pHjhg40THvxUD405cm8U=", + "lastModified": 1743341436, + "narHash": "sha256-G16Liuyv9SOziASKI5qRuyp/wJpDKSfQP3ksj2YUDZQ=", "owner": "ryanccn", "repo": "am", - "rev": "c33a08341bb05761e7900dd4316446c6ef08b444", + "rev": "0e302b8eff61f1844b7dfd6991c479b03f7b98fc", "type": "github" }, "original": { @@ -24,12 +21,17 @@ } }, "catppuccin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1733001911, - "narHash": "sha256-uX/9m0TbdhEzuWA0muM5mI/AaWcLiDLjCCyu5Qr9MRk=", + "lastModified": 1743414153, + "narHash": "sha256-bFIXz7SvLlSNR4M3vYPYS1CpEN9vTUiH01R4iR/BDmA=", "owner": "catppuccin", "repo": "nix", - "rev": "a817009ebfd2cca7f70a77884e5098d0a8c83f8e", + "rev": "2f52f9ead26f80d7b391cedcbb3eb309bd83fff4", "type": "github" }, "original": { @@ -38,18 +40,23 @@ "type": "github" } }, - "darwin-custom-icons": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1719071371, - "narHash": "sha256-SPazmoL3Pls4QTiZ2CRtavecNJgzpL4GeiwafTmtdJ8=", - "owner": "ryanccn", - "repo": "nix-darwin-custom-icons", - "rev": "ad3e8cf49ef0b276ccf67410f544ff33d965d821", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { - "owner": "ryanccn", - "repo": "nix-darwin-custom-icons", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, @@ -60,11 +67,11 @@ ] }, "locked": { - "lastModified": 1733085484, - "narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=", + "lastModified": 1743607567, + "narHash": "sha256-kTzKPDFmNzwO1cK4fiJgPB/iSw7HgBAmknRTeAPJAeI=", "owner": "nix-community", "repo": "home-manager", - "rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163", + "rev": "49748c74cdbae03d70381f150b810f92617f23aa", "type": "github" }, "original": { @@ -75,19 +82,16 @@ }, "morlana": { "inputs": { - "nix-filter": [ - "nix-filter" - ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1732778088, - "narHash": "sha256-qx4IbbDhEbi5ZWcBNVw/Frxz8UWjMRafVFeTMlt3120=", + "lastModified": 1743340617, + "narHash": "sha256-laBEsV4Hxg6BxAjOKf7EclqZiOltNCi/mE4rNzfchME=", "owner": "ryanccn", "repo": "morlana", - "rev": "832662972c6a706ed0ba75196dafad1665cf68ba", + "rev": "9fe612776403d8eaa6860b78aa7f7dc68f1b41f0", "type": "github" }, "original": { @@ -103,34 +107,19 @@ ] }, "locked": { - "lastModified": 1733047432, - "narHash": "sha256-fQUKxgxAEHlL5bevRkdsQB7sSpAMhlvxf7Zw0KK8QIg=", - "owner": "LnL7", + "lastModified": 1743496612, + "narHash": "sha256-emPWa5lmKbnyuj8c1mSJUkzJNT+iJoU9GMcXwjp2oVM=", + "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "e30a3622b606dffc622305b4bbe1cfe37e78fa40", + "rev": "73d59580d01e9b9f957ba749f336a272869c42dd", "type": "github" }, "original": { - "owner": "LnL7", + "owner": "nix-darwin", "repo": "nix-darwin", "type": "github" } }, - "nix-filter": { - "locked": { - "lastModified": 1731533336, - "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -138,11 +127,11 @@ ] }, "locked": { - "lastModified": 1733024876, - "narHash": "sha256-vy9Q41hBE7Zg0yakF79neVgb3i3PQMSMR7uHPpPywFE=", + "lastModified": 1743306489, + "narHash": "sha256-LROaIjSLo347cwcHRfSpqzEOa2FoLSeJwU4dOrGm55E=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "6e0b7f81367069589a480b91603a10bcf71f3103", + "rev": "b3696bfb6c24aa61428839a99e8b40c53ac3a82d", "type": "github" }, "original": { @@ -153,11 +142,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733064805, - "narHash": "sha256-7NbtSLfZO0q7MXPl5hzA0sbVJt6pWxxtGWbaVUDDmjs=", + "lastModified": 1743568003, + "narHash": "sha256-ZID5T65E8ruHqWRcdvZLsczWDOAWIE7om+vQOREwiX0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "31d66ae40417bb13765b0ad75dd200400e98de84", + "rev": "b7ba7f9f45c5cd0d8625e9e217c28f8eb6a19a76", "type": "github" }, "original": { @@ -169,19 +158,16 @@ }, "nrr": { "inputs": { - "nix-filter": [ - "nix-filter" - ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1732541227, - "narHash": "sha256-gbTRShWfwbHN8GcTXkWzaeNc5nVlEJf8Qe4bUT/CvL4=", + "lastModified": 1743610126, + "narHash": "sha256-qh4YEfdfO6WofdrFHVDvkNocloK2LuWelfZPilxiKPk=", "owner": "ryanccn", "repo": "nrr", - "rev": "e3efbaf985e51fefc940993ee65f6ac3fdddcb8f", + "rev": "2897e6945b26645d746e87da937a1ac762f979a5", "type": "github" }, "original": { @@ -192,19 +178,16 @@ }, "nyoom": { "inputs": { - "nix-filter": [ - "nix-filter" - ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1732792649, - "narHash": "sha256-/qXj3b70ljGgaC0jbqh1X8YCaXFVqQrvciymtJpIDJg=", + "lastModified": 1743340790, + "narHash": "sha256-fnRXur0YiZdiRqqKYDdxMCo7ROMqwimOIg1waCqugPo=", "owner": "ryanccn", "repo": "nyoom", - "rev": "27240cc8ef94ca0d6be28cad2c9121cae741c3eb", + "rev": "131feeb52c0ec403186e19b60433ac4548f585f1", "type": "github" }, "original": { @@ -216,11 +199,11 @@ "ohmyzsh": { "flake": false, "locked": { - "lastModified": 1732784241, - "narHash": "sha256-31wI3wFGQ9YhEo7XguLSTNY0rvOFa+/MoFwDAZIo7ZY=", + "lastModified": 1743249320, + "narHash": "sha256-Wh4PR/TH6DDDfckI9nAnbecDs9MUBzj7+iwY19yv454=", "owner": "ohmyzsh", "repo": "ohmyzsh", - "rev": "69a6359f7cf8978d464573fb7b023ee3cd00181a", + "rev": "f81259fb344685e2dc8b67f8ad8764ccd4e8502e", "type": "github" }, "original": { @@ -233,11 +216,10 @@ "inputs": { "am": "am", "catppuccin": "catppuccin", - "darwin-custom-icons": "darwin-custom-icons", + "flake-parts": "flake-parts", "home-manager": "home-manager", "morlana": "morlana", "nix-darwin": "nix-darwin", - "nix-filter": "nix-filter", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", "nrr": "nrr", @@ -245,7 +227,6 @@ "ohmyzsh": "ohmyzsh", "rust-overlay": "rust-overlay", "spdx-gen": "spdx-gen", - "systems": "systems", "vivid-zsh": "vivid-zsh" } }, @@ -256,11 +237,11 @@ ] }, "locked": { - "lastModified": 1733020719, - "narHash": "sha256-Chv9+3zrf1DhdB9JyskjoV0vJbCQEgkVqrU3p4RPLv8=", + "lastModified": 1743561237, + "narHash": "sha256-dd97LXek202OWmUXvKYFdYWj0jHrn3p+L5Ojh1SEOqs=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "8e18f10703112e6c33e1c0d8b93e8305f6f0a75c", + "rev": "1de27ae43712a971c1da100dcd84386356f03ec7", "type": "github" }, "original": { @@ -271,19 +252,16 @@ }, "spdx-gen": { "inputs": { - "nix-filter": [ - "nix-filter" - ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1732279449, - "narHash": "sha256-LL1wSvrdTIuOEfGjBEQFbYTE+BmaiioQl9S1ZxRL1oQ=", + "lastModified": 1743340768, + "narHash": "sha256-DRMvB5BmnbfbVvOv2HaQwqeVxeXdZrXH8MufH1MVmg0=", "owner": "ryanccn", "repo": "spdx-gen", - "rev": "4238a0e3e07f035529b4a5368b31093dad5b45b8", + "rev": "a97a52ac35462d1414827c3692ce9107241dbd13", "type": "github" }, "original": { @@ -292,21 +270,6 @@ "type": "github" } }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "vivid-zsh": { "flake": false, "locked": { diff --git a/flake.lock.license b/flake.lock.license new file mode 100644 index 0000000..63af9bd --- /dev/null +++ b/flake.lock.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2025 Ryan Cao + +SPDX-License-Identifier: CC0-1.0 diff --git a/flake.nix b/flake.nix index 874d177..f485c6c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,37 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { - description = "Ryan's MacBook Pro flake"; + outputs = + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + imports = [ + ./checks + ./packages + ./systems + ]; + }; inputs = { nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + nix-darwin = { - url = "github:LnL7/nix-darwin"; + url = "github:nix-darwin/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -18,6 +42,7 @@ catppuccin = { url = "github:catppuccin/nix"; + inputs.nixpkgs.follows = "nixpkgs"; }; nix-index-database = { @@ -28,31 +53,26 @@ am = { url = "github:ryanccn/am"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix-filter.follows = "nix-filter"; }; nrr = { url = "github:ryanccn/nrr"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix-filter.follows = "nix-filter"; }; nyoom = { url = "github:ryanccn/nyoom"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix-filter.follows = "nix-filter"; }; morlana = { url = "github:ryanccn/morlana"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix-filter.follows = "nix-filter"; }; spdx-gen = { url = "github:ryanccn/spdx-gen"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix-filter.follows = "nix-filter"; }; rust-overlay = { @@ -60,14 +80,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - darwin-custom-icons = { - url = "github:ryanccn/nix-darwin-custom-icons"; - }; - - nix-filter = { - url = "github:numtide/nix-filter"; - }; - ohmyzsh = { url = "github:ohmyzsh/ohmyzsh"; flake = false; @@ -77,38 +89,5 @@ url = "github:ryanccn/vivid-zsh"; flake = false; }; - - systems = { - url = "github:nix-systems/default"; - }; }; - - outputs = - { - self, - nixpkgs, - nix-darwin, - systems, - ... - }@inputs: - let - inherit (nixpkgs) lib; - forAllSystems = lib.genAttrs (import systems); - in - { - darwinConfigurations = { - Ryans-MacBook-Pro = nix-darwin.lib.darwinSystem { - modules = [ - ./modules/_module.nix - ./system.nix - ]; - - specialArgs = { - inherit self inputs; - }; - }; - }; - - packages = forAllSystems (system: (import ./packages) nixpkgs.legacyPackages.${system}); - }; } diff --git a/home/apps/ghostty.conf b/home/apps/ghostty.conf deleted file mode 100644 index 723f0a4..0000000 --- a/home/apps/ghostty.conf +++ /dev/null @@ -1,21 +0,0 @@ -theme = catppuccin-frappe -window-colorspace = display-p3 - -font-family = "Ryan Term" -font-size = 14 -font-feature = -calt -font-feature = -dlig - -adjust-cell-height = 25% -adjust-underline-position = 5 - -command = /run/current-system/sw/bin/fish -l - -macos-option-as-alt = true -macos-secure-input-indication = false - -window-step-resize = true -window-padding-x = 15 -window-padding-y = 15 - -keybind = super+backspace=text:\x15 diff --git a/home/apps/ghostty.nix b/home/apps/ghostty.nix deleted file mode 100644 index 074a7ac..0000000 --- a/home/apps/ghostty.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ config, ... }: -{ - home.file."${config.xdg.configHome}/ghostty/config".source = ./ghostty.conf; -} diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix deleted file mode 100644 index d23132d..0000000 --- a/home/apps/vscode.nix +++ /dev/null @@ -1,238 +0,0 @@ -{ - pkgs, - lib, - config, - # self, - ... -}: -let - extensions = [ - "astro-build.astro-vscode" - "bierner.lit-html" - "bmalehorn.vscode-fish" - "bradlc.vscode-tailwindcss" - "catppuccin.catppuccin-vsc" - "catppuccin.catppuccin-vsc-icons" - "charliermarsh.ruff" - "dbaeumer.vscode-eslint" - "denoland.vscode-deno" - "dotjoshjohnson.xml" - "dprint.dprint" - # "eamodio.gitlens" - "editorconfig.editorconfig" - # "enkia.tokyo-night" - "esbenp.prettier-vscode" - "github.vscode-github-actions" - "graphql.vscode-graphql" - "graphql.vscode-graphql-syntax" - "golang.go" - "griimick.vhs" - # "leonardssh.vscord" - # "jdinhlife.gruvbox" - "jnoortheen.nix-ide" - "ms-python.isort" - "ms-python.vscode-pylance" - "ms-python.python" - "myriad-dreamin.tinymist" - "naumovs.color-highlight" - "prisma.prisma" - "ronnidc.nunjucks" - "rust-lang.rust-analyzer" - "skellock.just" - "svelte.svelte-vscode" - "tamasfe.even-better-toml" - "timonwong.shellcheck" - "unifiedjs.vscode-mdx" - "usernamehw.errorlens" - "vue.volar" - "waderyan.gitblame" - "yoavbls.pretty-ts-errors" - ]; -in -{ - programs.vscode = { - enable = true; - package = pkgs.stdenvNoCC.mkDerivation { - pname = "vscode"; - version = "1.92.2"; - dontUnpack = true; - installPhase = '' - mkdir -p "$out" - ''; - }; - - extensions = [ ]; - mutableExtensionsDir = true; - - userSettings = { - "workbench.colorTheme" = "Catppuccin Frappé"; - "workbench.iconTheme" = "catppuccin-frappe"; - "workbench.sideBar.location" = "left"; - "workbench.activityBar.location" = "top"; - - # "symbols.hidesExplorerArrows" = false; - - "catppuccin.accentColor" = config.catppuccin.accent; - "catppuccin.boldKeywords" = false; - "catppuccin.italicKeywords" = false; - "catppuccin.workbenchMode" = "flat"; - "catppuccin.customUIColors" = { - "all" = { - "activityBar.activeBorder" = "accent"; - "statusBarItem.remoteBackground" = "accent"; - "activityBarTop.foreground" = "text"; - "activityBarTop.inactiveForeground" = "subtext1"; - "activityBarTop.activeBorder" = "accent"; - "activityBarTop.dropBorder" = "accent"; - }; - }; - - "git.autofetch" = true; - "git.confirmSync" = false; - "git.inputValidation" = false; - "git.suggestSmartCommit" = false; - "diffEditor.renderSideBySide" = false; - "diffEditor.ignoreTrimWhitespace" = false; - # "gitlens.showWelcomeOnInstall" = false; - - "gitblame.inlineMessageEnabled" = true; - "gitblame.inlineMessageFormat" = "\${author.name} · \${time.ago} · \${commit.summary,120}"; - - "editor.fontFamily" = ''"Ryan Mono", "Symbols Nerd Font", monospace''; - "editor.fontLigatures" = true; - "editor.fontSize" = 16; - "editor.lineHeight" = 1.5; - "editor.cursorSmoothCaretAnimation" = "on"; - # "editor.minimap.renderCharacters" = false; - "editor.cursorBlinking" = "phase"; - "workbench.editor.highlightModifiedTabs" = true; - "workbench.editor.empty.hint" = "hidden"; - "chat.commandCenter.enabled" = false; - - "editor.inlineSuggest.enabled" = true; - "editor.tabSize" = 2; - "editor.insertSpaces" = true; - "editor.formatOnSave" = true; - - "terminal.integrated.fontFamily" = ''"Ryan Term", "Symbols Nerd Font Mono", monospace''; - "terminal.integrated.fontSize" = 14; - "terminal.integrated.lineHeight" = 1.5; - "terminal.integrated.cursorBlinking" = true; - "terminal.integrated.defaultProfile.osx" = "fish"; - "terminal.integrated.inheritEnv" = false; - "terminal.integrated.shellIntegration.enabled" = true; - - "editor.defaultFormatter" = "esbenp.prettier-vscode"; - - "javascript.preferGoToSourceDefinition" = true; - "typescript.preferGoToSourceDefinition" = true; - "typescript.enablePromptUseWorkspaceTsdk" = true; - - "eslint.experimental.useFlatConfig" = true; - - "shellcheck.ignorePatterns".".envrc" = true; - "tailwindCSS.includeLanguages" = { - "typescript" = "javascript"; - "typescriptreact" = "javascript"; - "vue-html" = "html"; - }; - - "telemetry.telemetryLevel" = "off"; - "workbench.enableExperiments" = false; - "workbench.settings.enableNaturalLanguageSearch" = false; - "extensions.ignoreRecommendations" = true; - "editor.accessibilitySupport" = "off"; - - # "vscord.status.details.text.editing" = "In {workspace}"; - # "vscord.status.details.text.viewing" = "In {workspace}"; - # "vscord.status.problems.enabled" = false; - # "vscord.status.state.text.editing" = "Working on {file_name}{file_extension}"; - # "vscord.status.buttons.button1.enabled" = false; - - # "gitlens.defaultTimeFormat" = "HH=mm"; - # "gitlens.defaultDateShortFormat" = "YYYY/MM/DD"; - # "gitlens.defaultDateFormat" = null; - - "[python]"."editor.tabSize" = 4; - "[python]"."editor.defaultFormatter" = "charliermarsh.ruff"; - "[cpp]"."editor.defaultFormatter" = "xaver.clang-format"; - "[toml]"."editor.defaultFormatter" = "tamasfe.even-better-toml"; - "[svelte]"."editor.defaultFormatter" = "svelte.svelte-vscode"; - "[go][go.mod][go.sum]"."editor.defaultFormatter" = "golang.go"; - "[xml]"."editor.defaultFormatter" = "DotJoshJohnson.xml"; - "[fish]"."editor.defaultFormatter" = "bmalehorn.vscode-fish"; - "[just]"."editor.defaultFormatter" = "skellock.just"; - "[mdx]"."editor.wordWrap" = "on"; - "[astro]"."editor.defaultFormatter" = "astro-build.astro-vscode"; - - "[rust]"."editor.tabSize" = 4; - "[rust]"."editor.defaultFormatter" = "rust-lang.rust-analyzer"; - - "rust-analyzer.server.path" = "rust-analyzer"; - "rust-analyzer.check.command" = "clippy"; - "rust-analyzer.showUnlinkedFileNotification" = false; - - "files.associations" = { - "*.mcmeta" = "json"; - "*.plist" = "xml"; - ".dockerignore" = "ignore"; - ".dev.vars" = "properties"; - ".env.example" = "properties"; - "*.sarif" = "json"; - ".tokeignore" = "ignore"; - "flake.lock" = "json"; - }; - - "svelte.enable-ts-plugin" = true; - - "color-highlight.matchRgbWithNoFunction" = true; - "color-highlight.matchHslWithNoFunction" = true; - - # "clang-format.executable" = "${pkgs.clang-tools}/bin/clang-format"; - - "[nix]"."editor.defaultFormatter" = "jnoortheen.nix-ide"; - "nix.enableLanguageServer" = true; - "nix.serverPath" = lib.getExe pkgs.nil; - "nix.serverSettings" = { - "nil" = { - formatting.command = [ (lib.getExe pkgs.nixfmt-rfc-style) ]; - # nixpkgs.expr = "import (builtins.getFlake \"${self}\").inputs.nixpkgs { }"; - }; - }; - - "[typst]"."editor.defaultFormatter" = "myriad-dreamin.tinymist"; - }; - }; - - home.activation = { - vscodeExtensions = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - code_bin="/usr/local/bin/code" - - if ! command -v "$code_bin" &> /dev/null; then - echo "code CLI is not available" - exit 0 - fi - - declare -A currentExtensions - for extension in $("$code_bin" --list-extensions); do - currentExtensions["$extension"]=1; - done - - ${builtins.concatStringsSep "\n" ( - builtins.map (ext: '' - if [[ -z "''${currentExtensions[${ext}]+unset}" ]]; then - echo "installing ${ext}" - $DRY_RUN_CMD "$code_bin" --install-extension ${ext} &> /dev/null - fi - unset 'currentExtensions[${ext}]' - '') extensions - )} - - for ext in "''${!currentExtensions[@]}"; do - echo "uninstalling $ext" - $DRY_RUN_CMD "$code_bin" --uninstall-extension $ext &> /dev/null - unset 'currentExtensions[$ext]' - done - ''; - }; -} diff --git a/home/fonts.nix b/home/fonts.nix deleted file mode 100644 index 70e6469..0000000 --- a/home/fonts.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, flake', ... }: -{ - home.packages = with pkgs; [ - inter - public-sans - - (flake'.packages.ibm-plex-compat.override { - families = [ - "sans" - "serif" - "mono" - ]; - }) - - flake'.packages.ryan-mono-bin - - # Install variable fonts for Cascadia Code instead of static fonts - (cascadia-code.overrideAttrs { - installPhase = '' - runHook preInstall - install -Dm644 ttf/*.ttf -t $out/share/fonts/truetype - runHook postInstall - ''; - }) - - nerd-fonts.symbols-only - ]; -} diff --git a/home/programs/aliases.nix b/home/programs/aliases.nix deleted file mode 100644 index 9e37a41..0000000 --- a/home/programs/aliases.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - "vim".command = "hx"; - "cat".command = "bat"; - "dig".command = "doggo"; - - "g".command = "git"; - "g".fishAlias = true; - - "j".command = "just"; - "j".fishAlias = true; - - "nb".command = "nix build"; - "nfu".command = "nix flake update"; - - "glol".command = "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'"; - "glol".fishAlias = true; - - "ghrvw".command = "gh repo view --web"; - - "opr".command = "op run --env-file=.env.1password --"; - "dr".command = "doppler run --"; - - "dequarantine".command = "xattr -d com.apple.quarantine"; - - "bcpa".command = "brew cleanup --prune=all"; - "puil".command = "pnpm update --interactive --latest"; - - "pip-upgrade-all".command = "pip --disable-pip-version-check list --outdated --format=json | python -c \"import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))\" | xargs -n1 pip install -U"; - "pip-upgrade-all".fishAlias = true; -} diff --git a/home/programs/bat.nix b/home/programs/bat.nix deleted file mode 100644 index 2a5330f..0000000 --- a/home/programs/bat.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - programs.bat = { - enable = true; - catppuccin.enable = true; - - config = { - style = "plain"; - }; - }; -} diff --git a/home/programs/direnv.nix b/home/programs/direnv.nix deleted file mode 100644 index 37f6d99..0000000 --- a/home/programs/direnv.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; -} diff --git a/home/programs/eza.nix b/home/programs/eza.nix deleted file mode 100644 index f09a82e..0000000 --- a/home/programs/eza.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - programs.eza = { - enable = true; - icons = "auto"; - extraOptions = [ "--all" ]; - }; -} diff --git a/home/programs/fish/configs/99_interactive.fish b/home/programs/fish/configs/99_interactive.fish deleted file mode 100644 index 84b9869..0000000 --- a/home/programs/fish/configs/99_interactive.fish +++ /dev/null @@ -1,15 +0,0 @@ -if status is-interactive - nix-your-shell fish | source - - set -l iterm2_shell_integration "$HOME/.iterm2_shell_integration.fish" - - string match -q "$TERM_PROGRAM" "iTerm.app" - and test -f "$iterm2_shell_integration" - and source "$iterm2_shell_integration" - - set -l ghostty_shell_integration "/Applications/Ghostty.app/Contents/Resources/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish" - - string match -q "$TERM_PROGRAM" ghostty - and test -f "$ghostty_shell_integration" - and source "$ghostty_shell_integration" -end diff --git a/home/programs/glamour.nix b/home/programs/glamour.nix deleted file mode 100644 index cfdbb30..0000000 --- a/home/programs/glamour.nix +++ /dev/null @@ -1 +0,0 @@ -_: { programs.glamour.catppuccin.enable = true; } diff --git a/home/programs/helix.nix b/home/programs/helix.nix deleted file mode 100644 index 398207b..0000000 --- a/home/programs/helix.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - programs.helix = { - enable = true; - catppuccin.enable = true; - defaultEditor = true; - }; -} diff --git a/icons/notion.icns b/icons/notion.icns deleted file mode 100644 index 1b9ea98..0000000 Binary files a/icons/notion.icns and /dev/null differ diff --git a/icons/obsidian.icns b/icons/obsidian.icns deleted file mode 100644 index f9d91fb..0000000 Binary files a/icons/obsidian.icns and /dev/null differ diff --git a/icons/things.icns b/icons/things.icns deleted file mode 100644 index 85d94df..0000000 Binary files a/icons/things.icns and /dev/null differ diff --git a/justfile b/justfile index 58a9f18..cb938df 100644 --- a/justfile +++ b/justfile @@ -1,8 +1,12 @@ -switch: - morlana switch +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 -build: - morlana build +switch *args: + morlana switch -- {{args}} + +build *args: + morlana build -- {{args}} wipe-history: sudo -H nix profile wipe-history --profile "/nix/var/nix/profiles/default" diff --git a/modules/_module.nix b/modules/_module.nix deleted file mode 100644 index 5faf9a1..0000000 --- a/modules/_module.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - pkgs, - lib, - inputs, - inputs', - ... -}: -{ - _module.args = { - inputs' = lib.mapAttrs (lib.const ( - lib.mapAttrs (lib.const (value: value.${pkgs.system} or value)) - )) inputs; - - flake' = inputs'.self; - }; -} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..105c5c3 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ } diff --git a/packages/default.nix b/packages/default.nix index 3293c88..b0e52b9 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,4 +1,15 @@ -pkgs: { - ibm-plex-compat = pkgs.callPackage ./ibm-plex-compat.nix { }; - ryan-mono-bin = pkgs.callPackage ./ryan-mono-bin.nix { }; +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + perSystem = + { pkgs, ... }: + { + packages = { + helix-with-lsps = pkgs.callPackage ./helix-with-lsps.nix { }; + ibm-plex-compat = pkgs.callPackage ./ibm-plex-compat.nix { }; + ryan-mono-bin = pkgs.callPackage ./ryan-mono-bin.nix { }; + }; + }; } diff --git a/packages/helix-with-lsps.nix b/packages/helix-with-lsps.nix new file mode 100644 index 0000000..3147fad --- /dev/null +++ b/packages/helix-with-lsps.nix @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + lib, + symlinkJoin, + makeBinaryWrapper, + helix, + typescript-language-server, + gopls, + nil, +}: +let + lsps = [ + typescript-language-server + gopls + nil + ]; +in +symlinkJoin { + pname = "${helix.pname}-with-lsps"; + inherit (helix) version meta; + paths = [ helix ]; + + nativeBuildInputs = [ makeBinaryWrapper ]; + + postBuild = '' + wrapProgram $out/bin/${helix.meta.mainProgram} \ + --suffix PATH : "${lib.makeBinPath lsps}" + ''; +} diff --git a/packages/ibm-plex-compat.nix b/packages/ibm-plex-compat.nix index aaa8005..a551e1b 100644 --- a/packages/ibm-plex-compat.nix +++ b/packages/ibm-plex-compat.nix @@ -1,6 +1,10 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { ibm-plex, - python312Packages, + python313Packages, families ? [ ], }: (ibm-plex.override { inherit families; }).overrideAttrs (_: { @@ -8,7 +12,7 @@ postInstall = '' set -eo pipefail - PATH="${python312Packages.fonttools}/bin:$PATH" + PATH="${python313Packages.fonttools}/bin:$PATH" cd "$out/share/fonts/opentype" diff --git a/packages/ryan-mono-bin.nix b/packages/ryan-mono-bin.nix index 7107023..25fad33 100644 --- a/packages/ryan-mono-bin.nix +++ b/packages/ryan-mono-bin.nix @@ -1,16 +1,18 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { lib, stdenvNoCC, fetchzip, }: let - version = "2024.11.18"; + version = "2025.03.09"; hashes = { - "RyanMono" = "sha256-c+NRiWMMZEmX2ImFpvSboPEKYPuBahYsjAzddsYi1Lo="; - "RyanTerm" = "sha256-uYqK1ktgZPbhAOX3FyFWKDUSBDBQX6KtepT3PGcGuB0="; - # "RyanMonoNerdFont" = "sha256-CKBgRHXw6U3PjXruHCE+YsksHn+hJGjwWwtS9CbGcXg="; - # "RyanTermNerdFont" = "sha256-4GYYuZ//Ekk7jNi2zjxTMziaOOx4f2K17xcYIzOYAWc="; + "ryan-mono" = "sha256-CDYRMkHbHTQgoVforRxLb+vMZuUwQ4Whl0kDAyadFKQ="; + "ryan-term" = "sha256-iPPoJ803P3Gw0pO37jFiaLr+Yug3vwxNHBiP2fr+1cg="; }; in stdenvNoCC.mkDerivation { diff --git a/statix.toml b/statix.toml index 3f02ae4..35c62e6 100644 --- a/statix.toml +++ b/statix.toml @@ -1 +1,5 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + disabled = ["repeated_keys"] diff --git a/system.nix b/system.nix deleted file mode 100644 index ebec308..0000000 --- a/system.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - inputs, - inputs', - flake', - self, - ... -}: -{ - imports = [ - inputs.home-manager.darwinModules.home-manager - inputs.darwin-custom-icons.darwinModules.default - - ./modules/nix.nix - ./modules/packages.nix - ./modules/homebrew.nix - ]; - - security.pam.enableSudoTouchIdAuth = true; - - environment.customIcons = { - enable = true; - icons = [ - { - path = "/Applications/Notion.app"; - icon = ./icons/notion.icns; - } - { - path = "/Applications/Obsidian.app"; - icon = ./icons/obsidian.icns; - } - ]; - }; - - programs.bash.enable = true; - programs.fish.enable = true; - programs.zsh.enable = true; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - - extraSpecialArgs = { - inherit - self - flake' - inputs - inputs' - ; - }; - - users.ryanccn = import ./home; - }; - - users.users.ryanccn = { - home = "/Users/ryanccn"; - }; - - system.stateVersion = 5; -} diff --git a/systems/caladan/default.nix b/systems/caladan/default.nix new file mode 100644 index 0000000..c5a7645 --- /dev/null +++ b/systems/caladan/default.nix @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + inputs, + inputs', + ... +}: +{ + imports = [ + inputs.home-manager.darwinModules.home-manager + + ./nix.nix + ./packages.nix + ./homebrew.nix + ]; + + security.pam.services.sudo_local.touchIdAuth = true; + + programs.bash.enable = true; + programs.zsh.enable = true; + programs.fish.enable = true; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + extraSpecialArgs = { + inherit + inputs + inputs' + ; + }; + + users.ryan = import "${inputs.self}/users/ryan"; + }; + + users.users.ryan = { + home = "/Users/ryan"; + }; + + system.stateVersion = 6; +} diff --git a/modules/homebrew.nix b/systems/caladan/homebrew.nix similarity index 80% rename from modules/homebrew.nix rename to systems/caladan/homebrew.nix index 5a0d486..2398baa 100644 --- a/modules/homebrew.nix +++ b/systems/caladan/homebrew.nix @@ -1,4 +1,8 @@ -_: { +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ environment.variables = { HOMEBREW_NO_ANALYTICS = "1"; HOMEBREW_NO_INSECURE_REDIRECT = "1"; @@ -19,9 +23,8 @@ _: { }; brews = [ + "gnupg" "pandoc" - "fontforge" - "ttfautohint" ]; casks = @@ -35,11 +38,8 @@ _: { in [ "blackhole-16ch" + (noQuarantine "librewolf") (noQuarantine "eloston-chromium") - "sf-symbols" - "1password/tap/1password-cli" ]; - - taps = [ "1password/tap" ]; }; } diff --git a/modules/nix.nix b/systems/caladan/nix.nix similarity index 62% rename from modules/nix.nix rename to systems/caladan/nix.nix index 56ddccc..7570ddf 100644 --- a/modules/nix.nix +++ b/systems/caladan/nix.nix @@ -1,44 +1,41 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { pkgs, - inputs, - config, ... }: { nix.package = pkgs.nixVersions.latest; - services.nix-daemon.enable = true; nix.registry = { - n.flake = inputs.nixpkgs; + n.to = { + type = "indirect"; + id = "nixpkgs"; + }; }; - nix.nixPath = [ - "nixpkgs=${inputs.nixpkgs.outPath}" - ]; - nix.settings = { experimental-features = [ "nix-command" "flakes" ]; - # https://github.com/NixOS/nix/issues/7273 - auto-optimise-store = !pkgs.stdenv.isDarwin; - extra-platforms = [ - "x86_64-darwin" "aarch64-darwin" + "x86_64-darwin" ]; - build-users-group = "nixbld"; - trusted-users = [ "ryanccn" ]; + # Included in default config + # build-users-group = "nixbld"; + + trusted-users = [ "ryan" ]; sandbox = true; use-xdg-base-directories = true; extra-substituters = [ ]; extra-trusted-public-keys = [ ]; - - nix-path = config.nix.nixPath; }; environment.profiles = [ diff --git a/modules/packages.nix b/systems/caladan/packages.nix similarity index 61% rename from modules/packages.nix rename to systems/caladan/packages.nix index 06828bb..4e4046d 100644 --- a/modules/packages.nix +++ b/systems/caladan/packages.nix @@ -1,10 +1,15 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { + lib, pkgs, inputs', ... }: let - defaultPackage = name: inputs'.${name}.packages.default; + defaultPackages = lib.mapAttrs (_: value: value.packages.default) inputs'; in { environment.systemPackages = with pkgs; [ @@ -22,13 +27,12 @@ in deno bun - (python312.withPackages (ps: with ps; [ pip ])) uv ruff yt-dlp xkcdpass - nodePackages.typescript-language-server + # nodePackages.typescript-language-server dprint # google-cloud-sdk @@ -42,7 +46,7 @@ in dust fd ffmpeg - gum + # gum hyperfine jq just @@ -60,10 +64,10 @@ in # packwiz # spicetify-cli - (defaultPackage "nrr") - (defaultPackage "am") - (defaultPackage "nyoom") - (defaultPackage "morlana") - (defaultPackage "spdx-gen") + defaultPackages.nrr + defaultPackages.am + defaultPackages.nyoom + defaultPackages.morlana + defaultPackages.spdx-gen ]; } diff --git a/systems/default.nix b/systems/default.nix new file mode 100644 index 0000000..59e6ee9 --- /dev/null +++ b/systems/default.nix @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + inputs, + withSystem, + ... +}: +let + specialArgsModule = ( + { pkgs, ... }: + { + _module.args = { + inputs' = withSystem pkgs.stdenvNoCC.hostPlatform.system (builtins.getAttr "inputs'"); + }; + } + ); +in +{ + flake.darwinConfigurations = { + caladan = inputs.nix-darwin.lib.darwinSystem { + modules = [ + specialArgsModule + ./caladan + ]; + + specialArgs = { inherit inputs; }; + }; + }; +} diff --git a/users/ryan/apps/ghostty.nix b/users/ryan/apps/ghostty.nix new file mode 100644 index 0000000..8a73c56 --- /dev/null +++ b/users/ryan/apps/ghostty.nix @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + pkgs, + lib, + config, + ... +}: +let + keyValue = pkgs.formats.keyValue { + listsAsDuplicateKeys = true; + mkKeyValue = lib.generators.mkKeyValueDefault { } " = "; + }; + + settings = { + theme = "catppuccin-${config.catppuccin.flavor}"; + window-colorspace = "display-p3"; + + font-family = "IBM Plex Mono"; + font-size = 14; + font-feature = [ + "-calt" + "-dlig" + ]; + + adjust-cell-height = "25%"; + adjust-underline-position = 5; + + command = "/run/current-system/sw/bin/fish -l"; + + macos-option-as-alt = true; + macos-secure-input-indication = false; + + window-step-resize = true; + window-padding-x = 15; + window-padding-y = 15; + + keybind = [ "super+backspace=text:\\x15" ]; + }; +in +{ + xdg.configFile."ghostty/config".source = keyValue.generate "ghostty-config" settings; +} diff --git a/users/ryan/apps/vscode.nix b/users/ryan/apps/vscode.nix new file mode 100644 index 0000000..4c2d154 --- /dev/null +++ b/users/ryan/apps/vscode.nix @@ -0,0 +1,232 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + pkgs, + lib, + config, + # self, + ... +}: +let + extensions = [ + "astro-build.astro-vscode" + "bierner.lit-html" + "bmalehorn.vscode-fish" + "bradlc.vscode-tailwindcss" + "catppuccin.catppuccin-vsc" + "catppuccin.catppuccin-vsc-icons" + "charliermarsh.ruff" + "dbaeumer.vscode-eslint" + "denoland.vscode-deno" + "dotjoshjohnson.xml" + "dprint.dprint" + "editorconfig.editorconfig" + "esbenp.prettier-vscode" + "github.vscode-github-actions" + "graphql.vscode-graphql" + "graphql.vscode-graphql-syntax" + "golang.go" + "griimick.vhs" + "jnoortheen.nix-ide" + "ms-python.isort" + "ms-python.vscode-pylance" + "ms-python.python" + "myriad-dreamin.tinymist" + "naumovs.color-highlight" + "prisma.prisma" + "ronnidc.nunjucks" + "rust-lang.rust-analyzer" + "skellock.just" + "svelte.svelte-vscode" + "tamasfe.even-better-toml" + "timonwong.shellcheck" + "unifiedjs.vscode-mdx" + "usernamehw.errorlens" + "vue.volar" + "yoavbls.pretty-ts-errors" + ]; + + defaultFormatters = { + "[python]" = "charliermarsh.ruff"; + "[cpp]" = "xaver.clang-format"; + "[toml]" = "tamasfe.even-better-toml"; + "[svelte]" = "svelte.svelte-vscode"; + "[go][go.mod][go.sum]" = "golang.go"; + "[xml]" = "DotJoshJohnson.xml"; + "[fish]" = "bmalehorn.vscode-fish"; + "[just]" = "skellock.just"; + "[astro]" = "astro-build.astro-vscode"; + "[rust]" = "rust-lang.rust-analyzer"; + "[nix]" = "jnoortheen.nix-ide"; + "[typst]" = "myriad-dreamin.tinymist"; + }; +in +{ + programs.vscode = { + enable = true; + package = pkgs.writeShellApplication { + name = "vscode-1.98.2"; + text = ""; + derivationArgs = { + pname = "vscode"; + version = "1.98.2"; + }; + }; + + profiles.default.extensions = [ ]; + mutableExtensionsDir = true; + + profiles.default.userSettings = builtins.foldl' lib.recursiveUpdate { } [ + { + "workbench.colorTheme" = "Catppuccin Frappé"; + "workbench.iconTheme" = "catppuccin-frappe"; + "workbench.sideBar.location" = "left"; + "workbench.activityBar.location" = "top"; + + "editor.semanticHighlighting.enabled" = true; + "terminal.integrated.minimumContrastRatio" = 1; + "terminal.integrated.drawBoldTextInBrightColors" = false; + "window.titleBarStyle" = "custom"; + + "catppuccin.accentColor" = config.catppuccin.accent; + "catppuccin.workbenchMode" = "flat"; + "catppuccin.customUIColors" = { + "all" = { + "statusBarItem.remoteBackground" = "accent"; + "activityBar.activeBorder" = "accent"; + "activityBarTop.activeBorder" = "accent"; + }; + }; + + "git.autofetch" = true; + "git.confirmSync" = false; + "git.inputValidation" = false; + "git.suggestSmartCommit" = false; + "git.blame.editorDecoration.enabled" = true; + + "diffEditor.renderSideBySide" = false; + "diffEditor.ignoreTrimWhitespace" = false; + + "editor.fontFamily" = ''"IBM Plex Mono", "Symbols Nerd Font", monospace''; + "editor.fontLigatures" = true; + "editor.fontSize" = 16; + "editor.lineHeight" = 1.5; + # "editor.cursorBlinking" = "phase"; + # "editor.cursorSmoothCaretAnimation" = "on"; + # "editor.minimap.renderCharacters" = false; + "workbench.editor.highlightModifiedTabs" = true; + "workbench.editor.empty.hint" = "hidden"; + "chat.commandCenter.enabled" = false; + + "editor.inlineSuggest.enabled" = true; + "editor.tabSize" = 2; + "editor.insertSpaces" = true; + "editor.formatOnSave" = true; + + "terminal.integrated.fontFamily" = ''"IBM Plex Mono", "Symbols Nerd Font Mono", monospace''; + "terminal.integrated.fontSize" = 14; + "terminal.integrated.lineHeight" = 1.5; + "terminal.integrated.cursorBlinking" = true; + "terminal.integrated.defaultProfile.osx" = "fish"; + "terminal.integrated.inheritEnv" = false; + "terminal.integrated.enablePersistentSessions" = false; + "terminal.integrated.shellIntegration.enabled" = false; + + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + + "javascript.preferGoToSourceDefinition" = true; + "typescript.preferGoToSourceDefinition" = true; + "typescript.enablePromptUseWorkspaceTsdk" = true; + + "eslint.useFlatConfig" = true; + + "shellcheck.ignorePatterns".".envrc" = true; + "tailwindCSS.includeLanguages" = { + "typescript" = "javascript"; + "typescriptreact" = "javascript"; + "vue-html" = "html"; + }; + + "telemetry.telemetryLevel" = "off"; + "workbench.enableExperiments" = false; + "workbench.settings.enableNaturalLanguageSearch" = false; + "extensions.ignoreRecommendations" = true; + "editor.accessibilitySupport" = "off"; + + "[python]"."editor.tabSize" = 4; + "[rust]"."editor.tabSize" = 4; + + "[mdx]"."editor.wordWrap" = "on"; + + "rust-analyzer.server.path" = "rust-analyzer"; + "rust-analyzer.check.command" = "clippy"; + "rust-analyzer.showUnlinkedFileNotification" = false; + + "files.associations" = { + "*.mcmeta" = "json"; + "*.plist" = "xml"; + ".dockerignore" = "ignore"; + ".dev.vars" = "properties"; + ".env.example" = "properties"; + "*.sarif" = "json"; + ".tokeignore" = "ignore"; + "flake.lock" = "json"; + }; + + "svelte.enable-ts-plugin" = true; + + "color-highlight.matchRgbWithNoFunction" = true; + "color-highlight.matchHslWithNoFunction" = true; + "color-highlight.markRuler" = false; + "color-highlight.markerType" = "underline"; + + "nix.enableLanguageServer" = true; + "nix.serverPath" = lib.getExe pkgs.nil; + "nix.serverSettings" = { + "nil" = { + formatting.command = [ (lib.getExe pkgs.nixfmt-rfc-style) ]; + # nixpkgs.expr = "import (builtins.getFlake \"${self}\").inputs.nixpkgs { }"; + }; + }; + } + + (lib.concatMapAttrs (lang: formatter: { + ${lang}."editor.defaultFormatter" = formatter; + }) defaultFormatters) + ]; + }; + + home.activation = { + vscodeExtensions = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + code_bin="/usr/local/bin/code" + + if ! command -v "$code_bin" &> /dev/null; then + echo "code CLI is not available" + exit 0 + fi + + declare -A currentExtensions + for extension in $("$code_bin" --list-extensions); do + currentExtensions["$extension"]=1; + done + + ${builtins.concatStringsSep "\n" ( + builtins.map (ext: '' + if [[ -z "''${currentExtensions[${ext}]+unset}" ]]; then + echo "installing ${ext}" + $DRY_RUN_CMD "$code_bin" --install-extension ${ext} &> /dev/null + fi + unset 'currentExtensions[${ext}]' + '') extensions + )} + + for ext in "''${!currentExtensions[@]}"; do + echo "uninstalling $ext" + $DRY_RUN_CMD "$code_bin" --uninstall-extension $ext &> /dev/null + unset 'currentExtensions[$ext]' + done + ''; + }; +} diff --git a/users/ryan/catppuccin.nix b/users/ryan/catppuccin.nix new file mode 100644 index 0000000..9592ce7 --- /dev/null +++ b/users/ryan/catppuccin.nix @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + catppuccin = { + flavor = "frappe"; + accent = "sapphire"; + + bat.enable = true; + fish.enable = true; + fzf.enable = true; + glamour.enable = true; + helix.enable = true; + }; +} diff --git a/home/default.nix b/users/ryan/default.nix similarity index 69% rename from home/default.nix rename to users/ryan/default.nix index 83b3288..5d823e9 100644 --- a/home/default.nix +++ b/users/ryan/default.nix @@ -1,5 +1,8 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { - config, inputs, ... }: @@ -8,11 +11,11 @@ imports = [ inputs.catppuccin.homeManagerModules.catppuccin - inputs.am.homeManagerModules.default inputs.nix-index-database.hmModules.nix-index ./variables.nix ./fonts.nix + ./catppuccin.nix ./apps/vscode.nix ./apps/ghostty.nix @@ -28,22 +31,13 @@ ./programs/go.nix ./programs/eza.nix ./programs/rust.nix - ./programs/glamour.nix ./programs/tealdeer.nix ]; programs.bash.enable = true; xdg.enable = true; - services.am-discord-rich-presence = { - enable = false; - logFile = "${config.home.homeDirectory}/Library/Logs/am-discord-rich-presence.log"; - }; - programs.nix-index-database.comma.enable = true; - catppuccin.flavor = "frappe"; - catppuccin.accent = "sapphire"; - home.stateVersion = "24.11"; } diff --git a/users/ryan/fonts.nix b/users/ryan/fonts.nix new file mode 100644 index 0000000..b3b007e --- /dev/null +++ b/users/ryan/fonts.nix @@ -0,0 +1,30 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + pkgs, + inputs, + ... +}: +let + pkgs' = inputs.self.packages.${pkgs.stdenvNoCC.hostPlatform.system}; +in +{ + home.packages = [ + pkgs.inter + pkgs.lxgw-wenkai + + (pkgs'.ibm-plex-compat.override { + families = [ + "sans" + "serif" + "mono" + ]; + }) + + pkgs'.ryan-mono-bin + (pkgs.cascadia-code.override { useVariableFont = true; }) + pkgs.nerd-fonts.symbols-only + ]; +} diff --git a/users/ryan/programs/aliases.nix b/users/ryan/programs/aliases.nix new file mode 100644 index 0000000..5b29510 --- /dev/null +++ b/users/ryan/programs/aliases.nix @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + "g".command = "git"; + "j".command = "just"; + + "nb".command = "nix build"; + "nfu".command = "nix flake update"; + + "glol".command = + "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'"; + "glol".fishAlias = true; + + "ghrvw".command = "gh repo view --web"; + + "opr".command = "op run --env-file=.env.1password --"; + "dr".command = "doppler run --"; + + "dequarantine".command = "xattr -d com.apple.quarantine"; + + "bcpa".command = "brew cleanup --prune=all"; + "puil".command = "pnpm update --interactive --latest"; +} diff --git a/users/ryan/programs/bat.nix b/users/ryan/programs/bat.nix new file mode 100644 index 0000000..cbff722 --- /dev/null +++ b/users/ryan/programs/bat.nix @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + programs.bat = { + enable = true; + + config = { + style = "plain"; + }; + }; +} diff --git a/users/ryan/programs/direnv.nix b/users/ryan/programs/direnv.nix new file mode 100644 index 0000000..cea069e --- /dev/null +++ b/users/ryan/programs/direnv.nix @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ pkgs, config, ... }: +{ + programs.direnv = { + enable = true; + nix-direnv.enable = true; + nix-direnv.package = pkgs.nix-direnv.override { nix = config.nix.package; }; + }; +} diff --git a/users/ryan/programs/eza.nix b/users/ryan/programs/eza.nix new file mode 100644 index 0000000..7c8677e --- /dev/null +++ b/users/ryan/programs/eza.nix @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + programs.eza = { + enable = true; + icons = "auto"; + extraOptions = [ "--all" ]; + }; +} diff --git a/home/programs/fish.nix b/users/ryan/programs/fish.nix similarity index 91% rename from home/programs/fish.nix rename to users/ryan/programs/fish.nix index a0d064e..bab7f79 100644 --- a/home/programs/fish.nix +++ b/users/ryan/programs/fish.nix @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { lib, ... }: let aliases = import ./aliases.nix; @@ -12,7 +16,6 @@ in { programs.fish = { enable = true; - catppuccin.enable = true; inherit shellAbbrs shellAliases; @@ -50,7 +53,6 @@ in "--layout reverse" "--border" ]; - catppuccin.enable = true; }; programs.zoxide = { diff --git a/home/programs/fish/configs/01_tooling.fish b/users/ryan/programs/fish/configs/01_tooling.fish similarity index 61% rename from home/programs/fish/configs/01_tooling.fish rename to users/ryan/programs/fish/configs/01_tooling.fish index e519f5f..7a3c7ce 100644 --- a/home/programs/fish/configs/01_tooling.fish +++ b/users/ryan/programs/fish/configs/01_tooling.fish @@ -1,34 +1,25 @@ -# ls/exa/eza -set -x LS_COLORS (vivid generate catppuccin-frappe) +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 -# 1Password SSH set -x SSH_AUTH_SOCK "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" +set -x LS_COLORS "$(vivid generate catppuccin-frappe)" -# Homebrew /opt/homebrew/bin/brew shellenv | source -# fnm shell env fnm env --use-on-cd | source -# cargo fish_add_path -P "$CARGO_HOME/bin" -# go fish_add_path -P "$GOPATH/bin" -# deno fish_add_path -P "$HOME/.deno/bin" - -# pnpm -set -x PNPM_HOME "$HOME/Library/pnpm" -fish_add_path -P "$PNPM_HOME" - -# local bin +fish_add_path -P "$HOME/.orbstack/bin" fish_add_path -P "$HOME/.local/bin" function expose_app_to_path set -f app $argv[1] - if test -d ~/"Applications/$app.app" - fish_add_path -P ~/"Applications/$app.app/Contents/MacOS" + if test -d "$HOME/Applications/$app.app" + fish_add_path -P "$HOME/Applications/$app.app/Contents/MacOS" end if test -d "/Applications/$app.app" fish_add_path -P "/Applications/$app.app/Contents/MacOS" @@ -38,5 +29,4 @@ end expose_app_to_path Ghostty expose_app_to_path WezTerm -# suppress greeting set fish_greeting diff --git a/users/ryan/programs/fish/configs/99_interactive.fish b/users/ryan/programs/fish/configs/99_interactive.fish new file mode 100644 index 0000000..6944259 --- /dev/null +++ b/users/ryan/programs/fish/configs/99_interactive.fish @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +if status is-interactive + nix-your-shell fish | source + + if command -q nrr + source "$(COMPLETE=fish nrr | psub)" + if command -q nrx + source "$(COMPLETE=fish nrx | psub)" + end + end + + if set -q GHOSTTY_RESOURCES_DIR + source "$GHOSTTY_RESOURCES_DIR/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish" + end +end diff --git a/home/programs/git.nix b/users/ryan/programs/git.nix similarity index 66% rename from home/programs/git.nix rename to users/ryan/programs/git.nix index cd9bf25..90f8a92 100644 --- a/home/programs/git.nix +++ b/users/ryan/programs/git.nix @@ -1,7 +1,11 @@ -_: { +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ programs.git = { enable = true; - difftastic.enable = true; + # difftastic.enable = true; ignores = [ ".DS_Store" @@ -19,21 +23,25 @@ _: { commit.gpgSign = true; gpg.format = "openpgp"; - user.signingKey = "48C96B2057D71CB1"; + user.signingKey = "F605AB4AF937D5D0"; + column.ui = "auto"; log.date = "iso"; merge.conflictStyle = "zdiff3"; - diff.algorithm = "histogram"; - transfer.fsckObjects = true; - fetch.fsckObjects = true; - receive.fsckObjects = true; + diff.algorithm = "histogram"; + diff.colorMoved = "plain"; + diff.mnemonicPrefix = true; + diff.renames = true; fetch.prune = true; fetch.pruneTags = true; + fetch.all = true; + + transfer.fsckObjects = true; branch.sort = "-committerdate"; - tag.sort = "taggerdate"; + tag.sort = "version:refname"; push.autoSetupRemote = true; }; diff --git a/home/programs/go.nix b/users/ryan/programs/go.nix similarity index 60% rename from home/programs/go.nix rename to users/ryan/programs/go.nix index f8353e0..2220065 100644 --- a/home/programs/go.nix +++ b/users/ryan/programs/go.nix @@ -1,4 +1,8 @@ -_: { +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ programs.go = { enable = true; goPath = ".local/share/go"; diff --git a/users/ryan/programs/helix.nix b/users/ryan/programs/helix.nix new file mode 100644 index 0000000..dee98a8 --- /dev/null +++ b/users/ryan/programs/helix.nix @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ + inputs, + pkgs, + ... +}: +{ + programs.helix = { + enable = true; + package = inputs.self.packages.${pkgs.stdenvNoCC.hostPlatform.system}.helix-with-lsps; + defaultEditor = true; + }; +} diff --git a/home/programs/rust.nix b/users/ryan/programs/rust.nix similarity index 86% rename from home/programs/rust.nix rename to users/ryan/programs/rust.nix index 7645f63..1e47ac7 100644 --- a/home/programs/rust.nix +++ b/users/ryan/programs/rust.nix @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { pkgs, inputs, @@ -32,6 +36,5 @@ in cargo-cache cargo-deny cargo-expand - cargo-watch ]; } diff --git a/home/programs/starship.nix b/users/ryan/programs/starship.nix similarity index 96% rename from home/programs/starship.nix rename to users/ryan/programs/starship.nix index 7baf93e..c3e11fb 100644 --- a/home/programs/starship.nix +++ b/users/ryan/programs/starship.nix @@ -1,4 +1,8 @@ -_: { +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ programs.starship = { enable = true; @@ -10,8 +14,6 @@ _: { error_symbol = "[➜](bold red)"; }; - gcloud.disabled = true; - bun.format = "[$symbol($version)]($style) "; cmd_duration.format = "[$duration]($style) "; deno.format = "[$symbol($version)]($style) "; diff --git a/home/programs/tealdeer.nix b/users/ryan/programs/tealdeer.nix similarity index 57% rename from home/programs/tealdeer.nix rename to users/ryan/programs/tealdeer.nix index eb7a462..d0ee6e2 100644 --- a/home/programs/tealdeer.nix +++ b/users/ryan/programs/tealdeer.nix @@ -1,4 +1,8 @@ -_: { +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + +{ programs.tealdeer = { enable = true; settings = { diff --git a/home/programs/zsh.nix b/users/ryan/programs/zsh.nix similarity index 89% rename from home/programs/zsh.nix rename to users/ryan/programs/zsh.nix index 5044c1b..f981747 100644 --- a/home/programs/zsh.nix +++ b/users/ryan/programs/zsh.nix @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { config, inputs, diff --git a/home/programs/zsh/envExtra.zsh b/users/ryan/programs/zsh/envExtra.zsh similarity index 82% rename from home/programs/zsh/envExtra.zsh rename to users/ryan/programs/zsh/envExtra.zsh index 68e7bcd..393ed62 100644 --- a/home/programs/zsh/envExtra.zsh +++ b/users/ryan/programs/zsh/envExtra.zsh @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + # 1Password SSH export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" diff --git a/home/programs/zsh/initExtra.zsh b/users/ryan/programs/zsh/initExtra.zsh similarity index 87% rename from home/programs/zsh/initExtra.zsh rename to users/ryan/programs/zsh/initExtra.zsh index 331b74d..7317e03 100644 --- a/home/programs/zsh/initExtra.zsh +++ b/users/ryan/programs/zsh/initExtra.zsh @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + # zsh options setopt interactivecomments unsetopt menu_complete @@ -22,8 +26,5 @@ function take() { # nix-your-shell eval "$(nix-your-shell zsh)" -# iTerm -[[ "$TERM_PROGRAM" == "iTerm.app" ]] && source "$HOME/.iterm2_shell_integration.zsh" - # Ghostty [[ "$TERM_PROGRAM" == "ghostty" ]] && source "/Applications/Ghostty.app/Contents/Resources/ghostty/shell-integration/zsh/ghostty-integration" diff --git a/home/variables.nix b/users/ryan/variables.nix similarity index 71% rename from home/variables.nix rename to users/ryan/variables.nix index 0f6c057..532a802 100644 --- a/home/variables.nix +++ b/users/ryan/variables.nix @@ -1,19 +1,26 @@ +# SPDX-FileCopyrightText: 2025 Ryan Cao +# +# SPDX-License-Identifier: Apache-2.0 + { config, ... }: { home.sessionVariables = { + DO_NOT_TRACK = "1"; NEXT_TELEMETRY_DISABLED = "1"; NUXT_TELEMETRY_DISABLED = "1"; CHECKPOINT_DISABLE = "1"; DISABLE_TELEMETRY = "YES"; ASTRO_TELEMETRY_DISABLED = "1"; + WRANGLER_SEND_METRICS = "false"; + HF_HUB_DISABLE_TELEMETRY = "1"; + STORYBOOK_DISABLE_TELEMETRY = "1"; FNM_RESOLVE_ENGINES = "true"; - FNM_COREPACK_ENABLED = "true"; DENO_NO_UPDATE_CHECK = "1"; CSC_IDENTITY_AUTO_DISCOVERY = "false"; - COMMA_NIXPKGS_FLAKE = "n"; + COMMA_NIXPKGS_FLAKE = "nixpkgs"; COMMA_PICKER = "fzf"; LESSHISTFILE = "${config.xdg.stateHome}/less/history";