Initial commit
This commit is contained in:
40
modules/desktop/greetd.nix
Normal file
40
modules/desktop/greetd.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.desktop.greetd;
|
||||
in
|
||||
{
|
||||
options.my.desktop.greetd = {
|
||||
user = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "User account that runs the default session.";
|
||||
};
|
||||
|
||||
command = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Command to run for the default session (use an absolute path).";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.user != null;
|
||||
message = "my.desktop.greetd.user must be set.";
|
||||
}
|
||||
{
|
||||
assertion = cfg.command != null;
|
||||
message = "my.desktop.greetd.command must be set (use an absolute path like \"${pkgs.sway}/bin/sway\").";
|
||||
}
|
||||
];
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings.default_session = {
|
||||
user = cfg.user;
|
||||
command = cfg.command;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
65
modules/desktop/sway.nix
Normal file
65
modules/desktop/sway.nix
Normal file
@@ -0,0 +1,65 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.my.desktop.sway;
|
||||
|
||||
utilitiesPkgs =
|
||||
if cfg.utilities == "minimal" then
|
||||
[ ]
|
||||
else if cfg.utilities == "essentials" then
|
||||
with pkgs; [
|
||||
wl-clipboard
|
||||
grim
|
||||
]
|
||||
else if cfg.utilities == "full" then
|
||||
with pkgs; [
|
||||
wl-clipboard
|
||||
grim
|
||||
slurp
|
||||
swaylock
|
||||
swayidle
|
||||
waybar
|
||||
mako # notifications
|
||||
wofi # launcher
|
||||
brightnessctl
|
||||
playerctl
|
||||
pavucontrol
|
||||
]
|
||||
else
|
||||
[ ];
|
||||
|
||||
portalPkgs = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
in
|
||||
{
|
||||
options.my.desktop.sway = {
|
||||
utilities = lib.mkOption {
|
||||
type = lib.types.enum [ "minimal" "essentials" "full" ];
|
||||
default = "essentials";
|
||||
description = "Utility bundle size for a Sway environment.";
|
||||
};
|
||||
|
||||
x11Compatibility = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable XWayland support for X11-only applications.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
xwayland.enable = cfg.x11Compatibility;
|
||||
};
|
||||
|
||||
services.seatd.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = portalPkgs;
|
||||
};
|
||||
|
||||
environment.systemPackages = utilitiesPkgs;
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user