Set up deployment config for nodes

main
kalle 2025-02-04 05:26:51 +01:00
parent 5ebaff36c4
commit 8a234dc1ed
2 changed files with 12 additions and 4 deletions

View File

@ -14,7 +14,7 @@
{ self, nixpkgs, ... }@inputs: { self, nixpkgs, ... }@inputs:
let let
outputs = self.outputs; outputs = self.outputs;
utils = import ./utils.nix; utils = import ./utils.nix { inherit inputs; };
homelabConfig = import ./config.nix; homelabConfig = import ./config.nix;
roles = import ./roles { inherit utils; }; roles = import ./roles { inherit utils; };

View File

@ -1,8 +1,16 @@
{
inputs,
...
}:
{ {
mkSystem = mkSystem =
{ hostConfig }: { hostConfig }:
{ inputs, ... }:
{ {
deployment = {
targetHost = hostConfig.ip;
targetUser = "maintenance";
};
imports = [ imports = [
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
@ -18,7 +26,7 @@
networking = { networking = {
hostName = hostConfig.hostname; hostName = hostConfig.hostname;
interfaces.ens18.ipv4.addresses = [ interfaces.eth0.ipv4.addresses = [
{ {
address = hostConfig.ip; address = hostConfig.ip;
prefixLength = 24; prefixLength = 24;
@ -27,7 +35,7 @@
nameservers = [ "192.168.10.1" ]; nameservers = [ "192.168.10.1" ];
defaultGateway = { defaultGateway = {
address = "192.168.10.1"; address = "192.168.10.1";
interface = "ens18"; interface = "eth0";
}; };
}; };
system.stateVersion = hostConfig.stateVersion; system.stateVersion = hostConfig.stateVersion;