Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 1.37 KB

README.md

File metadata and controls

63 lines (47 loc) · 1.37 KB

Configuration for our Raspberry PI server

Deployment

See DEPLOYMENT for instructions on how apply this config to a new system.

Adding new modules

Example service

To add a new service, create a file in the modules directory, for example:

# file: modules/example.nix
{ pkgs, ... }:

{
  services.example = {
    enable = true;
    package = pkgs.example;
  };
}

Note

Until NixOS/nix#7107 is fixed, don't forget to stage new files with git!

The module will be automatically enabled. If you want to disable it, you can exclude it when importing all the modules:

# file: hosts/raspi-doboz/configuration.nix
imports =
 [ ./hardware-configuration.nix ]
 ++ modules.allModulesExcept [
   "example"
 ];

Service with nginx, borgmatic, or other config

If a new service also needs to create an nginx virtual host, backup some data using borgmatic, set up temporary files, open ports, use an agenix secret, etc., then prefer putting those configs in the new module rather than the nginx, borgmatic modules.

# file: modules/example.nix
{ pkgs, ... }:

{
  services.example = {
    enable = true;
    package = pkgs.example;
  };

  services.nginx.virtualHosts."example.ymstnt.com".locations = {
    # ...
  };

  services.borgmatic.configurations.raspi = {
    sqlite_databases = [
      # ...
    ];
  };
}