Skip to content

Commit

Permalink
feat: extend desktop config with windows manager
Browse files Browse the repository at this point in the history
note: hyprland is missing configuration files.
  • Loading branch information
AleksanderGondek committed Sep 16, 2024
1 parent b4ea476 commit d30623c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 25 deletions.
17 changes: 0 additions & 17 deletions cfg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
51 changes: 43 additions & 8 deletions cfg/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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";
};
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
};
desktop = {
enable = true;
windowsManager = "hyprland";
};
users.agondek = {
enable = true;
Expand Down

0 comments on commit d30623c

Please sign in to comment.