expose overlay (2)

This commit is contained in:
Jonas Heinrich 2025-03-12 11:29:56 +01:00
parent 9243e1fe0f
commit 05f710b980
3 changed files with 55 additions and 91 deletions

View file

@ -62,6 +62,8 @@ def eintopf_post_event(title, location, description, time_start, time_end):
else: else:
return False return False
print("Beginning scraping Radar api ...")
response = requests.get(config["radar"]["api_endpoint"]) response = requests.get(config["radar"]["api_endpoint"])
if response.status_code == 200: if response.status_code == 200:

34
flake.lock generated
View file

@ -1,23 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1741600792, "lastModified": 1741600792,
@ -35,24 +17,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -1,43 +1,29 @@
{ {
inputs = { description = "eintopf-radar-sync package and service";
nixpkgs.url = "nixpkgs/nixos-24.11";
# Required for multi platform support
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs.nixpkgs.url = "nixpkgs/nixos-24.11";
{
self, outputs = { self, nixpkgs }:
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let let
pkgs = import nixpkgs { inherit system; }; systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
in forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
rec { # Import nixpkgs with our overlay for each system.
devShell = pkgs.mkShell { nixpkgsFor = forAllSystems (system:
packages = import nixpkgs {
with pkgs; inherit system;
with python3Packages; overlays = [ self.overlay ];
[ }
python );
requests in {
beautifulsoup4 overlay = final: prev: {
pyyaml eintopf-radar-sync = with final; python3Packages.buildPythonApplication {
];
};
packages = flake-utils.lib.flattenTree {
eintopf-radar-sync = pkgs.python3Packages.buildPythonApplication {
pname = "eintopf-radar-sync"; pname = "eintopf-radar-sync";
version = "0.0.1"; version = "0.0.1";
format = "other"; format = "other";
src = self; src = self;
dependencies = with pkgs.python3Packages; [ dependencies = with python3Packages; [
python python
requests requests
beautifulsoup4 beautifulsoup4
@ -50,14 +36,24 @@
}; };
}; };
defaultPackage = packages.eintopf-radar-sync; packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) eintopf-radar-sync;
});
defaultPackage = forAllSystems (system: self.packages.${system}.eintopf-radar-sync);
devShells = forAllSystems (system: let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
in pkgs.mkShell {
buildInputs = with pkgs; with python3Packages; [
python
requests
beautifulsoup4
pyyaml
];
});
# eintopf-radar-sync service module # eintopf-radar-sync service module
nixosModule = (import ./module.nix); nixosModule = (import ./module.nix);
overlay = self: super: {
eintopf-radar-sync = packages.eintopf-radar-sync;
}; };
}
);
} }