diff --git a/flake.lock b/flake.lock index 5e844e8..ab904d1 100644 --- a/flake.lock +++ b/flake.lock @@ -56,11 +56,11 @@ ] }, "locked": { - "lastModified": 1726902823, - "narHash": "sha256-Gkc7pwTVLKj4HSvRt8tXNvosl8RS9hrBAEhOjAE0Tt4=", + "lastModified": 1726785354, + "narHash": "sha256-SLorVhoorZwjM1aS04bBX4fufEXIfkMdAGkj9bu2QAQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "14929f7089268481d86b83ed31ffd88713dcd415", + "rev": "1786e2afdbc48e9038f7cff585069736e1d0ed44", "type": "github" }, "original": { @@ -110,11 +110,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1726918033, - "narHash": "sha256-I0U4OLssUlNd6/KXHwErmgmYZURTJYJNHbeoKaMH4iI=", + "lastModified": 1726761214, + "narHash": "sha256-xaecVNHaxiAXDCUFZzDLMP3jbxpBjQTqT4Bku2z5vGA=", "ref": "refs/heads/main", - "rev": "8579066c7a1ceb745499ea4e11d5d420b1387ec0", - "revCount": 5246, + "rev": "9856378384539e35cd943604e6a4d696a9d25447", + "revCount": 5240, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -193,11 +193,11 @@ ] }, "locked": { - "lastModified": 1726874949, - "narHash": "sha256-PNnIpwGqpTvMU3N2r0wMQwK1E+t4Bb5fbJwblQvr+80=", + "lastModified": 1724966483, + "narHash": "sha256-WXDgKIbzjYKczxSZOsJplCS1i1yrTUpsDPuJV/xpYLo=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "d97af4f6bd068c03a518b597675e598f57ea2291", + "rev": "8976e3f6a5357da953a09511d0c7f6a890fb6ec2", "type": "github" }, "original": { @@ -218,11 +218,11 @@ ] }, "locked": { - "lastModified": 1726840673, - "narHash": "sha256-HIPEXyRRVZoqD6U+lFS1B0tsIU7p83FaB9m7KT/x6mQ=", + "lastModified": 1721324119, + "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "b68dab23fc922eae99306988133ee80a40b39ca5", + "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", "type": "github" }, "original": { @@ -233,11 +233,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726755586, - "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", + "lastModified": 1725983898, + "narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", + "rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43", "type": "github" }, "original": { @@ -249,11 +249,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1726755586, - "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", + "lastModified": 1726463316, + "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", + "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", "type": "github" }, "original": { @@ -279,11 +279,11 @@ ] }, "locked": { - "lastModified": 1726892163, - "narHash": "sha256-LZkatWOJcdJ1FvhWNFl54r8aDcnIfeZC5MLtzN15vMc=", + "lastModified": 1726719408, + "narHash": "sha256-r/dXHHa6py/fKy087nGt4k3GoBjqFvpyZCsyRsXl0IA=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "426f126ac7014ba7076ddcbf2fafa87c2962d908", + "rev": "49bb2ac8bdca209d235feabb9551dd09a5eb8ec9", "type": "github" }, "original": { @@ -314,14 +314,6 @@ "hyprland", "hyprlang" ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -332,11 +324,11 @@ ] }, "locked": { - "lastModified": 1726851729, - "narHash": "sha256-1z0esr5lBeUMlrPZ9gZmqZT8oTQekxJi53HAW4cH0Ms=", + "lastModified": 1726046979, + "narHash": "sha256-6SEsjurq9cdTkITA6d49ncAJe4O/8CgRG5/F//s6Xh8=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "73b8c4f1150040644cf678aa8bbf2cec48a433cf", + "rev": "e695669fd8e1d1be9eaae40f35e00f8bd8b64c18", "type": "github" }, "original": { diff --git a/modules/home-manager/common.nix b/modules/home-manager/common.nix index 13f8dfe..4600d9d 100644 --- a/modules/home-manager/common.nix +++ b/modules/home-manager/common.nix @@ -70,6 +70,71 @@ source = ./scripts; recursive = true; }; + + ".local/share/scripts/hyprland/start_services.sh" = { + executable = true; + text = # sh + '' + #!/bin/sh + + # + # Make sure xdg-desktop-portal-hyprland has access to what it needs + # + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP & + + # + # Start waybar. + # + waybar & + + # + # Start xwaylandvideobridge + # + xwaylandvideobridge & + + + # + # Start wallpaper daemon + # + ~/.local/share/scripts/wallpaper.sh & + + # + # Start notification daemon. + # + mako & + + # + # Start polkit agent + # + ${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 + + # + # Start kwallet service + # + kwalletd6 & + + # + # Start kdeconnect daemon + # + kdeconnectd & + + # + # Clipboard manager + # + wl-paste --type text --watch cliphist store & + wl-paste --type image --watch cliphist store & + + # + # Start Fcitx5 + # + fcitx5 & + + # + # Start the blueman applet for managing bluetooth devices + # + blueman-applet & + ''; + }; }; # Configure XDG diff --git a/modules/home-manager/programs/hyprland/default.nix b/modules/home-manager/programs/hyprland/default.nix index a409aa8..aeca597 100644 --- a/modules/home-manager/programs/hyprland/default.nix +++ b/modules/home-manager/programs/hyprland/default.nix @@ -1,30 +1,15 @@ -{ - config, - lib, - pkgs, - ... -}: +{ config, lib, ... }: -let - cfg = config.modules.hyprland; -in { - options.modules.hyprland = { - extraConfig = lib.mkOption { - type = lib.types.str; - default = ""; - example = # hyprlang - '' - monitor = DP-3, 1920x1080@74.973, 2560x0, 1 - monitor = DP-2, 2560x1440@165.00301, 0x0, 1 - ''; - description = "Configuration to be appended to my own."; - }; - - scripts = { - screenshot.enable = lib.mkEnableOption "screenshot"; - startup.enable = lib.mkEnableOption "startup"; - }; + options.modules.hyprland.extraConfig = lib.mkOption { + type = lib.types.str; + default = ""; + example = # hyprlang + '' + monitor = DP-3, 1920x1080@74.973, 2560x0, 1 + monitor = DP-2, 2560x1440@165.00301, 0x0, 1 + ''; + description = "Configuration to be appended to my own."; }; config = { @@ -153,23 +138,11 @@ in ''; }; - # Set-up the scripts for services and apps. - home.packages = lib.mkIf cfg.scripts.startup.enable [ - (import ./scripts/start_services.nix pkgs) - (import ./scripts/start_apps.nix pkgs) - ]; - - # Then add the hyprland screenshot scripts. - xdg.dataFile = lib.mkIf cfg.scripts.screenshot.enable { - "scripts/hyprland/screenshot.sh".source = ./scripts/screenshot.sh; - "scripts/hyprland/screenshot_area.sh".source = ./scripts/screenshot_area.sh; - }; - # Configure hyprland - we enable it in NixOS. xdg.configFile."hypr/hyprland.conf".text = # hyprlang '' source = $HOME/.config/hypr/frappe.conf - ${cfg.extraConfig} + ${config.modules.hyprland.extraConfig} # # Please note not all available settings / options are set here. @@ -184,10 +157,10 @@ in exec-once = /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh # Start the core services of my desktop - exec-once = start_services + exec-once = ~/.local/share/scripts/hyprland/start_services.sh # Open the apps I always use - exec-once = start_apps + exec-once = ~/.local/share/scripts/hyprland/start_apps.sh # Set cursor size. env = HYPRCURSOR_SIZE, 36 diff --git a/modules/home-manager/programs/hyprland/scripts/start_apps.nix b/modules/home-manager/programs/hyprland/scripts/start_apps.nix deleted file mode 100755 index 27740d5..0000000 --- a/modules/home-manager/programs/hyprland/scripts/start_apps.nix +++ /dev/null @@ -1,15 +0,0 @@ -pkgs: - -pkgs.writeShellScriptBin "start_apps" '' - # Open qbittorrent - qbittorrent & - - # Open vesktop - vesktop & - - # Open steam - steam & - - # Open firefox - firefox -'' diff --git a/modules/home-manager/programs/hyprland/scripts/start_services.nix b/modules/home-manager/programs/hyprland/scripts/start_services.nix deleted file mode 100644 index 367a16f..0000000 --- a/modules/home-manager/programs/hyprland/scripts/start_services.nix +++ /dev/null @@ -1,59 +0,0 @@ -pkgs: - -pkgs.writeShellScriptBin "start_services" '' - # - # Make sure xdg-desktop-portal-hyprland has access to what it needs - # - dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP & - - # - # Start waybar. - # - waybar & - - # - # Start xwaylandvideobridge - # - xwaylandvideobridge & - - - # - # Start wallpaper daemon - # - ~/.local/share/scripts/wallpaper.sh & - - # - # Start notification daemon. - # - mako & - - # - # Start polkit agent - # - ${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 & - - # - # Start kwallet service - # - kwalletd6 & - - # - # Start kdeconnect daemon - # - kdeconnectd & - - # - # Start Fcitx5 - # - fcitx5 & - - # - # Start the blueman applet for managing bluetooth devices - # - blueman-applet & - - # - # Clipboard manager - # - ${pkgs.wl-clipboard}/bin/wl-paste --watch cliphist store & -'' diff --git a/modules/home-manager/programs/hyprland/scripts/screenshot.sh b/modules/home-manager/scripts/hyprland/screenshot.sh similarity index 100% rename from modules/home-manager/programs/hyprland/scripts/screenshot.sh rename to modules/home-manager/scripts/hyprland/screenshot.sh diff --git a/modules/home-manager/programs/hyprland/scripts/screenshot_area.sh b/modules/home-manager/scripts/hyprland/screenshot_area.sh similarity index 100% rename from modules/home-manager/programs/hyprland/scripts/screenshot_area.sh rename to modules/home-manager/scripts/hyprland/screenshot_area.sh diff --git a/modules/home-manager/scripts/hyprland/start_apps.sh b/modules/home-manager/scripts/hyprland/start_apps.sh new file mode 100755 index 0000000..f4dca8b --- /dev/null +++ b/modules/home-manager/scripts/hyprland/start_apps.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Open qbittorrent +qbittorrent & + +# Open vesktop +vesktop & + +# Open steam +steam & + +# Open firefox +firefox diff --git a/specific/desktop/home-manager.nix b/specific/desktop/home-manager.nix index cb99529..d0b2dca 100644 --- a/specific/desktop/home-manager.nix +++ b/specific/desktop/home-manager.nix @@ -79,31 +79,23 @@ # MODULES # # - modules.hyprland = { - # Enable scripts - scripts = { - startup.enable = true; - screenshot.enable = true; - }; + # Add monitor configuration to hyprland + modules.hyprland.extraConfig = # hyprlang + '' + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor = DP-3, 1920x1080@74.973, 2560x0, 1 + monitor = DP-2, 2560x1440@165.00301, 0x0, 1 - # Add monitor configuration to hyprland - extraConfig = # hyprlang - '' - # 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 - ''; - }; + # 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/desktop/nixos.nix b/specific/desktop/nixos.nix index 79acca3..473d6ca 100644 --- a/specific/desktop/nixos.nix +++ b/specific/desktop/nixos.nix @@ -142,7 +142,6 @@ # # PACKAGES # # - environment.systemPackages = with pkgs; [ ## Tools # Utilities diff --git a/specific/laptop/home-manager.nix b/specific/laptop/home-manager.nix index ab8033b..1fbdbe1 100644 --- a/specific/laptop/home-manager.nix +++ b/specific/laptop/home-manager.nix @@ -68,30 +68,21 @@ # # Add monitor configuration to hyprland - modules.hyprland = { - # Enable scripts - scripts = { - startup.enable = true; - screenshot.enable = true; - }; + modules.hyprland.extraConfig = # hyprlang + '' + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor = eDP-1, 1920x1080@60.01, 0x0, 1 - # Add monitor configuration to hyprland - extraConfig = # hyprlang - '' - # See https://wiki.hyprland.org/Configuring/Monitors/ - 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 - ''; - }; + # 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 + ''; }