refactor: restructure config files
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
mkNoctaliaSettings =
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
terminal,
|
||||
}:
|
||||
import ./_noctalia-config.nix {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminal
|
||||
;
|
||||
};
|
||||
|
||||
mkBaseSettings =
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
terminal,
|
||||
}:
|
||||
mkNoctaliaSettings {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminal
|
||||
;
|
||||
};
|
||||
|
||||
mkPortableSettings =
|
||||
baseSettings:
|
||||
lib.recursiveUpdate baseSettings {
|
||||
bar.widgets.right = lib.concatMap (
|
||||
widget:
|
||||
if widget.id == "ControlCenter" then
|
||||
[
|
||||
{
|
||||
id = "Network";
|
||||
}
|
||||
{
|
||||
id = "Battery";
|
||||
showPowerProfiles = true;
|
||||
displayMode = "graphic";
|
||||
}
|
||||
widget
|
||||
]
|
||||
else
|
||||
[ widget ]
|
||||
) baseSettings.bar.widgets.right;
|
||||
};
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.noctalia =
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
baseSettings = mkBaseSettings {
|
||||
inherit lib;
|
||||
homeDirectory = config.home.homeDirectory;
|
||||
terminal = config.repo.terminal.primary;
|
||||
};
|
||||
settings =
|
||||
if baseSettings == { } || !osConfig.meta.machine.portable then
|
||||
baseSettings
|
||||
else
|
||||
mkPortableSettings baseSettings;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.noctalia.homeModules.default ];
|
||||
|
||||
programs.noctalia-shell = {
|
||||
enable = true;
|
||||
package = lib.mkForce (
|
||||
inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
||||
calendarSupport = true;
|
||||
}
|
||||
);
|
||||
inherit settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user