Add 'old-conf/' from commit '62a64a79a8'

git-subtree-dir: old-conf
git-subtree-mainline: 4667974392
git-subtree-split: 62a64a79a8
This commit is contained in:
Lucy Hochkamp 2025-11-21 13:33:06 +01:00
commit 83de52d5db
195 changed files with 13408 additions and 0 deletions

View file

@ -0,0 +1,199 @@
{ pkgs, inputs, lib, ... }:
with lib;
with lib.my;
{
system.stateVersion = 5;
ids.gids.nixbld = 30000;
users.users.xyno = {
name = "xyno";
home = "/Users/xyno";
};
homebrew = {
enable = true;
taps = [
"cormacrelf/tap" # dark-notify
"leoafarias/fvm" # flutter version manager
];
brews = [
"cormacrelf/tap/dark-notify"
"lima"
"docker" # docker cli
"docker-compose"
# "leoafarias/fvm/fvm" # flutter version manager
"cocoapods" # flutter/other ios shit
# "butane"
"borgbackup" # time machine can eat my ass
];
casks = [
"plexamp"
"vorta" # (borgbackup GUI) time machine can eat my ass
"grandperspective"
"xquartz"
"hammerspoon"
"kicad"
"android-platform-tools"
# "nheko"
"raycast"
"ukelele"
"imhex"
# "homebrew/cask-drivers/zsa-wally"
"thunderbird"
"balenaetcher"
"audacity"
"openlens"
# "ferdium"
"discord"
"vlc"
"rectangle"
"floorp"
# "space-capsule"
"iterm2"
"signal"
"eqmac"
"syncthing"
"android-studio"
# "temurin"
"whisky"
"dbeaver-community"
"rider" # I'm sorry
# "qutebrowser" # rly want to switch to it
# "dmenu-mac"
];
#masApps = {
# # Install Mac App Store apps (install them manually and then do `mas list` to get the id)
# "AdGuard for Safari" = 1440147259;
# "Xcode" = 497799835;
# "Home as Assistant" = 1099568401;
# "WireGuard" = 1451685025;
# "UTM" = 1538878817;
# "Bitwarden" = 1352778147;
# "Shareful" = 1522267256;
# "app.seashore" = 1448648921;
# "Tailscale" = 1475387142;
#};
};
nix.configureBuildUsers = true;
ids.uids.nixbld = lib.mkForce 400;
environment.pathsToLink = [ "/share/fish" ];
#ragon.services.borgmatic =
# let
# tmMountPath = "/tmp/timeMachineSnapshotForBorg";
# in
# {
# enable = false;
# configurations."daedalus-ds9" = {
# source_directories = [
# # tmMountPath
# "/Users/ragon"
# ];
# exclude_if_present = [ ".nobackup" ];
# repositories = [
# { path = "ssh://ragon@ds9/backups/daedalus/borgmatic"; label = "ds9"; }
# { path = "ssh://root@gatebridge/media/backup/daedalus"; label = "gatebridge"; }
# ];
# encryption_passcommand = pkgs.writeShellScript "getBorgmaticPw" ''security find-generic-password -a daedalus -s borgmaticKey -g 2>&1 | grep -E 'password' | sed 's/^.*"\(.*\)"$/\1/g' '';
# compression = "auto,zstd,10";
# #ssh_command = "ssh -o GlobalKnownHostsFile=${config.age.secrets.gatebridgeHostKeys.path} -i ${config.age.secrets.picardResticSSHKey.path}";
# keep_hourly = 24;
# keep_daily = 7;
# keep_weekly = 4;
# keep_monthly = 12;
# keep_yearly = 10;
# # before_backup = [
# # (pkgs.writeShellScript
# # "apfsSnapshot"
# # ''
# # tmutil localsnapshot
# # SNAPSHOT=$(tmutil listlocalsnapshots / | grep TimeMachine | tail -n 1)
# # mkdir -p "${tmMountPath}"
# # mount_apfs -s $SNAPSHOT /System/Volumes/Data "${tmMountPath}"
# # '')
# # ];
# # after_backup = [
# # (pkgs.writeShellScript
# # "apfsSnapshotUnmount"
# # ''
# # diskutil unmount "${tmMountPath}"
# # SNAPSHOT=$(tmutil listlocalsnapshots / | grep TimeMachine | tail -n 1)
# # tmutil deletelocalsnapshots $(echo $SNAPSHOT | sed 's/com\.apple\.TimeMachine\.\(.*\)\.local/\1/g')
# # '')
# # ];
# # on_error = [
# #
# # (pkgs.writeShellScript
# # "apfsSnapshotUnmountError"
# # ''
# # diskutil unmount "${tmMountPath}"
# # '')
# # ];
# };
# };
home-manager.users.xyno = { pkgs, lib, inputs, config, ... }:
{
imports = [
../../hm-modules/nvim
../../hm-modules/tmux
../../hm-modules/vscode
../../hm-modules/xonsh
../../hm-modules/helix
../../hm-modules/zellij
../../hm-modules/nushell
../../hm-modules/cli.nix
../../hm-modules/files.nix
];
home.file.".hammerspoon/init.lua".source =
let
notmuchMails = pkgs.writeScript "notmuch-get-mail-count" ''
#!/usr/bin/env zsh
printf "I%s F%s W%s" $(notmuch search tag:inbox | wc -l) $(notmuch search tag:follow-up | wc -l) $(notmuch search tag:waiting | wc -l)
'';
in
pkgs.substituteAll {
src = ./hammerspoon.lua; inherit notmuchMails;
};
home.file.".hammerspoon/Spoons/MiroWindowsManager.spoon".source = "${inputs.miro}/MiroWindowsManager.spoon";
ragon.vscode.enable = true;
ragon.helix.enable = true;
ragon.nushell.enable = true;
ragon.zellij.enable = true;
programs.home-manager.enable = true;
home.stateVersion = "23.11";
#home.shellAliases = {
# v = lib.mkForce "emacsclient -t";
# vv = lib.mkForce "emacsclient -c";
#};
home.sessionVariables = {
# EDITOR = "nvim";
# VISUAL = "nvim";
COLORTERM = "truecolor"; # emacs tty fix
};
home.packages = with pkgs; [
mosh
pandoc
tectonic
micromamba
bitwarden-cli
rustup
ffmpeg
];
};
}

