From 8ac07ae9853fd2102578862f13f360baeb387901 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 10 Sep 2021 00:21:38 +0200 Subject: [PATCH] spaceapi: flakify --- flake.lock | 17 +++++++++++++++++ flake.nix | 13 ++++++++++++- .../spaceapi/{configuration.nix => default.nix} | 12 +----------- 3 files changed, 30 insertions(+), 12 deletions(-) rename hosts/containers/spaceapi/{configuration.nix => default.nix} (68%) diff --git a/flake.lock b/flake.lock index a8db035c..72960608 100644 --- a/flake.lock +++ b/flake.lock @@ -67,6 +67,7 @@ "nixpkgs": "nixpkgs", "scrapers": "scrapers", "secrets": "secrets", + "spacemsg": "spacemsg", "ticker": "ticker", "tigger": "tigger", "yammat": "yammat", @@ -104,6 +105,22 @@ "url": "ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git" } }, + "spacemsg": { + "flake": false, + "locked": { + "lastModified": 1603817965, + "narHash": "sha256-CxtSUiTK5VdklEYFlPadx16R7OTQaVEIEX5EqnCH6N8=", + "owner": "astro", + "repo": "spacemsg", + "rev": "682679f93b2491401c6d592292a043b04ac98fc5", + "type": "github" + }, + "original": { + "owner": "astro", + "repo": "spacemsg", + "type": "github" + } + }, "ticker": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index f1516dce..8990f1c0 100644 --- a/flake.nix +++ b/flake.nix @@ -9,13 +9,15 @@ yammat.inputs.nixpkgs.follows = "nixpkgs"; scrapers.url = "git+https://gitea.c3d2.de/astro/scrapers.git"; scrapers.flake = false; + spacemsg.url = "github:astro/spacemsg"; + spacemsg.flake = false; tigger.url = "github:astro/tigger"; tigger.flake = false; ticker.url = "git+https://gitea.c3d2.de/astro/ticker.git"; ticker.flake = false; }; - outputs = { self, nixpkgs, secrets, nixos-hardware, zentralwerk, yammat, scrapers, tigger, ticker }: + outputs = { self, nixpkgs, secrets, nixos-hardware, zentralwerk, yammat, scrapers, spacemsg, tigger, ticker }: let forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ]; @@ -308,6 +310,15 @@ system = "x86_64-linux"; }; + spaceapi = nixosSystem' { + modules = [ + ./lib/lxc-container.nix + "${spacemsg}/spaceapi/module.nix" + ./hosts/containers/spaceapi + ]; + system = "x86_64-linux"; + }; + }; nixosModules.c3d2 = import ./lib; diff --git a/hosts/containers/spaceapi/configuration.nix b/hosts/containers/spaceapi/default.nix similarity index 68% rename from hosts/containers/spaceapi/configuration.nix rename to hosts/containers/spaceapi/default.nix index 053f6e65..ebad63f4 100644 --- a/hosts/containers/spaceapi/configuration.nix +++ b/hosts/containers/spaceapi/default.nix @@ -1,14 +1,4 @@ -{ config, pkgs, lib, ... }: - -let spacemsgGit = builtins.fetchGit "https://github.com/astro/spacemsg.git"; -in { - imports = [ - ../../../lib/lxc-container.nix - ../../../lib/shared.nix - ../../../lib/admins.nix - "${spacemsgGit}/spaceapi/module.nix" - ]; - +{ networking.hostName = "spaceapi"; networking.interfaces.eth0.ipv4.addresses = [{ address = "172.20.73.25";