-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
104 lines (93 loc) · 2.33 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
rec {
nixConfig = {
extra-substituters = ["https://pcsd.cachix.org"];
extra-trusted-public-keys = [
"pcsd.cachix.org-1:PS4IaaAiEdfaffVlQf/veW+H5T1RAncqNhxJzW9v9Lc="
];
};
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
systems = {
type = "github";
owner = "nix-systems";
repo = "default-linux";
};
};
outputs = {
self,
systems,
nixpkgs,
...
} @ inputs: let
perSystem = attrs:
nixpkgs.lib.genAttrs (import systems) (system:
attrs (import nixpkgs {inherit system;}));
in {
packages =
perSystem (pkgs:
import ./pkgs ({inherit self pkgs;} // inputs));
nixosModules = {
pacemaker = import ./modules/pacemaker.nix self;
pcsd = import ./modules self nixConfig;
default = self.nixosModules.pcsd;
};
formatter = perSystem (pkgs: pkgs.alejandra);
devShells = perSystem (pkgs: {
update = pkgs.mkShell {
packages = with pkgs; [
alejandra
git
bundler
bundix
(writeShellApplication {
name = "updateGems";
runtimeInputs = [bundler bundix];
text = ''
cd ./pkgs/pcs || exit
rm Gemfile.lock gemset.nix
bundler
bundix
'';
})
common-updater-scripts
jq
nix-prefetch-git
nix-prefetch-github
nix-prefetch-scripts
nix-update
];
};
docs = let
inputs = with pkgs; [
git
nix
mkdocs
ghp-import
python3Packages.mkdocs-material
python3Packages.pygments
];
in
pkgs.mkShell {
packages =
[
(pkgs.writeShellApplication {
name = "localDeploy";
runtimeInputs = inputs;
text = "(nix build --option binary-caches \"https://cache.nixos.org\" .#docs && cd result && mkdocs serve)";
})
(pkgs.writeShellApplication {
name = "ghDeploy";
runtimeInputs = inputs;
text = builtins.readFile ./docs/deploy.sh;
})
]
++ inputs;
};
});
};
}