mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
systems -> machines
This commit is contained in:
@@ -123,7 +123,7 @@ in
|
|||||||
zoom-us # video conferencing
|
zoom-us # video conferencing
|
||||||
(pkgs.writers.writeDashBin "im" ''
|
(pkgs.writers.writeDashBin "im" ''
|
||||||
weechat_password=$(${pkgs.pass}/bin/pass weechat)
|
weechat_password=$(${pkgs.pass}/bin/pass weechat)
|
||||||
exec ${weechat}/bin/weechat -t -r '/mouse enable; /remote add makanek http://${pkgs.lib.niveum.systems.makanek.externalIp}:8002 -password='"$weechat_password"'; /remote connect makanek'
|
exec ${weechat}/bin/weechat -t -r '/mouse enable; /remote add makanek http://${pkgs.lib.niveum.machines.makanek.externalIp}:8002 -password='"$weechat_password"'; /remote connect makanek'
|
||||||
'')
|
'')
|
||||||
alejandra # nix formatter
|
alejandra # nix formatter
|
||||||
pdfgrep # search in pdf
|
pdfgrep # search in pdf
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ports = [ pkgs.lib.niveum.systems.${config.networking.hostName}.sshPort ];
|
ports = [ pkgs.lib.niveum.machines.${config.networking.hostName}.sshPort ];
|
||||||
settings = {
|
settings = {
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
X11Forwarding = true;
|
X11Forwarding = true;
|
||||||
|
|||||||
10
flake.nix
10
flake.nix
@@ -92,7 +92,7 @@
|
|||||||
map (
|
map (
|
||||||
hostname:
|
hostname:
|
||||||
let
|
let
|
||||||
niveumSystems = import lib/systems.nix;
|
machines = import lib/machines.nix;
|
||||||
systemAddresses =
|
systemAddresses =
|
||||||
system:
|
system:
|
||||||
lib.optionals (system ? "internalIp") [ system.internalIp ]
|
lib.optionals (system ? "internalIp") [ system.internalIp ]
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
addresses = lib.listToAttrs (
|
addresses = lib.listToAttrs (
|
||||||
map (name: {
|
map (name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
value = systemAddresses (niveumSystems.${hostname});
|
value = systemAddresses (machines.${hostname});
|
||||||
}) (builtins.attrNames self.nixosConfigurations)
|
}) (builtins.attrNames self.nixosConfigurations)
|
||||||
);
|
);
|
||||||
deployScript = pkgs.writers.writeBash "deploy-${hostname}" ''
|
deployScript = pkgs.writers.writeBash "deploy-${hostname}" ''
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
)
|
)
|
||||||
for target in "''${targets[@]}"; do
|
for target in "''${targets[@]}"; do
|
||||||
nc -z -w 2 "$(echo $target | cut -d'@' -f2)" ${
|
nc -z -w 2 "$(echo $target | cut -d'@' -f2)" ${
|
||||||
toString niveumSystems.${hostname}.sshPort
|
toString machines.${hostname}.sshPort
|
||||||
} && reachable_target=$target && break
|
} && reachable_target=$target && break
|
||||||
done
|
done
|
||||||
if [ -z "$reachable_target" ]; then
|
if [ -z "$reachable_target" ]; then
|
||||||
@@ -123,13 +123,13 @@
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Deploying to ${hostname} via $reachable_target"
|
echo "Deploying to ${hostname} via $reachable_target"
|
||||||
export NIX_SSHOPTS='-p ${toString niveumSystems.${hostname}.sshPort}'
|
export NIX_SSHOPTS='-p ${toString machines.${hostname}.sshPort}'
|
||||||
${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
|
${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
|
||||||
--max-jobs 2 \
|
--max-jobs 2 \
|
||||||
--log-format internal-json \
|
--log-format internal-json \
|
||||||
--flake .#${hostname} \
|
--flake .#${hostname} \
|
||||||
--target-host "$reachable_target" \
|
--target-host "$reachable_target" \
|
||||||
${lib.optionalString (localSystem != niveumSystems.${hostname}.system) "--build-host $reachable_target"} \
|
${lib.optionalString (localSystem != machines.${hostname}.system) "--build-host $reachable_target"} \
|
||||||
|& ${pkgs.nix-output-monitor}/bin/nom --json
|
|& ${pkgs.nix-output-monitor}/bin/nom --json
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ lib, pkgs }:
|
{ lib, pkgs }:
|
||||||
let
|
let
|
||||||
systems = import ./systems.nix;
|
machines = import ./machines.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
tmpfilesConfig =
|
tmpfilesConfig =
|
||||||
@@ -70,19 +70,19 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
retiolumAddresses = lib.mapAttrs (_: v: { inherit (v.retiolum) ipv4 ipv6; }) (
|
retiolumAddresses = lib.mapAttrs (_: v: { inherit (v.retiolum) ipv4 ipv6; }) (
|
||||||
lib.filterAttrs (_: v: v ? "retiolum") systems
|
lib.filterAttrs (_: v: v ? "retiolum") machines
|
||||||
);
|
);
|
||||||
externalNetwork = lib.mapAttrs (_: v: v.externalIp) (
|
externalNetwork = lib.mapAttrs (_: v: v.externalIp) (
|
||||||
lib.filterAttrs (_: v: v ? "externalIp") systems
|
lib.filterAttrs (_: v: v ? "externalIp") machines
|
||||||
);
|
);
|
||||||
localAddresses = lib.mapAttrs (_: v: v.internalIp) (
|
localAddresses = lib.mapAttrs (_: v: v.internalIp) (
|
||||||
lib.filterAttrs (_: v: v ? "internalIp") systems
|
lib.filterAttrs (_: v: v ? "internalIp") machines
|
||||||
);
|
);
|
||||||
myceliumAddresses = lib.mapAttrs (_: v: v.mycelium.ipv6) (
|
myceliumAddresses = lib.mapAttrs (_: v: v.mycelium.ipv6) (
|
||||||
lib.filterAttrs (_: v: v ? "mycelium") systems
|
lib.filterAttrs (_: v: v ? "mycelium") machines
|
||||||
);
|
);
|
||||||
syncthingIds = lib.mapAttrs (_: v: { id = v.syncthingId; }) (
|
syncthingIds = lib.mapAttrs (_: v: { id = v.syncthingId; }) (
|
||||||
lib.filterAttrs (_: v: v ? "syncthingId") systems
|
lib.filterAttrs (_: v: v ? "syncthingId") machines
|
||||||
);
|
);
|
||||||
|
|
||||||
email =
|
email =
|
||||||
@@ -102,7 +102,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systems = systems;
|
machines = machines;
|
||||||
|
|
||||||
kieran = {
|
kieran = {
|
||||||
github = "kmein";
|
github = "kmein";
|
||||||
@@ -120,9 +120,9 @@ in
|
|||||||
"सः"
|
"सः"
|
||||||
];
|
];
|
||||||
sshKeys = [
|
sshKeys = [
|
||||||
systems.fatteh.sshKey
|
machines.fatteh.sshKey
|
||||||
systems.manakish.sshKey
|
machines.manakish.sshKey
|
||||||
systems.kabsa.sshKey
|
machines.kabsa.sshKey
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user