From f7efae09edb5b187c454b4ed90c54c55e5eca425 Mon Sep 17 00:00:00 2001 From: cookiez Date: Wed, 13 Aug 2025 17:07:03 +0200 Subject: [PATCH] Started setup for easier gitea usage --- configuration.nix | 2 -- flake.nix | 1 + gitea.nix | 21 +++++++++++++++++++++ home.nix | 13 +++++++++++++ other/aliases | 6 +++--- other/ssh-keys/gitea | 7 +++++++ other/ssh-keys/gitea.pub | 1 + 7 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 gitea.nix create mode 100644 other/ssh-keys/gitea create mode 100644 other/ssh-keys/gitea.pub diff --git a/configuration.nix b/configuration.nix index a4ec619..5325b62 100644 --- a/configuration.nix +++ b/configuration.nix @@ -171,8 +171,6 @@ source /etc/nixos/other/pfp.sh source /etc/nixos/other/theme-reminder.sh - - echo -e "Use: $YELLOW'home-manager switch'$NOCOLOR or $DARKGRAY'home-upd'$NOCOLOR (if available) to update your home manager!" ''; diff --git a/flake.nix b/flake.nix index d1c6e87..6e321a2 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,7 @@ ./firefox.nix ./zsh.nix ./autostart.nix + #./gitea.nix #./neovim.nix ./packages.nix ./lockscreen.nix diff --git a/gitea.nix b/gitea.nix new file mode 100644 index 0000000..041be28 --- /dev/null +++ b/gitea.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: +{ + programs.ssh = { + startAgent = true; + extraConfig = '' + Host gitea + HostName http://100.89.141.79:3000/ + User cookiez + IdentityFile ~/.ssh/gitea + IdentitiesOnly yes + ''; + }; + + environment.etc."ssh-keys/gitea".source = /etc/nixos/other/ssh-keys/gitea; + environment.etc."ssh-keys/gitea".mode = "0600"; + + # Optional: symlink to ~/.ssh + #environment.homeFiles = { + # ".ssh/gitea" = "/etc/ssh-keys/gitea"; + #}; +} diff --git a/home.nix b/home.nix index ab8cb36..e5467bb 100644 --- a/home.nix +++ b/home.nix @@ -22,6 +22,8 @@ # changes in each release. home.stateVersion = version; + #home.file.".ssh/gitea".source = /etc/nixos/other/ssh-keys/gitea; + # Let Home Manager install and manage itself. programs = { home-manager = { enable = true; }; @@ -32,6 +34,17 @@ userEmail = "jaden-puerkenauer@web.de"; }; + ssh = { + enable = true; + extraConfig = '' + Host gitea + HostName http://100.89.141.79:3000/ + User cookiez + IdentityFile ~/.ssh/gitea + IdentitiesOnly yes + ''; + }; + zen-browser = { enable = true; #package = inputs.zen-browser.packages.${pkgs.system}.default; diff --git a/other/aliases b/other/aliases index 53762e6..b2e689d 100644 --- a/other/aliases +++ b/other/aliases @@ -28,11 +28,11 @@ alias nix-edit-zsh="sudoedit /etc/nixos/zsh.nix" alias nix-aliases="sudoedit /etc/nixos/other/aliases" alias nix-edit-aliases="sudoedit /etc/nixos/other/aliases" alias nix-regenerate-config="sudo nixos-generate-config" -alias nix-home="echo To edit home manager run command \'home-edit\'" +alias nix-home="sudoedit /etc/nixos/home.nix" alias nix-gc="sudo nix-store --gc" alias nix-clean="sudo nix-store --gc" alias nix-clear="sudo nix-store --gc" + alias home-edit="sudoedit /etc/nixos/home.nix" -alias home-upd="home-manager switch" -alias home-update="home-manager switch" + alias cd-nix="cd /etc/nixos/" diff --git a/other/ssh-keys/gitea b/other/ssh-keys/gitea new file mode 100644 index 0000000..d292692 --- /dev/null +++ b/other/ssh-keys/gitea @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACBC5b8lmBdsmTEpEr/ue+P4SQkorJz3LU6rTJ+u46dZHgAAAJDgFZde4BWX +XgAAAAtzc2gtZWQyNTUxOQAAACBC5b8lmBdsmTEpEr/ue+P4SQkorJz3LU6rTJ+u46dZHg +AAAEBxskKJRsisml2xBI0VTX9BFCKEUKJc7bn5yhzaxh4ie0LlvyWYF2yZMSkSv+574/hJ +CSisnPctTqtMn67jp1keAAAADGdpdGVhLWFjY2VzcwE= +-----END OPENSSH PRIVATE KEY----- diff --git a/other/ssh-keys/gitea.pub b/other/ssh-keys/gitea.pub new file mode 100644 index 0000000..5fad5c8 --- /dev/null +++ b/other/ssh-keys/gitea.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIELlvyWYF2yZMSkSv+574/hJCSisnPctTqtMn67jp1ke gitea-access