add darwin stuff
This commit is contained in:
parent
e4c20f0163
commit
e0e24a42ad
23 changed files with 455 additions and 303 deletions
147
systems/aarch64-darwin/canis/default.nix
Normal file
147
systems/aarch64-darwin/canis/default.nix
Normal file
|
@ -0,0 +1,147 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
environment.variables.FLAKE = "/Users/marshall/nix-config";
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
font-awesome
|
||||
inter
|
||||
maple-mono
|
||||
nerdfonts
|
||||
];
|
||||
|
||||
networking = {
|
||||
computerName = "MacBook Air";
|
||||
hostName = "canis";
|
||||
};
|
||||
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
interval.Day = 7;
|
||||
};
|
||||
|
||||
daemonIOLowPriority = true;
|
||||
daemonProcessType = "Adaptive";
|
||||
distributedBuilds = true;
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
registry = lib.mapAttrs (_: v: {flake = v;}) inputs;
|
||||
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
builders-use-substitutes = true;
|
||||
extra-experimental-features = "nix-command flakes";
|
||||
flake-registry = "/etc/nix/registry.json";
|
||||
keep-derivations = true;
|
||||
keep-outputs = true;
|
||||
max-jobs = "auto";
|
||||
warn-dirty = false;
|
||||
extra-sandbox-paths = ["/nix/var/cache/ccache"];
|
||||
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
|
||||
trusted-substituters = [
|
||||
"cache.nixos.org"
|
||||
"nix-community.cachix.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
||||
];
|
||||
|
||||
trusted-users = ["marshall"];
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
programs = {
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.enableSudoTouchIdAuth = true;
|
||||
|
||||
services = {
|
||||
nix-daemon.enable = true;
|
||||
skhd = {
|
||||
enable = true;
|
||||
package = pkgs.skhd;
|
||||
|
||||
skhdConfig = ''
|
||||
alt - return : wezterm
|
||||
alt - w : open -na "Arc"
|
||||
|
||||
cmd - space : yabai -m window --toggle float
|
||||
|
||||
shift + cmd - q : yabai -m window --close
|
||||
|
||||
alt - h : yabai -m window --focus west
|
||||
alt - j : yabai -m window --focus south
|
||||
alt - k : yabai -m window --focus north
|
||||
alt - l : yabai -m window --focus east
|
||||
|
||||
shift + cmd - h : yabai -m window --swap west
|
||||
shift + cmd - j : yabai -m window --swap south
|
||||
shift + cmd - k : yabai -m window --swap north
|
||||
shift + cmd - l : yabai -m window --swap east
|
||||
|
||||
shift + cmd - 1 : yabai -m window --space 1
|
||||
shift + cmd - 2 : yabai -m window --space 2
|
||||
shift + cmd - 3 : yabai -m window --space 3
|
||||
shift + cmd - 4 : yabai -m window --space 4
|
||||
shift + cmd - 5 : yabai -m window --space 5
|
||||
shift + cmd - 6 : yabai -m window --space 6
|
||||
shift + cmd - 7 : yabai -m window --space 7
|
||||
shift + cmd - 8 : yabai -m window --space 8
|
||||
shift + cmd - 9 : yabai -m window --space 9
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
snowfallorg.users.marshall = {
|
||||
create = true;
|
||||
|
||||
home = {
|
||||
enable = true;
|
||||
|
||||
config = import ./home.nix {inherit lib pkgs inputs;};
|
||||
};
|
||||
};
|
||||
|
||||
users.users.marshall = {
|
||||
name = "marshall";
|
||||
home = "/Users/marshall";
|
||||
};
|
||||
|
||||
system = {
|
||||
keyboard.enableKeyMapping = true;
|
||||
|
||||
defaults = {
|
||||
NSGlobalDomain = {
|
||||
KeyRepeat = 1;
|
||||
NSAutomaticCapitalizationEnabled = false;
|
||||
NSAutomaticSpellingCorrectionEnabled = false;
|
||||
};
|
||||
|
||||
dock = {
|
||||
autohide = true;
|
||||
autohide-delay = 1000.0;
|
||||
expose-animation-duration = 0.0;
|
||||
orientation = "bottom";
|
||||
showhidden = true;
|
||||
tilesize = 48;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
74
systems/aarch64-darwin/canis/home.nix
Normal file
74
systems/aarch64-darwin/canis/home.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = with inputs; [
|
||||
nix-index-database.hmModules.nix-index
|
||||
catppuccin.homeManagerModules.catppuccin
|
||||
chaotic.homeManagerModules.default
|
||||
nix-colors.homeManagerModules.default
|
||||
];
|
||||
|
||||
home = {
|
||||
packages = with pkgs;
|
||||
[
|
||||
alejandra
|
||||
bit
|
||||
cargo-edit
|
||||
cargo-udeps
|
||||
cmake
|
||||
duf
|
||||
eternal-terminal
|
||||
grc
|
||||
huniq
|
||||
hurl
|
||||
igrep
|
||||
keybase
|
||||
keychain
|
||||
monolith
|
||||
nix-output-monitor
|
||||
nix-prefetch-scripts
|
||||
nixd
|
||||
nodePackages_latest.nodejs
|
||||
nurl
|
||||
pinentry_mac
|
||||
pkg-config
|
||||
pnpm
|
||||
rm-improved
|
||||
rnr
|
||||
slack
|
||||
stylua
|
||||
tailspin
|
||||
tokei
|
||||
typst
|
||||
typst-live
|
||||
typstfmt
|
||||
unrar
|
||||
unzip
|
||||
upx
|
||||
vgrep
|
||||
wget
|
||||
xcp
|
||||
xh
|
||||
]
|
||||
++ (with inputs; [nixvim.packages.${pkgs.system}.default]);
|
||||
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
|
||||
programs = {
|
||||
bacon.enable = true;
|
||||
btop.enable = true;
|
||||
bun.enable = true;
|
||||
gpg.enable = true;
|
||||
skim.enable = false;
|
||||
tealdeer.enable = false;
|
||||
wezterm.extraConfig = builtins.readFile ./wezterm.lua;
|
||||
|
||||
git = {
|
||||
extraConfig.credential.helper = "osxkeychain";
|
||||
signing.key = "874E22DF2F9DFCB5";
|
||||
};
|
||||
};
|
||||
}
|
134
systems/aarch64-darwin/canis/wezterm.lua
Normal file
134
systems/aarch64-darwin/canis/wezterm.lua
Normal file
|
@ -0,0 +1,134 @@
|
|||
local c = wezterm.config_builder()
|
||||
|
||||
wezterm.on('user-var-changed', function(window, pane, name, value)
|
||||
local overrides = window:get_config_overrides() or {}
|
||||
if name == 'ZEN_MODE' then
|
||||
local incremental = value:find('+')
|
||||
local number_value = tonumber(value)
|
||||
if incremental ~= nil then
|
||||
while number_value > 0 do
|
||||
window:perform_action(wezterm.action.IncreaseFontSize, pane)
|
||||
number_value = number_value - 1
|
||||
end
|
||||
overrides.enable_tab_bar = false
|
||||
elseif number_value < 0 then
|
||||
window:perform_action(wezterm.action.ResetFontSize, pane)
|
||||
overrides.font_size = nil
|
||||
overrides.enable_tab_bar = true
|
||||
else
|
||||
overrides.font_size = number_value
|
||||
overrides.enable_tab_bar = false
|
||||
end
|
||||
end
|
||||
window:set_config_overrides(overrides)
|
||||
end)
|
||||
wezterm.on('format-window-title', function(tab, pane, tabs, panes, config)
|
||||
local zoomed = ''
|
||||
|
||||
if tab.active_pane.is_zoomed then
|
||||
zoomed = '[Z] '
|
||||
end
|
||||
|
||||
local index = ''
|
||||
|
||||
if #tabs > 1 then
|
||||
index = string.format('[%d/%d] ', tab.tab_index + 1, #tabs)
|
||||
end
|
||||
|
||||
return 'WezTerm - ' .. zoomed .. index .. tab.active_pane.title
|
||||
end)
|
||||
|
||||
wezterm.plugin.require('https://github.com/nekowinston/wezterm-bar').apply_to_config(c, {
|
||||
position = 'bottom',
|
||||
max_width = 32,
|
||||
dividers = 'slant_right',
|
||||
indicator = {
|
||||
leader = {
|
||||
enabled = true,
|
||||
off = ' ',
|
||||
on = ' ',
|
||||
},
|
||||
mode = {
|
||||
enabled = true,
|
||||
names = {
|
||||
resize_mode = 'RESIZE',
|
||||
copy_mode = 'VISUAL',
|
||||
search_mode = 'SEARCH',
|
||||
},
|
||||
},
|
||||
},
|
||||
tabs = {
|
||||
numerals = 'arabic',
|
||||
pane_count = 'subscript',
|
||||
brackets = {
|
||||
active = { '', ':' },
|
||||
inactive = { '', ':' },
|
||||
},
|
||||
},
|
||||
clock = {
|
||||
enabled = true,
|
||||
format = '%l:%M %p',
|
||||
},
|
||||
})
|
||||
|
||||
local act = wezterm.action
|
||||
|
||||
local keybinds = {
|
||||
{
|
||||
key = 'Enter',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.SplitHorizontal({ domain = 'CurrentPaneDomain' }),
|
||||
},
|
||||
{
|
||||
key = 'h',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection('Left'),
|
||||
},
|
||||
{
|
||||
key = 'l',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection('Right'),
|
||||
},
|
||||
{
|
||||
key = 'k',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection('Up'),
|
||||
},
|
||||
{
|
||||
key = 'j',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.ActivatePaneDirection('Down'),
|
||||
},
|
||||
{
|
||||
key = 't',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = act.SpawnCommandInNewTab({ cwd = wezterm.home_dir }),
|
||||
},
|
||||
}
|
||||
|
||||
local config = {
|
||||
adjust_window_size_when_changing_font_size = false,
|
||||
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
|
||||
cursor_blink_ease_in = 'Constant',
|
||||
cursor_blink_ease_out = 'Constant',
|
||||
cursor_blink_rate = 500,
|
||||
default_cursor_style = 'BlinkingBar',
|
||||
enable_scroll_bar = false,
|
||||
font = wezterm.font('Maple Mono NF'),
|
||||
font_size = 16,
|
||||
front_end = 'WebGpu',
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
keys = keybinds,
|
||||
macos_window_background_blur = 32,
|
||||
use_fancy_tab_bar = false,
|
||||
webgpu_power_preference = 'HighPerformance',
|
||||
window_background_opacity = 0.85,
|
||||
window_decorations = 'RESIZE',
|
||||
window_padding = { left = 0, right = 0, top = 0, bottom = 0 },
|
||||
}
|
||||
|
||||
for k, v in pairs(config) do
|
||||
c[k] = v
|
||||
end
|
||||
|
||||
return c
|
Loading…
Add table
Add a link
Reference in a new issue