feat(quickshell): add basic module for quickshell

This commit is contained in:
matt1432 2025-04-26 18:55:04 -04:00
parent 4823e9a196
commit e66fe1db82
4 changed files with 51 additions and 0 deletions
configurations/wim
modules
desktop
quickshell

View file

@ -79,6 +79,7 @@
user = mainUser;
ags.enable = true;
quickshell.enable = true;
mainMonitor = "eDP-1";
isLaptop = true;
isTouchscreen = true;

View file

@ -58,6 +58,14 @@ in {
'';
};
quickshell.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether we want to enable Quickshell for the DE shell.
'';
};
mainMonitor = mkOption {
type = types.str;
description = ''

View file

@ -21,6 +21,7 @@ self: {
in {
imports = [
(import ../../ags self)
../../quickshell
./modules/dconf.nix
./modules/printer.nix

View file

@ -0,0 +1,41 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) hasPrefix mkIf removePrefix;
# Configs
cfgDesktop = config.roles.desktop;
flakeDir = config.environment.variables.FLAKE;
qsConfigDir = "${removePrefix "/home/${cfgDesktop.user}/" flakeDir}/modules/quickshell/config";
in {
config = mkIf cfgDesktop.quickshell.enable {
assertions = [
{
assertion = hasPrefix "/home/${cfgDesktop.user}/" flakeDir;
message = ''
Your $FLAKE environment variable needs to point to a directory in
the main users' home to use my quickshell module.
'';
}
];
# Machine config
environment.systemPackages = [
(pkgs.writeShellApplication {
name = "quickshell";
runtimeInputs = [pkgs.quickshell];
text = ''
if [ "$#" == 0 ]; then
exec qs --path ~/${qsConfigDir}
else
exec qs "$@"
fi
'';
})
];
};
}