-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26e5410
commit 041be46
Showing
11 changed files
with
172 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 @@ | ||
{ inputs, config, ... }: | ||
{ | ||
imports = [ inputs.nix-topology.nixosModules.default ]; | ||
|
||
topology.self = { | ||
name = config.networking.hostName; | ||
}; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
{ inputs, ... }: | ||
let | ||
# we need to remove lilith from the list of nixosConfigurations since | ||
# it does not import nix-topology, as of thus it will throw an error | ||
inherit (inputs.self) nixosConfigurations; | ||
filteredConfigs = builtins.removeAttrs nixosConfigurations [ "lilith" ]; | ||
in | ||
{ | ||
imports = [ inputs.nix-topology.flakeModule ]; | ||
|
||
# nix build .#topology.x86_64-linux.config.output | ||
perSystem.topology = { | ||
nixosConfigurations = filteredConfigs; | ||
modules = [ ./output.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,107 @@ | ||
{ config, ... }: | ||
let | ||
inherit (config.lib.topology) | ||
mkInternet | ||
mkDevice | ||
mkRouter | ||
mkConnection | ||
; | ||
in | ||
{ | ||
nodes = { | ||
internet = mkInternet { | ||
connections = [ | ||
(mkConnection "minerva" "eth0") | ||
(mkConnection "router" "eth0") | ||
]; | ||
}; | ||
|
||
# our router | ||
router = mkRouter "bingus" { | ||
info = "BT Home Hub 5"; | ||
|
||
interfaceGroups = [ | ||
[ "eth0" ] | ||
[ | ||
"eth1" | ||
"eth2" | ||
"eth3" | ||
] | ||
[ "wlan0" ] | ||
]; | ||
|
||
interfaces = { | ||
eth1.network = "LAN"; | ||
wlan0.network = "WLAN"; | ||
}; | ||
|
||
connections = { | ||
eth1 = mkConnection "bongus" "eth0"; | ||
eth2 = mkConnection "amaterasu" "eth0"; | ||
wlan0 = [ | ||
(mkConnection "hydra" "wlan0") | ||
(mkConnection "amaterasu" "wlan0") | ||
(mkConnection "tatsumaki" "wlan0") | ||
]; | ||
}; | ||
}; | ||
|
||
# devices not collected by nix-topology | ||
bongus = mkDevice "bongus" { | ||
info = "Raspberry Pi 4"; | ||
deviceIcon = ./assets/rpi.svg; | ||
interfaces = { | ||
eth0 = { }; | ||
eth1 = { }; | ||
}; | ||
|
||
services.pihole = { | ||
name = "Pi-hole"; | ||
icon = ./assets/pihole.png; | ||
}; | ||
}; | ||
|
||
tatsumaki = mkDevice "tatsumaki" { | ||
info = "A MacBook Air"; | ||
deviceIcon = ./assets/mac.png; | ||
|
||
interfaces.wlan0 = { }; | ||
}; | ||
|
||
# extra settings for devices that are collected by nix-topology | ||
amaterasu = { | ||
hardware.info = "My high-end gaming machine"; | ||
|
||
interfaces = { | ||
eth0 = { }; | ||
wlan0 = { }; | ||
}; | ||
}; | ||
|
||
hydra = { | ||
hardware.info = "A super mid spec laptop"; | ||
interfaces.wlan0 = { }; | ||
}; | ||
|
||
minerva.hardware.info = "A server for some of my infrastructure"; | ||
|
||
valkyrie = { | ||
hardware.info = "WSL2 host, devenv on Windows"; | ||
|
||
guestType = "wsl"; | ||
parent = "amaterasu"; | ||
}; | ||
}; | ||
|
||
networks = { | ||
LAN = { | ||
name = "LAN"; | ||
cidrv4 = "192.68.1.0/24"; | ||
}; | ||
|
||
WLAN = { | ||
name = "WLAN"; | ||
cidrv4 = "192.68.2.0/24"; | ||
}; | ||
}; | ||
} |