-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathflake.nix
149 lines (132 loc) · 3.96 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{
description = "Stardust";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixpkgs-unstable";
};
flake-parts = {
type = "github";
owner = "hercules-ci";
repo = "flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# a tree-wide formatter
treefmt-nix = {
type = "github";
owner = "numtide";
repo = "treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
systems = {
type = "github";
owner = "nix-systems";
repo = "default";
};
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.treefmt-nix.flakeModule ];
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem =
{ lib
, pkgs
, self'
, config
, inputs'
, system
, ...
}:
{
# this is what controls how packages in the flake are built, but this is not passed to the
# builders in lib which is important to note, since we have to do something different for
# the builders to work correctly
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
};
overlays = [ ];
};
formatter = config.treefmt.build.wrapper;
treefmt = {
projectRootFile = "flake.nix";
programs = {
taplo.enable = true;
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
biome = {
enable = true;
settings =
let
ignore = [
".next"
"node_modules"
"public/files/*"
];
in
{
organizeImports = {
enabled = true;
inherit ignore;
};
formatter = {
indentStyle = "space";
indentWidth = 2;
lineWidth = 310;
inherit ignore;
};
javascript.formatter = {
semicolons = "asNeeded";
trailingComma = "none";
quoteStyle = "single";
};
};
};
shfmt = {
enable = true;
indent_size = 2;
};
};
};
devShells = {
default = pkgs.mkShell {
name = "stardust";
packages = [
pkgs.nodejs_latest
pkgs.nodePackages_latest.pnpm # PNPM package manager
pkgs.postgresql_16
pkgs.libpqxx
pkgs.jq
(pkgs.bun.overrideAttrs rec {
version = "1.1.43";
passthru.sources = {
"x86_64-linux" = pkgs.fetchurl {
url = "https://github.com/oven-sh/bun/releases/download/bun-v1.1.43/bun-linux-x64-baseline.zip";
hash = "sha256-6xY2I50sQoggJq3F3whD86kmTPHykOxzX5RbQsXxoX8=";
};
"x86_64-darwin" = pkgs.fetchurl {
url = "https://github.com/oven-sh/bun/releases/download/bun-v1.1.43/bun-darwin-x64-baseline.zip";
hash = "sha256-q2vBAlBJ7FRowGje7F50MUdgDrOmeyG0xHYC1nRpETY=";
};
};
src = passthru.sources.${system};
})
];
inputsFrom = [ config.treefmt.build.devShell ];
};
};
};
};
}