Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88f7da1700 |
Generated
+3
-3
@@ -264,11 +264,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1788187754,
|
||||
"narHash": "sha256-bu1QxmXKmPuvBLN7bHP355OV9Qo13x9WCiRDH62CqRM=",
|
||||
"lastModified": 1792615934,
|
||||
"narHash": "sha256-MlvRfa1O5Cqc2/a+gG+l9TSuowEoCKCmrJ1d9oAVm0I=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5dfba6236110080a54247d6460bc2ff5dda939cc",
|
||||
"rev": "da6dc0e7b26060f2f71ce3ef7088fb56ee44fa36",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
+6
-17
@@ -47,18 +47,12 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
||||
shellHook = ''echo "Available scripts: ${builtins.concatStringsSep " " installed}"'';
|
||||
};
|
||||
|
||||
legacyPackages.scripts = {
|
||||
malobeo-remote-install = pkgs.writeShellScriptBin "malobeo-remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
|
||||
malobeo-boot-unlock = pkgs.writeShellScriptBin "malobeo-boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
|
||||
malobeo-add-host-keys = pkgs.writeShellScriptBin "malobeo-add-host-keys" (builtins.readFile ./scripts/add_new_host_keys.sh);
|
||||
malobeo-run-vm = self.packages.${system}.run-vm;
|
||||
} // (import ./packages/ssh_to_hosts.nix) {
|
||||
malobeo = (import ./machines/hosts.nix {}).malobeo;
|
||||
peers = import ./machines/modules/malobeo/peers.nix;
|
||||
pkgs = pkgs;
|
||||
lib = nixpkgs.lib;
|
||||
};
|
||||
|
||||
legacyPackages = {
|
||||
scripts.remote-install = pkgs.writeShellScriptBin "remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
|
||||
scripts.boot-unlock = pkgs.writeShellScriptBin "boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
|
||||
scripts.add-host-keys = pkgs.writeShellScriptBin "add-host-keys" (builtins.readFile ./scripts/add_new_host_keys.sh);
|
||||
scripts.run-vm = self.packages.${system}.run-vm;
|
||||
};
|
||||
|
||||
vmBuilder = utils.buildVM;
|
||||
|
||||
@@ -81,11 +75,6 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
||||
};
|
||||
|
||||
run-vm = pkgs.writeShellScriptBin "run-vm" (builtins.readFile ./scripts/run-vm.sh);
|
||||
} // (import ./packages/ssh_to_hosts.nix) {
|
||||
malobeo = (import ./machines/hosts.nix {}).malobeo;
|
||||
peers = import ./machines/modules/malobeo/peers.nix;
|
||||
pkgs = pkgs;
|
||||
lib = nixpkgs.lib;
|
||||
};
|
||||
|
||||
apps = {
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{ malobeo, peers, pkgs, lib, ... }:
|
||||
#mapAttrs' (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
|
||||
let
|
||||
get_ip = hostname: malobeo.hosts.${hostname}.network.address;
|
||||
generate_ssh_command = hostname: hostConfig: (
|
||||
if hostConfig.network.local == true then
|
||||
if hostname == "fanny" then
|
||||
"ssh admin@${malobeo.hosts."fanny".network.address}"
|
||||
else
|
||||
"ssh -J admin@${malobeo.hosts."fanny".network.address} admin@${get_ip hostname}"
|
||||
else
|
||||
"offsite"
|
||||
);
|
||||
in
|
||||
(lib.attrsets.mapAttrs' (hostname: hostConfig: lib.nameValuePair
|
||||
("malobeo-ssh-${hostname}")
|
||||
(pkgs.writeShellScriptBin "malobeo-ssh-${hostname}"
|
||||
''
|
||||
#!/bin/sh
|
||||
echo "${hostname} ${generate_ssh_command hostname hostConfig}"
|
||||
'')) malobeo.hosts )
|
||||
#{
|
||||
# test-pkg = pkgs.writeShellScriptBin "run-vm" (builtins.readFile ../scripts/run-vm.sh);
|
||||
#}
|
||||
|
||||
|
||||
# microvm
|
||||
# - local:
|
||||
# - yes: ssh through fanny
|
||||
# - no: if in peers.nix -> ssh through vpn, else not possible
|
||||
# not microvm:
|
||||
# - local:
|
||||
# - yes: ssh through fanny (except for fanny)
|
||||
# - no: not supported
|
||||
|
||||
Reference in New Issue
Block a user