This commit is contained in:
2025-08-03 20:35:48 +02:00
parent ffc78043e6
commit 2ddffc74c9
17 changed files with 476 additions and 333 deletions

View File

@@ -1,2 +1 @@
_:
[]
_: [ ]

View File

@@ -1,2 +1,7 @@
{ user, config, pkgs, ... }:
{}
{
user,
config,
pkgs,
...
}:
{ }

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, home-manager, ... }:
{
config,
pkgs,
lib,
home-manager,
...
}:
let
user = "cschmatzler";
@@ -7,7 +13,7 @@ let
in
{
imports = [
./dock
./dock
];
# It me
@@ -20,7 +26,7 @@ in
homebrew = {
enable = true;
casks = pkgs.callPackage ./casks.nix {};
casks = pkgs.callPackage ./casks.nix { };
masApps = {
};
@@ -28,18 +34,25 @@ in
home-manager = {
useGlobalPkgs = true;
users.${user} = { pkgs, config, lib, ... }:{
home = {
enableNixpkgsReleaseCheck = false;
packages = pkgs.callPackage ./packages.nix {};
file = lib.mkMerge [
sharedFiles
additionalFiles
];
stateVersion = "23.11";
users.${user} =
{
pkgs,
config,
lib,
...
}:
{
home = {
enableNixpkgsReleaseCheck = false;
packages = pkgs.callPackage ./packages.nix { };
file = lib.mkMerge [
sharedFiles
additionalFiles
];
stateVersion = "23.11";
};
programs = { } // import ../shared/home-manager.nix { inherit config pkgs lib; };
};
programs = {} // import ../shared/home-manager.nix { inherit config pkgs lib; };
};
};
# Fully declarative dock using the latest from Nix Store

View File

@@ -1,8 +1,11 @@
{ pkgs }:
with pkgs;
let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in
shared-packages ++ [
let
shared-packages = import ../shared/packages.nix { inherit pkgs; };
in
shared-packages
++ [
dockutil
_1password-gui
raycast

View File

@@ -1,6 +1,14 @@
{ config, pkgs, agenix, secrets, ... }:
{
config,
pkgs,
agenix,
secrets,
...
}:
let user = "cschmatzler"; in
let
user = "cschmatzler";
in
{
age.identityPaths = [
"/Users/${user}/.ssh/id_ed25519"

View File

@@ -1,10 +1,11 @@
{ user, ... }:
let
home = builtins.getEnv "HOME";
home = builtins.getEnv "HOME";
xdg_configHome = "${home}/.config";
xdg_dataHome = "${home}/.local/share";
xdg_stateHome = "${home}/.local/state"; in
xdg_dataHome = "${home}/.local/share";
xdg_stateHome = "${home}/.local/state";
in
{
"${xdg_configHome}/bspwm/bspwmrc" = {
@@ -62,162 +63,162 @@ let
"${xdg_configHome}/sxhkd/sxhkdrc" = {
text = ''
# Close window
alt + F4
bspc node --close
# Close window
alt + F4
bspc node --close
# Make split ratios equal
super + equal
bspc node @/ --equalize
# Make split ratios equal
super + equal
bspc node @/ --equalize
# Make split ratios balanced
super + minus
bspc node @/ --balance
# Make split ratios balanced
super + minus
bspc node @/ --balance
# Toogle tiling of window
super + d
bspc query --nodes -n focused.tiled && state=floating || state=tiled; \
bspc node --state \~$state
# Toogle tiling of window
super + d
bspc query --nodes -n focused.tiled && state=floating || state=tiled; \
bspc node --state \~$state
# Toggle fullscreen of window
super + f
bspc node --state \~fullscreen
# Toggle fullscreen of window
super + f
bspc node --state \~fullscreen
# Swap the current node and the biggest window
super + g
bspc node -s biggest.window
# Swap the current node and the biggest window
super + g
bspc node -s biggest.window
# Swap the current node and the smallest window
super + shift + g
bspc node -s biggest.window
# Swap the current node and the smallest window
super + shift + g
bspc node -s biggest.window
# Alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# Alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# Move between windows in monocle layout
super + {_, alt + }m
bspc node -f {next, prev}.local.!hidden.window
# Move between windows in monocle layout
super + {_, alt + }m
bspc node -f {next, prev}.local.!hidden.window
# Focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# Focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# Focus left/right occupied desktop
super + {Left,Right}
bspc desktop --focus {prev,next}.occupied
# Focus left/right occupied desktop
super + {Left,Right}
bspc desktop --focus {prev,next}.occupied
# Focus left/right occupied desktop
super + {Up,Down}
bspc desktop --focus {prev,next}.occupied
# Focus left/right occupied desktop
super + {Up,Down}
bspc desktop --focus {prev,next}.occupied
# Focus left/right desktop
ctrl + alt + {Left,Right}
bspc desktop --focus {prev,next}
# Focus left/right desktop
ctrl + alt + {Left,Right}
bspc desktop --focus {prev,next}
# Focus left/right desktop
ctrl + alt + {Up, Down}
bspc desktop --focus {prev,next}
# Focus left/right desktop
ctrl + alt + {Up, Down}
bspc desktop --focus {prev,next}
# Focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# Focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# Focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# Focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# Preselect the direction
super + alt + {h,j,k,l}
bspc node -p {west,south,north,east}
# Preselect the direction
super + alt + {h,j,k,l}
bspc node -p {west,south,north,east}
# Cancel the preselect
# For context on syntax: https://github.com/baskerville/bspwm/issues/344
super + alt + {_,shift + }Escape
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# Cancel the preselect
# For context on syntax: https://github.com/baskerville/bspwm/issues/344
super + alt + {_,shift + }Escape
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# Preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# Preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# Cancel the preselect
# For context on syntax: https://github.com/baskerville/bspwm/issues/344
super + ctrl + {_,shift + }Escape
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# Cancel the preselect
# For context on syntax: https://github.com/baskerville/bspwm/issues/344
super + ctrl + {_,shift + }Escape
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# Set the node flags
super + ctrl + {m,x,s,p}
bspc node -g {marked,locked,sticky,private}
# Set the node flags
super + ctrl + {m,x,s,p}
bspc node -g {marked,locked,sticky,private}
# Send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# Send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# Program launcher
super + @space
rofi -config -no-lazy-grab -show drun -modi drun -theme /home/${user}/.config/rofi/launcher.rasi
# Program launcher
super + @space
rofi -config -no-lazy-grab -show drun -modi drun -theme /home/${user}/.config/rofi/launcher.rasi
# Terminal emulator
super + Return
bspc rule -a Alacritty -o state=floating rectangle=1024x768x0x0 center=true && /etc/profiles/per-user/${user}/bin/alacritty
# Terminal emulator
super + Return
bspc rule -a Alacritty -o state=floating rectangle=1024x768x0x0 center=true && /etc/profiles/per-user/${user}/bin/alacritty
# Terminal emulator
super + ctrl + Return
/etc/profiles/per-user/${user}/bin/alacritty
# Terminal emulator
super + ctrl + Return
/etc/profiles/per-user/${user}/bin/alacritty
# Jump to workspaces
super + t
bspc desktop --focus ^2
super + b
bspc desktop --focus ^1
super + w
bspc desktop --focus ^4
super + Tab
bspc {node,desktop} -f last
# Jump to workspaces
super + t
bspc desktop --focus ^2
super + b
bspc desktop --focus ^1
super + w
bspc desktop --focus ^4
super + Tab
bspc {node,desktop} -f last
# Keepass XC
super + shift + x
/etc/profiles/per-user/${user}/bin/keepassxc
# Keepass XC
super + shift + x
/etc/profiles/per-user/${user}/bin/keepassxc
# Emacs
# -c flag is --create-frame
# -a flag is fallback to plain emacs if daemon fails
super + alt + Return
emacsclient -c -a emacs
# Emacs
# -c flag is --create-frame
# -a flag is fallback to plain emacs if daemon fails
super + alt + Return
emacsclient -c -a emacs
super + alt + e
systemctl --user restart emacs.service && \
emacsclient -c -a emacs
super + alt + e
systemctl --user restart emacs.service && \
emacsclient -c -a emacs
# Web browser
ctrl + alt + Return
google-chrome-stable
# Web browser
ctrl + alt + Return
google-chrome-stable
# File browser at home dir
super + shift + @space
pcmanfm
# File browser at home dir
super + shift + @space
pcmanfm
# Take a screenshot with PrintSc
Print
flameshot gui -c -p $HOME/.local/share/img/screenshots
# Take a screenshot with PrintSc
Print
flameshot gui -c -p $HOME/.local/share/img/screenshots
# Lock the screen
ctrl + alt + BackSpace
i3lock
# Lock the screen
ctrl + alt + BackSpace
i3lock
# Audio controls for + volume
XF86AudioRaiseVolume
pactl set-sink-volume @DEFAULT_SINK@ +5%
# Audio controls for + volume
XF86AudioRaiseVolume
pactl set-sink-volume @DEFAULT_SINK@ +5%
# Audio controls for - volume
XF86AudioLowerVolume
pactl set-sink-volume @DEFAULT_SINK@ -5%
# Audio controls for - volume
XF86AudioLowerVolume
pactl set-sink-volume @DEFAULT_SINK@ -5%
# Audio controls for mute
XF86AudioMute
pactl set-sink-mute @DEFAULT_SINK@ toggle
# Audio controls for mute
XF86AudioMute
pactl set-sink-mute @DEFAULT_SINK@ toggle
'';
};
@@ -285,84 +286,84 @@ let
"${xdg_configHome}/rofi/bin/powermenu.sh" = {
executable = true;
text = ''
#!/bin/sh
#!/bin/sh
configDir="${xdg_configHome}/rofi"
uptime=$(uptime -p | sed -e 's/up //g')
rofi_command="rofi -no-config -theme $configDir/powermenu.rasi"
configDir="${xdg_configHome}/rofi"
uptime=$(uptime -p | sed -e 's/up //g')
rofi_command="rofi -no-config -theme $configDir/powermenu.rasi"
# Options
shutdown=" Shutdown"
reboot=" Restart"
lock=" Lock"
suspend=" Sleep"
logout=" Logout"
# Options
shutdown=" Shutdown"
reboot=" Restart"
lock=" Lock"
suspend=" Sleep"
logout=" Logout"
# Confirmation
confirm_exit() {
rofi -dmenu\
-no-config\
-i\
-no-fixed-num-lines\
-p "Are You Sure? : "\
-theme $configDir/confirm.rasi
}
# Confirmation
confirm_exit() {
rofi -dmenu\
-no-config\
-i\
-no-fixed-num-lines\
-p "Are You Sure? : "\
-theme $configDir/confirm.rasi
}
# Message
msg() {
rofi -no-config -theme "$configDir/message.rasi" -e "Available Options - yes / y / no / n"
}
# Message
msg() {
rofi -no-config -theme "$configDir/message.rasi" -e "Available Options - yes / y / no / n"
}
# Variable passed to rofi
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
case $chosen in
$shutdown)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl poweroff
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$reboot)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl reboot
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$lock)
betterlockscreen -l
;;
$suspend)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$logout)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
bspc quit
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
esac
'';
# Variable passed to rofi
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
case $chosen in
$shutdown)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl poweroff
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$reboot)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl reboot
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$lock)
betterlockscreen -l
;;
$suspend)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$logout)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
bspc quit
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
esac
'';
};
}

