expose overlay (2)
This commit is contained in:
parent
9243e1fe0f
commit
05f710b980
3 changed files with 55 additions and 91 deletions
|
|
@ -62,6 +62,8 @@ def eintopf_post_event(title, location, description, time_start, time_end):
|
|||
else:
|
||||
return False
|
||||
|
||||
print("Beginning scraping Radar api ...")
|
||||
|
||||
response = requests.get(config["radar"]["api_endpoint"])
|
||||
|
||||
if response.status_code == 200:
|
||||
|
|
|
|||
34
flake.lock
generated
34
flake.lock
generated
|
|
@ -1,23 +1,5 @@
|
|||
{
|
||||
"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": {
|
||||
"locked": {
|
||||
"lastModified": 1741600792,
|
||||
|
|
@ -35,24 +17,8 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"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",
|
||||
|
|
|
|||
110
flake.nix
110
flake.nix
|
|
@ -1,63 +1,59 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-24.11";
|
||||
# Required for multi platform support
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
description = "eintopf-radar-sync package and service";
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
rec {
|
||||
devShell = pkgs.mkShell {
|
||||
packages =
|
||||
with pkgs;
|
||||
with python3Packages;
|
||||
[
|
||||
python
|
||||
requests
|
||||
beautifulsoup4
|
||||
pyyaml
|
||||
];
|
||||
};
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-24.11";
|
||||
|
||||
packages = flake-utils.lib.flattenTree {
|
||||
eintopf-radar-sync = pkgs.python3Packages.buildPythonApplication {
|
||||
pname = "eintopf-radar-sync";
|
||||
version = "0.0.1";
|
||||
format = "other";
|
||||
|
||||
src = self;
|
||||
|
||||
dependencies = with pkgs.python3Packages; [
|
||||
python
|
||||
requests
|
||||
beautifulsoup4
|
||||
pyyaml
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 ${./eintopf-radar-sync.py} $out/bin/eintopf-radar-sync
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultPackage = packages.eintopf-radar-sync;
|
||||
|
||||
# eintopf-radar-sync service module
|
||||
nixosModule = (import ./module.nix);
|
||||
|
||||
overlay = self: super: {
|
||||
eintopf-radar-sync = packages.eintopf-radar-sync;
|
||||
};
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
||||
# Import nixpkgs with our overlay for each system.
|
||||
nixpkgsFor = forAllSystems (system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlay ];
|
||||
}
|
||||
);
|
||||
in {
|
||||
overlay = final: prev: {
|
||||
eintopf-radar-sync = with final; python3Packages.buildPythonApplication {
|
||||
pname = "eintopf-radar-sync";
|
||||
version = "0.0.1";
|
||||
format = "other";
|
||||
|
||||
src = self;
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
python
|
||||
requests
|
||||
beautifulsoup4
|
||||
pyyaml
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 ${./eintopf-radar-sync.py} $out/bin/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
|
||||
nixosModule = (import ./module.nix);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue