From fe27dff1924bf728161afb63ad37ffb82d81cc5e Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 1 Apr 2026 07:45:17 +0200 Subject: [PATCH] init --- configuration.nix | 157 +++++++++++++++++++++++++++++++++++ custom/ai.nix | 19 +++++ custom/games.nix | 30 +++++++ custom/hyprland.nix | 15 ++++ custom/locale.nix | 15 ++++ custom/mount.nix | 33 ++++++++ custom/packages.nix | 134 ++++++++++++++++++++++++++++++ custom/services.nix | 74 +++++++++++++++++ flake.lock | 164 +++++++++++++++++++++++++++++++++++++ flake.nix | 53 ++++++++++++ hardware-configuration.nix | 39 +++++++++ 11 files changed, 733 insertions(+) create mode 100644 configuration.nix create mode 100644 custom/ai.nix create mode 100755 custom/games.nix create mode 100644 custom/hyprland.nix create mode 100755 custom/locale.nix create mode 100755 custom/mount.nix create mode 100755 custom/packages.nix create mode 100755 custom/services.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..e71cb9a --- /dev/null +++ b/configuration.nix @@ -0,0 +1,157 @@ +#e Edit this configuration file to define what should be installed on +# Hi +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./custom/packages.nix + ./custom/mount.nix + ./custom/locale.nix + ./custom/services.nix + ./custom/games.nix + ./custom/hyprland.nix + ./custom/ai.nix + ]; + + # Optimization + nix = { + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + optimise = { + automatic = true; + dates = [ "weekly" ]; + }; + settings.experimental-features = [ "nix-command" "flakes"]; + }; + +# Bootloader. + boot = { + initrd.kernelModules = [ "amdgpu" ]; + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + #extraModulePackages = []; + kernelModules = [ "amdgpu" "i2c-dev" "i2c-piix4" ]; + kernelParams = [ + "acpi_enforce_resources=lax" + "quiet" + "udev.log_level=3" + "systemd.show_status=auto" + ]; + kernelPackages = pkgs.linuxPackages_zen; + plymouth = { + enable = true; + theme = "lone"; + themePackages = with pkgs; [ + # By default we would install all themes + (adi1090x-plymouth-themes.override { + selected_themes = [ "lone" ]; + }) + ]; + }; + + # Enable "Silent boot" + #consoleLogLevel = 3; + #initrd.verbose = false; + #loader.timeout = 0; + }; + + powerManagement.cpufreq.max = 4200000; + powerManagement.cpuFreqGovernor = "powersave"; + + time.timeZone = "Europe/Berlin"; + + networking = { + hostName = "peceli"; + firewall.enable = true; + networkmanager.enable = true; + firewall.allowedTCPPorts = [ 9943 9944 22000 53317 ]; + firewall.allowedUDPPorts = [ 9943 9944 53317 ]; + }; + +#Configs + nixpkgs.config.allowUnfree = true; + + fonts.packages = with pkgs; [ + nerd-fonts.caskaydia-cove + ]; + + virtualisation = { + docker.enable = true; + libvirtd = { + enable = true; + qemu.vhostUserPackages = with pkgs; [ virtiofsd ]; + }; + }; + +#User config + users = { + defaultUserShell = pkgs.zsh; + groups.wireshark.gid = 500; + users = { + robin = { + isNormalUser = true; + description = "robin"; + extraGroups = [ "audio" "wireshark" "libvirtd" "networkmanager" "wheel" "docker"]; + packages = with pkgs; [ + flatpak + ]; + shell = pkgs.zsh; # Set shell to zsh + ignoreShellProgramCheck = true; + }; + }; + groups.i2c.members = [ "robin" ]; + }; + +#hardware + hardware = { + graphics = { + enable = true; + enable32Bit = true; + }; + bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + DiscoverableTimeout = 0; + Experimental = true; + FastConnectable = true; + }; + Policy = { + AutoEnable = true; + }; + }; + }; + }; + +#Programs + programs = { + wireshark.enable = true; + virt-manager.enable = true; + kdeconnect.enable = true; + noisetorch.enable = true; + partition-manager.enable = true; + zsh.enable = true; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryPackage = pkgs.pinentry-tty; + }; +# hyprland = { +# enable = true; +# withUWSM = true; # recommended for most users +# #xwayland.enable = true; +# }; + }; + + system.stateVersion = "26.05"; # Did you read the comment? + +} diff --git a/custom/ai.nix b/custom/ai.nix new file mode 100644 index 0000000..b05be9f --- /dev/null +++ b/custom/ai.nix @@ -0,0 +1,19 @@ +{config, pkgs, pkgs-stable, ...}:{ + + services.open-webui = { + package = pkgs-stable.open-webui; # pkgs must be from stable, for example nixos-24.11 + enable = true; + port = 8083; + environment = { + ANONYMIZED_TELEMETRY = "False"; + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + OLLAMA_API_BASE_URL = "http://127.0.0.1:11434/api"; + OLLAMA_BASE_URL = "http://127.0.0.1:11434"; + }; + }; + services.ollama = { + enable = true; + package = pkgs.ollama-rocm; + }; +} diff --git a/custom/games.nix b/custom/games.nix new file mode 100755 index 0000000..38c41f4 --- /dev/null +++ b/custom/games.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ...}: +{ + environment = { + systemPackages = with pkgs; [ + #gamescope_git + #mesa_git + obs-studio + protonup-ng + prismlauncher + steam + heroic + mangohud + ]; + + sessionVariables = { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; + }; + }; + + #chaotic.mesa-git.enable = true; + programs = { + steam.gamescopeSession.enable = true; + gamemode.enable = true; + steam = { + enable = true; + remotePlay.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + }; +} diff --git a/custom/hyprland.nix b/custom/hyprland.nix new file mode 100644 index 0000000..1c12e42 --- /dev/null +++ b/custom/hyprland.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: { + environment.systemPackages = (with pkgs; [ + rofi + hyprcursor + swww + hyprland + hyprlock + hyprsunset + ]); + programs.hyprland = { + enable = true; + withUWSM = true; # recommended for most users + #xwayland.enable = true; + }; +} diff --git a/custom/locale.nix b/custom/locale.nix new file mode 100755 index 0000000..04a35d6 --- /dev/null +++ b/custom/locale.nix @@ -0,0 +1,15 @@ +{ config, ... }: +{ + 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"; + }; +} diff --git a/custom/mount.nix b/custom/mount.nix new file mode 100755 index 0000000..5fb3a7f --- /dev/null +++ b/custom/mount.nix @@ -0,0 +1,33 @@ +{ config, ... }: +{ + +boot.supportedFilesystems = [ "ntfs" ]; + +fileSystems."/run/media/robin/2nd_ssd" = { + device = "/dev/disk/by-uuid/ab6209bf-0171-43f6-b652-7e37656da7e9"; + fsType = "btrfs"; + options = [ + "nofail" + "x-gvfs-show" + ]; + }; + +fileSystems."/run/media/robin/1tb_volume2_lol" = { + device = "/dev/disk/by-uuid/2C81D8DF06D810EF"; + fsType = "ntfs-3g"; + options = [ + "nofail" + "rw" + "x-gvfs-show" + ]; + }; + +fileSystems."/run/media/robin/1tb_volume" = { + device = "/dev/disk/by-uuid/fae13c7f-1e3e-4fb4-aea0-2c08297e26b5"; + fsType = "btrfs"; + options = [ + "nofail" + "x-gvfs-show" + ]; + }; +} diff --git a/custom/packages.nix b/custom/packages.nix new file mode 100755 index 0000000..d5d8744 --- /dev/null +++ b/custom/packages.nix @@ -0,0 +1,134 @@ +{ pkgs, inputs, pkgs-stable, ... }: +{ + environment.systemPackages = (with pkgs; [ + krita + wget + vim + neovim + fastfetch + waybar + swaynotificationcenter + kitty + nautilus + ranger + ly + zsh + stow + git + firefox + kanata + bat + kdePackages.kdeconnect-kde + pkgs.fzf + zoxide + killall + pkgs.eza + discord + pavucontrol + docker + docker-compose + keepassxc + tmux + nwg-look + zip + unzip + (pkgs.catppuccin-gtk.override { + accents = [ "pink" ]; # You can specify multiple accents here to output multiple themes + size = "compact"; + variant = "frappe"; + }) + bashmount + kdePackages.partitionmanager + rsync + cmatrix + cowsay + fortune + qbittorrent + gdu + calc + unp + noisetorch + signal-desktop + element-desktop + revolt-desktop + localsend + mpd + ghostty + gcc + oh-my-posh + mpv + qimgv + grim + slurp + sl + (pass.withExtensions (exts: [ exts.pass-import ])) + python3 + wl-clipboard + pinentry-tty + mpc + ripgrep + fd + unixtools.netstat + clerk + alsa-utils + kdePackages.okular + progress + tor-browser + obsidian + libreoffice + scrcpy + colloid-icon-theme + pigz + asciinema + asciinema-agg + nmap + gimp + duf + linuxKernel.packages.linux_zen.cpupower + home-manager + iperf3 + vesktop + lutris + btop-rocm + lm_sensors + pipes + cbonsai + inkscape + asciiquarium-transparent + wireshark + termshark + monero-gui + rmpc + yt-dlp + vulnix + ffmpeg + croc + spotdl + supertuxkart + testdisk + testdisk-qt + htop + ungoogled-chromium + syncthing + samba + sssnake + droidcam + obs-studio-plugins.droidcam-obs + nitch + tomb + wine + linux-wallpaperengine + fusee-nano + ppsspp + alvr + lact + librewolf + nvtopPackages.amd + xhost + rpi-imager + powertop + i2c-tools + spotify + termdown + ]); +} diff --git a/custom/services.nix b/custom/services.nix new file mode 100755 index 0000000..a2403bc --- /dev/null +++ b/custom/services.nix @@ -0,0 +1,74 @@ +{ config, pkgs, ... }: +{ +#Services: +security.rtkit.enable = true; + +services = { + hardware.openrgb = { + enable = true; + package = pkgs.openrgb-with-all-plugins; + motherboard = "amd"; + startupProfile = "meow"; + }; + sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; # only needed for Wayland -- omit this when using with Xorg + openFirewall = true; + }; + lact.enable = true; + syncthing = { + enable = true; + #group = "mygroupname"; + user = "robin"; + dataDir = "/home/robin/Documents"; # Default folder for new synced folders + configDir = "/home/robin/.config/syncthing"; # Folder for Syncthing's settings and keys + }; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + jack.enable = true; + }; + qemuGuest.enable = true; + spice-vdagentd.enable = true; + pcscd.enable = true; + udisks2.enable = true; + flatpak.enable = true; + gvfs.enable = true; + displayManager.ly = { + enable = true; + settings = { + animation = "colormix"; + }; + }; + openssh.enable = true; + xserver.xkb = { + layout = "us"; + variant = ""; + }; + kanata = { + enable = true; + keyboards = { + internalKeyboard = { + extraDefCfg = "process-unmapped-keys yes"; + config = '' + (defsrc + caps + ) + + (defalias + escctrl (tap-hold 300 100 caps lmet) + ) + + (deflayer base + @escctrl + ) + ''; + }; + }; + }; +}; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1db4f45 --- /dev/null +++ b/flake.lock @@ -0,0 +1,164 @@ +{ + "nodes": { + "catppuccin": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1774799062, + "narHash": "sha256-U9RGxFsLeKivD1+7sVXj5TltHGfB4m/dkn3dENT2fSM=", + "owner": "catppuccin", + "repo": "nix", + "rev": "948a8ee84858d053b83f01c8c168f9f4347937e6", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1774738535, + "narHash": "sha256-2jfBEZUC67IlnxO5KItFCAd7Oc+1TvyV/jQlR+2ykGQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "769e07ef8f4cf7b1ec3b96ef015abec9bc6b1e2a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773422513, + "narHash": "sha256-MPjR48roW7CUMU6lu0+qQGqj92Kuh3paIulMWFZy+NQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ef12a9a2b0f77c8fa3dda1e7e494fca668909056", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773821835, + "narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1774388614, + "narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1774386573, + "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1774769488, + "narHash": "sha256-xxtoCIonfzlaYUb8B39Mho12TY8PU3Qy1FytCQ6JUCk=", + "ref": "refs/heads/master", + "rev": "ee1100eb98d5033d8d4b76bf9fb0e720fec4c191", + "revCount": 780, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, + "root": { + "inputs": { + "catppuccin": "catppuccin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable", + "quickshell": "quickshell", + "zen-browser": "zen-browser" + } + }, + "zen-browser": { + "inputs": { + "home-manager": "home-manager_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1774708879, + "narHash": "sha256-rTYvYkQL69/YkZB+MRA/IaX1qJ1lPx5KXoQS2/9+7Mw=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "d01d23c798cceef42307d5789bfbce70515e8800", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..08815fc --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Nixos config flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11"; + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + catppuccin.url = "github:catppuccin/nix"; + # IMPORTANT + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + quickshell = { + url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, nixpkgs-stable, home-manager, zen-browser, catppuccin, quickshell, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-stable = import nixpkgs { system = "${system}"; config.allowUnfree = true; }; + in { + nixosConfigurations = { + peceli = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit pkgs-stable; + }; + modules = [ + ./configuration.nix + catppuccin.nixosModules.catppuccin + ({pkgs, ...}: { + environment.systemPackages = [ + zen-browser.packages.${system}.default + quickshell.packages.${system}.default + ]; + }) + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + } + ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..08cd478 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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/4e6c7445-aaa7-45a4-8e24-a6a555656be5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9E04-B5B4"; + 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.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}