format with alejandra style
This commit is contained in:
parent
02a87f0294
commit
9439acf4d1
60
flake.nix
60
flake.nix
|
@ -22,27 +22,42 @@
|
|||
kubenix.url = "github:hall/kubenix";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixos-generators, nixinate, home-manager, agenix, terranix, alertmanager-ntfy, nixpkgs-wayland, kubenix, kde2nix }@inputs:
|
||||
let
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixos-generators,
|
||||
nixinate,
|
||||
home-manager,
|
||||
agenix,
|
||||
terranix,
|
||||
alertmanager-ntfy,
|
||||
nixpkgs-wayland,
|
||||
kubenix,
|
||||
kde2nix,
|
||||
} @ inputs: let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
tf = terranix.lib.terranixConfiguration {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./terraform/main.nix ];
|
||||
modules = [./terraform/main.nix];
|
||||
};
|
||||
in {
|
||||
devShells.x86_64-linux.default = with pkgs; mkShell {
|
||||
shellHook =
|
||||
''
|
||||
devShells.x86_64-linux.default = with pkgs;
|
||||
mkShell {
|
||||
shellHook = ''
|
||||
set -o allexport
|
||||
source .env set
|
||||
set +o allexport
|
||||
'';
|
||||
nativeBuildInputs = [
|
||||
jq opentofu kubectl
|
||||
k9s terraform-ls kubernetes-helm
|
||||
jq
|
||||
opentofu
|
||||
kubectl
|
||||
k9s
|
||||
terraform-ls
|
||||
kubernetes-helm
|
||||
nil
|
||||
];
|
||||
buildInputs = [ ];
|
||||
buildInputs = [];
|
||||
};
|
||||
packages.aarch64-linux = {
|
||||
raspberry-pi = nixos-generators.nixosGenerate {
|
||||
|
@ -55,15 +70,22 @@
|
|||
};
|
||||
};
|
||||
packages.x86_64-linux = {
|
||||
kubernetes = (kubenix.evalModules.x86_64-linux {
|
||||
module = { kubenix, ... }: {
|
||||
kubernetes =
|
||||
(kubenix.evalModules.x86_64-linux {
|
||||
module = {kubenix, ...}: {
|
||||
imports = [
|
||||
kubenix.modules.k8s ./homelab/kubernetes.nix
|
||||
kubenix.modules.k8s
|
||||
./homelab/kubernetes.nix
|
||||
];
|
||||
};
|
||||
}).config.kubernetes.result;
|
||||
})
|
||||
.config
|
||||
.kubernetes
|
||||
.result;
|
||||
};
|
||||
apps = nixinate.nixinate.x86_64-linux self // {
|
||||
apps =
|
||||
nixinate.nixinate.x86_64-linux self
|
||||
// {
|
||||
x86_64-linux = {
|
||||
kube-apply = {
|
||||
type = "app";
|
||||
|
@ -100,7 +122,7 @@
|
|||
|
||||
homeConfigurations."gsimmer" = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./nix/london/gsimmer.nix ];
|
||||
modules = [./nix/london/gsimmer.nix];
|
||||
};
|
||||
nixosConfigurations = {
|
||||
london = nixpkgs.lib.nixosSystem {
|
||||
|
@ -113,8 +135,12 @@
|
|||
home-manager.useUserPackages = true;
|
||||
home-manager.users.gsimmer = import ./nix/london/gsimmer.nix;
|
||||
}
|
||||
({pkgs, config, ... }:
|
||||
(
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
config = {
|
||||
nix.settings = {
|
||||
# add binary caches
|
||||
|
@ -131,7 +157,7 @@
|
|||
};
|
||||
|
||||
# use it as an overlay
|
||||
nixpkgs.overlays = [ nixpkgs-wayland.overlay ];
|
||||
nixpkgs.overlays = [nixpkgs-wayland.overlay];
|
||||
};
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, kubenix, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: {
|
||||
kubernetes.helm.releases.cloudflare-exporter = {
|
||||
namespace = "default";
|
||||
chart = kubenix.lib.helm.fetch {
|
||||
|
|
|
@ -2,7 +2,7 @@ let
|
|||
appName = "conduwuit";
|
||||
conduwuit-Image = "git.gmem.ca/arch/conduwuit:latest";
|
||||
in
|
||||
{ ... }: {
|
||||
{...}: {
|
||||
kubernetes.resources.services.conduwuit = {
|
||||
spec = {
|
||||
selector.app = appName;
|
||||
|
@ -27,9 +27,15 @@ in
|
|||
imagePullPolicy = "Always";
|
||||
ports.http.containerPort = 6167;
|
||||
volumeMounts = [
|
||||
{ name = "data"; mountPath = "/var/lib/matrix-conduit"; }
|
||||
{ name = "config"; mountPath = "/etc/matrix-conduit/conduit.toml";
|
||||
subPath = "conduit.toml"; }
|
||||
{
|
||||
name = "data";
|
||||
mountPath = "/var/lib/matrix-conduit";
|
||||
}
|
||||
{
|
||||
name = "config";
|
||||
mountPath = "/etc/matrix-conduit/conduit.toml";
|
||||
subPath = "conduit.toml";
|
||||
}
|
||||
];
|
||||
env.CONDUIT_CONFIG.value = "/etc/matrix-conduit/conduit.toml";
|
||||
};
|
||||
|
@ -37,10 +43,11 @@ in
|
|||
};
|
||||
};
|
||||
volumeClaimTemplates = [
|
||||
{ metadata.name = "data";
|
||||
{
|
||||
metadata.name = "data";
|
||||
spec = {
|
||||
storageClassName = "nfs-client";
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
resources.requests.storage = "5Gi";
|
||||
};
|
||||
}
|
||||
|
@ -54,15 +61,23 @@ in
|
|||
};
|
||||
};
|
||||
spec = {
|
||||
tls = [ { hosts = [ "chat.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["chat.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
host = "chat.gmem.ca";
|
||||
http.paths = [
|
||||
{ path = "/"; pathType = "Prefix";
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = appName;
|
||||
port.name = "http"; };
|
||||
port.name = "http";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -76,8 +91,7 @@ in
|
|||
"cert-manager.io/issuer" = "le-issuer";
|
||||
};
|
||||
};
|
||||
data."conduit.toml" =
|
||||
''
|
||||
data."conduit.toml" = ''
|
||||
[global]
|
||||
# The Conduit server needs all /_matrix/ requests to be reachable at
|
||||
# https://your.server.name/ on port 443 (client-server) and 8448 (federation).
|
||||
|
@ -94,4 +108,4 @@ in
|
|||
address = "0.0.0.0"
|
||||
'';
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }: {
|
||||
kubernetes.resourceOrder =
|
||||
[ "CustomResourceDefinition"
|
||||
{lib, ...}: {
|
||||
kubernetes.resourceOrder = [
|
||||
"CustomResourceDefinition"
|
||||
"Namespace"
|
||||
"ConfigMap"
|
||||
];
|
||||
|
|
|
@ -26,36 +26,65 @@ let
|
|||
};
|
||||
};
|
||||
in {
|
||||
kubernetes.resources.services = builtins.mapAttrs (name: endpoint: {
|
||||
kubernetes.resources.services =
|
||||
builtins.mapAttrs (name: endpoint: {
|
||||
spec = {
|
||||
ports.${name} = {
|
||||
port = endpoint.port;
|
||||
targetPort = endpoint.port;
|
||||
};
|
||||
};
|
||||
}) endpoints;
|
||||
kubernetes.resources.endpoints = builtins.mapAttrs (name: endpoint: {
|
||||
subsets = [ {
|
||||
addresses = [ { ip = endpoint.location; } ];
|
||||
ports = [ { name = name; port = endpoint.port; protocol = "TCP"; } ];
|
||||
} ];
|
||||
}) endpoints;
|
||||
kubernetes.resources.ingresses = builtins.mapAttrs (name: endpoint: {
|
||||
metadata = { name = name; annotations = {
|
||||
})
|
||||
endpoints;
|
||||
kubernetes.resources.endpoints =
|
||||
builtins.mapAttrs (name: endpoint: {
|
||||
subsets = [
|
||||
{
|
||||
addresses = [{ip = endpoint.location;}];
|
||||
ports = [
|
||||
{
|
||||
name = name;
|
||||
port = endpoint.port;
|
||||
protocol = "TCP";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
})
|
||||
endpoints;
|
||||
kubernetes.resources.ingresses =
|
||||
builtins.mapAttrs (name: endpoint: {
|
||||
metadata = {
|
||||
name = name;
|
||||
annotations = {
|
||||
"nginx.ingress.kubernetes.io/proxy-body-size" = "10g";
|
||||
"cert-manager.io/issuer" = "le-issuer";
|
||||
"nginx.ingress.kubernetes.io/backend-protocol" = endpoint.protocol;
|
||||
}; };
|
||||
};
|
||||
};
|
||||
spec = {
|
||||
tls = [ { hosts = [ endpoint.host ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
rules = [ { host = endpoint.host; http.paths = [
|
||||
{ path = "/"; pathType = "Prefix";
|
||||
tls = [
|
||||
{
|
||||
hosts = [endpoint.host];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
host = endpoint.host;
|
||||
http.paths = [
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = name;
|
||||
port.number = endpoint.port;
|
||||
};
|
||||
}
|
||||
];}];
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}) endpoints;
|
||||
})
|
||||
endpoints;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
{ lib, config, kubenix, ... }:
|
||||
let homepage-config = {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: let
|
||||
homepage-config = {
|
||||
bookmarks = [];
|
||||
services = [
|
||||
{
|
||||
Media = [
|
||||
{ Plex = {
|
||||
{
|
||||
Plex = {
|
||||
icon = "plex.png";
|
||||
href = "https://app.plex.tv";
|
||||
description = "Plex";
|
||||
|
@ -15,7 +21,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ Overseerr = {
|
||||
{
|
||||
Overseerr = {
|
||||
icon = "overseerr.png";
|
||||
href = "https://request-media.gmem.ca";
|
||||
description = "Request movies and TV shows";
|
||||
|
@ -26,7 +33,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ Transmission = {
|
||||
{
|
||||
Transmission = {
|
||||
icon = "transmission.png";
|
||||
description = "Download progress for torrents";
|
||||
widget = {
|
||||
|
@ -39,25 +47,29 @@ let homepage-config = {
|
|||
}
|
||||
{
|
||||
"Personal Infrastructure" = [
|
||||
{ authentik = {
|
||||
{
|
||||
authentik = {
|
||||
icon = "authentik.png";
|
||||
href = "https://authentik.gmem.ca";
|
||||
description = "OIDC SSO";
|
||||
};
|
||||
}
|
||||
{ Tailscale = {
|
||||
{
|
||||
Tailscale = {
|
||||
icon = "tailscale.png";
|
||||
href = "https://login.tailscale.com";
|
||||
description = "VPN provider";
|
||||
};
|
||||
}
|
||||
{ Git = {
|
||||
{
|
||||
Git = {
|
||||
icon = "forgejo.png";
|
||||
href = "https://git.gmem.ca";
|
||||
description = "Git forge";
|
||||
};
|
||||
}
|
||||
{ Grafana = {
|
||||
{
|
||||
Grafana = {
|
||||
icon = "grafana.png";
|
||||
href = "https://grafana.gmem.ca";
|
||||
description = "Monitoring & metrics";
|
||||
|
@ -69,7 +81,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ NextDNS = {
|
||||
{
|
||||
NextDNS = {
|
||||
icon = "nextdns.png";
|
||||
href = "https://my.nextdns.io/bcee89/setup";
|
||||
description = "DNS provider";
|
||||
|
@ -80,7 +93,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ "Proxmox" = {
|
||||
{
|
||||
"Proxmox" = {
|
||||
icon = "proxmox.png";
|
||||
href = "https://proxmox.gmem.ca";
|
||||
description = "Homelab proxmox";
|
||||
|
@ -92,7 +106,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ "Immich" = {
|
||||
{
|
||||
"Immich" = {
|
||||
icon = "immich.png";
|
||||
href = "https://photos.gmem.ca";
|
||||
description = "Image hosting";
|
||||
|
@ -103,7 +118,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ "NextDNS Tailscale" = {
|
||||
{
|
||||
"NextDNS Tailscale" = {
|
||||
icon = "nextdns.png";
|
||||
href = "https://my.nextdns.io/74c6db/setup";
|
||||
description = "Tailnet DNS provider";
|
||||
|
@ -118,7 +134,8 @@ let homepage-config = {
|
|||
}
|
||||
{
|
||||
Reading = [
|
||||
{ FreshRSS = {
|
||||
{
|
||||
FreshRSS = {
|
||||
icon = "freshrss.png";
|
||||
href = "https://freshrss.gmem.ca";
|
||||
description = "FreshRSS RSS Reader";
|
||||
|
@ -130,12 +147,14 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ "Lobste.rs" = {
|
||||
{
|
||||
"Lobste.rs" = {
|
||||
href = "https://lobste.rs";
|
||||
description = "News aggregator";
|
||||
};
|
||||
}
|
||||
{ "Hacker News" = {
|
||||
{
|
||||
"Hacker News" = {
|
||||
href = "https://news.ycombinator.com";
|
||||
description = "VC news aggregator";
|
||||
};
|
||||
|
@ -144,7 +163,8 @@ let homepage-config = {
|
|||
}
|
||||
{
|
||||
"Floofy.tech Infrastructure" = [
|
||||
{ Mastodon = {
|
||||
{
|
||||
Mastodon = {
|
||||
icon = "mastodon.png";
|
||||
href = "https://floofy.tech";
|
||||
description = "Primary Mastodon instance";
|
||||
|
@ -154,19 +174,22 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ Grafana = {
|
||||
{
|
||||
Grafana = {
|
||||
icon = "grafana.png";
|
||||
href = "https://grafana.services.floofy.tech";
|
||||
description = "Metrics and Monitoring";
|
||||
};
|
||||
}
|
||||
{ vSphere = {
|
||||
{
|
||||
vSphere = {
|
||||
icon = "vmware-esxi.png";
|
||||
href = "https://vcenter.services.floofy.tech";
|
||||
description = "Hypervisor Manager";
|
||||
};
|
||||
}
|
||||
{ "vrclub.social" = {
|
||||
{
|
||||
"vrclub.social" = {
|
||||
icon = "calckey.png";
|
||||
href = "https://vrclub.social";
|
||||
description = "Firefish instance for VR clubs";
|
||||
|
@ -176,13 +199,15 @@ let homepage-config = {
|
|||
}
|
||||
{
|
||||
"Tools" = [
|
||||
{ "IT Tools" = {
|
||||
{
|
||||
"IT Tools" = {
|
||||
icon = "it-tools.png";
|
||||
href = "https://tools.gmem.ca";
|
||||
description = "Various useful tools";
|
||||
};
|
||||
}
|
||||
{ Cyberchef = {
|
||||
{
|
||||
Cyberchef = {
|
||||
icon = "cyberchef.png";
|
||||
href = "https://gchq.github.io/CyberChef/";
|
||||
description = "More useful tools, mostly text manipulation";
|
||||
|
@ -192,7 +217,8 @@ let homepage-config = {
|
|||
}
|
||||
{
|
||||
"Backup Status" = [
|
||||
{ "gsimmer backups" = {
|
||||
{
|
||||
"gsimmer backups" = {
|
||||
icon = "healthchecks.png";
|
||||
href = "https://healthchecks.gmem.ca";
|
||||
description = "Uptime monitor for recurring tasks";
|
||||
|
@ -204,7 +230,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ "becki backups" = {
|
||||
{
|
||||
"becki backups" = {
|
||||
icon = "healthchecks.png";
|
||||
href = "https://healthchecks.gmem.ca";
|
||||
description = "Uptime monitor for recurring tasks";
|
||||
|
@ -216,7 +243,8 @@ let homepage-config = {
|
|||
};
|
||||
};
|
||||
}
|
||||
{ "apps backups" = {
|
||||
{
|
||||
"apps backups" = {
|
||||
icon = "healthchecks.png";
|
||||
href = "https://healthchecks.gmem.ca";
|
||||
description = "Uptime monitor for recurring tasks";
|
||||
|
@ -272,8 +300,7 @@ let homepage-config = {
|
|||
}
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
kubernetes.helm.releases.homepage = {
|
||||
chart = kubenix.lib.helm.fetch {
|
||||
repo = "https://jameswynn.github.io/helm-charts";
|
||||
|
@ -307,7 +334,7 @@ in
|
|||
];
|
||||
tls = [
|
||||
{
|
||||
hosts = [ "home.gmem.ca" ];
|
||||
hosts = ["home.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
|
@ -319,8 +346,8 @@ in
|
|||
metadata.namespace = "default";
|
||||
|
||||
spec.template = {
|
||||
metadata.annotations."gmem.ca/homepage-config-hash" = (builtins.hashString "md5" (builtins.toJSON homepage-config));
|
||||
spec.containers.homepage.envFrom = [ { secretRef.name = "homepage-config"; } ];
|
||||
metadata.annotations."gmem.ca/homepage-config-hash" = builtins.hashString "md5" (builtins.toJSON homepage-config);
|
||||
spec.containers.homepage.envFrom = [{secretRef.name = "homepage-config";}];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, kubenix, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: {
|
||||
kubernetes.helm.releases.immich = {
|
||||
chart = kubenix.lib.helm.fetch {
|
||||
repo = "https://immich-app.github.io/immich-charts";
|
||||
|
@ -24,11 +29,16 @@
|
|||
annotations = {
|
||||
"cert-manager.io/issuer" = "le-issuer";
|
||||
};
|
||||
tls = [ { hosts = [ "photos.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["photos.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
hosts = [
|
||||
{
|
||||
host = "photos.gmem.ca";
|
||||
paths = [ { path = "/"; } ];
|
||||
paths = [{path = "/";}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -2,8 +2,7 @@ let
|
|||
appName = "soju";
|
||||
sojuImage = "git.gmem.ca/arch/soju:latest";
|
||||
gamjaImage = "git.gmem.ca/arch/gamja:latest";
|
||||
in
|
||||
{
|
||||
in {
|
||||
kubernetes.resources.services.soju = {
|
||||
spec = {
|
||||
type = "NodePort";
|
||||
|
@ -45,8 +44,17 @@ in
|
|||
soju = {
|
||||
image = sojuImage;
|
||||
imagePullPolicy = "Always";
|
||||
volumeMounts = [ { name = "config"; mountPath = "/etc/soju/config"; subPath = "config"; }
|
||||
{ name = "ssl"; mountPath = "/ssl"; } ];
|
||||
volumeMounts = [
|
||||
{
|
||||
name = "config";
|
||||
mountPath = "/etc/soju/config";
|
||||
subPath = "config";
|
||||
}
|
||||
{
|
||||
name = "ssl";
|
||||
mountPath = "/ssl";
|
||||
}
|
||||
];
|
||||
ports.tls.containerPort = 6697;
|
||||
ports.ws.containerPort = 80;
|
||||
|
||||
|
@ -92,32 +100,46 @@ in
|
|||
"cert-manager.io/issuer" = "le-issuer";
|
||||
};
|
||||
spec = {
|
||||
tls = [ { hosts = [ "irc.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
rules = [ { host = "irc.gmem.ca"; http.paths = [
|
||||
{ path = "/"; pathType = "Prefix";
|
||||
tls = [
|
||||
{
|
||||
hosts = ["irc.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
host = "irc.gmem.ca";
|
||||
http.paths = [
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = "gamja";
|
||||
port.number = 80;
|
||||
};
|
||||
}
|
||||
{ path = "/socket"; pathType = "Prefix";
|
||||
{
|
||||
path = "/socket";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = "soju-ws";
|
||||
port.number = 80;
|
||||
};
|
||||
}
|
||||
];}];
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
kubernetes.resources.configMaps.soju.data.config = ''
|
||||
listen ircs://
|
||||
listen unix+admin:///app/admin
|
||||
listen ws+insecure://
|
||||
hostname irc.gmem.ca
|
||||
title irc.gmem.ca
|
||||
db postgres "dbname=soju"
|
||||
message-store db
|
||||
tls /ssl/tls.crt /ssl/tls.key
|
||||
listen ircs://
|
||||
listen unix+admin:///app/admin
|
||||
listen ws+insecure://
|
||||
hostname irc.gmem.ca
|
||||
title irc.gmem.ca
|
||||
db postgres "dbname=soju"
|
||||
message-store db
|
||||
tls /ssl/tls.crt /ssl/tls.key
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
{ lib, config, kubenix, ... }: {
|
||||
imports = [ kubenix.modules.k8s kubenix.modules.helm
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
kubenix.modules.k8s
|
||||
kubenix.modules.helm
|
||||
(import ./custom.nix)
|
||||
(import ./nginx.nix)
|
||||
(import ./tclip.nix)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
let
|
||||
appName = "netbootxyz";
|
||||
netbootxyzImage = "ghcr.io/netbootxyz/netbootxyz";
|
||||
in
|
||||
{
|
||||
in {
|
||||
kubernetes.resources.services.netbootxyz = {
|
||||
spec = {
|
||||
selector.app = appName;
|
||||
|
@ -35,16 +34,28 @@ in
|
|||
metadata.labels.app = appName;
|
||||
spec = {
|
||||
volumes = [
|
||||
{ name = "config"; persistentVolumeClaim.claimName = "netbootxyz-config"; }
|
||||
{ name = "assets"; persistentVolumeClaim.claimName = "netbootxyz-assets"; }
|
||||
{
|
||||
name = "config";
|
||||
persistentVolumeClaim.claimName = "netbootxyz-config";
|
||||
}
|
||||
{
|
||||
name = "assets";
|
||||
persistentVolumeClaim.claimName = "netbootxyz-assets";
|
||||
}
|
||||
];
|
||||
containers = {
|
||||
netbootxyz = {
|
||||
image = netbootxyzImage;
|
||||
imagePullPolicy = "Always";
|
||||
volumeMounts = [
|
||||
{ mountPath = "/config"; name = "config"; }
|
||||
{ mountPath = "/assets"; name = "assets"; }
|
||||
{
|
||||
mountPath = "/config";
|
||||
name = "config";
|
||||
}
|
||||
{
|
||||
mountPath = "/assets";
|
||||
name = "assets";
|
||||
}
|
||||
];
|
||||
env.SUBFOLDER.value = "/ui/";
|
||||
ports.http.containerPort = 80;
|
||||
|
@ -62,12 +73,12 @@ in
|
|||
kubernetes.resources.persistentVolumeClaims.netbootxyz-config.spec = {
|
||||
resources.requests.storage = "1Gi";
|
||||
volumeMode = "Filesystem";
|
||||
accessModes = [ "ReadWriteMany" ];
|
||||
accessModes = ["ReadWriteMany"];
|
||||
};
|
||||
kubernetes.resources.persistentVolumeClaims.netbootxyz-assets.spec = {
|
||||
resources.requests.storage = "10Gi";
|
||||
volumeMode = "Filesystem";
|
||||
accessModes = [ "ReadWriteMany" ];
|
||||
accessModes = ["ReadWriteMany"];
|
||||
};
|
||||
|
||||
kubernetes.resources.ingresses.netbootxyz = {
|
||||
|
@ -76,22 +87,35 @@ in
|
|||
"nginx.ingress.kubernetes.io/ssl-redirect" = "false";
|
||||
};
|
||||
spec = {
|
||||
tls = [ { hosts = [ "netboot.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
rules = [ { host = "netboot.gmem.ca"; http.paths = [
|
||||
{ path = "/ui"; pathType = "Prefix";
|
||||
tls = [
|
||||
{
|
||||
hosts = ["netboot.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
host = "netboot.gmem.ca";
|
||||
http.paths = [
|
||||
{
|
||||
path = "/ui";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = "netbootxyz";
|
||||
port.number = 3000;
|
||||
};
|
||||
}
|
||||
{ path = "/"; pathType = "Prefix";
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = "netbootxyz";
|
||||
port.number = 80;
|
||||
};
|
||||
}
|
||||
];}];
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, kubenix, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: {
|
||||
kubernetes.helm.releases.ingress-nginx = {
|
||||
namespace = "ingress-nginx";
|
||||
chart = kubenix.lib.helm.fetch {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
let
|
||||
appName = "overseerr";
|
||||
appImage = "sctx/overseerr";
|
||||
in
|
||||
{
|
||||
in {
|
||||
kubernetes.resources.services.overseerr = {
|
||||
spec = {
|
||||
selector.app = appName;
|
||||
|
@ -25,7 +24,10 @@ in
|
|||
overseerr = {
|
||||
image = appImage;
|
||||
volumeMounts = [
|
||||
{ name = "data"; mountPath = "/app/config"; }
|
||||
{
|
||||
name = "data";
|
||||
mountPath = "/app/config";
|
||||
}
|
||||
];
|
||||
ports.metrics.containerPort = 5055;
|
||||
resources = {
|
||||
|
@ -43,10 +45,11 @@ in
|
|||
};
|
||||
};
|
||||
volumeClaimTemplates = [
|
||||
{ metadata.name = "data";
|
||||
{
|
||||
metadata.name = "data";
|
||||
spec = {
|
||||
storageClassName = "nfs-client";
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
resources.requests.storage = "1Gi";
|
||||
};
|
||||
}
|
||||
|
@ -60,15 +63,23 @@ in
|
|||
};
|
||||
};
|
||||
spec = {
|
||||
tls = [ { hosts = [ "request-media.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["request-media.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
host = "request-media.gmem.ca";
|
||||
http.paths = [
|
||||
{ path = "/"; pathType = "Prefix";
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = appName;
|
||||
port.name = "http"; };
|
||||
port.name = "http";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, kubenix, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: {
|
||||
kubernetes.helm.releases.piped = {
|
||||
namespace = "default";
|
||||
chart = kubenix.lib.helm.fetch {
|
||||
|
@ -20,24 +25,48 @@
|
|||
password = "password";
|
||||
};
|
||||
};
|
||||
fontend.env.BACKEND_HOSTNAME= "pipedapi.gmem.ca";
|
||||
fontend.env.BACKEND_HOSTNAME = "pipedapi.gmem.ca";
|
||||
ingress = {
|
||||
main = {
|
||||
tls = [ { hosts = [ "piped.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["piped.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
hosts = [
|
||||
{ host = "piped.gmem.ca"; paths = [ { path = "/"; } ]; }
|
||||
{
|
||||
host = "piped.gmem.ca";
|
||||
paths = [{path = "/";}];
|
||||
}
|
||||
];
|
||||
};
|
||||
backend = {
|
||||
tls = [ { hosts = [ "pipedapi.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["pipedapi.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
hosts = [
|
||||
{ host = "pipedapi.gmem.ca"; paths = [ { path = "/"; } ]; }
|
||||
{
|
||||
host = "pipedapi.gmem.ca";
|
||||
paths = [{path = "/";}];
|
||||
}
|
||||
];
|
||||
};
|
||||
ytproxy = {
|
||||
tls = [ { hosts = [ "ytproxy.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["ytproxy.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
hosts = [
|
||||
{ host = "ytproxy.gmem.ca"; paths = [ { path = "/"; } ]; }
|
||||
{
|
||||
host = "ytproxy.gmem.ca";
|
||||
paths = [{path = "/";}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
@ -50,7 +79,7 @@
|
|||
restartPolicy = "Never";
|
||||
containers.refresh-subscriptions = {
|
||||
image = "alpine:3.15";
|
||||
envFrom = [ { secretRef.name = "hippo-pguser-piped"; } ];
|
||||
envFrom = [{secretRef.name = "hippo-pguser-piped";}];
|
||||
command = [
|
||||
"/bin/ash"
|
||||
"-c"
|
||||
|
|
|
@ -2,7 +2,12 @@ let
|
|||
appName = "pterodactyl-panel";
|
||||
pterodactyl-panel-Image = "git.gmem.ca/arch/pterodactyl-panel:latest";
|
||||
in
|
||||
{ lib, config, kubenix, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
kubenix,
|
||||
...
|
||||
}: {
|
||||
kubernetes.resources.services.pterodactyl-panel = {
|
||||
spec = {
|
||||
selector.app = appName;
|
||||
|
@ -24,18 +29,22 @@ in
|
|||
imagePullPolicy = "Always";
|
||||
ports.http.containerPort = 8080;
|
||||
volumeMounts = [
|
||||
{ name = "data"; mountPath = "/var/www/pterodactyl/storage/app"; }
|
||||
{
|
||||
name = "data";
|
||||
mountPath = "/var/www/pterodactyl/storage/app";
|
||||
}
|
||||
];
|
||||
envFrom = [ { secretRef.name = "pterodactyl"; } ];
|
||||
envFrom = [{secretRef.name = "pterodactyl";}];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
volumeClaimTemplates = [
|
||||
{ metadata.name = "data";
|
||||
{
|
||||
metadata.name = "data";
|
||||
spec = {
|
||||
storageClassName = "nfs-client";
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
resources.requests.storage = "1Gi";
|
||||
};
|
||||
}
|
||||
|
@ -61,19 +70,27 @@ in
|
|||
};
|
||||
};
|
||||
spec = {
|
||||
tls = [ { hosts = [ "games.gmem.ca" ]; secretName = "gmem-ca-wildcard"; } ];
|
||||
tls = [
|
||||
{
|
||||
hosts = ["games.gmem.ca"];
|
||||
secretName = "gmem-ca-wildcard";
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
host = "games.gmem.ca";
|
||||
http.paths = [
|
||||
{ path = "/"; pathType = "Prefix";
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
backend.service = {
|
||||
name = appName;
|
||||
port.name = "http"; };
|
||||
port.name = "http";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,16 @@ let
|
|||
appName = "tclip";
|
||||
litestreamImage = "litestream/litestream:sha-749bc0d";
|
||||
tclipImage = "git.gmem.ca/arch/tclip:arm";
|
||||
in
|
||||
{
|
||||
in {
|
||||
kubernetes.resources."monitoring.coreos.com"."v1".ServiceMonitor.tclip = {
|
||||
spec = {
|
||||
selector.matchLabels.app = appName;
|
||||
endpoints = [ { port = "metrics"; interval = "30s"; } ];
|
||||
endpoints = [
|
||||
{
|
||||
port = "metrics";
|
||||
interval = "30s";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
kubernetes.resources.services.tclip = {
|
||||
|
@ -36,41 +40,67 @@ in
|
|||
};
|
||||
initContainers.init-litestream = {
|
||||
image = litestreamImage;
|
||||
args = ["restore" "-if-db-not-exists" "-if-replica-exists" "-v" "/data/data.db" ];
|
||||
args = ["restore" "-if-db-not-exists" "-if-replica-exists" "-v" "/data/data.db"];
|
||||
volumeMounts = [
|
||||
{ name = "data"; mountPath = "/data"; }
|
||||
{ name = "litestream"; mountPath = "/etc/litestream.yml"; subPath = "tclip.yml"; }
|
||||
{
|
||||
name = "data";
|
||||
mountPath = "/data";
|
||||
}
|
||||
{
|
||||
name = "litestream";
|
||||
mountPath = "/etc/litestream.yml";
|
||||
subPath = "tclip.yml";
|
||||
}
|
||||
];
|
||||
envFrom = [ { secretRef.name = "tclip-litestream-s3"; } ];
|
||||
envFrom = [{secretRef.name = "tclip-litestream-s3";}];
|
||||
};
|
||||
containers = {
|
||||
tclip = {
|
||||
image = tclipImage;
|
||||
imagePullPolicy = "Always";
|
||||
volumeMounts = [ { name = "data"; mountPath = "/data"; } ];
|
||||
volumeMounts = [
|
||||
{
|
||||
name = "data";
|
||||
mountPath = "/data";
|
||||
}
|
||||
];
|
||||
env = [
|
||||
{ name = "DATA_DIR"; value = "/data"; }
|
||||
{ name = "USE_FUNNEL"; value = "true"; }
|
||||
{
|
||||
name = "DATA_DIR";
|
||||
value = "/data";
|
||||
}
|
||||
{
|
||||
name = "USE_FUNNEL";
|
||||
value = "true";
|
||||
}
|
||||
];
|
||||
};
|
||||
litestream = {
|
||||
image = litestreamImage;
|
||||
args = [ "replicate" ];
|
||||
args = ["replicate"];
|
||||
volumeMounts = [
|
||||
{ name = "data"; mountPath = "/data"; }
|
||||
{ name = "litestream"; mountPath = "/etc/litestream.yml"; subPath = "tclip.yml"; }
|
||||
{
|
||||
name = "data";
|
||||
mountPath = "/data";
|
||||
}
|
||||
{
|
||||
name = "litestream";
|
||||
mountPath = "/etc/litestream.yml";
|
||||
subPath = "tclip.yml";
|
||||
}
|
||||
];
|
||||
envFrom = [ { secretRef.name = "tclip-litestream-s3"; } ];
|
||||
envFrom = [{secretRef.name = "tclip-litestream-s3";}];
|
||||
ports.metrics.containerPort = 9090;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
volumeClaimTemplates = [
|
||||
{ metadata.name = "data";
|
||||
{
|
||||
metadata.name = "data";
|
||||
spec = {
|
||||
storageClassName = "nfs-client";
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
resources.requests.storage = "1Gi";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
let
|
||||
appName = "vrchat-prometheus-exporter";
|
||||
appImage = "git.gmem.ca/arch/vrchat-prometheus-adapter:arm";
|
||||
in
|
||||
{
|
||||
in {
|
||||
kubernetes.resources."monitoring.coreos.com"."v1".ServiceMonitor.vrchat-prometheus-adapter = {
|
||||
spec = {
|
||||
selector.matchLabels.app = appName;
|
||||
endpoints = [ { port = "metrics"; interval = "60s"; } ];
|
||||
endpoints = [
|
||||
{
|
||||
port = "metrics";
|
||||
interval = "60s";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
kubernetes.resources.services.vrchat-prometheus-adapter = {
|
||||
|
@ -35,8 +39,14 @@ in
|
|||
vrchat-prometheus-adapter = {
|
||||
image = appImage;
|
||||
imagePullPolicy = "Always";
|
||||
volumeMounts = [ { name = "config"; mountPath = "/config.toml"; subPath = "config.toml"; } ];
|
||||
envFrom = [ { secretRef.name = "vrchat-prometheus-adapter"; } ];
|
||||
volumeMounts = [
|
||||
{
|
||||
name = "config";
|
||||
mountPath = "/config.toml";
|
||||
subPath = "config.toml";
|
||||
}
|
||||
];
|
||||
envFrom = [{secretRef.name = "vrchat-prometheus-adapter";}];
|
||||
ports.metrics.containerPort = 6534;
|
||||
resources = {
|
||||
requests = {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
|
@ -12,20 +14,19 @@
|
|||
};
|
||||
|
||||
boot = {
|
||||
supportedFilesystems = [ "nfs" ];
|
||||
supportedFilesystems = ["nfs"];
|
||||
kernelPackages = pkgs.linuxPackages_rpi4;
|
||||
kernelParams = [ "cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1" ];
|
||||
kernelParams = ["cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1"];
|
||||
loader = {
|
||||
grub.enable = false;
|
||||
generic-extlinux-compatible.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 8*1024;
|
||||
size = 8 * 1024;
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -52,8 +53,8 @@
|
|||
firewall = {
|
||||
trustedInterfaces = ["tailscale0"];
|
||||
checkReversePath = "loose";
|
||||
allowedUDPPorts = [ 41641 ];
|
||||
allowedTCPPorts = [ 22 80 443 6443 10250 ];
|
||||
allowedUDPPorts = [41641];
|
||||
allowedTCPPorts = [22 80 443 6443 10250];
|
||||
enable = false;
|
||||
};
|
||||
nftables.enable = false;
|
||||
|
@ -63,7 +64,7 @@
|
|||
|
||||
users.users.gsimmer = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
extraGroups = ["wheel"];
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
];
|
||||
|
@ -72,7 +73,8 @@
|
|||
url = "https://gmem.ca/ssh";
|
||||
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
};
|
||||
|
||||
|
@ -108,5 +110,4 @@
|
|||
};
|
||||
|
||||
system.stateVersion = "23.11"; # dId YoU rEaD tHe CoMmEnT?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +1,28 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "uas" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "uas"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
swapDevices = [];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# WARN: this file will get overwritten by $ cachix use <name>
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
folder = ./cachix;
|
||||
toImport = name: value: folder + ("/" + name);
|
||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
|
@ -15,12 +16,12 @@
|
|||
};
|
||||
};
|
||||
tmp.cleanOnBoot = true;
|
||||
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||
binfmt.emulatedSystems = ["aarch64-linux"];
|
||||
extraModulePackages = [
|
||||
config.boot.kernelPackages.v4l2loopback
|
||||
];
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
kernelModules = [ "amdgpu" "coretemp" "kvm-amd" "v4l2loopback" ];
|
||||
kernelModules = ["amdgpu" "coretemp" "kvm-amd" "v4l2loopback"];
|
||||
};
|
||||
|
||||
time.hardwareClockInLocalTime = true;
|
||||
|
@ -31,7 +32,7 @@
|
|||
};
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
gc = {
|
||||
|
@ -48,11 +49,21 @@
|
|||
networkmanager.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedUDPPortRanges = [ { from = 27031; to = 27036; } ];
|
||||
allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
|
||||
allowedTCPPorts = [ 7000 7100 7001 22000 8000 3000 9943 9944 ];
|
||||
allowedUDPPorts = [ 69 6000 6001 7011 41641 3478 22000 21027 9943 9944 ];
|
||||
trustedInterfaces = [ "enp4s0" "tailscale0" "docker0" ];
|
||||
allowedUDPPortRanges = [
|
||||
{
|
||||
from = 27031;
|
||||
to = 27036;
|
||||
}
|
||||
];
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 27036;
|
||||
to = 27037;
|
||||
}
|
||||
];
|
||||
allowedTCPPorts = [7000 7100 7001 22000 8000 3000 9943 9944];
|
||||
allowedUDPPorts = [69 6000 6001 7011 41641 3478 22000 21027 9943 9944];
|
||||
trustedInterfaces = ["enp4s0" "tailscale0" "docker0"];
|
||||
checkReversePath = "loose";
|
||||
};
|
||||
nftables.enable = true;
|
||||
|
@ -72,10 +83,13 @@
|
|||
positions = {
|
||||
filename = "/tmp/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
clients = [
|
||||
{
|
||||
url = "http://monitoring:3030/loki/api/v1/push";
|
||||
}];
|
||||
scrape_configs = [{
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
|
@ -84,11 +98,14 @@
|
|||
host = "london";
|
||||
};
|
||||
};
|
||||
relabel_configs = [{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = ["__journal__systemd_unit"];
|
||||
target_label = "unit";
|
||||
}];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
fwupd.enable = true;
|
||||
|
@ -105,12 +122,13 @@
|
|||
enable = true;
|
||||
listenAddress = "100.110.180.123";
|
||||
enabledCollectors = [
|
||||
"systemd" "processes"
|
||||
"systemd"
|
||||
"processes"
|
||||
];
|
||||
};
|
||||
dbus.enable = true;
|
||||
yubikey-agent.enable = true;
|
||||
udev.packages = with pkgs; [ libu2f-host yubikey-personalization ];
|
||||
udev.packages = with pkgs; [libu2f-host yubikey-personalization];
|
||||
tailscale.enable = true;
|
||||
pcscd.enable = true;
|
||||
mullvad-vpn.enable = true;
|
||||
|
@ -133,7 +151,7 @@
|
|||
};
|
||||
printing = {
|
||||
enable = true;
|
||||
drivers = [ pkgs.gutenprint pkgs.gutenprintBin ];
|
||||
drivers = [pkgs.gutenprint pkgs.gutenprintBin];
|
||||
};
|
||||
avahi = {
|
||||
nssmdns4 = true;
|
||||
|
@ -164,7 +182,7 @@
|
|||
};
|
||||
|
||||
sane.enable = true;
|
||||
sane.extraBackends = [ pkgs.epkowa ];
|
||||
sane.extraBackends = [pkgs.epkowa];
|
||||
pulseaudio.enable = false;
|
||||
};
|
||||
environment.variables.AMD_VULKAN_ICD = "RADV";
|
||||
|
@ -194,7 +212,7 @@
|
|||
shell = pkgs.fish;
|
||||
isNormalUser = true;
|
||||
description = "Gabriel Simmer";
|
||||
extraGroups = [ "networkmanager" "wheel" "libvirtd" "qemu-libvirtd" "docker" ];
|
||||
extraGroups = ["networkmanager" "wheel" "libvirtd" "qemu-libvirtd" "docker"];
|
||||
packages = with pkgs; [
|
||||
firefox-wayland
|
||||
vim
|
||||
|
@ -223,9 +241,9 @@
|
|||
enableDefaultPackages = true;
|
||||
};
|
||||
|
||||
systemd.packages = with pkgs; [ cloudflare-warp ];
|
||||
systemd.packages = with pkgs; [cloudflare-warp];
|
||||
environment = {
|
||||
shells = with pkgs; [ zsh fish ];
|
||||
shells = with pkgs; [zsh fish];
|
||||
systemPackages = with pkgs; [
|
||||
os-prober
|
||||
tailscale
|
||||
|
@ -276,5 +294,4 @@
|
|||
rtkit.enable = true;
|
||||
};
|
||||
system.stateVersion = "23.05"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +1,31 @@
|
|||
{ config, pkgs, callPackage, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
callPackage,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
nixpkgs = {
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"parsec-bin"
|
||||
"discord"
|
||||
];
|
||||
config.allowUnfree = true;
|
||||
overlays =
|
||||
let
|
||||
overlays = let
|
||||
discordOverlay = self: super: {
|
||||
discord = super.discord.override { withVencord = true; withOpenASAR = true; };
|
||||
discord = super.discord.override {
|
||||
withVencord = true;
|
||||
withOpenASAR = true;
|
||||
};
|
||||
in
|
||||
[
|
||||
};
|
||||
in [
|
||||
(import (builtins.fetchTarball {
|
||||
url = "https://github.com/nix-community/emacs-overlay/archive/master.tar.gz";
|
||||
sha256 = "1nglxrfynyjmqfzz81y4idc40c6rbsaa4jb4ishiwibdkh85nyf6";
|
||||
})) discordOverlay];
|
||||
}))
|
||||
discordOverlay
|
||||
];
|
||||
};
|
||||
home = {
|
||||
username = "gsimmer";
|
||||
|
@ -27,12 +35,12 @@
|
|||
services.pueue = {
|
||||
enable = true;
|
||||
settings = {
|
||||
client = { };
|
||||
client = {};
|
||||
daemon.callback = ''
|
||||
${pkgs.libnotify}/bin/notify-send -t 4000 "Task {{id}} finished, status '{{result}}'" "<b>{{exit_code}}</b> {{command}}"
|
||||
'';
|
||||
shared = { };
|
||||
profiles = { };
|
||||
shared = {};
|
||||
profiles = {};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,30 +1,34 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.initrd.availableKernelModules = ["nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/736c20e1-f11a-4af7-88f2-bba7b0f09939";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/736c20e1-f11a-4af7-88f2-bba7b0f09939";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/2A2C-A8CE";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/2A2C-A8CE";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/41c7d0e1-e015-4d78-a0fb-f039a7f648ef"; }
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/41c7d0e1-e015-4d78-a0fb-f039a7f648ef";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
rev = "master"; # 'rev' could be a git rev, to pin the overlay.
|
||||
url = "https://github.com/nix-community/nixpkgs-wayland/archive/${rev}.tar.gz";
|
||||
waylandOverlay = (import "${builtins.fetchTarball url}/overlay.nix");
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = [ waylandOverlay ];
|
||||
}
|
||||
waylandOverlay = import "${builtins.fetchTarball url}/overlay.nix";
|
||||
in {
|
||||
nixpkgs.overlays = [waylandOverlay];
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./networking.nix # generated at runtime by nixos-infect
|
||||
|
@ -104,7 +106,8 @@
|
|||
};
|
||||
|
||||
schema_config = {
|
||||
configs = [{
|
||||
configs = [
|
||||
{
|
||||
from = "2022-06-06";
|
||||
store = "boltdb-shipper";
|
||||
object_store = "filesystem";
|
||||
|
@ -113,7 +116,8 @@
|
|||
prefix = "index_";
|
||||
period = "24h";
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
storage_config = {
|
||||
|
@ -164,10 +168,13 @@
|
|||
positions = {
|
||||
filename = "/tmp/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
clients = [
|
||||
{
|
||||
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
|
||||
}];
|
||||
scrape_configs = [{
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
|
@ -176,11 +183,14 @@
|
|||
host = "monitoring";
|
||||
};
|
||||
};
|
||||
relabel_configs = [{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = ["__journal__systemd_unit"];
|
||||
target_label = "unit";
|
||||
}];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
services.alertmanager-ntfy = {
|
||||
|
@ -211,18 +221,23 @@
|
|||
globalConfig = {
|
||||
scrape_interval = "15s";
|
||||
};
|
||||
alertmanagers = [ {
|
||||
alertmanagers = [
|
||||
{
|
||||
basic_auth = {
|
||||
username = "homelab";
|
||||
password_file = config.age.secrets.prometheus-password-secret.path;
|
||||
};
|
||||
static_configs = [ {
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"localhost:9093"
|
||||
];
|
||||
} ];
|
||||
} ];
|
||||
rules = [(builtins.toJSON {
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
(builtins.toJSON {
|
||||
groups = [
|
||||
{
|
||||
name = "internet_connection";
|
||||
|
@ -255,11 +270,13 @@
|
|||
};
|
||||
}
|
||||
];
|
||||
}];
|
||||
})];
|
||||
}
|
||||
];
|
||||
})
|
||||
];
|
||||
alertmanager = {
|
||||
enable = true;
|
||||
extraFlags = [ "--web.config.file=${config.age.secrets.prometheus-webconfig-secret.path}" ];
|
||||
extraFlags = ["--web.config.file=${config.age.secrets.prometheus-webconfig-secret.path}"];
|
||||
webExternalUrl = "https://alerts.gmem.ca";
|
||||
configText = ''
|
||||
global: {}
|
||||
|
@ -284,63 +301,75 @@
|
|||
'';
|
||||
};
|
||||
port = 9001;
|
||||
extraFlags = [ "--web.enable-remote-write-receiver" ];
|
||||
extraFlags = ["--web.enable-remote-write-receiver"];
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "proxmox";
|
||||
metrics_path = "/pve";
|
||||
params = { "target" = [ "localhost" ]; };
|
||||
static_configs = [ { targets = [ "proxmox:9221" ]; } ];
|
||||
params = {"target" = ["localhost"];};
|
||||
static_configs = [{targets = ["proxmox:9221"];}];
|
||||
}
|
||||
{
|
||||
job_name = "personal_hardware";
|
||||
static_configs = [ { targets = [ "london:9100" "vancouver:9100" "localhost:9100" ]; } ];
|
||||
static_configs = [{targets = ["london:9100" "vancouver:9100" "localhost:9100"];}];
|
||||
}
|
||||
{
|
||||
job_name = "speedtest-exporter";
|
||||
scrape_interval = "1h";
|
||||
scrape_timeout = "1m";
|
||||
static_configs = [ { targets = [ "vancouver:9798" ]; } ];
|
||||
static_configs = [{targets = ["vancouver:9798"];}];
|
||||
}
|
||||
{
|
||||
job_name = "syncthing";
|
||||
static_configs = [ { targets = [ "vancouver:8384" "london:8384" ]; } ];
|
||||
static_configs = [{targets = ["vancouver:8384" "london:8384"];}];
|
||||
}
|
||||
{
|
||||
job_name = "forgejo";
|
||||
static_configs = [ { targets = [ "git.gmem.ca" ]; } ];
|
||||
static_configs = [{targets = ["git.gmem.ca"];}];
|
||||
}
|
||||
{
|
||||
job_name = "coredns";
|
||||
static_configs = [ { targets = [ "vancouver:9253" ]; } ];
|
||||
static_configs = [{targets = ["vancouver:9253"];}];
|
||||
}
|
||||
{
|
||||
job_name = "healthchecks";
|
||||
scrape_interval = "60s";
|
||||
metrics_path = "/projects/5f1de50f-a52d-4215-961f-aae7cc6cf6c9/metrics/TbMoU7SUdknzMe-H5Q4HzmKl3itOIrJk";
|
||||
static_configs = [ { targets = [ "localhost:8000" ]; } ];
|
||||
static_configs = [{targets = ["localhost:8000"];}];
|
||||
}
|
||||
{
|
||||
job_name = "vrc_events";
|
||||
scrape_interval = "60s";
|
||||
static_configs = [ { targets = [ "vancouver:6534" ]; } ];
|
||||
static_configs = [{targets = ["vancouver:6534"];}];
|
||||
}
|
||||
{
|
||||
job_name = "blackbox";
|
||||
metrics_path = "/probe";
|
||||
params = { "modules" = [ "http_2xx" ]; };
|
||||
static_configs = [ { targets = [ "google.com" "gabrielsimmer.com" "artbybecki.com" ]; } ];
|
||||
params = {"modules" = ["http_2xx"];};
|
||||
static_configs = [{targets = ["google.com" "gabrielsimmer.com" "artbybecki.com"];}];
|
||||
relabel_configs = [
|
||||
{ source_labels = ["__address__"]; target_label = "__param_target"; }
|
||||
{ source_labels = ["__param_target"]; target_label = "instance"; }
|
||||
{ source_labels = []; target_label = "__address__"; replacement = "vancouver:9115"; } ];
|
||||
{
|
||||
source_labels = ["__address__"];
|
||||
target_label = "__param_target";
|
||||
}
|
||||
{
|
||||
source_labels = ["__param_target"];
|
||||
target_label = "instance";
|
||||
}
|
||||
{
|
||||
source_labels = [];
|
||||
target_label = "__address__";
|
||||
replacement = "vancouver:9115";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
exporters.node = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
enabledCollectors = [
|
||||
"systemd" "processes"
|
||||
"systemd"
|
||||
"processes"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
{modulesPath, ...}: {
|
||||
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
||||
boot.loader.grub = {
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
device = "nodev";
|
||||
};
|
||||
fileSystems."/boot" = { device = "/dev/disk/by-uuid/77CF-345D"; fsType = "vfat"; };
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/77CF-345D";
|
||||
fsType = "vfat";
|
||||
};
|
||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"];
|
||||
boot.initrd.kernelModules = ["nvme"];
|
||||
fileSystems."/" = {
|
||||
device = "/dev/sda1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{ lib, ... }: {
|
||||
{lib, ...}: {
|
||||
# This file was populated at runtime with the networking
|
||||
# details gathered from the active system.
|
||||
networking = {
|
||||
nameservers = [ "8.8.8.8"
|
||||
nameservers = [
|
||||
"8.8.8.8"
|
||||
];
|
||||
defaultGateway = "172.31.1.1";
|
||||
defaultGateway6 = {
|
||||
|
@ -14,16 +15,34 @@
|
|||
interfaces = {
|
||||
eth0 = {
|
||||
ipv4.addresses = [
|
||||
{ address="91.107.206.145"; prefixLength=32; }
|
||||
{
|
||||
address = "91.107.206.145";
|
||||
prefixLength = 32;
|
||||
}
|
||||
];
|
||||
ipv6.addresses = [
|
||||
{ address="2a01:4f8:c012:5ec6::1"; prefixLength=64; }
|
||||
{ address="fe80::9400:2ff:fe83:3979"; prefixLength=64; }
|
||||
{
|
||||
address = "2a01:4f8:c012:5ec6::1";
|
||||
prefixLength = 64;
|
||||
}
|
||||
{
|
||||
address = "fe80::9400:2ff:fe83:3979";
|
||||
prefixLength = 64;
|
||||
}
|
||||
];
|
||||
ipv4.routes = [
|
||||
{
|
||||
address = "172.31.1.1";
|
||||
prefixLength = 32;
|
||||
}
|
||||
];
|
||||
ipv6.routes = [
|
||||
{
|
||||
address = "fe80::1";
|
||||
prefixLength = 128;
|
||||
}
|
||||
];
|
||||
ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ];
|
||||
ipv6.routes = [ { address = "fe80::1"; prefixLength = 128; } ];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
services.udev.extraRules = ''
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
|
@ -42,7 +44,7 @@
|
|||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
supportedFilesystems = ["zfs"];
|
||||
kernelModules = [ "coretemp" "kvm-amd" "it87" ];
|
||||
kernelModules = ["coretemp" "kvm-amd" "it87"];
|
||||
zfs.extraPools = ["tank"];
|
||||
};
|
||||
|
||||
|
@ -58,10 +60,13 @@
|
|||
positions = {
|
||||
filename = "/tmp/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
clients = [
|
||||
{
|
||||
url = "http://monitoring:3030/loki/api/v1/push";
|
||||
}];
|
||||
scrape_configs = [{
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
|
@ -70,11 +75,14 @@
|
|||
host = "vancouver";
|
||||
};
|
||||
};
|
||||
relabel_configs = [{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = ["__journal__systemd_unit"];
|
||||
target_label = "unit";
|
||||
}];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
restic = {
|
||||
|
@ -187,7 +195,9 @@
|
|||
enable = true;
|
||||
listenAddress = "100.116.48.47";
|
||||
enabledCollectors = [
|
||||
"systemd" "zfs" "processes"
|
||||
"systemd"
|
||||
"zfs"
|
||||
"processes"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
@ -201,7 +211,7 @@
|
|||
zfs.autoScrub.enable = true;
|
||||
tailscale.enable = true;
|
||||
openssh.enable = true;
|
||||
xserver.videoDrivers = [ "nvidia" ];
|
||||
xserver.videoDrivers = ["nvidia"];
|
||||
nfs.server.enable = true;
|
||||
samba-wsdd.enable = true;
|
||||
samba = {
|
||||
|
@ -282,8 +292,7 @@
|
|||
addSSL = true;
|
||||
acmeRoot = null;
|
||||
locations."/" = {
|
||||
extraConfig =
|
||||
''
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
@ -400,8 +409,8 @@
|
|||
trustedInterfaces = ["tailscale0"];
|
||||
checkReversePath = "loose";
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 22 80 443 9798 2049 ];
|
||||
allowedUDPPorts = [ 41641 ];
|
||||
allowedTCPPorts = [22 80 443 9798 2049];
|
||||
allowedUDPPorts = [41641];
|
||||
};
|
||||
nftables.enable = true;
|
||||
};
|
||||
|
@ -434,20 +443,21 @@
|
|||
zsh.enable = true;
|
||||
fish.enable = true;
|
||||
};
|
||||
environment.shells = with pkgs; [ zsh fish ];
|
||||
environment.shells = with pkgs; [zsh fish];
|
||||
|
||||
users.users = {
|
||||
gsimmer = {
|
||||
shell = pkgs.fish;
|
||||
isNormalUser = true;
|
||||
home = "/tank/gsimmer";
|
||||
extraGroups = [ "wheel" "libvirtd" "qemu-libvirtd" ];
|
||||
extraGroups = ["wheel" "libvirtd" "qemu-libvirtd"];
|
||||
openssh.authorizedKeys.keys = let
|
||||
authorizedKeys = pkgs.fetchurl {
|
||||
url = "https://gmem.ca/ssh";
|
||||
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
};
|
||||
becki = {
|
||||
|
@ -460,11 +470,12 @@
|
|||
url = "https://gmem.ca/ssh";
|
||||
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
};
|
||||
|
||||
home-manager.users.gsimmer = { pkgs, ... }: {
|
||||
home-manager.users.gsimmer = {pkgs, ...}: {
|
||||
programs.git = {
|
||||
userName = "Gabriel Simmer";
|
||||
userEmail = "git@gmem.ca";
|
||||
|
@ -487,7 +498,7 @@
|
|||
virtualisation.oci-containers.containers = {
|
||||
speedtest = {
|
||||
image = "ghcr.io/miguelndecarvalho/speedtest-exporter";
|
||||
ports = [ "9798:9798" ];
|
||||
ports = ["9798:9798"];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,30 +1,34 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/c099cd1d-75a0-42ee-bffa-1e92cd241064";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/c099cd1d-75a0-42ee-bffa-1e92cd241064";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/77EB-F216";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/77EB-F216";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/6e19c559-000a-4ba4-b68c-7ec0794f45e4"; }
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/6e19c559-000a-4ba4-b68c-7ec0794f45e4";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{ config, pkgs, callPackage, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
callPackage,
|
||||
...
|
||||
}: {
|
||||
home.username = "gsimmer";
|
||||
home.homeDirectory = "/tank/gsimmer";
|
||||
|
||||
|
@ -11,7 +14,7 @@
|
|||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting
|
||||
if test "$TERM" = "dumb"
|
||||
if test "$TERM" = "dumb"
|
||||
function fish_prompt
|
||||
echo "\$ "
|
||||
end
|
||||
|
@ -19,11 +22,11 @@ if test "$TERM" = "dumb"
|
|||
function fish_right_prompt; end
|
||||
function fish_greeting; end
|
||||
function fish_title; end
|
||||
end
|
||||
atuin init fish | source
|
||||
end
|
||||
atuin init fish | source
|
||||
'';
|
||||
loginShellInit = ''
|
||||
if test "$TERM" = "dumb"
|
||||
if test "$TERM" = "dumb"
|
||||
function fish_prompt
|
||||
echo "\$ "
|
||||
end
|
||||
|
@ -31,7 +34,7 @@ if test "$TERM" = "dumb"
|
|||
function fish_right_prompt; end
|
||||
function fish_greeting; end
|
||||
function fish_title; end
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -49,7 +52,7 @@ end
|
|||
enable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [ atuin ];
|
||||
home.packages = with pkgs; [atuin];
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
|
|
|
@ -1,44 +1,47 @@
|
|||
{ lib
|
||||
, fetchurl
|
||||
, installShellFiles
|
||||
, makeWrapper
|
||||
, terraform
|
||||
, stdenvNoCC
|
||||
, unzip
|
||||
}:
|
||||
let
|
||||
{
|
||||
lib,
|
||||
fetchurl,
|
||||
installShellFiles,
|
||||
makeWrapper,
|
||||
terraform,
|
||||
stdenvNoCC,
|
||||
unzip,
|
||||
}: let
|
||||
inherit (stdenvNoCC.hostPlatform) system;
|
||||
in
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "coder";
|
||||
version = "2.3.3";
|
||||
|
||||
src = fetchurl {
|
||||
sha256 = {
|
||||
sha256 =
|
||||
{
|
||||
x86_64-linux = "sha256-3gO71Eii3KBjn/oQ1Q3OCJ7S6H12iDYjOfqf43ph1nQ=";
|
||||
x86_64-darwin = lib.fakeHash;
|
||||
aarch64-linux = "sha256-v7S22I62EKPcHO9yZGciKKftRlzIowfAeVgnccOdlSs=";
|
||||
aarch64-darwin = "";
|
||||
}.${system};
|
||||
}
|
||||
.${system};
|
||||
|
||||
url =
|
||||
let
|
||||
systemName = {
|
||||
url = let
|
||||
systemName =
|
||||
{
|
||||
x86_64-linux = "linux_amd64";
|
||||
aarch64-linux = "linux_arm64";
|
||||
x86_64-darwin = "darwin_amd64";
|
||||
aarch64-darwin = "darwin_arm64";
|
||||
}.${system};
|
||||
}
|
||||
.${system};
|
||||
|
||||
ext = {
|
||||
ext =
|
||||
{
|
||||
x86_64-linux = "tar.gz";
|
||||
aarch64-linux = "tar.gz";
|
||||
x86_64-darwin = "zip";
|
||||
aarch64-darwin = "zip";
|
||||
}.${system};
|
||||
in
|
||||
"https://github.com/coder/coder/releases/download/v${version}/coder_${version}_${systemName}.${ext}";
|
||||
}
|
||||
.${system};
|
||||
in "https://github.com/coder/coder/releases/download/v${version}/coder_${version}_${systemName}.${ext}";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -66,7 +69,7 @@ stdenvNoCC.mkDerivation rec {
|
|||
--fish <($out/bin/coder completion fish) \
|
||||
--zsh <($out/bin/coder completion zsh)
|
||||
|
||||
wrapProgram $out/bin/coder --prefix PATH : ${lib.makeBinPath [ terraform ]}
|
||||
wrapProgram $out/bin/coder --prefix PATH : ${lib.makeBinPath [terraform]}
|
||||
'';
|
||||
|
||||
# integration tests require network access
|
||||
|
@ -76,7 +79,7 @@ stdenvNoCC.mkDerivation rec {
|
|||
description = "Provision software development environments via Terraform on Linux, macOS, Windows, X86, ARM, and of course, Kubernetes";
|
||||
homepage = "https://coder.com";
|
||||
license = lib.licenses.agpl3;
|
||||
maintainers = [ lib.maintainers.ghuntley lib.maintainers.urandom ];
|
||||
maintainers = [lib.maintainers.ghuntley lib.maintainers.urandom];
|
||||
broken = false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
zramSwap.enable = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
@ -38,18 +40,18 @@
|
|||
|
||||
programs.zsh.enable = true;
|
||||
programs.fish.enable = true;
|
||||
environment.shells = with pkgs; [ zsh fish ];
|
||||
environment.shells = with pkgs; [zsh fish];
|
||||
|
||||
networking = {
|
||||
hostName = "forgejo-action-runner";
|
||||
domain = "gmem.ca";
|
||||
nameservers = [ "1.1.1.1" "1.0.0.1" ];
|
||||
nameservers = ["1.1.1.1" "1.0.0.1"];
|
||||
firewall = {
|
||||
trustedInterfaces = ["tailscale0"];
|
||||
checkReversePath = "loose";
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 22 80 443 4328 ];
|
||||
allowedUDPPorts = [ ];
|
||||
allowedTCPPorts = [22 80 443 4328];
|
||||
allowedUDPPorts = [];
|
||||
};
|
||||
nftables.enable = true;
|
||||
};
|
||||
|
@ -60,7 +62,8 @@
|
|||
url = "https://gmem.ca/ssh";
|
||||
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
};
|
||||
virtualisation = {
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
{modulesPath, ...}: {
|
||||
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
boot.loader.grub = {
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
device = "nodev";
|
||||
};
|
||||
fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/CC2E-AEC0"; fsType = "vfat"; };
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/mapper/ocivolume-root"; fsType = "xfs"; };
|
||||
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/CC2E-AEC0";
|
||||
fsType = "vfat";
|
||||
};
|
||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"];
|
||||
boot.initrd.kernelModules = ["nvme"];
|
||||
fileSystems."/" = {
|
||||
device = "/dev/mapper/ocivolume-root";
|
||||
fsType = "xfs";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
|
@ -34,16 +36,22 @@
|
|||
firewall = {
|
||||
trustedInterfaces = ["tailscale0"];
|
||||
checkReversePath = "loose";
|
||||
allowedTCPPorts = [ 80 443 1935 ];
|
||||
allowedTCPPorts = [80 443 1935];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 4000; to = 4007; }
|
||||
{ from = 8000; to = 8010; }
|
||||
{
|
||||
from = 4000;
|
||||
to = 4007;
|
||||
}
|
||||
{
|
||||
from = 8000;
|
||||
to = 8010;
|
||||
}
|
||||
];
|
||||
allowedUDPPorts = [ 41641 1935 ];
|
||||
allowedUDPPorts = [41641 1935];
|
||||
enable = true;
|
||||
};
|
||||
nftables.enable = true;
|
||||
nameservers = [ "1.1.1.1" "1.0.0.1" ];
|
||||
nameservers = ["1.1.1.1" "1.0.0.1"];
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
|
@ -53,7 +61,8 @@
|
|||
url = "https://gmem.ca/ssh";
|
||||
sha256 = "0vm0q5fzx55mmgw7md430c20rvywmknmpvnkffx9szlm0l74bypc";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
@ -77,7 +86,7 @@
|
|||
openFirewall = false;
|
||||
};
|
||||
nginx = {
|
||||
additionalModules = [ pkgs.nginxModules.rtmp ];
|
||||
additionalModules = [pkgs.nginxModules.rtmp];
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
|
@ -93,8 +102,7 @@
|
|||
proxyPass = "http://127.0.0.1:8080";
|
||||
proxyWebsockets = true;
|
||||
|
||||
extraConfig =
|
||||
''
|
||||
extraConfig = ''
|
||||
client_max_body_size 100M;
|
||||
proxy_pass_header Authorization;
|
||||
'';
|
||||
|
@ -135,5 +143,4 @@
|
|||
};
|
||||
|
||||
system.stateVersion = "23.11"; # dId YoU rEaD tHe CoMmEnT?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
{modulesPath, ...}: {
|
||||
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
boot.loader.grub = {
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
device = "nodev";
|
||||
};
|
||||
fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/CC2E-AEC0"; fsType = "vfat"; };
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/mapper/ocivolume-root"; fsType = "xfs"; };
|
||||
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/CC2E-AEC0";
|
||||
fsType = "vfat";
|
||||
};
|
||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"];
|
||||
boot.initrd.kernelModules = ["nvme"];
|
||||
fileSystems."/" = {
|
||||
device = "/dev/mapper/ocivolume-root";
|
||||
fsType = "xfs";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
|
@ -12,19 +14,18 @@
|
|||
};
|
||||
|
||||
boot = {
|
||||
supportedFilesystems = [ "nfs" ];
|
||||
kernelParams = [ "cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1" ];
|
||||
supportedFilesystems = ["nfs"];
|
||||
kernelParams = ["cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1"];
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 8*1024;
|
||||
size = 8 * 1024;
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -51,8 +52,8 @@
|
|||
firewall = {
|
||||
trustedInterfaces = ["tailscale0"];
|
||||
checkReversePath = "loose";
|
||||
allowedUDPPorts = [ 41641 ];
|
||||
allowedTCPPorts = [ 22 80 443 6443 10250 ];
|
||||
allowedUDPPorts = [41641];
|
||||
allowedTCPPorts = [22 80 443 6443 10250];
|
||||
enable = false;
|
||||
};
|
||||
nftables.enable = false;
|
||||
|
@ -62,7 +63,7 @@
|
|||
|
||||
users.users.gsimmer = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
extraGroups = ["wheel"];
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
];
|
||||
|
@ -71,7 +72,8 @@
|
|||
url = "https://gmem.ca/ssh";
|
||||
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
};
|
||||
|
||||
|
@ -99,5 +101,4 @@
|
|||
};
|
||||
|
||||
system.stateVersion = "23.11"; # dId YoU rEaD tHe CoMmEnT?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,30 +1,34 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.initrd.availableKernelModules = ["uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/b6eaa1d7-49dc-44a7-9494-6363939a36ee";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/b6eaa1d7-49dc-44a7-9494-6363939a36ee";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/92BB-B090";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/92BB-B090";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/45b1b1cc-7a27-4abc-9903-16d293c8570c"; }
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/45b1b1cc-7a27-4abc-9903-16d293c8570c";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
supportedFilesystems = [ "nfs" ];
|
||||
supportedFilesystems = ["nfs"];
|
||||
kernelPackages = pkgs.linuxPackages_rpi4;
|
||||
kernelParams = [ "cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1" ];
|
||||
kernelParams = ["cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1"];
|
||||
loader = {
|
||||
grub.enable = false;
|
||||
generic-extlinux-compatible.enable = true;
|
||||
|
@ -19,7 +21,7 @@
|
|||
swapDevices = [
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 8*1024;
|
||||
size = 8 * 1024;
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -46,8 +48,8 @@
|
|||
firewall = {
|
||||
trustedInterfaces = ["tailscale0"];
|
||||
checkReversePath = "loose";
|
||||
allowedTCPPorts = [ 22 80 443 6443 10250 ];
|
||||
allowedUDPPorts = [ 41641 80 443 ];
|
||||
allowedTCPPorts = [22 80 443 6443 10250];
|
||||
allowedUDPPorts = [41641 80 443];
|
||||
enable = false;
|
||||
};
|
||||
nftables.enable = false;
|
||||
|
@ -57,7 +59,7 @@
|
|||
|
||||
users.users.gsimmer = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
extraGroups = ["wheel"];
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
];
|
||||
|
@ -66,7 +68,8 @@
|
|||
url = "https://gmem.ca/ssh";
|
||||
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
||||
};
|
||||
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||
in
|
||||
pkgs.lib.splitString "\n" (builtins.readFile
|
||||
authorizedKeys);
|
||||
};
|
||||
|
||||
|
@ -103,5 +106,4 @@
|
|||
};
|
||||
|
||||
system.stateVersion = "23.11"; # dId YoU rEaD tHe CoMmEnT?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +1,28 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "uas" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "uas"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
swapDevices = [];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIztwQxt+jqroFONSgq+xzPMuE2I5Dq/zWPQ8RcTYJr gabriel@gitgalaxy.com"
|
||||
];
|
||||
sdImage.compressImage = false;
|
||||
systemd.services.openssh.wantedBy = lib.mkOverride 40 [ "multi-user.target" ];
|
||||
systemd.services.openssh.wantedBy = lib.mkOverride 40 ["multi-user.target"];
|
||||
services.openssh.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
27
secrets.nix
27
secrets.nix
|
@ -1,28 +1,27 @@
|
|||
let
|
||||
vancouver = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC30kDkktiWJGaJEIrqgneQx1SmIYUEVPm7w1F9p//CB";
|
||||
monitoring = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEDtzsbxKgZ/NBYlYO2EJQZhBy3nVBVERWebbsP9mLcy";
|
||||
machines = [ vancouver monitoring ];
|
||||
machines = [vancouver monitoring];
|
||||
|
||||
proxmox-k3s-node = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB1KEjdFl0UmuKfESJTMZdKR2H9a405z0SSlt75NKKht";
|
||||
seattle = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF9pTEqeVljLq0ctFgDn25Q76mCqpddkSNN9kd3IQXd1";
|
||||
glasgow = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMgZSpfnx/4kfE4P1tFpq047IZkF2Q0UYahputnWxtEJ";
|
||||
k3s = [ proxmox-k3s-node seattle glasgow ];
|
||||
k3s = [proxmox-k3s-node seattle glasgow];
|
||||
|
||||
gsimmer = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIztwQxt+jqroFONSgq+xzPMuE2I5Dq/zWPQ8RcTYJr gabriel@gitgalaxy.com";
|
||||
users = [ gsimmer ];
|
||||
in
|
||||
{
|
||||
"secrets/vancouver-action-runner.age".publicKeys = [ vancouver gsimmer ];
|
||||
"secrets/vancouver-restic-b2.age".publicKeys = [ vancouver gsimmer ];
|
||||
"secrets/vancouver-restic-password.age".publicKeys = [ vancouver gsimmer ];
|
||||
"secrets/monitoring-healthchecks-secret.age".publicKeys = [ monitoring gsimmer ];
|
||||
"secrets/monitoring-healthchecks-ro.age".publicKeys = [ monitoring gsimmer ];
|
||||
"secrets/monitoring-prometheus-webconfig.age".publicKeys = [ monitoring gsimmer ];
|
||||
"secrets/monitoring-prometheus-password.age".publicKeys = [ monitoring gsimmer ];
|
||||
users = [gsimmer];
|
||||
in {
|
||||
"secrets/vancouver-action-runner.age".publicKeys = [vancouver gsimmer];
|
||||
"secrets/vancouver-restic-b2.age".publicKeys = [vancouver gsimmer];
|
||||
"secrets/vancouver-restic-password.age".publicKeys = [vancouver gsimmer];
|
||||
"secrets/monitoring-healthchecks-secret.age".publicKeys = [monitoring gsimmer];
|
||||
"secrets/monitoring-healthchecks-ro.age".publicKeys = [monitoring gsimmer];
|
||||
"secrets/monitoring-prometheus-webconfig.age".publicKeys = [monitoring gsimmer];
|
||||
"secrets/monitoring-prometheus-password.age".publicKeys = [monitoring gsimmer];
|
||||
"secrets/healthchecks-ping.sh.age".publicKeys = machines ++ users;
|
||||
"secrets/fastmail-smtp.age".publicKeys = machines ++ users;
|
||||
"secrets/healthchecks-telegram.age".publicKeys = [ monitoring gsimmer ];
|
||||
"secrets/healthchecks-telegram.age".publicKeys = [monitoring gsimmer];
|
||||
"secrets/cloudflare-dns.age".publicKeys = machines ++ users;
|
||||
"secrets/monitoring-grafana-client-secret.age".publicKeys = [monitoring gsimmer ];
|
||||
"secrets/monitoring-grafana-client-secret.age".publicKeys = [monitoring gsimmer];
|
||||
"secrets/k3s-token.age".publicKeys = k3s ++ users;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }: {
|
||||
{...}: {
|
||||
terraform = {
|
||||
required_providers = {
|
||||
cloudflare.source = "cloudflare/cloudflare";
|
||||
|
|
Loading…
Reference in a new issue