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 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 diff --git a/hosts/jeremiah/default.nix b/hosts/jeremiah/default.nix index 584b31c..b82896d 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,55 @@ 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/"; + STORAGE_URL = "http://localhost:9000"; + }; + }; + }; + }; + }; + 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/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; }; 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 diff --git a/secrets/gitlab/jeremiah-runner-reg.age b/secrets/gitlab/jeremiah-runner-reg.age new file mode 100644 index 0000000..0636c77 Binary files /dev/null and b/secrets/gitlab/jeremiah-runner-reg.age differ diff --git a/secrets/gitlab/myself-qemu-runner-reg.age b/secrets/gitlab/myself-qemu-runner-reg.age index 463a49f..b581326 100644 Binary files a/secrets/gitlab/myself-qemu-runner-reg.age and b/secrets/gitlab/myself-qemu-runner-reg.age differ 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;