63 lines
1.1 KiB
Nix
63 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
mkNoctaliaSettings =
|
|
{ homeDirectory }:
|
|
import ./_noctalia-config.nix {
|
|
inherit homeDirectory;
|
|
};
|
|
|
|
mkBaseSettings =
|
|
{ homeDirectory }:
|
|
mkNoctaliaSettings {
|
|
inherit homeDirectory;
|
|
};
|
|
|
|
mkPortableSettings =
|
|
baseSettings:
|
|
lib.recursiveUpdate baseSettings {
|
|
bar.default.end = lib.concatMap (
|
|
widget:
|
|
if widget == "control-center" then
|
|
[
|
|
"network"
|
|
"battery"
|
|
widget
|
|
]
|
|
else
|
|
[ widget ]
|
|
) baseSettings.bar.default.end;
|
|
};
|
|
in
|
|
{
|
|
flake.modules.homeManager.noctalia =
|
|
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
osConfig,
|
|
...
|
|
}:
|
|
let
|
|
baseSettings = mkBaseSettings {
|
|
homeDirectory = config.home.homeDirectory;
|
|
};
|
|
settings =
|
|
if baseSettings == { } || !(osConfig.facts.machine.portable or false) then
|
|
baseSettings
|
|
else
|
|
mkPortableSettings baseSettings;
|
|
in
|
|
{
|
|
imports = [ inputs.noctalia.homeModules.default ];
|
|
|
|
programs.noctalia = {
|
|
enable = true;
|
|
inherit settings;
|
|
};
|
|
};
|
|
}
|