-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
66 lines (65 loc) · 2.25 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
mission-control.url = "github:Platonic-Systems/mission-control";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.flake-root.flakeModule
inputs.mission-control.flakeModule
];
perSystem = { pkgs, lib, config, system, ... }: {
mission-control.scripts = {
readme = {
description = "Read the readme.";
exec = "${lib.getExe pkgs.glow} README.md";
};
tests = {
description = "Run the Rodeo tests.";
exec = "mill -w rodeo.test";
};
editor = {
description = "Run a preconfigured VSCode.";
exec = "code .";
};
editor-setup = {
description = "Setup the editor.";
exec = ''
rm -rf .bsp/ .metals/ .bloop/ out/
mill mill.bsp.BSP/install
echo "Done 🎉"
echo "Run the editor for the first time and then open the Command Palette"
echo "with Shift+Cmd+P, then search for «switch build server»; when asked"
echo "select mill-bsp as your build server, don't use the other option!"
echo "You should do this only every time that you execute the editor-setup."
echo "Have fun! 🐴"
'';
};
};
devShells.default =
let unfreepkgs = import nixpkgs {
config = { allowUnfree = true; };
system = system;
};
vscode = unfreepkgs.vscode-with-extensions.override {
vscodeExtensions = with unfreepkgs.vscode-extensions; [
scalameta.metals
arrterian.nix-env-selector
scala-lang.scala
mkhl.direnv
];
};
shell = pkgs.mkShell {
buildInputs = [
pkgs.mill
vscode
];
};
in config.mission-control.installToDevShell shell;
};
};
}