depot/ops/nixos/bvm-nixosmgmt/default.nix

61 lines
1.6 KiB
Nix
Raw Normal View History

2021-03-19 20:28:24 +00:00
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
2021-04-10 22:17:28 +00:00
{ depot, lib, pkgs, ... }:
{
2021-03-19 20:28:24 +00:00
imports = [
../lib/bvm.nix
2021-12-31 07:00:32 +00:00
../lib/nhsenglandtests.nix
2021-04-10 17:20:35 +00:00
../../../nix/pkgs/rundeck-bin/module.nix
2021-03-19 20:28:24 +00:00
];
# Networking!
2021-07-17 08:41:34 +00:00
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
2021-03-19 20:28:24 +00:00
networking = {
hostName = "bvm-nixosmgmt";
2021-03-19 20:28:24 +00:00
hostId = "49b0fbc7";
interfaces.enp1s0 = {
ipv4.addresses = [{ address = "10.100.0.200"; prefixLength = 23; }];
};
2021-05-09 10:26:34 +00:00
interfaces.enp6s0 = {
ipv4.addresses = [{ address = "92.118.28.5"; prefixLength = 24; }];
ipv6.addresses = [{ address = "2a09:a441::5"; prefixLength = 32; }];
};
defaultGateway = { address = "92.118.28.1"; interface = "enp6s0"; };
defaultGateway6 = { address = "2a09:a441::1"; interface = "enp6s0"; };
2021-03-19 20:28:24 +00:00
};
my.ip.tailscale = "100.65.226.19";
2022-09-01 23:22:16 +00:00
my.ip.tailscale6 = "fd7a:115c:a1e0:ab12:4843:cd96:6241:e213";
2021-03-19 20:28:24 +00:00
2021-04-10 22:17:28 +00:00
services.rundeck = {
enable = true;
user = "deployer";
pathPackages = with pkgs; [
depot.nix.pkgs.mercurial
2021-04-10 22:35:53 +00:00
openssh
2021-04-10 23:12:24 +00:00
nix
2021-04-10 22:17:28 +00:00
];
};
2021-04-10 17:20:35 +00:00
environment.etc."rundeck.nodes.yaml" = let
content = builtins.mapAttrs (name: value: {
nodename = name;
2021-04-10 20:15:30 +00:00
hostname = value.config.my.rundeck.hostname;
tags = lib.concatStringsSep "," value.config.my.rundeck.tags;
username = "deployer";
osFamily = "unix";
osName = "Linux";
}) (lib.filterAttrs
(name: value: value.config.my.rundeck.expectedOnline)
depot.ops.nixos.systemConfigs
);
in {
text = builtins.toJSON content;
};
2021-03-19 20:28:24 +00:00
system.stateVersion = "21.05";
}