mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-25 21:30:52 +01:00
feat: intro vm-simple-network profile
This commit is contained in:
parent
ce1a607c10
commit
b8db804e38
4 changed files with 27 additions and 13 deletions
|
@ -64,8 +64,9 @@ rec {
|
|||
machineF = import (../machines + "/${name}/default.nix");
|
||||
in
|
||||
evalMeta
|
||||
(machineF ((mapAttrs (_: _: null) (builtins.functionArgs machineF)) // { inherit inputs; }))
|
||||
.machine.meta
|
||||
(machineF (
|
||||
(mapAttrs (_: _: null) (builtins.functionArgs machineF)) // { inherit inputs profiles; }
|
||||
)).machine.meta
|
||||
) (final.filterAttrs (_: v: v == "directory") (readDir ../machines)))
|
||||
// mapAttrs (_: evalMeta) non_local_machines;
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
profiles,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
|
@ -10,6 +15,7 @@
|
|||
arch = "x86_64-linux";
|
||||
nixpkgs_version = inputs.nixpkgs;
|
||||
hm_version = inputs.home-manager;
|
||||
profiles = with profiles; [ vm-simple-network ];
|
||||
ips = {
|
||||
public.ipv4 = "82.67.34.230";
|
||||
local.ipv4 = "192.168.0.90";
|
||||
|
@ -27,16 +33,6 @@
|
|||
|
||||
disko = import ./disko.nix;
|
||||
|
||||
systemd.network.enable = true;
|
||||
systemd.network.networks."10-wan" = {
|
||||
matchConfig.Name = "ens18";
|
||||
networkConfig = {
|
||||
DHCP = "ipv4";
|
||||
Address = "2a01:e0a:de4:a0e1:eb2:aaaa::45/128";
|
||||
};
|
||||
linkConfig.RequiredForOnline = "routable";
|
||||
};
|
||||
|
||||
systemd.network.netdevs = {
|
||||
"20-wg0" = {
|
||||
netdevConfig = {
|
||||
|
|
|
@ -44,4 +44,8 @@
|
|||
default = { };
|
||||
};
|
||||
|
||||
config = {
|
||||
machine.meta.profiles = [ profiles.base ];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
13
profiles/vm-simple-network.nix
Normal file
13
profiles/vm-simple-network.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
systemd.network.enable = true;
|
||||
systemd.network.networks."10-wan" = {
|
||||
matchConfig.Name = "ens18";
|
||||
networkConfig = {
|
||||
DHCP = "ipv4";
|
||||
Address = config.machine.meta.ips.public.ipv6;
|
||||
};
|
||||
linkConfig.RequiredForOnline = "routable";
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue