-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (53 loc) · 1.65 KB
/
flake.nix
File metadata and controls
62 lines (53 loc) · 1.65 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
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.systems.url = "github:nix-systems/default";
inputs.parts.url = "github:hercules-ci/flake-parts";
inputs.parts.inputs.nixpkgs-lib.follows = "nixpkgs";
outputs = inputs: inputs.parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
flake.overlays.default = pkgs: _: {
osync = pkgs.callPackage ./default.nix { };
};
perSystem = { lib, pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
};
devShells.default = pkgs.mkShell {
inputsFrom = with pkgs; [ osync ];
packages = with pkgs; [
fantomas
fsautocomplete
nixpkgs-fmt
openssh
];
shellHook = ''
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
export NUGET_PACKAGES=$PWD/.nuget/packages
mkdir -p "$NUGET_PACKAGES"
'';
};
packages = {
inherit (pkgs) osync;
default = pkgs.osync;
};
formatter = pkgs.writeShellScriptBin "formatter" ''
set -eoux pipefail
shopt -s globstar
root="$PWD"
while [[ ! -f "$root/.git/index" ]]; do
if [[ "$root" == "/" ]]; then
exit 1
fi
root="$(dirname "$root")"
done
pushd "$root" > /dev/null
${lib.getExe pkgs.deno} fmt .
${lib.getExe pkgs.fantomas} --verbosity detailed src/
${lib.getExe pkgs.gitleaks} git --pre-commit --staged --verbose
${lib.getExe pkgs.nixpkgs-fmt} .
popd
'';
};
};
}