Skip to content

Commit

Permalink
pureintent: add containers
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Nov 19, 2024
1 parent 6ef3ae8 commit 46354c2
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 257 deletions.
32 changes: 32 additions & 0 deletions configurations/nixos/pureintent/containers.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# TODO(refactor): decompose
{ flake, pkgs, ... }:

let
inherit (flake) inputs;
actualism-app = inputs.actualism-app.packages.${pkgs.system}.default;
app-port = 3000;
app-domain = "actualism.app";
in
{
containers.actualism-app = {
autoStart = true;
config = { lib, ... }: {
systemd.services.actualism-app = {
description = "actualism-app";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${lib.getExe actualism-app}";
Restart = "always";
};
};
};
};

# TODO: cloudflare tunnels
services.nginx = {
enable = true;
virtualHosts.${app-domain} = {
locations."/".proxyPass = "http://localhost:${builtins.toString app-port}";
};
};
}
4 changes: 1 addition & 3 deletions configurations/nixos/pureintent/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ in
imports = [
self.nixosModules.default
./configuration.nix
./containers.nix
];

services.openssh.enable = true;
Expand All @@ -22,9 +23,6 @@ in

programs.nix-ld.enable = true; # for vscode server

environment.systemPackages = with pkgs; [
];

# Workaround the annoying `Failed to start Network Manager Wait Online` error on switch.
# https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online.enable = false;
Expand Down
Loading

0 comments on commit 46354c2

Please sign in to comment.