diff --git a/flake.lock b/flake.lock index 3fb124a..6f5f8c6 100644 --- a/flake.lock +++ b/flake.lock @@ -165,11 +165,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1756963222, - "narHash": "sha256-NrldOYsg+bF5SlBn/zthaeWYCT9cuIbIO3LdaRtlVR4=", + "lastModified": 1756974459, + "narHash": "sha256-NTvg7t9+gr9gB51ADkRIefVQC6jmLbH9LynY+JDf4xE=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "169a6483ce140cf7c5601b034678fb0e9ca20539", + "rev": "e926011ce231a21999607cc66c55c2c193a6d219", "type": "github" }, "original": { @@ -181,11 +181,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1756963538, - "narHash": "sha256-vXkatEnNkaAWp8eUqF2kjh73Aumc9HmqklmszcoQUTE=", + "lastModified": 1756983121, + "narHash": "sha256-Iy59o8+roiHszph8GttkhRyb4vXjGSqecU2QrqTiHpM=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "b42e3b0fabfec5e3125bd201a72229bf5d35fb3e", + "rev": "2e8c6ce706e4e4093bcac1bed8b2a46761c491bf", "type": "github" }, "original": { @@ -273,11 +273,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1756961638, - "narHash": "sha256-LSv7ZoFuBNuGms+yQGwlqkh/0T1RLoHnB/1lr1ClDZg=", + "lastModified": 1756983599, + "narHash": "sha256-I0XTyXKvVJBt57xSptpEZku3Iqnxy00U0IRt7Jl/EWU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1db6d3c472c786a90b9eea0bcd0368eb60bf6477", + "rev": "3bb3bf51029939ab947e82342e7545e6b477a9a4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c53459c..058bff3 100644 --- a/flake.nix +++ b/flake.nix @@ -30,22 +30,13 @@ zjstatus.url = "github:dj95/zjstatus"; }; - outputs = inputs @ {flake-parts, ...}: let - loadOverlays = path: - with builtins; - map (n: import (path + ("/" + n))) - (filter (n: match ".*\\.nix" n != null) - (attrNames (readDir path))); - in + outputs = inputs @ {flake-parts, ...}: flake-parts.lib.mkFlake {inherit inputs;} ( let constants = import ./lib/constants.nix; user = constants.user; darwinHosts = builtins.attrNames (builtins.readDir ./hosts/darwin); nixosHosts = builtins.attrNames (builtins.readDir ./hosts/nixos); - - commonOverlays = loadOverlays ./overlays; - darwinOverlays = loadOverlays ./overlays/darwin; in { systems = [ "x86_64-linux" @@ -65,14 +56,11 @@ inputs.home-manager.darwinModules.home-manager inputs.nix-homebrew.darwinModules.nix-homebrew { - nixpkgs.overlays = - commonOverlays - ++ darwinOverlays - ++ [ - (final: prev: { - zjstatus = inputs.zjstatus.packages.${prev.system}.default; - }) - ]; + nixpkgs.overlays = [ + (final: prev: { + zjstatus = inputs.zjstatus.packages.${prev.system}.default; + }) + ]; nix-homebrew = { inherit user; @@ -102,13 +90,11 @@ modules = [ inputs.home-manager.nixosModules.home-manager { - nixpkgs.overlays = - commonOverlays - ++ [ - (final: prev: { - zjstatus = inputs.zjstatus.packages.${prev.system}.default; - }) - ]; + nixpkgs.overlays = [ + (final: prev: { + zjstatus = inputs.zjstatus.packages.${prev.system}.default; + }) + ]; } ./hosts/nixos/${hostname} ]; diff --git a/hosts/darwin/chidi/default.nix b/hosts/darwin/chidi/default.nix index 82e146c..09d2993 100644 --- a/hosts/darwin/chidi/default.nix +++ b/hosts/darwin/chidi/default.nix @@ -1,22 +1,15 @@ { - config, - lib, pkgs, user, ... }: { imports = [ ../shared.nix - ../../../modules/postgresql.nix ]; networking.hostName = "chidi"; networking.computerName = "Chidi"; - services.postgresql = { - enable = true; - }; - services.syncthing.settings.folders = { "Projects/Work" = { path = "/Users/${user}/Projects/Work"; diff --git a/hosts/nixos/tahani/default.nix b/hosts/nixos/tahani/default.nix index 0f4fa61..0e2e714 100644 --- a/hosts/nixos/tahani/default.nix +++ b/hosts/nixos/tahani/default.nix @@ -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 = { "Projects/Personal" = { path = "/home/${user}/Projects/Personal"; diff --git a/modules/core.nix b/modules/core.nix index df487e9..d0785c3 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -5,15 +5,6 @@ config = { 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 = { diff --git a/modules/home/neovim/default.nix b/modules/home/neovim/default.nix index 373fdba..21cad05 100644 --- a/modules/home/neovim/default.nix +++ b/modules/home/neovim/default.nix @@ -4,6 +4,7 @@ ./mappings.nix ./options.nix ./plugins/blink-cmp.nix + ./plugins/harpoon.nix ./plugins/conform.nix ./plugins/grug-far.nix ./plugins/lsp.nix diff --git a/modules/home/neovim/mappings.nix b/modules/home/neovim/mappings.nix index bb6be5c..4329975 100644 --- a/modules/home/neovim/mappings.nix +++ b/modules/home/neovim/mappings.nix @@ -148,5 +148,41 @@ action = ":lua require('mini.jump2d').start(require('mini.jump2d').builtin_opts.query)"; options.desc = "Jump to character"; } + { + mode = "n"; + key = "a"; + action = ":lua require('harpoon'):list():add()"; + options.desc = "Add harpoon"; + } + { + mode = "n"; + key = ""; + action = ":lua require('harpoon').ui:toggle_quick_menu(require('harpoon'):list())"; + options.desc = "Toggle harpoon quick menu"; + } + { + mode = "n"; + key = "1"; + action = ":lua require('harpoon'):list():select(1)"; + options.desc = "Go to harpoon 1"; + } + { + mode = "n"; + key = "2"; + action = ":lua require('harpoon'):list():select(2)"; + options.desc = "Go to harpoon 2"; + } + { + mode = "n"; + key = "3"; + action = ":lua require('harpoon'):list():select(3)"; + options.desc = "Go to harpoon 3"; + } + { + mode = "n"; + key = "4"; + action = ":lua require('harpoon'):list():select(4)"; + options.desc = "Go to harpoon 4"; + } ]; } diff --git a/modules/home/neovim/plugins/harpoon.nix b/modules/home/neovim/plugins/harpoon.nix new file mode 100644 index 0000000..69bd017 --- /dev/null +++ b/modules/home/neovim/plugins/harpoon.nix @@ -0,0 +1,7 @@ +{ + programs.nixvim.plugins = { + harpoon = { + enable = true; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index c624271..9917f6f 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -8,7 +8,6 @@ }: { imports = [ ../core.nix - ../postgresql.nix ./firewall.nix ./ssh.nix ./adguard.nix diff --git a/modules/packages.sync-conflict-20250904-133614-N7W6SUT.nix b/modules/packages.sync-conflict-20250904-133614-N7W6SUT.nix new file mode 100644 index 0000000..72d4bd0 --- /dev/null +++ b/modules/packages.sync-conflict-20250904-133614-N7W6SUT.nix @@ -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 +] diff --git a/modules/postgresql.nix b/modules/postgresql.nix deleted file mode 100644 index 8a7b8ca..0000000 --- a/modules/postgresql.nix +++ /dev/null @@ -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 - ''; - }; - }; -} diff --git a/overlays/darwin/postgresql.nix b/overlays/darwin/postgresql.nix deleted file mode 100644 index 2683fcc..0000000 --- a/overlays/darwin/postgresql.nix +++ /dev/null @@ -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} - ) & - ''; - }; - }; - }; -}