Files
HandyHelper/deploy/flake.nix

45 lines
1.1 KiB
Nix

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.handyhelper.url = "../";
outputs = { self, nixpkgs, handyhelper }: let
system = "x86_64-linux";
handy_py = handyhelper.packages.${system}.default;
in {
nixosConfigurations."staging" = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
../secrets/deploy.nix
({lib, config, pkgs, ...}: let
py = pkgs.python3.withPackages (p: with p; [
handy_py
]);
handybot = pkgs.writeShellApplication {
name = "Handy Helper Discord Bot";
runtimeInputs = with pkgs; [
py
];
text = ''
python -m handyhelper
'';
};
in {
systemd.services.handyhelper = {
wantedBy = ["networking-online.target"];
enable = true;
path = [
py
];
serviceConfig = {
StartExec = handybot;
};
};
})
];
};
};
}