From ac9d778c536411d6a8c0d1d6bfb07e0a3d343c02 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 21 Apr 2025 21:32:17 +0800 Subject: [PATCH] update hyprland usage --- flake.nix | 2 -- home/desktop.nix | 2 +- home/server.nix | 2 +- modules/home/hyprland/default.nix | 16 ++++++++++++++-- profiles/apollo/default.nix | 4 ++-- profiles/gaea/default.nix | 4 ++-- profiles/luna/default.nix | 4 ++-- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 0fa862b..0edf11b 100644 --- a/flake.nix +++ b/flake.nix @@ -78,8 +78,6 @@ inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - hyprland.url = "github:hyprwm/Hyprland"; - # Impermanence system impermanence.url = "github:nix-community/impermanence"; diff --git a/home/desktop.nix b/home/desktop.nix index 5fe6bff..8c3be5c 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -1,7 +1,7 @@ # This is your home-manager configuration file # Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{ inputs, outputs, lib, config, pkgs, username, useremail, hyprland, ... }: +{ inputs, outputs, lib, config, pkgs, username, useremail, ... }: { # You can import other home-manager modules here imports = [ diff --git a/home/server.nix b/home/server.nix index e422615..4cf2f63 100644 --- a/home/server.nix +++ b/home/server.nix @@ -1,7 +1,7 @@ # This is your home-manager configuration file # Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{ inputs, outputs, lib, config, pkgs, username, useremail, hyprland, ... }: { +{ inputs, outputs, lib, config, pkgs, username, useremail, ... }: { # You can import other home-manager modules here imports = [ # If you want to use modules your own flake exports (from modules/home-manager): diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index 8271b4c..e70fcb6 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -1,11 +1,23 @@ -{ config, lib, pkgs, hyprland, ... }: +{ config, lib, pkgs, ... }: { imports = [ - hyprland.homeManagerModules.default ./env.nix ]; + wayland.windowManager.hyprland = { + # Whether to enable Hyprland wayland compositor + enable = true; + # The hyprland package to use + package = pkgs.hyprland; + # Whether to enable XWayland + xwayland.enable = true; + + # Optional + # Whether to enable hyprland-session.target on hyprland startup + systemd.enable = true; + }; + home.packages = with pkgs; [ waybar # the status bar # hyprpaper # wallpaper diff --git a/profiles/apollo/default.nix b/profiles/apollo/default.nix index 06ec19a..0a9421c 100644 --- a/profiles/apollo/default.nix +++ b/profiles/apollo/default.nix @@ -1,6 +1,6 @@ { inputs, outputs, lib, pkgs, config, self, username, useremail, hostname, sysversion, ... }: let - inherit (inputs) home-manager hyprland; + inherit (inputs) home-manager; in { # You can import other NixOS modules here @@ -27,7 +27,7 @@ in # home-manager.useGlobalPkgs = true; # home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - inherit inputs outputs hostname username useremail hyprland sysversion; + inherit inputs outputs hostname username useremail sysversion; }; home-manager.users."${username}" = { ... }: { imports = [ diff --git a/profiles/gaea/default.nix b/profiles/gaea/default.nix index c879d57..cb074e3 100644 --- a/profiles/gaea/default.nix +++ b/profiles/gaea/default.nix @@ -1,6 +1,6 @@ { inputs, outputs, lib, pkgs, config, self, username, useremail, hostname, sysversion, ... }: let - inherit (inputs) home-manager hyprland nixpkgs-unstable; + inherit (inputs) home-manager nixpkgs-unstable; in { # You can import other NixOS modules here @@ -37,7 +37,7 @@ in # home-manager.useGlobalPkgs = true; # home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - inherit inputs outputs hostname username useremail hyprland sysversion; + inherit inputs outputs hostname username useremail sysversion; # enable unstable packages nixpkgs = nixpkgs-unstable; diff --git a/profiles/luna/default.nix b/profiles/luna/default.nix index 06ec19a..0a9421c 100644 --- a/profiles/luna/default.nix +++ b/profiles/luna/default.nix @@ -1,6 +1,6 @@ { inputs, outputs, lib, pkgs, config, self, username, useremail, hostname, sysversion, ... }: let - inherit (inputs) home-manager hyprland; + inherit (inputs) home-manager; in { # You can import other NixOS modules here @@ -27,7 +27,7 @@ in # home-manager.useGlobalPkgs = true; # home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - inherit inputs outputs hostname username useremail hyprland sysversion; + inherit inputs outputs hostname username useremail sysversion; }; home-manager.users."${username}" = { ... }: { imports = [