Compare commits

..

No commits in common. "781ce2d5e939da7cab8b4ae20ea9467fc68e16ec" and "d039cc313130d564c9b001580c9dac00c02bb604" have entirely different histories.

24 changed files with 506 additions and 620 deletions

View file

@ -13,19 +13,14 @@
agenix.url = "github:yaxitech/ragenix"; agenix.url = "github:yaxitech/ragenix";
}; };
outputs = inputs @ { outputs = inputs@{ self, nixpkgs, home-manager, microvm, agenix, ... }:
self, let
nixpkgs,
home-manager,
microvm,
agenix,
...
}: let
system = "x86_64-linux"; system = "x86_64-linux";
username = "tbarnouin"; username = "tbarnouin";
proxy_host = "192.168.1.40"; proxy_host = "192.168.1.40";
pgsql_host = "192.168.1.13"; pgsql_host = "192.168.1.13";
in { in
{
nixosConfigurations = { nixosConfigurations = {
nixmox-curiosity = nixpkgs.lib.nixosSystem { nixmox-curiosity = nixpkgs.lib.nixosSystem {
inherit system; inherit system;

View file

@ -1,10 +1,6 @@
{ { config, lib, pkgs, ... }:
config,
lib, { imports = [ ./hardware-configuration.nix ];
pkgs,
...
}: {
imports = [./hardware-configuration.nix];
nix = { nix = {
settings = { settings = {
@ -108,4 +104,5 @@
}; };
system.stateVersion = "24.11"; # Did you read the comment? system.stateVersion = "24.11"; # Did you read the comment?
} }

View file

@ -1,8 +1,6 @@
{ lib, system, ... }:
{ {
lib,
system,
...
}: {
boot = { boot = {
# use latest kernel # use latest kernel
# kernelPackages = pkgs.linuxPackages_latest; # kernelPackages = pkgs.linuxPackages_latest;
@ -47,6 +45,7 @@
}; };
}; };
services.fstrim = { services.fstrim = {
enable = true; enable = true;
interval = "weekly"; interval = "weekly";

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
home = { home = {
username = "tbarnouin"; username = "tbarnouin";
stateVersion = "24.11"; stateVersion = "24.11";
@ -78,7 +75,8 @@
}; };
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
plugins = [ plugins =
[
"git" "git"
"terraform" "terraform"
"sudo" "sudo"

View file

@ -1,10 +1,6 @@
{ { config, lib, pkgs, ... }:
config,
lib, { imports = [ ./hardware-configuration.nix ];
pkgs,
...
}: {
imports = [./hardware-configuration.nix];
nix = { nix = {
settings = { settings = {
@ -108,4 +104,5 @@
}; };
system.stateVersion = "24.11"; # Did you read the comment? system.stateVersion = "24.11"; # Did you read the comment?
} }

View file

@ -1,8 +1,6 @@
{ lib, system, ... }:
{ {
lib,
system,
...
}: {
boot = { boot = {
# use latest kernel # use latest kernel
# kernelPackages = pkgs.linuxPackages_latest; # kernelPackages = pkgs.linuxPackages_latest;

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
home = { home = {
username = "tbarnouin"; username = "tbarnouin";
stateVersion = "24.11"; stateVersion = "24.11";
@ -78,7 +75,8 @@
}; };
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
plugins = [ plugins =
[
"git" "git"
"terraform" "terraform"
"sudo" "sudo"

View file

@ -7,7 +7,8 @@ let
onlyoffice = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGbnzv2/Or4XdQXLDjIbr7oIDTQEvgSMTX4aiNCQk4tC root@onlyoffice"; onlyoffice = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGbnzv2/Or4XdQXLDjIbr7oIDTQEvgSMTX4aiNCQk4tC root@onlyoffice";
systems = [ forgejo grafana ]; systems = [ forgejo grafana ];
in { in
{
"secrets/initialPassword.age".publicKeys = users ++ systems; "secrets/initialPassword.age".publicKeys = users ++ systems;
"services/grafana/secrets/grafana-db.age".publicKeys = [ tbarnouin grafana ]; "services/grafana/secrets/grafana-db.age".publicKeys = [ tbarnouin grafana ];
"services/grafana/secrets/grafana-oauth_secret.age".publicKeys = [ tbarnouin grafana ]; "services/grafana/secrets/grafana-oauth_secret.age".publicKeys = [ tbarnouin grafana ];
@ -15,3 +16,4 @@ in {
"services/onlyoffice/secrets/office-dbpass.age".publicKeys = [ tbarnouin onlyoffice ]; "services/onlyoffice/secrets/office-dbpass.age".publicKeys = [ tbarnouin onlyoffice ];
"services/onlyoffice/secrets/office-jwtpass.age".publicKeys = [ tbarnouin onlyoffice ]; "services/onlyoffice/secrets/office-jwtpass.age".publicKeys = [ tbarnouin onlyoffice ];
} }

View file

@ -1,12 +1,8 @@
{ { inputs, config, lib, authentik-nix, ... }:
inputs, let
config,
lib,
authentik-nix,
...
}: let
cfg = config.services.vm_authentik; cfg = config.services.vm_authentik;
in { in
{
options.services.vm_authentik = { options.services.vm_authentik = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
}; };

View file

@ -1,4 +1,5 @@
{inputs, ...}: { { inputs, ... }:
{
imports = [ imports = [
./nginx ./nginx
./gitea ./gitea

View file

@ -1,11 +1,8 @@
{ { config, pkgs, lib, ... }:
config, let
pkgs,
lib,
...
}: let
cfg = config.services.vm_gitea; cfg = config.services.vm_gitea;
in { in
{
options.services.vm_gitea = { options.services.vm_gitea = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
db_ip = lib.mkOption { db_ip = lib.mkOption {

View file

@ -1,11 +1,8 @@
{ { lib, config, pkgs, ... }:
lib, let
config,
pkgs,
...
}: let
cfg = config.services.vm_grafana; cfg = config.services.vm_grafana;
in { in
{
options.services.vm_grafana = { options.services.vm_grafana = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
vm_ip = lib.mkOption { vm_ip = lib.mkOption {
@ -91,125 +88,95 @@ in {
job_name = "kuma"; job_name = "kuma";
scrape_interval = "30s"; scrape_interval = "30s";
scheme = "http"; scheme = "http";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.90:3001" ]; targets = [ "192.168.1.90:3001" ];
} }];
];
basic_auth.username = "tbarnouin"; basic_auth.username = "tbarnouin";
basic_auth.password_file = config.age.secrets.kuma-token.path; basic_auth.password_file = config.age.secrets.kuma-token.path;
} }
{ {
job_name = "grafana"; job_name = "grafana";
static_configs = [ static_configs = [{
{
targets = [ "127.0.0.1:9002" ]; targets = [ "127.0.0.1:9002" ];
} }];
];
} }
{ {
job_name = "openmediavault_cadvisor"; job_name = "openmediavault_cadvisor";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.125:8080" ]; targets = [ "192.168.1.125:8080" ];
} }];
];
} }
{ {
job_name = "opportunity"; job_name = "opportunity";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.125:9100" ]; targets = [ "192.168.1.125:9100" ];
} }];
];
} }
{ {
job_name = "nginx"; job_name = "nginx";
static_configs = [ static_configs = [{
{
targets = [ "${cfg.proxy_ip}:9002" ]; targets = [ "${cfg.proxy_ip}:9002" ];
} }];
];
} }
{ {
job_name = "redis"; job_name = "redis";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.16:9002" ]; targets = [ "192.168.1.16:9002" ];
} }];
];
} }
{ {
job_name = "ingenuity"; job_name = "ingenuity";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.90:9100" ]; targets = [ "192.168.1.90:9100" ];
} }];
];
} }
{ {
job_name = "gitea"; job_name = "gitea";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.14:9100" ]; targets = [ "192.168.1.14:9100" ];
} }];
];
} }
{ {
job_name = "postgresql"; job_name = "postgresql";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.13:9100" ]; targets = [ "192.168.1.13:9100" ];
} }];
];
} }
{ {
job_name = "nextcloud"; job_name = "nextcloud";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.44:9100" ]; targets = [ "192.168.1.44:9100" ];
} }];
];
} }
{ {
job_name = "deluge"; job_name = "deluge";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.18:9100" ]; targets = [ "192.168.1.18:9100" ];
} }];
];
} }
{ {
job_name = "netbox"; job_name = "netbox";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.45:9100" ]; targets = [ "192.168.1.45:9100" ];
} }];
];
} }
{ {
job_name = "jellyfin"; job_name = "jellyfin";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.42:9100" ]; targets = [ "192.168.1.42:9100" ];
} }];
];
} }
{ {
job_name = "authentik-ldap"; job_name = "authentik-ldap";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.41:9100" ]; targets = [ "192.168.1.41:9100" ];
} }];
];
} }
{ {
job_name = "authentik"; job_name = "authentik";
static_configs = [ static_configs = [{
{
targets = [ "192.168.1.25:9002" ]; targets = [ "192.168.1.25:9002" ];
} }];
];
} }
]; ];
}; };
@ -235,8 +202,7 @@ in {
chunk_retain_period = "30s"; chunk_retain_period = "30s";
}; };
schema_config = { schema_config = {
configs = [ configs = [{
{
from = "2022-06-06"; from = "2022-06-06";
store = "boltdb-shipper"; store = "boltdb-shipper";
object_store = "filesystem"; object_store = "filesystem";
@ -245,8 +211,7 @@ in {
prefix = "index_"; prefix = "index_";
period = "24h"; period = "24h";
}; };
} }];
];
}; };
storage_config = { storage_config = {
boltdb_shipper = { boltdb_shipper = {
@ -290,11 +255,9 @@ in {
positions = { positions = {
filename = "/tmp/positions.yaml"; filename = "/tmp/positions.yaml";
}; };
clients = [ clients = [{
{
url = "http://127.0.0.1:3100/loki/api/v1/push"; url = "http://127.0.0.1:3100/loki/api/v1/push";
} }];
];
scrape_configs = [ scrape_configs = [
{ {
job_name = "syslog"; job_name = "syslog";

View file

@ -1,11 +1,8 @@
{ { lib, config, pkgs, ... }:
lib, let
config,
pkgs,
...
}: let
cfg = config.services.vm_jellyfin; cfg = config.services.vm_jellyfin;
in { in
{
options.services.vm_jellyfin = { options.services.vm_jellyfin = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
}; };

View file

@ -1,11 +1,6 @@
{ config, pkgs, lib, inputs, modulesPath, ... }:
{ {
config,
pkgs,
lib,
inputs,
modulesPath,
...
}: {
imports = [ imports = [
./lxc.nix ./lxc.nix
./vm.nix ./vm.nix

View file

@ -1,11 +1,8 @@
{ {lib, config, modulesPath, ...}:
lib, let
config,
modulesPath,
...
}: let
cfg = config.services.lxc; cfg = config.services.lxc;
in { in
{
options.services.lxc = { options.services.lxc = {
enable = lib.mkEnableOption "Enable LXC container config"; enable = lib.mkEnableOption "Enable LXC container config";
}; };

View file

@ -1,11 +1,8 @@
{ {lib, config, modulesPath, ...}:
lib, let
config,
modulesPath,
...
}: let
cfg = config.services.vm; cfg = config.services.vm;
in { in
{
options.services.vm = { options.services.vm = {
enable = lib.mkEnableOption "Enable LXC container config"; enable = lib.mkEnableOption "Enable LXC container config";
}; };

View file

@ -1,11 +1,8 @@
{ { lib, config, pkgs, ... }:
lib, let
config,
pkgs,
...
}: let
cfg = config.services.vm_nextcloud; cfg = config.services.vm_nextcloud;
in { in
{
options.services.vm_nextcloud = { options.services.vm_nextcloud = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
proxy_ip = lib.mkOption { proxy_ip = lib.mkOption {

View file

@ -1,11 +1,8 @@
{ { config, pkgs, lib, ... }:
config, let
pkgs,
lib,
...
}: let
cfg = config.services.vm_nginx; cfg = config.services.vm_nginx;
in { in
{
options.services.vm_nginx = { options.services.vm_nginx = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
}; };
@ -149,15 +146,6 @@ in {
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
"actual.le43.eu" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://192.168.1.125:5006";
recommendedProxySettings = true;
proxyWebsockets = true;
};
};
}; };
}; };
}; };

View file

@ -1,11 +1,8 @@
{ { config, pkgs, lib, ... }:
config, let
pkgs,
lib,
...
}: let
cfg = config.services.vm_onlyoffice; cfg = config.services.vm_onlyoffice;
in { in
{
options.services.vm_onlyoffice = { options.services.vm_onlyoffice = {
enable = lib.mkEnableOption "Enable OnlyOffice service"; enable = lib.mkEnableOption "Enable OnlyOffice service";
pgsql_ip = lib.mkOption { pgsql_ip = lib.mkOption {

View file

@ -1,11 +1,8 @@
{ { lib, config, pkgs, ... }:
lib, let
config,
pkgs,
...
}: let
cfg = config.services.vm_postgresql; cfg = config.services.vm_postgresql;
in { in
{
options.services.vm_postgresql = { options.services.vm_postgresql = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
}; };

View file

@ -1,11 +1,8 @@
{ { config, pkgs, lib, ... }:
config, let
pkgs,
lib,
...
}: let
cfg = config.services.vm_redis; cfg = config.services.vm_redis;
in { in
{
options.services.vm_redis = { options.services.vm_redis = {
enable = lib.mkEnableOption "Enable minimal config"; enable = lib.mkEnableOption "Enable minimal config";
}; };

View file

@ -1,11 +1,6 @@
{ config, pkgs, lib, inputs, modulesPath, ... }:
{ {
config,
pkgs,
lib,
inputs,
modulesPath,
...
}: {
nix = { nix = {
settings.experimental-features = [ "nix-command" "flakes" ]; settings.experimental-features = [ "nix-command" "flakes" ];
settings.trusted-users = [ "root" "@wheel" ]; settings.trusted-users = [ "root" "@wheel" ];

View file

@ -1,14 +1,8 @@
{ { config, pkgs, lib, inputs, modulesPath, microvm, ... }:
config, let
pkgs,
lib,
inputs,
modulesPath,
microvm,
...
}: let
cfg = config.services.micro_vm; cfg = config.services.micro_vm;
in { in
{
options.services.micro_vm = { options.services.micro_vm = {
enable = lib.mkEnableOption "Enable NixOS microvm config"; enable = lib.mkEnableOption "Enable NixOS microvm config";
hostname = lib.mkOption { hostname = lib.mkOption {
@ -59,13 +53,11 @@ in {
mountPoint = "/run/secrets/${cfg.hostname}"; mountPoint = "/run/secrets/${cfg.hostname}";
} }
]; ];
interfaces = [ interfaces = [ {
{
type = "tap"; type = "tap";
id = "vm-${cfg.hostname}"; id = "vm-${cfg.hostname}";
mac = "${cfg.macAddr}"; mac = "${cfg.macAddr}";
} } ];
];
hypervisor = "qemu"; hypervisor = "qemu";
socket = "control.socket"; socket = "control.socket";
@ -200,3 +192,4 @@ in {
}; };
}; };
} }

View file

@ -1,11 +1,6 @@
{ config, pkgs, lib, inputs, modulesPath, ... }:
{ {
config,
pkgs,
lib,
inputs,
modulesPath,
...
}: {
nix = { nix = {
settings.experimental-features = [ "nix-command" "flakes" ]; settings.experimental-features = [ "nix-command" "flakes" ];
settings.trusted-users = [ "root" "@wheel" ]; settings.trusted-users = [ "root" "@wheel" ];