-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
191 lines (181 loc) · 5.42 KB
/
flake.nix
File metadata and controls
191 lines (181 loc) · 5.42 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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
{
description = "SnowBlower";
inputs = {
# global, so they can be `.follow`ed
systems.url = "github:nix-systems/default-linux";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
};
outputs = inputs @ {
flake-parts,
nixpkgs,
...
}: let
# We extend the base library with our snowblower functions.
lib = nixpkgs.lib.extend (l: _: (import ./lib l));
in
flake-parts.lib.mkFlake {
inherit inputs;
specialArgs = {inherit lib;};
} ({
withSystem,
flake-parts-lib,
inputs,
self,
...
}: let
inherit (flake-parts-lib) importApply;
flakeModules.default = importApply ./flake-module.nix {inherit withSystem;};
mkSnow = import ./mkSnow.nix {inherit lib inputs self;};
in {
imports = [
flakeModules.default
];
systems = import inputs.systems;
perSystem = _: {
snowblower = {
integration = {
aider = {
enable = true;
commands = {
son = {
description = "using Sonet as base";
watchFiles = true;
suggestShellCommands = false;
readFiles = ["CONVENTIONS.MD"];
lintCommands = ["treefmt"];
};
gem = {
description = "using Gemini as base";
model = "gemini";
watchFiles = true;
suggestShellCommands = false;
# readFiles = ["CONVENTIONS.MD"];
lintCommands = ["treefmt"];
};
};
};
agenix = {
enable = true;
secrets = {
".env.local" = {
publicKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL0idNvgGiucWgup/mP78zyC23uFjYq0evcWdjGQUaBH"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSE69dmDxQ/UJ8k+8CL3lzc/PyJXXO/2aCcYQOjkTW+"
];
};
};
};
preCommit.enable = true;
treefmt.enable = true;
};
shell = {
atuin.enable = true;
};
language.javascript = {
enable = true;
npm.enable = true;
};
# process."npm-dev" = {
# enable = true;
# exec = "npm install && npm run docs:dev";
# port = {
# container = 5173;
# host = 5173;
# };
# };
service = {
};
tool = {
alejandra.enable = true;
statix.enable = true;
deadnix.enable = true;
shfmt.enable = true;
keepSorted.enable = true;
};
};
};
flake = {
inherit flakeModules mkSnow;
};
});
}
# outputs = inputs @ {
# self,
# flake-parts,
# ...
# }: let
# src = ./.;
# #
# bootstrap =
# inputs.flake-parts.lib.mkFlake {
# inherit inputs self;
# moduleLocation = ./flake.nix;
# } ({...}: {
# imports = [
# {
# _module.args = {
# inherit src;
# };import inputs.systems;
# }
# ./packages/flake/modules
# ./packages/flake/lib
# ];
# debug = true;
# systems = import inputs.systems;
# });
# mkSnowBlower = import ./packages/flake/mkSnowBlower.nix {inherit inputs self;};
# in
# inputs.flake-parts.lib.mkFlake {inherit inputs;} ({...}: {
# imports = [
# bootstrap.flakeModules.default
# # ./options-document.nix
# ];
# flake =
# bootstrap
# // {
# templates = let
# base = {
# path = ./packages/flake/templates/base;
# description = "The base snow blower flake.";
# };
# in {
# inherit base;
# default = base;
# ruby = {
# path = ./packages/flake/templates/ruby;
# description = "A simple Ruby project";
# welcomeText = ''
# # Simple Ruby Project Template
# ## Intended usage
# The intended usage of this flake is to provide a starting point for Ruby projects using Nix flakes.
# ## More info
# - [Ruby language](https://www.ruby-lang.org/)
# - [Ruby on the NixOS Wiki](https://wiki.nixos.org/wiki/Ruby)
# - ...
# '';
# };
# laravel = {
# path = ./packages/flake/templates/laravel;
# description = "A simple Laravel project";
# welcomeText = ''
# # Simple Laravel Project Template
# ## Intended usage
# The intended usage of this flake is to provide a starting point for Laravel projects using Nix flakes.
# ## More info
# - [Laravel framework](https://laravel.com/)
# - [Laravel on the NixOS Wiki](https://wiki.nixos.org/wiki/Laravel)
# - ...
# '';
# };
# };
# }
# // {
# inherit mkSnowBlower;
# };
# });
# }