Add initial sway module

This commit is contained in:
DashieTM 2025-02-25 21:40:41 +01:00
parent d88a6c3e4d
commit c2ca2e5b71
6 changed files with 540 additions and 259 deletions

655
flake.lock generated

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,7 @@
./starship.nix ./starship.nix
./stylix.nix ./stylix.nix
./supersonic.nix ./supersonic.nix
./sway.nix
./teams.nix ./teams.nix
./virtmanager.nix ./virtmanager.nix
./xkb.nix ./xkb.nix

View file

@ -34,6 +34,16 @@
By default the scale of the main monitor is used. By default the scale of the main monitor is used.
''; '';
}; };
greeterCommand = lib.mkOption {
default = "${
lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland
} --config /etc/greetd/hyprgreet.conf";
example = "${
lib.getExe pkgs.cage
} -s -- ${lib.getEze pkgs.regreet}";
type = lib.types.str;
description = "The compositor/greeter command to run";
};
resolution = lib.mkOption { resolution = lib.mkOption {
default = "${config.conf.defaultMonitorMode}"; default = "${config.conf.defaultMonitorMode}";
example = "3440x1440@180"; example = "3440x1440@180";
@ -73,9 +83,7 @@
config = let config = let
username = config.conf.username; username = config.conf.username;
session = { session = {
command = "${ command = config.mods.greetd.greeterCommand;
lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland
} --config /etc/greetd/hyprgreet.conf";
user = username; user = username;
}; };
in in

View file

@ -4,7 +4,8 @@
config, config,
pkgs, pkgs,
... ...
}: { }:
{
options.mods.media = { options.mods.media = {
useBasePackages = lib.mkOption { useBasePackages = lib.mkOption {
default = true; default = true;
@ -13,24 +14,24 @@
description = "Default media packages (If disabled, only the additional packages will be installed)"; description = "Default media packages (If disabled, only the additional packages will be installed)";
}; };
additionalPackages = lib.mkOption { additionalPackages = lib.mkOption {
default = []; default = [ ];
example = [pkgs.flatpak]; example = [ pkgs.flatpak ];
type = with lib.types; listOf package; type = with lib.types; listOf package;
description = '' description = ''
Additional media packages. Additional media packages.
''; '';
}; };
specialPrograms = lib.mkOption { specialPrograms = lib.mkOption {
default = {}; default = { };
example = {}; example = { };
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
special program configuration to be added which require programs.something notation. special program configuration to be added which require programs.something notation.
''; '';
}; };
specialServices = lib.mkOption { specialServices = lib.mkOption {
default = {}; default = { };
example = {}; example = { };
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
special services configuration to be added which require an services.something notation. special services configuration to be added which require an services.something notation.
@ -39,50 +40,51 @@
}; };
config = lib.optionalAttrs (options ? home.packages) { config = lib.optionalAttrs (options ? home.packages) {
home.packages = home.packages =
if config.mods.media.useBasePackages if config.mods.media.useBasePackages then
then
with pkgs; with pkgs;
[ [
# base audio # base audio
pipewire pipewire
wireplumber wireplumber
# audio control # audio control
playerctl playerctl
# images # images
imv imv
# videos # videos
mpv mpv
# pdf # pdf
zathura zathura
evince evince
libreoffice-fresh libreoffice-fresh
onlyoffice-bin onlyoffice-bin
pdftk pdftk
pdfpc pdfpc
polylux2pdfpc polylux2pdfpc
# spotify # spotify
# video editing # video editing
kdenlive kdePackages.kdenlive
# image creation # image creation
inkscape inkscape
gimp gimp
krita krita
yt-dlp yt-dlp
] ]
++ config.mods.media.additionalPackages ++ config.mods.media.additionalPackages
else config.mods.media.additionalPackages; else
config.mods.media.additionalPackages;
programs = programs =
if config.mods.media.useBasePackages if config.mods.media.useBasePackages then
then
{ {
obs-studio.enable = true; obs-studio.enable = true;
obs-studio.plugins = with pkgs; [obs-studio-plugins.obs-vaapi]; obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ];
} }
// config.mods.media.specialPrograms // config.mods.media.specialPrograms
else config.mods.media.specialPrograms; else
config.mods.media.specialPrograms;
services = services =
if config.mods.media.useBasePackages if config.mods.media.useBasePackages then
then config.mods.media.specialServices config.mods.media.specialServices
else config.mods.media.specialServices; else
config.mods.media.specialServices;
}; };
} }

View file

@ -48,11 +48,8 @@
}; };
cursor = lib.mkOption { cursor = lib.mkOption {
default = { default = {
# broken package = pkgs.bibata-cursors;
#package = pkgs.bibata-cursors; name = "Bibata-Modern-Classic";
#name = "Bibata-Modern-Classic";
package = pkgs.catppuccin-cursors.mochaLavender;
name = "catppuccin-mocha-lavender-cursors";
size = 24; size = 24;
}; };
example = {}; example = {};

30
modules/programs/sway.nix Normal file
View file

@ -0,0 +1,30 @@
{
lib,
config,
options,
...
}: {
options.mods.sway = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables sway";
};
config = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = "sway config";
};
};
config = lib.mkIf config.mods.sway.enable (
lib.optionalAttrs (options ? wayland.windowManger) {
wayland.windowManager.sway =
{
enable = true;
}
// config.mods.sway.config;
}
);
}