2025-03-21 22:32:07 +08:00
|
|
|
{
|
2025-04-28 21:20:32 +08:00
|
|
|
config,
|
|
|
|
|
lib,
|
2025-04-30 18:32:16 +08:00
|
|
|
inputs,
|
2025-06-24 21:42:12 +08:00
|
|
|
pkgs,
|
2025-11-10 19:28:58 +08:00
|
|
|
osConfig ? (throw "Trying to access osConfig, the home-manager module is not being used in the nixos module"),
|
2025-07-06 08:58:26 +08:00
|
|
|
options,
|
2025-04-28 21:20:32 +08:00
|
|
|
...
|
2025-11-10 19:28:58 +08:00
|
|
|
}: let
|
2025-04-28 21:20:32 +08:00
|
|
|
cfg = config.david.programs.niri;
|
2025-11-09 06:25:03 +08:00
|
|
|
in {
|
2025-11-10 19:28:58 +08:00
|
|
|
imports = [
|
|
|
|
|
./config.nix
|
|
|
|
|
];
|
2025-03-21 22:32:07 +08:00
|
|
|
options = {
|
|
|
|
|
david.programs.niri = {
|
2025-11-09 06:25:03 +08:00
|
|
|
enable =
|
|
|
|
|
(lib.mkEnableOption "niri")
|
|
|
|
|
// {
|
|
|
|
|
default = osConfig.youthlic.gui.enabled == "niri";
|
|
|
|
|
};
|
2025-11-10 19:28:58 +08:00
|
|
|
config = lib.mkOption {
|
2025-04-30 18:32:16 +08:00
|
|
|
type = inputs.niri-flake.lib.kdl.types.kdl-document;
|
|
|
|
|
};
|
2025-11-10 19:28:58 +08:00
|
|
|
configHelper = lib.mkOption {
|
|
|
|
|
type = lib.types.anything;
|
|
|
|
|
default = {
|
|
|
|
|
validated-config-for = configuration:
|
|
|
|
|
pkgs.runCommand "config.kdl" {
|
|
|
|
|
inherit configuration;
|
|
|
|
|
passAsFile = ["configuration"];
|
|
|
|
|
buildInputs = [config.programs.niri.package];
|
|
|
|
|
}
|
|
|
|
|
#bash
|
|
|
|
|
''
|
|
|
|
|
niri validate -c $configurationPath
|
|
|
|
|
cp $configurationPath $out
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-07-06 08:58:26 +08:00
|
|
|
wluma.extraSettings = lib.mkOption {
|
|
|
|
|
inherit (options.david.programs.wluma.extraSettings) type;
|
|
|
|
|
};
|
2025-07-13 06:04:55 +08:00
|
|
|
waybar = {
|
|
|
|
|
template = lib.mkOption {
|
|
|
|
|
readOnly = true;
|
|
|
|
|
type = lib.types.anything;
|
|
|
|
|
default = config.david.programs.waybar.template;
|
|
|
|
|
};
|
|
|
|
|
helper = lib.mkOption {
|
|
|
|
|
readOnly = true;
|
|
|
|
|
type = lib.types.anything;
|
|
|
|
|
default = config.david.programs.waybar.helper;
|
|
|
|
|
};
|
|
|
|
|
settings = lib.mkOption {
|
|
|
|
|
inherit (options.david.programs.waybar.settings) type;
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-03-21 22:32:07 +08:00
|
|
|
};
|
|
|
|
|
};
|
2025-05-03 23:23:02 +08:00
|
|
|
config = lib.mkMerge [
|
2025-07-13 06:04:55 +08:00
|
|
|
(lib.mkIf cfg.enable {
|
2025-11-10 19:28:58 +08:00
|
|
|
home.packages = with pkgs; [
|
2025-11-10 19:28:58 +08:00
|
|
|
# swaynotificationcenter
|
2025-11-10 19:28:58 +08:00
|
|
|
wl-clipboard
|
2025-11-10 19:28:58 +08:00
|
|
|
# cliphist
|
2025-11-10 19:28:58 +08:00
|
|
|
swayimg
|
|
|
|
|
seahorse
|
|
|
|
|
];
|
2025-11-09 06:25:03 +08:00
|
|
|
xdg.configFile = let
|
2025-11-10 19:28:58 +08:00
|
|
|
qtctConf = ''
|
|
|
|
|
[Appearance]
|
|
|
|
|
standard_dialogs=xdgdesktopportal
|
|
|
|
|
'';
|
2025-11-09 06:25:03 +08:00
|
|
|
in {
|
2025-11-10 19:28:58 +08:00
|
|
|
"qt5ct/qt5ct.conf" = {
|
2025-11-09 06:25:03 +08:00
|
|
|
text = qtctConf;
|
|
|
|
|
};
|
2025-11-10 19:28:58 +08:00
|
|
|
"qt6ct/qt6ct.conf" = {
|
2025-11-09 06:25:03 +08:00
|
|
|
text = qtctConf;
|
2025-07-01 23:17:40 +08:00
|
|
|
};
|
2025-11-09 06:25:03 +08:00
|
|
|
};
|
2025-07-13 06:04:55 +08:00
|
|
|
david.programs = {
|
2025-11-10 19:28:58 +08:00
|
|
|
# fuzzel.enable = true;
|
|
|
|
|
# waybar = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# inherit (cfg.waybar) settings;
|
|
|
|
|
# };
|
|
|
|
|
# wluma = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# inherit (cfg.wluma) extraSettings;
|
|
|
|
|
# };
|
|
|
|
|
# swaync.enable = true;
|
|
|
|
|
# swaylock.enable = true;
|
|
|
|
|
# waypaper.enable = true;
|
2025-07-13 06:04:55 +08:00
|
|
|
kanshi.enable = true;
|
2025-11-10 19:28:58 +08:00
|
|
|
noctalia.enable = true;
|
2025-07-13 06:04:55 +08:00
|
|
|
};
|
2025-11-10 19:28:58 +08:00
|
|
|
programs = {
|
|
|
|
|
niri = {
|
|
|
|
|
config =
|
|
|
|
|
cfg.config
|
|
|
|
|
++ [
|
|
|
|
|
(inputs.niri-flake.lib.kdl.leaf "include" [(toString config.david.programs.noctalia.niriExtraConfig)])
|
|
|
|
|
];
|
|
|
|
|
};
|
2025-07-13 06:04:55 +08:00
|
|
|
};
|
|
|
|
|
})
|
2025-10-28 23:22:41 +08:00
|
|
|
(lib.mkIf (!cfg.enable) {
|
|
|
|
|
programs.niri = {
|
|
|
|
|
settings = null;
|
|
|
|
|
config = null;
|
|
|
|
|
};
|
|
|
|
|
})
|
2025-05-03 23:23:02 +08:00
|
|
|
];
|
2025-03-21 22:32:07 +08:00
|
|
|
}
|