Compare commits

..

No commits in common. "6014ad7d7a7167333cb0249c1dffd9edbf0bddc1" and "b048858c40d24c7d6f9dc89f4c1dddb7036ea576" have entirely different histories.

30 changed files with 633 additions and 878 deletions

6
flake.lock generated
View file

@ -318,11 +318,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1755186698, "lastModified": 1751271578,
"narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -17,9 +17,6 @@ in {
extraDomainNames = [ "*.${domain}" ]; extraDomainNames = [ "*.${domain}" ];
group = "acme"; group = "acme";
}; };
"git.${domain}" = {
group = "acme";
};
"internal.${domain}" = { "internal.${domain}" = {
group = "acme"; group = "acme";
}; };

View file

@ -20,14 +20,14 @@
}; };
}; };
# pywb = { pywb = {
# image = "docker.io/webrecorder/pywb"; image = "docker.io/webrecorder/pywb";
# ports = [ "127.0.0.1:8001:8001" ]; ports = [ "127.0.0.1:8001:8001" ];
# volumes = [ volumes = [
# "/mnt/usb/services/browsertrix/webrecorder/:/" "/mnt/usb/services/browsertrix/webrecorder/:/"
# "/mnt/usb/services/browsertrix/webrecorder/webarchive:/webarchive" "/mnt/usb/services/browsertrix/webrecorder/webarchive:/webarchive"
# ]; ];
# }; };
}; };
environment.systemPackages = [ pkgs.docker ]; environment.systemPackages = [ pkgs.docker ];

View file

