{ description = "Application packaged using poetry2nix"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; inputs.poetry2nix = { url = "github:nix-community/poetry2nix"; inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { self, nixpkgs, flake-utils, poetry2nix }: flake-utils.lib.eachDefaultSystem (system: let # 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 rec { hydraJobs = pkgs.lib.optionalAttrs (system == "x86_64-linux" ) { handyhelper = packages.handyhelper; runCommandHook = { handyhelper = pkgs.runCommand "Handy Helper Deploy" { nativeBuildInputs = [ packages.handyhelper ]; } '' 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; }; devShells.default = pkgs.mkShell { packages = with pkgs; [ poetry2nix.packages.${system}.poetry (mkPoetryEnv { projectDir = self; }) sops ]; }; } ); }