From 428cc395c98eccf92094639c9727f4c598394265 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Wed, 28 Feb 2024 06:48:35 -0300 Subject: [PATCH] fix: adjust for laptops' needs --- hardware-configuration.nix | 33 +++++++----------------------- nixos.nix | 32 ++--------------------------- programs/hyprland/default.nix | 25 +++++++++++----------- scripts/hyprland/screenshot.sh | 2 +- scripts/hyprland/start_services.sh | 8 ++------ services/caddy.nix | 24 ---------------------- services/jellyfin.nix | 20 ------------------ 7 files changed, 24 insertions(+), 120 deletions(-) delete mode 100644 services/caddy.nix delete mode 100644 services/jellyfin.nix diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 7ef132d..ecb837f 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -5,45 +5,26 @@ { imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") + [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { - device = "/dev/disk/by-uuid/65e4c115-aff0-4c0e-8799-7309a25ecab6"; + { device = "/dev/disk/by-uuid/796d5ad8-db83-4c4f-883d-2f1f4f1937de"; fsType = "ext4"; }; + boot.initrd.luks.devices."luks-94d233be-889a-46a4-9c20-b7f026980cbf".device = "/dev/disk/by-uuid/94d233be-889a-46a4-9c20-b7f026980cbf"; + fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/2EFE-3A26"; + { device = "/dev/disk/by-uuid/CA05-302F"; fsType = "vfat"; }; - fileSystems."/mnt/ssd" = - { - device = "/dev/disk/by-uuid/f27f2224-d351-46fd-89f5-991de36166ad"; - fsType = "ext4"; - }; - - fileSystems."/mnt/internal" = - { - device = "/dev/disk/by-uuid/b8541c0d-9146-4388-b217-431f196957cc"; - fsType = "ext4"; - }; - - fileSystems."/mnt/media" = - { - device = "/dev/disk/by-uuid/52c17b8b-46c1-4870-b86c-c3b9f4bd4434"; - fsType = "ext4"; - }; - swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -52,7 +33,7 @@ # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.docker0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/nixos.nix b/nixos.nix index dd24340..80cee71 100644 --- a/nixos.nix +++ b/nixos.nix @@ -13,9 +13,6 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix - # Include service configuration - ./services/caddy.nix - ./services/jellyfin.nix ]; # Enable experimental features @@ -46,9 +43,6 @@ # Kernel boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; - # Add AMD drivers. - boot.initrd.kernelModules = [ "amdgpu" ]; - # TODO: FIX IT BEING BEING OVERWRITTEN boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; @@ -74,18 +68,9 @@ # Open ports in the firewall. networking.firewall = { - allowedTCPPorts = [ - 11753 # OpenRCT2 - 443 # SSL - 80 # HTTP - ]; + allowedTCPPorts = [ ]; - allowedUDPPorts = [ - 11753 # OpenRCT2 - 2626 # Dolphin emulator - 27015 # Source games - 8211 # Palworld - ]; + allowedUDPPorts = [ ]; allowedTCPPortRanges = [ { from = 1714; to = 1764; } # KDEConnect @@ -114,8 +99,6 @@ openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDdGOyRbu6IOw9yqotxE6m7wCif7oP/2D0tlREa5Q6uo Alexandre Cavalheiro S. Tiago da Silva " - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIISfCUsZrnCMZapdrvkUCrdRiX+1xuZBdGrynNRzDI2v" # SpaceEEC - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPInBFp7zBLhFluoww65CZzcnMdhndTawBv8QYJ5s/Xt david.alejandro.rubio@gmail.com" # Kodehawa ]; }; @@ -163,12 +146,6 @@ }; services.blueman.enable = true; - # Enable openrazer for managing Razer products' configuration - hardware.openrazer = { - enable = true; - users = [ "wizardlink" ]; - }; - # Enable xpadneo support. hardware.xpadneo.enable = true; @@ -301,11 +278,6 @@ ## Libraries libsForQt5.qt5.qtgraphicaleffects libsForQt5.qt5.qtquickcontrols2 - pkgsi686Linux.gperftools # Needed for TF2 rn :( - - ## Hardware specific - openrazer-daemon # Razor products back-end - polychromatic # and it's Front-end ]; # Some programs need SUID wrappers, can be configured further or are diff --git a/programs/hyprland/default.nix b/programs/hyprland/default.nix index cf6bcdc..c096071 100644 --- a/programs/hyprland/default.nix +++ b/programs/hyprland/default.nix @@ -82,8 +82,7 @@ autogenerated = 0 # remove this line to remove the warning # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor = DP-3, 1920x1080@75, 2560x0, 1 - monitor = DP-2, 2560x1440@165, 0x0, 1 + monitor = eDP-1, 1920x1080@60.00800, 0x0, 1 # See https://wiki.hyprland.org/Configuring/Keywords/ for more @@ -115,7 +114,7 @@ } device:wacom-bamboo-one-m-pen { - output = DP-2 + output = eDP-1 } general { @@ -190,16 +189,16 @@ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # Bind workspaces to specific monitors - workspace = 1, monitor:DP-2 - workspace = 2, monitor:DP-3 - workspace = 3, monitor:DP-2 - workspace = 4, monitor:DP-3 - workspace = 5, monitor:DP-2 - workspace = 6, monitor:DP-3 - workspace = 7, monitor:DP-2 - workspace = 8, monitor:DP-3 - workspace = 9, monitor:DP-2 - workspace = 0, monitor:DP-3 + workspace = 1, monitor:eDP-1 + workspace = 2, monitor:eDP-1 + workspace = 3, monitor:eDP-1 + workspace = 4, monitor:eDP-1 + workspace = 5, monitor:eDP-1 + workspace = 6, monitor:eDP-1 + workspace = 7, monitor:eDP-1 + workspace = 8, monitor:eDP-1 + workspace = 9, monitor:eDP-1 + workspace = 0, monitor:eDP-1 # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER diff --git a/scripts/hyprland/screenshot.sh b/scripts/hyprland/screenshot.sh index e5e91cc..b32f08b 100755 --- a/scripts/hyprland/screenshot.sh +++ b/scripts/hyprland/screenshot.sh @@ -2,5 +2,5 @@ FILE_PATH="/mnt/internal/personal/screenshots/$(date +'%Y-%m-%d_%H-%M-%S').png" -grim -t png -o DP-2 $FILE_PATH +grim -t png -o eDP-1 $FILE_PATH wl-copy <$FILE_PATH diff --git a/scripts/hyprland/start_services.sh b/scripts/hyprland/start_services.sh index c70cfcc..e5bdf89 100755 --- a/scripts/hyprland/start_services.sh +++ b/scripts/hyprland/start_services.sh @@ -8,15 +8,11 @@ waybar & # ## Start wallpaper daemon and set one. # -OUTPUT_1="DP-2" -IMAGE_1="/mnt/internal/personal/wallpapers/wallhaven-g71xoe.jpg" - -OUTPUT_2="DP-3" -IMAGE_2="/mnt/internal/personal/wallpapers/wallhaven-3zjexv.jpg" +OUTPUT_1="eDP-1" +IMAGE_1="~/Pictures/wallhaven-x6p3y3.jpg" function load_wallpapers() { swww img -t any --transition-bezier 0.0,0.0,1.0,1.0 --transition-duration .8 --transition-step 255 --transition-fps 60 -o $OUTPUT_1 $IMAGE_1; - swww img -t any --transition-bezier 0.0,0.0,1.0,1.0 --transition-duration .8 --transition-step 255 --transition-fps 60 -o $OUTPUT_2 $IMAGE_2 } if ! swww query; then diff --git a/services/caddy.nix b/services/caddy.nix deleted file mode 100644 index ef9a55c..0000000 --- a/services/caddy.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ ... }: -{ - services.caddy = { - enable = true; - - virtualHosts."thewizard.link".extraConfig = '' - redir https://github.com/wizardlink/ - header Strict-Transport-Security "max-age=63072000; includeSubDomains" - ''; - - virtualHosts."jellyfin.thewizard.link".extraConfig = '' - encode gzip - reverse_proxy 127.0.0.1:8096 { - flush_interval -1 - } - ''; - - virtualHosts."foundry.thewizard.link".extraConfig = '' - reverse_proxy 127.0.0.1:30000 { - flush_interval -1 - } - ''; - }; -} diff --git a/services/jellyfin.nix b/services/jellyfin.nix deleted file mode 100644 index cb7b5d4..0000000 --- a/services/jellyfin.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: - -{ - services.jellyfin = { - enable = true; - openFirewall = true; - user = "wizardlink"; - - package = pkgs.jellyfin.override { - jellyfin-web = pkgs.jellyfin-web.overrideAttrs (oldAttrs: { - patches = [ - (pkgs.fetchpatch { - url = "https://github.com/jellyfin/jellyfin-web/compare/v${oldAttrs.version}...ConfusedPolarBear:jellyfin-web:intros.diff"; - hash = "sha256-qm4N4wMUFc4I53oQJUK1Six0cahVYz3J+FgO2vvSvXM="; - }) - ]; - }); - }; - }; -}