@ -5,7 +5,7 @@ let
ssl = { ssl = {
forceSSL = true; forceSSL = true;
quic = true; quic = true;
useACMEHost = acmeDomain; useACMEHost = domain;
}; };
in in
{ {

View file

@ -5,7 +5,7 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
{ {
imports = [ ./hardware-configuration.nix ./site.nix ./cache ./archive ./forgejo ]; imports = [ ./hardware-configuration.nix ./site.nix ./cache ./archive ];
age.secrets.password.file = ./password.age; age.secrets.password.file = ./password.age;
users.users = { users.users = {

View file

@ -1,5 +0,0 @@
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>

View file

@ -1,42 +1,75 @@
{ pkgs, lib, ... }: { pkgs, ... }:
let let
subdomains = [ "internal" "archive" "crawler" "r" "b" "s" "p" "q" "cloud" ]; internalZoneFile = pkgs.writeText "internal.zone" ''
$ORIGIN internal.thegeneralist01.com.
mainZoneFile = pkgs.writeText "thegeneralist01.zone" '' @ IN SOA ns.internal.thegeneralist01.com. thegeneralist01.proton.me. (
$ORIGIN thegeneralist01.com. 2025071801 ; serial (yyyymmddXX)
@ IN SOA ns.thegeneralist01.com. thegeneralist01.proton.me. (
2025081501 ; serial (yyyymmddXX)
3600 ; refresh 3600 ; refresh
600 ; retry 600 ; retry
86400 ; expire 86400 ; expire
3600 ; minimum 3600 ; minimum
) )
IN NS ns.thegeneralist01.com. IN NS ns.internal.thegeneralist01.com.
ns IN A 100.86.129.23 ns IN A 100.86.129.23
@ IN A 100.86.129.23 @ IN A 100.86.129.23
${lib.concatStringsSep "\n" (lib.map (sub: "${sub} IN A 100.86.129.23") subdomains)}
''; '';
forwarderBlock = '' archiveZoneFile = pkgs.writeText "archive.zone" ''
.:53 { $ORIGIN archive.thegeneralist01.com.
forward . 100.100.100.100 45.90.28.181 45.90.30.181 @ IN SOA ns.archive.thegeneralist01.com. thegeneralist01.proton.me. (
cache 2025073101 ; serial (yyyymmddXX)
log 3600 ; refresh
errors 600 ; retry
} 86400 ; expire
3600 ; minimum
)
IN NS ns.archive.thegeneralist01.com.
ns IN A 100.86.129.23
@ IN A 100.86.129.23
'';
crawlerZoneFile = pkgs.writeText "crawler.zone" ''
$ORIGIN crawler.thegeneralist01.com.
@ IN SOA ns.crawler.thegeneralist01.com. thegeneralist01.proton.me. (
2025080801 ; serial (yyyymmddXX)
3600 ; refresh
600 ; retry
86400 ; expire
3600 ; minimum
)
IN NS ns.crawler.thegeneralist01.com.
ns IN A 100.86.129.23
@ IN A 100.86.129.23
''; '';
in in
{ {
services.coredns = { services.coredns = {
enable = true; enable = true;
config = '' config = ''
thegeneralist01.com:53 { internal.thegeneralist01.com:53 {
file ${mainZoneFile} file ${internalZoneFile}
log log
errors errors
} }
${forwarderBlock} archive.thegeneralist01.com:53 {
file ${archiveZoneFile}
log
errors
}
crawler.thegeneralist01.com:53 {
file ${crawlerZoneFile}
log
errors
}
.:53 {
forward . 100.100.100.100 45.90.28.181 45.90.30.181
cache
log
errors
}
''; '';
}; };

View file

@ -1,94 +0,0 @@
let
forgejo_root_dir = "/var/lib/forgejo";
domain = "git.thegeneralist01.com";
forgejo_folder = folder_name: "${forgejo_root_dir}/${folder_name}";
in
{
imports = [ ../../../modules/postgresql.nix ];
services.forgejo = {
enable = true;
stateDir = forgejo_folder "state";
lfs.enable = true;
settings =
let
title = "thegeneralist01's forgejo";
desc = "the attic of thegeneralist01's random repositories";
in
{
default.APP_NAME = title;
"ui.meta" = {
AUTHOR = title;
DESCRIPTION = desc;
};
attachment.ALLOWED_TYPES = "*/*";
cache.ENABLED = true;
"cron.archive_cleanup" =
let
interval = "4h";
in
{
SCHEDULE = "@every ${interval}";
OLDER_THAN = interval;
};
packages.ENABLED = true;
mailer = {
ENABLED = false;
# PROTOCOL = "smtps";
# SMTP_ADDR = self.disk.mailserver.fqdn;
# USER = "git@${domain}";
};
other = {
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false;
SHOW_FOOTER_VERSION = false;
};
repository = {
DEFAULT_BRANCH = "master";
DEFAULT_MERGE_STYLE = "rebase-merge";
DEFAULT_REPO_UNITS = "repo.code, repo.issues, repo.pulls";
DEFAULT_PUSH_CREATE_PRIVATE = false;
ENABLE_PUSH_CREATE_ORG = true;
ENABLE_PUSH_CREATE_USER = true;
DISABLE_STARS = true;
};
"repository.upload" = {
FILE_MAX_SIZE = 100;
MAX_FILES = 10;
};
server = {
ROOT_URL = "https://${domain}/";
DOMAIN = domain;
LANDING_PAGE = "/explore";
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3000;
SSH_LISTEN_HOST = "0.0.0.0";
SSH_PORT = 2222;
SSH_LISTEN_PORT = 2222;
};
service.DISABLE_REGISTRATION = true;
session = {
COOKIE_SECURE = true;
SAME_SITE = "strict";
};
};
};
networking.firewall.allowedTCPPorts = [ 2222 ];
}

View file

@ -1,38 +1,31 @@
{ config, pkgs, ... }: { config, pkgs, ... }: let
let
domain = "thegeneralist01.com"; domain = "thegeneralist01.com";
family_domain = builtins.getEnv "FAMILY_DOMAIN";
ssl = { ssl = {
quic = true; quic = true;
useACMEHost = domain; useACMEHost = domain;
}; };
in in {
{ imports = [ ./acme ./dns.nix ./jellyfin ];
imports = [
./acme
./dns.nix
./jellyfin
];
# Nginx # Nginx
services.nginx = { services.nginx = {
enable = true; enable = true;
package = pkgs.nginxQuic; package = pkgs.nginxQuic;
enableQuicBPF = true; enableQuicBPF = true;
experimentalZstdSettings = true; recommendedZstdSettings = true;
recommendedUwsgiSettings = true; recommendedUwsgiSettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedBrotliSettings = true; recommendedBrotliSettings = true;
statusPage = true; statusPage = true;
validateConfigFile = true; validateConfigFile = true;
virtualHosts."${domain}" = ssl // { virtualHosts."${domain}" = ssl // {
root = "/var/www/${domain}"; root = "/var/www/${domain}";
locations."/".tryFiles = "$uri $uri.html $uri/ $uri/index.html =404"; locations."/".tryFiles = "$uri $uri.html $uri/ $uri/index.html =404";
@ -50,35 +43,13 @@ in
''; '';
}; };
virtualHosts."www.${domain}" = ssl // { virtualHosts."www.${domain}" = ssl // {
locations."/".return = "306 https://${domain}$request_uri"; locations."/".return = "306 https://${domain}$request_uri";
}; };
virtualHosts."${family_domain}" = { virtualHosts._ = ssl // {
root = "/var/www/${family_domain}"; locations."/".return = "307 https://${domain}/404";
locations."/".tryFiles = "$uri $uri.html $uri/ $uri/index.html =404";
extraConfig = ''
if ($http_x_forwarded_proto = "http") {
return 301 https://${family_domain}$request_uri;
}
location ~* \.(html|css|js|jpg|jpeg|png|gif|svg|ico|woff2?)$ {
expires 1d;
add_header Cache-Control "public";
}
error_page 404 /404.html;
'';
}; };
virtualHosts."www.${family_domain}" = {
locations."/".return = "306 https://${family_domain}$request_uri";
};
# virtualHosts._ = ssl // {
# locations."/".return = "307 https://${domain}/404";
# };
}; };
# Cloudflare # Cloudflare
@ -86,35 +57,21 @@ in
age.secrets.cftcert.file = ./cert.pem.age; age.secrets.cftcert.file = ./cert.pem.age;
age.secrets.cftcredentials.file = ./credentials.age; age.secrets.cftcredentials.file = ./credentials.age;
age.secrets.cftcredentials_personal.file = ./credentials_personal.age;
services.cloudflared = { services.cloudflared = {
enable = true; enable = true;
certificateFile = config.age.secrets.cftcert.path; certificateFile = config.age.secrets.cftcert.path;
tunnels = { tunnels."site" = {
"site" = { ingress = {
ingress = { "thegeneralist01.com" = "http://localhost:80";
"thegeneralist01.com" = "http://localhost:80"; "www.thegeneralist01.com" = "http://localhost:80";
"www.thegeneralist01.com" = "http://localhost:80"; "cache.thegeneralist01.com" = "http://localhost:80";
"cache.thegeneralist01.com" = "http://localhost:80";
"git.thegeneralist01.com" = "http://localhost:3000";
};
default = "http_status:404";
credentialsFile = config.age.secrets.cftcredentials.path;
certificateFile = config.age.secrets.cftcert.path;
}; };
"personal" = { default = "http_status:404";
ingress = {
"${family_domain}" = "http://localhost:80";
"www.${family_domain}" = "http://localhost:80";
};
default = "http_status:404";
credentialsFile = config.age.secrets.cftcredentials_personal.path; credentialsFile = config.age.secrets.cftcredentials.path;
certificateFile = config.age.secrets.cftcert.path; certificateFile = config.age.secrets.cftcert.path;
};
}; };
}; };
} }

View file

@ -1,6 +1,5 @@
inputs: self: super: inputs: self: super:
let let
system = import ./system.nix inputs self super; system = import ./system.nix inputs self super;
option = import ./option.nix inputs self super;
in in
system // option system

View file

@ -1,12 +0,0 @@
_: _: super: let
inherit (super) mkOption;
in {
mkConst = value: mkOption {
default = value;
readOnly = true;
};
mkValue = default: mkOption {
inherit default;
};
}

View file

@ -11,7 +11,7 @@
clearDefaultKeybinds = false; clearDefaultKeybinds = false;
settings = { settings = {
# theme = "tokyonight"; # theme = "tokyonight";
theme = "Gruvbox Dark Hard"; theme = "GruvboxDarkHard";
font-family = "Berkeley Mono"; font-family = "Berkeley Mono";
font-size = 16; font-size = 16;

View file

@ -19,10 +19,7 @@ in {
python313 python313
python313Packages.pip python313Packages.pip
uv
python313Packages.virtualenv python313Packages.virtualenv
basedpyright
black
nodejs nodejs
nodePackages."sass" nodePackages."sass"

View file

@ -25,7 +25,7 @@ in {
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
]; ];
trusted-users = [ "thegeneralist" "central" "root" "@build" "@wheel" "@admin" "jellyfin" "git" ]; trusted-users = [ "thegeneralist" "central" "root" "@build" "@wheel" "@admin" ];
builders-use-substitutes = true; builders-use-substitutes = true;
}; };

View file

@ -22,7 +22,7 @@ $env.config.completions = {
enable: true enable: true
max_results: 100 max_results: 100
completer: {|tokens: list<string>| completer: {|tokens: list<string>|
let expanded = scope aliases | where name == $tokens.0 | get --optional expansion.0 let expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
mut expanded_tokens = if $expanded != null and $tokens.0 != "cd" { mut expanded_tokens = if $expanded != null and $tokens.0 != "cd" {
$expanded | split row " " | append ($tokens | skip 1) $expanded | split row " " | append ($tokens | skip 1)
@ -67,12 +67,3 @@ alias ah = cd ~/dotfiles/hosts/thegeneralist
alias ai3 = nvim /home/thegeneralist/dotfiles/hosts/thegeneralist/dotfiles/i3/config alias ai3 = nvim /home/thegeneralist/dotfiles/hosts/thegeneralist/dotfiles/i3/config
# alias rb = sudo nixos-rebuild switch --flake ~/dotfiles#thegeneralist # alias rb = sudo nixos-rebuild switch --flake ~/dotfiles#thegeneralist
alias rb = nh os switch . -v -- --show-trace --verbose alias rb = nh os switch . -v -- --show-trace --verbose
def greeting [] {
let quotes = [
"What is impossible for you is not impossible for me."
]
echo ($quotes | get (random int 0..(($quotes | length) - 1)))
}
greeting

View file

@ -21,7 +21,6 @@ in {
fzf fzf
gh gh
fastfetch fastfetch
carapace
]; ];
shellAliases = { shellAliases = {
@ -74,16 +73,10 @@ in {
envFile.text = readFile ./env.nu; envFile.text = readFile ./env.nu;
environmentVariables = config.environment.variables // homeArgs.config.home.sessionVariables; environmentVariables = config.environment.variables // homeArgs.config.home.sessionVariables;
}; };
programs.carapace = {
enable = true;
enableZshIntegration = true;
enableNushellIntegration = true;
};
programs.zsh = { programs.zsh = {
enable = true; enable = true;
sessionVariables = config.environment.variables // homeArgs.config.home.sessionVariables; sessionVariables = config.environment.variables // homeArgs.config.home.sessionVariables;
}; };
home.sessionPath = [ "/Users/thegeneralist/.cargo/bin" ];
}) })
]; ];
} }

