Skip to content

Commit dd66455

Browse files
committed
feat: build package using nix and move nix stuff into nix/ folder to declobber workspace
1 parent 97a8a27 commit dd66455

File tree

5 files changed

+114
-4
lines changed

5 files changed

+114
-4
lines changed

.gitignore

+72
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,75 @@ pnpm-debug.log*
1919

2020
# macOS-specific files
2121
.DS_Store
22+
23+
# Nix
24+
result
25+
result-*
26+
.direnv/
27+
.devenv/
28+
29+
# Node/npm/pnpm
30+
node_modules/
31+
.pnpm-store/
32+
.npm/
33+
.node_repl_history
34+
npm-debug.log*
35+
pnpm-debug.log*
36+
37+
# Build outputs
38+
build/
39+
out/
40+
.output/
41+
.astro/
42+
43+
# Environment variables
44+
.env
45+
.env.*
46+
!.env.example
47+
48+
# IDE and editor files
49+
.idea/
50+
.vscode/
51+
*.swp
52+
*.swo
53+
*~
54+
.DS_Store
55+
56+
# Logs
57+
logs/
58+
*.log
59+
npm-debug.log*
60+
yarn-debug.log*
61+
yarn-error.log*
62+
63+
# Cache directories
64+
.cache/
65+
.eslintcache
66+
.stylelintcache
67+
.parcel-cache/
68+
69+
# Test coverage
70+
coverage/
71+
.nyc_output/
72+
73+
# Temporary files
74+
*.tmp
75+
*.temp
76+
.tmp/
77+
tmp/
78+
79+
# Local development
80+
*.local
81+
82+
# TypeScript
83+
*.tsbuildinfo
84+
85+
# Yarn
86+
.yarn/*
87+
!.yarn/patches
88+
!.yarn/plugins
89+
!.yarn/releases
90+
!.yarn/sdks
91+
!.yarn/versions
92+
.pnp.*
93+

flake.nix

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
{
2-
description = "Simple flake with a devshell";
2+
description = "Flake for Genki Documentation";
33

4-
# Add all your dependencies here
54
inputs = {
65
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
76
blueprint.url = "github:numtide/blueprint";
87
blueprint.inputs.nixpkgs.follows = "nixpkgs";
98
treefmt-nix.url = "github:numtide/treefmt-nix";
109
};
1110

12-
# Load the blueprint
13-
outputs = inputs: inputs.blueprint { inherit inputs; };
11+
outputs =
12+
inputs:
13+
inputs.blueprint {
14+
inherit inputs;
15+
prefix = "nix/";
16+
systems = [
17+
"aarch64-darwin"
18+
"x86_64-linux"
19+
];
20+
};
1421
}
File renamed without changes.
File renamed without changes.

nix/package.nix

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{ pkgs, ... }:
2+
let
3+
pname = "genki-docs";
4+
version = "0.1.0";
5+
src = ./..;
6+
in
7+
pkgs.stdenv.mkDerivation {
8+
inherit pname version src;
9+
10+
nativeBuildInputs = [
11+
pkgs.nodejs
12+
pkgs.pnpm.configHook
13+
pkgs.typescript
14+
pkgs.vips
15+
pkgs.pkg-config
16+
];
17+
buildPhase = ''
18+
pnpm build
19+
'';
20+
21+
installPhase = ''
22+
runHook preInstall
23+
cp -pr --reflink=auto dist $out/
24+
runHook postInstall
25+
'';
26+
27+
pnpmDeps = pkgs.pnpm.fetchDeps {
28+
inherit pname version src;
29+
hash = "sha256-2OXwnhc6rN3j7vWB5UBardWt38u+X6wfH+9wOfseIXY=";
30+
};
31+
}

0 commit comments

Comments
 (0)