users/foo-dogsquared: use upstream config for custom-homepage

This commit is contained in:
Gabriel Arazas 2024-09-04 14:48:04 +08:00
parent c52c7f49f6
commit 47f6c0bee9
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 31 additions and 14 deletions

View File

@ -24,16 +24,23 @@ in
custom-homepage = {
enable = true;
sections.services = lib.mkMerge [
sections = lib.mkMerge [
# Merge the upstream since any new files will be overridden. It also
# allows us to attach data to it such as new links to the hardcoded
# sections.
(lib.importTOML "${config.users.foo-dogsquared.programs.custom-homepage.package.src}/data/foodogsquared-homepage/links.toml")
{
services = {
name = "Local services";
flavorText = "For your local productivity";
textOnly = true;
weight = (-50);
};
}
(lib.mkIf config.services.archivebox.webserver.enable {
links = lib.singleton {
services.links = lib.singleton {
url = "http://localhost:${builtins.toString config.state.ports.archivebox-webserver.value}";
text = "Archive webserver";
};

View File

@ -131,7 +131,7 @@ in
"browser.search.widget.inNavBar" = true;
"browser.search.openintab" = true;
"browser.startup.homepage" =
lib.mkIf userCfg.programs.custom-homepage.enable "file://${userCfg.programs.custom-homepage.finalPackage}";
lib.mkIf userCfg.programs.custom-homepage.enable "file://${userCfg.programs.custom-homepage.finalPackage}/index.html";
# Some privacy settings...
"privacy.donottrackheader.enabled" = true;

View File

@ -99,10 +99,15 @@ in
# Set every music-related services from the encompassing NixOS
# configuration.
users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.mkMerge [
(lib.mkIf (attrs.nixosConfig.services.gonic.enable or false) (lib.singleton {
users.foo-dogsquared.programs.custom-homepage.sections = lib.mkMerge [
(lib.mkIf (attrs.nixosConfig.services.gonic.enable or false) (let
subsonicLink = {
url = "http://localhost:${builtins.toString attrs.nixosConfig.state.ports.gonic.value}";
text = "Subsonic music server";
text = "Jukebox server";
};
in {
services.links = lib.singleton subsonicLink;
music.links = lib.mkAfter [ (subsonicLink // { text = "Subsonic music server"; }) ];
}))
];
}
@ -171,10 +176,15 @@ in
};
# Set this to the custom homepage.
users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.singleton {
users.foo-dogsquared.programs.custom-homepage.sections = let
mopidyLink = {
url = "http://localhost:${builtins.toString config.state.ports.mopidy.value}";
text = "Music streaming server";
};
in {
services.links = lib.singleton mopidyLink;
music.links = lib.singleton (mopidyLink // { text = "Mopidy server"; });
};
})
]);
}