update flake, add module

This commit is contained in:
Jonas Heinrich 2024-12-26 16:26:51 +01:00
parent 1c5b52eab0
commit 7ce1a3ab3a
5 changed files with 172 additions and 48 deletions

View file

@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs.url = "nixpkgs/nixos-24.11";
# Required for multi platform support
flake-utils.url = "github:numtide/flake-utils";
};
@ -9,23 +9,40 @@
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
start =
pkgs.writeShellScriptBin "start" ''
set -e
${pkgs.python3}/bin/python eintopf-sync.py
'';
in
{
rec {
devShell = pkgs.mkShell {
packages = with pkgs; with python3Packages; [
python3
python
requests
beautifulsoup4
];
};
packages = { inherit start; };
defaultPackage = start;
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
];
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);
});
}