diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..18eefe7 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,4 @@ +{ + "workspace.checkThirdParty": false, + "workspace.library": ["${3rd}/luassert/library", "${3rd}/luv/library"] +} diff --git a/LICENSE b/LICENSE index 570135f..b76ad1c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,374 +1,21 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - +MIT License + +Copyright (c) 2021 Keanu Timmermans + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/common/Brewfile b/common/Brewfile deleted file mode 100644 index d24acbc..0000000 --- a/common/Brewfile +++ /dev/null @@ -1,143 +0,0 @@ -# Utils {{{ -def flatten_brews(brews) - brews.flat_map do |category, brew_list| - brew_list.map do |brew| - if brew.is_a?(Hash) - brew.to_a.first # Extract the package name and options from the hash - else - [brew, {}] # No options, so use an empty hash - end - end - end -end - -def liftoff(root) - root[:taps].each do |name| - tap name - end - - flatten_brews(root[:brews]).each do |pkg, opts| - brew(pkg, opts) - end - - root[:casks].each do |name| - cask name - end -end -# }}} - -packages = { - taps: [ - "ddev/ddev", - "the-wineskin-project/wineskin", - "isen-ng/dotnet-sdk-versions" - ], - brews: { # {{{ - services: [ - { "syncthing" => { restart_service: :changed } }, - ], - system: [ - "cmark", - "cmark-gfm", - "gcc@12", - "mkcert", - "nss", - "pinentry-mac", - "pkg-config", - "sdl2" - ], - languages: [ - "bash-language-server", - "composer", - "dhall", - "dhall-json", - "dhall-lsp-server", - "go", - "gradle", - "kotlin", - "lua-language-server", - "node", - "openjdk", - "php", - "poetry", - "ruby", - "stylua", - "uv", - "yaml-language-server" - ], - tools: [ - "act", - "bat", - "bear", - "coder", - "croc", - "ddev", - "dua-cli", - "eza", - "ffmpeg", - "fzf", - "gawk", - "gh", - "git-crypt", - "git-delta", - "gitui", - "gnupg", - "ijq", - "imagemagick", - "kubernetes-cli", - "neovim", - "pandoc", - "ripgrep", - "shellcheck", - "shfmt", - "sops", - "tealdeer", - "wget" - ] - }, # }}} - casks: [ # {{{ - "1password", - "1password-cli", - "alt-tab", - "android-studio", - "browserstacklocal", - "crossover", - "dotnet-sdk9", - "dotnet-sdk8", - "db-browser-for-sqlite", - "discord", - "discord@ptb", - "firefox@developer-edition", - "font-ibm-plex", - "font-jetbrains-mono-nerd-font", - "goland", - "google-chrome", - "imhex", - "insomnia", - "intellij-idea", - "iterm2", - "kitty", - "lens", - "obs", - "obsidian", - "orbstack", - "phpstorm", - "prismlauncher", - "qbittorrent", - "raycast", - "rectangle", - "rider", - "rubymine", - "sequel-ace", - "shottr", - "slack", - "spotify", - # "steam", - "tailscale-app", - "thunderbird", - "transmit", - "visual-studio-code" - ] # }}} -} - -liftoff packages diff --git a/dmitmel-dotfiles b/dmitmel-dotfiles index 7b2b39e..6676f24 160000 --- a/dmitmel-dotfiles +++ b/dmitmel-dotfiles @@ -1 +1 @@ -Subproject commit 7b2b39e8fa5a00a990c683fb69bae88462defb83 +Subproject commit 6676f249fb50421a457da1cddd2682c80b8669ab diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 944c79b..c9b2d05 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -1,10 +1,14 @@ +# Include Dima's config. include ../dmitmel-dotfiles/misc/kitty.conf -font_family JetBrainsMonoNFM-Regular +# I sure do love ligatures. +font_family Fira Code +# Remember previous window size. (which will probably always be maximized) remember_window_size yes -enable_audio_bell no -cursor_shape beam -# Mac bindings -map cmd+t launch --type=tab +# Disable the stupid bell. +enable_audio_bell no + +# The block confuses me, shush. +cursor_shape beam diff --git a/nix/darwin-configuration.nix.bak b/nix/darwin-configuration.nix.bak new file mode 100644 index 0000000..c73922e --- /dev/null +++ b/nix/darwin-configuration.nix.bak @@ -0,0 +1,220 @@ +{ config, pkgs, ... }: + +{ + networking = { + hostName = "alymac"; + }; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = with pkgs; [ + # System tools + libtool + pcre + pkg-config + patchelf + gnutls + gsasl + + # CLI tools + act + bat + bitwarden-cli + cloudflared + delta + exa + ffmpeg + fzf + gh + git + git-crypt + gitui + gnupg + jq + kubectl + kubelogin-oidc + mosh + neovim + nixpkgs-fmt + ripgrep + sops + vim + wget + + # Charm tools + skate + soft-serve + + # Programs + jetbrains.idea-ultimate + jetbrains.phpstorm + jetbrains.rider + rectangle + slack + tailscale + + # Programming languages + crystal + deno + dotnet-sdk + go + jdk + nil + nodejs_20 + ruby_3_1 + sbcl + shards + zig + + # Libraries + nodePackages.http-server + nodePackages.pnpm + nodePackages.prettier + nodePackages.yarn + openssl + + # Fyra vala crap + glib + glib-networking + gobject-introspection + gtk4 + libgee + meson + ninja + vala + ]; + + homebrew = { + enable = true; + # If only this didn't break. + onActivation.cleanup = "zap"; + + taps = [ + "drud/ddev" + "homebrew/cask" + "homebrew/cask-versions" + ]; + + # Please do not the brew. + brews = [ + "composer" + "ddev" + "mkcert" + "pkg-config" + "sdl2" + ]; + + casks = [ + "1password" + "1password-cli" + "alt-tab" + "amethyst" + "android-studio" + "audacity" + "background-music" + "db-browser-for-sqlite" + "discord" + "discord-ptb" + "docker" + "emacs" + "fig" + "firefox" + "google-chrome" + "itch" + "iterm2" + "obs" + "raycast" + "sequel-ace" + "shortcat" + "shottr" + "spotify" + "thunderbird" + "visual-studio-code" + ]; + }; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + + # Configuration for nix itself. + nix = { + package = pkgs.nix; + settings = { + experimental-features = [ "nix-command" "flakes" ]; + build-users-group = "nixbld"; + }; + gc = { + automatic = true; + options = "--delete-older-than 8d"; + }; + }; + + # Create /etc/zshrc that loads the nix-darwin environment. + # I wish I had access to inputs. + programs.zsh = { + enable = true; + promptInit = " + source ~/.dotfiles/zsh/zshrc + "; + }; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + + # Absolutely proprietary. + nixpkgs.config.allowUnfree = true; +} + + +# services.yabai = { +# enable = true; +# enableScriptingAddition = true; +# config = { +# layout = "bsp"; +# window_placement = "first_child"; +# auto_balance = "on"; +# +# focus_follows_mouse = "autoraise"; +# +# window_topmost = "on"; +# +# window_opacity = "on"; +# active_window_opacity = "1.0"; +# normal_window_opacity = "0.9"; +# }; +# +# extraConfig = " +# yabai -m signal --add event=dock_did_restart action=\"sudo yabai --load-sa\" +# sudo yabai --load-sa +# "; +# }; +# +# services.skhd = { +# enable = true; +# skhdConfig = " +# # Toggle split +# shift + cmd - enter : /run/current-system/sw/bin/yabai -m window --toggle split +# +# # Focus window +# ctrl + cmd - up : /run/current-system/sw/bin/yabai -m window --focus north +# ctrl + cmd - right : /run/current-system/sw/bin/yabai -m window --focus east +# ctrl + cmd - down : /run/current-system/sw/bin/yabai -m window --focus south +# ctrl + cmd - left : /run/current-system/sw/bin/yabai -m window --focus west +# +# # Move windows +# shift + cmd - left : /run/current-system/sw/bin/yabai -m window --warp west +# shift + cmd - right : /run/current-system/sw/bin/yabai -m window --warp east +# +# # Focus monitor +# ctrl + alt - z : /run/current-system/sw/bin/yabai -m display --focus prev +# +# # Increase window size +# shift + alt - a : /run/current-system/sw/bin/yabai -m window --resize left:-20:0 +# shift + alt - w : /run/current-system/sw/bin/yabai -m window --resize top:0:-20 +# +# # Decrease window size +# shift + cmd - s : /run/current-system/sw/bin/yabai -m window --resize bottom:0:-20 +# shift + cmd - w : /run/current-system/sw/bin/yabai -m window --resize top:0:20 +# "; +# }; diff --git a/nix/flake.lock b/nix/flake.lock index 81f346d..0b74a57 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -7,16 +7,15 @@ ] }, "locked": { - "lastModified": 1743127615, - "narHash": "sha256-+sMGqywrSr50BGMLMeY789mSrzjkoxZiu61eWjYS/8o=", + "lastModified": 1720469887, + "narHash": "sha256-BwPsGQ/EMqCreUc5j9Efj+wx13AjREtuHhbyHZygcE4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "fc843893cecc1838a59713ee3e50e9e7edc6207c", + "rev": "fabc653517106127e2ed435fb52e7e8854354428", "type": "github" }, "original": { "owner": "lnl7", - "ref": "nix-darwin-24.11", "repo": "nix-darwin", "type": "github" } @@ -24,11 +23,11 @@ "dotfiles": { "flake": false, "locked": { - "lastModified": 1737381808, - "narHash": "sha256-8iX9gv7R/bpmwr5aedF8Dl6tgKo+bKNyXV2MLp8AyGE=", + "lastModified": 1717202661, + "narHash": "sha256-yRqcINrAjRhW7JGE2qoAvQv1hirZLGZwmxayAMdtCU0=", "ref": "refs/heads/master", - "rev": "8a22bbd9fdeb3fe2bad5583fc7f8af8ac1899877", - "revCount": 494, + "rev": "66b760491c829609e016688beaa121d3aa1d2188", + "revCount": 473, "submodules": true, "type": "git", "url": "https://github.com/lexisother/dotfiles" @@ -39,6 +38,39 @@ "url": "https://github.com/lexisother/dotfiles" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -46,32 +78,69 @@ ] }, "locked": { - "lastModified": 1744743431, - "narHash": "sha256-iyn/WBYDc7OtjSawbegINDe/gIkok888kQxk3aVnkgg=", + "lastModified": 1720042825, + "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "owner": "nix-community", "repo": "home-manager", - "rev": "c61bfe3ae692f42ce688b5865fac9e0de58e1387", + "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.11", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } }, + "lix": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": "lix_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719353937, + "narHash": "sha256-86NBqDxAP20ET/UoKX0WvSItblNQ97czXb2q7lkMrwk=", + "ref": "refs/heads/main", + "rev": "5d9d94089fb1ca96222a34bfe245ef5c5ebefd37", + "revCount": 92, + "type": "git", + "url": "https://git.lix.systems/lix-project/nixos-module" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/nixos-module" + } + }, + "lix_2": { + "flake": false, + "locked": { + "lastModified": 1718767907, + "narHash": "sha256-gpd+mGQxqVHw2kO6rSPQel8TkChHh9UpqxjsmQi0QJM=", + "rev": "85f282ef572577899b3d80ba8def1b920a386218", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/85f282ef572577899b3d80ba8def1b920a386218.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz" + } + }, "nixpkgs": { "locked": { - "lastModified": 1744492897, - "narHash": "sha256-qqKO4FOo/vPmNIaRPcLqwfudUlQ29iNdI1IbCZfjmxs=", + "lastModified": 1720492477, + "narHash": "sha256-PV6LKJpj43tuKAMEfmXiKZjlOW1IqZORUJ8WYcdLtGE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "86484f6076aac9141df2bfcddbf7dcfce5e0c6bb", + "rev": "64f145f456b7a3953f191cad9e257cd88412044e", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-24.11-darwin", + "ref": "nixpkgs-24.05-darwin", "repo": "nixpkgs", "type": "github" } @@ -81,8 +150,24 @@ "darwin": "darwin", "dotfiles": "dotfiles", "home-manager": "home-manager", + "lix": "lix", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/nix/flake.nix b/nix/flake.nix index a656bc2..cf246b6 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -2,49 +2,55 @@ description = "flake of the lyxer..."; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; + darwin.url = "github:lnl7/nix-darwin"; + lix.url = "git+https://git.lix.systems/lix-project/nixos-module"; + dotfiles = { + url = "https://github.com/lexisother/dotfiles"; + type = "git"; + submodules = true; + flake = false; + }; - home-manager = { - url = "github:nix-community/home-manager/release-24.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - darwin = { - url = "github:lnl7/nix-darwin/nix-darwin-24.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - dotfiles = { - url = "https://github.com/lexisother/dotfiles"; - type = "git"; - submodules = true; - flake = false; - }; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + lix.inputs.nixpkgs.follows = "nixpkgs"; }; # add the inputs declared above to the argument attribute set - outputs = - { - self, - darwin, - ... - }@inputs: - let - lib = import ./lib { inherit inputs; }; - in - { - inherit lib; - - darwinConfigurations.alymac = darwin.lib.darwinSystem { - specialArgs = { inherit lib self inputs; }; - modules = [ - ./modules/common - ./modules/darwin - - ./home - - ./hosts/alymac - ]; - }; + outputs = { self, nixpkgs, lix, home-manager, dotfiles, darwin }: let + system = "x86_64-darwin"; + importAll = path: map + (p: import (path + ("/" + p))) + (builtins.attrNames (builtins.readDir path)); + pkgs = import nixpkgs { + inherit system; + overlays = importAll ./overlays; }; + libs = with builtins; listToAttrs (map + (path: { + name = replaceStrings [".nix"] [""] path; + value = (import (pkgs.lib.path.append ./lib path)) { inherit pkgs; }; + }) + (attrNames (readDir ./lib))); + in { + darwinConfigurations."alymac" = darwin.lib.darwinSystem { + inherit system; + specialArgs = libs; + modules = [ + ./system + lix.nixosModules.default + home-manager.darwinModules.home-manager + { + home-manager = { + extraSpecialArgs = { inherit self; inherit dotfiles; } // libs; + useGlobalPkgs = true; + useUserPackages = true; + users.alyxia.imports = [ ./home ]; + }; + } + ]; + }; + }; } diff --git a/nix/home/alyxia/default.nix b/nix/home/alyxia/default.nix deleted file mode 100644 index 5dea2d8..0000000 --- a/nix/home/alyxia/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ lib, ... }: - -{ - imports = lib.importAll [ ] ./.; - - home.stateVersion = "24.05"; -} diff --git a/nix/home/alyxia/docs.nix b/nix/home/alyxia/docs.nix deleted file mode 100644 index 22c8c7f..0000000 --- a/nix/home/alyxia/docs.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ lib, ... }: -{ - manual = lib.mapAttrs (_: lib.mkForce) { - html.enable = false; - json.enable = false; - manpages.enable = false; - }; -} diff --git a/nix/home/alyxia/git.nix b/nix/home/alyxia/git.nix deleted file mode 100644 index f69e8f6..0000000 --- a/nix/home/alyxia/git.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, ... }: - -{ - programs = { - git = { - enable = true; - package = pkgs.gitAndTools.gitFull; # contains git send-email et al - - userName = "Alyxia Sother"; - userEmail = "alyxia@riseup.net"; - signing = { - key = "01E16C4E775A37E4"; - signByDefault = true; - }; - - ignores = [ - ".DS_Store" - ]; - - delta = { - enable = true; - options = { - navigate = true; - line-numbers = true; - features = "decorations"; - - decorations = { - commit-decoration-style = "bold yellow box ul"; - file-style = "bold yellow ul"; - file-decoration-style = "none"; - hunk-header-decoration-style = "yellow box"; - }; - }; - }; - - extraConfig = { - init.defaultBranch = "master"; - }; - }; - - gh = { - enable = true; - # Why the *fuck* are these packages as opposed to GitHub links??? - extensions = with pkgs; [ - gh-actions-cache - ]; - }; - - gitui.enable = true; - }; -} diff --git a/nix/home/alyxia/syncthing.nix b/nix/home/alyxia/syncthing.nix deleted file mode 100644 index 9c5cae9..0000000 --- a/nix/home/alyxia/syncthing.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: - -{ - services = { - syncthing = { - enable = true; - }; - }; -} diff --git a/nix/home/default.nix b/nix/home/default.nix index 170bacc..14146e1 100644 --- a/nix/home/default.nix +++ b/nix/home/default.nix @@ -1,17 +1,7 @@ -{ inputs, self, ... }: +{ importAll, ... }: + { - imports = [ inputs.home-manager.darwinModules.home-manager ]; + imports = importAll [] ./.; - config = { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - - extraSpecialArgs = { - inherit self inputs; - }; - - users.alyxia = ./alyxia; - }; - }; + home.stateVersion = "24.05"; } diff --git a/nix/home/git.nix b/nix/home/git.nix new file mode 100644 index 0000000..a429f70 --- /dev/null +++ b/nix/home/git.nix @@ -0,0 +1,42 @@ +{ pkgs, ... }: + +{ + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; # contains git send-email et al + + userName = "Alyxia Sother"; + userEmail = "alyxia@riseup.net"; + signing = { + key = "01E16C4E775A37E4"; + signByDefault = true; + }; + + ignores = [ + ".DS_Store" + ]; + + delta = { + enable = true; + options = { + line-numbers = true; + features = "decorations"; + syntax-theme = "ansi"; + }; + }; + + extraConfig = { + init.defaultBranch = "master"; + }; + }; + + programs.gh = { + enable = true; + # Why the *fuck* are these packages as opposed to GitHub links??? + extensions = with pkgs; [ + gh-actions-cache + ]; + }; + + programs.gitui.enable = true; +} diff --git a/nix/home/alyxia/nvim.nix b/nix/home/nvim.nix similarity index 89% rename from nix/home/alyxia/nvim.nix rename to nix/home/nvim.nix index e051cdc..efbb5b5 100644 --- a/nix/home/alyxia/nvim.nix +++ b/nix/home/nvim.nix @@ -1,4 +1,5 @@ { self, pkgs, ... }: + { programs.neovim = { enable = true; @@ -28,10 +29,7 @@ command = "rescript-language-server"; args = [ "--node-ipc" ]; filetypes = [ "rescript" ]; - rootPatterns = [ - "rescript.json" - "bsconfig.json" - ]; + rootPatterns = [ "rescript.json" "bsconfig.json" ]; }; }; }; diff --git a/nix/home/alyxia/packages.nix b/nix/home/packages.nix similarity index 81% rename from nix/home/alyxia/packages.nix rename to nix/home/packages.nix index 07f15c1..3563604 100644 --- a/nix/home/alyxia/packages.nix +++ b/nix/home/packages.nix @@ -1,17 +1,8 @@ { pkgs, ... }: let - phpEnv = pkgs.php.buildEnv { - extensions = - { enabled, all }: - enabled - ++ (with all; [ - imagick - ]); - }; - packageSets = with pkgs; { - system = [ + system = [ gnutls gsasl libtool @@ -23,6 +14,7 @@ let base = [ act bat + bitwarden-cli cachix cloudflared delta @@ -33,11 +25,10 @@ let git-crypt gitui gnupg - imagemagick + jq kubectl kubelogin-oidc mosh - nix-init nixd nixpkgs-fmt pandoc @@ -62,16 +53,13 @@ let dhall dhall-json dhall-lsp-server - ghostscript go jdk kotlin kotlin-language-server lua-language-server nil - nodejs_22 - phpEnv - phpEnv.packages.composer + nodejs_20 python2 ruby_3_1 sbcl @@ -99,8 +87,8 @@ let distro ]; }; - everything = builtins.concatLists (builtins.attrValues packageSets); + in { home.packages = everything; diff --git a/nix/home/alyxia/zsh.nix b/nix/home/zsh.nix similarity index 95% rename from nix/home/alyxia/zsh.nix rename to nix/home/zsh.nix index 8dd4a48..777c0a6 100644 --- a/nix/home/alyxia/zsh.nix +++ b/nix/home/zsh.nix @@ -1,4 +1,5 @@ { self, ... }: + { programs.zsh = { enable = true; @@ -17,7 +18,6 @@ export FRENYARD_SCALE=2.40 export RETHINK_API="https://rethink.alyxia.dev" export KUBECONFIG="$HOME/.kube/config.yaml" - export SDKROOT="$(xcrun --show-sdk-path)" function violent-update() { # diff --git a/nix/lib/default.nix b/nix/lib/default.nix deleted file mode 100644 index 58d9962..0000000 --- a/nix/lib/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ inputs }: -let - lib0 = inputs.nixpkgs.lib; - - myLib = lib0.makeExtensible ( - self: - let - callLib = file: import file { lib = self; }; - in - { - importAll = callLib ./importAll.nix; - } - ); - - lib = myLib.extend (_: _: lib0); -in -lib diff --git a/nix/lib/importAll.nix b/nix/lib/importAll.nix index 770bbe6..2db75b0 100644 --- a/nix/lib/importAll.nix +++ b/nix/lib/importAll.nix @@ -1,31 +1,15 @@ -{ lib }: -let - inherit (lib) - map - filter - path - attrNames - filterAttrs - pathExists - elem - match - ; +{ pkgs, ... }: - inherit (builtins) readDir baseNameOf; -in -exclude: cwd: -filter (e: !elem e exclude) ( - map (p: path.append cwd p) ( - attrNames ( - filterAttrs ( - p: t: +exclude: cwd: with builtins; with pkgs.lib; filter + (e: !elem e exclude) + (map + (p: path.append cwd p) + (attrNames (attrsets.filterAttrs + (p: t: let d = t == "directory"; b = baseNameOf p; in - d && pathExists (path.append cwd (p + "/default.nix")) - || !d && match ''.*\.nix'' b != null && b != "default.nix" - ) (readDir cwd) - ) - ) -) + d && pathExists (path.append cwd (p + "/default.nix")) || + !d && match ''.*\.nix'' b != null && b != "default.nix") + (readDir cwd)))) diff --git a/nix/modules/common/default.nix b/nix/modules/common/default.nix deleted file mode 100644 index 8bdc9b3..0000000 --- a/nix/modules/common/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ lib, ... }: -{ - imports = lib.importAll [ ] ./.; -} diff --git a/nix/modules/common/users.nix b/nix/modules/common/users.nix deleted file mode 100644 index cf7317b..0000000 --- a/nix/modules/common/users.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - users.users.alyxia = { - name = "alyxia"; - home = if pkgs.stdenv.hostPlatform.isDarwin then "/Users/alyxia" else "/home/alyxia"; - }; -} diff --git a/nix/modules/darwin/default.nix b/nix/modules/darwin/default.nix deleted file mode 100644 index 8bdc9b3..0000000 --- a/nix/modules/darwin/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ lib, ... }: -{ - imports = lib.importAll [ ] ./.; -} diff --git a/nix/overlays/lix.nix b/nix/overlays/lix.nix new file mode 100644 index 0000000..f44f23b --- /dev/null +++ b/nix/overlays/lix.nix @@ -0,0 +1,12 @@ +(final: prev: { + lix = prev.lix.overrideAttrs (oldAttrs: { + postPatch = (oldAttrs.postPatch or "") + '' + substituteInPlace src/libmain/shared.cc \ + --replace-fail "(Lix, like Nix)" "but for lesbians" + ''; + + # WARNING: This greatly assumes that lix will never merge a CL that breaks + # the tests. But I choose to disable them anyway because the build time is faster + doCheck = false; + }); +}) diff --git a/nix/hosts/alymac/default.nix b/nix/system/default.nix similarity index 79% rename from nix/hosts/alymac/default.nix rename to nix/system/default.nix index dab5f82..018abe3 100644 --- a/nix/hosts/alymac/default.nix +++ b/nix/system/default.nix @@ -1,5 +1,7 @@ +{ importAll, ... }: + { - system.stateVersion = 5; + imports = importAll [] ./.; networking = { computerName = "Alyxia's MacBook Pro"; @@ -7,6 +9,11 @@ localHostName = "alymac"; }; + users.users.alyxia = { + name = "alyxia"; + home = "/Users/alyxia"; + }; + # enable the gpg agent by default programs.gnupg.agent.enable = true; @@ -16,7 +23,4 @@ # tailscaled isn't automatically registered as a service that should run on installation. services.tailscale.enable = true; - - # set nixpkgs system - nixpkgs.hostPlatform = "x86_64-darwin"; } diff --git a/nix/modules/darwin/homebrew.nix b/nix/system/homebrew.nix similarity index 77% rename from nix/modules/darwin/homebrew.nix rename to nix/system/homebrew.nix index beb98d9..99b0fd4 100644 --- a/nix/modules/darwin/homebrew.nix +++ b/nix/system/homebrew.nix @@ -1,3 +1,5 @@ +{ ... }: + { homebrew = { enable = true; @@ -11,21 +13,19 @@ "drud/ddev" "homebrew/cask-versions" "int128/kubelogin" - "the-wineskin-project/wineskin" ]; # Please do not the brew. brews = [ "bear" "coder" + "composer" "croc" "ddev" "deno" "dotnet" "ferium" - "gcc@12" "gradle" - "ijq" "kubelogin" "mkcert" "nss" @@ -37,13 +37,13 @@ # Fyra crap, but from Homebrew because someone doesn't know how to # package libraries in nixpkgs - # "appstream-glib" - # "glib" - # "gobject-introspection" - # "gsettings-desktop-schemas" - # "gtk4" - # "gtksourceview5" - # "libgee" + "appstream-glib" + "glib" + "gobject-introspection" + "gsettings-desktop-schemas" + "gtk4" + "gtksourceview5" + "libgee" ]; casks = [ @@ -51,31 +51,27 @@ "1password-cli" "alt-tab" "android-studio" - "anydesk" "audacity" "background-music" "browserstacklocal" - "clion" "db-browser-for-sqlite" "discord" - "discord@ptb" + "discord-ptb" "docker" + "dolphin@dev" "firefox" - "firefox@developer-edition" - "fleet" + "firefox-developer-edition" "goland" "google-chrome" - "imhex" - "insomnia" "intellij-idea" "itch" "iterm2" "lens" "minecraft" "obs" - "obsidian" "orbstack" "phpstorm" + "plexamp" "qbittorrent" "raycast" "readdle-spark" @@ -92,7 +88,6 @@ "typora" "visual-studio-code" "wine-stable" - "wineskin" ]; }; } diff --git a/nix/modules/common/nix.nix b/nix/system/nix.nix similarity index 91% rename from nix/modules/common/nix.nix rename to nix/system/nix.nix index fe3bce3..43f97f2 100644 --- a/nix/modules/common/nix.nix +++ b/nix/system/nix.nix @@ -1,16 +1,12 @@ { pkgs, ... }: + { services.nix-daemon.enable = true; nix = { - # package = inputs.nixpkgs-old.legacyPackages.${pkgs.system}.lix; - settings = { # enable flakes and the `nix` command - experimental-features = [ - "nix-command" - "flakes" - ]; + experimental-features = [ "nix-command" "flakes" ]; # disable the flake registry since it worsens perf flake-registry = pkgs.writers.writeJSON "flakes-empty.json" { @@ -19,9 +15,9 @@ }; # "apply the free optimisations" - # auto-optimise-store = true; + auto-optimise-store = true; - # we need to create some trusted and allwed users so that we can use + # we need to create some trusted and allwed users so that we can use # some features like substituters allowed-users = [ "@wheel" # allow sudo users to mark the following values as trusted @@ -68,7 +64,6 @@ "lexisother.cachix.org-1:/JtVjLzEue9SHlXK0O4ogtZpRpzeLqTwfZpfTIN/N2s=" ]; }; - gc = { automatic = true; options = "--delete-older-than 3d"; diff --git a/nix/modules/darwin/preferences.nix b/nix/system/preferences.nix similarity index 95% rename from nix/modules/darwin/preferences.nix rename to nix/system/preferences.nix index c56c187..7d52f4c 100644 --- a/nix/modules/darwin/preferences.nix +++ b/nix/system/preferences.nix @@ -1,3 +1,5 @@ +{ ... }: + { system.defaults = { ActivityMonitor = { @@ -12,8 +14,8 @@ NSNavPanelExpandedStateForSaveMode = true; NSNavPanelExpandedStateForSaveMode2 = true; - KeyRepeat = 6; - InitialKeyRepeat = 25; + KeyRepeat = 1; + InitialKeyRepeat = 10; }; LaunchServices.LSQuarantine = false; diff --git a/nvim/.luarc.json b/nvim/.luarc.json deleted file mode 100644 index 8c8dd32..0000000 --- a/nvim/.luarc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", - "runtime.version": "LuaJIT", - "diagnostics.globals": ["vim"], - "diagnostics.disable": ["empty-block", "duplicate-set-field", "inject-field"], - "diagnostics.unusedLocalExclude": ["_*"] -} diff --git a/nvim/.stylua.toml b/nvim/.stylua.toml deleted file mode 100644 index 4573b87..0000000 --- a/nvim/.stylua.toml +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "LuaJIT" -column_width = 100 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferSingle" -call_parentheses = "Always" -space_after_function_names = "Never" -collapse_simple_statement = "Always" diff --git a/nvim/.vintrc.yml b/nvim/.vintrc.yml deleted file mode 100644 index 64f8063..0000000 --- a/nvim/.vintrc.yml +++ /dev/null @@ -1,7 +0,0 @@ -cmdargs: - severity: style_problem - env: - neovim: true -policies: - ProhibitSetNoCompatible: - enabled: false diff --git a/nvim/after/ftplugin/dream.vim b/nvim/after/ftplugin/dream.vim index 51638a8..50703e1 100644 --- a/nvim/after/ftplugin/dream.vim +++ b/nvim/after/ftplugin/dream.vim @@ -1 +1 @@ -execute 'source' fnameescape(g:a_dotfiles_dir) . '/dmitmel-dotfiles/nvim/after/ftplugin/text.vim' +execute 'source' fnameescape(g:k_dotfiles_dir) . '/dmitmel-dotfiles/nvim/after/ftplugin/text.vim' diff --git a/nvim/after/lsp/bashls.lua b/nvim/after/lsp/bashls.lua deleted file mode 100644 index e9bc27d..0000000 --- a/nvim/after/lsp/bashls.lua +++ /dev/null @@ -1,16 +0,0 @@ --- - ----@type dotfiles.lsp.Config -return { - cmd = { 'bash-language-server', 'start' }, - filetypes = { 'bash', 'sh' }, - root_markers = { '.git' }, - - settings = { - bashIde = { - globPattern = '*@(.sh|.bash)', - }, - }, - - build_settings = function(ctx) ctx.settings:merge(ctx.new_settings:pick({ 'bashIde' })) end, -} diff --git a/nvim/after/lsp/biome.lua b/nvim/after/lsp/biome.lua deleted file mode 100644 index a1ccc0e..0000000 --- a/nvim/after/lsp/biome.lua +++ /dev/null @@ -1,5 +0,0 @@ ----@type dotfiles.lsp.Config -return { - -- why aren't they configuring this??? - root_markers = { 'biome.json', 'biome.jsonc' }, -} diff --git a/nvim/after/lsp/php.lua b/nvim/after/lsp/php.lua deleted file mode 100644 index f85e3c5..0000000 --- a/nvim/after/lsp/php.lua +++ /dev/null @@ -1,9 +0,0 @@ --- - ----@type dotfiles.lsp.Config -return { - cmd = { 'phpactor', 'language-server' }, - filetypes = { 'php' }, - root_markers = { '.git', 'composer.json', '.phpactor.json', '.phpactor.yml' }, - workspace_required = true, -} diff --git a/nvim/after/plugin/keybinds.vim b/nvim/after/plugin/keybinds.vim new file mode 100644 index 0000000..46efcf3 --- /dev/null +++ b/nvim/after/plugin/keybinds.vim @@ -0,0 +1,4 @@ +nnoremap ff Telescope find_files +nnoremap fg Telescope live_grep +nnoremap fb Telescope buffers +nnoremap fh Telescope help_tags diff --git a/nvim/coc-languages/go.vim b/nvim/coc-languages/go.vim new file mode 100644 index 0000000..d838559 --- /dev/null +++ b/nvim/coc-languages/go.vim @@ -0,0 +1,2 @@ +call extend(g:dotfiles_coc_extensions, {'coc-go': 1}) +call extend(g:dotfiles_coc_filetypes, {'go': 1}) diff --git a/nvim/coc-languages/javascript.vim b/nvim/coc-languages/javascript.vim new file mode 100644 index 0000000..6996f0d --- /dev/null +++ b/nvim/coc-languages/javascript.vim @@ -0,0 +1 @@ +let g:coc_user_config['prettier']['printWidth'] = 80 diff --git a/nvim/coc-languages/lisp.vim b/nvim/coc-languages/lisp.vim new file mode 100644 index 0000000..bb594d3 --- /dev/null +++ b/nvim/coc-languages/lisp.vim @@ -0,0 +1,2 @@ +call extend(g:dotfiles_coc_extensions, {'coc-cl': 1}) +call extend(g:dotfiles_coc_filetypes, {'lisp': 1}) diff --git a/nvim/coc-languages/lua.vim b/nvim/coc-languages/lua.vim new file mode 100644 index 0000000..c8c8489 --- /dev/null +++ b/nvim/coc-languages/lua.vim @@ -0,0 +1,10 @@ +if !has('nvim-0.2.1') | finish | endif +call extend(g:dotfiles_coc_extensions, {'coc-stylua': 1}) +let g:coc_user_config['coc.preferences.formatOnSaveFiletypes'] = ['lua'] + +" We're using Nix here, so point to the right path... +if has('macunix') + let g:coc_user_config['stylua.styluaPath'] = "/etc/profiles/per-user/alyxia/bin/stylua" +else + let g:coc_user_config['stylua.styluaPath'] = "/usr/bin/stylua" +endif diff --git a/nvim/coc-languages/php.vim b/nvim/coc-languages/php.vim new file mode 100644 index 0000000..ad91d65 --- /dev/null +++ b/nvim/coc-languages/php.vim @@ -0,0 +1,2 @@ +call extend(g:dotfiles_coc_extensions, {'coc-phpls': 1, 'coc-blade': 1, 'coc-tighten-lint': 1}) +call extend(g:dotfiles_coc_filetypes, {'php': 1, 'blade': 1}) diff --git a/nvim/coc-languages/sh.vim b/nvim/coc-languages/sh.vim new file mode 100644 index 0000000..c85456d --- /dev/null +++ b/nvim/coc-languages/sh.vim @@ -0,0 +1,2 @@ +call extend(g:dotfiles_coc_extensions, {'coc-sh': 1}) +call extend(g:dotfiles_coc_filetypes, {'sh': 1, 'zsh': 1}) diff --git a/nvim/coc-languages/tex.vim b/nvim/coc-languages/tex.vim new file mode 100644 index 0000000..a64c73e --- /dev/null +++ b/nvim/coc-languages/tex.vim @@ -0,0 +1,2 @@ +call extend(g:dotfiles_coc_extensions, {'coc-vimtex': 1}) +call extend(g:dotfiles_coc_filetypes, {'tex': 1, 'cls': 1}) diff --git a/nvim/dotfiles/lspconfigs/dart.lua b/nvim/dotfiles/lspconfigs/dart.lua new file mode 100644 index 0000000..d7674ef --- /dev/null +++ b/nvim/dotfiles/lspconfigs/dart.lua @@ -0,0 +1,4 @@ +local ignition = require("dotfiles.lsp.ignition") +local dartls_config = require("lspconfig.server_configurations.dartls").default_config + +ignition.setup_config("dartls", dartls_config) diff --git a/nvim/dotfiles/lspconfigs/php.lua b/nvim/dotfiles/lspconfigs/php.lua new file mode 100644 index 0000000..2effbad --- /dev/null +++ b/nvim/dotfiles/lspconfigs/php.lua @@ -0,0 +1,4 @@ +local ignition = require("dotfiles.lsp.ignition") +local phpactor_config = require("lspconfig.server_configurations.phpactor").default_config + +ignition.setup_config("phpactor", phpactor_config) diff --git a/nvim/dotfiles/plugins-list.lua b/nvim/dotfiles/plugins-list.lua deleted file mode 100644 index 56cb46a..0000000 --- a/nvim/dotfiles/plugins-list.lua +++ /dev/null @@ -1,5 +0,0 @@ --- Not really part of the "plugins list" per-se, for the actual plugin list see `plugins-list.vim`. - -dotplug.plug({ - { import = 'adotfiles.plugins' }, -}) diff --git a/nvim/dotfiles/plugins-list.vim b/nvim/dotfiles/plugins-list.vim index d36523c..259f3e4 100644 --- a/nvim/dotfiles/plugins-list.vim +++ b/nvim/dotfiles/plugins-list.vim @@ -1,40 +1,71 @@ -exe dotplug#define_plug_here() +let s:plug = funcref('dotfiles#plugman#register') " UI {{{ if has('nvim') - Plug 'romgrk/barbar.nvim' - Plug 'hoob3rt/lualine.nvim' + call s:plug('romgrk/barbar.nvim') + call s:plug('hoob3rt/lualine.nvim') endif " }}} " Navigation {{{ if has('nvim') - Plug 'nvim-telescope/telescope.nvim', { -\ 'requires': [ -\ 'nvim-lua/plenary.nvim' -\ ] -\ } + call s:plug('nvim-telescope/telescope.nvim') " dependencies {{{ + call s:plug('nvim-lua/plenary.nvim') + " }}} endif " }}} " Files {{{ if has('nvim') - Plug 'kyazdani42/nvim-web-devicons' - Plug 'akinsho/nvim-toggleterm.lua' + call s:plug('kyazdani42/nvim-web-devicons') + call s:plug('akinsho/nvim-toggleterm.lua') endif - Plug 'preservim/nerdtree' - Plug 'antoyo/vim-licenses' + call s:plug('preservim/nerdtree') + call s:plug('antoyo/vim-licenses') " }}} " Language specific {{{ - Plug 'lervag/vimtex' - Plug 'm-pilia/vim-mediawiki' - Plug 'aquach/vim-mediawiki-editor' - Plug 'davidmh/mdx.nvim' + if has('nvim') + call s:plug('xiyaowong/coc-nvim-lua') + call s:plug('alaviss/nim.nvim') + if has('unix') + call s:plug('nvim-neorg/neorg') " dependencies {{{ + call s:plug('nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }) + " }}} + endif + endif + call s:plug('lervag/vimtex') + call s:plug('stevearc/vim-arduino') + call s:plug('luke-gru/vim-riml') + call s:plug('guns/vim-sexp') + call s:plug('vim-scripts/newlisp') + call s:plug('m-pilia/vim-mediawiki') + call s:plug('aquach/vim-mediawiki-editor') + call s:plug('noahfrederick/vim-laravel') " dependencies {{{ + call s:plug('noahfrederick/vim-composer') + call s:plug('tpope/vim-projectionist') + call s:plug('tpope/vim-dispatch') + " }}} + call s:plug('rescript-lang/vim-rescript') +" }}} + +" coc {{{ + if g:dotfiles_build_coc_from_source + call s:plug('https://github.com/UltiRequiem/coc-cl', { 'do': 'yarn install --frozen-lockfile && yarn build' }) + endif +" }}} + +" mini.nvim {{{ + call s:plug('echasnovski/mini.pairs') " }}} " Misc {{{ - Plug 'wakatime/vim-wakatime' + if has('nvim') + call s:plug('andweeb/presence.nvim') + if has('nvim-0.6.0') + call s:plug('github/copilot.vim') + endif + endif + call s:plug('junegunn/vader.vim') + call s:plug('wakatime/vim-wakatime') " }}} - -delcommand Plug diff --git a/nvim/ftdetect/dotfiles.lua b/nvim/ftdetect/dotfiles.lua deleted file mode 100644 index 08ee3e3..0000000 --- a/nvim/ftdetect/dotfiles.lua +++ /dev/null @@ -1,5 +0,0 @@ -vim.filetype.add({ - extension = { - mdx = 'mdx' - } -}) diff --git a/nvim/ftdetect/dotfiles.vim b/nvim/ftdetect/dotfiles.vim index b6b5926..c120a2d 100644 --- a/nvim/ftdetect/dotfiles.vim +++ b/nvim/ftdetect/dotfiles.vim @@ -1,2 +1,10 @@ -autocmd BufNewFile,BufRead *.dream setf dream -autocmd BufNewFile,BufRead *.newlisp setf newlisp +function! s:genSrcInfo() + :call system('rm -rf .SRCINFO; makepkg --printsrcinfo > .SRCINFO') +endfunction + +augroup dotfilesftdetect + autocmd BufWritePost PKGBUILD :call s:genSrcInfo() + + autocmd BufNewFile,BufRead *.dream setf dream + autocmd BufNewFile,BufRead *.newlisp setf newlisp +augroup END diff --git a/nvim/ftplugin/PKGBUILD.vim b/nvim/ftplugin/PKGBUILD.vim deleted file mode 100644 index 6f28e47..0000000 --- a/nvim/ftplugin/PKGBUILD.vim +++ /dev/null @@ -1,5 +0,0 @@ -function! s:genSrcInfo() - :call system('rm -rf .SRCINFO; makepkg --printsrcinfo > .SRCINFO') -endfunction - -autocmd BufWritePost PKGBUILD :call s:genSrcInfo() diff --git a/nvim/ftplugin/mdx.vim b/nvim/ftplugin/mdx.vim deleted file mode 100644 index 4249185..0000000 --- a/nvim/ftplugin/mdx.vim +++ /dev/null @@ -1,8 +0,0 @@ -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -" Taken from $VIMRUNTIME/ftplugin/javascript.vim -exe dotfiles#ft#setlocal('comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://') -exe dotfiles#ft#setlocal('commentstring=//\ %s') diff --git a/nvim/ideavimrc b/nvim/ideavimrc deleted file mode 100644 index 433f430..0000000 --- a/nvim/ideavimrc +++ /dev/null @@ -1,48 +0,0 @@ -" vim:ft=vim -" .ideavimrc is a configuration file for IdeaVim plugin. It uses -" the same commands as the original .vimrc configuration. -" You can find a list of commands here: https://jb.gg/h38q75 -" Find more examples here: https://jb.gg/share-ideavimrc - - -" Show a few lines of context around the cursor. Note that this makes the -" text scroll if you mouse-click near the start or end of the window. -set scrolloff=5 - -" Do incremental searching. -set incsearch - -set number " show current line number -set relativenumber " show relative line numbers - -" Don't use Ex mode, use Q for formatting. -map Q gq - -" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins -" Highlight copied text -Plug 'machakann/vim-highlightedyank' -" Commentary plugin -Plug 'tpope/vim-commentary' - -Plug 'terryma/vim-multiple-cursors' -" vim-multiple-cursors default mappings {{{ -" Remap multiple-cursors shortcuts to match terryma/vim-multiple-cursors -nmap NextWholeOccurrence -xmap NextWholeOccurrence -nmap g NextOccurrence -xmap g NextOccurrence -xmap SkipOccurrence -xmap RemoveOccurrence - -" Note that the default and g shortcuts don't work on Mac due to dead keys. -" is used to enter accented text e.g. ñ -" Feel free to pick your own mappings that are not affected. I like to use -nmap AllWholeOccurrences -xmap AllWholeOccurrences -nmap g AllOccurrences -xmap g AllOccurrences -" }}} - - -"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t -map \r (ReformatCode) diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..a9decd1 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,14 @@ +-- Disable airline to use barbar +vim.g.loaded_airline = 1 + +-- TODO: Refactor to Lua +-- This has stopped working...? +-- let g:dotfiles_plugin_manager_inhibited_plugins = { +-- \ 'vim-airline': 1, +-- \ } + +-- Small plugin configs +vim.g.dashboard_default_executive ='fzf' + +-- Styling +vim.o.termguicolors = true diff --git a/nvim/init.vim b/nvim/init.vim index ab06f72..d16d87e 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,20 +1,26 @@ -" Add my paths to the rtp -let g:a_nvim_dotfiles_dir = expand(':p:h') -let g:a_dotfiles_dir = expand(':p:h:h') -let &runtimepath = g:a_nvim_dotfiles_dir.','.&runtimepath.','.g:a_nvim_dotfiles_dir.'/after' +let g:k_nvim_dotfiles_dir = expand(':p:h') +let g:k_dotfiles_dir = expand(':p:h:h') +let &runtimepath = g:k_nvim_dotfiles_dir.','.&runtimepath.','.g:k_nvim_dotfiles_dir.'/after' -" dotfiles configuration -let g:vim_ide = 2 +let g:vim_ide = 1 let g:dotfiles_rainbow_indent_opacity = 0.5 -let g:dotfiles_treesitter_highlighting = v:true -let g:dotfiles_highlight_url_under_cursor = v:true + +" Inhibited plugins {{{ + " I'd love to use dotfiles#plugman#inhibit in my plugins-list.vim but by that + " point it is already too late. + let g:dotfiles#plugman#inhibited_plugins = {} + + " Does not do its job properly anymore, I'm afraid. + let g:dotfiles#plugman#inhibited_plugins["delimitMate"] = 1 +" }}} source :p:h/../dmitmel-dotfiles/nvim/init.vim -let g:loaded_airline = 1 - -" Doesn't hurt to try and set again. -set termguicolors +if has('nvim') + luafile :p:h/init.lua +else + set termguicolors +endif " Arrow key fix kanged from {{{ if exists("g:HELP_MY_ARROW_KEYS_ARE_BROKEN") diff --git a/nvim/lua/adotfiles/plugins/blink.lua b/nvim/lua/adotfiles/plugins/blink.lua deleted file mode 100644 index 5eaae79..0000000 --- a/nvim/lua/adotfiles/plugins/blink.lua +++ /dev/null @@ -1,18 +0,0 @@ ----@type LazySpec -return { - 'blink.cmp', - ---@type blink.cmp.Config - opts = { - keymap = { - [''] = { - 'select_next', - 'fallback', - }, - - [''] = { - 'select_prev', - 'fallback', - }, - }, - }, -} diff --git a/nvim/lua/kdotfiles/utils.lua b/nvim/lua/kdotfiles/utils.lua new file mode 100644 index 0000000..17e4ef7 --- /dev/null +++ b/nvim/lua/kdotfiles/utils.lua @@ -0,0 +1,28 @@ +local M = require('dotfiles.autoload')('kdotfiles.utils') + +function M.file_exists(file) + local f = io.open(file, "rb") + if f then f:close() end + return f ~= nil +end + +function M.lines_from(file) + if not M.file_exists(file) then return {} end + lines = {} + for line in io.lines(file) do + lines[#lines + 1] = line + end + return lines +end + +function M.get_os(lines) + os_name = "Unknown" + for k,v in pairs(lines) do + if string.match(v, "^ID=") then + os_name = string.sub(v, 4) + end + end + return os_name +end + +return M diff --git a/nvim/plugin/barbar.lua b/nvim/plugin/barbar.lua index e1b5f5b..cbaa758 100644 --- a/nvim/plugin/barbar.lua +++ b/nvim/plugin/barbar.lua @@ -1,23 +1,18 @@ local ok, barbar = pcall(require, 'barbar') -if not ok then return end +if not ok then return end; ----@diagnostic disable: missing-fields - -barbar.setup({ +barbar.setup { icons = { buffer_index = true, filetype = { - enabled = true, - }, - }, -}) --[[@as barbar.config.options]] + enabled = true + } + } +} local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } -map('n', '', 'BufferNext', opts) -map('n', '', 'BufferPrevious', opts) - -- Navigating buffers map('n', '', 'BufferPrevious', opts) map('n', '', 'BufferNext', opts) diff --git a/nvim/plugin/commands.vim b/nvim/plugin/commands.vim index f38449c..7842ea6 100644 --- a/nvim/plugin/commands.vim +++ b/nvim/plugin/commands.vim @@ -1,3 +1 @@ -if !(dotplug#has('coc.nvim') && g:vim_ide == 1) - command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') -endif +command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') diff --git a/nvim/plugin/completion.vim b/nvim/plugin/completion.vim deleted file mode 100644 index 824849f..0000000 --- a/nvim/plugin/completion.vim +++ /dev/null @@ -1,23 +0,0 @@ -if !(dotplug#has('coc.nvim') && g:vim_ide == 1) | finish | endif - -" Additional extensions {{{ -" Go -call dotutils#add_unique(g:coc_global_extensions, 'coc-go') -" Common Lisp -call dotutils#add_unique(g:coc_global_extensions, 'coc-cl') -" PHP -call dotutils#add_unique(g:coc_global_extensions, 'coc-phpls') -call dotutils#add_unique(g:coc_global_extensions, 'coc-blade') -call dotutils#add_unique(g:coc_global_extensions, 'coc-tighten-lint') -" Shell -call dotutils#add_unique(g:coc_global_extensions, 'coc-sh') -" TeX -call dotutils#add_unique(g:coc_global_extensions, 'coc-vimtex') -" Vue -call dotutils#add_unique(g:coc_global_extensions, '@yaegassy/coc-volar') -" }}} - -" Config {{{ -let g:coc_user_config['prettier'] = {} -let g:coc_user_config['prettier']['printWidth'] = 80 -" }}} diff --git a/nvim/plugin/keybinds.vim b/nvim/plugin/keybinds.vim index cc331dd..d6dbc8d 100644 --- a/nvim/plugin/keybinds.vim +++ b/nvim/plugin/keybinds.vim @@ -1,33 +1,23 @@ nnoremap :NERDTreeToggle -inoremap db - " Completion {{{ - if (dotplug#has('coc.nvim') && g:vim_ide == 1) - function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' - endfunction + function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' + endfunction - nmap (coc-codeaction-line) - xmap (coc-codeaction-selected) + nmap (coc-codeaction-line) + xmap (coc-codeaction-selected) - inoremap coc#pum#visible() ? coc#pum#confirm() - \: "\u\\=coc#on_enter()\" + inoremap coc#pum#visible() ? coc#pum#confirm() : "\" - inoremap - \ coc#pum#visible() ? coc#pum#next(1) : - \ check_back_space() ? "\" : - \ coc#refresh() - inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" - endif + inoremap + \ coc#pum#visible() ? coc#pum#next(1): + \ check_back_space() ? "\" : + \ coc#refresh() + inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " }}} -nnoremap ff Telescope find_files -nnoremap fg Telescope live_grep -nnoremap fb Telescope buffers -nnoremap fh Telescope help_tags - " Copy to clipboard register and paste from clipboard register {{{ " Taken from https://unix.stackexchange.com/a/23437 nnoremap "+y diff --git a/nvim/plugin/lualine.lua b/nvim/plugin/lualine.lua index 70ad855..d281582 100644 --- a/nvim/plugin/lualine.lua +++ b/nvim/plugin/lualine.lua @@ -1,14 +1,12 @@ -local ok, lualine = pcall(require, 'lualine') -if not ok then return end; - local dotfiles_gruv = require'lualine.themes.gruvbox' local theme = require'dotfiles.colorscheme' -- https://github.com/dmitmel/dotfiles/commit/bf96e553764e3a166286f5a6a8017e01dadcf6f9 -- https://ptb.discord.com/channels/382339402338402315/382339402338402317/885864846892077086 -local function get_color(index) +function get_color(index) local color = theme.base16_colors[index] - return string.format('%06x', color.gui) + local r, g, b = unpack(color, 1, 3) + return string.format('#%02x%02x%02x', r, g, b) end -- Structure of themes is as follows: @@ -16,21 +14,21 @@ end -- b: secondary components, such git branch info -- c: Middle components, basically everything in the middle -dotfiles_gruv.normal.a.bg = get_color(11) +dotfiles_gruv.normal.a.bg = get_color(12) -dotfiles_gruv.insert.a.bg = get_color(13) -dotfiles_gruv.insert.c.bg = get_color(1) +dotfiles_gruv.insert.a.bg = get_color(14) +dotfiles_gruv.insert.c.bg = get_color(2) -dotfiles_gruv.visual.a.bg = get_color(14) -dotfiles_gruv.visual.c.bg = get_color(1) -dotfiles_gruv.visual.c.fg = get_color(6) +dotfiles_gruv.visual.a.bg = get_color(15) +dotfiles_gruv.visual.c.bg = get_color(2) +dotfiles_gruv.visual.c.fg = get_color(7) -dotfiles_gruv.command.a.bg = get_color(15) +dotfiles_gruv.command.a.bg = get_color(16) dotfiles_gruv.command.c.bg = get_color(2) -dotfiles_gruv.command.c.fg = get_color(6) +dotfiles_gruv.command.c.fg = get_color(7) -dotfiles_gruv.replace.a.bg = get_color(8) -dotfiles_gruv.replace.c.bg = get_color(1) +dotfiles_gruv.replace.a.bg = get_color(9) +dotfiles_gruv.replace.c.bg = get_color(2) -- Displays the currently selected Arduino board local function showBoard() @@ -39,7 +37,7 @@ local function showBoard() end end -lualine.setup{ +require('lualine').setup{ options = { theme = dotfiles_gruv } diff --git a/nvim/plugin/neorg.lua b/nvim/plugin/neorg.lua new file mode 100644 index 0000000..e655840 --- /dev/null +++ b/nvim/plugin/neorg.lua @@ -0,0 +1,21 @@ +local ok, neorg = pcall(require, 'neorg') +if not ok then return end; + +local ok, cmp = pcall(require, 'cmp') +if not ok then return end; + +local cmp_config = cmp.get_config() +table.insert(cmp_config.sources, { name = "neorg" }) +cmp.setup(cmp_config) + +require('neorg').setup { + load = { + ["core.defaults"] = {}, + ["core.norg.concealer"] = {}, + ["core.norg.completion"] = { + config = { + engine = "nvim-cmp" + } + } + } +} diff --git a/nvim/plugin/nlsp.lua b/nvim/plugin/nlsp.lua deleted file mode 100644 index bb7e3c7..0000000 --- a/nvim/plugin/nlsp.lua +++ /dev/null @@ -1,10 +0,0 @@ -local has_lsp, lsp = pcall(require, 'vim.lsp') -if not (has_lsp and lsp.config ~= nil and vim.g.vim_ide == 2) then return end - -require('dotfiles.lsp_ignition').enable({ - 'php', - 'biome', - 'vimls', - 'bashls', - 'mdx_analyzer' -}) diff --git a/nvim/plugin/treesitter.lua b/nvim/plugin/treesitter.lua new file mode 100644 index 0000000..bcdfe6f --- /dev/null +++ b/nvim/plugin/treesitter.lua @@ -0,0 +1,37 @@ +local ok, parser_configs = pcall(require, 'nvim-treesitter.parsers') +if not ok then return end + +-- Should only really run on my Macbook, as it is my only macOS device. +-- Apple's C compilers seem to not want to compile any of Treesitter's +-- dialects. +-- That is, `cc`, `gcc`, `g++`, andsoforth. Funnily enough, they are all +-- aliases to the same program. +-- So, the nix-darwin configuration specifies the installation of zig as a +-- replacement compiler solely so the Treesitter dialects compile. Very +-- intuitive. +-- Sadly, the solution only works on my old MacBook pro, which is a 13 inch +-- model. So my only option is to lock it down to that device. +if vim.loop.os_uname().sysname == 'Darwin' then + local meta = vim.fn.system({"system_profiler", "SPHardwareDataType"}); + if not string.match(meta, "MacBookPro13,1") then + return + end + + local opts = require('nvim-treesitter.install') + opts.compilers = { "zig" } + opts.command_extra_args = { "--help" } +end + +local parser_configs = parser_configs.get_parser_configs() + +parser_configs.norg = { + install_info = { + url = "https://github.com/nvim-neorg/tree-sitter-norg", + files = { "src/parser.c", "src/scanner.cc" }, + branch = "main" + }, +} + +require('nvim-treesitter.configs').setup { + ensure_installed = { "norg" } +} diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index a575520..f765f91 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -1,14 +1,8 @@ -alias welcome="welcome --extra-logos-dir $A_ZSH_DOTFILES/../script-resources/welcome/logos" -alias markdown2htmldoc="$A_ZSH_DOTFILES/../scripts/markdown2htmldoc" -alias mediawiki-preview="$A_ZSH_DOTFILES/../scripts/mediawiki-preview" +alias welcome="welcome --extra-logos-dir $K_ZSH_DOTFILES/../script-resources/welcome/logos" +alias markdown2htmldoc="$K_ZSH_DOTFILES/../scripts/markdown2htmldoc" +alias mediawiki-preview="$K_ZSH_DOTFILES/../scripts/mediawiki-preview" alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail' -if command_exists ddev; then - function craft() { - [ -f craft ] && ddev craft $@ || return 1 - } -fi - if (( _is_macos )); then if command_exists exa; then alias ls="exa --classify --group-directories-first" diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 84d653c..c47c5e6 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -1,52 +1,3 @@ #!/usr/bin/env zsh - +# silence() { $1 &>/dev/null } - -# Utility for recovering environment variable files when moving devices, -# provided they are in a central backup dir -function recover-env() { - local PWD="$(pwd)" - local backup_dir="$HOME/Documents/envs" - - if ! [ -d "$backup_dir" ]; then - echo "No backup dir found. Bailing." - return 1 - fi - - local project="$1" - if [ "$#" -eq 0 ] || [ -z "$1" ]; then - echo "No arguments specified, using current folder as project name." - local project="$(basename "$PWD")" - fi - - if ! [ -f "$backup_dir/$project.env" ]; then - echo "No .env file for this project found. Bailing." - return 1 - fi - - cp "$backup_dir/$project.env" "$PWD/.env" - echo "$project.env restored to .env" -} - -# https://github.com/dmitmel/dotfiles/blob/a174ef1556c440ca8cb7ee23bf1731290b9d22ce/zsh/functions.zsh#L114-L134 -SYNC_WORKING_DIR_STORAGE="${ZSH_CACHE_DIR}/last-working-dir" - -autoload -Uz add-zsh-hook -add-zsh-hook chpwd sync_working_dir_chpwd_hook -sync_working_dir_chpwd_hook() { - if [[ "$ZSH_SUBSHELL" == 0 ]]; then - sync_working_dir_save - fi -} - -sync_working_dir_save() { - pwd >| "$SYNC_WORKING_DIR_STORAGE" -} - -sync_working_dir_load() { - local dir - if dir="$(<"$SYNC_WORKING_DIR_STORAGE")" 2>/dev/null && [[ -n "$dir" ]]; then - cd -- "$dir" - fi -} -alias cds="sync_working_dir_load" diff --git a/zsh/zle.zsh b/zsh/zle.zsh deleted file mode 100644 index b5b8268..0000000 --- a/zsh/zle.zsh +++ /dev/null @@ -1,3 +0,0 @@ -_fzf_history_list() { - fc -lr 1 | sed "s/^[[:space:]]*[0-9][0-9]*/${${${fg[blue]//\\/\\\\}//\//\\\/}//&/\\&}&${${${reset_color//\\/\\\\}//\//\\\/}//&/\\&}/" -} diff --git a/zsh/zshrc b/zsh/zshrc index 6461e5f..4a43f8a 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,27 +1,23 @@ #!/usr/bin/env zsh -# enable KSH globbing, which gives access to things such as !(1|2|3) -setopt ksh_glob - -# Get this file's current directory and source Dima's zshrc from there -A_ZSH_DOTFILES="$( dirname "$( readlink -f "$0" )" )" - +# Options for Dima's config +DOTFILES_DISABLE_WELCOME=1 DOTFILES_SYNC_LAST_WORKING_DIR=1 -_dotfiles_customizations() { - for script in functions plugins aliases zle; do - source "$A_ZSH_DOTFILES/$script.zsh" +# Get this file's current directory and source Dima's zshrc from there +K_ZSH_DOTFILES="$( dirname "$( readlink -f "$0" )" )" +source $K_ZSH_DOTFILES/../dmitmel-dotfiles/zsh/zshrc + +for script in functions plugins aliases; do + source "$K_ZSH_DOTFILES/$script.zsh" +done + +if [[ -d "$K_ZSH_DOTFILES/custom" ]]; then + for script in $K_ZSH_DOTFILES/custom/*.zsh; do + source "$script" done +fi - if [[ -d "$A_ZSH_DOTFILES/custom" ]]; then - for script in $A_ZSH_DOTFILES/custom/*.zsh; do - source "$script" - done - fi - - if [[ -n "$DOTFILES_SYNC_LAST_WORKING_DIR" ]]; then - sync_working_dir_load - fi -} - -source $A_ZSH_DOTFILES/../dmitmel-dotfiles/zsh/zshrc +if [[ -z "$KDOTFILES_DISABLE_WELCOME" && -z "$POETRY_ACTIVE" ]]; then + welcome +fi