From f94103e8562d590356bb172ae8cebf077dab8e7a Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 20 Jun 2024 22:12:38 -0500 Subject: [PATCH 1/7] Add locally hosted S3 cache --- secrets/gitlab/myself-qemu-runner-reg.age | Bin 1954 -> 1950 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/gitlab/myself-qemu-runner-reg.age b/secrets/gitlab/myself-qemu-runner-reg.age index 463a49f264252b92f99dfd9df206ba219841039a..b5813264d8f0614c01c363eac284104c0cc8dc4d 100644 GIT binary patch literal 1950 zcmZA1Z_wKW9S3kxwrM$#ak|4}jygE+k@%1%P11%9Bx%z&O`D``+9m-#(=rIoiE^MG?AWtA#+c$b*og{w;yF3p4v`yEd|vnM@6G4F zci-<%F|O8v;o*7!L1_@0$WL}Hesp~CkQM*yIb3lbGqvH;#AxYS7a)!W0 zo+l5KDJhMcYR4&YMJW~PZYQqfRbB0IRH3iryL6FN^hiu<$q*XZekbTdI8Ka7dtM_N z106EbiP&)`I6L+fcx==rY89Z{By2Y$z1yi5D*-i}&fGGUOcFaKGGGz&8jj(IL@^57x%|fXRzYPLZmVfuS7{NeVJZ83ftGaylWHKx1Aj_iIL> zkw&^2qpT!-2A&;`By<=L){3V%1?-6B(gA z&5BSvM%`d4SS7PAb^|E}Ad8sSrd$QAG}4+0xDbWpz1hesCSIXo$I`GwsPZ)GWSNrh zOBh+B@m#m;r7|2(4QbG9idaq+y`a;9NdrsTY*LYyudqBp8aa&*g`PLBl}58rZ=^+( z5O}FA_oE;-P!uk30^LMii*|TC=uvQ45L~Qd;WC^_IY@@_V8D?TdK3>8SsizCS)uHe z;g-$e=!~YcJj%IaQZSL(l4=+DfMZ-QYwWOG0Ig8IXe=2Ift80 zmp3FP2nBE&OPTrX7m29KBC{c@!x3bFn<8d)1NtTtD1#WZ5lyKhC)C?WWD~?}6XEba>tEhd$i#m*;kHe>)AG zIPssm+xy;GfBUWrz->pW_op5>`_i|c56@iaeh$3)r&nB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EwDK14y1-OE)x07$SAl((Sm)^r~%WS z+nSbAjS;K_In}o<0QY3L3WJ`?oBCjedv#5gQ5fc|x{;M#3Qx_=&7}uJ6G!vmiGw$+OYUz#h2W~>%#P|N_?Sl{R`C$3QbKg20NcSFo z>5hk9`rYwgTwH(k;Ddj@`CUEP z4oB6;kY`^#k$>)xMho*lZvX2Da%n?-ZS>v8&HLpoli!oG#goz*=2d9>WJ#XfjBfqq zt?#vueS3a$>e3bA$`9`N%&xV~b?+Qo_}SkVNApYHys#d-_VWF^7I!MAF5;}j{`|n} z`!;_3{q4?`pWJ!R}$uCK1~jvZM1-o5@aTbPd*&MmKbROueNCCeO|jnZ#DJba;bYIv5svi98k4}pKI z{CmyU*SfbI-+b!)E1S|!e?@<8|A#L;_R*Q;USI;c*FG_Fk-ul!v_o?^) za(e5g(ofNUe);`t7w@V(zULe41N?7pUpT$6uX6P8Koc&Um#%&FmUHCOugyPl{r}@= B!3zKY From cc42575bc2ccaa0f667f32f5d10824976fbffbd9 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 20 Jun 2024 23:27:00 -0500 Subject: [PATCH 2/7] Add gitlab restart alias --- home/xonsh_footer.xsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/xonsh_footer.xsh b/home/xonsh_footer.xsh index 019831e..26baea5 100644 --- a/home/xonsh_footer.xsh +++ b/home/xonsh_footer.xsh @@ -15,6 +15,10 @@ def bw_unlock(): $BW_SESSION = token return token +def _glrestart(args): + sudo nixos-container run gitlab -- systemctl restart gitlab + sudo nixos-container run gitlab -- systemctl restart nginx + def _cfetch(args): bw_unlock() $CIRCLECI_CLI_TOKEN=$(bw get password CircleCI) @@ -68,6 +72,7 @@ def _bake(args): git clone src:greg/copier-templates.git ~/.copier-templates copier copy @(str(templates / args[0])) . +aliases['glrestart'] = _glrestart aliases['cfetch'] = _cfetch aliases['bake'] = _bake aliases['rebuild'] = _rebuild From d9af805f607ffdfe442f6074578e1c0abc9d91a4 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 21 Jun 2024 01:27:03 -0500 Subject: [PATCH 3/7] Aim to new minio cluster --- hosts/myself/container-git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/myself/container-git.nix b/hosts/myself/container-git.nix index a704b51..2b57a0d 100644 --- a/hosts/myself/container-git.nix +++ b/hosts/myself/container-git.nix @@ -106,7 +106,7 @@ in { proxy_download = false; # Tell them to reach out to object storage themselves! connection = { provider = "AWS"; - endpoint = "http://s3.thehellings.lan:9000"; + endpoint = "http://minio-01.thehellings.lan:9000"; region = "us-east-1"; aws_access_key_id = { _secret = config.age.secrets.minio_access_key_id.path; }; aws_secret_access_key = { _secret = config.age.secrets.minio_secret_access_key.path; }; From d80b7cb098c954464d86dbfa4e44b5fd169fa2b5 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 21 Jun 2024 13:02:13 -0500 Subject: [PATCH 4/7] Add Jeremiah runner --- hosts/jeremiah/default.nix | 65 ++++++++++++++++++++++++- secrets/gitlab/jeremiah-runner-reg.age | Bin 0 -> 1919 bytes secrets/secrets.nix | 1 + 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 secrets/gitlab/jeremiah-runner-reg.age diff --git a/hosts/jeremiah/default.nix b/hosts/jeremiah/default.nix index 584b31c..dc4a199 100644 --- a/hosts/jeremiah/default.nix +++ b/hosts/jeremiah/default.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { imports = @@ -56,6 +56,19 @@ }; environment.systemPackages = with pkgs; [ btrfs-progs + curl + gawk + git + p7zip + packer + pup + gregpy + shellcheck + unzip + xonsh + xorriso + vagrant + wget ]; fileSystems = { @@ -70,4 +83,54 @@ device = "/dev/nvme0n1p1"; }; }; + + ##################################################################################### + #################### Virtualbox Runner ############################################## + ##################################################################################### + services = { + gitlab-runner = { + enable = true; + settings.concurrent = 1; + services = { + shell = { + executor = "shell"; + limit = 5; + registrationConfigFile = config.age.secrets.runner-reg.path; + environmentVariables = { + EFI_DIR = "${pkgs.OVMF.fd}/FV/"; + }; + }; + }; + }; + }; + age.secrets.runner-reg.file = ../../secrets/gitlab/jeremiah-runner-reg.age; + virtualisation.virtualbox.host = { + enable = true; + enableExtensionPack = true; + enableHardening = false; + headless = true; + }; + + systemd.services."gitlab-runner" = { + after = [ + "network.target" + "network-online.target" + "systemd-resolved.service" + ]; + wants = [ + "network-online.target" + "systemd-resolved.service" + ]; + preStart = builtins.concatStringsSep "\n" [ + "${pkgs.kmod}/bin/modprobe vboxdrv" + "${pkgs.kmod}/bin/modprobe vboxnetadp" + "${pkgs.kmod}/bin/modprobe vboxnetflt" + ]; + postStop = "${pkgs.kmod}/bin/rmmod vboxnetadp vboxnetflt vboxdrv"; + serviceConfig = { + DevicePolicy = lib.mkForce "auto"; + User = "root"; + DynamicUser = lib.mkForce false; + }; + }; } diff --git a/secrets/gitlab/jeremiah-runner-reg.age b/secrets/gitlab/jeremiah-runner-reg.age new file mode 100644 index 0000000000000000000000000000000000000000..0636c77251c250d5b5a60e46cf82944ea478ed49 GIT binary patch literal 1919 zcmZY8{qNia9l&wIHZ~6s2bze4aT-ZB%hz6e*Iv&Au$Sb>^|{w; zk1v8S83rbc2n$9wABa3loEbwgZ1W*Y*dS~!J^^ua_zf^X$(C)z8Qjm`{ROXlKJU** zHHHgAXAq=bG;*D8!*6Dj@4h6`8*q-X7-vK$*Va6d=#@Uiz)x!xQqGiz+ zy2~}2wK?6$cHwq1tm7flwi#T47>^aJNef6g(^ep$s9I$KDu8^OuHqTM5J@*boN|>q zQer$X5HW1)?fSy*UT{f3hFu;p5}F%tS0X6w%LU{fjKxKo3`d@8wS(49tJ z4YeC?m5J0!&+EV7~J%$Ob8I?$rXo-$pX|zhP;WtWRdnQRLYG7XKjRwm# zwF~14o<-1^+Bb4Q(Uqxkm)Dwo)0nh~sGghYZgGU0<58XP9oKKyGjMmKY7_<5m zYKQqMP5Bdn$uv!?T~$z19Ep9L=aJBf64o3iO}QEAAe`6y9L|lM$fN4ZH(AwagXFVb zEExI8sN4bixw;4XVx$eqCe(J4v1L>UoNa+}14J1ht!FwVC*Wp$wV9)8DiP#o5{t0) zI@Y3tq}VIkI$4}2hK?ncwOotX8d&4AK`u6HI-K++Cz+2tyDpV*rc`OEXmjWf3sr4@#eA4XN{CB z2pClu6y!MSP)f0>0zb$4X5f zB@_Ybff20p6abJIn|GIMmd3?%K3ncPql%3H)(~eo$105m1xKUt0HyUVqq&vPq-8=A z^L#DLgv!)}I3lSzHH*;Hd^~^#uHe-KyHlUZQwt00L})6~Fke`%xsI)PMizra(3!+K zMW*otNQ&~9${CPYq-~6C&?ccVxdv7l7CgS2@omEiVaso5aY)&yJZ735xDz}1QKeKL zxsqFG{p3%uM^LbD?2oVPPRFQl@v|g47xu@&eQb zTTY~gI2JR?bc%@a-0p;PyGQh8ZIJnvyVU!^*PcB0MeMmRZOuOteem4}SFZpb33hEy z3h&>iYoAu0QLZ`9J$&w8pJ?sNe}8P>HGd>-UU~oe{ilBO*q)dE{mRNyJ?B;9)Hj|^ zo|JbUI`huE2Mm0}$$O5zcl!BHj&I!h`*~ literal 0 HcmV?d00001 diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 583093c..684783b 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -57,6 +57,7 @@ in # Then pipe the resulting files to agenix -e "gitlab/key.age".publicKeys = everyone; "gitlab/cert.age".publicKeys = everyone; + "gitlab/jeremiah-runner-reg.age".publicKeys = everyone; "gitlab/myself-qemu-runner-reg.age".publicKeys = everyone; "gitlab/myself-vbox-runner-reg.age".publicKeys = everyone; "gitlab/myself-podman-runner-reg.age".publicKeys = everyone; From 77f8dec208ca5161989a77aeada8b45a5262f4e8 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 21 Jun 2024 13:08:42 -0500 Subject: [PATCH 5/7] Add STORAGE_URL --- hosts/jeremiah/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/jeremiah/default.nix b/hosts/jeremiah/default.nix index dc4a199..b82896d 100644 --- a/hosts/jeremiah/default.nix +++ b/hosts/jeremiah/default.nix @@ -98,6 +98,7 @@ registrationConfigFile = config.age.secrets.runner-reg.path; environmentVariables = { EFI_DIR = "${pkgs.OVMF.fd}/FV/"; + STORAGE_URL = "http://localhost:9000"; }; }; }; From eb88be91167c53099d63f8a7ac9bf6e9d0fb2a52 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 21 Jun 2024 17:06:25 -0500 Subject: [PATCH 6/7] Setup MinIO in runner --- hosts/myself/container-runner.nix | 2 ++ hosts/myself/git.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hosts/myself/container-runner.nix b/hosts/myself/container-runner.nix index 440d547..2656eff 100644 --- a/hosts/myself/container-runner.nix +++ b/hosts/myself/container-runner.nix @@ -31,6 +31,7 @@ lib.attrsets.recursiveUpdate { curl gawk git + minio-client p7zip packer pup @@ -67,6 +68,7 @@ lib.attrsets.recursiveUpdate { registrationConfigFile = config.age.secrets.runner-reg.path; environmentVariables = { EFI_DIR = "${pkgs.OVMF.fd}/FV/"; + STORAGE_URL = "http://localhost:9000"; }; }; }; diff --git a/hosts/myself/git.nix b/hosts/myself/git.nix index a88a930..c6d6901 100644 --- a/hosts/myself/git.nix +++ b/hosts/myself/git.nix @@ -120,6 +120,7 @@ in { registrationConfigFile = config.age.secrets.runner-qemu.path; environmentVariables = { EFI_DIR = "${pkgs.OVMF.fd}/FV/"; + STORAGE_URL = "http://localhost:9000"; }; }; }; @@ -132,6 +133,7 @@ in { curl gawk git + minio-client p7zip packer pup From 7448bf91f4aa3b2f4f44bf705d943fd530ec8caf Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 24 Jun 2024 16:04:48 -0400 Subject: [PATCH 7/7] Better vim usage Move to better settings for fzf Go back to NERDTree, as the others are very annoying --- home/vim.nix | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/home/vim.nix b/home/vim.nix index 4524ede..91e0dbd 100644 --- a/home/vim.nix +++ b/home/vim.nix @@ -33,10 +33,6 @@ in globals = { indent_guides_enable_on_vim_startup = 1; nix_recommended_style = 0; - netrw_liststyle = 3; - netrw_browse_split = 4; - netrw_altv = 1; - netrw_winsize = 25; }; opts = { background = "dark"; @@ -75,11 +71,7 @@ in } { mode = "n"; key = ""; - action = ":Lex"; - } { - mode = "n"; - key = ""; - action = ":GFiles?"; + action = ":NERDTreeToggle"; } (winMove "h") (winMove "j") @@ -87,25 +79,43 @@ in (winMove "l") ]; plugins = { - airline = { - enable = true; - settings.theme = "gruvbox"; - }; + airline.enable = true; + cmp.enable = true; + direnv.enable = true; gitgutter.enable = true; fugitive.enable = true; + fzf-lua = { + enable = true; + iconsEnabled = true; + keymaps = { + "" = { + action = "files"; + settings = { + previewers.cat.cmd = "${pkgs.coreutils}/bin/cat"; + winopts.height = 0.5; + }; + }; + "" = { + action = "git_files"; + settings = { + previewers.cat.cmd = "${pkgs.coreutils}/bin/cat"; + winopts.height = 0.5; + }; + }; + }; + profile = "fzf-vim"; + }; notify.enable = true; }; extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (builtins.readFile ./vim/extra.lua); extraConfigVim = builtins.readFile ./vim/extra.vimrc; extraPlugins = with pkgs.vimPlugins; [ bufexplorer - gruvbox - nvim-cmp + nerdtree + nvim-web-devicons # Be sure to install Hack Nerd Font and set it to your term default: https://gist.github.com/matthewjberger/7dd7e079f282f8138a9dc3b045ebefa0 packer-nvim context-vim - direnv-vim - fzf-vim vim-flake8 vim-indent-guides vim-xonsh