View File

@@ -1,18 +1,25 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
user = "cschmatzler";
xdg_configHome = "/home/${user}/.config";
xdg_configHome = "/home/${user}/.config";
shared-programs = import ../shared/home-manager.nix { inherit config pkgs lib; };
shared-files = import ../shared/files.nix { inherit config pkgs; };
polybar-user_modules = builtins.readFile (pkgs.replaceVars ./config/polybar/user_modules.ini {
packages = "${xdg_configHome}/polybar/bin/check-nixos-updates.sh";
searchpkgs = "${xdg_configHome}/polybar/bin/search-nixos-updates.sh";
launcher = "${xdg_configHome}/polybar/bin/launcher.sh";
powermenu = "${xdg_configHome}/rofi/bin/powermenu.sh";
calendar = "${xdg_configHome}/polybar/bin/popup-calendar.sh";
});
polybar-user_modules = builtins.readFile (
pkgs.replaceVars ./config/polybar/user_modules.ini {
packages = "${xdg_configHome}/polybar/bin/check-nixos-updates.sh";
searchpkgs = "${xdg_configHome}/polybar/bin/search-nixos-updates.sh";
launcher = "${xdg_configHome}/polybar/bin/launcher.sh";
powermenu = "${xdg_configHome}/rofi/bin/powermenu.sh";
calendar = "${xdg_configHome}/polybar/bin/popup-calendar.sh";
}
);
polybar-config = pkgs.replaceVars ./config/polybar/config.ini {
font0 = "DejaVu Sans:size=12;3";
@@ -29,7 +36,7 @@ in
enableNixpkgsReleaseCheck = false;
username = "${user}";
homeDirectory = "/home/${user}";
packages = pkgs.callPackage ./packages.nix {};
packages = pkgs.callPackage ./packages.nix { };
file = shared-files // import ./files.nix { inherit user; };
stateVersion = "21.05";
};
@@ -112,6 +119,8 @@ in
};
};
programs = shared-programs // { gpg.enable = true; };
programs = shared-programs // {
gpg.enable = true;
};
}

