-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
131 lines (117 loc) · 3.5 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
{
description = "Spaceness homepage";
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";
settings.global.excludes = [ "node_modules/**" ];
programs = {
taplo.enable = true;
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
prettier = {
enable = true;
settings = {
useTabs = true;
singleQuote = true;
trailingComma = "none";
printWidth = 100;
plugins = [
"prettier-plugin-svelte"
"prettier-plugin-tailwindcss"
];
overrides = [
{
files = "*.svelte";
options = {
parser = "svelte";
};
}
];
};
};
};
};
devShells = {
default = pkgs.mkShell {
name = "stardust";
packages = [
(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.2.1/bun-linux-x64-baseline.zip";
hash = "sha256-5PKoeW7i9DV+AvOHR6PYCqSKPeyoCqQbIaO4hBhVvx4=";
};
"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 ];
};
};
};
};
}