From becce8eea282bc9ec27436014847da8ef8261d22 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Tue, 17 Sep 2024 12:28:29 -0300 Subject: [PATCH 1/4] fix(Hyprland): move workspaces to be specific to host --- .../home-manager/programs/hyprland/default.nix | 12 ------------ specific/desktop/home-manager.nix | 12 ++++++++++++ specific/laptop/home-manager.nix | 15 +++++++++++++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/modules/home-manager/programs/hyprland/default.nix b/modules/home-manager/programs/hyprland/default.nix index 0eabf51..aeca597 100644 --- a/modules/home-manager/programs/hyprland/default.nix +++ b/modules/home-manager/programs/hyprland/default.nix @@ -255,18 +255,6 @@ # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # 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 - # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER diff --git a/specific/desktop/home-manager.nix b/specific/desktop/home-manager.nix index 22f7d8e..729719b 100644 --- a/specific/desktop/home-manager.nix +++ b/specific/desktop/home-manager.nix @@ -35,5 +35,17 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor = DP-3, 1920x1080@74.973, 2560x0, 1 monitor = DP-2, 2560x1440@165.00301, 0x0, 1 + + # 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 ''; } diff --git a/specific/laptop/home-manager.nix b/specific/laptop/home-manager.nix index 7993919..ef4839c 100644 --- a/specific/laptop/home-manager.nix +++ b/specific/laptop/home-manager.nix @@ -32,7 +32,18 @@ modules.hyprland.extraConfig = # hyprlang '' # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor = DP-3, 1920x1080@74.973, 2561x0, 1 - monitor = DP-2, 2560x1440@165.00301, 0x0, 1 + monitor = eDP-1, 1920x1080@60.01, 0x0, 1 + + # Bind workspaces to specific monitors + 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 ''; } From 108cfa8e807a4582d6746b7b1af24b52a82ab711 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Tue, 17 Sep 2024 12:29:15 -0300 Subject: [PATCH 2/4] fix(desktop): move wallpaper daemon to be specific to host --- .../scripts/hyprland/start_services.sh | 20 ++----------- specific/desktop/home-manager.nix | 29 +++++++++++++++++++ specific/laptop/home-manager.nix | 25 ++++++++++++++++ 3 files changed, 57 insertions(+), 17 deletions(-) diff --git a/modules/home-manager/scripts/hyprland/start_services.sh b/modules/home-manager/scripts/hyprland/start_services.sh index e0e509f..59c3a09 100755 --- a/modules/home-manager/scripts/hyprland/start_services.sh +++ b/modules/home-manager/scripts/hyprland/start_services.sh @@ -15,25 +15,11 @@ waybar & # xwaylandvideobridge & + # -## Start wallpaper daemon and set one. +# Start wallpaper daemon # -OUTPUT_1="DP-2" -IMAGE_1="/mnt/internal/personal/wallpapers/wallhaven-vqlvm8.jpg" - -OUTPUT_2="DP-3" -IMAGE_2="/mnt/internal/personal/wallpapers/wallhaven-2yl6px.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 - swww-daemon & -fi - -load_wallpapers & +~/.local/share/scripts/wallpaper.sh & # # Start notification daemon. diff --git a/specific/desktop/home-manager.nix b/specific/desktop/home-manager.nix index 729719b..c86fa5c 100644 --- a/specific/desktop/home-manager.nix +++ b/specific/desktop/home-manager.nix @@ -29,6 +29,35 @@ EDITOR = "nvim"; }; + home.file = { + # Create wallpaper script to be read by the start_services.sh script. + ".local/share/scripts/wallpaper.sh" = { + executable = true; + text = # sh + '' + # + ## Start wallpaper daemon and set one. + # + OUTPUT_1="DP-2" + IMAGE_1="/mnt/internal/personal/wallpapers/wallhaven-vqlvm8.jpg" + + OUTPUT_2="DP-3" + IMAGE_2="/mnt/internal/personal/wallpapers/wallhaven-2yl6px.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 + swww-daemon & + fi + + load_wallpapers & + ''; + }; + }; + # Add monitor configuration to hyprland modules.hyprland.extraConfig = # hyprlang '' diff --git a/specific/laptop/home-manager.nix b/specific/laptop/home-manager.nix index ef4839c..9f00157 100644 --- a/specific/laptop/home-manager.nix +++ b/specific/laptop/home-manager.nix @@ -28,6 +28,31 @@ EDITOR = "nvim"; }; + home.file = { + # Create wallpaper script to be read by the start_services.sh script. + ".local/share/scripts/wallpaper.sh" = { + executable = true; + text = # sh + '' + # + ## Start wallpaper daemon and set one. + # + OUTPUT_1="eDP-1" + IMAGE_1="/home/wizardlink/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; + } + + if ! swww query; then + swww-daemon & + fi + + load_wallpapers & + ''; + }; + }; + # Add monitor configuration to hyprland modules.hyprland.extraConfig = # hyprlang '' From d217ebc911e14b7f893b13e2b8ccbbb9d403eec5 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Tue, 17 Sep 2024 12:29:35 -0300 Subject: [PATCH 3/4] fix(laptop): add hardware-configuration --- specific/laptop/hardware-configuration.nix | 53 ++++++++++++++++++++++ specific/laptop/nixos.nix | 1 + 2 files changed, 54 insertions(+) create mode 100644 specific/laptop/hardware-configuration.nix diff --git a/specific/laptop/hardware-configuration.nix b/specific/laptop/hardware-configuration.nix new file mode 100644 index 0000000..3b29b09 --- /dev/null +++ b/specific/laptop/hardware-configuration.nix @@ -0,0 +1,53 @@ +# 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" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + 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/CA05-302F"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + 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.docker0.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/specific/laptop/nixos.nix b/specific/laptop/nixos.nix index 4d0ce8e..e607877 100644 --- a/specific/laptop/nixos.nix +++ b/specific/laptop/nixos.nix @@ -3,6 +3,7 @@ { imports = [ ../../modules/nixos + ./hardware-configuration.nix ./hardware.nix ]; From fc96d1d0ae2247939eaebd12cdeaea702cd54ea7 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Tue, 17 Sep 2024 12:30:05 -0300 Subject: [PATCH 4/4] fix(desktop): make WoL specific to it --- modules/nixos/system.nix | 3 --- specific/desktop/nixos.nix | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/nixos/system.nix b/modules/nixos/system.nix index 2abe44a..c9640bc 100644 --- a/modules/nixos/system.nix +++ b/modules/nixos/system.nix @@ -27,9 +27,6 @@ # Enable networking networking.networkmanager.enable = true; - # Enable WOL on my ethernet interface. - networking.interfaces.enp5s0.wakeOnLan.enable = true; - # Define variables that will be initialized in PAM. environment.sessionVariables = { # Set env for Fcitx5 diff --git a/specific/desktop/nixos.nix b/specific/desktop/nixos.nix index 3b59bcd..2514b97 100644 --- a/specific/desktop/nixos.nix +++ b/specific/desktop/nixos.nix @@ -131,4 +131,11 @@ LC_TIME = "en_GB.UTF-8"; }; }; + + # + # NETWORK # + # + + # Enable WOL on my ethernet interface. + networking.interfaces.enp5s0.wakeOnLan.enable = true; }