Compare commits

14 Commits

Author SHA1 Message Date
John Lancaster 9b51398ceb nhms switch keymap 2026-04-01 23:34:39 -05:00
John Lancaster 2a97dbf7ca slowed down the mouse scrolling in ghostty 2026-04-01 23:32:28 -05:00
John Lancaster d7e32c0a2f Merge branch 'forgejo' 2026-04-01 20:55:17 -05:00
John Lancaster 76cb1d078b added key and cert files to https config in forgejo 2026-04-01 20:48:38 -05:00
John Lancaster fb7750235f added my-neovim to soteria 2026-04-01 20:48:07 -05:00
John Lancaster 4c90263866 flake.lock update 2026-04-01 20:47:20 -05:00
John Lancaster fac9c7f5ce mtls param renames 2026-04-01 20:45:09 -05:00
John Lancaster a7b65e4eee formatting 2026-04-01 20:44:40 -05:00
John Lancaster 1fe4d59ce6 mtls options 2026-04-01 15:59:56 -05:00
John Lancaster 86bb800886 prune 2026-04-01 15:57:51 -05:00
John Lancaster c4cf7c8096 fixed postgres group 2026-04-01 15:57:44 -05:00
John Lancaster 863ff2d04d ssh updates for john p14s 2026-03-31 23:54:45 -05:00
John Lancaster cf02260941 my-neovim shortcuts 2026-03-31 23:11:23 -05:00
John Lancaster 609d2a5cca p14 ssh config 2026-03-31 23:09:32 -05:00
13 changed files with 208 additions and 131 deletions
Generated
+50 -29
View File
@@ -18,11 +18,11 @@
}, },
"flake-file": { "flake-file": {
"locked": { "locked": {
"lastModified": 1774666175, "lastModified": 1774886516,
"narHash": "sha256-WaZxvtOvVNikiNTen2Emhds2RvzFCWIb7KU9C0eWrNA=", "narHash": "sha256-w2LoQVM6DXrSdGUZBZqa1nYkMzHoB0t82DrptzZKhTs=",
"owner": "vic", "owner": "vic",
"repo": "flake-file", "repo": "flake-file",
"rev": "953d01f3ae5ba50869c5e1248062198f73e971bf", "rev": "3daadf37de2bb85b0ff34e2a7ab0d71e077c2b9e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -38,11 +38,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772408722, "lastModified": 1775087534,
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -95,11 +95,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1774738535, "lastModified": 1775080052,
"narHash": "sha256-2jfBEZUC67IlnxO5KItFCAd7Oc+1TvyV/jQlR+2ykGQ=", "narHash": "sha256-jAB4ZZbx8ECu9GcE/PUUwT+wpooZ0Ssmn2imB8PVTdM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "769e07ef8f4cf7b1ec3b96ef015abec9bc6b1e2a", "rev": "6267895e9898399f0ce2fe79b645e9ee4858aaff",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -184,11 +184,11 @@
"nixos-hardware": { "nixos-hardware": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1774777275, "lastModified": 1774933469,
"narHash": "sha256-qogBiYFq8hZusDPeeKRqzelBAhZvREc7Cl+qlewGUCg=", "narHash": "sha256-OrnCQeUO2bqaWUl0lkDWyGWjKsOhtCyd7JSfTedQNUE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "b8f81636927f1af0cca812d22c876bad0a883ccd", "rev": "f4c4c2c0c923d7811ac2a63ccc154767e4195337",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -199,11 +199,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1774106199, "lastModified": 1774709303,
"narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=", "narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655", "rev": "8110df5ad7abf5d4c0f6fb0f8f978390e77f9685",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -215,11 +215,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1774701658, "lastModified": 1775064974,
"narHash": "sha256-5QVei2IIfVO3GqMkiiXlrZtaniOkXyMWnqbTVkItrco=", "narHash": "sha256-PqhsO5qloSyvATi9qAIrgUcEFK67xSoacjacPw+t4H0=",
"rev": "b63fe7f000adcfa269967eeff72c64cafecbbebe", "rev": "6ebfbc38bdc6b22822a6f991f2d922306f33cfbc",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre971056.b63fe7f000ad/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre973084.6ebfbc38bdc6/nixexprs.tar.xz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@@ -254,11 +254,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1774736237, "lastModified": 1774852850,
"narHash": "sha256-uQ+Was7QP9Bupr0XZyZXOAD32Ox8z2mJnevT2FmDwS8=", "narHash": "sha256-7VK4v7ZbQw5apfgc+FvgRi8BUC45ERlcp8VTTTQ3tko=",
"owner": "notashelf", "owner": "notashelf",
"repo": "nvf", "repo": "nvf",
"rev": "a0636d5c977743851c91d3c2e74bfac90be48835", "rev": "b4d6539e7e9948aaba5efd7a67a63672d1fa80ef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -281,7 +281,8 @@
], ],
"nvf": "nvf", "nvf": "nvf",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"wrapper-modules": "wrapper-modules" "wrapper-modules": "wrapper-modules",
"wrappers": "wrappers"
} }
}, },
"sops-nix": { "sops-nix": {
@@ -291,11 +292,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1774760784, "lastModified": 1774910634,
"narHash": "sha256-D+tgywBHldTc0klWCIC49+6Zlp57Y4GGwxP1CqfxZrY=", "narHash": "sha256-B+rZDPyktGEjOMt8PcHKYmgmKoF+GaNAFJhguktXAo0=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8adb84861fe70e131d44e1e33c426a51e2e0bfa5", "rev": "19bf3d8678fbbfbc173beaa0b5b37d37938db301",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -339,11 +340,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1774767209, "lastModified": 1774879171,
"narHash": "sha256-bJxBN+ebX3yZj+KT/c+LeA4xIpoNghG233szgRFAWOc=", "narHash": "sha256-a6JZDuBIwQmuEwYM4dziH+WyrpE8HCP8F7JFIn3CNvw=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nix-wrapper-modules", "repo": "nix-wrapper-modules",
"rev": "70795f6eb74a69d736e41ee837cd7e1a6d46c0aa", "rev": "bab35ffae25cf6f4e4fdb3c2f7f0ac80966ce737",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -351,6 +352,26 @@
"repo": "nix-wrapper-modules", "repo": "nix-wrapper-modules",
"type": "github" "type": "github"
} }
},
"wrappers": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1774293387,
"narHash": "sha256-yVekLWxKTUfUyuvo9HVihtOK8llIP3IZCrJmftxT+Nc=",
"owner": "lassulus",
"repo": "wrappers",
"rev": "3cf1e8371129e8746d37c863c5d56a81fb16caa0",
"type": "github"
},
"original": {
"owner": "lassulus",
"repo": "wrappers",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",
+4
View File
@@ -30,5 +30,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules"; wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules";
wrappers = {
url = "github:lassulus/wrappers";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
} }
+2
View File
@@ -37,6 +37,8 @@
ROOT_URL = "https://forgejo.john-stream.com"; ROOT_URL = "https://forgejo.john-stream.com";
PROTOCOL = "https"; PROTOCOL = "https";
COOKIE_SECURE = true; COOKIE_SECURE = true;
KEY_FILE = config.mtls.keyFile;
CERT_FILE = config.mtls.certFile;
}) })
]; ];
+54 -51
View File
@@ -1,7 +1,7 @@
{ self, inputs, lib, ... }: { self, inputs, lib, ... }:
let let
# Options that will be in common between # Options that will be in common between the nixos module and the home-manager module.
opts = { mkOpts = config: let cfg = config.mtls; in {
enable = lib.mkEnableOption "Enable mTLS"; enable = lib.mkEnableOption "Enable mTLS";
subject = lib.mkOption { subject = lib.mkOption {
description = "The Common Name, DNS Name, or IP address that will be set as the Subject Common Name for the certificate. If no Subject Alternative Names (SANs) are configured (via the --san flag) then the subject will be set as the only SAN."; description = "The Common Name, DNS Name, or IP address that will be set as the Subject Common Name for the certificate. If no Subject Alternative Names (SANs) are configured (via the --san flag) then the subject will be set as the only SAN.";
@@ -11,20 +11,25 @@ let
description = "String path to the directory where the certs will be stored"; description = "String path to the directory where the certs will be stored";
type = lib.types.str; type = lib.types.str;
}; };
keyFilename = lib.mkOption { caFile = lib.mkOption {
description = "String filename for the private key"; description = "String path for the root CA file";
type = lib.types.str; type = lib.types.str;
default = "key.pem"; default = "${cfg.certDir}/root_ca.crt";
}; };
certFilename = lib.mkOption { keyFile = lib.mkOption {
description = "String filename for the public certificate"; description = "String path for the private key";
type = lib.types.str; type = lib.types.str;
default = "cert.pem"; default = "${cfg.certDir}/key.pem";
}; };
bundleFilename = lib.mkOption { certFile = lib.mkOption {
description = "String filename for the mTLS key bundle"; description = "String path for the public cert";
type = lib.types.str; type = lib.types.str;
default = "mtls.pem"; default = "${cfg.certDir}/cert.pem";
};
bundleFile = lib.mkOption {
description = "String path for the mTLS key bundle";
type = lib.types.str;
default = "${cfg.certDir}/mtls.pem";
}; };
san = lib.mkOption { san = lib.mkOption {
description = "List of SAN to give the mTLS cert"; description = "List of SAN to give the mTLS cert";
@@ -37,7 +42,7 @@ let
}; };
lifetime = lib.mkOption { lifetime = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "6h"; default = "24h";
}; };
renew = { renew = {
enable = lib.mkOption { enable = lib.mkOption {
@@ -83,9 +88,9 @@ let
subject, subject,
provisioner, provisioner,
san, san,
tlsCert, certFile,
tlsKey, keyFile,
mtlsBundle, bundleFile,
lifetime, lifetime,
}: }:
let let
@@ -95,26 +100,26 @@ let
pkgs.writeShellScriptBin "mtls-generate" '' pkgs.writeShellScriptBin "mtls-generate" ''
set -euo pipefail set -euo pipefail
${stepCmd} ca certificate \ ${stepCmd} ca certificate \
${subject} ${tlsCert} ${tlsKey} \ ${subject} ${certFile} ${keyFile} \
--not-before=-5m --not-after=${lifetime} \ --not-before=-5m --not-after=${lifetime} \
--provisioner ${provisioner} \ --provisioner ${provisioner} \
${sanArgs} \ ${sanArgs} \
"$@" "$@"
cat ${tlsCert} ${tlsKey} > ${mtlsBundle} cat ${certFile} ${keyFile} > ${bundleFile}
''; '';
mkMtlsCheckScript = { pkgs, mtlsBundle }: pkgs.writeShellScriptBin "mtls-check" '' mkMtlsCheckScript = { pkgs, bundleFile }: pkgs.writeShellScriptBin "mtls-check" ''
${lib.getExe pkgs.openssl} x509 \ ${lib.getExe pkgs.openssl} x509 \
-noout -subject -issuer \ -noout -subject -issuer \
-ext subjectAltName,extendedKeyUsage \ -ext subjectAltName,extendedKeyUsage \
-enddate -in ${mtlsBundle} -enddate -in ${bundleFile}
''; '';
mkMtlsRenewScript = { mkMtlsRenewScript = {
pkgs, pkgs,
tlsCert, certFile,
tlsKey, keyFile,
mtlsBundle, bundleFile,
reloadUnits ? [ ], reloadUnits ? [ ],
postCommands ? [ ], postCommands ? [ ],
systemctlArgs ? [ ], systemctlArgs ? [ ],
@@ -134,17 +139,17 @@ let
pkgs.writeShellScriptBin "mtls-renew" '' pkgs.writeShellScriptBin "mtls-renew" ''
set -euo pipefail set -euo pipefail
if ${lib.getExe pkgs.step-cli} certificate needs-renewal "${tlsCert}"; then if ${lib.getExe pkgs.step-cli} certificate needs-renewal "${certFile}"; then
${echoCmd} "Renewing mTLS certificate" ${echoCmd} "Renewing mTLS certificate"
else else
${echoCmd} "Skipping renew" ${echoCmd} "Skipping renew"
exit "$?" exit "$?"
fi fi
${lib.getExe pkgs.step-cli} ca renew --force "${tlsCert}" "${tlsKey}" ${lib.getExe pkgs.step-cli} ca renew --force "${certFile}" "${keyFile}"
umask 077 umask 077
${lib.getExe' pkgs.coreutils "cat"} "${tlsCert}" "${tlsKey}" > "${mtlsBundle}" ${lib.getExe' pkgs.coreutils "cat"} "${certFile}" "${keyFile}" > "${bundleFile}"
${echoCmd} "Reloading units:" ${echoCmd} "Reloading units:"
${renewReloadScript} ${renewReloadScript}
@@ -155,9 +160,9 @@ let
mkNixosMtlsRenewService = { mkNixosMtlsRenewService = {
pkgs, pkgs,
tlsCert, certFile,
tlsKey, keyFile,
mtlsBundle, bundleFile,
reloadUnits ? [ ], reloadUnits ? [ ],
postCommands ? [ ], postCommands ? [ ],
user ? "root", user ? "root",
@@ -166,7 +171,7 @@ let
let let
serviceGroup = if group == null then user else group; serviceGroup = if group == null then user else group;
renewScript = mkMtlsRenewScript { renewScript = mkMtlsRenewScript {
inherit pkgs tlsCert tlsKey mtlsBundle reloadUnits postCommands; inherit pkgs certFile keyFile bundleFile reloadUnits postCommands;
}; };
in in
{ {
@@ -200,15 +205,15 @@ let
mkHomeManagerMtlsRenewService = { mkHomeManagerMtlsRenewService = {
pkgs, pkgs,
tlsCert, certFile,
tlsKey, keyFile,
mtlsBundle, bundleFile,
reloadUnits ? [ ], reloadUnits ? [ ],
postCommands ? [ ], postCommands ? [ ],
}: }:
let let
renewScript = mkMtlsRenewScript { renewScript = mkMtlsRenewScript {
inherit pkgs tlsCert tlsKey mtlsBundle reloadUnits postCommands; inherit pkgs certFile keyFile bundleFile reloadUnits postCommands;
systemctlArgs = [ "--user" ]; systemctlArgs = [ "--user" ];
}; };
in in
@@ -249,17 +254,14 @@ in
flake.modules.nixos.mtls = { config, lib, pkgs, ... }: flake.modules.nixos.mtls = { config, lib, pkgs, ... }:
let let
cfg = config.mtls; cfg = config.mtls;
tlsKey = "${cfg.certDir}/${cfg.keyFilename}";
tlsCert = "${cfg.certDir}/${cfg.certFilename}";
mtlsBundle = "${cfg.certDir}/${cfg.bundleFilename}";
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san; sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
in in
{ {
options.mtls = opts // { options.mtls = (mkOpts config) // {
certDir = lib.mkOption { certDir = lib.mkOption {
description = "String path to where the mtls certs will be stored."; description = "String path to where the mtls certs will be stored.";
type = lib.types.str; type = lib.types.str;
default = "/etc/step/certs"; default = "/etc/step-ca/certs";
}; };
}; };
@@ -267,11 +269,11 @@ in
environment.systemPackages = with pkgs; lib.optionals cfg.enable [ environment.systemPackages = with pkgs; lib.optionals cfg.enable [
# step-cli # step-cli
(mkMtlsGenerateScript { (mkMtlsGenerateScript {
inherit (cfg) subject provisioner san lifetime; inherit pkgs;
inherit pkgs tlsCert tlsKey mtlsBundle; inherit (cfg) subject provisioner san certFile keyFile bundleFile lifetime;
}) })
(mkMtlsCheckScript { inherit pkgs mtlsBundle; }) (mkMtlsCheckScript { inherit pkgs; inherit (cfg) bundleFile; })
(mkMtlsRenewScript { inherit pkgs tlsCert tlsKey mtlsBundle; }) (mkMtlsRenewScript { inherit pkgs; inherit (cfg) certFile keyFile bundleFile; })
]; ];
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
@@ -279,7 +281,8 @@ in
]; ];
systemd.services.mtls-renew = lib.mkIf cfg.renew.enable (mkNixosMtlsRenewService { systemd.services.mtls-renew = lib.mkIf cfg.renew.enable (mkNixosMtlsRenewService {
inherit pkgs tlsCert tlsKey mtlsBundle; inherit pkgs;
inherit (cfg) certFile keyFile bundleFile;
inherit (cfg.renew) reloadUnits postCommands user group; inherit (cfg.renew) reloadUnits postCommands user group;
}); });
@@ -292,13 +295,13 @@ in
flake.modules.homeManager.mtls = { config, lib, pkgs, ... }: flake.modules.homeManager.mtls = { config, lib, pkgs, ... }:
let let
cfg = config.mtls; cfg = config.mtls;
tlsKey = "${cfg.certDir}/${cfg.keyFilename}"; keyFile = cfg.keyFile;
tlsCert = "${cfg.certDir}/${cfg.certFilename}"; certFile = cfg.certFile;
mtlsBundle = "${cfg.certDir}/${cfg.bundleFilename}"; bundleFile = cfg.bundleFile;
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san; sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
in in
{ {
options.mtls = opts // { options.mtls = (mkOpts config) // {
certDir = lib.mkOption { certDir = lib.mkOption {
description = "String path to where the mtls certs will be stored."; description = "String path to where the mtls certs will be stored.";
type = lib.types.str; type = lib.types.str;
@@ -311,10 +314,10 @@ in
# step-cli # step-cli
(mkMtlsGenerateScript { (mkMtlsGenerateScript {
inherit (cfg) subject provisioner san lifetime; inherit (cfg) subject provisioner san lifetime;
inherit pkgs tlsCert tlsKey mtlsBundle; inherit pkgs certFile keyFile bundleFile;
}) })
(mkMtlsCheckScript { inherit pkgs mtlsBundle; }) (mkMtlsCheckScript { inherit pkgs bundleFile; })
(mkMtlsRenewScript { inherit pkgs tlsCert tlsKey mtlsBundle; }) (mkMtlsRenewScript { inherit pkgs certFile keyFile bundleFile; })
]; ];
systemd.user.tmpfiles.rules = lib.mkIf cfg.enable [ systemd.user.tmpfiles.rules = lib.mkIf cfg.enable [
@@ -322,7 +325,7 @@ in
]; ];
systemd.user.services.mtls-renew = lib.mkIf cfg.renew.enable (mkHomeManagerMtlsRenewService { systemd.user.services.mtls-renew = lib.mkIf cfg.renew.enable (mkHomeManagerMtlsRenewService {
inherit pkgs tlsCert tlsKey mtlsBundle; inherit pkgs certFile keyFile bundleFile;
inherit (cfg.renew) reloadUnits postCommands; inherit (cfg.renew) reloadUnits postCommands;
}); });
+12 -12
View File
@@ -19,6 +19,11 @@
type = lib.types.str; type = lib.types.str;
default = "john-ubuntu"; default = "john-ubuntu";
}; };
repoUrl = lib.mkOption {
description = "URL to the REST endpoint";
type = lib.types.str;
default = "rest:https://soteria.john-stream.com/${cfg.repoName}";
};
passwordFile = lib.mkOption { passwordFile = lib.mkOption {
description = "String path to the restic password file"; description = "String path to the restic password file";
type = lib.types.str; type = lib.types.str;
@@ -44,29 +49,24 @@
}; };
}; };
config = let config = {
resticRepository = "rest:https://soteria.john-stream.com/${cfg.repoName}";
caCert = "${config.mtls.certDir}/root_ca.crt";
mtlsBundle = "${config.mtls.certDir}/${config.mtls.bundleFilename}";
in
{
home.sessionVariables = { home.sessionVariables = {
RESTIC_REPOSITORY = resticRepository; RESTIC_REPOSITORY = cfg.repoUrl;
RESTIC_PASSWORD_FILE = cfg.passwordFile; RESTIC_PASSWORD_FILE = cfg.passwordFile;
RESTIC_CACERT = caCert; RESTIC_CACERT = config.mtls.caFile;
RESTIC_TLS_CLIENT_CERT = mtlsBundle; RESTIC_TLS_CLIENT_CERT = config.mtls.bundleFile;
}; };
# This is necessary because the restic service in home manager doesn't otherwise expose these options. # This is necessary because the restic service in home manager doesn't otherwise expose these options.
systemd.user.services."restic-backups-${cfg.repoName}".Service.Environment = [ systemd.user.services."restic-backups-${cfg.repoName}".Service.Environment = [
"RESTIC_CACERT=${caCert}" "RESTIC_CACERT=${config.mtls.caFile}"
"RESTIC_TLS_CLIENT_CERT=${mtlsBundle}" "RESTIC_TLS_CLIENT_CERT=${config.mtls.bundleFile}"
]; ];
services.restic = { services.restic = {
enable = true; enable = true;
backups.${cfg.repoName} = { backups.${cfg.repoName} = {
repository = resticRepository; repository = cfg.repoUrl;
passwordFile = cfg.passwordFile; passwordFile = cfg.passwordFile;
paths = cfg.paths; paths = cfg.paths;
timerConfig = { timerConfig = {
+6 -5
View File
@@ -6,7 +6,8 @@ let
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6"; fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
in in
{ {
flake.modules.nixos.janus-ca = { config, lib, ... }: flake.modules.nixos.janus-ca =
{ config, lib, ... }:
let let
johnHome = lib.attrByPath [ "users" "users" username "home" ] "/home/${username}" config; johnHome = lib.attrByPath [ "users" "users" username "home" ] "/home/${username}" config;
johnGroup = lib.attrByPath [ "users" "users" username "group" ] username config; johnGroup = lib.attrByPath [ "users" "users" username "group" ] username config;
@@ -17,12 +18,13 @@ in
"L+ ${home}/.step/config/defaults.json - - - - /etc/step/config/defaults.json" "L+ ${home}/.step/config/defaults.json - - - - /etc/step/config/defaults.json"
"L+ ${home}/.step/certs/root_ca.crt - - - - /etc/step/certs/root_ca.crt" "L+ ${home}/.step/certs/root_ca.crt - - - - /etc/step/certs/root_ca.crt"
]; ];
in { in
{
environment.etc."step/config/defaults.json".text = builtins.toJSON { environment.etc."step/config/defaults.json".text = builtins.toJSON {
inherit ca-url fingerprint; inherit ca-url fingerprint;
root = "/etc/step/certs/root_ca.crt"; root = "/etc/step-ca/certs/root_ca.crt";
}; };
environment.etc."step/certs/root_ca.crt".source = ./root_ca.crt; environment.etc."step-ca/certs/root_ca.crt".source = ./root_ca.crt;
systemd.tmpfiles.rules = systemd.tmpfiles.rules =
mkStepRules johnHome username johnGroup mkStepRules johnHome username johnGroup
++ mkStepRules "/root" "root" "root"; ++ mkStepRules "/root" "root" "root";
@@ -73,7 +75,6 @@ in
]; ];
}; };
flake-file.inputs = { flake-file.inputs = {
wrappers = { wrappers = {
url = "github:lassulus/wrappers"; url = "github:lassulus/wrappers";
@@ -5,6 +5,7 @@
hostname = "john-p14s"; hostname = "john-p14s";
homeDirectory = config.home-manager.users.john.home.homeDirectory; homeDirectory = config.home-manager.users.john.home.homeDirectory;
flakeDir = "${homeDirectory}/Documents/dendritic"; flakeDir = "${homeDirectory}/Documents/dendritic";
my-neovim = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim;
in in
{ {
imports = [ imports = [
@@ -40,6 +41,7 @@
busybox busybox
dig dig
samba samba
my-neovim
]; ];
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
@@ -122,7 +124,14 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
bash bash
discord discord
my-neovim
]; ];
ssh.matchSets = {
appdaemon = true;
homelab = true;
dev = true;
certs = true;
};
} }
]; ];
sops.defaultSopsFile = ./secrets.yaml; sops.defaultSopsFile = ./secrets.yaml;
-2
View File
@@ -12,8 +12,6 @@ in
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }: flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
let let
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic"; flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
certDir = "${config.mtls.certDir}";
mtlsBundle = "${certDir}/${config.mtls.bundleFilename}";
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt"; resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
testPushCmd = (pkgs.writeShellScriptBin "test-push" '' testPushCmd = (pkgs.writeShellScriptBin "test-push" ''
+1
View File
@@ -64,6 +64,7 @@ in
environment.systemPackages = [ environment.systemPackages = [
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.janus-ca inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.janus-ca
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim
]; ];
forgejo.enable = true; forgejo.enable = true;
+1 -1
View File
@@ -22,7 +22,7 @@
++ lib.optional isAdmin "wheel" ++ lib.optional isAdmin "wheel"
++ lib.optional config.virtualisation.docker.enable "docker" ++ lib.optional config.virtualisation.docker.enable "docker"
++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group ++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group
++ lib.optional (isAdmin && config.services.postgresql.enable) config.services.postgresql.group; ++ lib.optional (isAdmin && config.services.postgresql.enable) "postgres";
}; };
security.sudo-rs.enable = lib.mkIf isAdmin true; security.sudo-rs.enable = lib.mkIf isAdmin true;
+1
View File
@@ -43,6 +43,7 @@
shell-integration = "zsh"; shell-integration = "zsh";
shell-integration-features = [ "no-title" "sudo" ]; shell-integration-features = [ "no-title" "sudo" ];
gtk-single-instance = true; gtk-single-instance = true;
mouse-scroll-multiplier = 0.375;
window-position-x = 25; window-position-x = 25;
window-position-y = 25; window-position-y = 25;
+46 -13
View File
@@ -6,7 +6,7 @@
}; };
}; };
perSystem = { system, pkgs, ... }: { perSystem = { system, pkgs, config, ... }: {
packages.my-neovim = ((inputs.nvf.lib.neovimConfiguration { packages.my-neovim = ((inputs.nvf.lib.neovimConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
@@ -32,17 +32,28 @@
theme.name = "catppuccin"; theme.name = "catppuccin";
theme.style = "mocha"; theme.style = "mocha";
git = { git.enable = true;
enable = true; # git.neogit.enable = true;
};
# https://github.com/akinsho/toggleterm.nvim
terminal.toggleterm.enable = true;
terminal.toggleterm.lazygit.enable = true;
terminal.toggleterm.lazygit.direction = "float";
terminal.toggleterm.lazygit.mappings.open = "<C-g>";
utility.nix-develop.enable = true;
utility.oil-nvim.enable = true;
utility.oil-nvim.gitStatus.enable = true;
filetree.neo-tree = { filetree.neo-tree = {
enable = true; enable = true;
}; };
lazy = { # lazy = {
enable = true; # enable = true;
}; # };
# globals = { # globals = {
# SimpylFold_docstring_preview = 1; # SimpylFold_docstring_preview = 1;
@@ -102,16 +113,38 @@
keymaps = [ keymaps = [
{ {
key = "<leader>fd"; desc = "Edit key mappings";
mode = "n"; key = "<leader>ekm";
mode = [ "n" ];
silent = false; silent = false;
action = ":Telescope find_files"; action = "<cmd>:edit +/keymaps /home/john/.config/home-manager/jsl-dendritic/modules/programs/neovim.nix<CR>";
} }
{ {
key = "<C-b>"; desc = "Home Manager Switch";
key = "<leader>nhms";
mode = [ "n" ];
silent = false;
action = "<cmd>:TermExec cmd='clear && nhms && exit' name='Nix Home Manager Switch' direction=float<CR>";
}
{
desc = "Key Maps [Telescope]";
key = "<leader>fkm";
mode = "n"; mode = "n";
silent = true; silent = false;
action = ":Neotree"; action = "<cmd>:Telescope keymaps<CR>";
}
{
desc = "Toggle Filesystem Tree [NeoTree]";
key = "<C-b>";
mode = [ "n" "v" "t" ];
silent = false;
action = "<cmd>:Neotree toggle filesystem left action=show<CR>";
}
{
key = "<C-`>";
mode = ["n" "v" "t"];
silent = false;
action = "<cmd>:ToggleTerm<CR>";
} }
]; ];
}; };
+4
View File
@@ -127,6 +127,10 @@ in
matchBlocks = lib.mkMerge [ matchBlocks = lib.mkMerge [
{ {
"john-pc-ubuntu" = {
hostname = "192.168.1.85";
};
"*" = lib.mkMerge [ "*" = lib.mkMerge [
{ {
user = "john"; user = "john";