From 6e2effbad5b387350455b31d4a4ee66478461447 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 7 Feb 2026 13:23:02 +0100 Subject: [PATCH] [TASK] Improve user config --- config/common.nix | 22 ++------ config/configuration.nix | 4 +- config/home.nix | 2 + config/users.nix | 24 --------- config/users/sebastian.nix | 101 +++++++++++++++++++++++++++++++++++++ config/vm-host.nix | 2 +- 6 files changed, 110 insertions(+), 45 deletions(-) delete mode 100644 config/users.nix create mode 100644 config/users/sebastian.nix diff --git a/config/common.nix b/config/common.nix index 84236ff..4b3d656 100644 --- a/config/common.nix +++ b/config/common.nix @@ -48,8 +48,6 @@ wget curl htop - stow - cifs-utils ]; @@ -61,19 +59,7 @@ services.flatpak.enable = true; # Sound - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Sound - sound.enable = true; - hardware.pulseaudio.enable = false; + services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; @@ -84,12 +70,12 @@ # 32-bit Support für Steam hardware.graphics.enable32Bit = true; - hardware.pulseaudio.support32Bit = true; + services.pulseaudio.support32Bit = true; # Desktop Environment / Window Manager services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; # Enable CUPS to print documents. services.printing.enable = true; diff --git a/config/configuration.nix b/config/configuration.nix index 38c5a49..f82bb4f 100644 --- a/config/configuration.nix +++ b/config/configuration.nix @@ -5,7 +5,7 @@ ./hardware-configuration.nix ./common.nix ./services.nix - ./users.nix + ./users/sebastian.nix # ./vm-guest.nix ]; @@ -13,7 +13,7 @@ # Home Manager Konfiguration home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.sebastian = import ./home.nix; + home-manager.backupFileExtension = "backup"; # NixOS Version (nicht ändern nach Erstinstallation) system.stateVersion = "25.11"; diff --git a/config/home.nix b/config/home.nix index 8afbed8..2a35e73 100644 --- a/config/home.nix +++ b/config/home.nix @@ -81,6 +81,8 @@ in jetbrains-toolbox mkcert gitflow + + stow ]; diff --git a/config/users.nix b/config/users.nix deleted file mode 100644 index 20bcddd..0000000 --- a/config/users.nix +++ /dev/null @@ -1,24 +0,0 @@ -# /etc/nixos/users.nix -# Benutzer-Konfiguration - -{ config, pkgs, ... }: - -{ - # Benutzer sebastian - users.users.sebastian = { - isNormalUser = true; - description = "Sebastian Fischer"; - extraGroups = [ - "networkmanager" - "wheel" - "docker" - "libvirtd" - ]; - shell = pkgs.zsh; - - hashedPassword = "$6$CAuppl9g4RL/0BpQ$njjjKs2MFlHRCxlBk.34f2z.wJ3nEOI4xOdOBEds59Adcr3ngJ1lVFpOS0v0pg4/k5pTg0Lgj.88w/RgR2/MS."; - }; - - # SSH für ssh-askpass (verwendet von Git, etc.) - programs.ssh.askPassword = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; -} diff --git a/config/users/sebastian.nix b/config/users/sebastian.nix new file mode 100644 index 0000000..b9ed8bc --- /dev/null +++ b/config/users/sebastian.nix @@ -0,0 +1,101 @@ +# /etc/nixos/sebastian.nix +# Benutzer-Konfiguration + +{ config, pkgs, lib, ... }: + +{ + # Benutzer sebastian + users.users.sebastian = { + isNormalUser = true; + description = "Sebastian Fischer"; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + "libvirtd" + ]; + shell = pkgs.zsh; + + hashedPassword = "$6$CAuppl9g4RL/0BpQ$njjjKs2MFlHRCxlBk.34f2z.wJ3nEOI4xOdOBEds59Adcr3ngJ1lVFpOS0v0pg4/k5pTg0Lgj.88w/RgR2/MS."; + }; + + # SSH für ssh-askpass (verwendet von Git, etc.) + programs.ssh.askPassword = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; + + home-manager.users.sebastian = lib.mkMerge [ + (import ../home.nix) + + { + programs.git = { + enable = true; + + settings = { + user.name = "Sebastian Fischer"; # ANPASSEN + user.email = "typo3@evoweb.de"; # ANPASSEN + init.defaultBranch = "main"; + core.editor = "vim"; + pull.rebase = false; + }; + }; + + # Zsh mit Oh-My-Zsh und Powerlevel10k + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + oh-my-zsh = { + enable = true; + theme = "powerlevel10k/powerlevel10k"; + plugins = [ + "git" + "git-flow" + "docker" + "docker-compose" + "systemd" + "sudo" + ]; + + custom = "$HOME/.oh-my-zsh/custom"; + }; + + shellAliases = { + ll = "ls -lah"; + la = "ls -A"; + l = "ls -CF"; + ".." = "cd .."; + "..." = "cd ../.."; + rebuild = "sudo nixos-rebuild switch"; + update = "sudo nixos-rebuild switch --upgrade"; + }; + + initContent = '' + # Powerlevel10k Konfiguration laden (falls vorhanden) + [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh + ''; + }; + + # Vim Konfiguration + programs.vim = { + enable = true; + defaultEditor = true; + + settings = { + number = true; + relativenumber = true; + tabstop = 2; + shiftwidth = 2; + expandtab = true; + }; + + extraConfig = '' + syntax on + set encoding=utf-8 + set autoindent + set smartindent + ''; + }; + } + ]; +} diff --git a/config/vm-host.nix b/config/vm-host.nix index bc9193d..96c0b2e 100644 --- a/config/vm-host.nix +++ b/config/vm-host.nix @@ -1,4 +1,4 @@ -# /etc/nixos/vm-guest.nix +# /etc/nixos/vm-host.nix # Erweiterte Virtualisierungs-Konfiguration # Diese Datei ist optional und kann in configuration.nix importiert werden