Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/.direnv/
/.vscode/
/dist/
pnpm-lock.yaml
package-lock.json
*.d.ts
**/*.mdx
src/components/Posthog.astro
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ Make sure that you have Nix and [direnv] installed, then:
```shell
# Activate Nix development environment
direnv allow

# Recommended
alias npm=pnpm
```

## Developing the site
Expand Down Expand Up @@ -159,7 +156,6 @@ We also recommend adding these settings to your local `.vscode/settings.json`:
"**/.git": true,
"**/node_modules": true,
"dist": true,
"pnpm-lock.yaml": true,
"*.d.ts": true,
"tmp": true,
},
Expand Down
7 changes: 5 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import alpinejs from "@astrojs/alpinejs";
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
import typography from "@tailwindcss/typography";
import tailwindcss from "@tailwindcss/vite";
import expressiveCode from "astro-expressive-code";
import icon from "astro-icon";
import { defineConfig } from "astro/config";
Expand Down Expand Up @@ -35,7 +36,6 @@ export default defineConfig({
remarkPlugins: [remarkEmoji, remarkHeadingId],
}),
sitemap(),
tailwind(),
react(),
],
markdown: {
Expand All @@ -55,4 +55,7 @@ export default defineConfig({
port: 3000,
},
site: "https://zero-to-nix.com",
vite: {
plugins: [tailwindcss({ plugins: [typography] })],
},
});
30 changes: 17 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
lychee

# JS
nodejs
pnpm
nodejs_latest

# Serve locally
static-web-server
Expand All @@ -60,26 +59,31 @@
};

scripts = with pkgs; [
(script "setup" [ pnpm ] "pnpm install")
(script "pnpm" [ ] ''
echo "pnpm is no longer used in this repo; use npm instead"
exit 1
'')

(script "setup" [ nodejs_latest ] "npm ci")

(script "build" [ pnpm ] ''
(script "build" [ nodejs_latest ] ''
setup
pnpm run build
npm run build
'')

(script "build-ci" [ pnpm ] ''
(script "build-ci" [ nodejs_latest ] ''
setup
ENV=ci pnpm run build
ENV=ci npm run build
'')

(script "dev" [ pnpm ] ''
(script "dev" [ nodejs_latest ] ''
setup
pnpm run dev
npm run dev
'')

(script "format" [ pnpm ] ''
(script "format" [ nodejs_latest ] ''
setup
pnpm run format
npm run format
'')

(script "check-internal-links" [ htmltest ] ''
Expand All @@ -90,9 +94,9 @@
vale src/pages
'')

(script "preview" [ pnpm ] ''
(script "preview" [ nodejs_latest ] ''
build
pnpm run preview
npm run preview
'')

(script "check-nix-formatting" [ nixfmt-rfc-style ] ''
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
command = "./scripts/netlify-redirects.sh >> netlify.toml && pnpm run build"
command = "./scripts/netlify-redirects.sh >> netlify.toml && npm run build"
publish = "dist"

[context.production]
Expand Down
Loading