From c792ddc54b479e29ec61c6a81836daf542ef0797 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Thu, 16 Jan 2025 21:26:48 +0100 Subject: [PATCH] try hyprland instead --- hosts/spectre-x360-2018/default.nix | 2 +- modules/home-manager/backup.nix | 34 ++++++++++++------- .../home-manager/hyprland-customization.nix | 5 +++ modules/nixos/hyprland.nix | 18 ++++++++++ modules/nixos/nvidia.nix | 15 ++++---- users/remy.nix | 2 +- 6 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 modules/home-manager/hyprland-customization.nix create mode 100644 modules/nixos/hyprland.nix diff --git a/hosts/spectre-x360-2018/default.nix b/hosts/spectre-x360-2018/default.nix index 5a887b2..05cac3b 100644 --- a/hosts/spectre-x360-2018/default.nix +++ b/hosts/spectre-x360-2018/default.nix @@ -5,7 +5,7 @@ ./configuration.nix ./hardware-configuration.nix ../../modules/nixos/flatpak.nix - ../../modules/nixos/gdm.nix + ../../modules/nixos/hyprland.nix ../../modules/nixos/monitoring.nix ../../modules/nixos/nvidia.nix ../../modules/nixos/pipewire.nix diff --git a/modules/home-manager/backup.nix b/modules/home-manager/backup.nix index fb1d7ab..dfebe68 100644 --- a/modules/home-manager/backup.nix +++ b/modules/home-manager/backup.nix @@ -1,17 +1,25 @@ {pkgs, ...}: { - # Add a udev rule that launches a backup using restic when a specific USB device (the backup drive) is plugged in + # Add a udev rule that launches a backup using restic when a specific USB device (the backup drive) is plugged in - environment.systemPackages = with pkgs; [ - restic - ]; - services.udev.packages = [ - (pkgs.writeTextFile { - name = "bakc"; - text = '' - SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", ATTRS{idProduct}=="1969", MODE="0666", TAG+="uaccess", SYMLINK+="stm32_dfu", GROUP="plugdev" - ''; - destination = "/etc/udev/rules.d/50-zsa.rules"; - }) - ]; + environment.systemPackages = with pkgs; [ + restic + ]; + + # the udev rule: + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_LABEL}=="backup-restic", TAG+="systemd", ENV{SYSTEMD_WANTS}="backup-restic.service" + ''; + + # the systemd service: + systemd.services.backup-restic = { + description = "Backup using restic (triggered when USB drive is plugged in)"; + after = [ "local-fs.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + # TODO: adapt command + ExecStart = "${pkgs.restic}/bin/restic backup /home/username"; + }; + }; } \ No newline at end of file diff --git a/modules/home-manager/hyprland-customization.nix b/modules/home-manager/hyprland-customization.nix new file mode 100644 index 0000000..0898aad --- /dev/null +++ b/modules/home-manager/hyprland-customization.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: +{ + wayland.windowManager.hyprland.enable = true; + programs.kitty.enable = true; +} diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix new file mode 100644 index 0000000..c8e2d84 --- /dev/null +++ b/modules/nixos/hyprland.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + programs.hyprland = { + enable = true; + }; + + environment.systemPackages = [ + # ... other packages + pkgs.hyprlandPlugins.hyprspace + pkgs.hyprlandPlugins.hyprgrass + ]; + +} diff --git a/modules/nixos/nvidia.nix b/modules/nixos/nvidia.nix index e9b8a44..b0d0635 100644 --- a/modules/nixos/nvidia.nix +++ b/modules/nixos/nvidia.nix @@ -17,19 +17,18 @@ enable = true; }; hardware.nvidia = { - prime = { - nvidiaBusId = "PCI:1:0:0"; - intelBusId = "PCI:0:2:0"; - - }; + # prime = { + # nvidiaBusId = "PCI:1:0:0"; + # intelBusId = "PCI:0:2:0"; + # }; modesetting.enable = true; - powerManagement.enable = false; + powerManagement.enable = true; powerManagement.finegrained = false; open = false; nvidiaSettings = false; package = config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "565.77"; # latest + version = "565.77"; sha256_64bit = "sha256-CnqnQsRrzzTXZpgkAtF7PbH9s7wbiTRNcM0SPByzFHw="; sha256_aarch64 = "sha256-LSAYUnhfnK3rcuPe1dixOwAujSof19kNOfdRHE7bToE="; openSha256 = "sha256-Fxo0t61KQDs71YA8u7arY+503wkAc1foaa51vi2Pl5I="; @@ -37,7 +36,7 @@ persistencedSha256 = "sha256-wnDjC099D8d9NJSp9D0CbsL+vfHXyJFYYgU3CwcqKww="; }; }; - + # overwrite the blacklists set previously boot.extraModprobeConfig = ""; boot.blacklistedKernelModules = []; services.udev.extraRules = ""; diff --git a/users/remy.nix b/users/remy.nix index 6592b1b..a4d628f 100644 --- a/users/remy.nix +++ b/users/remy.nix @@ -6,7 +6,7 @@ with lib.hm.gvariant; ../modules/home-manager/code.nix ../modules/home-manager/fish.nix ../modules/home-manager/flatpaks.nix - ../modules/home-manager/gnome-shell-customization.nix + # ../modules/home-manager/gnome-shell-customization.nix ../modules/home-manager/keepassxc.nix ../modules/home-manager/obsidian.nix ../modules/home-manager/owncloud-client.nix