Prepare to upload encrypted secrets file

This commit is contained in:
Jimbo 2024-08-24 23:09:23 -04:00
parent ba5d5260b3
commit f61fa33b7e
23 changed files with 35 additions and 25 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
nixos/modules/secrets.nix filter=git-crypt diff=git-crypt

View file

@ -44,8 +44,8 @@
auth = import ./common/auth.nix;
in {
nixdate = ''
${auth.method} nixos-rebuild switch --flake /etc/nixos/.#JimNixDesktop;
home-manager switch --flake /etc/nixos/.#jimbo@JimNixDesktop;
${auth.method} nixos-rebuild switch --flake /etc/nixos/NixOS-Config/.#JimNixDesktop;
home-manager switch --flake /etc/nixos/NixOS-Config/.#jimbo@JimNixDesktop;
notify-send "NixOS switch finished."
'';
};

View file

@ -12,8 +12,8 @@
auth = import ./common/auth.nix;
in {
nixdate = ''
${auth.method} nixos-rebuild switch --flake /etc/nixos/.#JimNixServer;
home-manager switch --flake /etc/nixos/.#jimbo@JimNixServer;
${auth.method} nixos-rebuild switch --flake /etc/nixos/NixOS-Config/.#JimNixServer;
home-manager switch --flake /etc/nixos/NixOS-Config/.#jimbo@JimNixServer;
'';
};
};

View file

@ -1,11 +1,15 @@
{
{pkgs, ...}: {
# Enable git and config
programs.git = let
secrets = import ../../../secrets.nix;
secrets = import ../../nixos/modules/secrets.nix;
in {
enable = true;
lfs.enable = true;
userName = secrets.jimUsername;
userEmail = secrets.jimEmail;
};
home.packages = with pkgs; [
git-crypt
];
}

View file

@ -16,7 +16,6 @@
# Modules
./modules/security.nix
./modules/networking.nix
# Hardware
./hardware/machines/desktop.nix

View file

@ -10,7 +10,8 @@
}: {
# You can import other NixOS modules here
imports = [
# My modules
./networking.nix
./gpg.nix
];
nixpkgs = {
@ -60,7 +61,7 @@
# Set timezone
time.timeZone = let
secrets = import ../common/secrets.nix;
secrets = import ../modules/secrets.nix;
in secrets.timeZone;
# Select internationalisation properties.

6
nixos/modules/gpg.nix Normal file
View file

@ -0,0 +1,6 @@
{
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
}

View file

@ -7,7 +7,7 @@
# Set hostnames
hosts = let
ips = import ../common/ips.nix;
ips = import ../modules/ips.nix;
in {
"${ips.server}" = ["server"];
"${ips.pc}" = ["pc"];

View file

@ -10,7 +10,6 @@
# Modules
./modules/security.nix
./modules/networking.nix
# Hardware
./hardware/machines/server.nix

View file

@ -1,6 +1,6 @@
{
security.acme = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
acceptTerms = true;
defaults.email = secrets.jimEmail;

View file

@ -1,7 +1,7 @@
{pkgs, ...}: {
# DDClient for Dynamic IPs
services.ddclient = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
protocol = "cloudflare";

View file

@ -1,7 +1,7 @@
{
# Configure the Element web server
nixpkgs.config.element-web.conf = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
default_server_config = {
"m.homeserver" = {

View file

@ -5,7 +5,7 @@
# Configure firewall
networking = let
ips = import ../modules/ips.nix;
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
firewall = {
allowPing = false;

View file

@ -1,6 +1,6 @@
{
services.gitea = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
settings = {

View file

@ -1,6 +1,6 @@
{
services.lemmy = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
nginx.enable = true;

View file

@ -1,5 +1,5 @@
{pkgs, ...}: let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in rec {
# Mail server
mailserver = rec {

View file

@ -1,6 +1,6 @@
{pkgs, ...}: {
services.mastodon = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
localDomain = "social.${secrets.jimDomain}";

View file

@ -1,5 +1,5 @@
{pkgs, ...}: let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
services.nextcloud = {
enable = true;

View file

@ -1,6 +1,6 @@
{pkgs, ...}: {
services.nginx = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
package = (pkgs.nginx.override {

View file

@ -1,6 +1,6 @@
{pkgs, lib, ...}: {
services.pufferpanel = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
environment = {

View file

@ -1,6 +1,6 @@
{pkgs, config, ...}: {
services = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
# Synapse Matrix server
matrix-synapse = with config.services.coturn; {

View file

@ -1,6 +1,6 @@
{
services.vaultwarden = let
secrets = import ../../../secrets.nix;
secrets = import ../modules/secrets.nix;
in {
enable = true;
config = {

View file

@ -1,7 +1,7 @@
{pkgs, ...}: {
users.users = {
jimbo = let
secrets = import ../common/secrets.nix;
secrets = import ../modules/secrets.nix;
in {
description = "Jimbo";
hashedPassword = secrets.jimboAccPass;