Skip to content

Commit

Permalink
wip: webfortune
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <me@sumnerevans.com>
  • Loading branch information
sumnerevans committed Nov 8, 2023
1 parent 582095f commit 1c5a004
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 7 deletions.
32 changes: 28 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
webfortune = {
url = "github:sumnerevans/webfortune";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};

outputs = { self, nixpkgs, flake-utils }@inputs: {
outputs = inputs@{ self, nixpkgs, flake-utils, webfortune }: {
nixosConfigurations = {
tatooine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
Expand Down
10 changes: 9 additions & 1 deletion host-configurations/morak.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }: with lib; {
{ config, lib, pkgs, modulesPath, webfortune, ... }: with lib; {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];

boot = {
Expand Down Expand Up @@ -83,6 +83,14 @@
];
}
];
services.nginx.virtualHosts."fortune.sumnerevans.com" = {
addSSL = true;
enableACME = true;
"/" = {
recommendedProxySettings = true;
proxyPass = "http://localhost:8009";
};
};

############
# Services #
Expand Down
23 changes: 22 additions & 1 deletion host-configurations/tatooine.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ modulesPath, ... }: {
{ modulesPath, pkgs, inputs, ... }: {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];

boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" ];
Expand Down Expand Up @@ -77,5 +77,26 @@
};
};
};

virtualHosts."fortune.sumnerevans.com" = {
addSSL = true;
enableACME = true;
locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://localhost:8009";
};
};
};

systemd.services.webfortune = {
description = "webfortune";
environment = {
QUOTESFILE = "";
QUOTESFILE_SOURCE_URL = "https://github.com/sumnerevans/home-manager-config/blob/master/modules/email/quotes";
LISTEN_ADDR = "0.0.0.0:9009";
};
serviceConfig = {
ExecStart = "${inputs.webfortune}/bin/webfortune";
};
};
}

0 comments on commit 1c5a004

Please sign in to comment.