View file

@ -26,9 +26,6 @@
nixfmt-rfc-style nixfmt-rfc-style
libiconv libiconv
clang
clang-analyzer
]; ];
}; };
} }

View file

@ -1,7 +1,7 @@
{ {
# services.tailscale = { services.tailscale = {
# enable = true; enable = true;
# }; };
#
# networking.search = [ "shorthair-wall.ts.net" ]; networking.search = [ "shorthair-wall.ts.net" ];
} }

View file

@ -1,31 +1,18 @@
let let
numbers = [ numbers = [
"1" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
"0"
]; ];
number_to_symbol = num: { number_to_symbol = num: {
type = "basic"; type = "basic";
from = { from = {
key_code = num; key_code = num;
modifiers = { modifiers = { optional = [ "caps_lock" ]; };
optional = [ "caps_lock" ];
};
}; };
to = [ to = [{
{ key_code = num;
key_code = num; modifiers = ["left_shift"];
modifiers = [ "left_shift" ]; }];
}
];
}; };
symbol_to_number = num: { symbol_to_number = num: {
@ -37,80 +24,55 @@ let
optional = [ "caps_lock" ]; optional = [ "caps_lock" ];
}; };
}; };
to = [ to = [{
{ key_code = num;
key_code = num; }];
}
];
}; };
manipulators = builtins.concatLists ( manipulators = builtins.concatLists (map (n: [
map (n: [ (number_to_symbol n)
(number_to_symbol n) (symbol_to_number n)
(symbol_to_number n) ]) numbers);
]) numbers
);
simple_modifications = [ simple_modifications = [
{ {
from.apple_vendor_top_case_key_code = "keyboard_fn"; from.apple_vendor_top_case_key_code = "keyboard_fn";
to = [ { key_code = "left_control"; } ]; to = [{ key_code = "left_control"; }];
} }
{ {
from.key_code = "left_control"; from.key_code = "left_control";
to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ]; to = [{ apple_vendor_top_case_key_code = "keyboard_fn"; }];
} }
]; ];
complex_modifications = { complex_modifications = {
name = "Complex Modifications"; name = "Complex Modifications";
rules = [ rules = [{
# { description = "Change numbers to symbols and vice versa";
# description = "Change numbers to symbols and vice versa"; manipulators = manipulators;
# manipulators = manipulators; }];
# }
{
description = "Toggle Focus Mode with F6";
manipulators = [
{
from = {
"key_code" = "f6";
};
to = [ { "shell_command" = "shortcuts run 'Reduced Interruptions'"; } ];
type = "basic";
}
];
}
];
}; };
config = builtins.toJSON { config = builtins.toJSON {
global.show_in_menu_bar = false; global.show_in_menu_bar = false;
profiles = [ profiles = [{
{ name = "default";
name = "default"; selected = true;
selected = true; virtual_hid_keyboard.keyboard_type_v2 = "ansi";
virtual_hid_keyboard.keyboard_type_v2 = "ansi"; inherit simple_modifications;
inherit simple_modifications; inherit complex_modifications;
inherit complex_modifications;
devices = [ devices = [{
{ identifiers.is_keyboard = true;
identifiers.is_keyboard = true; }];
} }];
];
}
];
}; };
in in {
{ home-manager.sharedModules = [{
home-manager.sharedModules = [ home.file.".config/karabiner/karabiner.json" = {
{ force = true;
home.file.".config/karabiner/karabiner.json" = { text = config;
force = true; };
text = config; }];
};
}
];
} }

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
homebrew.enable = true; homebrew.enable = true;
homebrew.casks = [ "google-chrome" ]; homebrew.casks = [ "ungoogled-chromium" ];
environment.systemPackages = [ pkgs.iina ]; environment.systemPackages = [ pkgs.iina ];
} }

