splitting home manager into managable files

This commit is contained in:
wieerwill 2024-12-12 20:41:40 +01:00
parent 9c79269bd6
commit 8e34fd742d
7 changed files with 283 additions and 288 deletions

10
fonts.nix Normal file
View File

@ -0,0 +1,10 @@
{ config, pkgs, lib, ... }:
{
# Configure fonts
fonts = {
fontconfig = {
enable = true;
};
};
}

14
git.nix Normal file
View File

@ -0,0 +1,14 @@
{ config, pkgs, lib, ... }:
{
programs.git = {
enable = true;
userName = "wieerwill";
userEmail = "robert.jeutter@gmx.de";
extraConfig = {
credential.helper = "${
pkgs.git.override { withLibsecret = true; }
}/bin/git-credential-libsecret";
};
};
}

307
home.nix
View File

@ -3,302 +3,33 @@
let
in
{
imports = [
./fonts.nix
./git.nix
./programs.nix
./sway.nix
./terminal.nix
./vim.nix
]
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "wieerwill";
home.homeDirectory = "/home/wieerwill";
home.enableNixpkgsReleaseCheck = false;
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
home = {
username = "wieerwill";
homeDirectory = "/home/wieerwill";
enableNixpkgsReleaseCheck = false;
stateVersion = "24.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# List of programs
thunderbird
signal-desktop
vscodium
vlc
keepassxc
alacritty
logseq
okular
firefox
borgbackup
# utility
htop
pulsemixer
brightnessctl
gammastep # color temperature
swaybg
xwayland
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer
# steam deck touch compability in non-steam games
caribou
evtest # for input key testing
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
(pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
];
# Configure fonts
fonts = {
fontconfig = {
enable = true;
file = {
# ".screenrc".source = dotfiles/screenrc;
};
};
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/wieerwill/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
sessionVariables = {
# EDITOR = "emacs";
};
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.alacritty = {
enable = true;
};
programs.git = {
enable = true;
userName = "wieerwill";
userEmail = "robert.jeutter@gmx.de";
extraConfig = {
credential.helper = "${
pkgs.git.override { withLibsecret = true; }
}/bin/git-credential-libsecret";
};
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
#defaultEditor = true;
#extraConfig = ''
# set number relativenumber
#'';
};
# Enable Sway window manager
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
# Sway configuration
config = rec {
modifier = "Mod4"; # Windows key
terminal = "alacritty";
menu = "bemenu-run";
# Define variables for your workspaces and displays
display1 = "card1-eDP-1";
workspace1 = "1:Web";
workspace2 = "2:App";
workspace3 = "3:Chat";
workspace4 = "4:Read";
workspace5 = "5:Code";
workspace6 = "6:Password";
workspace7 = "7:Shell";
workspace8 = "8:Media";
# Autostart applications
startup = [
{ command = "swaymsg workspace ${workspace7}; exec nvim"; }
{ command = "swaymsg workspace ${workspace7}; exec alacritty"; }
{ command = "keepassxc"; }
{ command = "logseq"; }
{ command = "thunderbird"; }
{ command = "firefox"; }
#{ command = "steam"; }
# Update environment variables
{ command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE PATH";}
# Start sway-session.target
{ command = "systemctl --user start sway-session.target";}
# Switch to the desired workspaces on each output
{ command = "swaymsg focus output ${display1}; swaymsg workspace ${workspace1}"; }
{ command = "swaymsg focus output ${display2}; swaymsg workspace ${workspace3}"; }
];
# Keyboard layout
input = {
# Enable touch screen
"10248:4117:FTS3528:00_2808:1015" = {
send_events = "enabled";
tap_enabled = true;
map_to_output = "${display1}";
};
# Map touch devices to display
"type:touch" = {
map_to_output = "${display1}";
};
# Configure Steam Controller pointer
"10462:4613:Valve_Software_Steam_Controller" = {
# For the pointer device
accel_speed = 0.0;
natural_scroll = false;
left_handed = false;
scroll_method = "two_finger";
middle_emulation = true;
};
# Configure Steam Controller keyboard
"10462:4613:Valve_Software_Steam_Controller" = {
xkb_layout = "de";
};
# Set German layout for all keyboards
"type:keyboard" = {
xkb_layout = "de";
repeat_delay = 600;
repeat_rate = 25;
};
# For all pointers
"type:pointer" = {
accel_speed = 0.0;
natural_scroll = false;
left_handed = false;
middle_emulation = true;
};
"*" = {
xkb_layout = "de"; # German keyboard layout
};
};
# Display configuration
output = {
"${display1}" = {
res = "1280x800"; # Steam Deck resolution
pos = "0 0";
scale = "1";
};
"*" = {
scale = "1";
};
};
# Keybindings
keybindings = {
"Mod4+1" = "workspace ${workspace1}";
"Mod4+2" = "workspace ${workspace2}";
"Mod4+3" = "workspace ${workspace3}";
"Mod4+4" = "workspace ${workspace4}";
"Mod4+5" = "workspace ${workspace5}";
"Mod4+6" = "workspace ${workspace6}";
"Mod4+7" = "workspace ${workspace7}";
"Mod4+8" = "workspace ${workspace8}";
"Mod4+Shift+1" = "move container to workspace ${workspace1}";
"Mod4+Shift+2" = "move container to workspace ${workspace2}";
"Mod4+Shift+3" = "move container to workspace ${workspace3}";
"Mod4+Shift+4" = "move container to workspace ${workspace4}";
"Mod4+Shift+5" = "move container to workspace ${workspace5}";
"Mod4+Shift+6" = "move container to workspace ${workspace6}";
"Mod4+Shift+7" = "move container to workspace ${workspace7}";
"Mod4+Shift+8" = "move container to workspace ${workspace8}";
"Mod4+Mod1+f" = "exec firefox, workspace ${workspace1}";
"Mod4+Mod1+g" = "exec logseq, workspace ${workspace2}";
"Mod4+Mod1+t" = "exec thunderbird, workspace ${workspace3}";
"Mod4+Mod1+s" = "exec signal-desktop, workspace ${workspace3}";
"Mod4+Mod1+o" = "exec okular, workspace ${workspace4}";
"Mod4+Mod1+c" = "exec codium, workspace ${workspace5}";
"Mod4+Mod1+k" = "exec keepassxc, workspace ${workspace6}";
"Mod4+Return" = "exec alacritty, workspace ${workspace7}";
"Mod4+Mod1+p" = "exec alacritty -e pulsemixer, workspace ${workspace7}";
"Mod4+Mod1+v" = "exec alacritty -e neovim, workspace ${workspace7}";
"Mod4+Mod1+b" = "exec alacritty -e bluetuith, workspace ${workspace7}";
"Mod4+Mod1+n" = "exec alacritty -e nmtui, workspace ${workspace7}";
"Mod4+Mod1+h" = "exec alacritty -e htop, workspace ${workspace7}";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
"XF86MonBrightnessUp" = "exec brightnessctl set 5%+";
"Print" = "exec grimshot save area";
"Mod4+Shift+q" = "exec swaynagmode --exit";
"Mod4+Shift+Return" = "exec swaynagmode --confirm";
# steamdeck specific keys
# "bindcode 304" = "exec firefox";...
};
# Assign workspaces to outputs (adjust as needed)
workspaceOutputAssign = [
{
workspace = workspace1;
output = display1;
}
# Add other workspace-output assignments if you have multiple monitors
];
# Assign applications to workspaces
assigns = {
"${workspace1}" = [ { app_id = "firefox"; } ];
"${workspace2}" = [ { class = "Logseq"; } ];
"${workspace3}" = [
{ class = "Signal"; }
{ app_id = "thunderbird"; }
];
"${workspace4}" = [ { app_id = "org.kde.okular"; } ];
"${workspace5}" = [
{ class = "VSCodium"; }
{ class = "nvim"; }
];
"${workspace6}" = [ { app_id = "org.keepassxc.KeePassXC"; } ];
"${workspace7}" = [ { app_id = "Alacritty"; } ];
"${workspace8}" = [
{ class = "vlc"; }
{ class = "steam"; }
];
};
};
};
}

41
programs.nix Normal file
View File

@ -0,0 +1,41 @@
{ config, pkgs, lib, ... }:
{
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# List of programs
thunderbird
signal-desktop
vscodium
vlc
keepassxc
alacritty
logseq
okular
firefox
borgbackup
# utility
htop
pulsemixer
brightnessctl
gammastep # color temperature
swaybg
xwayland
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer
# steam deck touch compability in non-steam games
caribou
evtest # for input key testing
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
(pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
];
}

179
sway.nix Normal file
View File

@ -0,0 +1,179 @@
{ config, pkgs, lib, ... }:
{
# Enable Sway window manager
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
# Sway configuration
config = rec {
modifier = "Mod4"; # Windows key
terminal = "alacritty";
menu = "bemenu-run";
# Define variables for your workspaces and displays
display1 = "card1-eDP-1";
workspace1 = "1:Web";
workspace2 = "2:App";
workspace3 = "3:Chat";
workspace4 = "4:Read";
workspace5 = "5:Code";
workspace6 = "6:Password";
workspace7 = "7:Shell";
workspace8 = "8:Media";
# Autostart applications
startup = [
{ command = "swaymsg workspace ${workspace7}; exec nvim"; }
{ command = "swaymsg workspace ${workspace7}; exec alacritty"; }
{ command = "keepassxc"; }
{ command = "logseq"; }
{ command = "thunderbird"; }
{ command = "firefox"; }
#{ command = "steam"; }
# Update environment variables
{ command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE PATH";}
# Start sway-session.target
{ command = "systemctl --user start sway-session.target";}
# Switch to the desired workspaces on each output
{ command = "swaymsg focus output ${display1}; swaymsg workspace ${workspace1}"; }
{ command = "swaymsg focus output ${display2}; swaymsg workspace ${workspace3}"; }
];
# Keyboard layout
input = {
# Enable touch screen
"10248:4117:FTS3528:00_2808:1015" = {
send_events = "enabled";
tap_enabled = true;
map_to_output = "${display1}";
};
# Map touch devices to display
"type:touch" = {
map_to_output = "${display1}";
};
# Configure Steam Controller pointer
"10462:4613:Valve_Software_Steam_Controller" = {
# For the pointer device
accel_speed = 0.0;
natural_scroll = false;
left_handed = false;
scroll_method = "two_finger";
middle_emulation = true;
};
# Configure Steam Controller keyboard
"10462:4613:Valve_Software_Steam_Controller" = {
xkb_layout = "de";
};
# Set German layout for all keyboards
"type:keyboard" = {
xkb_layout = "de";
repeat_delay = 600;
repeat_rate = 25;
};
# For all pointers
"type:pointer" = {
accel_speed = 0.0;
natural_scroll = false;
left_handed = false;
middle_emulation = true;
};
"*" = {
xkb_layout = "de"; # German keyboard layout
};
};
# Display configuration
output = {
"${display1}" = {
res = "1280x800"; # Steam Deck resolution
pos = "0 0";
scale = "1";
};
"*" = {
scale = "1";
};
};
# Keybindings
keybindings = {
"Mod4+1" = "workspace ${workspace1}";
"Mod4+2" = "workspace ${workspace2}";
"Mod4+3" = "workspace ${workspace3}";
"Mod4+4" = "workspace ${workspace4}";
"Mod4+5" = "workspace ${workspace5}";
"Mod4+6" = "workspace ${workspace6}";
"Mod4+7" = "workspace ${workspace7}";
"Mod4+8" = "workspace ${workspace8}";
"Mod4+Shift+1" = "move container to workspace ${workspace1}";
"Mod4+Shift+2" = "move container to workspace ${workspace2}";
"Mod4+Shift+3" = "move container to workspace ${workspace3}";
"Mod4+Shift+4" = "move container to workspace ${workspace4}";
"Mod4+Shift+5" = "move container to workspace ${workspace5}";
"Mod4+Shift+6" = "move container to workspace ${workspace6}";
"Mod4+Shift+7" = "move container to workspace ${workspace7}";
"Mod4+Shift+8" = "move container to workspace ${workspace8}";
"Mod4+Mod1+f" = "exec firefox, workspace ${workspace1}";
"Mod4+Mod1+g" = "exec logseq, workspace ${workspace2}";
"Mod4+Mod1+t" = "exec thunderbird, workspace ${workspace3}";
"Mod4+Mod1+s" = "exec signal-desktop, workspace ${workspace3}";
"Mod4+Mod1+o" = "exec okular, workspace ${workspace4}";
"Mod4+Mod1+c" = "exec codium, workspace ${workspace5}";
"Mod4+Mod1+k" = "exec keepassxc, workspace ${workspace6}";
"Mod4+Return" = "exec alacritty, workspace ${workspace7}";
"Mod4+Mod1+p" = "exec alacritty -e pulsemixer, workspace ${workspace7}";
"Mod4+Mod1+v" = "exec alacritty -e neovim, workspace ${workspace7}";
"Mod4+Mod1+b" = "exec alacritty -e bluetuith, workspace ${workspace7}";
"Mod4+Mod1+n" = "exec alacritty -e nmtui, workspace ${workspace7}";
"Mod4+Mod1+h" = "exec alacritty -e htop, workspace ${workspace7}";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
"XF86MonBrightnessUp" = "exec brightnessctl set 5%+";
"Print" = "exec grimshot save area";
"Mod4+Shift+q" = "exec swaynagmode --exit";
"Mod4+Shift+Return" = "exec swaynagmode --confirm";
# steamdeck specific keys
# "bindcode 304" = "exec firefox";...
};
# Assign workspaces to outputs (adjust as needed)
workspaceOutputAssign = [
{
workspace = workspace1;
output = display1;
}
# Add other workspace-output assignments if you have multiple monitors
];
# Assign applications to workspaces
assigns = {
"${workspace1}" = [ { app_id = "firefox"; } ];
"${workspace2}" = [ { class = "Logseq"; } ];
"${workspace3}" = [
{ class = "Signal"; }
{ app_id = "thunderbird"; }
];
"${workspace4}" = [ { app_id = "org.kde.okular"; } ];
"${workspace5}" = [
{ class = "VSCodium"; }
{ class = "nvim"; }
];
"${workspace6}" = [ { app_id = "org.keepassxc.KeePassXC"; } ];
"${workspace7}" = [ { app_id = "Alacritty"; } ];
"${workspace8}" = [
{ class = "vlc"; }
{ class = "steam"; }
];
};
};
};
}

7
terminal.nix Normal file
View File

@ -0,0 +1,7 @@
{ config, pkgs, lib, ... }:
{
programs.alacritty = {
enable = true;
};
}

13
vim.nix Normal file
View File

@ -0,0 +1,13 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
#defaultEditor = true;
#extraConfig = ''
# set number relativenumber
#'';
};
}