+/website

git clone https://git.julia.blue/+/website

Julia RyanMove to new Cortana3537b6e

master
1.3 KiB40 linesraw
1{
2  inputs = {
3    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4    utils.url = "github:numtide/flake-utils";
5  };
6  outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
7    let pkgs = nixpkgs.legacyPackages.${system}; in {
8      devShell = pkgs.mkShell {
9        packages = with pkgs; [
10          entr
11          caddy
12          (writeShellScriptBin "deploy" ''
13            set -eu
14            HOST="''${HOST-julia.blue}"
15            DIR="''${DIR-/website}"
16            cargo r -r
17            rsync -a --info=progress2  .site/ "$HOST:$DIR"
18          '')
19          (writeShellScriptBin "preview" ''
20            set -euo pipefail
21            cargo r -r
22            ln -sf assets .site/assets
23            caddy run --config Caddyfile &
24            readonly server_pid=$!
25            trap 'kill -9 $server_pid; echo "goodbye 👋"' EXIT
26            while sleep 1; do fd . assets/{pages,posts,projects,templates,} src |
27              entr -d cargo r -r; done
28          '')
29        ];
30        TMTHEME="${pkgs.fetchFromGitHub {
31          owner = "catppuccin";
32          repo = "bat";
33          rev = "699f60fc8ec434574ca7451b444b880430319941";
34          hash = "sha256-6fWoCH90IGumAMc4buLRWL0N61op+AuMNN9CAR9/OdI=";
35        }}/themes/Catppuccin Mocha.tmTheme";
36        # FONTS=[]; TODO: use ones from nix and copy them in the generator
37      };
38    }
39  );
40}