View file

@ -1,7 +0,0 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
-- use opts = {} for passing setup options
-- this is equivalent to setup({}) function
}

View file

@ -1,86 +1,84 @@
return { return {
{ {
"saghen/blink.cmp", "saghen/blink.cmp",
dependencies = { "rafamadriz/friendly-snippets" }, dependencies = { "rafamadriz/friendly-snippets" },
version = "1.*", version = "1.*",
opts = { opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept) -- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept -- 'enter' for enter to accept
-- 'none' for no mappings -- 'none' for no mappings
-- --
-- All presets have the following mappings: -- All presets have the following mappings:
-- C-space: Open menu or open docs if already open -- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item -- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu -- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true) -- C-k: Toggle signature help (if signature.enabled = true)
-- --
-- See :h blink-cmp-config-keymap for defining your own keymap -- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { keymap = { preset = "default" },
preset = "default",
},
appearance = { appearance = {
nerd_font_variant = "mono", nerd_font_variant = "mono",
}, },
-- (Default) Only show the documentation popup when manually triggered -- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = false } }, completion = { documentation = { auto_show = false } },
-- Default list of enabled providers defined so that you can extend it -- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend` -- elsewhere in your config, without redefining it, due to `opts_extend`
sources = { sources = {
default = { "lsp", "path", "snippets", "buffer" }, default = { "lsp", "path", "snippets", "buffer" },
}, },
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
-- --
-- See the fuzzy documentation for more information -- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" }, fuzzy = { implementation = "prefer_rust_with_warning" },
}, },
opts_extend = { "sources.default" }, opts_extend = { "sources.default" },
}, },
-- { -- {
-- 'neovim/nvim-lspconfig', -- 'neovim/nvim-lspconfig',
-- dependencies = { -- dependencies = {
-- 'saghen/blink.cmp', -- 'saghen/blink.cmp',
-- 'williamboman/mason.nvim', -- 'williamboman/mason.nvim',
-- 'mason-org/mason-registry', -- 'mason-org/mason-registry',
-- 'williamboman/mason-lspconfig.nvim', -- 'williamboman/mason-lspconfig.nvim',
-- 'L3MON4D3/LuaSnip', -- 'L3MON4D3/LuaSnip',
-- 'saadparwaiz1/cmp_luasnip', -- 'saadparwaiz1/cmp_luasnip',
-- 'j-hui/fidget.nvim', -- 'j-hui/fidget.nvim',
-- }, -- },
-- --
-- -- example using `opts` for defining servers -- -- example using `opts` for defining servers
-- opts = { -- opts = {
-- servers = { -- servers = {
-- lua_ls = {} -- lua_ls = {}
-- } -- }
-- }, -- },
-- config = function(_, opts) -- config = function(_, opts)
-- require("fidget").setup({}) -- require("fidget").setup({})
-- require("mason").setup() -- require("mason").setup()
-- --
-- local lspconfig = require('mason-lspconfig') -- local lspconfig = require('mason-lspconfig')
-- for server, config in pairs(opts.servers) do -- for server, config in pairs(opts.servers) do
-- -- passing config.capabilities to blink.cmp merges with the capabilities in your -- -- passing config.capabilities to blink.cmp merges with the capabilities in your
-- -- `opts[server].capabilities, if you've defined it -- -- `opts[server].capabilities, if you've defined it
-- print('configuring server:', server) -- print('configuring server:', server)
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities) -- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
-- require("lspconfig")[server].setup(config) -- require("lspconfig")[server].setup(config)
-- end -- end
-- end -- end
-- --
-- example calling setup directly for each LSP -- example calling setup directly for each LSP
-- config = function() -- config = function()
-- local capabilities = require('blink.cmp').get_lsp_capabilities() -- local capabilities = require('blink.cmp').get_lsp_capabilities()
-- local lspconfig = require('lspconfig') -- local lspconfig = require('lspconfig')
-- --
-- lspconfig['lua_ls'].setup({ capabilities = capabilities }) -- lspconfig['lua_ls'].setup({ capabilities = capabilities })
-- end -- end
-- }, -- },
} }

View file

