-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
85 lines (80 loc) · 2.31 KB
/
Copy pathflake.nix
File metadata and controls
85 lines (80 loc) · 2.31 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
{
inputs = {
nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
};
outputs =
inputs@{
self,
nixpkgs,
pre-commit-hooks,
}:
let
lib = nixpkgs.lib;
forSystem =
f: system:
f {
inherit system;
pkgs = import nixpkgs { inherit system; };
};
supportedSystems = lib.platforms.unix;
forAllSystems = f: lib.genAttrs supportedSystems (forSystem f);
forLinuxSystems = f: lib.genAttrs lib.platforms.linux (forSystem f);
in
{
checks = forAllSystems (
{ system, pkgs }:
{
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
check-case-conflicts.enable = true;
nixfmt-rfc-style.enable = true;
check-added-large-files.enable = true;
check-executables-have-shebangs.enable = true;
check-merge-conflicts.enable = true;
check-symlinks.enable = true;
check-toml.enable = true;
detect-private-keys.enable = true;
trim-trailing-whitespace.enable = true;
end-of-file-fixer.enable = true;
shellcheck.enable = true;
golines.enable = true;
};
};
}
);
packages =
lib.recursiveUpdate
(forAllSystems (
{ system, pkgs }:
{
namescale = pkgs.callPackage ./nix/package.nix { };
default = self.packages.${system}.namescale;
}
))
(
forLinuxSystems (
{ system, pkgs }:
{
container = pkgs.callPackage ./nix/container.nix {
namescale = self.packages.${system}.namescale;
};
}
)
);
nixosModules = {
namescale = import ./nix/module.nix inputs;
default = self.nixosModules.namescale;
};
devShells = forAllSystems (
{ system, pkgs }:
{
namescale = pkgs.callPackage ./nix/shell.nix {
namescale = self.packages.${system}.namescale;
};
default = self.devShells.${system}.namescale;
}
);
};
}