summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2023-04-26 01:45:29 +0200
committerstuebinm2023-04-26 01:45:29 +0200
commit6b1290d8092ab097cefcfceef0a7755ed1197b8c (patch)
treec53da8bc6f72b755c8336982786016ca69970afc
parentf1146ab5a3b3a4c0680234ba42c37dbf93f8f51c (diff)
bahnhof.name
in gleam, because why not? (tbf i will probably eventually rewrite this in a more sensible language; I haven't even found any reason to use any of the OTP features for this 🙈)
Diffstat (limited to '')
-rw-r--r--chaski/configuration.nix1
-rw-r--r--chaski/services/bahnhof-name.nix19
-rw-r--r--flake.lock33
-rw-r--r--flake.nix10
-rw-r--r--pkgs/overlay.nix13
5 files changed, 74 insertions, 2 deletions
diff --git a/chaski/configuration.nix b/chaski/configuration.nix
index af82b98..cbc2e91 100644
--- a/chaski/configuration.nix
+++ b/chaski/configuration.nix
@@ -11,6 +11,7 @@
./services/uplcg.nix
./services/tracktrain.nix
./services/chat.nix
+ ./services/bahnhof-name.nix
];
diff --git a/chaski/services/bahnhof-name.nix b/chaski/services/bahnhof-name.nix
new file mode 100644
index 0000000..e0e2988
--- /dev/null
+++ b/chaski/services/bahnhof-name.nix
@@ -0,0 +1,19 @@
+{ config, lib, pkgs, ... }:
+
+{
+ systemd.services.bahnhof-name = {
+ enable = true;
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig.Type = "simple";
+ path = [ pkgs.bahnhof-name ];
+ script = ''
+ bahnhofname
+ '';
+ };
+
+ services.nginx.virtualHosts."bahnhof.name" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/".proxyPass = "http://localhost:2345";
+ };
+}
diff --git a/flake.lock b/flake.lock
index f7680ee..87bbeff 100644
--- a/flake.lock
+++ b/flake.lock
@@ -16,6 +16,22 @@
"url": "https://stuebinm.eu/git/forks/almanac"
}
},
+ "bahnhof-name": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1682465641,
+ "narHash": "sha256-Xz7mkgImm5ly0xei3gXEknOlXD2QLfu+lto+kp+DMRU=",
+ "ref": "refs/heads/main",
+ "rev": "a827bb0e4d75f784f2cb26d664055c05810b096b",
+ "revCount": 2,
+ "type": "git",
+ "url": "https://stuebinm.eu/git/bahnhof.name"
+ },
+ "original": {
+ "type": "git",
+ "url": "https://stuebinm.eu/git/bahnhof.name"
+ }
+ },
"blobs": {
"flake": false,
"locked": {
@@ -223,6 +239,21 @@
"url": "https://stuebinm.eu/git/isabelle-utils"
}
},
+ "nix-gleam": {
+ "locked": {
+ "lastModified": 1681467615,
+ "narHash": "sha256-pp87h+V1ByoSFRHpkWP81WqQnUtv1V9uTUkSc8ZvzWY=",
+ "owner": "arnarg",
+ "repo": "nix-gleam",
+ "rev": "d1d2d6bcc5be6ea6a2d31e48aa55e7ea3bd41a1f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "arnarg",
+ "repo": "nix-gleam",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
"lastModified": 1673540789,
@@ -320,6 +351,7 @@
"root": {
"inputs": {
"almanac": "almanac",
+ "bahnhof-name": "bahnhof-name",
"blog": "blog",
"deploy-rs": "deploy-rs",
"emacs-overlay": "emacs-overlay",
@@ -327,6 +359,7 @@
"gtfsBooks": "gtfsBooks",
"home-manager": "home-manager",
"isabelle-utils": "isabelle-utils",
+ "nix-gleam": "nix-gleam",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"playground": "playground",
diff --git a/flake.nix b/flake.nix
index aea27f3..9bfce9b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,6 +18,7 @@
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
+ nix-gleam.url = "github:arnarg/nix-gleam";
uplcg.url = "git+https://stuebinm.eu/git/uplcg?ref=main";
uplcg.flake = false;
@@ -37,6 +38,8 @@
feeds.flake = false;
isabelle-utils.url = "git+https://stuebinm.eu/git/isabelle-utils";
isabelle-utils.flake = false;
+ bahnhof-name.url = "git+https://stuebinm.eu/git/bahnhof.name";
+ bahnhof-name.flake = false;
gtfsBooks.url = "git+https://stuebinm.eu/git/gtfs-books?ref=main";
gtfsBooks.flake = false;
@@ -48,8 +51,11 @@
let
nixpkgs = import inputs.nixpkgs {
system = "x86_64-linux";
- overlays =
- [ inputs.rust-overlay.overlays.default self.overlays.default ];
+ overlays = [
+ inputs.rust-overlay.overlays.default
+ inputs.nix-gleam.overlays.default
+ self.overlays.default
+ ];
};
mkConfig = imports: config:
inputs.nixpkgs.lib.nixosSystem rec {
diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix
index 210a34d..659517d 100644
--- a/pkgs/overlay.nix
+++ b/pkgs/overlay.nix
@@ -1,6 +1,9 @@
{ inputs, ... }:
self: super:
+let
+ unstable = inputs.nixpkgs-unstable.legacyPackages.${self.system}; # { inherit (self) system; };
+in
{
galmon-core = self.callPackage (import ./galmon.nix {}) {};
galmon-full = self.callPackage (import ./galmon.nix { buildAll = true; }) {};
@@ -78,4 +81,14 @@ self: super:
crs-tools = self.callPackage ./crs-tools.nix {};
travelynx = self.callPackage ./travelynx.nix {};
+
+ gleam = unstable.gleam;
+ beamPackages = super.beam.packagesWith super.erlang_nox;
+
+ bahnhof-name = (self.buildGleamApplication )
+ {
+ version = "0.1";
+ pname = "bahnhof.name";
+ src = inputs.bahnhof-name;
+ };
}