@ -1,106 +1,101 @@
return { return {
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
main = "ibl", main = "ibl",
---@module "ibl" ---@module "ibl"
---@type ibl.config ---@type ibl.config
opts = {}, opts = {},
}, },
--[[ { --[[ {
'boganworld/crackboard.nvim', 'boganworld/crackboard.nvim',
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { 'nvim-lua/plenary.nvim' },
opts = { opts = {
session_key = 'redacted', session_key = 'redacted',
}, },
}, ]] }, ]]
{ {
"onsails/lspkind-nvim", "onsails/lspkind-nvim",
}, },
-- { -- {
-- "ziglang/zig.vim", -- "ziglang/zig.vim",
-- }, -- },
{ {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
name = "plenary", name = "plenary",
}, },
{ {
"stevearc/oil.nvim", "stevearc/oil.nvim",
config = function() config = function()
require("oil").setup() require("oil").setup()
end, end,
}, },
-- { -- {
-- -- https://github.com/zbirenbaum/copilot.lua -- -- https://github.com/zbirenbaum/copilot.lua
-- "zbirenbaum/copilot.lua", -- "zbirenbaum/copilot.lua",
-- cmd = "Copilot", -- cmd = "Copilot",
-- event = "InsertEnter", -- event = "InsertEnter",
-- config = function() -- config = function()
-- require("copilot").setup({ -- require("copilot").setup({
-- panel = { -- panel = {
-- keymap = { -- keymap = {
-- jump_prev = "]]", -- jump_prev = "]]",
-- jump_next = "[[", -- jump_next = "[[",
-- accept = "<Tab>", -- accept = "<Tab>",
-- refresh = "gr", -- refresh = "gr",
-- open = "<M-]>", -- open = "<M-]>",
-- }, -- },
-- }, -- },
-- suggestion = { -- suggestion = {
-- auto_trigger = true, -- auto_trigger = true,
-- keymap = { -- keymap = {
-- accept = "<M-Tab>", -- accept = "<M-Tab>",
-- }, -- },
-- }, -- },
-- }) -- })
-- -- vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>") -- -- vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
-- -- vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>") -- -- vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
-- end, -- end,
-- }, -- },
{ {
"github/copilot.vim", "github/copilot.vim",
config = function() config = function()
-- set <leader>cpd and <leader>cpe to disable/enable copilot -- set <leader>cpd and <leader>cpe to disable/enable copilot
vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>") vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>") vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
vim.keymap.set("i", "<C-J>", 'copilot#Accept("\\<CR>")', { end,
expr = true, },
replace_keycodes = false, -- {
}) -- "Exafunction/codeium.nvim",
vim.g.copilot_no_tab_map = true -- dependencies = {
end, -- "nvim-lua/plenary.nvim",
}, -- "hrsh7th/nvim-cmp",
-- { -- },
-- "Exafunction/codeium.nvim", -- config = function()
-- dependencies = { -- require("codeium").setup({
-- "nvim-lua/plenary.nvim", -- -- https://github.com/Exafunction/codeium.vim
-- "hrsh7th/nvim-cmp", -- })
-- }, -- end
-- config = function() -- },
-- require("codeium").setup({ {
-- -- https://github.com/Exafunction/codeium.vim "ldelossa/gh.nvim",
-- }) dependencies = {
-- end "ldelossa/litee.nvim",
-- }, },
{ },
"ldelossa/gh.nvim", "eandrju/cellular-automaton.nvim",
dependencies = { "gpanders/editorconfig.nvim",
"ldelossa/litee.nvim",
},
},
"eandrju/cellular-automaton.nvim",
"gpanders/editorconfig.nvim",
-- Useful for getting pretty icons, but requires a Nerd Font. -- Useful for getting pretty icons, but requires a Nerd Font.
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font }, { "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
"lambdalisue/nerdfont.vim", "lambdalisue/nerdfont.vim",
"junegunn/vim-easy-align", "junegunn/vim-easy-align",
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
event = "VimEnter", event = "VimEnter",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
opts = { signs = false }, opts = { signs = false },
}, },
} }

View file

