forked from denisshevchenko/iohk-nixops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.nix
More file actions
20 lines (18 loc) · 690 Bytes
/
Copy pathlib.nix
File metadata and controls
20 lines (18 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
let
lib = (import <nixpkgs> {}).lib;
in lib // {
# Allows to also generate the key compared to upstream genAttrs
genAttrs' = names: fkey: fname:
lib.listToAttrs (map (n: lib.nameValuePair (fkey n) (fname n)) names);
# If we're generating an AMI, don't set nixops deployment attributes
generatingAMI = builtins.getEnv "GENERATING_AMI";
# Function to generate DHT key
genDhtKey = { i
, dhtKeyPrefix ? "MHdrsP-oPf7UWly"
, dhtKeyPostfix ? "7QuXnLK5RD=" }:
let padded =
if i < 10
then "0" + toString i
else toString i
; in dhtKeyPrefix + padded + dhtKeyPostfix;
}