Initial Deployment Schema

This commit is contained in:
2023-03-15 22:12:56 -04:00
parent ffea0b04bb
commit 0c3389115f

View File

@@ -14,7 +14,34 @@
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication mkPoetryEnv;
pkgs = nixpkgs.legacyPackages.${system};
in {
in rec {
hydraJobs = lib.optionalAttrs
(system == "x86_64-linux" ) {
handyhelper = packages.handyhelper;
runCommandHook = {
handyhelper = pkgs.runCommand "Handy Helper Deploy" {
nativeBuildInputs = [newalan];
} ''
cat << 'DOC' >> $out
#!${pkgs.runtimeShell}
export tmp=$(mktemp -d)
pushd $tmp
${pkgs.wget}/bin/wget \
https://git.syzygial.cc/Syzygial/HandyHelper/archive/${self.rev}.bundle
git clone * src
${pkgs.tree}/bin/tree
cd src
${pkgs.sops}/bin/sops -i -d secrets/deploy.nix
${pkgs.sops}/bin/sops -i -d secrets/deploy.sh
export flake="$tmp/src/deploy"
${pkgs.runtimeShell} ./secrets/deploy.sh
DOC
chmod +x $out
'';
};
};
packages = {
handyhelper = mkPoetryApplication { projectDir = self; };
default = self.packages.${system}.myapp;