@ -1,287 +1,286 @@
return { return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { dependencies = {
"saghen/blink.cmp", "saghen/blink.cmp",
-- "folke/neodev.nvim", -- "folke/neodev.nvim",
"williamboman/mason.nvim", "williamboman/mason.nvim",
"mason-org/mason-registry", "mason-org/mason-registry",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
-- "hrsh7th/nvim-cmp", -- "hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
}, },
config = function() config = function()
local lspkind = require("lspkind") local lspkind = require("lspkind")
-- local cmp = require("cmp") -- local cmp = require("cmp")
-- local cmp_lsp = require("cmp_nvim_lsp") -- local cmp_lsp = require("cmp_nvim_lsp")
-- local capabilities = vim.tbl_deep_extend( -- local capabilities = vim.tbl_deep_extend(
-- "force", -- "force",
-- {}, -- {},
-- vim.lsp.protocol.make_client_capabilities(), -- vim.lsp.protocol.make_client_capabilities(),
-- cmp_lsp.default_capabilities() -- cmp_lsp.default_capabilities()
-- ) -- )
require("fidget").setup({}) require("fidget").setup({})
require("mason").setup() require("mason").setup()
-- local vue_typescript_plugin = require("mason-registry") -- local vue_typescript_plugin = require("mason-registry")
-- .get_package("vue-language-server") -- .get_package("vue-language-server")
-- :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin" -- :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin"
local capabilities = require("blink.cmp").get_lsp_capabilities() local capabilities = require("blink.cmp").get_lsp_capabilities()
vim.lsp.enable("nixd") vim.lsp.enable("nixd")
vim.lsp.enable("clangd") require("mason-lspconfig").setup({
vim.lsp.enable("basedpyright") automatic_enable = true,
require("mason-lspconfig").setup({ ensure_installed = {
automatic_enable = true, "lua_ls",
ensure_installed = { "ts_ls",
"lua_ls", "cssls",
"ts_ls", "tailwindcss",
"cssls", "pyright",
"tailwindcss", },
}, handlers = {
handlers = { function(server_name) -- default handler (optional)
function(server_name) -- default handler (optional) -- if server_name == "rust_analyzer" then
-- if server_name == "rust_analyzer" then -- return
-- return -- end
-- end require("lspconfig")[server_name].setup({
require("lspconfig")[server_name].setup({ capabilities = capabilities,
capabilities = capabilities, })
}) end,
end,
["lua_ls"] = function() ["lua_ls"] = function()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({ lspconfig.lua_ls.setup({
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
Lua = { Lua = {
diagnostics = { diagnostics = {
globals = { "vim", "it", "describe", "before_each", "after_each" }, globals = { "vim", "it", "describe", "before_each", "after_each" },
}, },
}, },
}, },
}) })
end, end,
["ts_ls"] = function() ["ts_ls"] = function()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
lspconfig.ts_ls.setup({ lspconfig.ts_ls.setup({
capabilities = capabilities, capabilities = capabilities,
-- settings = { -- settings = {
-- }, -- },
-- init_options = { -- init_options = {
-- plugins = { -- plugins = {
-- { -- {
-- name = "@vue/typescript-plugin", -- name = "@vue/typescript-plugin",
-- location = vue_typescript_plugin, -- location = vue_typescript_plugin,
-- languages = { "vue" }, -- languages = { "vue" },
-- }, -- },
-- }, -- },
-- }, -- },
filetypes = { filetypes = {
"javascript", "javascript",
"javascriptreact", "javascriptreact",
"javascript.jsx", "javascript.jsx",
"typescript", "typescript",
"typescriptreact", "typescriptreact",
"typescript.tsx", "typescript.tsx",
-- "vue", -- "vue",
}, },
}) })
end, end,
}, },
}) })
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args) callback = function(args)
local c = vim.lsp.get_client_by_id(args.data.client_id) local c = vim.lsp.get_client_by_id(args.data.client_id)
if not c then if not c then
return return
end end
if vim.bo.filetype == "lua" then if vim.bo.filetype == "lua" then
-- Format the current buffer on save -- Format the current buffer on save
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
buffer = args.buf, buffer = args.buf,
callback = function() callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = c.id }) vim.lsp.buf.format({ bufnr = args.buf, id = c.id })
end, end,
}) })
end end
end, end,
}) })
-- local cmp_select = { behavior = cmp.SelectBehavior.Select } -- local cmp_select = { behavior = cmp.SelectBehavior.Select }
--- Select item next/prev, taking into account whether the cmp window is --- Select item next/prev, taking into account whether the cmp window is
--- top-down or bottoom-up so that the movement is always in the same direction. --- top-down or bottoom-up so that the movement is always in the same direction.
-- local select_item_smart = function(dir, opts) -- local select_item_smart = function(dir, opts)
-- return function(fallback) -- return function(fallback)
-- if cmp.visible() then -- if cmp.visible() then
-- opts = opts or { behavior = cmp.SelectBehavior.Select } -- opts = opts or { behavior = cmp.SelectBehavior.Select }
-- if cmp.core.view.custom_entries_view:is_direction_top_down() then -- if cmp.core.view.custom_entries_view:is_direction_top_down() then
-- ({ next = cmp.select_next_item, prev = cmp.select_prev_item })[dir](opts) -- ({ next = cmp.select_next_item, prev = cmp.select_prev_item })[dir](opts)
-- else -- else
-- ({ prev = cmp.select_next_item, next = cmp.select_prev_item })[dir](opts) -- ({ prev = cmp.select_next_item, next = cmp.select_prev_item })[dir](opts)
-- end -- end
-- else -- else
-- fallback() -- fallback()
-- end -- end
-- end -- end
-- end -- end
-- cmp.setup({ -- cmp.setup({
-- snippet = { -- snippet = {
-- expand = function(args) -- expand = function(args)
-- require("luasnip").lsp_expand(args.body) -- For `luasnip` users. -- require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- end, -- end,
-- }, -- },
-- completion = { -- completion = {
-- completeopt = "menu,menuone,noinsert", -- completeopt = "menu,menuone,noinsert",
-- }, -- },
-- -- No idea what this is -- -- No idea what this is
-- matching = { -- matching = {
-- disallow_fuzzy_matching = false, -- disallow_fuzzy_matching = false,
-- disallow_fullfuzzy_matching = false, -- disallow_fullfuzzy_matching = false,
-- disallow_partial_fuzzy_matching = false, -- disallow_partial_fuzzy_matching = false,
-- }, -- },
-- performance = { -- performance = {
-- -- debounce = 50, -- -- debounce = 50,
-- debounce = 25, -- debounce = 25,
-- -- max_view_entries = 20, -- -- max_view_entries = 20,
-- }, -- },
-- That crazy window -- That crazy window
-- window = { -- window = {
-- completion = cmp.config.window.bordered({ -- completion = cmp.config.window.bordered({
-- border = "single", -- border = "single",
-- side_padding = 2, -- side_padding = 2,
-- col_offset = -3, -- col_offset = -3,
-- max_width = 80, -- max_width = 80,
-- }), -- }),
-- documentation = cmp.config.window.bordered({ -- documentation = cmp.config.window.bordered({
-- max_width = 50, -- max_width = 50,
-- }), -- }),
-- }, -- },
-- mapping = cmp.mapping.preset.insert({ -- mapping = cmp.mapping.preset.insert({
-- ["<C-p>"] = select_item_smart("prev", cmp_select), -- ["<C-p>"] = select_item_smart("prev", cmp_select),
-- ["<C-n>"] = select_item_smart("next", cmp_select), -- ["<C-n>"] = select_item_smart("next", cmp_select),
-- ["<C-e>"] = cmp.mapping.close(), -- ["<C-e>"] = cmp.mapping.close(),
-- ["<C-y>"] = cmp.mapping.confirm({ select = true }), -- ["<C-y>"] = cmp.mapping.confirm({ select = true }),
-- ["<Tab>"] = cmp.mapping.confirm({ select = true }), -- ["<Tab>"] = cmp.mapping.confirm({ select = true }),
-- ["<C-B>"] = cmp.mapping.complete(), -- ["<C-B>"] = cmp.mapping.complete(),
-- ["<C-u>"] = cmp.mapping.scroll_docs(-3), -- ["<C-u>"] = cmp.mapping.scroll_docs(-3),
-- ["<C-d>"] = cmp.mapping.scroll_docs(3), -- ["<C-d>"] = cmp.mapping.scroll_docs(3),
-- ["<C-g>"] = cmp.mapping.abort(), -- ["<C-g>"] = cmp.mapping.abort(),
-- }), -- }),
-- sorting = { -- sorting = {
-- comparators = { -- comparators = {
-- cmp.config.compare.locality, -- cmp.config.compare.locality,
-- cmp.config.compare.offset, -- cmp.config.compare.offset,
-- cmp.config.compare.recently_used, -- cmp.config.compare.recently_used,
-- cmp.config.compare.exact, -- cmp.config.compare.exact,
-- cmp.config.compare.order, -- cmp.config.compare.order,
-- cmp.config.compare.length, -- cmp.config.compare.length,
-- function(entry1, entry2) -- function(entry1, entry2)
-- local _, entry1_under = entry1.completion_item.label:find("^_+") -- local _, entry1_under = entry1.completion_item.label:find("^_+")
-- local _, entry2_under = entry2.completion_item.label:find("^_+") -- local _, entry2_under = entry2.completion_item.label:find("^_+")
-- entry1_under = entry1_under or 0 -- entry1_under = entry1_under or 0
-- entry2_under = entry2_under or 0 -- entry2_under = entry2_under or 0
-- if entry1_under > entry2_under then -- if entry1_under > entry2_under then
-- return false -- return false
-- elseif entry1_under < entry2_under then -- elseif entry1_under < entry2_under then
-- return true -- return true
-- end -- end
-- end, -- end,
-- cmp.config.compare.kind, -- cmp.config.compare.kind,
-- cmp.config.compare.sort_text, -- cmp.config.compare.sort_text,
-- }, -- },
-- }, -- },
-- sources = cmp.config.sources({ -- sources = cmp.config.sources({
-- { name = "neopyter" }, -- { name = "neopyter" },
-- { name = "nvim_lsp" }, -- { name = "nvim_lsp" },
-- { name = "codeium" }, -- { name = "codeium" },
-- { name = "luasnip" }, -- For luasnip users. -- { name = "luasnip" }, -- For luasnip users.
-- }, { -- }, {
-- { name = "buffer" }, -- { name = "buffer" },
-- }), -- }),
-- formatting = { -- formatting = {
-- fields = { -- fields = {
-- "abbr", -- "abbr",
-- "kind", -- "kind",
-- "menu", -- "menu",
-- }, -- },
-- expandable_indicator = true, -- expandable_indicator = true,
-- format = lspkind.cmp_format({ -- format = lspkind.cmp_format({
-- mode = "symbol_text", -- mode = "symbol_text",
-- maxwidth = 50, -- maxwidth = 50,
-- ellipsis_char = "...", -- ellipsis_char = "...",
-- menu = { -- menu = {
-- neopyter = "[Neopyter]", -- neopyter = "[Neopyter]",
-- }, -- },
-- symbol_map = { -- symbol_map = {
-- -- specific complete item kind icon -- -- specific complete item kind icon
-- ["Magic"] = "🪄", -- ["Magic"] = "🪄",
-- ["Path"] = "📁", -- ["Path"] = "📁",
-- ["Dict key"] = "🔑", -- ["Dict key"] = "🔑",
-- ["Instance"] = "󱃻", -- ["Instance"] = "󱃻",
-- ["Statement"] = "󱇯", -- ["Statement"] = "󱇯",
-- }, -- },
-- }), -- }),
-- }, -- },
-- }) -- })
-- -- menu item highlight -- -- menu item highlight
-- vim.api.nvim_set_hl(0, "CmpItemKindMagic", { bg = "NONE", fg = "#D4D434" }) -- vim.api.nvim_set_hl(0, "CmpItemKindMagic", { bg = "NONE", fg = "#D4D434" })
-- vim.api.nvim_set_hl(0, "CmpItemKindPath", { link = "CmpItemKindFolder" }) -- vim.api.nvim_set_hl(0, "CmpItemKindPath", { link = "CmpItemKindFolder" })
-- vim.api.nvim_set_hl(0, "CmpItemKindDictkey", { link = "CmpItemKindKeyword" }) -- vim.api.nvim_set_hl(0, "CmpItemKindDictkey", { link = "CmpItemKindKeyword" })
-- vim.api.nvim_set_hl(0, "CmpItemKindInstance", { link = "CmpItemKindVariable" }) -- vim.api.nvim_set_hl(0, "CmpItemKindInstance", { link = "CmpItemKindVariable" })
-- vim.api.nvim_set_hl(0, "CmpItemKindStatement", { link = "CmpItemKindVariable" }) -- vim.api.nvim_set_hl(0, "CmpItemKindStatement", { link = "CmpItemKindVariable" })
-- vim.diagnostic.config({ -- vim.diagnostic.config({
-- -- update_in_insert = true, -- Update diagnostics in Insert mode -- -- update_in_insert = true, -- Update diagnostics in Insert mode
-- -- ^ (if false, diagnostics are updated on InsertLeave) -- -- ^ (if false, diagnostics are updated on InsertLeave)
-- --
-- underline = true, -- underline = true,
-- --
-- virtual_text = true, -- virtual_text = true,
-- --
-- severity_sort = true, -- high -> low -- severity_sort = true, -- high -> low
-- --
-- -- float = { -- -- float = {
-- -- focusable = false, -- -- focusable = false,
-- -- style = "minimal", -- -- style = "minimal",
-- -- border = "rounded", -- -- border = "rounded",
-- -- source = true, -- -- source = true,
-- -- header = { "  Diagnostics", "String" }, -- -- header = { "  Diagnostics", "String" },
-- -- prefix = function(_, _, _) -- -- prefix = function(_, _, _)
-- -- return "  ", "String" -- -- return "  ", "String"
-- -- end, -- -- end,
-- -- }, -- -- },
-- }) -- })
-- treesitter jupyter notebook stuff -- treesitter jupyter notebook stuff
-- require("nvim-treesitter.configs").setup({ -- require("nvim-treesitter.configs").setup({
-- textobjects = { -- textobjects = {
-- move = { -- move = {
-- enable = true, -- enable = true,
-- goto_next_start = { -- goto_next_start = {
-- ["]j"] = "@cellseparator", -- ["]j"] = "@cellseparator",
-- ["]c"] = "@cellcontent", -- ["]c"] = "@cellcontent",
-- }, -- },
-- goto_previous_start = { -- goto_previous_start = {
-- ["[j"] = "@cellseparator", -- ["[j"] = "@cellseparator",
-- ["[c"] = "@cellcontent", -- ["[c"] = "@cellcontent",
-- }, -- },
-- }, -- },
-- }, -- },
-- }) -- })
end, end,
}, },
} }

