Format the entire project.

This commit is contained in:
Kevin Baensch 2023-09-11 20:23:04 +02:00
parent 1dc50ae17d
commit 6f9db5e3a4
Signed by: derped
GPG key ID: C0F1D326C7626543
115 changed files with 3451 additions and 2901 deletions

View file

@ -1,10 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
{
config,
lib,
pkgs,
...
}:
with lib; {
environment.etc = mkIf (elem "etcfiles" config.machine.conffiles) {
"rofi.rasi".source = (import ./etc/rofi.rasi.nix { inherit pkgs; });
"rofi.rasi".source = import ./etc/rofi.rasi.nix {inherit pkgs;};
"i3/py3status".source = ./etc/i3/py3status;
"sway/config".source = mkDefault ./etc/sway/config;
"mpv/input.conf".source = ./etc/mpv/input.conf;

View file

@ -1,286 +1,284 @@
{ pkgs, ... }:
{pkgs, ...}: (pkgs.writeText "config" ''
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
(pkgs.writeText "config" ''
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
exec redshift-gtk -l 51.0504:13.7373
exec redshift-gtk -l 51.0504:13.7373
### START USER CONFIG ###
set $mod Mod4
workspace "HDMI" output HDMI1
workspace_auto_back_and_forth yes
new_window pixel
hide_edge_borders both
### START USER CONFIG ###
set $mod Mod4
workspace "HDMI" output HDMI1
workspace_auto_back_and_forth yes
new_window pixel
hide_edge_borders both
exec setxkbmap de
exec setxkbmap de
#exec compton -f
exec ${pkgs.feh}/bin/feh --bg-scale $(xdg-user-dir PICTURES)/wallpaper.jpg
#exec pulseaudio -D
exec fcitx5
#exec env=LC_CTYPE=zh_CN.UTF-8 emacs --daemon
#exec conky -c $HOME/.my_little_conky/.conkyrc
#exec xsnow -nosanta -norudolf -notrees
#exec $LOCK
#exec compton -f
exec ${pkgs.feh}/bin/feh --bg-scale $(xdg-user-dir PICTURES)/wallpaper.jpg
#exec pulseaudio -D
exec fcitx5
#exec env=LC_CTYPE=zh_CN.UTF-8 emacs --daemon
#exec conky -c $HOME/.my_little_conky/.conkyrc
#exec xsnow -nosanta -norudolf -notrees
#exec $LOCK
### END USER CONFIG ###
### END USER CONFIG ###
### START USER PROGRAMMS ###
### START USER PROGRAMMS ###
### END USER PROGRAMMS ###
### END USER PROGRAMMS ###
### START MEDIA BINDSYM ###
### START MEDIA BINDSYM ###
bindsym XF86AudioPlay exec ${pkgs.playerctl}/bin/playerctl play
bindsym XF86AudioPause exec ${pkgs.playerctl}/bin/playerctl pause
bindsym XF86AudioNext exec ${pkgs.playerctl}/bin/playerctl next
bindsym XF86AudioPrev exec ${pkgs.playerctl}/bin/playerctl previous
bindsym XF86AudioPlay exec ${pkgs.playerctl}/bin/playerctl play
bindsym XF86AudioPause exec ${pkgs.playerctl}/bin/playerctl pause
bindsym XF86AudioNext exec ${pkgs.playerctl}/bin/playerctl next
bindsym XF86AudioPrev exec ${pkgs.playerctl}/bin/playerctl previous
bindsym $mod+Mod1+space exec ${pkgs.playerctl}/bin/playerctl play-pause
bindsym $mod+Mod1+Left exec ${pkgs.playerctl}/bin/playerctl position 10-
bindsym $mod+Mod1+Right exec ${pkgs.playerctl}/bin/playerctl position 10+
bindsym $mod+Mod1+Down exec ${pkgs.playerctl}/bin/playerctl next
bindsym $mod+Mod1+Up exec ${pkgs.playerctl}/bin/playerctl previous
bindsym $mod+Mod1+space exec ${pkgs.playerctl}/bin/playerctl play-pause
bindsym $mod+Mod1+Left exec ${pkgs.playerctl}/bin/playerctl position 10-
bindsym $mod+Mod1+Right exec ${pkgs.playerctl}/bin/playerctl position 10+
bindsym $mod+Mod1+Down exec ${pkgs.playerctl}/bin/playerctl next
bindsym $mod+Mod1+Up exec ${pkgs.playerctl}/bin/playerctl previous
bindsym $mod+Shift+w sticky toggle
bindsym $mod+Shift+B floating enable; border none; resize set 900 600; move position 1020 19
bindsym $mod+Shift+w sticky toggle
bindsym $mod+Shift+B floating enable; border none; resize set 900 600; move position 1020 19
### END MEDIA BINDSYM ###
### END MEDIA BINDSYM ###
### START BINDSYM ###
### START BINDSYM ###
bindsym $mod+b border toggle
bindsym $mod+m bar mode toggle
bindsym $mod+y move container to output left
bindsym $mod+x move container to output right
bindsym $mod+Shift+y move workspace to output left
bindsym $mod+Shift+x move workspace to output right
bindsym $mod+l exec ${pkgs.i3lock}/bin/i3lock -efc 000000
bindsym $mod+minus exec ${pkgs.alsa-utils}/bin/amixer -c 0 sset Master 1%-
bindsym $mod+plus exec ${pkgs.alsa-utils}/bin/amixer -c 0 sset Master 1%+
bindsym $mod+Mod1+minus exec ${pkgs.alsa-utils}/bin/amixer -D pulse sset Master 1%-
bindsym $mod+Mod1+plus exec ${pkgs.alsa-utils}/bin/amixer -D pulse sset Master 1%+
bindsym $mod+Shift+minus exec ${pkgs.acpilight}/bin/xbacklight -5
bindsym $mod+Shift+plus exec ${pkgs.acpilight}/bin/xbacklight +5
bindsym $mod+Ctrl+0 exec ${pkgs.acpilight}/bin/xbacklight -set 0
bindsym $mod+Ctrl+1 exec ${pkgs.acpilight}/bin/xbacklight -set 10
bindsym $mod+Ctrl+2 exec ${pkgs.acpilight}/bin/xbacklight -set 20
bindsym $mod+Ctrl+3 exec ${pkgs.acpilight}/bin/xbacklight -set 30
bindsym $mod+Ctrl+4 exec ${pkgs.acpilight}/bin/xbacklight -set 40
bindsym $mod+Ctrl+5 exec ${pkgs.acpilight}/bin/xbacklight -set 50
bindsym $mod+Ctrl+6 exec ${pkgs.acpilight}/bin/xbacklight -set 60
bindsym $mod+Ctrl+7 exec ${pkgs.acpilight}/bin/xbacklight -set 70
bindsym $mod+Ctrl+8 exec ${pkgs.acpilight}/bin/xbacklight -set 80
bindsym $mod+Ctrl+9 exec ${pkgs.acpilight}/bin/xbacklight -set 90
bindsym $mod+p move scratchpad
bindsym $mod+Shift+p scratchpad show
bindsym --release $mod+Ctrl+s exec scrot
bindsym --release $mod+Ctrl+d exec "scrot --select"
bindsym --release $mod+Ctrl+a exec "scrot -s '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f && rm $f'"
bindsym $mod+o exec pcmanfm
bindsym $mod+Mod1+1 exec luxa fade --speed 50 '00ff00'
bindsym $mod+Mod1+2 exec luxa fade --speed 50 'ffff00'
bindsym $mod+Mod1+3 exec luxa fade --speed 50 'ff0000'
bindsym $mod+Mod1+4 exec luxa fade --speed 50 '0000ff'
bindsym $mod+Mod1+5 exec luxa fade --speed 50 'ffffff'
### END BINDSYM ###
bindsym $mod+b border toggle
bindsym $mod+m bar mode toggle
bindsym $mod+y move container to output left
bindsym $mod+x move container to output right
bindsym $mod+Shift+y move workspace to output left
bindsym $mod+Shift+x move workspace to output right
bindsym $mod+l exec ${pkgs.i3lock}/bin/i3lock -efc 000000
bindsym $mod+minus exec ${pkgs.alsa-utils}/bin/amixer -c 0 sset Master 1%-
bindsym $mod+plus exec ${pkgs.alsa-utils}/bin/amixer -c 0 sset Master 1%+
bindsym $mod+Mod1+minus exec ${pkgs.alsa-utils}/bin/amixer -D pulse sset Master 1%-
bindsym $mod+Mod1+plus exec ${pkgs.alsa-utils}/bin/amixer -D pulse sset Master 1%+
bindsym $mod+Shift+minus exec ${pkgs.acpilight}/bin/xbacklight -5
bindsym $mod+Shift+plus exec ${pkgs.acpilight}/bin/xbacklight +5
bindsym $mod+Ctrl+0 exec ${pkgs.acpilight}/bin/xbacklight -set 0
bindsym $mod+Ctrl+1 exec ${pkgs.acpilight}/bin/xbacklight -set 10
bindsym $mod+Ctrl+2 exec ${pkgs.acpilight}/bin/xbacklight -set 20
bindsym $mod+Ctrl+3 exec ${pkgs.acpilight}/bin/xbacklight -set 30
bindsym $mod+Ctrl+4 exec ${pkgs.acpilight}/bin/xbacklight -set 40
bindsym $mod+Ctrl+5 exec ${pkgs.acpilight}/bin/xbacklight -set 50
bindsym $mod+Ctrl+6 exec ${pkgs.acpilight}/bin/xbacklight -set 60
bindsym $mod+Ctrl+7 exec ${pkgs.acpilight}/bin/xbacklight -set 70
bindsym $mod+Ctrl+8 exec ${pkgs.acpilight}/bin/xbacklight -set 80
bindsym $mod+Ctrl+9 exec ${pkgs.acpilight}/bin/xbacklight -set 90
bindsym $mod+p move scratchpad
bindsym $mod+Shift+p scratchpad show
bindsym --release $mod+Ctrl+s exec scrot
bindsym --release $mod+Ctrl+d exec "scrot --select"
bindsym --release $mod+Ctrl+a exec "scrot -s '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f && rm $f'"
bindsym $mod+o exec pcmanfm
bindsym $mod+Mod1+1 exec luxa fade --speed 50 '00ff00'
bindsym $mod+Mod1+2 exec luxa fade --speed 50 'ffff00'
bindsym $mod+Mod1+3 exec luxa fade --speed 50 'ff0000'
bindsym $mod+Mod1+4 exec luxa fade --speed 50 '0000ff'
bindsym $mod+Mod1+5 exec luxa fade --speed 50 'ffffff'
### END BINDSYM ###
### START MODES ###
### START MODES ###
mode "ACPI Events" {
bindsym p exec systemctl poweroff; mode "default"
bindsym h exec systemctl hibernate; mode "default"
bindsym s exec systemctl suspend; mode "default"
bindsym r exec systemctl reboot; mode "default"
bindsym h exec systemctl halt; mode "default"
bindsym e exec systemctl exit; mode "default"
bindsym l exec $LOCK; mode "default"
mode "ACPI Events" {
bindsym p exec systemctl poweroff; mode "default"
bindsym h exec systemctl hibernate; mode "default"
bindsym s exec systemctl suspend; mode "default"
bindsym r exec systemctl reboot; mode "default"
bindsym h exec systemctl halt; mode "default"
bindsym e exec systemctl exit; mode "default"
bindsym l exec $LOCK; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "Power Mode"{
bindsym s exec xbacklight -set 5; exec rfkill block all ; exec xset -b +dpms; mode "default"
bindsym p exec xbacklight -set 100; exec rfkill unblock all; exec xset -dpms; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "No Keybinds" {
bindsym $mod+Shift+Escape mode "default"
}
bindsym $mod+F12 mode "ACPI Events"
bindsym $mod+F11 mode "No Keybinds"
bindsym $mod+F10 mode "Power Mode"
### END MODES ###
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:monospace 8
#font pango:System San Francisco Display 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Shift+Return exec emacsclient -c
bindsym $mod+Mod1+Return exec emacsclient -c -e '(eshell t)'
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec ${pkgs.rofi}/bin/rofi -config /etc/rofi.rasi -show combi
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right
#bindsym $mod+Shift+semicolon1 move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+q layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+s focus child
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
position top
status_command py3status -c /etc/i3/py3status
tray_output primary
# status_command i3status
colors {
separator #586e75
background #002b36
statusline #aea79f
focused_workspace #586e75 #586e75 #ffffff
active_workspace #073642 #073642 #ffffff
inactive_workspace #002b36 #002b36 #aea79f
urgent_workspace #77216f #77216f #ffffff
bindsym Return mode "default"
bindsym Escape mode "default"
}
}
client.focused #008666 #000000 #ffffff
client.focused_inactive #000000 #222222 #ffffff
client.unfocused #002b36 #333333 #ffffff #ffffff
client.urgent #aa0000 y#990000 #ffffff
#client.focused #586e75 #586e75 #fdf6e3 #268bd2
#client.focused_inactive #073642 #073642 #93a1a1 #002b36
#client.unfocused #002b36 #002b36 #586e75 #002b36
#client.urgent #dc322f #dc322f #fdf6e3 #dc322f
mode "Power Mode"{
bindsym s exec xbacklight -set 5; exec rfkill block all ; exec xset -b +dpms; mode "default"
bindsym p exec xbacklight -set 100; exec rfkill unblock all; exec xset -dpms; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "No Keybinds" {
bindsym $mod+Shift+Escape mode "default"
}
bindsym $mod+F12 mode "ACPI Events"
bindsym $mod+F11 mode "No Keybinds"
bindsym $mod+F10 mode "Power Mode"
### END MODES ###
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:monospace 8
#font pango:System San Francisco Display 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Shift+Return exec emacsclient -c
bindsym $mod+Mod1+Return exec emacsclient -c -e '(eshell t)'
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec ${pkgs.rofi}/bin/rofi -config /etc/rofi.rasi -show combi
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right
#bindsym $mod+Shift+semicolon1 move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+q layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+s focus child
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
position top
status_command py3status -c /etc/i3/py3status
tray_output primary
# status_command i3status
colors {
separator #586e75
background #002b36
statusline #aea79f
focused_workspace #586e75 #586e75 #ffffff
active_workspace #073642 #073642 #ffffff
inactive_workspace #002b36 #002b36 #aea79f
urgent_workspace #77216f #77216f #ffffff
}
}
client.focused #008666 #000000 #ffffff
client.focused_inactive #000000 #222222 #ffffff
client.unfocused #002b36 #333333 #ffffff #ffffff
client.urgent #aa0000 y#990000 #ffffff
#client.focused #586e75 #586e75 #fdf6e3 #268bd2
#client.focused_inactive #073642 #073642 #93a1a1 #002b36
#client.unfocused #002b36 #002b36 #586e75 #002b36
#client.urgent #dc322f #dc322f #fdf6e3 #dc322f
'')

View file

@ -1,25 +1,23 @@
{ pkgs }:
let
{pkgs}: let
tabMode = pkgs.writeScript "tab-finder.sh" (with pkgs; ''
#!/usr/bin/env bash
if [ -z ''${1} ]; then
${brotab}/bin/bt list;
else
TARGET_TAB=$(sed "s/\t.*$//g" <<< ''${1});
# activate window as focused to it is easy to switch to
${brotab}/bin/bt activate --focused ''${TARGET_TAB} > /dev/null 2>&1;
${i3}/bin/i3-msg -t run_command "[urgent=latest] focus" > /dev/null 2>&1;
fi
exit 0;
#!/usr/bin/env bash
if [ -z ''${1} ]; then
${brotab}/bin/bt list;
else
TARGET_TAB=$(sed "s/\t.*$//g" <<< ''${1});
# activate window as focused to it is easy to switch to
${brotab}/bin/bt activate --focused ''${TARGET_TAB} > /dev/null 2>&1;
${i3}/bin/i3-msg -t run_command "[urgent=latest] focus" > /dev/null 2>&1;
fi
exit 0;
'');
in (pkgs.writeText "rofi.rasi" ''
configuration {
modi: "combi,window,drun,ssh,tabFinder:${tabMode}";
font: "hack 10";
combi-modi: "window,drun,ssh,tabFinder";
icon-theme: "Papirus";
show-icons: true;
}
@theme "solarized"
configuration {
modi: "combi,window,drun,ssh,tabFinder:${tabMode}";
font: "hack 10";
combi-modi: "window,drun,ssh,tabFinder";
icon-theme: "Papirus";
show-icons: true;
}
@theme "solarized"
'')

View file

@ -1,42 +1,45 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
with lib;
mkIf (elem "fonts" config.machine.conffiles) {
fonts = {
fontDir.enable = true;
enableGhostscriptFonts = true;
fontconfig = {
enable = true;
# deprecated (will eventually be completely removed)
# ultimate.enable = true;
includeUserConf = false;
mkIf (elem "fonts" config.machine.conffiles) {
fonts = {
fontDir.enable = true;
enableGhostscriptFonts = true;
fontconfig = {
enable = true;
# deprecated (will eventually be completely removed)
# ultimate.enable = true;
includeUserConf = false;
};
packages = with pkgs; [
arphic-ukai
arphic-uming
crimson
corefonts # Microsoft free fonts
dejavu_fonts
font-awesome
inconsolata # monospaced
inter
manrope
montserrat
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
powerline-fonts
source-han-sans-japanese
source-han-sans-korean
source-han-sans-simplified-chinese
source-han-sans-traditional-chinese
# source-sans-pro
symbola
ubuntu_font_family
wqy_microhei
wqy_zenhei
];
};
packages = with pkgs; [
arphic-ukai
arphic-uming
crimson
corefonts # Microsoft free fonts
dejavu_fonts
font-awesome
inconsolata # monospaced
inter
manrope
montserrat
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
powerline-fonts
source-han-sans-japanese
source-han-sans-korean
source-han-sans-simplified-chinese
source-han-sans-traditional-chinese
# source-sans-pro
symbola
ubuntu_font_family
wqy_microhei
wqy_zenhei
];
};
}
}

View file

@ -1,13 +1,18 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
console.keyMap = "de";
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "all" ];
supportedLocales = ["all"];
inputMethod = {
enabled = if config.services.xserver.enable then "fcitx5" else null;
fcitx5.addons = with pkgs; [ fcitx5-chinese-addons fcitx5-mozc fcitx5-table-extra ];
enabled =
if config.services.xserver.enable
then "fcitx5"
else null;
fcitx5.addons = with pkgs; [fcitx5-chinese-addons fcitx5-mozc fcitx5-table-extra];
};
};
}

View file

@ -1,10 +1,11 @@
{ config, lib, ... }:
with lib;
let
{
config,
lib,
...
}:
with lib; let
networkD = config.machine.networkD;
in{
in {
networking = {
hostName = config.machine.hostName;
useNetworkd = networkD.enable;
@ -20,7 +21,7 @@ in{
DHCP = "yes";
DNSSEC = "yes";
DNSOverTLS = "yes";
DNS = [ "1.1.1.1" "1.0.0.1" ];
DNS = ["1.1.1.1" "1.0.0.1"];
};
in {
"40-wired" = {
@ -58,7 +59,8 @@ in{
systemd.services."systemd-networkd-wait-online" = {
enable = mkForce networkD.waitOnline;
serviceConfig.ExecStart = [
"" "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --any"
""
"${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --any"
];
};
}

View file

@ -1,6 +1,12 @@
{ nixpkgs, nixpkgs-git, nixpkgs-stable, pkgs, config, lib, ... }:
let
{
nixpkgs,
nixpkgs-git,
nixpkgs-stable,
pkgs,
config,
lib,
...
}: let
cfg = config.machine;
emptyGlobalRegistry = pkgs.writeText "registry.json" ''{ "flakes": [], "version": 2 }'';
in {
@ -16,15 +22,19 @@ in {
cores = 1;
sandbox = true;
auto-optimise-store = true;
trusted-substituters = [
"https://cache.nixos.org"
] ++ cfg.binaryCaches;
trusted-substituters =
[
"https://cache.nixos.org"
]
++ cfg.binaryCaches;
# TODO: integrate into sops
# trusted-public-keys = [ (lib.fileContents "${cfg.secretPath}/hydra_cache.pub") ];
substituters = [
"https://cache.nixos.org"
] ++ cfg.binaryCaches;
allowed-users = [ "root" ] ++ (map (n: n.name) cfg.administrators);
substituters =
[
"https://cache.nixos.org"
]
++ cfg.binaryCaches;
allowed-users = ["root"] ++ (map (n: n.name) cfg.administrators);
};
extraOptions = ''
build-timeout = 86400 # 24 hours

View file

@ -1,10 +1,12 @@
{ config, lib, ... }:
{
config,
lib,
...
}:
with lib;
mkIf (elem "security" config.machine.conffiles) {
security = {
audit.enable = true;
auditd.enable = true;
};
}
mkIf (elem "security" config.machine.conffiles) {
security = {
audit.enable = true;
auditd.enable = true;
};
}

View file

@ -1,8 +1,11 @@
{ config, lib, fn, pkgs, ... }:
with lib;
let
{
config,
lib,
fn,
pkgs,
...
}:
with lib; let
withDocker = config.virtualisation.docker.enable;
withPodman = config.virtualisation.podman.enable;
administrators = user: {
@ -13,16 +16,23 @@ let
in {
isNormalUser = true;
name = user.name;
uid = user.id;
subUidRanges = (optional withPodman { startUid = 100000; count = 65536; });
subGidRanges = (optional withPodman { startGid = 100000; count = 65536; });
uid = user.id;
subUidRanges = optional withPodman {
startUid = 100000;
count = 65536;
};
subGidRanges = optional withPodman {
startGid = 100000;
count = 65536;
};
home = builtins.toPath "/home/${user.name}";
createHome = true;
description = "Administrative user ${user.name}.";
group = user.name;
extraGroups = [ "audio" "wheel" "network" ]
extraGroups =
["audio" "wheel" "network"]
++ (optionals cfg.xserver.enable ["input" "video"])
++ (optionals cfg.printing.enable [ "cups" "lp" ])
++ (optionals cfg.printing.enable ["cups" "lp"])
++ (optional (withDocker && !withPodman) "docker")
++ (optional withPodman "podman");
shell = "${pkgs.zsh}/bin/zsh";
@ -30,19 +40,20 @@ let
};
};
mkusergroup = user: {
name = user.name;
value = {
name = user.name;
gid = user.id;
members = [ user.name ];
};
};
mkusergroup = user: {
name = user.name;
value = {
name = user.name;
gid = user.id;
members = [user.name];
};
};
in {
sops.secrets = (fn.sopsHelper
sops.secrets =
fn.sopsHelper
(user: "users/${user.name}/password")
config.machine.administrators
{ neededForUsers = true; });
{neededForUsers = true;};
users = {
mutableUsers = false;
users = listToAttrs (map administrators config.machine.administrators);

View file

@ -1,36 +1,38 @@
{ config, lib, ... }:
{
config,
lib,
...
}:
with lib;
mkIf (elem "zsh" config.machine.conffiles) {
programs.zsh = {
enable = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
cat = ''bat --paging=never --theme="Solarized (dark)"'';
less = ''bat --paging=always --style=changes --color=always --theme="Solarized (dark)"'';
ls = "exa";
l = "exa -abgHhl@ --git --color=always --group-directories-first";
tree = "exa --tree --color=always";
ustrip = "sed -e '/\.service\|\.timer\|\.target\|\.socket\|\.slice\|\.scope\|\.path\|\.mount\|\.device)/!d' -e 's/loaded.*$//g' -e 's/^ \|^ //g'";
lsunits = "systemctl list-units | ustrip";
};
shellInit = ''
function ll() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" }
function lln() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" -n }
function lszip() { unzip -l $@ 2>&1 | sed -e "1,3d" -e "s/^.*:.. *//g" | head --lines=-2 }
function rwhich() { realpath $(which $@) }
function cdf() { cd $(rwhich $@ | sed "s/$@$//") }
function sfu() { lsunits | rg -i $@ }
function map() { for f in "$\{@:2\}"; do; eval $1 \"$f\"; done }
'';
ohMyZsh = {
mkIf (elem "zsh" config.machine.conffiles) {
programs.zsh = {
enable = true;
plugins = [ "cabal" "docker" "gitfast" "python" "pip" "sudo" "systemd" "man" ];
theme = "gentoo";
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
cat = ''bat --paging=never --theme="Solarized (dark)"'';
less = ''bat --paging=always --style=changes --color=always --theme="Solarized (dark)"'';
ls = "exa";
l = "exa -abgHhl@ --git --color=always --group-directories-first";
tree = "exa --tree --color=always";
ustrip = "sed -e '/\.service\|\.timer\|\.target\|\.socket\|\.slice\|\.scope\|\.path\|\.mount\|\.device)/!d' -e 's/loaded.*$//g' -e 's/^ \|^ //g'";
lsunits = "systemctl list-units | ustrip";
};
shellInit = ''
function ll() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" }
function lln() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" -n }
function lszip() { unzip -l $@ 2>&1 | sed -e "1,3d" -e "s/^.*:.. *//g" | head --lines=-2 }
function rwhich() { realpath $(which $@) }
function cdf() { cd $(rwhich $@ | sed "s/$@$//") }
function sfu() { lsunits | rg -i $@ }
function map() { for f in "$\{@:2\}"; do; eval $1 \"$f\"; done }
'';
ohMyZsh = {
enable = true;
plugins = ["cabal" "docker" "gitfast" "python" "pip" "sudo" "systemd" "man"];
theme = "gentoo";
};
};
};
}
}