mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat: resolve nix-darwin changes
This commit is contained in:
parent
4b986433a3
commit
2bf645b787
11 changed files with 185 additions and 73 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{ config, ... }: {
|
||||
homebrew = {
|
||||
enable = true;
|
||||
onActivation.upgrade = true;
|
||||
cleanup = "zap";
|
||||
brews = [
|
||||
"mas"
|
||||
|
|
|
|||
119
darwin/gui.nix
Normal file
119
darwin/gui.nix
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
{ config, pkgs, lib, ... }: with lib; {
|
||||
services = {
|
||||
yabai = {
|
||||
enable = true;
|
||||
enableScriptingAddition = true;
|
||||
config = {
|
||||
layout = "bsp";
|
||||
auto_balance = "on";
|
||||
split_ratio = "0.50";
|
||||
window_placement = "second_child";
|
||||
window_gap = 18;
|
||||
top_padding = 36;
|
||||
bottom_padding = 18;
|
||||
left_padding = 18;
|
||||
right_padding = 18;
|
||||
window_shadow = "on";
|
||||
window_border = "off";
|
||||
window_border_width = 3;
|
||||
window_opacity = "on";
|
||||
window_opacity_duration = "0.1";
|
||||
active_window_opacity = "1.0";
|
||||
normal_window_opacity = "1.0";
|
||||
mouse_modifier = "cmd";
|
||||
mouse_action1 = "move";
|
||||
mouse_action2 = "resize";
|
||||
mouse_drop_action = "swap";
|
||||
};
|
||||
extraConfig = ''
|
||||
yabai -m rule --add app='Firefox' manage=on
|
||||
yabai -m rule --add app='System Preferences' manage=off
|
||||
yabai -m rule --add app='Activity Monitor' manage=off
|
||||
'';
|
||||
};
|
||||
spacebar = {
|
||||
enable = true;
|
||||
package = pkgs.spacebar;
|
||||
config = {
|
||||
position = "top";
|
||||
height = 28;
|
||||
title = "off";
|
||||
spaces = "on";
|
||||
power = "on";
|
||||
clock = "on";
|
||||
right_shell = "on";
|
||||
padding_left = 20;
|
||||
padding_right = 20;
|
||||
spacing_left = 25;
|
||||
spacing_right = 25;
|
||||
text_font = ''"Menlo:16.0"'';
|
||||
icon_font = ''"Menlo:16.0"'';
|
||||
background_color = "0xff161616";
|
||||
foreground_color = "0xffFFFFFF";
|
||||
space_icon_color = "0xff3ddbd9";
|
||||
power_icon_strip = " ";
|
||||
space_icon_strip = "一 二 三 四 五 六 七 八 九 十";
|
||||
spaces_for_all_displays = "on";
|
||||
display_separator = "on";
|
||||
display_separator_icon = "|";
|
||||
clock_format = ''"%d/%m/%y %R"'';
|
||||
right_shell_icon = " ";
|
||||
right_shell_command = "whoami";
|
||||
};
|
||||
};
|
||||
skhd = {
|
||||
enable = true;
|
||||
package = pkgs.skhd;
|
||||
skhdConfig = ''
|
||||
# open terminal
|
||||
cmd - return : wezterm
|
||||
|
||||
# focus window
|
||||
lalt - h : yabai -m window --focus west
|
||||
lalt - j : yabai -m window --focus south
|
||||
lalt - k : yabai -m window --focus north
|
||||
lalt - l : yabai -m window --focus east
|
||||
|
||||
# swap managed window
|
||||
shift + lalt - h : yabai -m window --swap west
|
||||
shift + lalt - l : yabai -m window --swap east
|
||||
shift + lalt - j : yabai -m window --swap south
|
||||
shift + lalt - k : yabai -m window --swap north
|
||||
|
||||
# focus spaces
|
||||
alt - x : yabai -m space --focus recent
|
||||
alt - 1 : yabai -m space --focus 1
|
||||
alt - 2 : yabai -m space --focus 2
|
||||
alt - 3 : yabai -m space --focus 3
|
||||
alt - 4 : yabai -m space --focus 4
|
||||
alt - 5 : yabai -m space --focus 5
|
||||
alt - 6 : yabai -m space --focus 6
|
||||
alt - 7 : yabai -m space --focus 7
|
||||
alt - 8 : yabai -m space --focus 8
|
||||
|
||||
# focus on next/prev space
|
||||
alt + ctrl - q : yabai -m space --focus prev
|
||||
alt + ctrl - e : yabai -m space --focus next
|
||||
|
||||
# send window to desktop
|
||||
shift + alt - x : yabai -m window --space recent
|
||||
shift + alt - 1 : yabai -m window --space 1
|
||||
shift + alt - 2 : yabai -m window --space 2
|
||||
shift + alt - 3 : yabai -m window --space 3
|
||||
shift + alt - 4 : yabai -m window --space 4
|
||||
shift + alt - 5 : yabai -m window --space 5
|
||||
shift + alt - 6 : yabai -m window --space 6
|
||||
shift + alt - 7 : yabai -m window --space 7
|
||||
shift + alt - 8 : yabai -m window --space 8
|
||||
|
||||
# float / unfloat window and center on screen
|
||||
lalt - t : yabai -m window --toggle float;\
|
||||
yabai -m window --grid 4:4:1:1:2:2
|
||||
|
||||
# toggle window zoom
|
||||
lalt - d : yabai -m window --toggle zoom-parent
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -64,9 +64,12 @@
|
|||
"kicad"
|
||||
"disk-inventory-x"
|
||||
"element"
|
||||
"dozer"
|
||||
"discord"
|
||||
"firefox"
|
||||
"gimp"
|
||||
"devtoys"
|
||||
"google-assistant"
|
||||
"cyberduck"
|
||||
"docker"
|
||||
"google-chrome"
|
||||
|
|
@ -79,6 +82,9 @@
|
|||
];
|
||||
masApps = {
|
||||
Tailscale = 1475387142;
|
||||
Dato = 1470584107;
|
||||
Lungo = 1263070803;
|
||||
"Battery Indicator" = 1206020918;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
24
flake.lock
generated
24
flake.lock
generated
|
|
@ -3,11 +3,11 @@
|
|||
"arcexprs": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1663355656,
|
||||
"narHash": "sha256-3unrNbVJR+s764pWKibdbKyf6g5IWng/sjpvLqiMlIU=",
|
||||
"lastModified": 1664324035,
|
||||
"narHash": "sha256-X/aULANyF9pHR+OejllcIG1vSs4H0sis5212dt6i/Xo=",
|
||||
"owner": "arcnmx",
|
||||
"repo": "nixexprs",
|
||||
"rev": "6fee134fe6ff18c3e59d24718c9f3193616a3f18",
|
||||
"rev": "6b308153ddc58f1ed5e3223cb242ac4867ef5712",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -41,11 +41,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1663492236,
|
||||
"narHash": "sha256-KzgrcFVhv/Ca7m83SaijE0W+tLHzjoypHZm9gHGS+cY=",
|
||||
"lastModified": 1664210064,
|
||||
"narHash": "sha256-df6nKVZe/yAhmJ9csirTPahc0dldwm3HBhCVNA6qWr0=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "de4d41ee9fd12a60236c1f35cead7c511dac08eb",
|
||||
"rev": "02d2551c927b7d65ded1b3c7cd13da5cc7ae3fcf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -373,11 +373,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1663357389,
|
||||
"narHash": "sha256-oYA2nVRSi6yhCBqS5Vz465Hw+3BQOVFEhfbfy//3vTs=",
|
||||
"lastModified": 1664281702,
|
||||
"narHash": "sha256-haixZ4TJLu1Dciow54wrHrHvlGDVr5sW6MTeAV/ZLuI=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "da6a05816e7fa5226c3f61e285ef8d9dfc868f3c",
|
||||
"rev": "7e52b35fe98481a279d89f9c145f8076d049d2b9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -405,11 +405,11 @@
|
|||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1663522399,
|
||||
"narHash": "sha256-R8oLUcqp98/S4t+g7rkMLI8guwnk5QQpIN2X1Rf7k74=",
|
||||
"lastModified": 1664382743,
|
||||
"narHash": "sha256-rtDxdzj5IBvO114QP9gyfjVt9N7tZWd0e2/RQxrDtw4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nur",
|
||||
"rev": "795eb7eca811fac12c1b5c8661d7408a3ac9495f",
|
||||
"rev": "8ca43145e3b31861d807c8df3ce53f559c3b5762",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gitAndTools.gitRemoteGcrypt
|
||||
gitAndTools.git-remote-gcrypt
|
||||
git-crypt
|
||||
git-revise
|
||||
];
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
xdg.configFile."wezterm/wezterm.lua".text = ''
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
check_for_updates = true,
|
||||
enable_tab_bar = true,
|
||||
font = wezterm.font "${config.kw.theme.font.termName}",
|
||||
font_size = ${toString config.kw.theme.font.size},
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.security.pam;
|
||||
|
||||
# Implementation Notes
|
||||
#
|
||||
# We don't use `environment.etc` because this would require that the user manually delete
|
||||
# `/etc/pam.d/sudo` which seems unwise given that applying the nix-darwin configuration requires
|
||||
# sudo. We also can't use `system.patchs` since it only runs once, and so won't patch in the
|
||||
# changes again after OS updates (which remove modifications to this file).
|
||||
#
|
||||
# As such, we resort to line addition/deletion in place using `sed`. We add a comment to the
|
||||
# added line that includes the name of the option, to make it easier to identify the line that
|
||||
# should be deleted when the option is disabled.
|
||||
mkSudoTouchIdAuthScript = isEnabled:
|
||||
let
|
||||
file = "/etc/pam.d/sudo";
|
||||
option = "security.pam.enableSudoTouchIdAuth";
|
||||
in ''
|
||||
${if isEnabled then ''
|
||||
# Enable sudo Touch ID authentication, if not already enabled
|
||||
if ! grep 'pam_tid.so' ${file} > /dev/null; then
|
||||
sed -i "" '2i\
|
||||
auth sufficient pam_tid.so # nix-darwin: ${option}
|
||||
' ${file}
|
||||
fi
|
||||
'' else ''
|
||||
# Disable sudo Touch ID authentication, if added by nix-darwin
|
||||
if grep '${option}' ${file} > /dev/null; then
|
||||
sed -i "" '/${option}/d' ${file}
|
||||
fi
|
||||
''}
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
security.pam.enableSudoTouchIdAuth = mkEnableOption ''
|
||||
Enable sudo authentication with Touch ID
|
||||
When enabled, this option adds the following line to /etc/pam.d/sudo:
|
||||
auth sufficient pam_tid.so
|
||||
(Note that macOS resets this file when doing a system update. As such, sudo
|
||||
authentication with Touch ID won't work after a system update until the nix-darwin
|
||||
configuration is reapplied.)
|
||||
'';
|
||||
};
|
||||
|
||||
config = {
|
||||
system.activationScripts.extraActivation.text = ''
|
||||
# PAM settings
|
||||
echo >&2 "setting up pam..."
|
||||
${mkSudoTouchIdAuthScript cfg.enableSudoTouchIdAuth}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"automation":"automations.yaml","config":null,"counter":null,"dhcp":null,"device_tracker":[{"platform":"luci","host":"192.168.1.1","username":"root","password":"suitable-anemia-boggle","new_device_defaults":{"track_new_devices":true}}],"energy":null,"frontend":{"themes":"themes"},"group":"groups.yaml","google_assistant":{"project_id":"integration-9e79d","service_account":"integration-9e79d-a60665a0b920.json"},"http":{"cors_allowed_origins":["https://google.com","https://www.home-assistant.io"],"use_x_forwarded_for":true,"trusted_proxies":["127.0.0.0/24","200::/7"]},"history":null,"image":null,"input_boolean":null,"input_datetime":null,"input_number":null,"input_select":null,"input_text":null,"logbook":null,"logger":{"default":"info"},"map":null,"media_source":null,"mobile_app":null,"my":null,"person":null,"scene":"scenes.yaml","script":"scripts.yaml","ssdp":null,"switch":[{"platform":"wake_on_lan","mac":"00:D8:61:C7:F4:9D"}],"stream":null,"sun":null,"system_health":null,"tag":null,"template":null,"timer":null,"webhook":null,"wake_on_lan":null,"zeroconf":null,"zone":null,"recorder":{"auto_purge":true,"purge_keep_days":14,"commit_interval":1,"exclude":{"domains":["automation","updater"],"entity_globs":["sensor.weather_*","sensor.date_*"],"entities":["sun.sun","sensor.last_boot","sensor.date","sensor.time"],"event_types":["call_service"]}},"tts":[{"platform":"google_translate","service_name":"google_say"}],"homeassistant":{"packages":"packages","customize":"customize.yaml","external_url":"https://home.kittywit.ch"}}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
final: prev: {
|
||||
irlsite = final.callPackage ./irlsite.nix { };
|
||||
vips = prev.vips.override { libjxl = null; };
|
||||
yabai = final.callPackage ./yabai.nix { };
|
||||
sway-scrot = final.callPackage ./sway-scrot { };
|
||||
vfio-vm = final.callPackage ./vm.nix { };
|
||||
vfio-vm-pinning = final.callPackage ./vm-pinning.nix { };
|
||||
|
|
|
|||
43
overlays/local/yabai.nix
Normal file
43
overlays/local/yabai.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ lib, stdenv, fetchFromGitHub, darwin, xcbuild, xxd }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "yabai";
|
||||
version = "5.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "koekeishiya";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-5WtWLfiWVOqshbsx50fuEv8ab3U0y6z5+yvXoxpLokU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
darwin.xcode_12_3
|
||||
xcbuild
|
||||
xxd
|
||||
];
|
||||
|
||||
buildInputs = with darwin.apple_sdk.frameworks; [
|
||||
Carbon
|
||||
Cocoa
|
||||
ScriptingBridge
|
||||
SkyLight
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share/man/man1/
|
||||
cp ./bin/yabai $out/bin/yabai
|
||||
cp ./doc/yabai.1 $out/share/man/man1/yabai.1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = ''
|
||||
A tiling window manager for macOS based on binary space partitioning
|
||||
'';
|
||||
homepage = "https://github.com/koekeishiya/yabai";
|
||||
platforms = platforms.darwin;
|
||||
maintainers = with maintainers; [ cmacrae shardy kittywitch ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
2
tf
2
tf
|
|
@ -1 +1 @@
|
|||
Subproject commit 19085b061685d726090c2b5fdc3afe536ad43dd7
|
||||
Subproject commit 856827e23fd7f1ef1d07dea9c5be26c0a0f7dee8
|
||||
Loading…
Add table
Add a link
Reference in a new issue