View file

@ -1,9 +1,9 @@
return { return {
"iamcco/markdown-preview.nvim", -- "iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, -- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install", -- build = "cd app && yarn install",
init = function() -- init = function()
vim.g.mkdp_filetypes = { "markdown" } -- vim.g.mkdp_filetypes = { "markdown" }
end, -- end,
ft = { "markdown" }, -- ft = { "markdown" },
} }

View file

@ -5,46 +5,47 @@ These three tabs are necessary when dealing with this nonsense:
- https://github.com/nvimtools/none-ls.nvim - https://github.com/nvimtools/none-ls.nvim
--]] --]]
return { return {
"jay-babu/mason-null-ls.nvim", "jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
dependencies = { dependencies = {
"williamboman/mason.nvim", "williamboman/mason.nvim",
"nvimtools/none-ls.nvim", "nvimtools/none-ls.nvim",
"nvimtools/none-ls-extras.nvim", "nvimtools/none-ls-extras.nvim",
}, },
config = function() config = function()
local null_ls = require("null-ls") local null_ls = require("null-ls")
require("mason-null-ls").setup({ require("mason-null-ls").setup({
ensure_installed = { ensure_installed = {
"stylua", "stylua",
"jq", "jq",
"basedpyright", "mypy",
"black", "ruff",
}, "black",
handlers = { },
-- ["mypy"] = function(source_name, methods) handlers = {
-- local options = { ["mypy"] = function(source_name, methods)
-- extra_args = function() local options = {
-- local command = "which python" extra_args = function()
-- local handle = io.popen(command) local command = "which python"
-- local python_path = "" local handle = io.popen(command)
-- if handle then local python_path = ""
-- python_path = handle:read("*a") if handle then
-- python_path = string.gsub(python_path, "\n", "") python_path = handle:read("*a")
-- handle:close() python_path = string.gsub(python_path, "\n", "")
-- end handle:close()
-- return { "--python-executable", python_path } end
-- end, return { "--python-executable", python_path }
-- } end,
-- null_ls.register(null_ls.builtins.diagnostics.mypy.with(options)) }
-- end, null_ls.register(null_ls.builtins.diagnostics.mypy.with(options))
--[[ ["ruff"] = function(source_name, methods) end,
--[[ ["ruff"] = function(source_name, methods)
null_ls.register(null_ls.builtins.diagnostics.ruff) null_ls.register(null_ls.builtins.diagnostics.ruff)
--require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior --require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior
end, ]] end, ]]
}, },
}) })
null_ls.setup() null_ls.setup()
end, end,
} }

