From 8a234dc1edaab7e0fcbc9ec79d41742cc449b9d6 Mon Sep 17 00:00:00 2001 From: Kalle Struik Date: Tue, 4 Feb 2025 05:26:51 +0100 Subject: [PATCH] Set up deployment config for nodes --- flake.nix | 2 +- utils.nix | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 4d44a5a..97392b4 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ { self, nixpkgs, ... }@inputs: let outputs = self.outputs; - utils = import ./utils.nix; + utils = import ./utils.nix { inherit inputs; }; homelabConfig = import ./config.nix; roles = import ./roles { inherit utils; }; diff --git a/utils.nix b/utils.nix index e504dd5..20037c0 100644 --- a/utils.nix +++ b/utils.nix @@ -1,8 +1,16 @@ +{ + inputs, + ... +}: { mkSystem = { hostConfig }: - { inputs, ... }: { + deployment = { + targetHost = hostConfig.ip; + targetUser = "maintenance"; + }; + imports = [ inputs.impermanence.nixosModules.impermanence inputs.sops-nix.nixosModules.sops @@ -18,7 +26,7 @@ networking = { hostName = hostConfig.hostname; - interfaces.ens18.ipv4.addresses = [ + interfaces.eth0.ipv4.addresses = [ { address = hostConfig.ip; prefixLength = 24; @@ -27,7 +35,7 @@ nameservers = [ "192.168.10.1" ]; defaultGateway = { address = "192.168.10.1"; - interface = "ens18"; + interface = "eth0"; }; }; system.stateVersion = hostConfig.stateVersion;