Skip to content

Commit

Permalink
hosts/risc: hello yabai again...
Browse files Browse the repository at this point in the history
  • Loading branch information
moni-dz committed Dec 10, 2024
1 parent f97b4a4 commit 53ce1aa
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 25 deletions.
64 changes: 54 additions & 10 deletions hosts/riscake/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
config,
lib,
pkgs,
system,
self,
inputs,
inputs',
...
{ config
, lib
, pkgs
, system
, self
, inputs
, inputs'
, ...
}:

{
Expand All @@ -18,7 +17,52 @@
};
};

services.nix-daemon.enable = true;
services = {
nix-daemon.enable = true;

skhd = {
enable = true;

skhdConfig =
let
spaces = map toString (lib.range 1 5);
ws = n: "cmd - ${n} : yabai -m space --focus ${n}";
move = n: "shift + cmd - ${n} : yabai -m window --space ${n}; yabai -m space --focus ${n}";
in
''
cmd - return : open -na ghostty
''
+ lib.optionalString config.services.yabai.enable ''
cmd - e : yabai -m window --toggle zoom-fullscreen
shift + cmd - e : yabai -m window --toggle float --grid 4:4:1:1:2:2
''
+ lib.optionalString config.services.yabai.enable (lib.concatLines (map move spaces));
};

yabai = {
enable = true;
enableScriptingAddition = true;

config = let gap = 8; in
{
layout = "bsp";
mouse_follows_focus = "off";
top_padding = gap;
bottom_padding = gap;
left_padding = gap;
right_padding = gap;
window_gap = gap;
window_placement = "second_child";
window_shadow = "float";
};

extraConfig = ''
yabai -m rule --add app='System Settings' manage=off
yabai -m rule --add app='Finder' manage=off
'';
};
};

programs.fish.enable = true;
security.pam.enableSudoTouchIdAuth = true;

Expand Down
2 changes: 1 addition & 1 deletion modules/shared/home-manager/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
programs = {
dircolors = {
enable = true;
enable = false;
enableFishIntegration = config.programs.fish.enable;

extraConfig = __readFile (
Expand Down
39 changes: 25 additions & 14 deletions users/moni/home.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
config,
inputs',
pkgs,
...
{ config
, inputs'
, pkgs
, ...
}:

/*
Expand All @@ -15,20 +14,32 @@
home = {
packages = __attrValues {
inherit (pkgs)
fanbox-dl
curl
nix-output-monitor
parallel
fd
ripgrep
jq
pfetch
nixd
nil
sapling
;
};
};

xdg.configFile."ghostty/testing.glsl".text = ''
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
vec2 uv = fragCoord.xy / iResolution.xy;
vec3 gradientStartColor = vec3(0.188,0.204,0.275);
vec3 gradientEndColor = vec3(0.067,0.067,0.106);
float mixValue = distance(uv, vec2(0.25, 0.5));
vec3 gradientColor = mix(gradientStartColor, gradientEndColor, mixValue);
vec4 terminalColor = texture(iChannel0, uv);
float mask = 1.0 - step(0.5, dot(terminalColor.rgb, vec3(1.0)));
vec3 blendedColor = mix(terminalColor.rgb, gradientColor, mask);
fragColor = vec4(blendedColor, terminalColor.a);
}
'';

programs = {
fish = {
interactiveShellInit = ''
Expand All @@ -43,17 +54,17 @@
end
. ${config.age.secrets.tokens.path}
. /Users/moni/.local/share/miniconda/etc/fish/conf.d/conda.fish
# . /Users/moni/.local/share/miniconda/etc/fish/conf.d/conda.fish
'';

shellInit = ''
fish_add_path /Users/moni/Library/Python/3.11/bin
fish_add_path -m /Users/moni/.local/share/miniconda/bin
fish_add_path -amP /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/bin
# fish_add_path /Users/moni/Library/Python/3.11/bin
# fish_add_path -m /Users/moni/.local/share/miniconda/bin
# fish_add_path -amP /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/bin
fish_add_path -amP /usr/bin
fish_add_path -amP /opt/homebrew/bin
fish_add_path -amP /Users/moni/.modular/bin
fish_add_path -amP /usr/local/smlnj/bin
# fish_add_path -amP /usr/local/smlnj/bin
fish_add_path -amP /opt/local/bin
fish_add_path -amP /opt/homebrew/opt/llvm/bin
fish_add_path -amP /Users/moni/.local/share/modular/pkg/packages.modular.com_mojo/bin
Expand Down

0 comments on commit 53ce1aa

Please sign in to comment.