Compare commits
No commits in common. "main" and "migrate-to-lua" have entirely different histories.
main
...
migrate-to
19 changed files with 1092 additions and 1129 deletions
214
LICENSE
214
LICENSE
|
@ -1,21 +1,201 @@
|
||||||
MIT License
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
Copyright (c) 2021 Salar Rahmanian
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
1. Definitions.
|
||||||
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
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
copies or substantial portions of the Software.
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
the copyright owner that is granting the License.
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
other entities that control, are controlled by, or are under common
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
control with that entity. For the purposes of this definition,
|
||||||
SOFTWARE.
|
"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.
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
{ allowUnfree = true; }
|
{
|
||||||
|
allowUnfree = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
148
flake.lock
148
flake.lock
|
@ -1,148 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"flake-parts": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nur",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733312601,
|
|
||||||
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1736013363,
|
|
||||||
"narHash": "sha256-P4lsS2Y5GzBfC8OfXtD/xWEucX6oHGTjOzjEjEJbXfc=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "0d7908bd09165db6699908b7e3970f137327cbf0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-darwin": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1736002328,
|
|
||||||
"narHash": "sha256-anoVvML2D+nLfHlBfhEcCMjTou/9SRrrlqQN+Ug39ws=",
|
|
||||||
"owner": "LnL7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"rev": "a464e5ba8cfb10a81599dbd422f30f5d37997916",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "LnL7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1735834308,
|
|
||||||
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1735834308,
|
|
||||||
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nur": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-parts": "flake-parts",
|
|
||||||
"nixpkgs": "nixpkgs_2",
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1736020005,
|
|
||||||
"narHash": "sha256-1wLkiazcUjmFj7UYb7VoqClAvoGc+k061Lqc5Tqrw8A=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nur",
|
|
||||||
"rev": "33f1c2d499b8eac46ec4fc19b49c8740a2482cc1",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nur",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"home-manager": "home-manager",
|
|
||||||
"nix-darwin": "nix-darwin",
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"nur": "nur"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"treefmt-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nur",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733222881,
|
|
||||||
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
101
flake.nix
101
flake.nix
|
@ -1,101 +0,0 @@
|
||||||
{
|
|
||||||
description = "Nix and home-manager configurations for Softinio's macbook";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
nix-darwin = {
|
|
||||||
url = "github:LnL7/nix-darwin";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nur.url = "github:nix-community/nur";
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs =
|
|
||||||
{
|
|
||||||
self,
|
|
||||||
nix-darwin,
|
|
||||||
home-manager,
|
|
||||||
nur,
|
|
||||||
nixpkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
homeManagerConfFor =
|
|
||||||
config:
|
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
nixpkgs.overlays = [ nur.overlays.default ];
|
|
||||||
imports = [
|
|
||||||
config
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
m3maxConfiguration =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [ home-manager ];
|
|
||||||
|
|
||||||
fonts = {
|
|
||||||
packages = with pkgs; [ fira-code ];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
nixPath = nixpkgs.lib.mkForce [ "nixpkgs=${nixpkgs}" ];
|
|
||||||
|
|
||||||
package = pkgs.nixVersions.stable;
|
|
||||||
settings = {
|
|
||||||
experimental-features = "nix-command flakes";
|
|
||||||
extra-platforms = [
|
|
||||||
"x86_64-darwin"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
|
||||||
trusted-users = [
|
|
||||||
"root"
|
|
||||||
"salar"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
distributedBuilds = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.fish.enable = true;
|
|
||||||
|
|
||||||
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
||||||
|
|
||||||
system.stateVersion = 4;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
|
||||||
|
|
||||||
users = {
|
|
||||||
users.salar = {
|
|
||||||
home = /Users/salar;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
darwinConfigurations.salarm3max = nix-darwin.lib.darwinSystem {
|
|
||||||
system = "aarc64-darwin";
|
|
||||||
modules = [
|
|
||||||
m3maxConfiguration
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.salar = homeManagerConfFor ./home.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
specialArgs = {
|
|
||||||
inherit nixpkgs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
darwinPackages = self.darwinConfigurations.salarm3max.pkgs;
|
|
||||||
|
|
||||||
defaultPackage.aarch64-darwin = self.darwinConfigurations.salarm3max.system;
|
|
||||||
};
|
|
||||||
}
|
|
352
home.nix
352
home.nix
|
@ -1,8 +1,4 @@
|
||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
|
@ -10,195 +6,53 @@
|
||||||
|
|
||||||
imports = (import ./programs);
|
imports = (import ./programs);
|
||||||
|
|
||||||
nixpkgs.config.allowUnfreePredicate =
|
nixpkgs.overlays = [
|
||||||
pkg:
|
(import ./overlays/sumneko-lua-language-server)
|
||||||
builtins.elem (lib.getName pkg) [
|
|
||||||
"discord"
|
|
||||||
"slack"
|
|
||||||
"vscode"
|
|
||||||
"vscode-extension-github-copilot"
|
|
||||||
"vscode-extension-github-copilot-chat"
|
|
||||||
"vscode-extension-MS-python-vscode-pylance"
|
|
||||||
"vscode-extension-visualjj-visualjj"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
stateVersion = "24.11";
|
username = "salar";
|
||||||
|
homeDirectory = "/Users/salar";
|
||||||
|
stateVersion = "21.11";
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
VISUAL = "$EDITOR";
|
VISUAL = "$EDITOR";
|
||||||
};
|
};
|
||||||
packages = with pkgs; [
|
|
||||||
any-nix-shell
|
|
||||||
aspell
|
|
||||||
basedpyright
|
|
||||||
bash-language-server
|
|
||||||
cachix
|
|
||||||
cmake
|
|
||||||
coursier
|
|
||||||
curlFull
|
|
||||||
deno
|
|
||||||
devenv
|
|
||||||
difftastic
|
|
||||||
discord
|
|
||||||
dua
|
|
||||||
fd
|
|
||||||
ffmpeg
|
|
||||||
font-awesome
|
|
||||||
gnupg
|
|
||||||
go
|
|
||||||
graphviz
|
|
||||||
jq-lsp
|
|
||||||
luajit
|
|
||||||
lua-language-server
|
|
||||||
marksman
|
|
||||||
marp-cli
|
|
||||||
maven
|
|
||||||
meld
|
|
||||||
metals
|
|
||||||
multimarkdown
|
|
||||||
mypy
|
|
||||||
neofetch
|
|
||||||
neovim
|
|
||||||
nil
|
|
||||||
niv
|
|
||||||
nixd
|
|
||||||
nix-index
|
|
||||||
nixfmt-rfc-style
|
|
||||||
nix-prefetch-git
|
|
||||||
nodejs
|
|
||||||
ollama
|
|
||||||
openssl
|
|
||||||
pandoc
|
|
||||||
patchelf
|
|
||||||
pngpaste
|
|
||||||
prettyping
|
|
||||||
python3Packages.huggingface-hub
|
|
||||||
python3Packages.jupyterlab
|
|
||||||
rclone
|
|
||||||
readline
|
|
||||||
ripgrep
|
|
||||||
ripgrep-all
|
|
||||||
rustup
|
|
||||||
sbt
|
|
||||||
scala-cli
|
|
||||||
shellcheck
|
|
||||||
slack
|
|
||||||
slides
|
|
||||||
slumber
|
|
||||||
sqlite
|
|
||||||
stylua
|
|
||||||
swift-format
|
|
||||||
tealdeer
|
|
||||||
tectonic
|
|
||||||
texlab
|
|
||||||
tig
|
|
||||||
tokei
|
|
||||||
tree
|
|
||||||
tree-sitter
|
|
||||||
typescript
|
|
||||||
typescript-language-server
|
|
||||||
wget
|
|
||||||
vscode-langservers-extracted
|
|
||||||
xz
|
|
||||||
yaml-language-server
|
|
||||||
yq
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.bat = {
|
programs.bat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.btop = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.darcs = {
|
|
||||||
enable = true;
|
|
||||||
author = [ "Salar Rahmanian <code@softinio.com>" ];
|
|
||||||
boring = [
|
|
||||||
"^.idea$"
|
|
||||||
"^.direnv$"
|
|
||||||
"^.envrc$"
|
|
||||||
"^.vscode$"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.eza = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
git = true;
|
|
||||||
icons = "auto";
|
|
||||||
extraOptions = [
|
|
||||||
"--group-directories-first"
|
|
||||||
"--long"
|
|
||||||
"--header"
|
|
||||||
"--all"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.fzf = {
|
programs.fzf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableFishIntegration = true;
|
enableFishIntegration = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
programs.gh = {
|
programs.gh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
|
||||||
editor = "nvim";
|
editor = "nvim";
|
||||||
git_protocol = "ssh";
|
gitProtocol = "ssh";
|
||||||
prompt = "enabled";
|
|
||||||
aliases = {
|
|
||||||
co = "pr checkout";
|
|
||||||
pv = "pr view";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.gh-dash = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.helix = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
theme = "tokyonight";
|
|
||||||
editor.file-picker.hidden = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.htop = {
|
programs.htop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.java = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.jq = {
|
programs.jq = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.lazygit = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.nix-index = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableFishIntegration = true;
|
|
||||||
settings = {
|
settings = {
|
||||||
command_timeout = 3000;
|
command_timeout = 1000;
|
||||||
character = {
|
character = {
|
||||||
success_symbol = " [λ](bold green)";
|
success_symbol = " [λ](bold green)";
|
||||||
error_symbol = " [λ](bold red)";
|
error_symbol = " [λ](bold red)";
|
||||||
|
@ -206,9 +60,179 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Neovim Configuration
|
programs.fish = {
|
||||||
xdg.configFile."nvim".source = builtins.fetchGit {
|
enable = true;
|
||||||
url = "https://code.softinio.com/softinio/nvim-config";
|
|
||||||
rev = "a972cdf4f9067111d67f2f0b5655eede437cdff3";
|
plugins = [
|
||||||
|
{
|
||||||
|
name = "bass";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "edc";
|
||||||
|
repo = "bass";
|
||||||
|
rev = "50eba266b0d8a952c7230fca1114cbc9fbbdfbd4";
|
||||||
|
sha256 = "0ppmajynpb9l58xbrcnbp41b66g7p0c9l2nlsvyjwk6d16g4p4gy";
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "foreign-env";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "oh-my-fish";
|
||||||
|
repo = "plugin-foreign-env";
|
||||||
|
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
||||||
|
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "bobthefish";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "oh-my-fish";
|
||||||
|
repo = "theme-bobthefish";
|
||||||
|
rev = "a2ad38aa051aaed25ae3bd6129986e7f27d42d7b";
|
||||||
|
sha256 = "1fssb5bqd2d7856gsylf93d28n3rw4rlqkhbg120j5ng27c7v7lq";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
loginShellInit = ''
|
||||||
|
set -xg TERM xterm-256color
|
||||||
|
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||||
|
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
|
||||||
|
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||||
|
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||||
|
end
|
||||||
|
|
||||||
|
set -xg PATH $HOME/bin $PATH
|
||||||
|
|
||||||
|
set -xg JAVA_HOME /Users/salar/.nix-profile/bin
|
||||||
|
|
||||||
|
set -xg JDTLS_CONFIG /Users/salar/.config/jdt-language-server/config_mac
|
||||||
|
|
||||||
|
set -xg JAR /Users/salar/.config/jdt-language-server/plugins/org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar
|
||||||
|
|
||||||
|
set -xg WORKSPACE /Users/salar/Projects
|
||||||
|
|
||||||
|
set -xg NIX_PATH $HOME/.nix-defexpr/channels $NIX_PATH
|
||||||
|
|
||||||
|
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
|
||||||
|
|
||||||
|
set -xg TOOLCHAINS swift
|
||||||
|
|
||||||
|
set -xg XDG_CONFIG_HOME $HOME/.config
|
||||||
|
'';
|
||||||
|
|
||||||
|
promptInit = ''
|
||||||
|
eval (direnv hook fish)
|
||||||
|
any-nix-shell fish --info-right | source
|
||||||
|
'';
|
||||||
|
|
||||||
|
shellAliases = {
|
||||||
|
cat="bat";
|
||||||
|
du="ncdu --color dark -rr -x";
|
||||||
|
fzfp="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
|
||||||
|
ping="prettyping";
|
||||||
|
".." = "cd ..";
|
||||||
|
pj="python -m json.tool";
|
||||||
|
l="exa --long --header --git --all";
|
||||||
|
g="git";
|
||||||
|
gl="git log";
|
||||||
|
gc="git commit -m";
|
||||||
|
gca="git commit -am";
|
||||||
|
gws="git status";
|
||||||
|
ghauth="gh auth login --with-token < ~/.ghauth";
|
||||||
|
gforksync="git fetch upstream && git merge upstream/master && git push origin master";
|
||||||
|
grep="grep --color=auto";
|
||||||
|
new-sbt="sbt new scala/scala-seed.g8";
|
||||||
|
nixre="home-manager switch";
|
||||||
|
nixedit="home-manager edit";
|
||||||
|
nixinfo="nix-shell -p nix-info --run \"nix-info -m\"";
|
||||||
|
nixgc="nix-collect-garbage -d";
|
||||||
|
nixq="nix-env -qa";
|
||||||
|
nixupdate="nix-channel --update";
|
||||||
|
nixupgrade="nix upgrade-nix";
|
||||||
|
nixup="nix-env -u";
|
||||||
|
nixversion="nix eval nixpkgs.lib.version";
|
||||||
|
nixdaemon="sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && launchctl start org.nixos.nix-daemon";
|
||||||
|
rmxcodederived="rm -fr ~/Library/Developer/Xcode/DerivedData";
|
||||||
|
v="nvim";
|
||||||
|
tabninecfg="vc /Users/salar/Library/Preferences/TabNine/TabNine.toml";
|
||||||
|
sshfre1="ssh salar@fre1.softinio.net";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."fish/conf.d/plugin-bobthefish.fish".text = lib.mkAfter ''
|
||||||
|
for f in $plugin_dir/*.fish
|
||||||
|
source $f
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Neovim Configuration
|
||||||
|
xdg.configFile."nvim/lua/salargalaxyline.lua".source = programs/neovim/settings/salargalaxyline.lua;
|
||||||
|
xdg.configFile."nvim/init.lua".source = programs/neovim/init.lua;
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
pkgs.adoptopenjdk-bin
|
||||||
|
pkgs.any-nix-shell
|
||||||
|
pkgs.asciinema
|
||||||
|
pkgs.aspell
|
||||||
|
pkgs.awscli
|
||||||
|
pkgs.cabal-install
|
||||||
|
pkgs.cmake
|
||||||
|
pkgs.coursier
|
||||||
|
pkgs.curlFull
|
||||||
|
pkgs.direnv
|
||||||
|
pkgs.dust
|
||||||
|
pkgs.exa
|
||||||
|
pkgs.fd
|
||||||
|
pkgs.ffmpeg
|
||||||
|
pkgs.ghcid
|
||||||
|
pkgs.gitAndTools.diff-so-fancy
|
||||||
|
pkgs.global
|
||||||
|
pkgs.gnupg
|
||||||
|
pkgs.gradle
|
||||||
|
pkgs.graphviz
|
||||||
|
pkgs.hlint
|
||||||
|
pkgs.httpie
|
||||||
|
pkgs.hugo
|
||||||
|
pkgs.hyperfine
|
||||||
|
pkgs.jansson
|
||||||
|
pkgs.luajit
|
||||||
|
pkgs.luajitPackages.luarocks
|
||||||
|
pkgs.maven
|
||||||
|
pkgs.multimarkdown
|
||||||
|
pkgs.ncdu
|
||||||
|
pkgs.neofetch
|
||||||
|
pkgs.neovim
|
||||||
|
pkgs.niv
|
||||||
|
pkgs.nixFlakes
|
||||||
|
pkgs.nixfmt
|
||||||
|
pkgs.nodePackages.pyright
|
||||||
|
pkgs.openssl
|
||||||
|
pkgs.pandoc
|
||||||
|
pkgs.pgcli
|
||||||
|
pkgs.prettyping
|
||||||
|
pkgs.procs
|
||||||
|
pkgs.procs
|
||||||
|
pkgs.ranger
|
||||||
|
pkgs.readline
|
||||||
|
pkgs.ripgrep
|
||||||
|
pkgs.rnix-lsp
|
||||||
|
pkgs.shellcheck
|
||||||
|
pkgs.stylua
|
||||||
|
pkgs.sumneko-lua-language-server
|
||||||
|
pkgs.tealdeer
|
||||||
|
pkgs.tig
|
||||||
|
pkgs.tokei
|
||||||
|
pkgs.tree
|
||||||
|
pkgs.universal-ctags
|
||||||
|
pkgs.vscodium
|
||||||
|
pkgs.wget
|
||||||
|
pkgs.xz
|
||||||
|
pkgs.yq
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
38
overlays/sumneko-lua-language-server/default.nix
Normal file
38
overlays/sumneko-lua-language-server/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
self: super: {
|
||||||
|
sumneko-lua-language-server = super.sumneko-lua-language-server.overrideAttrs (
|
||||||
|
o: rec {
|
||||||
|
version = "2.2.3";
|
||||||
|
|
||||||
|
src = builtins.fetchurl {
|
||||||
|
url = "https://github.com/sumneko/vscode-lua/releases/download/v${version}/lua-${version}.vsix";
|
||||||
|
sha256 = "16rpi6p7rslpdfi37ndy5g9qmvh22qljfk9w15kdrr668hfwp7nm";
|
||||||
|
};
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
${super.pkgs.unzip}/bin/unzip $src
|
||||||
|
'';
|
||||||
|
|
||||||
|
platform = if super.stdenv.isDarwin then "macOS" else "Linux";
|
||||||
|
|
||||||
|
preBuild = "";
|
||||||
|
postBuild = "";
|
||||||
|
nativeBuildInputs = [
|
||||||
|
super.makeWrapper
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -r extension $out/extras
|
||||||
|
chmod a+x $out/extras/server/bin/$platform/lua-language-server
|
||||||
|
makeWrapper $out/extras/server/bin/$platform/lua-language-server \
|
||||||
|
$out/bin/lua-language-server \
|
||||||
|
--add-flags "-E -e LANG=en $out/extras/server/main.lua \
|
||||||
|
--logpath='~/.cache/sumneko_lua/log' \
|
||||||
|
--metapath='~/.cache/sumneko_lua/meta'"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta.platforms = super.lib.platforms.all;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
let
|
|
||||||
myverbs = [
|
|
||||||
{
|
|
||||||
invocation = "panel_right";
|
|
||||||
key = "alt-right";
|
|
||||||
internal = ":panel_right";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
invocation = "panel_left_no_open";
|
|
||||||
key = "alt-left";
|
|
||||||
internal = ":panel_left_no_open";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.broot = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
settings = {
|
|
||||||
modal = true;
|
|
||||||
verbs = myverbs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,10 +1,4 @@
|
||||||
[
|
[
|
||||||
./broot
|
|
||||||
./fish
|
|
||||||
./git
|
./git
|
||||||
./jujutsu
|
# ./neovim
|
||||||
./tmux
|
|
||||||
./wezterm
|
|
||||||
./vscode
|
|
||||||
./zed
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
fish
|
|
||||||
fishPlugins.foreign-env
|
|
||||||
fishPlugins.bobthefish
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.fish = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
functions = {
|
|
||||||
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
|
|
||||||
};
|
|
||||||
|
|
||||||
plugins = [
|
|
||||||
{
|
|
||||||
name = "fish-ssh-agent";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "danhper";
|
|
||||||
repo = "fish-ssh-agent";
|
|
||||||
rev = "f10d95775352931796fd17f54e6bf2f910163d1b";
|
|
||||||
sha256 = "sha256-cFroQ7PSBZ5BhXzZEKTKHnEAuEu8W9rFrGZAb8vTgIE=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
loginShellInit = ''
|
|
||||||
set -xg TERM xterm-256color
|
|
||||||
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
||||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
|
|
||||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
end
|
|
||||||
|
|
||||||
set -xg PATH /Applications/Ghostty.app/Contents/MacOS $HOME/bin $HOME/.cargo/bin /Users/salar/.luarocks/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $PATH
|
|
||||||
|
|
||||||
set -xg WORKSPACE /Users/salar/Projects
|
|
||||||
|
|
||||||
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
|
|
||||||
|
|
||||||
set -xg TOOLCHAINS swift
|
|
||||||
'';
|
|
||||||
|
|
||||||
interactiveShellInit = ''
|
|
||||||
jj util completion fish | source
|
|
||||||
eval (direnv hook fish)
|
|
||||||
any-nix-shell fish --info-right | source
|
|
||||||
'';
|
|
||||||
|
|
||||||
shellAliases = {
|
|
||||||
addsshmac = "ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain";
|
|
||||||
bf = "broot";
|
|
||||||
cat = "bat";
|
|
||||||
du = "dua i";
|
|
||||||
fzfp = "fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
|
|
||||||
ping = "prettyping";
|
|
||||||
".." = "cd ..";
|
|
||||||
pj = "python -m json.tool";
|
|
||||||
l = "ll";
|
|
||||||
g = "git";
|
|
||||||
ghauth = "gh auth login --with-token < ~/.ghauth";
|
|
||||||
gitpurgemain = ''git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d'';
|
|
||||||
gitpurgemaster = ''git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d'';
|
|
||||||
giscala = "gitignore scala,vim,java,sbt > .gitignore";
|
|
||||||
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
|
|
||||||
grep = "grep --color=auto";
|
|
||||||
lg = "lazygit";
|
|
||||||
new-sbt = "sbt new scala/scala-seed.g8";
|
|
||||||
nixc = "cd ~/.config/nixpkgs";
|
|
||||||
nixre = "nix build && sudo ./result/activate";
|
|
||||||
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
|
|
||||||
nixgc = "nix-collect-garbage -d";
|
|
||||||
nixq = "nix-env -qa";
|
|
||||||
nixstorerepair = "nix-store --repair --verify --check-contents";
|
|
||||||
nixupgrade = "nix upgrade-nix";
|
|
||||||
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
|
|
||||||
v = "nvim";
|
|
||||||
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
|
|
||||||
sshhcloud1r = "ssh root@hcloud1.softinio.net";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,80 +1,52 @@
|
||||||
{ ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
gitConfig = {
|
gitConfig = {
|
||||||
core = {
|
core = {
|
||||||
editor = "nvim";
|
editor = "nvim";
|
||||||
|
pager = "diff-so-fancy | less --tabs=4 -RFX";
|
||||||
};
|
};
|
||||||
diff = {
|
merge.tool = "intellij";
|
||||||
colorMoved = "default";
|
mergetool = {
|
||||||
external = "difft";
|
cmd = "idea merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"";
|
||||||
tool = "difftastic";
|
trustExitCode = true;
|
||||||
};
|
|
||||||
difftool.difftastic = {
|
|
||||||
cmd = "difft \"$MERGED\" \"$LOCAL\" \"abcdef1\" \"100644\" \"$REMOTE\" \"abcdef2\" \"100644\"";
|
|
||||||
prompt = false;
|
prompt = false;
|
||||||
};
|
};
|
||||||
difftool.nvim = {
|
diff.tool = "intellij";
|
||||||
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"";
|
difftool = {
|
||||||
|
cmd = "idea diff \"$LOCAL\" \"$REMOTE\"";
|
||||||
prompt = false;
|
prompt = false;
|
||||||
};
|
};
|
||||||
fetch.prune = true;
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
merge.conflictstyle = "zdiff3";
|
|
||||||
merge.tool = "nvim";
|
|
||||||
mergetool.nvim = {
|
|
||||||
cmd = "nvim -d -c \"wincmd l\" -c \"norm ]c\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"";
|
|
||||||
prompt = false;
|
|
||||||
keepBackup = false;
|
|
||||||
};
|
|
||||||
pager = {
|
|
||||||
difftool = true;
|
|
||||||
};
|
|
||||||
pull = {
|
|
||||||
rebase = true;
|
|
||||||
};
|
|
||||||
url = {
|
url = {
|
||||||
"git@github.com:" = {
|
"git@github.com:" = {
|
||||||
insteadOf = "https://github.com/";
|
insteadOf = "https://github.com/";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
pull = {
|
||||||
|
rebase = true;
|
||||||
};
|
};
|
||||||
myAliases = {
|
|
||||||
ci = "commit";
|
|
||||||
cim = "commit -m";
|
|
||||||
cia = "commit -am";
|
|
||||||
co = "checkout";
|
|
||||||
cob = "checkout -b";
|
|
||||||
di = "diff";
|
|
||||||
gpo = "push origin";
|
|
||||||
main = "checkout main";
|
|
||||||
master = "checkout master";
|
|
||||||
st = "status";
|
|
||||||
};
|
};
|
||||||
myIgnores = [
|
|
||||||
".DS_Store"
|
|
||||||
"*.bloop"
|
|
||||||
".direnv/"
|
|
||||||
".idea/"
|
|
||||||
".mypy_cache"
|
|
||||||
"*.metals"
|
|
||||||
"*.metals.sbt"
|
|
||||||
"*metals.sbt"
|
|
||||||
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
|
|
||||||
"*hie.yaml" # ghcide files
|
|
||||||
"*.mill-version" # used by metals
|
|
||||||
"*.vscode"
|
|
||||||
"*.python-version"
|
|
||||||
"result"
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userEmail = "code@softinio.com";
|
userEmail = "code@softinio.com";
|
||||||
userName = "Salar Rahmanian";
|
userName = "Salar Rahmanian";
|
||||||
aliases = myAliases;
|
ignores = [
|
||||||
ignores = myIgnores;
|
"*~"
|
||||||
|
".DS_Store"
|
||||||
|
"*.bloop"
|
||||||
|
"*.metals"
|
||||||
|
"*.metals.sbt"
|
||||||
|
"*metals.sbt"
|
||||||
|
"*.direnv"
|
||||||
|
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
|
||||||
|
"*hie.yaml" # ghcide files
|
||||||
|
"*.mill-version" # used by metals
|
||||||
|
"*.idea"
|
||||||
|
"*.vscode"
|
||||||
|
"*.python-version"
|
||||||
|
];
|
||||||
extraConfig = gitConfig;
|
extraConfig = gitConfig;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
let
|
|
||||||
MyAliases = {
|
|
||||||
l = [
|
|
||||||
"log"
|
|
||||||
"-r"
|
|
||||||
"(main..@):: | (main..@)-"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.jujutsu = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
aliases = MyAliases;
|
|
||||||
signing = {
|
|
||||||
key = "~/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
ui = {
|
|
||||||
diff.format = "git";
|
|
||||||
diff.tool = [
|
|
||||||
"difft"
|
|
||||||
"--color=always"
|
|
||||||
"$left"
|
|
||||||
"$right"
|
|
||||||
];
|
|
||||||
editor = "nvim";
|
|
||||||
merge-editor = [
|
|
||||||
"meld"
|
|
||||||
"$left"
|
|
||||||
"$base"
|
|
||||||
"$right"
|
|
||||||
"-o"
|
|
||||||
"$output"
|
|
||||||
];
|
|
||||||
pager = "less -FRX";
|
|
||||||
};
|
|
||||||
user = {
|
|
||||||
name = "Salar Rahmanian";
|
|
||||||
email = "code@softinio.com";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
437
programs/neovim/init.lua
Normal file
437
programs/neovim/init.lua
Normal file
|
@ -0,0 +1,437 @@
|
||||||
|
local fn = vim.fn
|
||||||
|
|
||||||
|
local install_path = fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
||||||
|
|
||||||
|
local function load_plugins()
|
||||||
|
local use = require('packer').use
|
||||||
|
require('packer').startup(function()
|
||||||
|
use 'wbthomason/packer.nvim' -- Package manager
|
||||||
|
use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client
|
||||||
|
use 'nvim-treesitter/nvim-treesitter'
|
||||||
|
use 'nvim-treesitter/nvim-treesitter-textobjects'
|
||||||
|
use 'nvim-treesitter/playground'
|
||||||
|
use 'folke/which-key.nvim'
|
||||||
|
use 'folke/lua-dev.nvim'
|
||||||
|
use 'folke/tokyonight.nvim' -- Theme
|
||||||
|
use { 'folke/trouble.nvim', requires = 'kyazdani42/nvim-web-devicons' }
|
||||||
|
use { 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/popup.nvim' }, { 'nvim-lua/plenary.nvim' } } }
|
||||||
|
use 'windwp/nvim-autopairs' -- Autopairs
|
||||||
|
use 'kyazdani42/nvim-tree.lua' -- File explorer
|
||||||
|
use {
|
||||||
|
'glepnir/galaxyline.nvim',
|
||||||
|
config = function()
|
||||||
|
require 'salargalaxyline'
|
||||||
|
end,
|
||||||
|
requires = 'kyazdani42/nvim-web-devicons',
|
||||||
|
}
|
||||||
|
use 'lukas-reineke/indent-blankline.nvim'
|
||||||
|
use { 'lewis6991/gitsigns.nvim', requires = 'nvim-lua/plenary.nvim' }
|
||||||
|
use { 'TimUntersberger/neogit', requires = { { 'nvim-lua/plenary.nvim' }, { 'sindrets/diffview.nvim' } } }
|
||||||
|
use { 'hrsh7th/nvim-compe', requires = 'L3MON4D3/LuaSnip' } -- Autocompletion plugin
|
||||||
|
use 'kevinhwang91/nvim-bqf'
|
||||||
|
use 'mfussenegger/nvim-dap'
|
||||||
|
use 'sheerun/vim-polyglot'
|
||||||
|
use 'scalameta/nvim-metals'
|
||||||
|
use 'ray-x/lsp_signature.nvim'
|
||||||
|
use 'b3nj5m1n/kommentary'
|
||||||
|
use 'ckipp01/stylua-nvim'
|
||||||
|
use 'gennaro-tedesco/nvim-jqx'
|
||||||
|
use 'kristijanhusak/orgmode.nvim'
|
||||||
|
use 'p00f/nvim-ts-rainbow'
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
_G.load_config = function()
|
||||||
|
require('gitsigns').setup()
|
||||||
|
require('kommentary.config').use_extended_mappings()
|
||||||
|
require('nvim-autopairs').setup()
|
||||||
|
require 'salargalaxyline'
|
||||||
|
require('trouble').setup()
|
||||||
|
require('which-key').setup()
|
||||||
|
|
||||||
|
local luadev = require('lua-dev').setup()
|
||||||
|
|
||||||
|
-- orgmode.nvim
|
||||||
|
require('orgmode').setup({
|
||||||
|
org_agenda_files = {'~/Documents/org'},
|
||||||
|
org_default_notes_file = '~/Documents/org/notes.org'
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
query_linter = {
|
||||||
|
enable = true,
|
||||||
|
use_virtual_text = true,
|
||||||
|
lint_events = { 'BufWrite', 'CursorHold' },
|
||||||
|
},
|
||||||
|
ensure_installed = 'maintained',
|
||||||
|
highlight = { enable = true },
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = 'gnn',
|
||||||
|
node_incremental = 'grn',
|
||||||
|
scope_incremental = 'grc',
|
||||||
|
node_decremental = 'grm',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||||
|
keymaps = {
|
||||||
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
|
['af'] = '@function.outer',
|
||||||
|
['if'] = '@function.inner',
|
||||||
|
['ac'] = '@class.outer',
|
||||||
|
['ic'] = '@class.inner',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
|
goto_next_start = {
|
||||||
|
[']m'] = '@function.outer',
|
||||||
|
[']]'] = '@class.outer',
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
[']M'] = '@function.outer',
|
||||||
|
[']['] = '@class.outer',
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
['[m'] = '@function.outer',
|
||||||
|
['[['] = '@class.outer',
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
['[M'] = '@function.outer',
|
||||||
|
['[]'] = '@class.outer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
playground = {
|
||||||
|
enable = true,
|
||||||
|
disable = {},
|
||||||
|
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
|
||||||
|
persist_queries = false, -- Whether the query persists across vim sessions
|
||||||
|
keybindings = {
|
||||||
|
toggle_query_editor = 'o',
|
||||||
|
toggle_hl_groups = 'i',
|
||||||
|
toggle_injected_languages = 't',
|
||||||
|
toggle_anonymous_nodes = 'a',
|
||||||
|
toggle_language_display = 'I',
|
||||||
|
focus_language = 'f',
|
||||||
|
unfocus_language = 'F',
|
||||||
|
update = 'R',
|
||||||
|
goto_node = '<cr>',
|
||||||
|
show_help = '?',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rainbow = {
|
||||||
|
enable = true,
|
||||||
|
extended_mode = true,
|
||||||
|
max_file_lines = 1000,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- neogit
|
||||||
|
require('neogit').setup {
|
||||||
|
integrations = {
|
||||||
|
diffview = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
--Incremental live completion
|
||||||
|
vim.o.inccommand = 'nosplit'
|
||||||
|
|
||||||
|
--Set highlight on search
|
||||||
|
vim.o.hlsearch = false
|
||||||
|
vim.o.incsearch = true
|
||||||
|
|
||||||
|
--Make line numbers default
|
||||||
|
vim.wo.number = true
|
||||||
|
|
||||||
|
--Do not save when switching buffers
|
||||||
|
vim.o.hidden = true
|
||||||
|
|
||||||
|
--Enable mouse mode
|
||||||
|
vim.o.mouse = 'a'
|
||||||
|
|
||||||
|
-- clipboard
|
||||||
|
vim.o.clipboard = 'unnamedplus'
|
||||||
|
|
||||||
|
--Enable break indent
|
||||||
|
vim.o.breakindent = true
|
||||||
|
|
||||||
|
--Save undo history
|
||||||
|
vim.cmd [[set undofile]]
|
||||||
|
|
||||||
|
--Case insensitive searching UNLESS /C or capital in search
|
||||||
|
vim.o.ignorecase = true
|
||||||
|
vim.o.smartcase = true
|
||||||
|
|
||||||
|
--Decrease update time
|
||||||
|
vim.o.updatetime = 250
|
||||||
|
vim.wo.signcolumn = 'yes'
|
||||||
|
|
||||||
|
--Set colorscheme (order is important here)
|
||||||
|
vim.g.tokyonight_style = 'night'
|
||||||
|
vim.g.tokyonight_italic_functions = true
|
||||||
|
vim.o.termguicolors = true
|
||||||
|
vim.cmd [[colorscheme tokyonight]]
|
||||||
|
|
||||||
|
--Remap space as leader key
|
||||||
|
vim.api.nvim_set_keymap('', '<Space>', '<Nop>', { noremap = true, silent = true })
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
|
--Remap for dealing with word wrap
|
||||||
|
vim.api.nvim_set_keymap('n', 'k', "v:count == 0 ? 'gk' : 'k'", { noremap = true, expr = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', 'j', "v:count == 0 ? 'gj' : 'j'", { noremap = true, expr = true, silent = true })
|
||||||
|
|
||||||
|
--Remap escape to leave terminal mode
|
||||||
|
vim.api.nvim_set_keymap('t', '<Esc>', [[<c-\><c-n>]], { noremap = true })
|
||||||
|
|
||||||
|
--Add map to enter paste mode
|
||||||
|
vim.o.pastetoggle = '<F3>'
|
||||||
|
|
||||||
|
--Map blankline
|
||||||
|
vim.g.indent_blankline_char = '┊'
|
||||||
|
vim.g.indent_blankline_filetype_exclude = { 'help', 'packer' }
|
||||||
|
vim.g.indent_blankline_buftype_exclude = { 'terminal', 'nofile' }
|
||||||
|
vim.g.indent_blankline_char_highlight = 'LineNr'
|
||||||
|
|
||||||
|
-- Toggle to disable mouse mode and indentlines for easier paste
|
||||||
|
ToggleMouse = function()
|
||||||
|
if vim.o.mouse == 'a' then
|
||||||
|
vim.cmd [[IndentBlanklineDisable]]
|
||||||
|
vim.wo.signcolumn = 'no'
|
||||||
|
vim.o.mouse = 'v'
|
||||||
|
vim.wo.number = false
|
||||||
|
print 'Mouse disabled'
|
||||||
|
else
|
||||||
|
vim.cmd [[IndentBlanklineEnable]]
|
||||||
|
vim.wo.signcolumn = 'yes'
|
||||||
|
vim.o.mouse = 'a'
|
||||||
|
vim.wo.number = true
|
||||||
|
print 'Mouse enabled'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', '<F10>', '<cmd>lua ToggleMouse()<cr>', { noremap = true })
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
require('telescope').setup {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
['<C-u>'] = false,
|
||||||
|
['<C-d>'] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
generic_sorter = require('telescope.sorters').get_fzy_sorter,
|
||||||
|
file_sorter = require('telescope.sorters').get_fzy_sorter,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--Add leader shortcuts
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>f', [[<cmd>lua require('telescope.builtin').find_files()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader><space>', [[<cmd>lua require('telescope.builtin').buffers()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>l', [[<cmd>lua require('telescope.builtin').current_buffer_fuzzy_find()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>t', [[<cmd>lua require('telescope.builtin').tags()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>?', [[<cmd>lua require('telescope.builtin').oldfiles()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>sd', [[<cmd>lua require('telescope.builtin').grep_string()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>sp', [[<cmd>lua require('telescope.builtin').live_grep()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>o', [[<cmd>lua require('telescope.builtin').tags{ only_current_buffer = true }<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>gc', [[<cmd>lua require('telescope.builtin').git_commits()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>gb', [[<cmd>lua require('telescope.builtin').git_branches()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>gs', [[<cmd>lua require('telescope.builtin').git_status()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>gp', [[<cmd>lua require('telescope.builtin').git_bcommits()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>m', [[<cmd>lua require('nvim-tree').toggle()<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>ng', [[<cmd>lua require('neogit').open({ kind = "split" })<cr>]], { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>nu', ':PackerUpdate<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- Change preview window location
|
||||||
|
vim.g.splitbelow = true
|
||||||
|
|
||||||
|
-- Highlight on yank
|
||||||
|
vim.api.nvim_exec(
|
||||||
|
[[
|
||||||
|
augroup YankHighlight
|
||||||
|
autocmd!
|
||||||
|
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
|
||||||
|
augroup end
|
||||||
|
]],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Y yank until the end of line
|
||||||
|
vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true })
|
||||||
|
--
|
||||||
|
-- LSP settings
|
||||||
|
local nvim_lsp = require 'lspconfig'
|
||||||
|
local on_attach = function(_client, bufnr)
|
||||||
|
require('lsp_signature').on_attach()
|
||||||
|
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gm', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Enable the following language servers
|
||||||
|
local servers = { 'jdtls', 'pyright', 'rnix', 'sourcekit' }
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
nvim_lsp[lsp].setup { on_attach = on_attach }
|
||||||
|
end
|
||||||
|
|
||||||
|
-- lua language server
|
||||||
|
local sumneko_binary = vim.fn.getenv 'HOME' .. '/.nix-profile/bin/lua-language-server'
|
||||||
|
local runtime_path = vim.split(package.path, ';')
|
||||||
|
table.insert(runtime_path, 'lua/?.lua')
|
||||||
|
table.insert(runtime_path, 'lua/?/init.lua')
|
||||||
|
|
||||||
|
require('lspconfig').sumneko_lua.setup {
|
||||||
|
cmd = { sumneko_binary },
|
||||||
|
commands = {
|
||||||
|
Format = {
|
||||||
|
function()
|
||||||
|
require('stylua-nvim').format_file()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = 'LuaJIT',
|
||||||
|
-- Setup your lua path
|
||||||
|
path = runtime_path,
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = { 'vim' },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = {
|
||||||
|
vim.api.nvim_get_runtime_file('', true),
|
||||||
|
luadev,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- metals
|
||||||
|
vim.opt_global.shortmess:remove('F'):append 'c'
|
||||||
|
Metals_config = require('metals').bare_config
|
||||||
|
Metals_config.init_options.statusBarProvider = 'on'
|
||||||
|
vim.cmd [[augroup lsp]]
|
||||||
|
vim.cmd [[au!]]
|
||||||
|
vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(metals_config)]]
|
||||||
|
vim.cmd [[augroup end]]
|
||||||
|
|
||||||
|
-- Map :Format to vim.lsp.buf.formatting()
|
||||||
|
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
|
||||||
|
|
||||||
|
-- Set completeopt to have a better completion experience
|
||||||
|
vim.o.completeopt = 'menuone,noinsert'
|
||||||
|
|
||||||
|
-- Compe setup
|
||||||
|
require('compe').setup {
|
||||||
|
enabled = true,
|
||||||
|
autocomplete = true,
|
||||||
|
debug = false,
|
||||||
|
min_length = 1,
|
||||||
|
preselect = 'enable',
|
||||||
|
throttle_time = 80,
|
||||||
|
source_timeout = 200,
|
||||||
|
incomplete_delay = 400,
|
||||||
|
max_abbr_width = 100,
|
||||||
|
max_kind_width = 100,
|
||||||
|
max_menu_width = 100,
|
||||||
|
documentation = true,
|
||||||
|
|
||||||
|
source = {
|
||||||
|
path = true,
|
||||||
|
nvim_lsp = {
|
||||||
|
priority = 1000,
|
||||||
|
filetypes = { 'scala', 'sbt', 'java', 'python' },
|
||||||
|
},
|
||||||
|
nvim_lua = true,
|
||||||
|
buffer = true,
|
||||||
|
luasnip = true,
|
||||||
|
orgmode = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local t = function(str)
|
||||||
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
local check_back_space = function()
|
||||||
|
local col = vim.fn.col '.' - 1
|
||||||
|
if col == 0 or vim.fn.getline('.'):sub(col, col):match '%s' then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Use (s-)tab to:
|
||||||
|
--- move to prev/next item in completion menuone
|
||||||
|
--- jump to prev/next snippet's placeholder
|
||||||
|
_G.tab_complete = function()
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
return t '<C-n>'
|
||||||
|
elseif check_back_space() then
|
||||||
|
return t '<Tab>'
|
||||||
|
else
|
||||||
|
return vim.fn['compe#complete']()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
_G.s_tab_complete = function()
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
return t '<C-p>'
|
||||||
|
else
|
||||||
|
return t '<S-Tab>'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('i', '<Tab>', 'v:lua.tab_complete()', { expr = true })
|
||||||
|
vim.api.nvim_set_keymap('s', '<Tab>', 'v:lua.tab_complete()', { expr = true })
|
||||||
|
vim.api.nvim_set_keymap('i', '<S-Tab>', 'v:lua.s_tab_complete()', { expr = true })
|
||||||
|
vim.api.nvim_set_keymap('s', '<S-Tab>', 'v:lua.s_tab_complete()', { expr = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
if fn.isdirectory(install_path) == 0 then
|
||||||
|
fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }
|
||||||
|
load_plugins()
|
||||||
|
require('packer').sync()
|
||||||
|
vim.cmd 'autocmd User PackerComplete ++once lua load_config()'
|
||||||
|
else
|
||||||
|
load_plugins()
|
||||||
|
_G.load_config()
|
||||||
|
end
|
197
programs/neovim/settings/salargalaxyline.lua
Normal file
197
programs/neovim/settings/salargalaxyline.lua
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
local gl = require 'galaxyline'
|
||||||
|
local gls = gl.section
|
||||||
|
gl.short_line_list = { 'LuaTree', 'vista', 'dbui' }
|
||||||
|
|
||||||
|
local colors = {
|
||||||
|
bg = '#282c34',
|
||||||
|
yellow = '#fabd2f',
|
||||||
|
cyan = '#008080',
|
||||||
|
darkblue = '#081633',
|
||||||
|
green = '#afd700',
|
||||||
|
orange = '#FF8800',
|
||||||
|
purple = '#5d4d7a',
|
||||||
|
magenta = '#d16d9e',
|
||||||
|
grey = '#c0c0c0',
|
||||||
|
blue = '#0087d7',
|
||||||
|
red = '#ec5f67',
|
||||||
|
}
|
||||||
|
|
||||||
|
local buffer_not_empty = function()
|
||||||
|
if vim.fn.empty(vim.fn.expand '%:t') ~= 1 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
gls.left[1] = {
|
||||||
|
FirstElement = {
|
||||||
|
provider = function()
|
||||||
|
return '▋'
|
||||||
|
end,
|
||||||
|
highlight = { colors.blue, colors.yellow },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[2] = {
|
||||||
|
ViMode = {
|
||||||
|
provider = function()
|
||||||
|
local alias = { n = 'NORMAL', i = 'INSERT', c = 'COMMAND', v = 'VISUAL', V = 'VISUAL LINE', [''] = 'VISUAL BLOCK' }
|
||||||
|
return alias[vim.fn.mode()]
|
||||||
|
end,
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = {
|
||||||
|
colors.purple,
|
||||||
|
function()
|
||||||
|
if not buffer_not_empty() then
|
||||||
|
return colors.purple
|
||||||
|
end
|
||||||
|
return colors.darkblue
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
highlight = { colors.darkblue, colors.purple, 'bold' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[3] = {
|
||||||
|
FileIcon = {
|
||||||
|
provider = 'FileIcon',
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = { require('galaxyline.provider_fileinfo').get_file_icon_color, colors.darkblue },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[4] = {
|
||||||
|
FileName = {
|
||||||
|
provider = { 'FileName', 'FileSize' },
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = { colors.purple, colors.darkblue },
|
||||||
|
highlight = { colors.magenta, colors.darkblue },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[5] = {
|
||||||
|
GitIcon = {
|
||||||
|
provider = function()
|
||||||
|
return ' '
|
||||||
|
end,
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = { colors.orange, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[6] = {
|
||||||
|
GitBranch = {
|
||||||
|
provider = 'GitBranch',
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = { colors.grey, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local checkwidth = function()
|
||||||
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||||
|
if squeeze_width > 40 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
gls.left[7] = {
|
||||||
|
DiffAdd = {
|
||||||
|
provider = 'DiffAdd',
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = { colors.green, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[8] = {
|
||||||
|
DiffModified = {
|
||||||
|
provider = 'DiffModified',
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = { colors.orange, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[9] = {
|
||||||
|
DiffRemove = {
|
||||||
|
provider = 'DiffRemove',
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = { colors.red, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[10] = {
|
||||||
|
LeftEnd = {
|
||||||
|
provider = function()
|
||||||
|
return ''
|
||||||
|
end,
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = { colors.purple, colors.bg },
|
||||||
|
highlight = { colors.purple, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[11] = {
|
||||||
|
DiagnosticError = {
|
||||||
|
provider = 'DiagnosticError',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = { colors.red, colors.bg },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[12] = {
|
||||||
|
Space = {
|
||||||
|
provider = function()
|
||||||
|
return ' '
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.left[13] = {
|
||||||
|
DiagnosticWarn = {
|
||||||
|
provider = 'DiagnosticWarn',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = { colors.blue, colors.bg },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.right[1] = {
|
||||||
|
FileFormat = {
|
||||||
|
provider = 'FileFormat',
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = { colors.bg, colors.purple },
|
||||||
|
highlight = { colors.grey, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.right[2] = {
|
||||||
|
LineInfo = {
|
||||||
|
provider = 'LineColumn',
|
||||||
|
separator = ' | ',
|
||||||
|
separator_highlight = { colors.darkblue, colors.purple },
|
||||||
|
highlight = { colors.grey, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.right[3] = {
|
||||||
|
PerCent = {
|
||||||
|
provider = 'LinePercent',
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = { colors.darkblue, colors.purple },
|
||||||
|
highlight = { colors.grey, colors.darkblue },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
gls.right[4] = {
|
||||||
|
ScrollBar = {
|
||||||
|
provider = 'ScrollBar',
|
||||||
|
highlight = { colors.yellow, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.short_line_left[1] = {
|
||||||
|
BufferType = {
|
||||||
|
provider = 'FileTypeName',
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = { colors.purple, colors.bg },
|
||||||
|
highlight = { colors.grey, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.short_line_right[1] = {
|
||||||
|
BufferIcon = {
|
||||||
|
provider = 'BufferIcon',
|
||||||
|
separator = '',
|
||||||
|
separator_highlight = { colors.purple, colors.bg },
|
||||||
|
highlight = { colors.grey, colors.purple },
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
tmuxConfig = builtins.readFile ./tmux.conf;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.tmux = {
|
|
||||||
enable = true;
|
|
||||||
baseIndex = 1;
|
|
||||||
escapeTime = 10;
|
|
||||||
historyLimit = 10000;
|
|
||||||
keyMode = "vi";
|
|
||||||
prefix = "C-a";
|
|
||||||
terminal = "xterm-256color";
|
|
||||||
extraConfig = tmuxConfig;
|
|
||||||
plugins = with pkgs; [
|
|
||||||
{
|
|
||||||
plugin = tmuxPlugins.resurrect;
|
|
||||||
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = tmuxPlugins.continuum;
|
|
||||||
extraConfig = "set -g @continuum-restore 'on'";
|
|
||||||
}
|
|
||||||
{ plugin = tmuxPlugins.sensible; }
|
|
||||||
{ plugin = tmuxPlugins.vim-tmux-navigator; }
|
|
||||||
{ plugin = tmuxPlugins.onedark-theme; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,110 +0,0 @@
|
||||||
##########################
|
|
||||||
# Configuration
|
|
||||||
###########################
|
|
||||||
|
|
||||||
# use 256 xterm for pretty colors. This enables same colors from iTerm2 within tmux.
|
|
||||||
# This is recommended in neovim :healthcheck
|
|
||||||
# set -g default-terminal "screen-256color"
|
|
||||||
# set -ga terminal-overrides ",xterm-256color:Tc"
|
|
||||||
|
|
||||||
# disable mouse
|
|
||||||
set -g mouse off
|
|
||||||
|
|
||||||
# decrease command delay (increases vim responsiveness)
|
|
||||||
set -sg escape-time 1
|
|
||||||
|
|
||||||
# increase repeat time for repeatable commands
|
|
||||||
set -g repeat-time 1000
|
|
||||||
|
|
||||||
# start pane index at 1 instead of 0
|
|
||||||
setw -g pane-base-index 1
|
|
||||||
|
|
||||||
# highlight window when it has new activity
|
|
||||||
setw -g monitor-activity on
|
|
||||||
set -g visual-activity on
|
|
||||||
|
|
||||||
# re-number windows when one is closed
|
|
||||||
set -g renumber-windows on
|
|
||||||
|
|
||||||
# enable pbcopy and pbpaste
|
|
||||||
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
|
|
||||||
# set-option -g default-command "reattach-to-user-namespace -l zsh"
|
|
||||||
|
|
||||||
###########################
|
|
||||||
# Key Bindings
|
|
||||||
###########################
|
|
||||||
|
|
||||||
# Tmux prefix
|
|
||||||
# Current solution is to keep the default
|
|
||||||
# and have term map C-; to C-b. This is the nicest
|
|
||||||
# bind I've found and this is the only way to enable it in tmux
|
|
||||||
# unbind C-b
|
|
||||||
# set -g prefix C-a
|
|
||||||
# bind C-a send-prefix
|
|
||||||
|
|
||||||
# Copy vim style
|
|
||||||
# create 'v' alias for selecting text
|
|
||||||
bind Escape copy-mode
|
|
||||||
bind C-[ copy-mode
|
|
||||||
bind -T copy-mode-vi 'v' send -X begin-selection
|
|
||||||
# copy with 'enter' or 'y' and send to mac os clipboard: http://goo.gl/2Bfn8
|
|
||||||
unbind -T copy-mode-vi Enter
|
|
||||||
bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
|
|
||||||
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
|
|
||||||
# paste
|
|
||||||
bind p paste-buffer
|
|
||||||
# paste from system clipboard MacOS
|
|
||||||
# bind C-v run \"tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer"
|
|
||||||
|
|
||||||
# panes: window splitting
|
|
||||||
unbind %
|
|
||||||
bind | split-window -h
|
|
||||||
unbind '"'
|
|
||||||
bind - split-window -v
|
|
||||||
|
|
||||||
# Switch panes with hjkl
|
|
||||||
bind h select-pane -L
|
|
||||||
bind j select-pane -D
|
|
||||||
bind k select-pane -U
|
|
||||||
bind l select-pane -R
|
|
||||||
|
|
||||||
# Quick window selection
|
|
||||||
bind -r C-h select-window -t :-
|
|
||||||
bind -r C-l select-window -t :+
|
|
||||||
|
|
||||||
# resize panes
|
|
||||||
bind -r H resize-pane -L 5
|
|
||||||
bind -r J resize-pane -D 5
|
|
||||||
bind -r K resize-pane -U 5
|
|
||||||
bind -r L resize-pane -R 5
|
|
||||||
|
|
||||||
## Quickly switch panes
|
|
||||||
unbind ^J
|
|
||||||
bind ^J select-pane -t :.+
|
|
||||||
|
|
||||||
############################
|
|
||||||
## Status Bar
|
|
||||||
############################
|
|
||||||
|
|
||||||
# enable UTF-8 support in status bar
|
|
||||||
set -gq status-utf8 on
|
|
||||||
|
|
||||||
# center the status bar
|
|
||||||
set -g status-justify centre
|
|
||||||
|
|
||||||
# show session, window, pane in left status bar
|
|
||||||
set -g status-left-length 40
|
|
||||||
set -g status-left '#[fg=green] #S #[fg=yellow]#I/#[fg=cyan]#P '
|
|
||||||
|
|
||||||
# update status bar info
|
|
||||||
set -g status-interval 60
|
|
||||||
|
|
||||||
###########################
|
|
||||||
# Colors
|
|
||||||
###########################
|
|
||||||
|
|
||||||
# onedark color scheme
|
|
||||||
set -g @onedark_widgets "#(date +%s)"
|
|
||||||
set -g @onedark_time_format "%I:%M %p"
|
|
||||||
set -g @onedark_date_format "%D"
|
|
||||||
|
|
|
@ -1,102 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
myExtensions = with pkgs.vscode-extensions; [
|
|
||||||
asvetliakov.vscode-neovim
|
|
||||||
baccata.scaladex-search
|
|
||||||
charliermarsh.ruff
|
|
||||||
davidanson.vscode-markdownlint
|
|
||||||
enkia.tokyo-night
|
|
||||||
github.copilot
|
|
||||||
github.copilot-chat
|
|
||||||
github.github-vscode-theme
|
|
||||||
github.vscode-github-actions
|
|
||||||
github.vscode-pull-request-github
|
|
||||||
humao.rest-client
|
|
||||||
jnoortheen.nix-ide
|
|
||||||
marp-team.marp-vscode
|
|
||||||
mechatroner.rainbow-csv
|
|
||||||
mkhl.direnv
|
|
||||||
ms-python.debugpy
|
|
||||||
ms-python.python
|
|
||||||
ms-python.vscode-pylance
|
|
||||||
ms-toolsai.jupyter
|
|
||||||
ms-toolsai.jupyter-keymap
|
|
||||||
ms-toolsai.jupyter-renderers
|
|
||||||
ms-toolsai.vscode-jupyter-cell-tags
|
|
||||||
ms-toolsai.vscode-jupyter-slideshow
|
|
||||||
ms-vscode.makefile-tools
|
|
||||||
ms-toolsai.jupyter
|
|
||||||
redhat.java
|
|
||||||
redhat.vscode-yaml
|
|
||||||
rust-lang.rust-analyzer
|
|
||||||
scalameta.metals
|
|
||||||
skyapps.fish-vscode
|
|
||||||
sswg.swift-lang
|
|
||||||
svsool.markdown-memo
|
|
||||||
timonwong.shellcheck
|
|
||||||
usernamehw.errorlens
|
|
||||||
visualstudioexptteam.vscodeintellicode
|
|
||||||
visualjj.visualjj
|
|
||||||
vscode-icons-team.vscode-icons
|
|
||||||
vscjava.vscode-java-pack
|
|
||||||
xyz.local-history
|
|
||||||
yzhang.markdown-all-in-one
|
|
||||||
];
|
|
||||||
myUserSettings = {
|
|
||||||
"editor.fontFamily" = "SF Mono";
|
|
||||||
"editor.fontLigatures" = true;
|
|
||||||
"editor.fontSize" = 13;
|
|
||||||
"editor.copyWithSyntaxHighlighting" = true;
|
|
||||||
"extensions.experimental.affinity" = {
|
|
||||||
"asvetliakov.vscode-neovim" = 1;
|
|
||||||
};
|
|
||||||
"extensions.ignoreRecommendations" = true;
|
|
||||||
"files.autoSave" = "afterDelay";
|
|
||||||
"git.confirmSync" = true;
|
|
||||||
"git.rebaseWhenSync" = true;
|
|
||||||
"github.gitProtocol" = "ssh";
|
|
||||||
"githubPullRequests.notifications" = "pullRequests";
|
|
||||||
"githubPullRequests.pullBranch" = "never";
|
|
||||||
"markdown.extension.preview.autoShowPreviewToSide" = true;
|
|
||||||
"notebook.formatOnSave" = true;
|
|
||||||
# Install paste image manually as not in nix ( https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image )
|
|
||||||
"pasteImage.insertPattern" = "![[\${imageFileName}]]";
|
|
||||||
"pasteImage.path" = "\${projectRoot}/Attachments";
|
|
||||||
"python.analysis.extraPaths" = [ "src" ];
|
|
||||||
"python.analysis.autoFormatStrings" = true;
|
|
||||||
"python.analysis.autoImportCompletions" = true;
|
|
||||||
"python.analysis.completeFunctionParens" = true;
|
|
||||||
"python.analysis.inlayHints.pytestParameters" = true;
|
|
||||||
"python.analysis.typeCheckingMode" = "strict";
|
|
||||||
"python.testing.pytestEnabled" = true;
|
|
||||||
"[python]" = {
|
|
||||||
"editor.defaultFormatter" = "charliermarsh.ruff";
|
|
||||||
"editor.formatOnSave" = true;
|
|
||||||
"editor.codeActionsOnSave" = {
|
|
||||||
"source.fixAll" = "afterDelay";
|
|
||||||
"source.organizeImports" = "afterDelay";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"telemetry.telemetryLevel" = "off";
|
|
||||||
"terminal.integrated.defaultProfile.osx" = "fish";
|
|
||||||
"terminal.integrated.fontFamily" = "SF Mono";
|
|
||||||
"terminal.integrated.fontSize" = 13;
|
|
||||||
"update.mode" = "none";
|
|
||||||
"vsicons.dontShowNewVersionMessage" = true;
|
|
||||||
"window.openFoldersInNewWindow" = "on";
|
|
||||||
"workbench.colorTheme" = "Tokyo Night";
|
|
||||||
"workbench.iconTheme" = "vscode-icons";
|
|
||||||
"workbench.sideBar.location" = "right";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.vscode = {
|
|
||||||
enable = true;
|
|
||||||
enableUpdateCheck = false;
|
|
||||||
enableExtensionUpdateCheck = false;
|
|
||||||
mutableExtensionsDir = false;
|
|
||||||
extensions = myExtensions;
|
|
||||||
userSettings = myUserSettings;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
weztermConfig = builtins.readFile ./wezterm.lua;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.wezterm = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = weztermConfig;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,170 +0,0 @@
|
||||||
local wezterm = require 'wezterm'
|
|
||||||
local mux = wezterm.mux
|
|
||||||
local act = wezterm.action
|
|
||||||
|
|
||||||
local function is_vim(pane)
|
|
||||||
-- this is set by the plugin, and unset on ExitPre in Neovim
|
|
||||||
return pane:get_user_vars().IS_NVIM == 'true'
|
|
||||||
end
|
|
||||||
|
|
||||||
local direction_keys = {
|
|
||||||
a = 'Left',
|
|
||||||
o = 'Down',
|
|
||||||
e = 'Up',
|
|
||||||
u = 'Right',
|
|
||||||
}
|
|
||||||
|
|
||||||
local function split_nav(resize_or_move, key)
|
|
||||||
return {
|
|
||||||
key = key,
|
|
||||||
mods = resize_or_move == 'resize' and 'META' or 'CTRL',
|
|
||||||
action = wezterm.action_callback(function(win, pane)
|
|
||||||
if is_vim(pane) then
|
|
||||||
-- pass the keys through to vim/nvim
|
|
||||||
win:perform_action({
|
|
||||||
SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' },
|
|
||||||
}, pane)
|
|
||||||
else
|
|
||||||
if resize_or_move == 'resize' then
|
|
||||||
win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane)
|
|
||||||
else
|
|
||||||
win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
wezterm.on('update-right-status', function(window, pane)
|
|
||||||
window:set_right_status(window:active_workspace())
|
|
||||||
end)
|
|
||||||
|
|
||||||
wezterm.on('gui-startup', function(cmd)
|
|
||||||
local tab, pane, window = mux.spawn_window(cmd or {})
|
|
||||||
window:gui_window():maximize()
|
|
||||||
pane:split { size = 0.2 }
|
|
||||||
end)
|
|
||||||
|
|
||||||
return {
|
|
||||||
adjust_window_size_when_changing_font_size = false,
|
|
||||||
check_for_updates = false,
|
|
||||||
-- color_scheme = "Gruvbox Light";
|
|
||||||
color_scheme = 'tokyonight',
|
|
||||||
default_gui_startup_args = { 'connect', 'unix' },
|
|
||||||
font = wezterm.font 'SF Mono',
|
|
||||||
font_size = 16,
|
|
||||||
dpi = 144,
|
|
||||||
scrollback_lines = 50000,
|
|
||||||
initial_cols = 400,
|
|
||||||
initial_rows = 80,
|
|
||||||
leader = { key = 'b', mods = 'SUPER', timeout_milliseconds = 1000 },
|
|
||||||
default_prog = { '/etc/profiles/per-user/salar/bin/fish' },
|
|
||||||
ssh_domains = {
|
|
||||||
{
|
|
||||||
name = 'hcloud1',
|
|
||||||
remote_address = 'hcloud1.softinio.net',
|
|
||||||
username = 'salar',
|
|
||||||
remote_wezterm_path = '/run/current-system/sw/bin/wezterm',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
unix_domains = {
|
|
||||||
{
|
|
||||||
name = 'unix',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ key = '-', mods = 'LEADER', action = wezterm.action { SplitVertical = { domain = 'CurrentPaneDomain' } } },
|
|
||||||
{ key = "'", mods = 'LEADER', action = wezterm.action { SplitHorizontal = { domain = 'CurrentPaneDomain' } } },
|
|
||||||
{ key = 'k', mods = 'SUPER', action = act.TogglePaneZoomState },
|
|
||||||
{ key = 'h', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Left' } },
|
|
||||||
{ key = 'j', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Down' } },
|
|
||||||
{ key = 'k', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Up' } },
|
|
||||||
{ key = 'l', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Right' } },
|
|
||||||
{ key = 'H', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Left', 5 } } },
|
|
||||||
{ key = 'J', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Down', 5 } } },
|
|
||||||
{ key = 'K', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Up', 5 } } },
|
|
||||||
{ key = 'L', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Right', 5 } } },
|
|
||||||
{ key = '1', mods = 'LEADER', action = wezterm.action { ActivateTab = 0 } },
|
|
||||||
{ key = '2', mods = 'LEADER', action = wezterm.action { ActivateTab = 1 } },
|
|
||||||
{ key = '3', mods = 'LEADER', action = wezterm.action { ActivateTab = 2 } },
|
|
||||||
{ key = '4', mods = 'LEADER', action = wezterm.action { ActivateTab = 3 } },
|
|
||||||
{ key = '5', mods = 'LEADER', action = wezterm.action { ActivateTab = 4 } },
|
|
||||||
{ key = '6', mods = 'LEADER', action = wezterm.action { ActivateTab = 5 } },
|
|
||||||
{ key = '7', mods = 'LEADER', action = wezterm.action { ActivateTab = 6 } },
|
|
||||||
{ key = '8', mods = 'LEADER', action = wezterm.action { ActivateTab = 7 } },
|
|
||||||
{ key = '9', mods = 'LEADER', action = wezterm.action { ActivateTab = 8 } },
|
|
||||||
{ key = '&', mods = 'LEADER', action = wezterm.action { CloseCurrentTab = { confirm = true } } },
|
|
||||||
{ key = 'x', mods = 'LEADER', action = wezterm.action { CloseCurrentPane = { confirm = true } } },
|
|
||||||
{ key = 'Enter', mods = 'ALT', action = act.ToggleFullScreen },
|
|
||||||
{ key = 'c', mods = 'SUPER', action = act.CopyTo 'Clipboard' },
|
|
||||||
{ key = 'v', mods = 'SUPER', action = act.PasteFrom 'Clipboard' },
|
|
||||||
{ key = 'n', mods = 'SUPER', action = act.SpawnWindow },
|
|
||||||
{ key = 't', mods = 'SUPER', action = act.SpawnTab 'CurrentPaneDomain' },
|
|
||||||
{ key = 'q', mods = 'SUPER', action = act.QuitApplication },
|
|
||||||
{ key = 'i', mods = 'CTRL|SHIFT', action = act.SwitchToWorkspace },
|
|
||||||
{
|
|
||||||
key = '8',
|
|
||||||
mods = 'ALT',
|
|
||||||
action = wezterm.action_callback(function(window, pane)
|
|
||||||
-- Here you can dynamically construct a longer list if needed
|
|
||||||
|
|
||||||
local home = wezterm.home_dir
|
|
||||||
local workspaces = {
|
|
||||||
{ id = home, label = 'Home' },
|
|
||||||
{ id = home .. '/Projects', label = 'My Projects' },
|
|
||||||
{ id = home .. '/OpenSource', label = 'Open Source Projects' },
|
|
||||||
{ id = home .. '/.config/nixpkgs', label = 'Nix Config' },
|
|
||||||
{ id = home .. '/Projects/scalanews', label = 'Scala News' },
|
|
||||||
}
|
|
||||||
|
|
||||||
window:perform_action(
|
|
||||||
act.InputSelector {
|
|
||||||
action = wezterm.action_callback(function(inner_window, inner_pane, id, label)
|
|
||||||
if not id and not label then
|
|
||||||
wezterm.log_info 'cancelled'
|
|
||||||
else
|
|
||||||
wezterm.log_info('id = ' .. id)
|
|
||||||
wezterm.log_info('label = ' .. label)
|
|
||||||
inner_window:perform_action(
|
|
||||||
act.SwitchToWorkspace {
|
|
||||||
name = label,
|
|
||||||
spawn = {
|
|
||||||
label = 'Workspace: ' .. label,
|
|
||||||
cwd = id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
inner_pane
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
title = 'Choose Workspace',
|
|
||||||
choices = workspaces,
|
|
||||||
fuzzy = true,
|
|
||||||
fuzzy_description = 'Fuzzy find and/or make a workspace',
|
|
||||||
},
|
|
||||||
pane
|
|
||||||
)
|
|
||||||
end),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key = '9',
|
|
||||||
mods = 'ALT',
|
|
||||||
action = act.ShowLauncherArgs {
|
|
||||||
flags = 'FUZZY|WORKSPACES',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ key = 'Tab', mods = 'CTRL', action = wezterm.action.DisableDefaultAssignment },
|
|
||||||
-- move between split panes
|
|
||||||
split_nav('move', 'a'),
|
|
||||||
split_nav('move', 'o'),
|
|
||||||
split_nav('move', 'e'),
|
|
||||||
split_nav('move', 'u'),
|
|
||||||
-- resize panes
|
|
||||||
split_nav('resize', 'a'),
|
|
||||||
split_nav('resize', 'o'),
|
|
||||||
split_nav('resize', 'e'),
|
|
||||||
split_nav('resize', 'u'),
|
|
||||||
},
|
|
||||||
-- temp fix
|
|
||||||
front_end = 'WebGpu',
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
let
|
|
||||||
myextensions = [
|
|
||||||
"fish"
|
|
||||||
"lua"
|
|
||||||
"nix"
|
|
||||||
"ruff"
|
|
||||||
"scala"
|
|
||||||
"sql"
|
|
||||||
"swift"
|
|
||||||
"toml"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.zed-editor = {
|
|
||||||
enable = true;
|
|
||||||
extensions = myextensions;
|
|
||||||
userSettings = {
|
|
||||||
assistant = {
|
|
||||||
version = "2";
|
|
||||||
default_model = {
|
|
||||||
provider = "copilot_chat";
|
|
||||||
model = "gpt-4o";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
features = {
|
|
||||||
copilot = true;
|
|
||||||
};
|
|
||||||
language_models = {
|
|
||||||
openai = {
|
|
||||||
available_models = [
|
|
||||||
{
|
|
||||||
provider = "openai";
|
|
||||||
name = "gpt-4o";
|
|
||||||
max_tokens = 128000;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
provider = "openai";
|
|
||||||
name = "gpt-4o-mini";
|
|
||||||
max_tokens = 128000;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
version = "2";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
telemetry.metrics = false;
|
|
||||||
theme = "Andromeda";
|
|
||||||
vim_mode = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue