my website at https://anirudh.fi
1{
2 description = "site";
3
4 inputs.nixpkgs.url = "github:nixos/nixpkgs";
5 inputs.vite.url = "git+https://tangled.org/@anirudh.fi/vite";
6
7 outputs =
8 { self
9 , nixpkgs
10 , vite
11 ,
12 }:
13 let
14 supportedSystems = [
15 "x86_64-linux"
16 "x86_64-darwin"
17 "aarch64-linux"
18 "aarch64-darwin"
19 ];
20 forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
21 nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
22 in
23 {
24 devShells = forAllSystems (
25 system:
26 let
27 pkgs = nixpkgsFor.${system};
28 in
29 {
30 default = pkgs.mkShell {
31 buildInputs = [
32 vite.packages.${system}.vite
33 pkgs.gotools
34 pkgs.gnumake
35 pkgs.entr
36 pkgs.awscli2
37 pkgs.tailwindcss_4
38 ];
39 };
40 }
41 );
42
43
44 apps = forAllSystems (
45 system:
46 let
47 pkgs = nixpkgsFor.${system};
48 in
49 {
50 default = {
51 type = "app";
52 program = "${pkgs.writeShellScriptBin "vite-build" ''
53 #!/usr/bin/env bash
54 ${vite.packages.${system}.vite}/bin/vite build
55 ''}/bin/vite-build";
56 cwd = ./.;
57 };
58 deploy = {
59 type = "app";
60 program = "${pkgs.writeShellScriptBin "s3-sync" ''
61 #!/usr/bin/env bash
62 ${vite.packages.${system}.vite}/bin/vite build
63 ${pkgs.awscli2}/bin/aws s3 sync build s3://site/ --size-only
64 ''}/bin/s3-sync";
65 };
66 }
67 );
68 };
69}