-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Began provisioning a basic raspberry pi
- Added homelab module, currently set up only with grafana - Adjusted makefile remote to allow remote building - Hosts `authorized_keys` added automatically - Enable fprintd on my laptop
- Loading branch information
1 parent
53fb5e5
commit 650c121
Showing
13 changed files
with
132 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ lib, config, ... }: | ||
let | ||
cfg = config.homelab; | ||
in | ||
{ | ||
imports = [ | ||
./observability | ||
]; | ||
|
||
options.homelab = { | ||
lan-domain = lib.mkOption { | ||
type = lib.types.str; | ||
description = "The base domain of the local network"; | ||
example = "local"; | ||
default = "arpa.nikita.computer"; | ||
}; | ||
domain = lib.mkOption { | ||
type = lib.types.str; | ||
description = "The domain all services will be deployed under"; | ||
default = "${config.networking.hostName}.${cfg.lan-domain}"; | ||
readOnly = true; | ||
}; | ||
}; | ||
|
||
|
||
config = { | ||
networking.firewall.allowedTCPPorts = [ 80 443 ]; | ||
services.nginx.enable = true; | ||
# Helper function to create a subdomain for a service | ||
lib.homelab.mkServiceSubdomain = subdomain: "${subdomain}.${cfg.domain}"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
imports = [ ./grafana.nix ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ lib, config, ... }: | ||
let | ||
cfg = config.homelab.observability.grafana; | ||
in | ||
{ | ||
options.homelab.observability.grafana = { | ||
enable = lib.mkEnableOption "Grafana"; | ||
subdomain = lib.mkOption { | ||
type = lib.types.str; | ||
default = "grafana"; | ||
description = "Grafana's subdomain"; | ||
}; | ||
domain = lib.mkOption { | ||
type = lib.types.str; | ||
default = config.lib.homelab.mkServiceSubdomain cfg.subdomain; | ||
description = "Grafana's domain"; | ||
readOnly = true; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
services.grafana = { | ||
enable = true; | ||
settings.server.domain = lib.mkForce cfg.domain; | ||
}; | ||
|
||
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = { | ||
locations."/" = { | ||
proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}"; | ||
proxyWebsockets = true; | ||
recommendedProxySettings = true; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ self, lib, ... }: | ||
{ | ||
imports = [ | ||
self.nixosModules.raspi4sd | ||
self.nixosModules.personal | ||
self.nixosModules.homelab | ||
]; | ||
|
||
sdImage.compressImage = lib.mkForce true; | ||
|
||
homelab.observability.grafana.enable = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters