forked from c3d2/nix-config
scrape: migrate from krops to flakes
This commit is contained in:
parent
f29dacb173
commit
4b8353c011
|
@ -40,11 +40,11 @@
|
|||
},
|
||||
"secrets": {
|
||||
"locked": {
|
||||
"lastModified": 1614993322,
|
||||
"narHash": "sha256-JcC7oPS8qCmk+abBGUzNvgV2B9XACcNSjc0pfX0ldoA=",
|
||||
"lastModified": 1614994700,
|
||||
"narHash": "sha256-2QCQB+w1teVZT83kfDifE1uKvFgm1wEL+3OHYG2+gFI=",
|
||||
"ref": "master",
|
||||
"rev": "30c7719adc2615e87e3b38596384ecec24347883",
|
||||
"revCount": 81,
|
||||
"rev": "abe64361305019ae7664d03fc29e1ac9faae2222",
|
||||
"revCount": 83,
|
||||
"type": "git",
|
||||
"url": "ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git"
|
||||
},
|
||||
|
|
13
flake.nix
13
flake.nix
|
@ -67,6 +67,8 @@
|
|||
freifunk-nixos-rebuild = mkDeploy "freifunk" "freifunk.core.zentralwerk.org";
|
||||
|
||||
matemat-nixos-rebuild = mkDeploy "matemat" hostRegistry.hosts.matemat.ip4;
|
||||
|
||||
scrape-nixos-rebuild = mkDeploy "scrape" hostRegistry.hosts.scrape.ip4;
|
||||
});
|
||||
|
||||
nixosConfigurations = let
|
||||
|
@ -147,6 +149,17 @@
|
|||
system = "x86_64-linux";
|
||||
};
|
||||
|
||||
scrape = nixosSystem' {
|
||||
modules = [
|
||||
./lib/lxc-container.nix
|
||||
./hosts/containers/scrape
|
||||
({ ... }: {
|
||||
nixpkgs.overlays = [ secrets.overlays.scrape ];
|
||||
})
|
||||
];
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
nixosModules.c3d2 = import ./lib;
|
||||
|
|
|
@ -81,6 +81,10 @@ rec {
|
|||
ip4 = "172.22.99.133";
|
||||
ip6 = "2a02:8106:208:5201:f82b:1bff:fedc:8572";
|
||||
};
|
||||
scrape = {
|
||||
ip4 = "172.20.73.32";
|
||||
ip6 = "2a02:8106:208:5282:e073:50ff:fef5:eb6e";
|
||||
};
|
||||
};
|
||||
|
||||
hqGlobal = builtins.attrNames hosts;
|
||||
|
|
|
@ -3,25 +3,13 @@
|
|||
let
|
||||
freifunkNodes = {
|
||||
"1139" = "10.200.4.120";
|
||||
"1487" = "10.200.5.213";
|
||||
"1884" = "10.200.7.100";
|
||||
"1891" = "10.200.7.107";
|
||||
"1768" = "10.200.6.239";
|
||||
"1176" = "10.200.7.80";
|
||||
"1099" = "10.200.4.80";
|
||||
"1864" = "10.200.7.80";
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/minimal.nix")
|
||||
../../../lib
|
||||
../../../lib/lxc-container.nix
|
||||
../../../lib/shared.nix
|
||||
];
|
||||
|
||||
c3d2 = {
|
||||
isInHq = false;
|
||||
hq.interface = "eth0";
|
||||
};
|
||||
c3d2.isInHq = false;
|
||||
|
||||
networking.hostName = "scrape";
|
||||
networking.interfaces.eth0.ipv4.addresses = [{
|
||||
|
@ -35,16 +23,15 @@ in {
|
|||
environment.systemPackages = [ pkgs.git ];
|
||||
|
||||
systemd.services = let
|
||||
scrapers = import (builtins.fetchGit {
|
||||
scrapers = import (pkgs.fetchgit {
|
||||
url = "https://gitea.c3d2.de/astro/scrapers.git";
|
||||
rev = "77c864b4d7e1ef4075ed115b036791c75176bef7";
|
||||
sha256 = "1rj4dyn89zqyfaiv2ffi6g4x86l2xfgybyy5hlvxzgcabwaxdjyh";
|
||||
}) { inherit pkgs; };
|
||||
makeService = { script, host, user ? "", password ? "" }: {
|
||||
script =
|
||||
"${scrapers.${script}}/bin/${script} ${host} ${user} ${password}";
|
||||
};
|
||||
xeriLogin = import <secrets/hosts/scrape/xeri.nix>;
|
||||
fhemLogin = import <secrets/hosts/scrape/fhem.nix>;
|
||||
matematLogin = import <secrets/hosts/scrape/matemat.nix>;
|
||||
makeNodeScraper = nodeId: {
|
||||
name = "scrape-node${nodeId}";
|
||||
value = makeService {
|
||||
|
@ -56,7 +43,7 @@ in {
|
|||
scrape-xeri = makeService {
|
||||
script = "xerox";
|
||||
host = "xeri.hq.c3d2.de";
|
||||
inherit (xeriLogin) user password;
|
||||
inherit (pkgs.scrape-xeri-login) user password;
|
||||
};
|
||||
scrape-roxi = makeService {
|
||||
script = "xerox";
|
||||
|
@ -65,12 +52,12 @@ in {
|
|||
scrape-fhem = makeService {
|
||||
script = "fhem";
|
||||
host = "fhem.hq.c3d2.de";
|
||||
inherit (fhemLogin) user password;
|
||||
inherit (pkgs.scrape-fhem-login) user password;
|
||||
};
|
||||
scrape-matemat = makeService {
|
||||
script = "matemat";
|
||||
host = "matemat.hq.c3d2.de";
|
||||
inherit (matematLogin) user password;
|
||||
inherit (pkgs.scrape-matemat-login) user password;
|
||||
};
|
||||
} // builtins.listToAttrs
|
||||
(map makeNodeScraper (builtins.attrNames freifunkNodes));
|
Loading…
Reference in New Issue