View file

@ -16,10 +16,10 @@ vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("n", "N", "Nzzzv")
vim.keymap.set("n", "<leader>vwm", function() vim.keymap.set("n", "<leader>vwm", function()
require("vim-with-me").StartVimWithMe() require("vim-with-me").StartVimWithMe()
end) end)
vim.keymap.set("n", "<leader>svwm", function() vim.keymap.set("n", "<leader>svwm", function()
require("vim-with-me").StopVimWithMe() require("vim-with-me").StopVimWithMe()
end) end)
vim.keymap.set("n", "<leader>vs", "<C-w>v") vim.keymap.set("n", "<leader>vs", "<C-w>v")
@ -54,19 +54,19 @@ vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.dotfiles/nvim/.config/nvim/lua/the
vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>") vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
vim.keymap.set("n", "<leader><leader>", function() vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so") vim.cmd("so")
end) end)
vim.keymap.set("n", "zh", "$viBhzf", { vim.keymap.set("n", "zh", "$viBhzf", {
desc = "Fold { block", desc = "Fold { block",
}) })
vim.keymap.set("n", "zj", "$vi[hzf", { vim.keymap.set("n", "zj", "$vi[hzf", {
desc = "Fold [ block", desc = "Fold [ block",
}) })
vim.keymap.set("n", "zk", "$vibhzf", { vim.keymap.set("n", "zk", "$vibhzf", {
desc = "Fold ( block", desc = "Fold ( block",
}) })
vim.keymap.set("n", "ga", "<cmd>EasyAlign<CR>") vim.keymap.set("n", "ga", "<cmd>EasyAlign<CR>")
@ -77,7 +77,6 @@ vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv") vim.keymap.set("v", ">", ">gv")
-- Indent with tab -- Indent with tab
vim.keymap.set("i", "<Tab>", "<Tab>")
vim.keymap.set("v", "<Tab>", ">gv") vim.keymap.set("v", "<Tab>", ">gv")
vim.keymap.set("v", "<S-Tab>", "<gv") vim.keymap.set("v", "<S-Tab>", "<gv")
@ -85,9 +84,9 @@ vim.keymap.set("v", "<S-Tab>", "<gv")
vim.keymap.set("n", "<C-w>e", "<C-w>j<C-w>q") vim.keymap.set("n", "<C-w>e", "<C-w>j<C-w>q")
vim.keymap.set("n", "<leader>w", function() vim.keymap.set("n", "<leader>w", function()
vim.ui.input({ prompt = "Enter value for shiftwidth: " }, function(input) vim.ui.input({ prompt = "Enter value for shiftwidth: " }, function(input)
vim.o.shiftwidth = tonumber(input) vim.o.shiftwidth = tonumber(input)
end) end)
end) end)
-- vim.keymap.set("n", "<leader>tc", function() -- vim.keymap.set("n", "<leader>tc", function()
-- -- local file_number = tonumber(vim.fn.input("File number > "), 10) -- -- local file_number = tonumber(vim.fn.input("File number > "), 10)

View file

@ -1,44 +0,0 @@
# stolen from https://github.com/RGBCube/ncc/blob/94c349aa767f04f40ff4165c70c15ed3c3996f82/modules/postgresql.nix
{ config, lib, pkgs, ... }: let
inherit (lib) flip mkForce mkOverride mkValue;
in {
config.environment.systemPackages = [
config.services.postgresql.package
];
options.services.postgresql.ensure = mkValue [];
config.services.postgresql = {
enable = true;
package = pkgs.postgresql_17;
enableJIT = true;
enableTCPIP = true;
settings.listen_addresses = mkForce "::";
authentication = mkOverride 10 /* ini */ ''
# DATABASE USER AUTHENTICATION
local all all peer
# DATABASE USER ADDRESS AUTHENTICATION
host all all ::/0 md5
'';
ensure = [ "postgres" "root" ];
initdbArgs = [ "--locale=C" "--encoding=UTF8" ];
ensureDatabases = config.services.postgresql.ensure;
ensureUsers = flip map config.services.postgresql.ensure (name: {
inherit name;
ensureDBOwnership = true;
ensureClauses = {
login = true;
superuser = name == "postgres" || name == "root";
};
});
};
}

View file

@ -7,7 +7,6 @@ in {
"hosts/thegeneralist-central/acme/acmeEnvironment.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist-central/acme/acmeEnvironment.age".publicKeys = [ thegeneralist ];
"hosts/thegeneralist-central/cert.pem.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist-central/cert.pem.age".publicKeys = [ thegeneralist ];
"hosts/thegeneralist-central/credentials.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist-central/credentials.age".publicKeys = [ thegeneralist ];
"hosts/thegeneralist-central/credentials_personal.age".publicKeys = [ thegeneralist ];
"hosts/thegeneralist-central/cache/key.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist-central/cache/key.age".publicKeys = [ thegeneralist ];
"hosts/thegeneralist-central/password.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist-central/password.age".publicKeys = [ thegeneralist ];