mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-20 13:36:51 +02:00
feat: migrate all nixos services from idols to 12kingdoms
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{pkgs, ...}: let
|
||||
configDir = "/var/lib/homepage-dashboard";
|
||||
in {
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/misc/homepage-dashboard.nix
|
||||
services.homepage-dashboard = {
|
||||
enable = true;
|
||||
listenPort = 4401;
|
||||
openFirewall = false;
|
||||
};
|
||||
systemd.services.homepage-dashboard.environment = {
|
||||
HOMEPAGE_CONFIG_DIR = configDir;
|
||||
|
||||
# 1. The value of env var HOMEPAGE_VAR_XXX will replace {{HOMEPAGE_VAR_XXX}} in any config
|
||||
# HOMEPAGE_VAR_XXX_APIKEY = "myapikey";
|
||||
# 2. The value of env var HOMEPAGE_FILE_XXX must be a file path,
|
||||
# the contents of which will be used to replace {{HOMEPAGE_FILE_XXX}} in any config
|
||||
};
|
||||
# Install the homepage-dashboard configuration files
|
||||
system.activationScripts.installHomepageDashboardConfig = ''
|
||||
mkdir -p ${configDir}
|
||||
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F600 ${./config}/ ${configDir}/
|
||||
|
||||
${pkgs.systemdMinimal}/bin/systemctl restart homepage-dashboard
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user