-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (53 loc) · 1.9 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "A Nix-flake-based Node.js development environment";
inputs = {
# https://github.com/NixOS/nixpkgs/branches
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
};
outputs = {
nixpkgs,
self,
...
} @ inputs: let
overlays = [
(final: prev: {
nodejs = prev.nodejs_21;
})
];
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {inherit overlays system;};
});
in {
devShells = forEachSupportedSystem ({pkgs}: {
default = pkgs.mkShell {
packages = with pkgs; [
# Cowsay reborn, just for fun
# https://github.com/Code-Hex/Neo-cowsay
neo-cowsay
nodejs
];
shellHook = ''
cowthink "Welcome to this nix dev shell!" --bold -f tux --rainbow
echo "Versions:"
echo "- Node.js $(node --version)"
echo "- npm $(npm --version)"
# secrets exposed as environment variables
export CLOUDFLARE_R2=$(cat /run/secrets/cloudflare/r2 | jq .personal | tr -d '"');
export ELEVENLABS_API_KEY=$(cat /run/secrets/elevenlabs/api_key);
export GITHUB_TOKEN=$(cat /run/secrets/github-tokens/semantic_release_bot);
export NPM_TOKEN=$(cat /run/secrets/npm-tokens/semantic_release_bot);
export PLAUSIBLE=$(cat /run/secrets/plausible/test_site);
export TELEGRAM=$(cat /run/secrets/telegram/personal_bot);
'';
CLOUDFLARE_ACCOUNT_ID = "43f9884041661b778e95a26992850715";
# DEBUG = "script:*,Eleventy:EleventyErrorHandler,11ty-plugin:csp:*";
DEBUG = "Eleventy:EleventyErrorHandler,hosting-utils:*,11ty-plugin:csp:*,csp:*";
NODE_ENV = "development";
# SKIP_VALIDATION = 1;
};
});
};
}