deploy: add build and deploy script as flake app

This commit is contained in:
Tobias Happ 2022-10-28 20:33:49 +02:00
parent 0a3b09df75
commit 28e2fde133
6 changed files with 116 additions and 155 deletions

34
scripts/deploy.nix Normal file
View file

@ -0,0 +1,34 @@
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
{ nixpkgs, system }:
let
pkgs = nixpkgs.legacyPackages.${system};
runtimePackages = with pkgs; [
coreutils
git
gnugrep
gnused
gnutar
gzip
jq
nix
openssh
rsync
];
in
pkgs.runCommand
"deploy"
{
preferLocalBuild = true;
allowSubstitutes = false;
}
''
install -D -m755 ${./deploy.sh} $out
substituteInPlace $out \
--subst-var-by bash "${pkgs.bash}" \
--subst-var-by path "${pkgs.lib.makeBinPath runtimePackages}"
''