From e037398c510d121aaf445a502ab8c3c16f44a549 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 4 Apr 2025 14:16:18 +0200 Subject: [PATCH] Backup created on 20250404_141454 --- configuration.nix | 2 + history/20250404_141454/autostart.nix | 27 +++ history/20250404_141454/clean.nix | 14 ++ history/20250404_141454/configuration.nix | 220 ++++++++++++++++++ .../hardware-configuration.nix | 38 +++ history/20250404_141454/home.nix | 24 ++ history/20250404_141454/sshm.nix | 41 ++++ history/20250404_141454/vm.nix | 35 +++ 8 files changed, 401 insertions(+) create mode 100644 history/20250404_141454/autostart.nix create mode 100644 history/20250404_141454/clean.nix create mode 100644 history/20250404_141454/configuration.nix create mode 100644 history/20250404_141454/hardware-configuration.nix create mode 100644 history/20250404_141454/home.nix create mode 100644 history/20250404_141454/sshm.nix create mode 100644 history/20250404_141454/vm.nix diff --git a/configuration.nix b/configuration.nix index d88d864..9db669d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -53,6 +53,8 @@ }; console.keyMap = "de"; + programs.hyprland.enable = true; + services.printing.enable = true; services.pulseaudio.enable = false; diff --git a/history/20250404_141454/autostart.nix b/history/20250404_141454/autostart.nix new file mode 100644 index 0000000..d23e28a --- /dev/null +++ b/history/20250404_141454/autostart.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +{ + + systemd.user.services.ollama = { + description = "Ollama Server Autostart"; + after = [ "graphical-session.target" ]; + wantedBy = [ "default.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.ollama}/bin/ollama serve"; + }; + }; + + +# systemd.user.services.obs-studio = { +# description = "OBS Studio Autostart mit Flags"; +# after = [ "graphical-session.target" ]; +# wantedBy = [ "default.target" ]; +# serviceConfig = { +# Type = "simple"; +# ExecStart = "${pkgs.obs-studio}/bin/obs --startreplaybuffer --disable-shutdown-check"; +# Restart = "on-failure"; +# }; +# }; + +} diff --git a/history/20250404_141454/clean.nix b/history/20250404_141454/clean.nix new file mode 100644 index 0000000..d7cdc00 --- /dev/null +++ b/history/20250404_141454/clean.nix @@ -0,0 +1,14 @@ +{ lib, pkgs, ... }: + +{ + #weekly update + system.autoUpgrade.enable = true; + system.autoUpgrade.dates = "weekly"; + + #auto cleanuo + nix.gc.automatic = true; + nix.gc.dates = "daily"; + nix.gc.options = "--delete-older-than 10d"; + nix.settings.auto-optimise-store = true; + +} diff --git a/history/20250404_141454/configuration.nix b/history/20250404_141454/configuration.nix new file mode 100644 index 0000000..9db669d --- /dev/null +++ b/history/20250404_141454/configuration.nix @@ -0,0 +1,220 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./home.nix + ./vm.nix + ./clean.nix + ./autostart.nix + ]; + + nixpkgs.overlays = [ + (import /home/leo/.config/nixpkgs/overlays/ssh-manager.nix) + ]; + + + + + # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nixos-leo"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Berlin"; + + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + environment.variables = { + EDITOR = "micro"; + VISUAL = "micro"; + }; + + services.xserver.enable = true; + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; + console.keyMap = "de"; + + programs.hyprland.enable = true; + + services.printing.enable = true; + + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + hardware.graphics = { + enable = true; + }; + services.xserver.videoDrivers = ["nvidia"]; + + + hardware.nvidia = { + modesetting.enable = true; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + + + users.users.leo = { + isNormalUser = true; + description = "leo"; + extraGroups = [ "networkmanager" "wheel" "video" ]; + packages = with pkgs; [ + kdePackages.kate + pkgs.vesktop + pkgs.brave + pkgs.localsend + pkgs.git + pkgs.pciutils + pkgs.spotify + pkgs.prismlauncher + pkgs.speedtest-cli + pkgs.yazi + zsh + starship + ]; + }; + + + programs.firefox.enable = true; + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + ssh-manager + micro + nano + btop + pkgs.flatpak + pkgs.unzip + pkgs.zip + pkgs.dig + pkgs.fish + pkgs.kitty + pkgs.vscode + pkgs.nodejs_23 + pkgs.jq + pkgs.xclip + pkgs.ffmpeg_6-full + pkgs.hyprland + pkgs.temurin-jre-bin-23 + appimage-run + pkgs.screenfetch + pkgs.nerd-fonts.jetbrains-mono + pkgs.pinta + pkgs.qbittorrent-enhanced + pkgs.adwaita-icon-theme + pkgs.streamdeck-ui + pkgs.mangohud + pkgs.gamemode + pkgs.ollama-cuda + pkgs.lmstudio + pkgs.tmux + pkgs.obs-studio + pkgs.waydroid + pkgs.waydroid-helper + pkgs.putty + pkgs.python313 + pkgs.python313Packages.textual + pkgs.python313Packages.cryptography + pkgs.python313Packages.paramiko + python313Packages.cryptography + pkgs.neovim + pkgs.cmake + pkgs.maven + wget + xdotool + xorg.xwininfo + vim # enthält xxd + yad + pkgs.openrgb-with-all-plugins + pkgs.sshpass + pkgs.timeshift-unwrapped + pkgs.psmisc + pkgs.mcron + + wineWowPackages.stable + wine + (wine.override { wineBuild = "wine64"; }) + wine64 + wineWowPackages.staging + winetricks + wineWowPackages.waylandFull + + ]; + + environment.shells = with pkgs; [ + fish + ]; + + programs.bash.shellAliases = { + l = "ls -alh"; + ll = "ls -l"; + ls = "ls --color=tty"; + sshm = "ssh-manager"; + }; + + programs.fish = { + shellAliases = { + sshm = "ssh-manager"; + }; + }; + + virtualisation.waydroid.enable = true; + + systemd.services.startsteam = { + enable = true; + description = "Starts Steam automatically in background at boot"; + serviceConfig = { + ExecStart = "steam -nochatui -nofriendsui -silent"; + }; + }; + + programs.steam.enable = true; + + services.flatpak.enable = true; + + programs.fish = { + enable = true; + }; + + programs.starship = { + enable = true; + }; + + services.udev.packages = [ pkgs.usb-modeswitch ]; + services.udev.extraRules = '' + SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c26d", RUN+="${pkgs.usb-modeswitch}/bin/usb_modeswitch -v 046d -p c26d -M 0f00010142 -C 0x03 -m 01 -r 01" + ''; + + + system.stateVersion = "24.11"; + + +} + diff --git a/history/20250404_141454/hardware-configuration.nix b/history/20250404_141454/hardware-configuration.nix new file mode 100644 index 0000000..27fc9a6 --- /dev/null +++ b/history/20250404_141454/hardware-configuration.nix @@ -0,0 +1,38 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2975466c-25c4-45bd-94e6-125d2f4b2c19"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/922A-1C77"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp9s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/history/20250404_141454/home.nix b/history/20250404_141454/home.nix new file mode 100644 index 0000000..e88b4c4 --- /dev/null +++ b/history/20250404_141454/home.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; +in +{ + imports = [ + (import "${home-manager}/nixos") + ]; + + home-manager.users.leo = { + home.stateVersion = "24.11"; + + programs.kitty = { + enable = true; + settings = { + font_family = "JetBrainsMono Nerd Font"; + font_size = 12.0; + }; + shellIntegration = { + enableFishIntegration = true; + }; + }; + }; +} diff --git a/history/20250404_141454/sshm.nix b/history/20250404_141454/sshm.nix new file mode 100644 index 0000000..2afc035 --- /dev/null +++ b/history/20250404_141454/sshm.nix @@ -0,0 +1,41 @@ +{ config, pkgs, ... }: + +let + sshManagerShell = pkgs.mkShell { + name = "ssh-manager-shell"; + buildInputs = [ + pkgs.python311 + pkgs.python311Packages.pip + pkgs.python311Packages.virtualenv + ]; + shellHook = '' + # Wechsel ins Projektverzeichnis, falls nötig + cd /home/leo/Documents/Dev/ssh-manager + + # Falls kein virtueller Umgebung existiert, wird eine erstellt + if [ ! -d "venv" ]; then + echo "Creating virtual environment..." + ${pkgs.python311}/bin/python -m venv venv + fi + + # Virtuelle Umgebung aktivieren + source venv/bin/activate + + # Falls die Anforderungen noch nicht installiert wurden, installiere sie + if [ ! -f "venv/requirements_installed" ]; then + echo "Installing requirements..." + pip install --upgrade pip + pip install -r requirements.txt + touch venv/requirements_installed + fi + + echo "Virtual environment activated. Run 'python main.py' to start the SSH manager." + ''; + }; +in { + # Optional: Füge das DevShell-Umfeld zu deinen Systempaketen hinzu, + # sodass du es z.B. via "nix-shell -p ssh-manager-shell" aufrufen kannst. + environment.systemPackages = with pkgs; [ + sshManagerShell + ]; +} diff --git a/history/20250404_141454/vm.nix b/history/20250404_141454/vm.nix new file mode 100644 index 0000000..b8f2a8f --- /dev/null +++ b/history/20250404_141454/vm.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + + # Enable dconf (System Management Tool) + programs.dconf.enable = true; + + # Add user to libvirtd group + users.users.leo.extraGroups = [ "libvirtd" ]; + + # Install necessary packages + environment.systemPackages = with pkgs; [ + virt-manager + virt-viewer + spice spice-gtk + spice-protocol + win-virtio + win-spice + ]; + + # Manage the virtualisation services + virtualisation = { + libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + ovmf.enable = true; + ovmf.packages = [ pkgs.OVMFFull.fd ]; + }; + }; + spiceUSBRedirection.enable = true; + }; + services.spice-vdagentd.enable = true; + +}