This commit is contained in:
parent
1a25b198ef
commit
781ce2d5e9
24 changed files with 610 additions and 505 deletions
13
flake.nix
13
flake.nix
|
@ -13,14 +13,19 @@
|
|||
agenix.url = "github:yaxitech/ragenix";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, home-manager, microvm, agenix, ... }:
|
||||
let
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
microvm,
|
||||
agenix,
|
||||
...
|
||||
}: let
|
||||
system = "x86_64-linux";
|
||||
username = "tbarnouin";
|
||||
proxy_host = "192.168.1.40";
|
||||
pgsql_host = "192.168.1.13";
|
||||
in
|
||||
{
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
nixmox-curiosity = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{ imports = [ ./hardware-configuration.nix ];
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [./hardware-configuration.nix];
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
|
@ -104,5 +108,4 @@
|
|||
};
|
||||
|
||||
system.stateVersion = "24.11"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ lib, system, ... }:
|
||||
|
||||
{
|
||||
lib,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
boot = {
|
||||
# use latest kernel
|
||||
# kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
@ -45,7 +47,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
services.fstrim = {
|
||||
enable = true;
|
||||
interval = "weekly";
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home = {
|
||||
username = "tbarnouin";
|
||||
stateVersion = "24.11";
|
||||
|
@ -75,8 +78,7 @@
|
|||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins =
|
||||
[
|
||||
plugins = [
|
||||
"git"
|
||||
"terraform"
|
||||
"sudo"
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{ imports = [ ./hardware-configuration.nix ];
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [./hardware-configuration.nix];
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
|
@ -104,5 +108,4 @@
|
|||
};
|
||||
|
||||
system.stateVersion = "24.11"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ lib, system, ... }:
|
||||
|
||||
{
|
||||
lib,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
boot = {
|
||||
# use latest kernel
|
||||
# kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home = {
|
||||
username = "tbarnouin";
|
||||
stateVersion = "24.11";
|
||||
|
@ -75,8 +78,7 @@
|
|||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins =
|
||||
[
|
||||
plugins = [
|
||||
"git"
|
||||
"terraform"
|
||||
"sudo"
|
||||
|
|
|
@ -7,8 +7,7 @@ let
|
|||
onlyoffice = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGbnzv2/Or4XdQXLDjIbr7oIDTQEvgSMTX4aiNCQk4tC root@onlyoffice";
|
||||
|
||||
systems = [forgejo grafana];
|
||||
in
|
||||
{
|
||||
in {
|
||||
"secrets/initialPassword.age".publicKeys = users ++ systems;
|
||||
"services/grafana/secrets/grafana-db.age".publicKeys = [tbarnouin grafana];
|
||||
"services/grafana/secrets/grafana-oauth_secret.age".publicKeys = [tbarnouin grafana];
|
||||
|
@ -16,4 +15,3 @@ in
|
|||
"services/onlyoffice/secrets/office-dbpass.age".publicKeys = [tbarnouin onlyoffice];
|
||||
"services/onlyoffice/secrets/office-jwtpass.age".publicKeys = [tbarnouin onlyoffice];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
{ inputs, config, lib, authentik-nix, ... }:
|
||||
let
|
||||
cfg = config.services.vm_authentik;
|
||||
in
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
authentik-nix,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_authentik;
|
||||
in {
|
||||
options.services.vm_authentik = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
};
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
{inputs, ...}: {
|
||||
imports = [
|
||||
./nginx
|
||||
./gitea
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.vm_gitea;
|
||||
in
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_gitea;
|
||||
in {
|
||||
options.services.vm_gitea = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
db_ip = lib.mkOption {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.vm_grafana;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_grafana;
|
||||
in {
|
||||
options.services.vm_grafana = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
vm_ip = lib.mkOption {
|
||||
|
@ -88,95 +91,125 @@ in
|
|||
job_name = "kuma";
|
||||
scrape_interval = "30s";
|
||||
scheme = "http";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.90:3001"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
basic_auth.username = "tbarnouin";
|
||||
basic_auth.password_file = config.age.secrets.kuma-token.path;
|
||||
}
|
||||
{
|
||||
job_name = "grafana";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:9002"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "openmediavault_cadvisor";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.125:8080"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "opportunity";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.125:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "nginx";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["${cfg.proxy_ip}:9002"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "redis";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.16:9002"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "ingenuity";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.90:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "gitea";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.14:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "postgresql";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.13:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "nextcloud";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.44:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "deluge";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.18:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "netbox";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.45:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "jellyfin";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.42:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "authentik-ldap";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.41:9100"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "authentik";
|
||||
static_configs = [{
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["192.168.1.25:9002"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
@ -202,7 +235,8 @@ in
|
|||
chunk_retain_period = "30s";
|
||||
};
|
||||
schema_config = {
|
||||
configs = [{
|
||||
configs = [
|
||||
{
|
||||
from = "2022-06-06";
|
||||
store = "boltdb-shipper";
|
||||
object_store = "filesystem";
|
||||
|
@ -211,7 +245,8 @@ in
|
|||
prefix = "index_";
|
||||
period = "24h";
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
storage_config = {
|
||||
boltdb_shipper = {
|
||||
|
@ -255,9 +290,11 @@ in
|
|||
positions = {
|
||||
filename = "/tmp/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
clients = [
|
||||
{
|
||||
url = "http://127.0.0.1:3100/loki/api/v1/push";
|
||||
}];
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "syslog";
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.vm_jellyfin;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_jellyfin;
|
||||
in {
|
||||
options.services.vm_jellyfin = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
};
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
{ config, pkgs, lib, inputs, modulesPath, ... }:
|
||||
{
|
||||
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./lxc.nix
|
||||
./vm.nix
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{lib, config, modulesPath, ...}:
|
||||
let
|
||||
cfg = config.services.lxc;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
modulesPath,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.lxc;
|
||||
in {
|
||||
options.services.lxc = {
|
||||
enable = lib.mkEnableOption "Enable LXC container config";
|
||||
};
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{lib, config, modulesPath, ...}:
|
||||
let
|
||||
cfg = config.services.vm;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
modulesPath,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm;
|
||||
in {
|
||||
options.services.vm = {
|
||||
enable = lib.mkEnableOption "Enable LXC container config";
|
||||
};
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.vm_nextcloud;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_nextcloud;
|
||||
in {
|
||||
options.services.vm_nextcloud = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
proxy_ip = lib.mkOption {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.vm_nginx;
|
||||
in
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_nginx;
|
||||
in {
|
||||
options.services.vm_nginx = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
};
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.vm_onlyoffice;
|
||||
in
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_onlyoffice;
|
||||
in {
|
||||
options.services.vm_onlyoffice = {
|
||||
enable = lib.mkEnableOption "Enable OnlyOffice service";
|
||||
pgsql_ip = lib.mkOption {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.vm_postgresql;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_postgresql;
|
||||
in {
|
||||
options.services.vm_postgresql = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
};
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.vm_redis;
|
||||
in
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.vm_redis;
|
||||
in {
|
||||
options.services.vm_redis = {
|
||||
enable = lib.mkEnableOption "Enable minimal config";
|
||||
};
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
{ config, pkgs, lib, inputs, modulesPath, ... }:
|
||||
{
|
||||
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
settings.experimental-features = ["nix-command" "flakes"];
|
||||
settings.trusted-users = ["root" "@wheel"];
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{ config, pkgs, lib, inputs, modulesPath, microvm, ... }:
|
||||
let
|
||||
cfg = config.services.micro_vm;
|
||||
in
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
modulesPath,
|
||||
microvm,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.micro_vm;
|
||||
in {
|
||||
options.services.micro_vm = {
|
||||
enable = lib.mkEnableOption "Enable NixOS microvm config";
|
||||
hostname = lib.mkOption {
|
||||
|
@ -53,11 +59,13 @@ in
|
|||
mountPoint = "/run/secrets/${cfg.hostname}";
|
||||
}
|
||||
];
|
||||
interfaces = [ {
|
||||
interfaces = [
|
||||
{
|
||||
type = "tap";
|
||||
id = "vm-${cfg.hostname}";
|
||||
mac = "${cfg.macAddr}";
|
||||
} ];
|
||||
}
|
||||
];
|
||||
|
||||
hypervisor = "qemu";
|
||||
socket = "control.socket";
|
||||
|
@ -192,4 +200,3 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
{ config, pkgs, lib, inputs, modulesPath, ... }:
|
||||
{
|
||||
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
settings.experimental-features = ["nix-command" "flakes"];
|
||||
settings.trusted-users = ["root" "@wheel"];
|
||||
|
|
Loading…
Add table
Reference in a new issue