apps: add app .#deploy

This commit is contained in:
DavHau 2023-07-17 23:21:54 +02:00
parent 911830ac2f
commit 4bb05fe0f1
2 changed files with 22 additions and 0 deletions

19
flake-parts/deploy.nix Normal file
View File

@ -0,0 +1,19 @@
{
perSystem = {
lib,
pkgs,
self',
...
}: let
deployScript = pkgs.writeScript "deploy.sh" ''
export PATH="${lib.makeBinPath [
pkgs.openssh
pkgs.rsync
]}"
rsync -a ${self'.packages.default}/ root@clan.lol:/var/www
'';
in {
apps.deploy.program = "${deployScript}";
};
}

View File

@ -9,6 +9,9 @@
outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
systems = lib.systems.flakeExposed;
imports = [
./flake-parts/deploy.nix
];
perSystem = { pkgs, ... }: {
packages.default = pkgs.runCommand "website" {
buildInputs = [ pkgs.zola ];