Compare commits

..

No commits in common. "977c3160490474f244518754eaa5f5c10764dfe3" and "47e073f9d1500ce19cfda441b1312fd4a8ba37d3" have entirely different histories.

3 changed files with 55 additions and 42 deletions

View file

@ -339,7 +339,7 @@ in
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } } let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } }
" lsp commands " lsp commands
nnoremap <leader>vgd :lua vim.lsp.buf.definition()<CR> " nnoremap <leader>vd :lua vim.lsp.buf.definition()<CR>
nnoremap <leader>vi :lua require('telescope.builtin').lsp_implementation()<CR> nnoremap <leader>vi :lua require('telescope.builtin').lsp_implementation()<CR>
nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR> nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR>
nnoremap <leader>vrr :lua require('telescope.builtin').lsp_references()<CR> nnoremap <leader>vrr :lua require('telescope.builtin').lsp_references()<CR>

View file

@ -5,7 +5,6 @@
group = "woodpecker-runner"; group = "woodpecker-runner";
home = "/var/lib/woodpecker"; home = "/var/lib/woodpecker";
createHome = true; createHome = true;
extraGroups = [ "docker" ];
}; };
users.groups.woodpecker-runner = { }; users.groups.woodpecker-runner = { };
# Allow the exec runner to write to build with nix # Allow the exec runner to write to build with nix
@ -14,43 +13,56 @@
age.secrets.woodpecker-agent-secret.owner = "woodpecker-runner"; age.secrets.woodpecker-agent-secret.owner = "woodpecker-runner";
age.secrets.woodpecker-agent-secret.file = "${self}/secrets/woodpecker-agent-secret.age"; age.secrets.woodpecker-agent-secret.file = "${self}/secrets/woodpecker-agent-secret.age";
systemd.services.woodpecker-agent = { systemd.services.woodpecker-runner-exec = {
enable = true; enable = true;
wantedBy = [ "multi-user.target" ];
### MANUALLY RESTART SERVICE IF CHANGED ### MANUALLY RESTART SERVICE IF CHANGED
restartIfChanged = true; restartIfChanged = true;
# confinement.enable = true; confinement.enable = true;
# confinement.packages = [ confinement.packages = [
# pkgs.git pkgs.git
# pkgs.gnutar pkgs.gnutar
# pkgs.bash pkgs.bash
# pkgs.nixFlakes pkgs.nixFlakes
# pkgs.gzip pkgs.gzip
# ]; ];
# path = [ path = [
# pkgs.git pkgs.git
# pkgs.gnutar pkgs.gnutar
# pkgs.bash pkgs.bash
# pkgs.nixFlakes pkgs.nixFlakes
# pkgs.gzip pkgs.gzip
# ]; ];
serviceConfig = { serviceConfig = {
Type = "simple";
Environment = [ Environment = [
"WOODPECKER_RUNNER_CAPACITY=6" "WOODPECKER_RUNNER_CAPACITY=6"
# "WOODPECKER_RUNNER_NAME=woodpecker-agent" "WOODPECKER_RUNNER_NAME=woodpecker-agent"
"WOODPECKER_SERVER=https://ci.sealight.xyz/" "WOODPECKER_SERVER=https://ci.sealight.xyz/"
# "WOODPECKER_HOSTNAME=mossnet" "WOODPECKER_HOSTNAME=mossnet"
# "WOODPECKER_BACKEND=local" "WOODPECKER_BACKEND=local"
# "NIX_REMOTE=daemon" "NIX_REMOTE=daemon"
# "PAGER=cat" "PAGER=cat"
# "WOODPECKER_LOG_LEVEL=debug" ];
BindPaths = [
"/nix/var/nix/daemon-socket/socket"
"/run/nscd/socket"
"/var/lib/woodpecker"
"/var/empty/usr"
];
BindReadOnlyPaths = [
"/etc/passwd:/etc/passwd"
"/etc/group:/etc/group"
"/nix/var/nix/profiles/system/etc/nix:/etc/nix"
"${config.environment.etc."ssl/certs/ca-certificates.crt".source}:/etc/ssl/certs/ca-certificates.crt"
"${config.environment.etc."ssh/ssh_known_hosts".source}:/etc/ssh/ssh_known_hosts"
"${builtins.toFile "ssh_config" ''
Host git.sealight.xyz
ForwardAgent yes
''}:/etc/ssh/ssh_config"
"/etc/machine-id"
"/etc/resolv.conf"
"/nix/"
]; ];
WorkingDirectory = "/var/lib/woodpecker";
# Runtime directory and mode
RuntimeDirectory = "woodpecker";
RuntimeDirectoryMode = "0755";
# Access write directories
ReadWritePaths = [ "/var/lib/woodpecker" ];
EnvironmentFile = [ EnvironmentFile = [
/run/agenix/woodpecker-agent-secret /run/agenix/woodpecker-agent-secret
]; ];

View file

@ -1,4 +1,4 @@
{ self, pkgs, config, ... }: { self, ... }:
{ {
age.secrets.woodpecker-server-secrets.owner = "woodpecker"; age.secrets.woodpecker-server-secrets.owner = "woodpecker";
age.secrets.woodpecker-server-secrets.file = "${self}/secrets/woodpecker-server-secrets.age"; age.secrets.woodpecker-server-secrets.file = "${self}/secrets/woodpecker-server-secrets.age";
@ -10,7 +10,6 @@
description = "woodpecker user"; description = "woodpecker user";
home = "/var/lib/woodpecker"; home = "/var/lib/woodpecker";
createHome = true; createHome = true;
isNormalUser = true;
}; };
users.groups.woodpecker = { }; users.groups.woodpecker = { };
@ -18,11 +17,9 @@
services.nginx.virtualHosts."ci.sealight.xyz" = { services.nginx.virtualHosts."ci.sealight.xyz" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/".proxyPass = "http://localhost:38125"; locations."/".proxyPass = "http://localhost:3030/";
}; };
networking.firewall.allowedTCPPorts = [ 80 443 22 ];
services.postgresql = { services.postgresql = {
ensureDatabases = [ "woodpecker" ]; ensureDatabases = [ "woodpecker" ];
ensureUsers = [{ ensureUsers = [{
@ -36,26 +33,30 @@
systemd.services.woodpecker-server = { systemd.services.woodpecker-server = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
WorkingDirectory = "/var/lib/woodpecker";
EnvironmentFile = [ EnvironmentFile = [
/run/agenix/woodpecker-server-secrets /run/agenix/woodpecker-server-secrets
/run/agenix/woodpecker-agent-secret /run/agenix/woodpecker-agent-secret
]; ];
Environment = [ Environment = [
"WOODPECKER_OPEN=false" "WOODPECKER_OPEN=true"
"WOODPECKER_HOST=https://ci.sealight.xyz"
"WOODPECKER_SERVER_ADDR=:38125"
"WOODPECKER_GITEA=true" "WOODPECKER_GITEA=true"
"WOODPECKER_GITEA_URL=https://git.sealight.xyz" "WOODPECKER_GITEA_URL=https://git.sealight.xyz"
"WOODPECKER_DATABASE_DATASOURCE=postgres:///woodpecker?host=/run/postgresql" "WOODPECKER_DATABASE_DATASOURCE=postgres:///woodpecker?host=/run/postgresql"
"WOODPECKER_DATABASE_DRIVER=postgres" "WOODPECKER_DATABASE_DRIVER=postgres"
"WOODPECKER_SERVER_PORT=:3030"
"WOODPECKER_USER_CREATE=username:aynish,admin:true" # set your admin username "WOODPECKER_USER_CREATE=username:aynish,admin:true" # set your admin username
"${config.environment.etc."ssl/certs/ca-certificates.crt".source}:/etc/ssl/certs/ca-certificates.crt"
"${config.environment.etc."ssh/ssh_known_hosts".source}:/etc/ssh/ssh_known_hosts"
"${builtins.toFile "ssh_config" ''
Host git.sealight.xyz
ForwardAgent yes
''}:/etc/ssh/ssh_config"
]; ];
ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server"; ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server";
User = "woodpecker"; User = woodpecker;
Group = "woodpecker"; Group = woodpecker;
}; };
}; };