diff --git a/flake.lock b/flake.lock index bc1c4bd..46e1a7a 100644 --- a/flake.lock +++ b/flake.lock @@ -563,7 +563,7 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems_10" + "systems": "systems_12" }, "locked": { "lastModified": 1710146030, @@ -581,7 +581,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_12" + "systems": "systems_14" }, "locked": { "lastModified": 1705309234, @@ -599,7 +599,7 @@ }, "flake-utils_7": { "inputs": { - "systems": "systems_14" + "systems": "systems_16" }, "locked": { "lastModified": 1710146030, @@ -1260,6 +1260,28 @@ "type": "github" } }, + "nix-webring": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "nte": "nte", + "systems": "systems_11" + }, + "locked": { + "lastModified": 1726250921, + "narHash": "sha256-lMpZgSZMWFA4nsogaIS9KS3bfgyW6tMR1LrRz6u2vo0=", + "ref": "refs/heads/main", + "rev": "d883daa41c5996c1b615d959b23d1e0e7cb42c1c", + "revCount": 1, + "type": "git", + "url": "https://git.jacekpoz.pl/jacekpoz/nixwebr.ing" + }, + "original": { + "type": "git", + "url": "https://git.jacekpoz.pl/jacekpoz/nixwebr.ing" + } + }, "nixpak": { "inputs": { "flake-parts": "flake-parts_2", @@ -1553,6 +1575,28 @@ } }, "nte": { + "inputs": { + "nixpkgs": [ + "nix-webring", + "nixpkgs" + ], + "systems": "systems_10" + }, + "locked": { + "lastModified": 1726242453, + "narHash": "sha256-VTHc10y2gI1CVmCayzzswPQPZ4S/QIi28VKpyfS+K1M=", + "ref": "refs/heads/main", + "rev": "b1f9ff4ed5fe38973c5c16db7b8c1f6100c52a5e", + "revCount": 51, + "type": "git", + "url": "https://git.jacekpoz.pl/jacekpoz/nte" + }, + "original": { + "type": "git", + "url": "https://git.jacekpoz.pl/jacekpoz/nte" + } + }, + "nte_2": { "inputs": { "nixpkgs": [ "pozsite", @@ -1699,7 +1743,7 @@ "plugin-vim-vsnip": "plugin-vim-vsnip", "plugin-which-key": "plugin-which-key", "rnix-lsp": "rnix-lsp", - "systems": "systems_11", + "systems": "systems_13", "zig": "zig" }, "locked": { @@ -3322,7 +3366,7 @@ "nixpkgs": [ "nixpkgs" ], - "nte": "nte" + "nte": "nte_2" }, "locked": { "lastModified": 1721584427, @@ -3394,6 +3438,7 @@ "iio-hyprland": "iio-hyprland", "nh": "nh", "nix-minecraft": "nix-minecraft", + "nix-webring": "nix-webring", "nixpak": "nixpak", "nixpkgs": "nixpkgs_9", "nur": "nur", @@ -3506,7 +3551,7 @@ "nixpkgs" ], "searx-randomizer": "searx-randomizer", - "systems": "systems_13" + "systems": "systems_15" }, "locked": { "lastModified": 1725210690, @@ -3646,6 +3691,36 @@ } }, "systems_13": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_14": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_15": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -3660,7 +3735,7 @@ "type": "github" } }, - "systems_14": { + "systems_16": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix index 0511241..2afe9da 100644 --- a/flake.nix +++ b/flake.nix @@ -113,5 +113,10 @@ nix-minecraft.url = "github:Infinidoge/nix-minecraft"; work-secrets.url = "git+ssh://jacekpoz/work/work-secrets"; + + nix-webring = { + url = "git+https://git.jacekpoz.pl/jacekpoz/nixwebr.ing"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } diff --git a/hosts/chmura/default.nix b/hosts/chmura/default.nix index 5f3803b..89d6998 100644 --- a/hosts/chmura/default.nix +++ b/hosts/chmura/default.nix @@ -1,11 +1,11 @@ _: { imports = [ - ./nixwebr.ing ./services ./trollface.pl ./configuration.nix ./hardware-configuration.nix ./jacekpoz.pl.nix + ./nixwebr.ing.nix ./profile.nix ./programs.nix ./system.nix diff --git a/hosts/chmura/nixwebr.ing.nix b/hosts/chmura/nixwebr.ing.nix new file mode 100644 index 0000000..e83bbce --- /dev/null +++ b/hosts/chmura/nixwebr.ing.nix @@ -0,0 +1,67 @@ +{ + inputs, + lib, + pkgs, + ... +}: let + inherit (lib.meta) getExe'; + + systemctl = getExe' pkgs.systemd "systemctl"; + + port = 5932; + sitePath = "/srv/web/nixwebr.ing"; +in { + services.caddy = { + enable = true; + virtualHosts = { + "nixwebr.ing".extraConfig = '' + reverse_proxy localhost:${toString port} + ''; + }; + }; + + users.groups.nixwebring = {}; + + users.users.nixwebring = { + isSystemUser = true; + group = "nixwebring"; + }; + + systemd = { + services = { + nix-webring-server = { + description = "The backend for nixwebr.ing"; + after = ["network.target"]; + wantedBy = ["multi-user.target"]; + + serviceConfig = { + Type = "simple"; + ExecStart = "${inputs.nix-webring.packages.${pkgs.system}.server}/bin/nix-webring-server"; + Restart = "on-failure"; + Environment = ''NIX_WEBRING_PORT="${toString port}" NIX_WEBRING_DIR="${sitePath}"''; + User = "nixwebring"; + Group = "nixwebring"; + }; + }; + + nix-webring-server-watcher = { + description = "Restarter for the backend"; + after = ["network.target"]; + wantedBy = ["multi-user.target"]; + + serviceConfig = { + Type = "oneshot"; + ExecStart = "${systemctl} restart nix-webring-server.service"; + }; + }; + }; + paths.nix-webring-server-watcher = { + wantedBy = ["multi-user.target"]; + + pathConfig = { + PathModified = sitePath; + Unit = "nix-webring-server-watcher.service"; + }; + }; + }; +} diff --git a/hosts/chmura/nixwebr.ing/default.nix b/hosts/chmura/nixwebr.ing/default.nix deleted file mode 100644 index 7eed47a..0000000 --- a/hosts/chmura/nixwebr.ing/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -_: { - services.caddy = { - enable = true; - virtualHosts."nixwebr.ing".extraConfig = '' - root * ${./.} - file_server - ''; - }; -} diff --git a/hosts/chmura/nixwebr.ing/index.css b/hosts/chmura/nixwebr.ing/index.css deleted file mode 100644 index c4eef1c..0000000 --- a/hosts/chmura/nixwebr.ing/index.css +++ /dev/null @@ -1,4 +0,0 @@ -body { - background-color: #111111; - color: #DDDDDD -} diff --git a/hosts/chmura/nixwebr.ing/index.html b/hosts/chmura/nixwebr.ing/index.html deleted file mode 100644 index 4c1ca57..0000000 --- a/hosts/chmura/nixwebr.ing/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - nix webring - - -

work in progress

- -