aboutsummaryrefslogtreecommitdiff
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
parent9105d8ec15ed4782a2ae9e8cb73c5709d2831200 (diff)
downloadnixos-personal-eb389bd5108226bca622a4631374b0ad709286cd.tar.gz
nixos-personal-eb389bd5108226bca622a4631374b0ad709286cd.tar.bz2
nixos-personal-eb389bd5108226bca622a4631374b0ad709286cd.zip
nixos: remove mrpump
-rw-r--r--flake.lock14
-rw-r--r--nixos/configurations.nix1
-rw-r--r--nixos/machine/default.nix1
-rw-r--r--nixos/machine/mrpump.nix121
4 files changed, 7 insertions, 130 deletions
diff --git a/flake.lock b/flake.lock
index 7166e5e..cb9fabd 100644
--- a/flake.lock
+++ b/flake.lock
@@ -268,11 +268,11 @@
]
},
"locked": {
- "lastModified": 1679930252,
- "narHash": "sha256-/ub/3bgXABu/Lh6i3ZyY7+Z5LUy8U+2+rxD/DVhmcoc=",
+ "lastModified": 1680711275,
+ "narHash": "sha256-WSKHOP65VEp9hyB0h4kcNbJT02zaJHc40hIq9l+uG4U=",
"owner": "cynerd",
"repo": "nixturris",
- "rev": "0262fb0603554e0926e0e93a4777d8d925566abe",
+ "rev": "45e61620f26b4d8f293b4e8ec6a29f1bdded2657",
"type": "github"
},
"original": {
@@ -283,11 +283,11 @@
},
"personal-secret": {
"locked": {
- "lastModified": 1678658788,
- "narHash": "sha256-SBy6oqtIzquFted5C1HS4l+tcB8QVnzugRB/0NEz/WA=",
+ "lastModified": 1680945393,
+ "narHash": "sha256-u/NkO1DHKwjdOpSJ24Uv8992ant1dqkBp5Z8DWGQ5L0=",
"ref": "refs/heads/master",
- "rev": "368ce315cabd1c875dc1602ea1c84c0e1deddaf2",
- "revCount": 70,
+ "rev": "efb1de36049900d68c3a232fea7efbc181ad5c81",
+ "revCount": 71,
"type": "git",
"url": "ssh://git@cynerd.cz/nixos-personal-secret"
},
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;
- };
-}