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": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1700907157, "lastModified": 1707347730,
"narHash": "sha256-n71E17bx1cpSDJOxcB3G9UxjUUIzsIvdyY2oWAiiKv4=", "narHash": "sha256-0etC/exQIaqC9vliKhc3eZE2Mm2wgLa0tj93ZF/egvM=",
"owner": "natsukium", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "483af9297efc85e6bf0c7045cc07b685e31ca6a8", "rev": "6832d0d99649db3d65a0e15fa51471537b2c56a6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "natsukium", "id": "nixpkgs",
"ref": "pydantic2", "ref": "nixos-23.11",
"repo": "nixpkgs", "type": "indirect"
"type": "github"
} }
}, },
"root": { "root": {

View file

@ -3,8 +3,8 @@
inputs = { inputs = {
nixpkgs = { nixpkgs = {
# url = "nixpkgs/nixos-23.05"; url = "nixpkgs/nixos-23.11";
url = "github:natsukium/nixpkgs/pydantic2"; # url = "github:natsukium/nixpkgs/pydantic2";
}; };
}; };
@ -19,21 +19,21 @@
py = pkgs.python3.override { py = pkgs.python3.override {
packageOverrides = final: prev: { packageOverrides = final: prev: {
django = prev.django_4; django = prev.django_4;
cronsim = let # cronsim = let
version = "2.5"; # version = "2.5";
pname = "cronsim"; # pname = "cronsim";
src = pkgs.fetchPypi { # src = pkgs.fetchPypi {
inherit pname version; # inherit pname version;
hash = "sha256-FTzwIZ3MGgyp5xqDav22B5ZTfYxSHGhsenMTSDdXM78="; # hash = "sha256-FTzwIZ3MGgyp5xqDav22B5ZTfYxSHGhsenMTSDdXM78=";
}; # };
in # in
prev.buildPythonPackage { # prev.buildPythonPackage {
inherit pname version src; # inherit pname version src;
# nativeCheckInputs = [ prev.pytestCheckHook ]; # # nativeCheckInputs = [ prev.pytestCheckHook ];
pythonImportsCheck = [ # pythonImportsCheck = [
"cronsim" # "cronsim"
]; # ];
}; # };
}; };
}; };
baseImage = { baseImage = {
@ -60,10 +60,61 @@
}; };
in { in {
packages.${system} = { 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 healthchecks = let
pname = "healthchecks"; pname = "healthchecks";
version = "3.0.1"; version = "3.2";
hash = "sha256-r8wzIZPetnTEJDKPx/Oxk+gzs8gbjEHSi40LSxLb1Js="; hash = "sha256-TAhr1PeoGp/zqsnJz9C/w7auip4RdRIFSxvo6haOG0Q=";
localSettings = pkgs.writeText "local_settings.py" '' localSettings = pkgs.writeText "local_settings.py" ''
import os import os
CSRF_TRUSTED_HOSTS = os.getenv("CSRF_TRUSTED_HOSTS", "").split(",") CSRF_TRUSTED_HOSTS = os.getenv("CSRF_TRUSTED_HOSTS", "").split(",")