Files
HandyHelper/deploy/flake.nix

42 lines
1.2 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}.handyhelper;
in {
nixosConfigurations."staging" = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
../secrets/deploy.nix
({lib, config, pkgs, ...}: let
in {
systemd.services.handyhelper = {
wantedBy = ["networking-online.target"];
enable = true;
serviceConfig = {
WorkingDirectory = config.users.users.handy.home;
ExecStart = ''
${handy_py}/bin/handyhelper
'';
User = "handy";
RuntimeDirectory = "handyhelper";
RuntimeDirectoryMode = "0755";
};
};
users.users = {
handy = {
home = "/var/lib/handyhelper";
useDefaultShell = true;
isSystemUser = true;
group = "handy";
};
};
users.groups.handy = {};
})
];
};
};
}