bring back scripts/

nix insists on mtime of 1970.
This commit is contained in:
Motiejus Jakštys 2024-10-09 21:57:41 -04:00
parent c4296b3278
commit a6c82632a8
3 changed files with 13 additions and 26 deletions

View File

@ -16,34 +16,10 @@
}: }:
flake-utils.lib.eachDefaultSystem (system: let flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;}; pkgs = import nixpkgs {inherit system;};
devDeps = with pkgs; [hugo brotli zopfli parallel dart-sass]; in {
in rec {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
packages = devDeps; packages = with pkgs; [hugo brotli zopfli parallel dart-sass];
};
packages.default = pkgs.compressDrvWeb (pkgs.stdenv.mkDerivation {
pname = "jakstys.lt";
version = "1.0.0";
src = pkgs.lib.cleanSource self;
buildInputs = with pkgs; [hugo dart-sass];
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; formatter = pkgs.alejandra;

6
scripts/build-and-upload Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -xeuo pipefail
cd "$(git rev-parse --show-toplevel)"
scripts/build
scripts/upload

5
scripts/upload Executable file
View File

@ -0,0 +1,5 @@
#!/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/