From d30623ca2c0c5920572bd37749c316c588a1e2ec Mon Sep 17 00:00:00 2001 From: Aleksander Gondek Date: Mon, 16 Sep 2024 14:06:28 +0200 Subject: [PATCH] feat: extend desktop config with windows manager note: hyprland is missing configuration files. --- cfg/default.nix | 17 -------------- cfg/desktop/default.nix | 51 ++++++++++++++++++++++++++++++++++------- flake.nix | 1 + 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/cfg/default.nix b/cfg/default.nix index 3b6c25a..1761ae2 100644 --- a/cfg/default.nix +++ b/cfg/default.nix @@ -15,23 +15,6 @@ ./virtualisation ]; - options.agondek-cfg.desktop = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - If enabled, the host machine will be configured to support - desktop mode (aka. not only terminal console). - ''; - }; - flavor = lib.mkOption { - type = lib.types.enum ["default" "nvidia"]; - default = "default"; - description = '' - What kind of desktop setup should be configured. - ''; - }; - }; options.agondek-cfg.nix = { channel = lib.mkOption { type = lib.types.str; diff --git a/cfg/desktop/default.nix b/cfg/desktop/default.nix index 5625291..a6f108f 100644 --- a/cfg/desktop/default.nix +++ b/cfg/desktop/default.nix @@ -8,6 +8,28 @@ in { imports = []; + options.agondek-cfg.desktop = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + If enabled, the host machine will be configured to support + desktop mode (aka. not only terminal console). + ''; + }; + flavor = lib.mkOption { + type = lib.types.enum ["default" "nvidia"]; + default = "default"; + description = '' + What kind of desktop setup should be configured. + ''; + }; + windowsManager = lib.mkOption { + type = lib.types.enum ["i3" "hyprland"]; + default = "i3"; + }; + }; + config = lib.mkIf cfg.desktop.enable { services.xserver = { enable = true; @@ -27,10 +49,11 @@ in { displayManager.gdm = { enable = true; + wayland = cfg.desktop.windowsManager == "hyprland"; }; windowManager.i3 = { - enable = true; + enable = cfg.desktop.windowsManager == "i3"; package = pkgs.i3-gaps; extraPackages = with pkgs; [ dmenu @@ -45,12 +68,24 @@ in { # For checking power status services.upower.enable = true; - environment.systemPackages = with pkgs; [ - networkmanagerapplet # NetworkManager in Gnome - alacritty # Cool rust terminal - pavucontrol # PulseAudio Volume Control - arandr # Front End for xrandr - brightnessctl # Control screen brightness - ]; + environment.systemPackages = with pkgs; + [ + networkmanagerapplet # NetworkManager in Gnome + alacritty # Cool rust terminal + pavucontrol # PulseAudio Volume Control + arandr # Front End for xrandr + brightnessctl # Control screen brightness + ] + ++ ( + if cfg.desktop.windowsManager == "hyprland" + then [ + rofi-wayland + swaybg + ] + else [] + ); + + programs.hyprland.enable = cfg.desktop.windowsManager == "hyprland"; + programs.waybar.enable = cfg.desktop.windowsManager == "hyprland"; }; } diff --git a/flake.nix b/flake.nix index e9bd71f..9ed4ed0 100644 --- a/flake.nix +++ b/flake.nix @@ -146,6 +146,7 @@ }; desktop = { enable = true; + windowsManager = "hyprland"; }; users.agondek = { enable = true;