Compare commits
No commits in common. "b9f35afd8bd6ca7792cd7c705ee2982d7599eecb" and "bb141b7a715e94d263a5da719c7bd8f4b1ce2917" have entirely different histories.
b9f35afd8b
...
bb141b7a71
7 changed files with 24 additions and 82 deletions
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
flake,
|
|
||||||
modulesPath,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (flake) inputs;
|
|
||||||
inherit (inputs) self;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
self.nixosModules.default
|
|
||||||
"${modulesPath}/virtualisation/lxc-container.nix"
|
|
||||||
];
|
|
||||||
deploy = {
|
|
||||||
enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
tty-ips.enable = true;
|
|
||||||
};
|
|
||||||
networking = {
|
|
||||||
yggdrasil = {
|
|
||||||
enable = true;
|
|
||||||
AllowedPublicKeys = [
|
|
||||||
"d0e265fcf663451ae9bc048dc1297749819ce9d48042a986f2866c15a779a074"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
hostName = "tofu";
|
|
||||||
};
|
|
||||||
environment.systemPackages = [
|
|
||||||
];
|
|
||||||
system.stateVersion = "25.05";
|
|
||||||
}
|
|
||||||
|
|
@ -14,9 +14,7 @@ in
|
||||||
self.nixosModules.default
|
self.nixosModules.default
|
||||||
"${modulesPath}/virtualisation/lxc-container.nix"
|
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||||
];
|
];
|
||||||
deploy = {
|
deploy.address = "200:b938:d405:92df:a6e:1ffd:5213:26b";
|
||||||
address = "200:b938:d405:92df:a6e:1ffd:5213:26b";
|
|
||||||
};
|
|
||||||
services = {
|
services = {
|
||||||
tty-ips.enable = true;
|
tty-ips.enable = true;
|
||||||
uptime-kuma = {
|
uptime-kuma = {
|
||||||
|
|
@ -29,6 +27,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
|
firewall.enable = false;
|
||||||
yggdrasil = {
|
yggdrasil = {
|
||||||
enable = true;
|
enable = true;
|
||||||
AllowedPublicKeys = [
|
AllowedPublicKeys = [
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# See /modules/nixos/* for actual settings
|
||||||
|
# This file is just *top-level* configuration.
|
||||||
{
|
{
|
||||||
flake,
|
flake,
|
||||||
modulesPath,
|
modulesPath,
|
||||||
|
|
@ -39,6 +41,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
|
firewall.enable = false;
|
||||||
yggdrasil = {
|
yggdrasil = {
|
||||||
enable = true;
|
enable = true;
|
||||||
AllowedPublicKeys = [
|
AllowedPublicKeys = [
|
||||||
|
|
|
||||||
|
|
@ -6,25 +6,21 @@ let
|
||||||
nixpkgs
|
nixpkgs
|
||||||
nixos-anywhere
|
nixos-anywhere
|
||||||
;
|
;
|
||||||
|
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
genNode =
|
genNode =
|
||||||
hostName: nixosCfg:
|
hostName: nixosCfg:
|
||||||
let
|
let
|
||||||
deploy = nixosCfg.config.deploy;
|
# inherit (self.hosts.${hostName}) address hostPlatform remoteBuild;
|
||||||
system = nixosCfg.pkgs.system;
|
# inherit (deploy-rs.lib.${hostPlatform}) activate;
|
||||||
|
system = self.nixosConfigurations."${hostName}".pkgs.system;
|
||||||
|
address = self.nixosConfigurations."${hostName}".config.deploy.address;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
hostname = deploy.address;
|
# inherit address;
|
||||||
profiles.system.path = deploy-rs.lib.${system}.activate.nixos nixosCfg;
|
hostname = address;
|
||||||
|
profiles.system.path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Filter out nodes where deploy.enable != true
|
|
||||||
deployableNodes = lib.filterAttrs (hostName: nixosCfg: nixosCfg.config.deploy.enable or false) (
|
|
||||||
self.nixosConfigurations or { }
|
|
||||||
);
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
perSystem =
|
perSystem =
|
||||||
|
|
@ -48,12 +44,13 @@ in
|
||||||
deploy = deploy-rs.apps.${system}.deploy-rs;
|
deploy = deploy-rs.apps.${system}.deploy-rs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
flake = {
|
||||||
flake.deploy = {
|
deploy = {
|
||||||
autoRollback = false;
|
autoRollback = false;
|
||||||
magicRollback = true;
|
magicRollback = true;
|
||||||
user = "root";
|
user = "root";
|
||||||
remoteBuild = true;
|
remoteBuild = true;
|
||||||
nodes = lib.mapAttrs genNode deployableNodes;
|
nodes = lib.mapAttrs genNode (self.nixosConfigurations or { });
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{ lib, config, ... }:
|
|
||||||
{
|
|
||||||
options.deploy = {
|
|
||||||
enable = (lib.mkEnableOption // { default = true; }) "enable deployrs module";
|
|
||||||
address = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = config.networking.hostName;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -14,20 +14,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
|
||||||
enable = true;
|
|
||||||
interfaces = {
|
|
||||||
ygg0 = {
|
|
||||||
allowedTCPPorts = [ 22 ];
|
|
||||||
allowedUDPPorts = [ ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Default deny policy for all interfaces (including ygg0)
|
|
||||||
allowPing = false;
|
|
||||||
allowedTCPPorts = [ ];
|
|
||||||
allowedUDPPorts = [ ];
|
|
||||||
};
|
|
||||||
dhcpcd.enable = false;
|
dhcpcd.enable = false;
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
useHostResolvConf = false;
|
useHostResolvConf = false;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
{
|
{
|
||||||
|
options.deploy.address = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = config.networking.hostName;
|
||||||
|
};
|
||||||
config = {
|
config = {
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
security = {
|
security = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue