-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathshell.nix
More file actions
50 lines (50 loc) · 1.22 KB
/
shell.nix
File metadata and controls
50 lines (50 loc) · 1.22 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
let
flakeLock = builtins.fromJSON (builtins.readFile ./flake.lock);
nixpkgsLock = flakeLock.nodes.nixpkgs.locked;
xpgLock = flakeLock.nodes.xpg.locked;
in
{ pkgs ?
import (builtins.fetchTarball {
name = nixpkgsLock.rev;
url = "https://github.com/${nixpkgsLock.owner}/${nixpkgsLock.repo}/archive/${nixpkgsLock.rev}.tar.gz";
sha256 = nixpkgsLock.narHash;
}) { }
, xpgPkgs ?
import (pkgs.fetchFromGitHub {
inherit (xpgLock) owner repo rev;
sha256 = xpgLock.narHash;
})
}:
let
nginxCustom = pkgs.callPackage ./nix/nginxCustom.nix {};
loadtest = pkgs.callPackage ./nix/loadtest.nix {};
pythonDeps = with pkgs.python3Packages; [
pytest
psycopg2
sqlalchemy
];
style =
pkgs.writeShellScriptBin "net-style" ''
${pkgs.clang-tools}/bin/clang-format -i src/*
'';
styleCheck =
pkgs.writeShellScriptBin "net-style-check" ''
${pkgs.clang-tools}/bin/clang-format -i src/*
${pkgs.git}/bin/git diff-index --exit-code HEAD -- '*.c'
'';
in
pkgs.mkShell {
buildInputs =
[
xpgPkgs.xpg
pythonDeps
nginxCustom.nginxScript
pkgs.curlWithGnuTls
loadtest
style
styleCheck
];
shellHook = ''
export HISTFILE=.history
'';
}