View File

@@ -1,8 +1,11 @@
{ pkgs }:
with pkgs;
let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in
shared-packages ++ [
let
shared-packages = import ../shared/packages.nix { inherit pkgs; };
in
shared-packages
++ [
# Security and authentication
yubikey-agent

View File

@@ -1,6 +1,14 @@
{ config, pkgs, agenix, secrets, ... }:
{
config,
pkgs,
agenix,
secrets,
...
}:
let user = "cschmatzler"; in
let
user = "cschmatzler";
in
{
age.identityPaths = [
"/home/${user}/.ssh/id_ed25519"

View File

@@ -9,10 +9,14 @@
};
overlays =
let path = ../../overlays; in with builtins;
map (n: import (path + ("/" + n)))
(filter (n: match ".*\\.nix" n != null ||
pathExists (path + ("/" + n + "/default.nix")))
(attrNames (readDir path)));
let
path = ../../overlays;
in
with builtins;
map (n: import (path + ("/" + n))) (
filter (n: match ".*\\.nix" n != null || pathExists (path + ("/" + n + "/default.nix"))) (
attrNames (readDir path)
)
);
};
}

View File

@@ -1,2 +1 @@
{ pkgs, config, ... }:
{}
{ pkgs, config, ... }: { }

View File

@@ -1,8 +1,15 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let name = "Christoph Schmatzler";
user = "cschmatzler";
email = "christoph@schmatzler.com"; in
let
name = "Christoph Schmatzler";
user = "cschmatzler";
email = "christoph@schmatzler.com";
in
{
zsh = {
enable = true;
@@ -10,14 +17,14 @@ let name = "Christoph Schmatzler";
cdpath = [ "~/Projects" ];
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./config;
file = "p10k.zsh";
name = "powerlevel10k-config";
src = lib.cleanSource ./config;
file = "p10k.zsh";
}
];
initContent = lib.mkBefore ''
@@ -74,7 +81,7 @@ let name = "Christoph Schmatzler";
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "vim";
editor = "vim";
autocrlf = "input";
};
commit.gpgsign = true;
@@ -86,23 +93,15 @@ let name = "Christoph Schmatzler";
ssh = {
enable = true;
includes = [
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux
"/home/${user}/.ssh/config_external"
)
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin
"/Users/${user}/.ssh/config_external"
)
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/config_external")
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/config_external")
];
matchBlocks = {
"github.com" = {
identitiesOnly = true;
identityFile = [
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux
"/home/${user}/.ssh/id_github"
)
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin
"/Users/${user}/.ssh/id_github"
)
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/id_github")
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/id_github")
];
};
};

View File

@@ -1,6 +1,7 @@
{ pkgs }:
with pkgs; [
with pkgs;
[
age
age-plugin-yubikey
bat