diff --git a/flake.lock b/flake.lock index 654274a..c72af2d 100644 --- a/flake.lock +++ b/flake.lock @@ -137,11 +137,11 @@ ] }, "locked": { - "lastModified": 1693905783, - "narHash": "sha256-ALIQLAzTJ6iy46U7tL62Nxd7247683kOR6TlSU6PXhU=", + "lastModified": 1694069327, + "narHash": "sha256-Si2otUNjCe8kY5nsV7tILi4PsI0odBFrdSu8cCjn/eQ=", "owner": "nix-community", "repo": "disko", - "rev": "b2ea7d62581fa50d3e19a949b85fe04c1e8d7384", + "rev": "7bee8de8e6755506c70323b864a884f9624cc23a", "type": "github" }, "original": { @@ -491,11 +491,11 @@ ] }, "locked": { - "lastModified": 1693859358, - "narHash": "sha256-r3Pak/ao3p8weTzR+Ry3qQrfRsmSOwWW5sAe73mrYKs=", + "lastModified": 1693972774, + "narHash": "sha256-Dt9UZs0/DaIex598quYRYFuGabUbvFdNrHuvGc6HjBc=", "owner": "nix-community", "repo": "home-manager", - "rev": "886ea1d213efd1082f419d066e89ef37635dc970", + "rev": "b22d7bab30076bbb73744867d6c5bf7d6380570c", "type": "github" }, "original": { @@ -514,11 +514,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1693896527, - "narHash": "sha256-jZ2J+2Qq+paM+Gva2AGK0eqoRpkLYbnSzbZhzJRnftk=", + "lastModified": 1694074322, + "narHash": "sha256-5JIwHRW/JCKNR5lD+LXi18dDVaGZ5Y4GABIK9JiDQbI=", "owner": "neovim", "repo": "neovim", - "rev": "6abc608445745e7e8def2aabf57c7a0c26b8a485", + "rev": "131a1ee82d15ce9d1356a46117c9a1651947d4b8", "type": "github" }, "original": { @@ -539,11 +539,11 @@ "weewx-proxy-flake": "weewx-proxy-flake" }, "locked": { - "lastModified": 1693902068, - "narHash": "sha256-MYZ52Wh/6GXWmGDY66JdOd59WEzGuTKlTvqqZYeYtw4=", + "lastModified": 1694074799, + "narHash": "sha256-fgLoGXgBdN10d/GiHoHrTJTP2kdwP+DzO+p6qthc/QE=", "owner": "nifoc", "repo": "nix-overlay", - "rev": "178f5895c1ddb3a6c8caf8c3d1459f5b0a02dca0", + "rev": "c4f91cae530aadf7ca1b6aa58ba7e7f469b12707", "type": "github" }, "original": { @@ -590,11 +590,11 @@ }, "nixos-stable": { "locked": { - "lastModified": 1693771906, - "narHash": "sha256-32EnPCaVjOiEERZ+o/2Ir7JH9pkfwJZJ27SKHNvt4yk=", + "lastModified": 1693953029, + "narHash": "sha256-1+28KQl4YC4IBzKo/epvEyK5KH4MlgoYueJ8YwLGbOc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "da5adce0ffaff10f6d0fee72a02a5ed9d01b52fc", + "rev": "4077a0e4ac3356222bc1f0a070af7939c3098535", "type": "github" }, "original": { @@ -606,11 +606,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1693844670, - "narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=", + "lastModified": 1694032533, + "narHash": "sha256-I8cfCV/4JNJJ8KHOTxTU1EphKT8ARSb4s9pq99prYV0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1", + "rev": "efd23a1c9ae8c574e2ca923c2b2dc336797f4cc4", "type": "github" }, "original": { diff --git a/home/programs/nvim/plugins.nix b/home/programs/nvim/plugins.nix index 24ab514..9b92608 100644 --- a/home/programs/nvim/plugins.nix +++ b/home/programs/nvim/plugins.nix @@ -118,12 +118,12 @@ in }; nvim-treesitter = buildVimPluginFrom2Nix { pname = "nvim-treesitter"; - version = "2023-09-05"; + version = "2023-09-07"; src = fetchFromGitHub { owner = "nvim-treesitter"; repo = "nvim-treesitter"; - rev = "95d02cdafe704fa5b86eac81f2eb1de3d8f52330"; - sha256 = "0qjm772883hy9k6ys5a0nn8kwkfi5y79bd9ckd2jh0d10pxmw50l"; + rev = "80b4fa7970ee159e5c2c715bbcd386143c48dcb1"; + sha256 = "0mzip875xxiq6yci7r2iral0d8yjnkw0svifjrqd51vg9vwim4r0"; fetchSubmodules = false; }; }; @@ -242,12 +242,12 @@ in }; nvim-lspconfig = buildVimPluginFrom2Nix { pname = "nvim-lspconfig"; - version = "2023-09-05"; + version = "2023-09-06"; src = fetchFromGitHub { owner = "neovim"; repo = "nvim-lspconfig"; - rev = "499314f76fa6e8f82f7cfd116578906d61ba2560"; - sha256 = "131a1f8cvsilrlbywhiyhanzkh4y17fcl60b0bmp4sdmafwfwkrf"; + rev = "0517d8522dcec286b1dba47aa3ee1ed8f523aed6"; + sha256 = "001s4pz7ppdm2lmyl86x04ks8kqdaxqdwkdlqkvp1dq0hhvmyx70"; fetchSubmodules = false; }; }; @@ -297,12 +297,12 @@ in }; nvim-lint = buildVimPluginFrom2Nix { pname = "nvim-lint"; - version = "2023-08-27"; + version = "2023-09-07"; src = fetchFromGitHub { owner = "mfussenegger"; repo = "nvim-lint"; - rev = "9b6cb72660114e5f188907be0d866a8ca2b0ef23"; - sha256 = "09j1q2ajav4vxcgd2a5i0i3g72j4y8j7amqx08ss9l9mw7j1lgjc"; + rev = "de5b36579c572325dc8142b7a8ecfff8e69f4e3a"; + sha256 = "1r2aq778nsri65fq67wx91g5i06mi53v34ypn0n5hn4vqqjfzr9v"; fetchSubmodules = false; }; }; @@ -440,12 +440,12 @@ in }; core-nvim = buildVimPluginFrom2Nix { pname = "core.nvim"; - version = "2023-07-18"; + version = "2023-09-07"; src = fetchFromGitHub { owner = "niuiic"; repo = "core.nvim"; - rev = "d0843388db6a6747ec1a1c2aea873da0efca2cac"; - sha256 = "0b47bsbwd1f0635r6jzsmp2d449cxgir93p50hbqlzn25kfvw43q"; + rev = "d33d153dd86c440b2bee19514a0f813d3d9f00f3"; + sha256 = "131by2i8yaplmra7dckkz3nzwdr4gv0y7pkj5n1v000a2vb34qjp"; fetchSubmodules = false; }; }; @@ -550,12 +550,12 @@ in }; toggleterm-nvim = buildVimPluginFrom2Nix { pname = "toggleterm.nvim"; - version = "2023-08-03"; + version = "2023-09-07"; src = fetchFromGitHub { owner = "akinsho"; repo = "toggleterm.nvim"; - rev = "12cba0a1967b4f3f31903484dec72a6100dcf515"; - sha256 = "1mlwncnnsp3skzszc544rbpx024im1p52k2pwvqlvwdjn46ffm2l"; + rev = "f2c720746238bc3ec620fe4bf92b58368317c266"; + sha256 = "0npiya5wazgp94qjzz4csndbm9d7k35p78h32p2mfd6lm6my6202"; fetchSubmodules = false; }; }; @@ -572,23 +572,23 @@ in }; gitsigns-nvim = buildVimPluginFrom2Nix { pname = "gitsigns.nvim"; - version = "2023-09-02"; + version = "2023-09-07"; src = fetchFromGitHub { owner = "lewis6991"; repo = "gitsigns.nvim"; - rev = "d927caa075df63bf301d92f874efb72fd22fd3b4"; - sha256 = "0vi81r4sj03ydjckpxi9s0w4qhd8lyx8xvl87ym6fp0kalk01vfa"; + rev = "983f1a216cca1a079399ba050bc4b9ce130de83a"; + sha256 = "1hlzabdgcja1nps0iiic38aq4fdvm7lynyd4l7ki63zsxqwqdag3"; fetchSubmodules = false; }; }; nui-nvim = buildVimPluginFrom2Nix { pname = "nui.nvim"; - version = "2023-08-29"; + version = "2023-09-06"; src = fetchFromGitHub { owner = "MunifTanjim"; repo = "nui.nvim"; - rev = "aa1b4c1e05983ff7debd2b4b2788651db099de2f"; - sha256 = "1ray6dk61n1g0vjfvdp9ln98pmf54gjrwrffazfv2gwbwllkj9jf"; + rev = "c8de23342caf8d50b15d6b28368d36a56a69d76f"; + sha256 = "0na7mi192alj1pyskdyivn12a0nmcmzy79kmqxyz8r1cijgb33q2"; fetchSubmodules = false; }; }; diff --git a/home/programs/wezterm.nix b/home/programs/wezterm.nix index fd152c7..34ce7b1 100644 --- a/home/programs/wezterm.nix +++ b/home/programs/wezterm.nix @@ -1,10 +1,13 @@ { pkgs, ... }: +let + wezterm-pkg = pkgs.wezterm; +in { programs.wezterm = { enable = true; - package = pkgs.wezterm; + package = wezterm-pkg; extraConfig = '' _G.shells = { diff --git a/system/darwin/skhd.nix b/system/darwin/skhd.nix new file mode 100644 index 0000000..ca83f32 --- /dev/null +++ b/system/darwin/skhd.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: + +let + wezterm-pkg = pkgs.wezterm; + wezterm-app = "${wezterm-pkg}/Applications/WezTerm.app"; + wezterm-cli = "${wezterm-pkg}/bin/wezterm"; + + yabai-bin = "${pkgs.yabai}/bin/yabai"; + jq-bin = "${pkgs.jq}/bin/jq"; + + script-open-wezterm = pkgs.writeShellScript "skhd-open-wezterm.sh" '' + if pgrep "wezterm-gui" >/dev/null 2>&1; then + ${wezterm-cli} cli spawn + wezterm_id="$(${yabai-bin} -m query --windows | ${jq-bin} '.[] | select(.app == "WezTerm") | .id')" + ${yabai-bin} -m window --focus "$wezterm_id" + else + open ${wezterm-app} + fi + ''; +in +{ + environment.systemPackages = [ pkgs.skhd ]; + + services.skhd = { + enable = true; + + skhdConfig = '' + cmd - return : ${script-open-wezterm} + ''; + }; +} diff --git a/system/darwin/yabai.nix b/system/darwin/yabai.nix new file mode 100644 index 0000000..ad56519 --- /dev/null +++ b/system/darwin/yabai.nix @@ -0,0 +1,74 @@ +{ pkgs, ... }: + +let + yabai-pkg = pkgs.yabai; + yabai-bin = "${yabai-pkg}/bin/yabai"; + jq-bin = "${pkgs.jq}/bin/jq"; + + script-cycle-clockwise = pkgs.writeShellScript "yabai-cycle-clockwise.sh" '' + win=$(${yabai-bin} -m query --windows --window last | ${jq-bin} '.id') + + while : ; do + ${yabai-bin} -m window $win --swap prev &> /dev/null + if [[ $? -eq 1 ]]; then + break + fi + done + ''; +in +{ + services.yabai = { + enable = true; + enableScriptingAddition = false; + package = yabai-pkg; + + config = { + layout = "bsp"; + window_placement = "second_child"; + top_padding = 5; + bottom_padding = 5; + left_padding = 5; + right_padding = 5; + window_gap = 5; + }; + + extraConfig = '' + yabai -m rule --add app='^Mona$' manage=off + yabai -m rule --add app='^System.*einstellungen$' manage=off + + yabai -m signal --add event=window_created action=' + yabai -m query --windows --window $YABAI_WINDOW_ID | ${jq-bin} -er ".\"can-resize\" or .\"is-floating\"" || \ + yabai -m window $YABAI_WINDOW_ID --toggle float + ' + ''; + }; + + services.skhd.skhdConfig = '' + alt + shift - h : ${yabai-bin} -m window --focus west + alt + shift - j : ${yabai-bin} -m window --focus south + alt + shift - k : ${yabai-bin} -m window --focus north + alt + shift - l : ${yabai-bin} -m window --focus east + + alt + shift - w : ${yabai-bin} -m display --focus west + alt + shift - e : ${yabai-bin} -m display --focus east + + meh - h : ${yabai-bin} -m window --swap west + meh - j : ${yabai-bin} -m window --swap south + meh - k : ${yabai-bin} -m window --swap north + meh - l : ${yabai-bin} -m window --swap east + meh - c : ${script-cycle-clockwise} + + meh - w : ${yabai-bin} -m window --display west; ${yabai-bin} -m display --focus west + meh - e : ${yabai-bin} -m window --display east; ${yabai-bin} -m display --focus east + + meh - f : ${yabai-bin} -m window --toggle zoom-fullscreen + + meh - g : ${yabai-bin} -m window --resize bottom:0:40 + meh - s : ${yabai-bin} -m window --resize bottom:0:-40 + + hyper - h : ${yabai-bin} -m window --warp west + hyper - j : ${yabai-bin} -m window --warp south + hyper - k : ${yabai-bin} -m window --warp north + hyper - l : ${yabai-bin} -m window --warp east + ''; +} diff --git a/system/hosts/Styx.nix b/system/hosts/Styx.nix index 9bb7569..0d624d3 100644 --- a/system/hosts/Styx.nix +++ b/system/hosts/Styx.nix @@ -3,10 +3,13 @@ ../shared/show-update-changelog.nix ../darwin/defaults.nix - #../darwin/fonts.nix ../darwin/sudo.nix + ../darwin/fish.nix ../darwin/attic.nix + + ../darwin/skhd.nix + ../darwin/yabai.nix ]; nix = {