-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sumner Evans <[email protected]>
- Loading branch information
1 parent
582095f
commit e813e0a
Showing
6 changed files
with
107 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
./restic.nix | ||
./sshd.nix | ||
./syncthing.nix | ||
./webfortune.nix | ||
./xandikos.nix | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ config, inputs, lib, pkgs, ... }: | ||
with lib; | ||
let | ||
cfg = config.services.webfortune; | ||
in | ||
{ | ||
options = { | ||
services.webfortune = { | ||
quotesfile = mkOption { | ||
type = types.path; | ||
description = "Path to the quotesfile"; | ||
}; | ||
sourceUrl = mkOption { | ||
type = types.str; | ||
description = "URL to the quotesfile"; | ||
}; | ||
listenAddr = mkOption { | ||
type = types.str; | ||
default = "0.0.0.0:8477"; | ||
description = "Address to listen on"; | ||
}; | ||
}; | ||
}; | ||
|
||
config = { | ||
services.nginx = { | ||
enable = true; | ||
virtualHosts."fortune.sumnerevans.com" = { | ||
addSSL = true; | ||
enableACME = true; | ||
locations."/" = { | ||
recommendedProxySettings = true; | ||
proxyPass = cfg.listenAddr; | ||
}; | ||
}; | ||
}; | ||
|
||
systemd.services.webfortune = { | ||
description = "webfortune"; | ||
environment = { | ||
QUOTESFILE = cfg.quotesfile; | ||
QUOTESFILE_SOURCE_URL = cfg.sourceUrl; | ||
LISTEN_ADDR = cfg.listenAddr; | ||
}; | ||
serviceConfig = { | ||
ExecStart = "${inputs.webfortune.packages.${pkgs.system}.webfortune}/bin/webfortune"; | ||
}; | ||
}; | ||
}; | ||
} |