View file

@ -0,0 +1,258 @@
----------------------------------------------------------------------------------------------------
-- Settings
----------------------------------------------------------------------------------------------------
hs.autoLaunch(true)
hs.automaticallyCheckForUpdates(true)
hs.consoleOnTop(true)
hs.dockIcon(false)
hs.menuIcon(false)
hs.uploadCrashData(false)
hs.window.animationDuration = 0
configWatcher = hs.pathwatcher.new(hs.configdir, hs.reload)
configWatcher:start()
local moonlanderMode = false
local maximizeMode = false
----------------------------------------------------------------------------------------------------
-- Utilities
----------------------------------------------------------------------------------------------------
local modifier = {
cmd = "cmd",
shift = "shift",
ctrl = "ctrl",
option = "alt",
}
local modifiers = {
hyper = { modifier.cmd, modifier.shift, modifier.ctrl, modifier.option },
window = { modifier.ctrl, modifier.option },
clipboard = { modifier.ctrl, modifier.cmd }
}
local bundleID = {
activityMonitor = "com.apple.ActivityMonitor",
finder = "com.apple.finder",
firefox = "org.mozilla.firefox",
emacs = "org.gnu.emacs",
iterm = "com.googlecode.iterm2",
orion = "com.kagi.kagimacOS",
safariTechnologyPreview = "com.apple.SafariTechnologyPreview",
spotify = "com.spotify.client",
bitwarden = "com.bitwarden.desktop",
teams = "com.microsoft.teams",
faclieThings = "com.electron.nativefier.facilethings-nativefier-cf88de",
timeular = "com.timeular.zei",
logseq = "com.electron.logseq"
}
local usbDevice = {
moonlander = "Moonlander Mark I"
}
local function languageIsGerman() return hs.host.locale.preferredLanguages()[1]:sub(0, 2) == "de" end
----------------------------------------------------------------------------------------------------
-- Menu
----------------------------------------------------------------------------------------------------
local function menuItems()
return {
{
title = "Hammerspoon " .. hs.processInfo.version,
disabled = true
},
{ title = "-" },
{
title = "Moonlander Mode",
checked = moonlanderMode,
fn = function() moonlanderDetected(not moonlanderMode) end
},
-- {
-- title = "Maximize Mode",
-- checked = maximizeMode,
-- fn = function() maximizeMode = not maximizeMode end
-- },
{ title = "-" },
{
title = "Reload",
fn = hs.reload
},
{
title = "Console...",
fn = hs.openConsole
},
{ title = "-" },
{
title = "Quit",
fn = function() hs.application.get(hs.processInfo.processID):kill() end
}
}
end
menu = hs.menubar.new()
menu:setMenu(menuItems)
----------------------------------------------------------------------------------------------------
-- Moonlander Detection
----------------------------------------------------------------------------------------------------
local moonlanderModeConfig = {
[false] = {
keyboardLayout = "Colemak DH ISO copy",
icon = hs.configdir .. "/assets/statusicon_off.tiff"
},
[true] = {
keyboardLayout = "EurKEY v1.2",
icon = hs.configdir .. "/assets/statusicon_on.tiff"
}
}
local function isDeviceMoonlander(device) return device.productName == usbDevice.moonlander end
function moonlanderDetected(connected)
moonlanderMode = connected
hs.keycodes.setLayout(moonlanderModeConfig[connected].keyboardLayout)
menu:setIcon(moonlanderModeConfig[connected].icon)
end
local function searchMoonlander()
local usbDevices = hs.usb.attachedDevices()
local moonlanderConnected = hs.fnutils.find(usbDevices, isDeviceMoonlander) ~= nil
moonlanderDetected(moonlanderConnected)
end
searchMoonlander()
usbWatcher = hs.usb.watcher.new(function(event)
if event.productName == usbDevice.moonlander then
moonlanderDetected(event.eventType == "added")
end
end)
usbWatcher:start()
caffeinateWatcher = hs.caffeinate.watcher.new(function(event)
if event == hs.caffeinate.watcher.systemDidWake then
searchMoonlander()
end
end)
caffeinateWatcher:start()
----------------------------------------------------------------------------------------------------
-- Window Management
----------------------------------------------------------------------------------------------------
--hs.window.filter.ignoreAlways = {
-- ["Mail Web Content"] = true,
-- ["Mail-Webinhalt"] = true,
-- ["QLPreviewGenerationExtension (Finder)"] = true,
-- ["Reeder Web Content"] = true,
-- ["Reeder-Webinhalt"] = true,
-- ["Safari Web Content (Cached)"] = true,
-- ["Safari Web Content (Prewarmed)"] = true,
-- ["Safari Web Content"] = true,
-- ["Safari Technology Preview Web Content (Cached)"] = true,
-- ["Safari Technology Preview Web Content (Prewarmed)"] = true,
-- ["Safari Technology Preview Web Content"] = true,
-- ["Safari-Webinhalt (im Cache)"] = true,
-- ["Safari-Webinhalt (vorgeladen)"] = true,
-- ["Safari-Webinhalt"] = true,
-- ["Strongbox (Safari)"] = true,
--}
--windowFilter = hs.window.filter.new({
-- "App Store",
-- "Code",
-- "DataGrip",
-- "Firefox",
-- "Fork",
-- "Fotos",
-- "Google Chrome",
-- "Vivaldi",
-- "IntelliJ IDEA",
-- "Mail",
-- "Emacs",
-- "Microsoft Outlook",
-- "Microsoft Teams",
-- "Music",
-- "Musik",
-- "Photos",
-- "Postman",
-- "Reeder",
-- "Safari",
-- "Safari Technology Preview",
-- "Spotify",
-- "Strongbox",
-- "BitWarden",
-- "Logseq",
-- "Timeular",
-- "Tower",
--})
--windowFilter:subscribe({ hs.window.filter.windowCreated, hs.window.filter.windowFocused }, function(window)
-- if maximizeMode and window ~= nil and window:isStandard() and window:frame().h > 500 then
-- window:maximize()
-- end
--end)
----------------------------------------------------------------------------------------------------
-- Keyboard Shortcuts
----------------------------------------------------------------------------------------------------
-- function showHideBundleId(bundleId)
-- local focusedWindow = hs.window.focusedWindow()
-- if focusedWindow ~= nil and focusedWindow:application():bundleID() == bundleId then -- window is focused
-- focusedWindow:close() -- hide
-- else
-- hs.application.launchOrFocusByBundleID(bundleId)
-- hs.window.focusedWindow():centerOnScreen(hs.mouse.getCurrentScreen())
-- end
-- end
-- hs.loadSpoon("MiroWindowsManager")
-- hs.window.animationDuration = 0
-- spoon.MiroWindowsManager:bindHotkeys({
-- up = {modifiers.window, "up"},
-- right = {modifiers.window, "right"},
-- down = {modifiers.window, "down"},
-- left = {modifiers.window, "left"},
-- fullscreen = {modifiers.window, "return"},
-- nextscreen = {modifiers.hyper, "right"}
-- })
-- hs.hotkey.bind(modifiers.hyper, hs.keycodes.map.delete, function() hs.caffeinate.lockScreen() end)
-- hs.hotkey.bind(modifiers.hyper, "a", function() showHideBundleId(bundleID.activityMonitor) end)
-- hs.hotkey.bind(modifiers.hyper, "o", function() showHideBundleId(bundleID.orion) end)
-- hs.hotkey.bind(modifiers.hyper, "f", function() showHideBundleId(bundleID.faclieThings) end)
-- hs.hotkey.bind(modifiers.hyper, "p", function() showHideBundleId(bundleID.timeular) end)
-- hs.hotkey.bind(modifiers.hyper, "b", function() showHideBundleId(bundleID.bitwarden) end)
-- hs.hotkey.bind(modifiers.hyper, "t", function() showHideBundleId(bundleID.iterm) end)
----------------------------------------------------------------------------------------------------
-- Mouse Shortcuts
----------------------------------------------------------------------------------------------------
local function handleMouse4()
hs.eventtap.keyStroke({ modifier.cmd }, "left")
end
local function handleMouse5()
hs.eventtap.keyStroke({ modifier.cmd }, "right")
end
-- bind mouse3/4 to back and forward
mouseTap = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(event)
if event:getButtonState(3) then
handleMouse4()
return true
elseif event:getButtonState(4) then
handleMouse5()
return true
end
return false
end)
mouseTap:start()