-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
86 lines (77 loc) · 2.36 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
{
description = "aiken-auction";
nixConfig.bash-prompt = "aiken-auction";
nixConfig.bash-prompt-prefix = "[\\033[1;33m";
nixConfig.bash-prompt-suffix = "\\033[0m \\w]$ ";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
};
aiken = {
url = "github:aiken-lang/aiken";
inputs.nixpkgs.follows = "nixpkgs";
};
cardano-node = {
url = "github:IntersectMBO/cardano-node/8.9.2";
};
};
outputs = {
self,
nixpkgs,
nix-vscode-extensions,
aiken,
cardano-node,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
extensions = nix-vscode-extensions.extensions.${system};
vscode = pkgs.vscode-with-extensions.override {
vscode = pkgs.vscodium;
vscodeExtensions = [
extensions.vscode-marketplace.bbenoist.nix
extensions.vscode-marketplace.txpipe.aiken
extensions.vscode-marketplace.denoland.vscode-deno
extensions.vscode-marketplace.laurencebahiirwa.deno-std-lib-snippets
extensions.vscode-marketplace.timonwong.shellcheck
extensions.vscode-marketplace-release.github.copilot
extensions.vscode-marketplace-release.github.copilot-chat
];
};
run-preview-node_sh = pkgs.writeShellScriptBin "run-preview-node.sh" ''
cd "$STATE_NODE_DIR" || exit 1
exec cardano-node-preview
'';
cardano-packages = [
cardano-node.packages."${system}"."preview/node"
cardano-node.packages."${system}".cardano-cli
aiken.packages.${system}.aiken
run-preview-node_sh
];
in {
devShells.${system} = rec {
aiken-auction = with pkgs;
mkShell {
packages = [vscode deno xxd jq shellcheck] ++ cardano-packages;
shellHook = ''
export HOME=$(pwd)
if [ -f ~/.secrets ] ; then
. ~/.secrets
fi
# cardano-cli autocompletion is broken, FIXME
shopt -u progcomp
'';
};
default = aiken-auction;
};
# FIXME:
# apps.${system} = rec {
# cardano-node-preview = {
# type = "app";
# program = "${run-preview-node_sh}/bin/run-preview-node.sh";
# };
# default = cardano-node-preview;
# };
};
}