Skip to content
Snippets Groups Projects
Commit 62835d00 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Refactor to improve reusability

parent a474ffb9
No related branches found
No related tags found
1 merge request!15Deploy v1 production grid
......@@ -19,6 +19,9 @@ import ./make-grid.nix {
# Pass the whole grid configuration to the module and let it take what it
# wants.
"storage000" = import ./storage000.nix cfg;
"storage000" = import ./make-storage.nix ({
cfg = import ./storage000-config.nix;
hardware = ./storage000-hardware.nix;
} // cfg);
};
}
let
# Get the configuration that's specific to this node.
cfg = import ./storage000-config.nix;
in
# Define the function that defines the node. Accept the public storage server
# port argument so we can configure Tahoe-LAFS with it. Accept but ignore any
# other arguments.
{ publicStoragePort, ristrettoSigningKeyPath, ... }: rec {
# Define the function that defines the node.
{ cfg # Get the configuration that's specific to this node.
, hardware # The path to the hardware configuration for this node.
, publicStoragePort # The storage port number on which to accept connections.
, ristrettoSigningKeyPath # The *local* path to the Ristretto signing key file.
}: rec {
deployment = {
secrets = {
"ristretto-signing-key" = {
......@@ -26,7 +23,7 @@ in
# Any extra NixOS modules to load on this server.
imports = [
# Include the results of the hardware scan.
./storage000-hardware.nix
hardware
# Configure it as a system operated by 100TB.
../nixos/modules/100tb.nix
# Bring in our module for configuring the Tahoe-LAFS service and other
......@@ -58,5 +55,5 @@ in
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.03"; # Did you read the comment?
system.stateVersion = "19.09"; # Did you read the comment?
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment