build and upload in flake.nix
This commit is contained in:
parent
14d3f73f27
commit
ae8c3531e5
19
flake.nix
19
flake.nix
@ -17,22 +17,35 @@
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
devDeps = with pkgs; [hugo brotli zopfli parallel dart-sass];
|
||||
in {
|
||||
in rec {
|
||||
devShells.default = pkgs.mkShell {
|
||||
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
||||
packages = devDeps;
|
||||
};
|
||||
|
||||
defaultPackage = pkgs.compressDrvWeb (pkgs.stdenv.mkDerivation {
|
||||
packages.default = pkgs.compressDrvWeb (pkgs.stdenv.mkDerivation {
|
||||
pname = "jakstys.lt";
|
||||
version = "1.0.0";
|
||||
|
||||
src = pkgs.lib.cleanSource self;
|
||||
buildInputs = devDeps;
|
||||
buildPhase = "hugo --cleanDestinationDir --printPathWarnings --panicOnWarning";
|
||||
installPhase = "mv public $out";
|
||||
}) {};
|
||||
|
||||
apps.default = {
|
||||
type = "app";
|
||||
program = builtins.toString (pkgs.writeShellScript "upload" ''
|
||||
${pkgs.rsync}/bin/rsync \
|
||||
--info=progress2 \
|
||||
--copy-links \
|
||||
--archive \
|
||||
--partial \
|
||||
--delete \
|
||||
${packages.default}/ \
|
||||
jakstys.lt:/var/www/jakstys.lt/
|
||||
'');
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
});
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -xeuo pipefail
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
scripts/build
|
||||
scripts/upload
|
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -xeuo pipefail
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
rsync --info=progress2 -a --partial --delete public/ jakstys.lt:/var/www/jakstys.lt/
|
Loading…
Reference in New Issue
Block a user