parent
4823e9a196
commit
e66fe1db82
4 changed files with 51 additions and 0 deletions
|
@ -79,6 +79,7 @@
|
|||
user = mainUser;
|
||||
|
||||
ags.enable = true;
|
||||
quickshell.enable = true;
|
||||
mainMonitor = "eDP-1";
|
||||
isLaptop = true;
|
||||
isTouchscreen = true;
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
|
@ -21,6 +21,7 @@ self: {
|
|||
in {
|
||||
imports = [
|
||||
(import ../../ags self)
|
||||
../../quickshell
|
||||
|
||||
./modules/dconf.nix
|
||||
./modules/printer.nix
|
||||
|
|
41
modules/quickshell/default.nix
Normal file
41
modules/quickshell/default.nix
Normal 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
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue