From 830b76bcb6ea3feb790aa2731425df693b5ef2c3 Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Sun, 2 Feb 2025 18:33:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Refactor,=20moved=20monitornames?= =?UTF-8?q?=20to=20common.nix,=20removed=20waypaper=20reload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- common.nix | 4 ++++ configuration.nix | 2 +- flake.nix | 3 ++- home-manager/development/git.nix | 1 + home-manager/hyprland/hypridle/default.nix | 1 + home-manager/hyprland/hyprpaper.nix | 8 +++++--- home-manager/hyprland/settings.nix | 8 +++----- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5edc07d..d2f11e1 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ My NixOS configurations with dotfiles for my desktop | Shell | Fish | | Prompt | Starship | | Theme | Catppuccin | -| GPU | NVidia | +| GPU | Nvidia | | Panel | Hyprpanel | | Runner | Rofi | | Fetch | Fastfetch | diff --git a/common.nix b/common.nix index d22f032..3efff0d 100644 --- a/common.nix +++ b/common.nix @@ -20,6 +20,10 @@ rec { options = "grp:alt_shift_toggle"; # Toggle using ALT + SHIFT }; + # Empty matches all + monitor1 = "DP-1"; + monitor2 = "DP-3"; + username = "martin"; # This value determines the NixOS release from which the default diff --git a/configuration.nix b/configuration.nix index 259c05d..cac4d50 100644 --- a/configuration.nix +++ b/configuration.nix @@ -53,7 +53,7 @@ in vdhcoapp fortune cowsay - inputs.zen-browser.packages."${system}".default # beta + inputs.zen-browser.packages.${system}.default # beta onlyoffice-desktopeditors ]; diff --git a/flake.nix b/flake.nix index f82a2d4..e5eca92 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,7 @@ }: let system = "x86_64-linux"; + hostname = "nixos"; inherit (self) outputs; common = import ./common.nix; in @@ -46,7 +47,7 @@ # Adds the nix fmt command to format nix files formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem { system = system; specialArgs = { inherit outputs inputs; }; # Pass args to modules modules = [ diff --git a/home-manager/development/git.nix b/home-manager/development/git.nix index 943009f..4e87ed3 100644 --- a/home-manager/development/git.nix +++ b/home-manager/development/git.nix @@ -5,6 +5,7 @@ userEmail = "git@martials.no"; aliases = { + amend = "commit --amend"; cm = "commit"; s = "status"; }; diff --git a/home-manager/hyprland/hypridle/default.nix b/home-manager/hyprland/hypridle/default.nix index 111fea1..69768c3 100644 --- a/home-manager/hyprland/hypridle/default.nix +++ b/home-manager/hyprland/hypridle/default.nix @@ -34,4 +34,5 @@ in ]; }; }; + wayland.windowManager.hyprland.settings.exec-once = [ "hypridle" ]; } diff --git a/home-manager/hyprland/hyprpaper.nix b/home-manager/hyprland/hyprpaper.nix index 68f7ac5..5d32197 100644 --- a/home-manager/hyprland/hyprpaper.nix +++ b/home-manager/hyprland/hyprpaper.nix @@ -1,6 +1,8 @@ # Wallpapers { pkgs, ... }: - +let + common = import ../../common.nix; +in { home.packages = with pkgs; [ hyprpaper @@ -25,8 +27,8 @@ ]; wallpaper = [ - "DP-1,${monitor1}" - "DP-3,${monitor2}" + "${common.monitor1},${monitor1}" + "${common.monitor2},${monitor2}" ]; }; }; diff --git a/home-manager/hyprland/settings.nix b/home-manager/hyprland/settings.nix index 5b239b3..195c3df 100644 --- a/home-manager/hyprland/settings.nix +++ b/home-manager/hyprland/settings.nix @@ -1,23 +1,21 @@ { lib, ... }: let common = import ../../common.nix; - app = common.default; theme = import ../../theme.nix; + app = common.default; in { wayland.windowManager.hyprland.settings = { monitor = [ - "DP-1, 3440x1440@175, 0x0, 1" - "DP-3, 3840x2160@60, 3440x0, 1.5, transform, 1" + "${common.monitor1}, 3440x1440@175, 0x0, 1" + "${common.monitor2}, 3840x2160@60, 3440x0, 1.5, transform, 1" ]; # Autostart exec-once = [ app.browser app.terminal - "hypridle" "systemctl --user start hyprpolkitagent" - "waypaper --restore" ]; env = [