diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2f5dd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result \ No newline at end of file diff --git a/.woodpecker/build-deploy.yaml b/.woodpecker/build-deploy.yaml new file mode 100644 index 0000000..07c4c64 --- /dev/null +++ b/.woodpecker/build-deploy.yaml @@ -0,0 +1,27 @@ +when: + - event: push + branch: main + +steps: + - name: build & deploy + image: nixos/nix + # volumes: + # - /nix:/mnt/nix:ro + commands: + - | + echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf + #echo 'store = unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt' >> /etc/nix/nix.conf + + - nix build -L . + + - | + nix-shell -p s3cmd --command 's3cmd \ + --host=static-sites.hoki-porgy.ts.net:9000 \ + --host-bucket=static-sites.hoki-porgy.ts.net:9000 \ + --no-ssl \ + sync result/* s3://kitsu.love' + environment: + AWS_ACCESS_KEY_ID: + from_secret: static_sites_client + AWS_SECRET_ACCESS_KEY: + from_secret: static_sites_secret diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ca447d4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1746904237, + "narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f7954b3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "https://kitsu.love"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" ]; + perSystem = { config, self', pkgs, lib, system, ... }: { + packages.default = pkgs.stdenvNoCC.mkDerivation { + name = "noe.sh"; + src = ./.; + installPhase = '' + cp -r . $out/ + cd $out/ + rm -rf .* *.nix *.lock + ''; + }; + }; + }; +} \ No newline at end of file