-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (51 loc) · 1.56 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 = "nobbz.dev - Website";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
d2n.url = "github:nix-community/dream2nix";
d2n.inputs.all-cabal-json.follows = "nixpkgs";
nobbz.url = "github:nobbz/nixos-config";
nix-filter.url = "github:numtide/nix-filter";
flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = {
self,
d2n,
nixpkgs,
nix-filter,
flake-parts,
pre-commit,
...
} @ inputs: let
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
in
flake-parts.lib.mkFlake {inherit inputs;} {
inherit systems;
imports = [d2n.flakeModuleBeta pre-commit.flakeModule ./nix/blog.nix ./nix/hooks.nix];
perSystem = {
config,
pkgs,
self',
inputs',
system,
...
}: {
formatter = inputs'.nobbz.formatter;
apps.serve.program = "${pkgs.writeShellScript "serve" ''
set -e
result=$(nom build .#blog --print-out-paths)
${pkgs.miniserve}/bin/miniserve -p 3001 --index index.html ''${result}
''}";
packages.default = self'.packages.blog;
devShells.default = pkgs.mkShell {
packages = builtins.attrValues {
inherit (pkgs) yarn nodejs_20 yarn2nix nil;
inherit (pkgs.nodePackages) gatsby-cli;
inherit (inputs.nobbz.packages.${system}) alejandra;
};
shellHook = config.pre-commit.installationScript;
};
};
};
}