diff --git a/flake.lock b/flake.lock index 4b41c53..f83ea24 100644 --- a/flake.lock +++ b/flake.lock @@ -718,11 +718,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1774289893, - "narHash": "sha256-si2LHcNiLuF01yOuaUs90p1U09hhaketA8tyanWwiP0=", + "lastModified": 1774683773, + "narHash": "sha256-4GyL+ZtAZEKX9FwSvNrOGSUJ9eaHE0Pdy3N3C9Xjlu8=", "owner": "jdonszelmann", "repo": "homepage", - "rev": "635f900ce31b7f901da33c6fa830a2e7c116552f", + "rev": "9755ae38ec713888bc18b64227116031cd71e0af", "type": "github" }, "original": { diff --git a/hosts/fili/services/websites/homepage.nix b/hosts/fili/services/websites/homepage.nix index ce17421..3a843a7 100644 --- a/hosts/fili/services/websites/homepage.nix +++ b/hosts/fili/services/websites/homepage.nix @@ -1,48 +1,46 @@ { flakes, pkgs, ... }: +let + cache = pkg: '' + location ~* \.(png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf)$ { + expires max; + add_header Cache-Control "public, no-transform"; + root ${pkg}; + } + ''; + regular = "${flakes.homepage.packages.${pkgs.system}.website}"; + gay = "${flakes.homepage.packages.${pkgs.system}.website-gay}"; + ssl = { + forceSSL = true; + http2 = true; + enableACME = true; + }; + base = + pkg: + { + extraConfig = cache pkg; + } + // ssl; + site = + pkg: + { + locations."/".root = pkg; + } + // (base pkg); + redirect = + return: + { + locations."/".return = return; + } + // ssl; +in { services.nginx = { - virtualHosts."donsz.nl" = { - forceSSL = true; - http2 = true; - enableACME = true; - - locations."/" = { - root = "${flakes.homepage.packages.${pkgs.system}.website}"; - }; - }; - virtualHosts."blog.donsz.nl" = { - forceSSL = true; - http2 = true; - enableACME = true; - - locations."/".return = "301 https://donsz.nl/blog"; - }; - virtualHosts."gay.donsz.nl" = { - forceSSL = true; - http2 = true; - enableACME = true; - - locations."/" = { - root = "${flakes.homepage.packages.${pkgs.system}.website-gay}"; - }; - }; - virtualHosts."jana.is.fckn.gay" = { - forceSSL = true; - http2 = true; - enableACME = true; - - locations."/" = { - root = "${flakes.homepage.packages.${pkgs.system}.website-gay}"; - }; - }; - virtualHosts."jdonszelmann.nl" = { - forceSSL = true; - http2 = true; - enableACME = true; - - locations."/" = { - root = "${flakes.homepage.packages.${pkgs.system}.website}"; - }; + virtualHosts = { + "donsz.nl" = site regular; + "jdonszelmann.nl" = site regular; + "blog.donsz.nl" = redirect "301 https://donsz.nl/blog"; + "gay.donsz.nl" = site gay; + "jana.is.fckn.gay" = site gay; }; }; } diff --git a/programs/default.nix b/programs/default.nix index 272d8a2..fd72c8b 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -3,7 +3,6 @@ imports = lib.concatLists [ [ - ./xdg.nix ./ssh.nix ./less.nix ./nvim @@ -16,6 +15,7 @@ ./niri ./zed ./firefox + ./xdg ] (machine.program { diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 5989eb8..0a0cc6e 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -201,7 +201,7 @@ inputs@{ machine, ... }: key = "~/.ssh/id_ed25519.pub"; }; - # remotes.origin.auto-track-bookmarks = true; + remotes.origin.auto-track-bookmarks = "*"; # remotes.upstream.auto-track-bookmarks = true; git = { diff --git a/programs/kanata/default.nix b/programs/kanata/default.nix index 7b9b465..bcdd468 100644 --- a/programs/kanata/default.nix +++ b/programs/kanata/default.nix @@ -21,7 +21,7 @@ let tab q w e r t y u i o p [ ] \ @cap a s d f g h j k l ; ' ret lsft z x c v b n m , . / rsft - lctl @lmet lalt spc ralt @rctl + lctl @lmet lalt spc @ralt @rctl ) (deflayer control @@ -30,7 +30,7 @@ let tab @mcleft @mup @mcright @replay t y u i o p @wup @wdown \ @cap @mleft @mdown @mright f g left down up right ; ' bspc lsft z x C-c v bspc n @macro , . C-f rsft - lctl lmet lalt spc ralt @rctl + lctl lmet lalt spc @ralt @rctl ) (deflayermap (other) @@ -82,6 +82,13 @@ let 200 200 C-k (layer-while-held other) ) + + ralt ( + tap-dance 200 ( + ralt + rmet + ) + ) ) ''; in diff --git a/programs/niri/default.nix b/programs/niri/default.nix index 417b4f8..5138e96 100644 --- a/programs/niri/default.nix +++ b/programs/niri/default.nix @@ -5,11 +5,12 @@ inputs@{ machine, ... }: inherit inputs; requirements = [ "graphical" ]; home-config = - { config - , pkgs - , flakes - , lib - , ... + { + config, + pkgs, + flakes, + lib, + ... }: let noctalia = @@ -115,7 +116,7 @@ inputs@{ machine, ... }: keyboard = { xkb = { layout = "us"; - options = "grp:win_space_toggle,compose:ralt"; + options = "grp:win_space_toggle,compose:rwin"; }; numlock = true; }; @@ -242,7 +243,7 @@ inputs@{ machine, ... }: } { - matches = [{ app-id = "firefox"; }]; + matches = [ { app-id = "firefox"; } ]; open-on-workspace = "browser"; } @@ -600,7 +601,7 @@ inputs@{ machine, ... }: id = "Volume"; } ] - ++ [{ id = "Battery"; }] + ++ [ { id = "Battery"; } ] ++ [ { id = "KeyboardLayout"; diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index e938cdb..4fabc34 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -13,24 +13,7 @@ inputs@{ machine, ... }: ... }: let - nvim_mime_types = [ - "application/x-zerosize" - "text/english" - "text/plain" - "text/x-makefile" - "text/x-c++hdr" - "text/x-c++src" - "text/x-chdr" - "text/x-csrc" - "text/x-java" - "text/x-moc" - "text/x-pascal" - "text/x-tcl" - "text/x-tex" - "application/x-shellscript" - "text/x-c" - "text/x-c++" - ]; + nvim_mime_types = (import ../xdg/mimemap.nix).text; desktop-entry-name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim"; desktop-entry = pkgs.makeDesktopItem { name = desktop-entry-name; @@ -55,6 +38,14 @@ inputs@{ machine, ... }: packages = with pkgs-unstable; [ tree-sitter + (pkgs.stdenv.mkDerivation { + name = "editor-hax"; + src = ./.; + installPhase = '' + mkdir -p $out/bin + cp ./editor-hax.py $out/bin/editor-hax + ''; + }) ]; }; diff --git a/programs/nvim/keys.nix b/programs/nvim/keys.nix index 4a9d4b3..4322b43 100644 --- a/programs/nvim/keys.nix +++ b/programs/nvim/keys.nix @@ -24,6 +24,7 @@ in # pickers (luamap "n" "" "${telescope}.find_files()") (luamap "n" "f" "${telescope}.live_grep()") + (luamap "n" "F" "${telescope}.find_files()") (luamap "n" "t" "${telescope}.lsp_document_symbols()") (luamap "n" "T" "${telescope}.lsp_dynamic_workspace_symbols()") (luamap "n" "/" "${telescope}.current_buffer_fuzzy_find()") diff --git a/programs/nvim/plugins.nix b/programs/nvim/plugins.nix index a8c5a92..74a5338 100644 --- a/programs/nvim/plugins.nix +++ b/programs/nvim/plugins.nix @@ -158,6 +158,7 @@ in }; }; }; + rainbow-delimiters.enable = true; vim-surround.enable = true; lsp-format.enable = true; @@ -179,6 +180,9 @@ in settings = { completion.completeopt = "noselect"; preselect = "None"; + view.entries = { + selection_order = "near_cursor"; + }; sources = let @@ -727,6 +731,7 @@ in ui-select.enable = true; fzf-native.enable = true; frecency.enable = true; + # ast-grep.enable = true; }; settings = { @@ -739,11 +744,17 @@ in "^target/" ]; defaults = { - path_display = [ "smart" ]; + path_display = { + "filename_first" = { + reverse_directories = true; + }; + }; + dynamic_preview_title = true; layout_strategy = "flex"; layout_config = { width = 0.99; height = 0.99; + prompt_position = "top"; }; }; }; diff --git a/programs/ssh.nix b/programs/ssh.nix index fca7d4c..3192892 100644 --- a/programs/ssh.nix +++ b/programs/ssh.nix @@ -5,6 +5,7 @@ inputs@{ machine, ... }: inherit inputs; requirements = [ "cli" ]; home-config = _: { + programs.mosh.enable = true; programs.ssh = { enable = true; enableDefaultConfig = false; diff --git a/programs/xdg.nix b/programs/xdg/default.nix similarity index 51% rename from programs/xdg.nix rename to programs/xdg/default.nix index 2910559..f0b35d8 100644 --- a/programs/xdg.nix +++ b/programs/xdg/default.nix @@ -25,86 +25,7 @@ let signal = [ "signal.desktop" ]; }; - mimeMap = { - text = [ - "text/rust" - "text/plain" - "text/english" - "application/x-zerosize" - "text/x-makefile" - "text/x-c++hdr" - "text/x-c++src" - "text/x-chdr" - "text/x-csrc" - "text/x-java" - "text/x-moc" - "text/x-pascal" - "text/x-tcl" - "text/x-tex" - "application/x-shellscript" - "text/x-c" - "text/x-c++" - ]; - image = [ - "image/bmp" - "image/gif" - "image/jpeg" - "image/jpg" - "image/png" - "image/svg+xml" - "image/tiff" - "image/vnd.microsoft.icon" - "image/webp" - ]; - audio = [ - "audio/aac" - "audio/mpeg" - "audio/ogg" - "audio/opus" - "audio/wav" - "audio/webm" - "audio/x-matroska" - ]; - video = [ - "video/mp2t" - "video/mp4" - "video/mpeg" - "video/ogg" - "video/webm" - "video/x-flv" - "video/x-matroska" - "video/x-msvideo" - ]; - directory = [ "inode/directory" ]; - mail = [ "x-scheme-handler/mailto" ]; - calendar = [ - "text/calendar" - "x-scheme-handler/webcal" - ]; - browser = [ - "text/html" - "x-scheme-handler/about" - "x-scheme-handler/http" - "x-scheme-handler/https" - "x-scheme-handler/unknown" - ]; - office = [ - "application/vnd.oasis.opendocument.text" - "application/vnd.oasis.opendocument.spreadsheet" - "application/vnd.oasis.opendocument.presentation" - "application/vnd.openxmlformats-officedocument.wordprocessingml.document" - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - "application/vnd.openxmlformats-officedocument.presentationml.presentation" - "application/msword" - "application/vnd.ms-excel" - "application/vnd.ms-powerpoint" - "application/rtf" - ]; - pdf = [ "application/pdf" ]; - ebook = [ "application/epub+zip" ]; - magnet = [ "x-scheme-handler/magnet" ]; - signal = [ "signal.desktop" ]; - }; + mimeMap = import ./mimemap.nix; associations = with inputs.lib; @@ -123,8 +44,10 @@ in inherit inputs; requirements = [ ]; home-config = - { config, ... }: + { config, pkgs, ... }: { + home.packages = with pkgs; [ xdg-utils ]; + xdg = { enable = true; mime.enable = true; diff --git a/programs/xdg/mimemap.nix b/programs/xdg/mimemap.nix new file mode 100644 index 0000000..1e6b644 --- /dev/null +++ b/programs/xdg/mimemap.nix @@ -0,0 +1,80 @@ +{ + text = [ + "text/rust" + "text/plain" + "text/english" + "application/x-zerosize" + "text/x-makefile" + "text/x-c++hdr" + "text/x-c++src" + "text/x-chdr" + "text/x-csrc" + "text/x-java" + "text/x-moc" + "text/x-pascal" + "text/x-tcl" + "text/x-tex" + "application/x-shellscript" + "text/x-c" + "text/x-c++" + ]; + image = [ + "image/bmp" + "image/gif" + "image/jpeg" + "image/jpg" + "image/png" + "image/svg+xml" + "image/tiff" + "image/vnd.microsoft.icon" + "image/webp" + ]; + audio = [ + "audio/aac" + "audio/mpeg" + "audio/ogg" + "audio/opus" + "audio/wav" + "audio/webm" + "audio/x-matroska" + ]; + video = [ + "video/mp2t" + "video/mp4" + "video/mpeg" + "video/ogg" + "video/webm" + "video/x-flv" + "video/x-matroska" + "video/x-msvideo" + ]; + directory = [ "inode/directory" ]; + mail = [ "x-scheme-handler/mailto" ]; + calendar = [ + "text/calendar" + "x-scheme-handler/webcal" + ]; + browser = [ + "text/html" + "x-scheme-handler/about" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/unknown" + ]; + office = [ + "application/vnd.oasis.opendocument.text" + "application/vnd.oasis.opendocument.spreadsheet" + "application/vnd.oasis.opendocument.presentation" + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + "application/msword" + "application/vnd.ms-excel" + "application/vnd.ms-powerpoint" + "application/rtf" + ]; + pdf = [ "application/pdf" ]; + ebook = [ "application/epub+zip" ]; + magnet = [ "x-scheme-handler/magnet" ]; + signal = [ "signal.desktop" ]; +} diff --git a/server exited unexpectedly b/server exited unexpectedly new file mode 100644 index 0000000..c29f9e9 --- /dev/null +++ b/server exited unexpectedly @@ -0,0 +1 @@ +Ptmux;_Ga=d,q=2,d=a\\ \ No newline at end of file