-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
80 lines (75 loc) · 2.12 KB
/
flake.nix
File metadata and controls
80 lines (75 loc) · 2.12 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
description = "elanora.lol - elanora96's personal site";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
perSystem =
{
self',
pkgs,
lib,
...
}:
let
name = "elanora.lol";
pname = name;
src = ./.;
inherit (pkgs) buildNpmPackage;
inherit (pkgs) importNpmLock;
nodejs = pkgs.nodejs_latest;
meta = {
description = "elanora.lol - elanora96's personal site";
longDescription = ''
A personal site built in React with Vite, Typescript, CSS Modules,
MDX, SSR, and much more.
'';
homepage = "https://elanora.lol";
license = lib.licenses.isc;
maintainers = with lib.maintainers; [ elanora96 ];
platforms = lib.platforms.all;
};
in
{
packages = {
frontend = buildNpmPackage {
inherit
name
pname
src
meta
;
npmDeps = importNpmLock { npmRoot = src; };
inherit (importNpmLock) npmConfigHook;
buildInputs = [ nodejs ];
installPhase = ''
mkdir -p $out
cp -r ./build $out/build
'';
};
default = self'.packages.frontend;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nixfmt-rfc-style
];
packages = [
importNpmLock.hooks.linkNodeModulesHook
nodejs
];
npmDeps = importNpmLock.buildNodeModules {
npmRoot = src;
inherit nodejs;
};
};
};
};
}