From b08fe0485e245ee3cfc72cd6f9d0def4d189f5f3 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 15 Jun 2024 19:54:39 +0200 Subject: [PATCH] pastila: add paste.py --- flake.lock | 154 +++++++++++++++++++++++++++++++++++++- flake.nix | 2 + pastila/configuration.nix | 1 + pastila/paste.nix | 17 +++++ 4 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 pastila/paste.nix diff --git a/flake.lock b/flake.lock index a0528d3..72e85dd 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,45 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "paste-py", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703863825, + "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1718208800, @@ -16,9 +56,121 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1718419000, + "narHash": "sha256-v4+aJpRDbJil691DXo5SydqowcB01B6E9+wFH/pNk6k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "24b048f70e34020c93ed7c11491bc050ff6eb142", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "paste-py": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "poetry2nix": "poetry2nix" + }, + "locked": { + "lastModified": 1718472648, + "narHash": "sha256-eugtFG0Z2uycs29m9XsezGoE7xBWYD7EaysDH4+RMz4=", + "ref": "refs/heads/pastisserie", + "rev": "fd4b051067a09b1f76df5516514330e0d53398f7", + "revCount": 126, + "type": "git", + "url": "https://github.com/Armael/paste-py" + }, + "original": { + "rev": "fd4b051067a09b1f76df5516514330e0d53398f7", + "type": "git", + "url": "https://github.com/Armael/paste-py" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_2", + "systems": "systems_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1718285706, + "narHash": "sha256-DScsBM+kZvxOva7QegfdtleebMXh30XPxDQr/1IGKYo=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "a5be1bbbe0af0266147a88e0ec43b18c722f2bb9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "paste-py": "paste-py" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "paste-py", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717850719, + "narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 7fdea7d..8972f5b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,7 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + inputs.paste-py.url = "git+https://github.com/Armael/paste-py?rev=fd4b051067a09b1f76df5516514330e0d53398f7"; + inputs.paste-py.inputs.nixpkgs.follows = "nixpkgs"; outputs = { self, nixpkgs, ... }@attrs: { nixosConfigurations."oven" = nixpkgs.lib.nixosSystem { diff --git a/pastila/configuration.nix b/pastila/configuration.nix index 0c1836f..fd68396 100644 --- a/pastila/configuration.nix +++ b/pastila/configuration.nix @@ -16,6 +16,7 @@ in ./weechat-relay.nix ./prosody.nix ./headscale.nix + ./paste.nix ]; # Use the GRUB 2 boot loader. diff --git a/pastila/paste.nix b/pastila/paste.nix new file mode 100644 index 0000000..fc49dec --- /dev/null +++ b/pastila/paste.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, paste-py, ... }: + +{ + # import the nixos module exported by the paste-py flake + imports = [ paste-py.nixosModules.default ]; + + custom.paste-py.enable = true; + + services.nginx.enable = true; + services.nginx.virtualHosts."paste.isomorphis.me" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8888"; + }; + }; +} \ No newline at end of file