aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-04-08 11:17:10 +0200
committerKarel Kočí <cynerd@email.cz>2023-04-08 11:21:51 +0200
commiteb389bd5108226bca622a4631374b0ad709286cd (patch)
tree0fb2616ce393e9a54d8f17adc3d483b3ba0579ba /nixos
parent9105d8ec15ed4782a2ae9e8cb73c5709d2831200 (diff)
downloadnixos-personal-eb389bd5108226bca622a4631374b0ad709286cd.tar.gz
nixos-personal-eb389bd5108226bca622a4631374b0ad709286cd.tar.bz2
nixos-personal-eb389bd5108226bca622a4631374b0ad709286cd.zip
nixos: remove mrpump
Diffstat (limited to 'nixos')
-rw-r--r--nixos/configurations.nix1
-rw-r--r--nixos/machine/default.nix1
-rw-r--r--nixos/machine/mrpump.nix121
3 files changed, 0 insertions, 123 deletions
diff --git a/nixos/configurations.nix b/nixos/configurations.nix
index 6fb25f3..96c74b9 100644
--- a/nixos/configurations.nix
+++ b/nixos/configurations.nix
@@ -112,7 +112,6 @@ in
// amd64System "ridcully"
// amd64System "susan"
// vpsSystem "lipwig"
- // vpsSystem "mrpump"
// raspi2System "spt-mpd"
// raspi3System "adm-mpd"
// beagleboneSystem "gaspode"
diff --git a/nixos/machine/default.nix b/nixos/machine/default.nix
index 801d0a4..aba8b6e 100644
--- a/nixos/machine/default.nix
+++ b/nixos/machine/default.nix
@@ -7,7 +7,6 @@ self: {
machine-susan = import ./susan.nix;
machine-lipwig = import ./lipwig.nix;
- machine-mrpump = import ./mrpump.nix self;
machine-gaspode = import ./gaspode.nix;
diff --git a/nixos/machine/mrpump.nix b/nixos/machine/mrpump.nix
deleted file mode 100644
index 2d626fb..0000000
--- a/nixos/machine/mrpump.nix
+++ /dev/null
@@ -1,121 +0,0 @@
-self: {
- config,
- lib,
- pkgs,
- ...
-}:
-with builtins;
-with lib; {
- config = let
- localNix = import (self.inputs.nix.outPath + "/docker.nix") {
- inherit pkgs;
- name = "local/nix";
- tag = "latest";
- bundleNixpkgs = false;
- extraPkgs = with pkgs; [cachix];
- nixConf = {
- cores = "0";
- experimental-features = ["nix-command" "flakes"];
- };
- };
- localNixDaemon = pkgs.dockerTools.buildLayeredImage {
- fromImage = localNix;
- name = "local/nix-daemon";
- tag = "latest";
- config = {
- Volumes = {
- "/nix/store" = {};
- "/nix/var/nix/db" = {};
- "/nix/var/nix/daemon-socket" = {};
- };
- };
- maxLayers = 125;
- };
- in {
- # MrPump won't see Errol anyway
- cynerd.hosts.enable = false;
- cynerd.monitoring.enable = false;
-
- # Docker for the gitlab runner
- virtualisation.docker = {
- enable = true;
- autoPrune = {
- enable = true;
- dates = "daily";
- };
- };
- users.users.cynerd.extraGroups = ["docker"];
-
- # Common container for the Gitlab Nix runner
- virtualisation.oci-containers = {
- backend = "docker";
- containers.gitlabnix = {
- imageFile = localNixDaemon;
- image = "local/nix-daemon:latest";
- cmd = ["nix" "daemon"];
- };
- };
-
- # Gitlab runner
- systemd.services.gitlab-runner.serviceConfig = let
- config = (pkgs.formats.toml {}).generate "gitlab-runner.toml" {
- concurrent = 1;
- runners = [
- {
- name = "MrPump Docker";
- url = "https://gitlab.com";
- id = 18138767;
- token = "@TOKEN_DOCKER@";
- executor = "docker";
- docker = {
- image = "alpine";
- };
- }
- {
- name = "MrPump Nix";
- url = "https://gitlab.com";
- id = 18139391;
- token = "@TOKEN_NIX@";
- executor = "docker";
- docker = {
- image = "local/nix:latest";
- allowed_images = ["local/nix:latest"];
- pull_policy = "if-not-present";
- allowed_pull_policies = ["if-not-present"];
- volumes_from = ["gitlabnix:ro"];
- };
- environment = [
- "NIX_REMOTE=daemon"
- "ENV=/etc/profile.d/nix-daemon.sh"
- "BASH_ENV=/etc/profile.d/nix-daemon.sh"
- ];
- # TODO for some reason the /tmp seems to be missing
- # The cp is required to allow modification of nix config for cachix as
- # otherwise it is link to the read only file in the store.
- pre_build_script = ''
- mkdir -p /tmp
- cp --remove-destination \
- $(readlink -f /etc/nix/nix.conf) /etc/nix/nix.conf
- '';
- }
- ];
- };
- configPath = "$HOME/.gitlab-runner/config.toml";
- configureScript = pkgs.writeShellScript "gitlab-runner-configure" ''
- ${pkgs.docker}/bin/docker load < ${localNix}
- mkdir -p $(dirname ${configPath})
- ${pkgs.gawk}/bin/awk '{
- for(varname in ENVIRON)
- gsub("@"varname"@", ENVIRON[varname])
- print
- }' "${config}" > "${configPath}"
- chown -R --reference=$HOME $(dirname ${configPath})
- '';
- in {
- EnvironmentFile = "/run/secrets/gitlab-runner.env";
- ExecStartPre = mkForce "!${configureScript}";
- ExecReload = mkForce "!${configureScript}";
- };
- services.gitlab-runner.enable = true;
- };
-}