harpoon
This commit is contained in:
18
flake.lock
generated
18
flake.lock
generated
@@ -165,11 +165,11 @@
|
|||||||
"homebrew-cask": {
|
"homebrew-cask": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756963222,
|
"lastModified": 1756974459,
|
||||||
"narHash": "sha256-NrldOYsg+bF5SlBn/zthaeWYCT9cuIbIO3LdaRtlVR4=",
|
"narHash": "sha256-NTvg7t9+gr9gB51ADkRIefVQC6jmLbH9LynY+JDf4xE=",
|
||||||
"owner": "homebrew",
|
"owner": "homebrew",
|
||||||
"repo": "homebrew-cask",
|
"repo": "homebrew-cask",
|
||||||
"rev": "169a6483ce140cf7c5601b034678fb0e9ca20539",
|
"rev": "e926011ce231a21999607cc66c55c2c193a6d219",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -181,11 +181,11 @@
|
|||||||
"homebrew-core": {
|
"homebrew-core": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756963538,
|
"lastModified": 1756983121,
|
||||||
"narHash": "sha256-vXkatEnNkaAWp8eUqF2kjh73Aumc9HmqklmszcoQUTE=",
|
"narHash": "sha256-Iy59o8+roiHszph8GttkhRyb4vXjGSqecU2QrqTiHpM=",
|
||||||
"owner": "homebrew",
|
"owner": "homebrew",
|
||||||
"repo": "homebrew-core",
|
"repo": "homebrew-core",
|
||||||
"rev": "b42e3b0fabfec5e3125bd201a72229bf5d35fb3e",
|
"rev": "2e8c6ce706e4e4093bcac1bed8b2a46761c491bf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -273,11 +273,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756961638,
|
"lastModified": 1756983599,
|
||||||
"narHash": "sha256-LSv7ZoFuBNuGms+yQGwlqkh/0T1RLoHnB/1lr1ClDZg=",
|
"narHash": "sha256-I0XTyXKvVJBt57xSptpEZku3Iqnxy00U0IRt7Jl/EWU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1db6d3c472c786a90b9eea0bcd0368eb60bf6477",
|
"rev": "3bb3bf51029939ab947e82342e7545e6b477a9a4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
36
flake.nix
36
flake.nix
@@ -30,22 +30,13 @@
|
|||||||
zjstatus.url = "github:dj95/zjstatus";
|
zjstatus.url = "github:dj95/zjstatus";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {flake-parts, ...}: let
|
outputs = inputs @ {flake-parts, ...}:
|
||||||
loadOverlays = path:
|
|
||||||
with builtins;
|
|
||||||
map (n: import (path + ("/" + n)))
|
|
||||||
(filter (n: match ".*\\.nix" n != null)
|
|
||||||
(attrNames (readDir path)));
|
|
||||||
in
|
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} (
|
flake-parts.lib.mkFlake {inherit inputs;} (
|
||||||
let
|
let
|
||||||
constants = import ./lib/constants.nix;
|
constants = import ./lib/constants.nix;
|
||||||
user = constants.user;
|
user = constants.user;
|
||||||
darwinHosts = builtins.attrNames (builtins.readDir ./hosts/darwin);
|
darwinHosts = builtins.attrNames (builtins.readDir ./hosts/darwin);
|
||||||
nixosHosts = builtins.attrNames (builtins.readDir ./hosts/nixos);
|
nixosHosts = builtins.attrNames (builtins.readDir ./hosts/nixos);
|
||||||
|
|
||||||
commonOverlays = loadOverlays ./overlays;
|
|
||||||
darwinOverlays = loadOverlays ./overlays/darwin;
|
|
||||||
in {
|
in {
|
||||||
systems = [
|
systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@@ -65,14 +56,11 @@
|
|||||||
inputs.home-manager.darwinModules.home-manager
|
inputs.home-manager.darwinModules.home-manager
|
||||||
inputs.nix-homebrew.darwinModules.nix-homebrew
|
inputs.nix-homebrew.darwinModules.nix-homebrew
|
||||||
{
|
{
|
||||||
nixpkgs.overlays =
|
nixpkgs.overlays = [
|
||||||
commonOverlays
|
(final: prev: {
|
||||||
++ darwinOverlays
|
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
||||||
++ [
|
})
|
||||||
(final: prev: {
|
];
|
||||||
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
nix-homebrew = {
|
nix-homebrew = {
|
||||||
inherit user;
|
inherit user;
|
||||||
@@ -102,13 +90,11 @@
|
|||||||
modules = [
|
modules = [
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
nixpkgs.overlays =
|
nixpkgs.overlays = [
|
||||||
commonOverlays
|
(final: prev: {
|
||||||
++ [
|
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
||||||
(final: prev: {
|
})
|
||||||
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
];
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
./hosts/nixos/${hostname}
|
./hosts/nixos/${hostname}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
user,
|
user,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../shared.nix
|
../shared.nix
|
||||||
../../../modules/postgresql.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "chidi";
|
networking.hostName = "chidi";
|
||||||
networking.computerName = "Chidi";
|
networking.computerName = "Chidi";
|
||||||
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.syncthing.settings.folders = {
|
services.syncthing.settings.folders = {
|
||||||
"Projects/Work" = {
|
"Projects/Work" = {
|
||||||
path = "/Users/${user}/Projects/Work";
|
path = "/Users/${user}/Projects/Work";
|
||||||
|
|||||||
@@ -65,24 +65,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
extensions = [pkgs.postgresql17Packages.timescaledb];
|
|
||||||
authentication = pkgs.lib.mkOverride 10 ''
|
|
||||||
local all all trust
|
|
||||||
host all all 127.0.0.1/32 trust
|
|
||||||
host all all ::1/128 trust
|
|
||||||
host all all 100.64.0.0/10 trust
|
|
||||||
'';
|
|
||||||
settings = {
|
|
||||||
shared_preload_libraries = ["timescaledb"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.clickhouse = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.syncthing.settings.folders = {
|
services.syncthing.settings.folders = {
|
||||||
"Projects/Personal" = {
|
"Projects/Personal" = {
|
||||||
path = "/home/${user}/Projects/Personal";
|
path = "/home/${user}/Projects/Personal";
|
||||||
|
|||||||
@@ -5,15 +5,6 @@
|
|||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
overlays = let
|
|
||||||
path = ../overlays;
|
|
||||||
in
|
|
||||||
with builtins;
|
|
||||||
map (n: import (path + ("/" + n))) (
|
|
||||||
filter (n: match ".*\\.nix" n != null || pathExists (path + ("/" + n + "/default.nix"))) (
|
|
||||||
attrNames (readDir path)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
./mappings.nix
|
./mappings.nix
|
||||||
./options.nix
|
./options.nix
|
||||||
./plugins/blink-cmp.nix
|
./plugins/blink-cmp.nix
|
||||||
|
./plugins/harpoon.nix
|
||||||
./plugins/conform.nix
|
./plugins/conform.nix
|
||||||
./plugins/grug-far.nix
|
./plugins/grug-far.nix
|
||||||
./plugins/lsp.nix
|
./plugins/lsp.nix
|
||||||
|
|||||||
@@ -148,5 +148,41 @@
|
|||||||
action = ":lua require('mini.jump2d').start(require('mini.jump2d').builtin_opts.query)<CR>";
|
action = ":lua require('mini.jump2d').start(require('mini.jump2d').builtin_opts.query)<CR>";
|
||||||
options.desc = "Jump to character";
|
options.desc = "Jump to character";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>a";
|
||||||
|
action = ":lua require('harpoon'):list():add()<CR>";
|
||||||
|
options.desc = "Add harpoon";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-e>";
|
||||||
|
action = ":lua require('harpoon').ui:toggle_quick_menu(require('harpoon'):list())<CR>";
|
||||||
|
options.desc = "Toggle harpoon quick menu";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>1";
|
||||||
|
action = ":lua require('harpoon'):list():select(1)<CR>";
|
||||||
|
options.desc = "Go to harpoon 1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>2";
|
||||||
|
action = ":lua require('harpoon'):list():select(2)<CR>";
|
||||||
|
options.desc = "Go to harpoon 2";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>3";
|
||||||
|
action = ":lua require('harpoon'):list():select(3)<CR>";
|
||||||
|
options.desc = "Go to harpoon 3";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>4";
|
||||||
|
action = ":lua require('harpoon'):list():select(4)<CR>";
|
||||||
|
options.desc = "Go to harpoon 4";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
7
modules/home/neovim/plugins/harpoon.nix
Normal file
7
modules/home/neovim/plugins/harpoon.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
programs.nixvim.plugins = {
|
||||||
|
harpoon = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../core.nix
|
../core.nix
|
||||||
../postgresql.nix
|
|
||||||
./firewall.nix
|
./firewall.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./adguard.nix
|
./adguard.nix
|
||||||
|
|||||||
38
modules/packages.sync-conflict-20250904-133614-N7W6SUT.nix
Normal file
38
modules/packages.sync-conflict-20250904-133614-N7W6SUT.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{pkgs, ...}:
|
||||||
|
with pkgs; [
|
||||||
|
(callPackage ./bin/open-project.nix {})
|
||||||
|
age
|
||||||
|
alejandra
|
||||||
|
nodejs_24
|
||||||
|
pnpm
|
||||||
|
ast-grep
|
||||||
|
delta
|
||||||
|
devenv
|
||||||
|
dig
|
||||||
|
docker
|
||||||
|
docker-compose
|
||||||
|
fastfetch
|
||||||
|
fd
|
||||||
|
fira-code
|
||||||
|
gh
|
||||||
|
git
|
||||||
|
gnumake
|
||||||
|
gnupg
|
||||||
|
htop
|
||||||
|
hyperfine
|
||||||
|
jjui
|
||||||
|
jq
|
||||||
|
killall
|
||||||
|
lsof
|
||||||
|
nurl
|
||||||
|
openssh
|
||||||
|
postgresql_17
|
||||||
|
sd
|
||||||
|
sops
|
||||||
|
sqlite
|
||||||
|
tree
|
||||||
|
tree-sitter
|
||||||
|
unzip
|
||||||
|
vivid
|
||||||
|
zip
|
||||||
|
]
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
user,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = lib.mkIf config.services.postgresql.enable {
|
|
||||||
services.postgresql = {
|
|
||||||
package = pkgs.postgresql_17;
|
|
||||||
enableTCPIP = true;
|
|
||||||
settings.port = 5432;
|
|
||||||
ensureDatabases = ["postgres"];
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "postgres";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = user;
|
|
||||||
ensureClauses = {
|
|
||||||
superuser = true;
|
|
||||||
createdb = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
authentication = ''
|
|
||||||
local all all trust
|
|
||||||
host all all 127.0.0.1/32 trust
|
|
||||||
host all all ::1/128 trust
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
final: prev: {
|
|
||||||
postgresql = {
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.services.postgresql;
|
|
||||||
|
|
||||||
postStartScript = prev.writeScript "postgresql-post-start" ''
|
|
||||||
#!${prev.bash}/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Wait for PostgreSQL to be ready
|
|
||||||
until ${cfg.package}/bin/pg_isready -h localhost -p ${toString cfg.port} -U ${cfg.superUser}; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create databases if they don't exist
|
|
||||||
${prev.lib.concatMapStringsSep "\n" (db: ''
|
|
||||||
if ! ${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -lqt | cut -d'|' -f1 | grep -qw ${prev.lib.escapeShellArg db}; then
|
|
||||||
echo "Creating database: ${prev.lib.escapeShellArg db}"
|
|
||||||
${cfg.package}/bin/createdb -h localhost -p ${toString cfg.port} -U ${cfg.superUser} ${prev.lib.escapeShellArg db}
|
|
||||||
fi
|
|
||||||
'')
|
|
||||||
cfg.ensureDatabases}
|
|
||||||
|
|
||||||
# Create users and set permissions
|
|
||||||
${prev.lib.concatMapStringsSep "\n" (user: ''
|
|
||||||
# Create user if it doesn't exist
|
|
||||||
if ! ${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -tAc "SELECT 1 FROM pg_roles WHERE rolname='${prev.lib.escapeShellArg user.name}'" | grep -q 1; then
|
|
||||||
echo "Creating user: ${prev.lib.escapeShellArg user.name}"
|
|
||||||
${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -c "CREATE USER \"${prev.lib.escapeShellArg user.name}\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set user privileges
|
|
||||||
${prev.lib.optionalString (user ? ensureDBOwnership && user.ensureDBOwnership) ''
|
|
||||||
echo "Setting database ownership for ${prev.lib.escapeShellArg user.name}"
|
|
||||||
${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -c "ALTER USER \"${prev.lib.escapeShellArg user.name}\" CREATEDB CREATEROLE"
|
|
||||||
''}
|
|
||||||
|
|
||||||
${prev.lib.optionalString (user ? ensureClauses) ''
|
|
||||||
${prev.lib.optionalString (user.ensureClauses ? superuser && user.ensureClauses.superuser) ''
|
|
||||||
echo "Granting superuser to ${prev.lib.escapeShellArg user.name}"
|
|
||||||
${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -c "ALTER USER \"${prev.lib.escapeShellArg user.name}\" SUPERUSER"
|
|
||||||
''}
|
|
||||||
${prev.lib.optionalString (user.ensureClauses ? createdb && user.ensureClauses.createdb) ''
|
|
||||||
echo "Granting createdb to ${prev.lib.escapeShellArg user.name}"
|
|
||||||
${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -c "ALTER USER \"${prev.lib.escapeShellArg user.name}\" CREATEDB"
|
|
||||||
''}
|
|
||||||
''}
|
|
||||||
|
|
||||||
# Grant permissions (legacy support)
|
|
||||||
${prev.lib.concatMapStringsSep "\n" (perm: ''
|
|
||||||
echo "Granting ${prev.lib.escapeShellArg perm} to ${prev.lib.escapeShellArg user.name}"
|
|
||||||
${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -c "GRANT ${prev.lib.escapeShellArg perm} TO \"${prev.lib.escapeShellArg user.name}\""
|
|
||||||
'') (prev.lib.optionals (user ? ensurePermissions) (prev.lib.mapAttrsToList (target: perm: "${perm} ON ${target}") user.ensurePermissions))}
|
|
||||||
'')
|
|
||||||
cfg.ensureUsers}
|
|
||||||
|
|
||||||
# Run initial script if provided
|
|
||||||
${prev.lib.optionalString (cfg.initialScript != null) ''
|
|
||||||
echo "Running initial script"
|
|
||||||
${cfg.package}/bin/psql -h localhost -p ${toString cfg.port} -U ${cfg.superUser} -f ${cfg.initialScript}
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
config = prev.lib.mkIf cfg.enable {
|
|
||||||
launchd.user.agents.postgresql = prev.lib.mkIf (cfg.ensureDatabases != [] || cfg.ensureUsers != [] || cfg.initialScript != null) {
|
|
||||||
script = prev.lib.mkAfter ''
|
|
||||||
# Run post-start script in background after PostgreSQL starts
|
|
||||||
(
|
|
||||||
sleep 5 # Give PostgreSQL a moment to fully start
|
|
||||||
${prev.bash}/bin/bash ${postStartScript}
|
|
||||||
) &
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user