mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
users/foo-dogsquared: add custom-homepage config and proper ports state
This commit is contained in:
parent
f544f3b93f
commit
6a0a697ffe
@ -22,6 +22,25 @@ in
|
|||||||
email.thunderbird.enable = true;
|
email.thunderbird.enable = true;
|
||||||
research.enable = true;
|
research.enable = true;
|
||||||
vs-code.enable = true;
|
vs-code.enable = true;
|
||||||
|
|
||||||
|
custom-homepage = {
|
||||||
|
enable = true;
|
||||||
|
sections.services = lib.mkMerge [
|
||||||
|
{
|
||||||
|
name = "Local services";
|
||||||
|
flavorText = "For your local productivity";
|
||||||
|
textOnly = true;
|
||||||
|
weight = (-50);
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf config.services.archivebox.webserver.enable {
|
||||||
|
links = lib.singleton {
|
||||||
|
url = "http://localhost:${builtins.toString config.state.ports.archivebox-webserver.value}";
|
||||||
|
text = "Archive webserver";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
setups = {
|
setups = {
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
let
|
let
|
||||||
userCfg = config.users.foo-dogsquared;
|
userCfg = config.users.foo-dogsquared;
|
||||||
cfg = userCfg.programs.browsers;
|
cfg = userCfg.programs.browsers;
|
||||||
|
|
||||||
homepage = pkgs.callPackage ../../files/homepage/package.nix { };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.users.foo-dogsquared.programs.browsers = {
|
options.users.foo-dogsquared.programs.browsers = {
|
||||||
@ -132,7 +130,8 @@ in
|
|||||||
# Some quality of lifes.
|
# Some quality of lifes.
|
||||||
"browser.search.widget.inNavBar" = true;
|
"browser.search.widget.inNavBar" = true;
|
||||||
"browser.search.openintab" = true;
|
"browser.search.openintab" = true;
|
||||||
"browser.startup.homepage" = "file://${homepage}";
|
"browser.startup.homepage" =
|
||||||
|
lib.mkIf userCfg.programs.custom-homepage.enable "file://${userCfg.programs.custom-homepage.finalPackage}";
|
||||||
|
|
||||||
# Some privacy settings...
|
# Some privacy settings...
|
||||||
"privacy.donottrackheader.enabled" = true;
|
"privacy.donottrackheader.enabled" = true;
|
||||||
|
@ -10,6 +10,8 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
{
|
{
|
||||||
|
state.ports.syncthing.value = 8384;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
anki # Rise, rinse, and repeat.
|
anki # Rise, rinse, and repeat.
|
||||||
#archivebox # The ultimate archiving solution created by a pirate!
|
#archivebox # The ultimate archiving solution created by a pirate!
|
||||||
@ -26,11 +28,22 @@ in
|
|||||||
zotero # It's actually good at archiving despite not being a researcher myself.
|
zotero # It's actually good at archiving despite not being a researcher myself.
|
||||||
];
|
];
|
||||||
|
|
||||||
services.syncthing.enable = true;
|
services.syncthing = {
|
||||||
|
enable = true;
|
||||||
|
extraOptions = [
|
||||||
|
"--gui-address=http://localhost:${builtins.toString config.state.ports.syncthing.value}"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
xdg.mimeApps.defaultApplications = {
|
xdg.mimeApps.defaultApplications = {
|
||||||
"application/vnd.anki" = [ "anki.desktop" ];
|
"application/vnd.anki" = [ "anki.desktop" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.foo-dogsquared.programs.custom-homepage.sections.services.links =
|
||||||
|
lib.singleton {
|
||||||
|
url = "http://localhost:${builtins.toString config.state.ports.syncthing.value}";
|
||||||
|
text = "Local sync server";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.mkIf userCfg.programs.shell.enable {
|
(lib.mkIf userCfg.programs.shell.enable {
|
||||||
|
@ -10,6 +10,8 @@ in
|
|||||||
lib.mkEnableOption "a set of usual desktop productivity services";
|
lib.mkEnableOption "a set of usual desktop productivity services";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
state.ports.activitywatch.value = 5600;
|
||||||
|
|
||||||
# Install all of the desktop stuff.
|
# Install all of the desktop stuff.
|
||||||
suites.desktop = {
|
suites.desktop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -29,6 +31,7 @@ in
|
|||||||
# Self-inflicted telemetry.
|
# Self-inflicted telemetry.
|
||||||
services.activitywatch = {
|
services.activitywatch = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
settings.server.port = config.state.ports.activitywatch.value;
|
||||||
watchers = {
|
watchers = {
|
||||||
aw-watcher-afk.package = pkgs.activitywatch;
|
aw-watcher-afk.package = pkgs.activitywatch;
|
||||||
aw-watcher-window.package = pkgs.activitywatch;
|
aw-watcher-window.package = pkgs.activitywatch;
|
||||||
@ -73,5 +76,10 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.singleton {
|
||||||
|
url = "http://localhost:${builtins.toString config.state.ports.activitywatch.value}";
|
||||||
|
text = "Telemetry server";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -96,9 +96,20 @@ in
|
|||||||
"vlc.memory_dump"
|
"vlc.memory_dump"
|
||||||
"vlc.mru"
|
"vlc.mru"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# 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 {
|
||||||
|
url = "http://localhost:${builtins.toString attrs.nixosConfig.state.ports.gonic.value}";
|
||||||
|
text = "Subsonic music server";
|
||||||
|
}))
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.mkIf cfg.mpd.enable {
|
(lib.mkIf cfg.mpd.enable {
|
||||||
|
state.ports.mopidy.value = 6680;
|
||||||
|
|
||||||
services.mopidy = {
|
services.mopidy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extensionPackages = with pkgs; [
|
extensionPackages = with pkgs; [
|
||||||
@ -114,7 +125,7 @@ in
|
|||||||
settings = {
|
settings = {
|
||||||
http = {
|
http = {
|
||||||
hostname = "127.0.0.1";
|
hostname = "127.0.0.1";
|
||||||
port = 6680;
|
port = config.state.ports.mopidy.value;
|
||||||
default_app = "iris";
|
default_app = "iris";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -158,6 +169,12 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
mpdMusicDir = musicDir;
|
mpdMusicDir = musicDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Set this to the custom homepage.
|
||||||
|
users.foo-dogsquared.programs.custom-homepage.sections.services.links = lib.singleton {
|
||||||
|
url = "http://localhost:${builtins.toString config.state.ports.mopidy.value}";
|
||||||
|
text = "Music streaming server";
|
||||||
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user