From adf8b20d297d2cb9d0ea87ba14fd5e817386185f Mon Sep 17 00:00:00 2001 From: greg-compass Date: Mon, 19 Sep 2022 13:26:51 -0500 Subject: [PATCH 1/4] Configure tmux --- home/home.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/home.nix b/home/home.nix index 35732fc..deb2fac 100644 --- a/home/home.nix +++ b/home/home.nix @@ -35,6 +35,15 @@ in { ] ++ guiImports; + programs.tmux = { + enable = true; + keyMode = "vi"; + shell = "${pkgs.xonsh}/bin/xonsh"; + terminal = "xterm-256color"; + customPaneNavigationAndResize = true; + extraConfig = "set-option -g default-command ${pkgs.xonsh}/bin/xonsh"; + }; + home.stateVersion = "22.05"; home.packages = with pkgs; [ bitwarden-cli From b952e681364bf0b507c708ac9f258d5aa16c44ae Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 23 Sep 2022 01:29:05 +0000 Subject: [PATCH 2/4] Add gitea --- hosts/linode/default.nix | 1 + hosts/linode/git.nix | 42 +++++++++++++++++++++++++++++++++++++++ hosts/linode/postgres.nix | 6 +++++- modules-linux/backup.nix | 2 +- 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 hosts/linode/git.nix diff --git a/hosts/linode/default.nix b/hosts/linode/default.nix index ae0a13c..d34fc13 100644 --- a/hosts/linode/default.nix +++ b/hosts/linode/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./git.nix ./hardware-configuration.nix ./nextcloud.nix ./nginx.nix diff --git a/hosts/linode/git.nix b/hosts/linode/git.nix new file mode 100644 index 0000000..51027bf --- /dev/null +++ b/hosts/linode/git.nix @@ -0,0 +1,42 @@ +{ config, ... }: + +{ + services.gitea = rec { + enable = true; + appName = "Greg's Sources"; + cookieSecure = true; + database = { + type = "postgres"; + user = "gitea"; + }; + disableRegistration = true; + domain = "src.thehellings.com"; + dump = { + enable = true; + type = "tar.xz"; + }; + rootUrl = "https://${domain}/"; + }; + + greg.proxies."src.thehellings.com" = { + target = "http://localhost:${toString config.services.gitea.httpPort}"; + ssl = true; + genAliases = false; + }; + + greg.backup.jobs.gitea = { + src = config.services.gitea.dump.backupDir; + dest = "gitea"; + user = "gitea"; + }; + + services.logrotate = { + enable = true; + settings = { + gitea = { + enable = true; + files = "${config.services.gitea.dump.backupDir}/*"; + }; + }; + }; +} diff --git a/hosts/linode/postgres.nix b/hosts/linode/postgres.nix index fd2da32..b5b811f 100644 --- a/hosts/linode/postgres.nix +++ b/hosts/linode/postgres.nix @@ -4,7 +4,7 @@ services.postgresql = { enable = true; checkConfig = true; - ensureDatabases = [ "nextcloud" ]; + ensureDatabases = [ "nextcloud" "gitea" ]; initialScript = pkgs.writeText "create-matrix-db.sql" '' CREATE ROLE "matrix-synapse" WITH LOGIN; CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C"; @@ -16,6 +16,9 @@ } { name = "root"; ensurePermissions."ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; + } { + name = "gitea"; + ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; } ]; settings = { log_connections = true; @@ -30,6 +33,7 @@ root root postgres services.postgresqlBackup = { enable = true; databases = [ + "gitea" "nextcloud" "synapse" ]; diff --git a/modules-linux/backup.nix b/modules-linux/backup.nix index f3df0e1..400c85c 100644 --- a/modules-linux/backup.nix +++ b/modules-linux/backup.nix @@ -39,7 +39,7 @@ in with lib; { key = mkOption { type = types.path; description = "SSH key to use"; - default = ./ssh/id_ed25519; + default = ../ssh/id_ed25519; }; jobs = mkOption { From f29321d2c60633285994347e36c75418b85f6c23 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 23 Sep 2022 01:45:24 +0000 Subject: [PATCH 3/4] Set SSH alias --- home/ssh.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/ssh.nix b/home/ssh.nix index fcc2d3f..3703dc3 100644 --- a/home/ssh.nix +++ b/home/ssh.nix @@ -20,6 +20,7 @@ "chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan"] nas; gh = { user = "git"; hostname = "github.com"; }; + "src" = { user = "gitea"; hostname = "src.thehellings.com"; }; "*.thehellings.lan" = owned; "10.42.*" = owned; From 7b659e4cde454fc7baa89344da81d5c301a2ed58 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 23 Sep 2022 02:36:13 +0000 Subject: [PATCH 4/4] Add garnix --- modules-all/automatic/nix.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules-all/automatic/nix.nix b/modules-all/automatic/nix.nix index f555dc6..bc4bdb9 100644 --- a/modules-all/automatic/nix.nix +++ b/modules-all/automatic/nix.nix @@ -5,6 +5,14 @@ nix = { package = pkgs.nixFlakes; + settings = { + substituters = [ + "https://cache.garnix.io" + ]; + trusted-public-keys = [ + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + ]; + }; # Keep freespace available, at a minimum, and enable Flakes extraOptions = '' experimental-features = nix-command flakes