2023-08-27 01:51:57 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-08-15 23:39:13 +02:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-24.05";
|
2023-08-27 01:51:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs }: let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in {
|
|
|
|
packages.${system} = {
|
|
|
|
default = self.packages.${system}.pvv-calendar-bot;
|
|
|
|
pvv-calendar-bot = pkgs.python3Packages.buildPythonPackage {
|
|
|
|
name = "pvv-calendar-bot";
|
|
|
|
src = ./.;
|
2024-08-15 23:39:13 +02:00
|
|
|
pyproject = true;
|
2023-08-27 01:51:57 +02:00
|
|
|
|
2024-08-15 23:39:13 +02:00
|
|
|
build-system = [
|
2023-08-27 01:51:57 +02:00
|
|
|
pkgs.python3Packages.setuptools
|
2024-08-15 23:39:13 +02:00
|
|
|
pkgs.python3Packages.setuptools-scm
|
2023-08-27 01:51:57 +02:00
|
|
|
];
|
|
|
|
|
2024-08-15 23:39:13 +02:00
|
|
|
dependencies = with pkgs.python3Packages; [
|
2023-08-27 01:51:57 +02:00
|
|
|
beautifulsoup4
|
|
|
|
markdown2
|
|
|
|
matrix-nio
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosModules.default = ./module.nix;
|
|
|
|
|
|
|
|
overlays.${system}.default = prevPackages: finalPackages: {
|
|
|
|
inherit (self.packages.${system}) pvv-calendar-bot;
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations."test" = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
self.nixosModules.default
|
|
|
|
{ nixpkgs.overlays = [ self.overlays."x86_64-linux".default ]; }
|
|
|
|
{
|
|
|
|
boot.isContainer = true;
|
|
|
|
|
|
|
|
services.pvv-calendar-bot = {
|
|
|
|
enable = true;
|
|
|
|
settings.matrix = {
|
|
|
|
channel = "testchannel";
|
|
|
|
user = "testuser";
|
|
|
|
homeserver = "pvv.ntnu.no";
|
|
|
|
};
|
|
|
|
settings.secretsFile = pkgs.writeText "calendarSecrets" "snakeoil";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|