This commit is contained in:
Jeffrey C. Ollie 2024-06-20 09:20:17 -05:00
parent 04a0fc7557
commit e113833196
No known key found for this signature in database
GPG key ID: F936E4DCB7E25F15
2 changed files with 77 additions and 27 deletions

View file

@ -2,18 +2,17 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1700907157,
"narHash": "sha256-n71E17bx1cpSDJOxcB3G9UxjUUIzsIvdyY2oWAiiKv4=",
"owner": "natsukium",
"lastModified": 1707347730,
"narHash": "sha256-0etC/exQIaqC9vliKhc3eZE2Mm2wgLa0tj93ZF/egvM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "483af9297efc85e6bf0c7045cc07b685e31ca6a8",
"rev": "6832d0d99649db3d65a0e15fa51471537b2c56a6",
"type": "github"
},
"original": {
"owner": "natsukium",
"ref": "pydantic2",
"repo": "nixpkgs",
"type": "github"
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"root": {

View file

@ -3,8 +3,8 @@
inputs = {
nixpkgs = {
# url = "nixpkgs/nixos-23.05";
url = "github:natsukium/nixpkgs/pydantic2";
url = "nixpkgs/nixos-23.11";
# url = "github:natsukium/nixpkgs/pydantic2";
};
};
@ -19,21 +19,21 @@
py = pkgs.python3.override {
packageOverrides = final: prev: {
django = prev.django_4;
cronsim = let
version = "2.5";
pname = "cronsim";
src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-FTzwIZ3MGgyp5xqDav22B5ZTfYxSHGhsenMTSDdXM78=";
};
in
prev.buildPythonPackage {
inherit pname version src;
# nativeCheckInputs = [ prev.pytestCheckHook ];
pythonImportsCheck = [
"cronsim"
];
};
# cronsim = let
# version = "2.5";
# pname = "cronsim";
# src = pkgs.fetchPypi {
# inherit pname version;
# hash = "sha256-FTzwIZ3MGgyp5xqDav22B5ZTfYxSHGhsenMTSDdXM78=";
# };
# in
# prev.buildPythonPackage {
# inherit pname version src;
# # nativeCheckInputs = [ prev.pytestCheckHook ];
# pythonImportsCheck = [
# "cronsim"
# ];
# };
};
};
baseImage = {
@ -60,10 +60,61 @@
};
in {
packages.${system} = {
oncalendar = let
in
py.pkgs.buildPythonApplication {
inherit pname version propagatedBuildInputs;
format = "other";
outputs = ["out" "static" "doc"];
src = pkgs.fetchFromGitHub {
owner = "healthchecks";
repo = pname;
rev = "v${version}";
inherit hash;
};
dontPatch = true;
dontConfigure = true;
dontBuild = true;
doCheck = false;
installPhase = ''
mkdir -p $out/app
cp -r CHANGELOG.md hc manage.py templates $out/app
chmod +x $out/app/manage.py
mkdir -p $doc
cp -r *.md LICENSE $doc
mkdir -p $static
DEBUG=False SECRET_KEY=build-key STATIC_ROOT=$static ${py}/bin/python ./manage.py collectstatic --noinput
DEBUG=False SECRET_KEY=build-key STATIC_ROOT=$static ${py}/bin/python ./manage.py compress
cp -r static-collected/* $static
cp ${localSettings} $out/app/hc/local_settings.py
'';
passthru = {
# PYTHONPATH of all dependencies used by the package
pythonPath = py.pkgs.makePythonPath propagatedBuildInputs;
tests = {
inherit (pkgs.nixosTests) healthchecks;
};
};
meta = with pkgs.lib; {
homepage = "https://github.com/healthchecks/healthchecks";
description = "A cron monitoring tool written in Python & Django ";
license = licenses.bsd3;
};
};
healthchecks = let
pname = "healthchecks";
version = "3.0.1";
hash = "sha256-r8wzIZPetnTEJDKPx/Oxk+gzs8gbjEHSi40LSxLb1Js=";
version = "3.2";
hash = "sha256-TAhr1PeoGp/zqsnJz9C/w7auip4RdRIFSxvo6haOG0Q=";
localSettings = pkgs.writeText "local_settings.py" ''
import os
CSRF_TRUSTED_HOSTS = os.getenv("CSRF_TRUSTED_HOSTS", "").split(",")