From 2418424adabca0a1616cca4920221cd67149b65a Mon Sep 17 00:00:00 2001 From: Jakub Stachurski Date: Sat, 29 Mar 2025 22:35:21 +0100 Subject: Initial commit (Pre-flakes) --- nixos/GrubBG.png | Bin 0 -> 4109858 bytes nixos/configuration.nix | 314 +++++++++++++++++++++++++++++++++++++++ nixos/hardware-configuration.nix | 156 +++++++++++++++++++ nixos/home-manager.nix | 4 + nixos/services.nix | 3 + 5 files changed, 477 insertions(+) create mode 100644 nixos/GrubBG.png create mode 100644 nixos/configuration.nix create mode 100644 nixos/hardware-configuration.nix create mode 100644 nixos/home-manager.nix create mode 100644 nixos/services.nix (limited to 'nixos') diff --git a/nixos/GrubBG.png b/nixos/GrubBG.png new file mode 100644 index 0000000..0f5028f Binary files /dev/null and b/nixos/GrubBG.png differ diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..b4bd651 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,314 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + + ./home-manager.nix + ./services.nix + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Use the systemd-boot EFI boot loader. + # boot.loader.systemd-boot.enable = true; + boot.loader.grub = { + useOSProber = true; + device = "nodev"; + + + efiSupport = true; + default = "saved"; + memtest86.enable = true; + splashImage = ./GrubBG.png; + }; + boot.loader.efi.canTouchEfiVariables = true; + boot.crashDump.enable = false; + boot.plymouth = { + enable = true; + theme = "bgrt"; + }; + + boot.kernelParams = [ + "quiet" + "splash" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.logpriority=3" + ]; + boot.consoleLogLevel = 0; + + networking.hostName = "icetea-dispenser"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + + # Enable the X11 windowing system. + programs.nix-ld.enable = true; + + services.printing.enable = true; + documentation.dev.enable = true; + services.displayManager.sddm ={ + #package = pkgs.kdePackages.sddm; + enable = true; + wayland.enable = true; + theme="catppuccin-mocha"; + }; + services.xserver.exportConfiguration = true; # This makes it easy to search for a valid keymap + # Enable KDE6 env in case Hyprland gets borked. + # services.desktopManager.plasma6.enable = true; + programs.hyprland.enable = true; + programs.hyprland.withUWSM = true; + programs.uwsm = { + enable = true; + waylandCompositors ={ + hyprland = { + prettyName = "Hyprland"; + comment = "Hyprland compositor managed by UWSM"; + binPath = "/run/current-system/sw/bin/Hyprland"; + }; + }; + }; + + nixpkgs.config.allowUnfree = true; + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # hardware.pulseaudio.enable = true; + # OR + services.pipewire = { + enable = true; + pulse.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + users.users.wilkuu = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" "input" "docker" "adbusers" "libvirtd" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + firefox + nano + ]; + }; + + xdg.portal = { + enable = true; + config = { + common = { + default = [ + "hyprland" + "gtk" + ]; + }; + }; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + zsh + busybox + usbutils + libsForQt5.qtstyleplugins + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + qt6.qtwayland + #qt5.qtwayland + kdePackages.sddm-kcm + sddm + # neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + nano + wget + git + tree + alacritty + kitty + docker + home-manager + wofi + waybar + waybar-mpris + vesktop + wineWowPackages.waylandFull + thunderbolt + catppuccin-sddm + kdePackages.kwallet + kdePackages.kwalletmanager + + virt-viewer + spice + spice-gtk + spice-protocol + win-virtio + win-spice + gnome.adwaita-icon-theme + ]; + + environment.variables = { + QT_STYLE_OVERRIDE = "kvantum"; + QT_QPA_PLATFORM="wayland"; + QT_QPA_PLATFORM_PATH="${pkgs.qt6.qtbase}/lib/qt-${pkgs.qt6.qtbase.version}/plugins/platform"; + }; + + programs.adb.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "24.05"; # Did you read the comment? + + # steam goes here + programs.steam = { + enable = true; + protontricks.enable = true; + }; + + # Fonts +fonts.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk-sans + font-awesome + noto-fonts-emoji + # (nerdfonts.override {fonts = [ "Hermit" ];}) + nerdfonts +]; + + # Input, note the waylandFrontend line + i18n.inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.waylandFrontend = true; + fcitx5.addons = with pkgs; [ + kdePackages.fcitx5-qt + fcitx5-mozc + ]; + }; + + # Bluetooth + hardware.bluetooth.enable = true; + hardware.bluetooth.settings = { + General = {Enable = "Source,Sink,Media,Socket";}; + }; + + hardware.bluetooth.powerOnBoot = true; + services.blueman.enable = true; + + services.avahi = { + enable = true; + nssmdns = true; + publish = { + enable = true; + }; + }; + + + systemd.user.services.mpris-proxy = { + description = "Mpris proxy"; + after = [ "network.target" "sound.target" ]; + wantedBy = [ "default.target" ]; + serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + }; + + + #services.fprintd.enable = true; + #security.pam.services.login.fprintAuth = true; + security.pam.services = { + kdm.enableKwallet = true; + lightdm.enableKwallet = true; + sddm.enableKwallet = true; + slim.enableKwallet = true; + }; + + programs.weylus = { + enable=true; + openFirewall=true; + users=["wilkuu"]; + }; + + ## VM's + programs.dconf.enable = true; + programs.virt-manager.enable = true; + virtualisation = { + docker.enable = true; + libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + vhostUserPackages = with pkgs; [ virtiofsd ]; + ovmf.enable = true; + ovmf.packages = [ pkgs.OVMFFull.fd ]; + }; + }; + spiceUSBRedirection.enable = true; + }; + services.spice-vdagentd.enable = true; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..f321cd0 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,156 @@ +# 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 = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" ]; + # GRUB 2 with UEFI example, chainloading another distro + boot.loader.grub.extraEntries = + '' +menuentry 'UEFI Firmware' $menuentry_id_option 'uefi-firmware' { + fwsetup +} + ''; + fileSystems."/" = + { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; + fsType = "btrfs"; + options = [ "noatime" "compress=zstd" "subvol=root" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; + fsType = "btrfs"; + options = [ "noatime" "compress=zstd" "subvol=home" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; + fsType = "btrfs"; + options = [ "noatime" "compress=zstd" "subvol=nix" ]; + }; + + fileSystems."/snapshots" = + { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; + fsType = "btrfs"; + options = [ "noatime" "compress=zstd" "subvol=snapshots" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/6E1A-07F4"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + fileSystems."/store2" = + { device = "/dev/disk/by-uuid/5368282f-c09d-44cf-9cf2-e69a2d415da6"; + fsType = "btrfs"; + options = [ "noatime" "compress=zstd" "subvol=/"]; + }; + fileSystems."/store1" = + { device = "/dev/disk/by-uuid/6A2E2BFF2E2BC2C5"; + fsType = "ntfs-3g" ; + options = ["rw" "uid=1000" "gid=100"]; + }; + fileSystems."/win_games" = + { device = "/dev/disk/by-uuid/6A680789680752ED"; + fsType = "ntfs-3g" ; + options = ["rw" "uid=1000" "gid=100"]; + }; + + + + swapDevices = + [ { device = "/dev/disk/by-uuid/f1dfc6a1-55f3-4148-9f1d-2a998c3b3168"; } + { device = "/dev/disk/by-uuid/003a819a-e06e-45df-bef6-b3702c2ddb48"; } + ]; + + # Thunderbolt + services.hardware.bolt.enable = true; + powerManagement.enable = true; + + # 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.nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; + + services.resolved = { + enable = true; + dnssec = "false"; + domains = [ "~." ]; + fallbackDns = [ ]; + dnsovertls = "opportunistic"; + }; + + + networking.useDHCP = lib.mkDefault true; + networking.firewall.checkReversePath = false; + + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.enp81s0u1u4.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Enable OpenGL + hardware.graphics = { + enable = true; + }; + + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = ["nvidia"]; + + hardware.nvidia = { + + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + # Currently alpha-quality/buggy, so false is currently the recommended setting. + open = false; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = false; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.production; + + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + + sync.enable = false; + + intelBusId = "PCI:1:0:0"; + nvidiaBusId = "PCI:0:2:0"; + }; + }; +} diff --git a/nixos/home-manager.nix b/nixos/home-manager.nix new file mode 100644 index 0000000..6e76671 --- /dev/null +++ b/nixos/home-manager.nix @@ -0,0 +1,4 @@ +{config, pkgs, ...}: +{ + users.users.wilkuu.isNormalUser = true; +} diff --git a/nixos/services.nix b/nixos/services.nix new file mode 100644 index 0000000..c7fac0e --- /dev/null +++ b/nixos/services.nix @@ -0,0 +1,3 @@ +{config, lib, pkgs, ...}: +{ +} -- cgit v1.3.1