Compare commits
No commits in common. "781ce2d5e939da7cab8b4ae20ea9467fc68e16ec" and "d039cc313130d564c9b001580c9dac00c02bb604" have entirely different histories.
781ce2d5e9
...
d039cc3131
24 changed files with 506 additions and 620 deletions
389
flake.nix
389
flake.nix
|
@ -13,205 +13,200 @@
|
||||||
agenix.url = "github:yaxitech/ragenix";
|
agenix.url = "github:yaxitech/ragenix";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {
|
outputs = inputs@{ self, nixpkgs, home-manager, microvm, agenix, ... }:
|
||||||
self,
|
let
|
||||||
nixpkgs,
|
system = "x86_64-linux";
|
||||||
home-manager,
|
username = "tbarnouin";
|
||||||
microvm,
|
proxy_host = "192.168.1.40";
|
||||||
agenix,
|
pgsql_host = "192.168.1.13";
|
||||||
...
|
in
|
||||||
}: let
|
{
|
||||||
system = "x86_64-linux";
|
nixosConfigurations = {
|
||||||
username = "tbarnouin";
|
nixmox-curiosity = nixpkgs.lib.nixosSystem {
|
||||||
proxy_host = "192.168.1.40";
|
|
||||||
pgsql_host = "192.168.1.13";
|
|
||||||
in {
|
|
||||||
nixosConfigurations = {
|
|
||||||
nixmox-curiosity = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
./hosts/nixmox-curiosity/configuration.nix
|
|
||||||
{
|
|
||||||
networking.hostName = "nixmox-curiosity";
|
|
||||||
}
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.${username} = import ./hosts/nixmox-curiosity/home.nix;
|
|
||||||
}
|
|
||||||
microvm.nixosModules.host
|
|
||||||
{
|
|
||||||
microvm = {
|
|
||||||
autostart = [];
|
|
||||||
vms = {};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
inherit username;
|
|
||||||
inherit proxy_host;
|
|
||||||
inherit pgsql_host;
|
|
||||||
inherit system;
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
./hosts/nixmox-curiosity/configuration.nix
|
||||||
|
{
|
||||||
|
networking.hostName = "nixmox-curiosity";
|
||||||
|
}
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.${username} = import ./hosts/nixmox-curiosity/home.nix;
|
||||||
|
}
|
||||||
|
microvm.nixosModules.host
|
||||||
|
{
|
||||||
|
microvm = {
|
||||||
|
autostart = [];
|
||||||
|
vms = {};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
inherit username;
|
||||||
|
inherit proxy_host;
|
||||||
|
inherit pgsql_host;
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nginx = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||||
|
"${inputs.self}/systems/minimalLXCConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
networking.hostName = "nginx";
|
||||||
|
services.vm_nginx = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
onlyoffice = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||||
|
"${inputs.self}/systems/minimalLXCConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
networking.hostName = "onlyoffice";
|
||||||
|
services.vm_onlyoffice = {
|
||||||
|
enable = true;
|
||||||
|
pgsql_ip = pgsql_host;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# template = nixpkgs.lib.nixosSystem {
|
||||||
|
# inherit system;
|
||||||
|
# modules = [
|
||||||
|
# agenix.nixosModules.default
|
||||||
|
# "${inputs.self}/systems/minimalVMConfig.nix"
|
||||||
|
# {
|
||||||
|
# networking.hostName = "nixos";
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
jellyfin = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
microvm.nixosModules.microvm
|
||||||
|
"${inputs.self}/systems/minimalVMConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
services.vm_jellyfin = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
redis = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||||
|
"${inputs.self}/systems/minimalLXCConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
networking.hostName = "redis";
|
||||||
|
services.vm_redis = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
grafana-lxc = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||||
|
"${inputs.self}/systems/minimalLXCConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
services.vm_grafana = {
|
||||||
|
enable = true;
|
||||||
|
vm_ip = "192.168.1.27";
|
||||||
|
proxy_ip = proxy_host;
|
||||||
|
pgsql_ip = pgsql_host;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
grafana = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
microvm.nixosModules.microvm
|
||||||
|
"${inputs.self}/systems/minimalMicrovmConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
services.vm_grafana = {
|
||||||
|
enable = true;
|
||||||
|
vm_ip = "192.168.1.27";
|
||||||
|
proxy_ip = proxy_host;
|
||||||
|
pgsql_ip = pgsql_host;
|
||||||
|
};
|
||||||
|
services.micro_vm = {
|
||||||
|
enable = true;
|
||||||
|
hostname = "grafana";
|
||||||
|
vm_ip = "192.168.1.20";
|
||||||
|
vm_cpu = 1;
|
||||||
|
vm_mem = 512;
|
||||||
|
macAddr = "02:00:00:00:00:20";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
authentik = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
agenix.nixosModules.default
|
||||||
|
inputs.authentik-nix.nixosModules.default
|
||||||
|
{
|
||||||
|
services.authentik = {
|
||||||
|
enable = true;
|
||||||
|
environmentFile = "/run/secrets/authentik/authentik-env";
|
||||||
|
settings = {
|
||||||
|
disable_startup_analytics = true;
|
||||||
|
avatars = "initials";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.vm_authentik = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
microvm.nixosModules.microvm
|
||||||
|
"${inputs.self}/systems/minimalMicrovmConfig.nix"
|
||||||
|
"${inputs.self}/services"
|
||||||
|
{
|
||||||
|
microvm = {
|
||||||
|
volumes = [
|
||||||
|
{
|
||||||
|
mountPoint = "/media";
|
||||||
|
image = "/var/lib/microvms/authentik/media.img";
|
||||||
|
size = 2048;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
services.micro_vm = {
|
||||||
|
enable = true;
|
||||||
|
hostname = "authentik";
|
||||||
|
vm_ip = "192.168.1.25";
|
||||||
|
vm_cpu = 2;
|
||||||
|
vm_mem = 2048;
|
||||||
|
macAddr = "02:00:00:00:00:25";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nginx = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
|
||||||
"${inputs.self}/systems/minimalLXCConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
networking.hostName = "nginx";
|
|
||||||
services.vm_nginx = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
onlyoffice = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
|
||||||
"${inputs.self}/systems/minimalLXCConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
networking.hostName = "onlyoffice";
|
|
||||||
services.vm_onlyoffice = {
|
|
||||||
enable = true;
|
|
||||||
pgsql_ip = pgsql_host;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
# template = nixpkgs.lib.nixosSystem {
|
|
||||||
# inherit system;
|
|
||||||
# modules = [
|
|
||||||
# agenix.nixosModules.default
|
|
||||||
# "${inputs.self}/systems/minimalVMConfig.nix"
|
|
||||||
# {
|
|
||||||
# networking.hostName = "nixos";
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
jellyfin = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
microvm.nixosModules.microvm
|
|
||||||
"${inputs.self}/systems/minimalVMConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
services.vm_jellyfin = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
redis = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
|
||||||
"${inputs.self}/systems/minimalLXCConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
networking.hostName = "redis";
|
|
||||||
services.vm_redis = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
grafana-lxc = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
|
||||||
"${inputs.self}/systems/minimalLXCConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
services.vm_grafana = {
|
|
||||||
enable = true;
|
|
||||||
vm_ip = "192.168.1.27";
|
|
||||||
proxy_ip = proxy_host;
|
|
||||||
pgsql_ip = pgsql_host;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
grafana = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
microvm.nixosModules.microvm
|
|
||||||
"${inputs.self}/systems/minimalMicrovmConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
services.vm_grafana = {
|
|
||||||
enable = true;
|
|
||||||
vm_ip = "192.168.1.27";
|
|
||||||
proxy_ip = proxy_host;
|
|
||||||
pgsql_ip = pgsql_host;
|
|
||||||
};
|
|
||||||
services.micro_vm = {
|
|
||||||
enable = true;
|
|
||||||
hostname = "grafana";
|
|
||||||
vm_ip = "192.168.1.20";
|
|
||||||
vm_cpu = 1;
|
|
||||||
vm_mem = 512;
|
|
||||||
macAddr = "02:00:00:00:00:20";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
authentik = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
agenix.nixosModules.default
|
|
||||||
inputs.authentik-nix.nixosModules.default
|
|
||||||
{
|
|
||||||
services.authentik = {
|
|
||||||
enable = true;
|
|
||||||
environmentFile = "/run/secrets/authentik/authentik-env";
|
|
||||||
settings = {
|
|
||||||
disable_startup_analytics = true;
|
|
||||||
avatars = "initials";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.vm_authentik = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
microvm.nixosModules.microvm
|
|
||||||
"${inputs.self}/systems/minimalMicrovmConfig.nix"
|
|
||||||
"${inputs.self}/services"
|
|
||||||
{
|
|
||||||
microvm = {
|
|
||||||
volumes = [
|
|
||||||
{
|
|
||||||
mountPoint = "/media";
|
|
||||||
image = "/var/lib/microvms/authentik/media.img";
|
|
||||||
size = 2048;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
services.micro_vm = {
|
|
||||||
enable = true;
|
|
||||||
hostname = "authentik";
|
|
||||||
vm_ip = "192.168.1.25";
|
|
||||||
vm_cpu = 2;
|
|
||||||
vm_mem = 2048;
|
|
||||||
macAddr = "02:00:00:00:00:25";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
{ imports = [ ./hardware-configuration.nix ];
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [./hardware-configuration.nix];
|
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = ["nix-command" "flakes"];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
trusted-users = ["@wheel"];
|
trusted-users = [ "@wheel" ];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
};
|
};
|
||||||
gc = {
|
gc = {
|
||||||
|
@ -21,9 +17,9 @@
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
networking = {
|
networking= {
|
||||||
useNetworkd = true;
|
useNetworkd = true;
|
||||||
firewall.allowedTCPPorts = [22];
|
firewall.allowedTCPPorts = [ 22 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.network = {
|
systemd.network = {
|
||||||
|
@ -108,4 +104,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
|
{ lib, system, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
boot = {
|
boot = {
|
||||||
# use latest kernel
|
# use latest kernel
|
||||||
# kernelPackages = pkgs.linuxPackages_latest;
|
# kernelPackages = pkgs.linuxPackages_latest;
|
||||||
supportedFilesystems = ["ext4" "btrfs" "xfs" "fat" "vfat" "cifs" "nfs"];
|
supportedFilesystems = [ "ext4" "btrfs" "xfs" "fat" "vfat" "cifs" "nfs" ];
|
||||||
growPartition = true;
|
growPartition = true;
|
||||||
kernelModules = ["kvm-intel"];
|
kernelModules = [ "kvm-intel" ];
|
||||||
kernelParams = lib.mkForce [];
|
kernelParams = lib.mkForce [ ];
|
||||||
|
|
||||||
loader = {
|
loader = {
|
||||||
grub = {
|
grub = {
|
||||||
|
@ -22,8 +20,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = ["9p" "9pnet_virtio" "ata_piix" "uhci_hcd" "virtio_blk" "virtio_mmio" "virtio_net" "virtio_pci" "virtio_scsi"];
|
availableKernelModules = [ "9p" "9pnet_virtio" "ata_piix" "uhci_hcd" "virtio_blk" "virtio_mmio" "virtio_net" "virtio_pci" "virtio_scsi" ];
|
||||||
kernelModules = ["virtio_balloon" "virtio_console" "virtio_rng"];
|
kernelModules = [ "virtio_balloon" "virtio_console" "virtio_rng" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
|
@ -47,6 +45,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.fstrim = {
|
services.fstrim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "weekly";
|
interval = "weekly";
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
home = {
|
home = {
|
||||||
username = "tbarnouin";
|
username = "tbarnouin";
|
||||||
stateVersion = "24.11";
|
stateVersion = "24.11";
|
||||||
|
@ -78,16 +75,17 @@
|
||||||
};
|
};
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = [
|
plugins =
|
||||||
"git"
|
[
|
||||||
"terraform"
|
"git"
|
||||||
"sudo"
|
"terraform"
|
||||||
"docker"
|
"sudo"
|
||||||
"pip"
|
"docker"
|
||||||
"python"
|
"pip"
|
||||||
"pyenv"
|
"python"
|
||||||
"pipenv"
|
"pyenv"
|
||||||
];
|
"pipenv"
|
||||||
|
];
|
||||||
theme = "bira";
|
theme = "bira";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
{ imports = [ ./hardware-configuration.nix ];
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [./hardware-configuration.nix];
|
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = ["nix-command" "flakes"];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
trusted-users = ["@wheel"];
|
trusted-users = [ "@wheel" ];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
};
|
};
|
||||||
gc = {
|
gc = {
|
||||||
|
@ -21,9 +17,9 @@
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
networking = {
|
networking= {
|
||||||
useNetworkd = true;
|
useNetworkd = true;
|
||||||
firewall.allowedTCPPorts = [22];
|
firewall.allowedTCPPorts = [ 22 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.network = {
|
systemd.network = {
|
||||||
|
@ -108,4 +104,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
|
{ lib, system, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
boot = {
|
boot = {
|
||||||
# use latest kernel
|
# use latest kernel
|
||||||
# kernelPackages = pkgs.linuxPackages_latest;
|
# kernelPackages = pkgs.linuxPackages_latest;
|
||||||
supportedFilesystems = ["ext4" "btrfs" "xfs" "fat" "vfat" "cifs" "nfs"];
|
supportedFilesystems = [ "ext4" "btrfs" "xfs" "fat" "vfat" "cifs" "nfs" ];
|
||||||
growPartition = true;
|
growPartition = true;
|
||||||
kernelModules = ["kvm-intel"];
|
kernelModules = [ "kvm-intel" ];
|
||||||
kernelParams = lib.mkForce [];
|
kernelParams = lib.mkForce [ ];
|
||||||
|
|
||||||
loader = {
|
loader = {
|
||||||
grub = {
|
grub = {
|
||||||
|
@ -22,8 +20,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = ["9p" "9pnet_virtio" "ata_piix" "uhci_hcd" "virtio_blk" "virtio_mmio" "virtio_net" "virtio_pci" "virtio_scsi"];
|
availableKernelModules = [ "9p" "9pnet_virtio" "ata_piix" "uhci_hcd" "virtio_blk" "virtio_mmio" "virtio_net" "virtio_pci" "virtio_scsi" ];
|
||||||
kernelModules = ["virtio_balloon" "virtio_console" "virtio_rng"];
|
kernelModules = [ "virtio_balloon" "virtio_console" "virtio_rng" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
home = {
|
home = {
|
||||||
username = "tbarnouin";
|
username = "tbarnouin";
|
||||||
stateVersion = "24.11";
|
stateVersion = "24.11";
|
||||||
|
@ -78,16 +75,17 @@
|
||||||
};
|
};
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = [
|
plugins =
|
||||||
"git"
|
[
|
||||||
"terraform"
|
"git"
|
||||||
"sudo"
|
"terraform"
|
||||||
"docker"
|
"sudo"
|
||||||
"pip"
|
"docker"
|
||||||
"python"
|
"pip"
|
||||||
"pyenv"
|
"python"
|
||||||
"pipenv"
|
"pyenv"
|
||||||
];
|
"pipenv"
|
||||||
|
];
|
||||||
theme = "bira";
|
theme = "bira";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
24
secrets.nix
24
secrets.nix
|
@ -1,17 +1,19 @@
|
||||||
let
|
let
|
||||||
tbarnouin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos";
|
tbarnouin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos";
|
||||||
users = [tbarnouin];
|
users = [ tbarnouin ];
|
||||||
|
|
||||||
forgejo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF2NAam+nseSCzJV/1UTyO2LgMjx0xT7/vTOOi5EG9HV root@forgejo-runner";
|
forgejo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF2NAam+nseSCzJV/1UTyO2LgMjx0xT7/vTOOi5EG9HV root@forgejo-runner";
|
||||||
grafana = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDQxvO9vdd2f9aV4F3LEQrrTJaLwLvSLbLtjB9qNxc4z root@grafana";
|
grafana = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDQxvO9vdd2f9aV4F3LEQrrTJaLwLvSLbLtjB9qNxc4z root@grafana";
|
||||||
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 ];
|
||||||
"services/grafana/secrets/kuma-token.age".publicKeys = [tbarnouin grafana];
|
"services/grafana/secrets/kuma-token.age".publicKeys = [ tbarnouin grafana ];
|
||||||
"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 ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
{
|
{ 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";
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
networking = {
|
networking = {
|
||||||
firewall.allowedTCPPorts = [9000 9300 9443];
|
firewall.allowedTCPPorts = [ 9000 9300 9443 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{inputs, ...}: {
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nginx
|
./nginx
|
||||||
./gitea
|
./gitea
|
||||||
|
|
|
@ -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 {
|
||||||
|
@ -30,6 +27,6 @@ in {
|
||||||
passwordFile = "/run/secrets/gitea/gitea-dbpass";
|
passwordFile = "/run/secrets/gitea/gitea-dbpass";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [3000];
|
networking.firewall.allowedTCPPorts = [ 3000 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
@ -22,16 +19,16 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
age.secrets = {
|
age.secrets ={
|
||||||
grafana-db = {
|
grafana-db = {
|
||||||
file = ./secrets/grafana-db.age;
|
file = ./secrets/grafana-db.age;
|
||||||
owner = "grafana";
|
owner = "grafana";
|
||||||
};
|
};
|
||||||
grafana-oauth_secret = {
|
grafana-oauth_secret = {
|
||||||
file = ./secrets/grafana-oauth_secret.age;
|
file = ./secrets/grafana-oauth_secret.age;
|
||||||
owner = "grafana";
|
owner = "grafana";
|
||||||
};
|
};
|
||||||
kuma-token.file = ./secrets/kuma-token.age;
|
kuma-token.file = ./secrets/kuma-token.age;
|
||||||
};
|
};
|
||||||
services.rsyslogd = {
|
services.rsyslogd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -62,22 +59,22 @@ in {
|
||||||
serve_from_sub_path = false;
|
serve_from_sub_path = false;
|
||||||
};
|
};
|
||||||
database = {
|
database = {
|
||||||
type = "postgres";
|
type = "postgres";
|
||||||
host = "${cfg.pgsql_ip}:5432";
|
host = "${cfg.pgsql_ip}:5432";
|
||||||
name = "grafana";
|
name = "grafana";
|
||||||
user = "grafana";
|
user = "grafana";
|
||||||
password = "\$__file{${config.age.secrets.grafana-db.path}}";
|
password = "\$__file{${config.age.secrets.grafana-db.path}}";
|
||||||
};
|
};
|
||||||
"auth.generic_oauth" = {
|
"auth.generic_oauth" = {
|
||||||
enabled = "true";
|
enabled = "true";
|
||||||
name = "authentik";
|
name = "authentik";
|
||||||
allow_sign_up = "true";
|
allow_sign_up = "true";
|
||||||
client_id = "9HV82G8F92Jcbw4nP8eppMcPpLcAw5uYpejfReLy";
|
client_id = "9HV82G8F92Jcbw4nP8eppMcPpLcAw5uYpejfReLy";
|
||||||
client_secret = "\$__file{${config.age.secrets.grafana-oauth_secret.path}}";
|
client_secret = "\$__file{${config.age.secrets.grafana-oauth_secret.path}}";
|
||||||
scopes = "openid email profile";
|
scopes = "openid email profile";
|
||||||
auth_url = "https://authentik.le43.eu/application/o/authorize/";
|
auth_url = "https://authentik.le43.eu/application/o/authorize/";
|
||||||
token_url = "https://authentik.le43.eu/application/o/token/";
|
token_url = "https://authentik.le43.eu/application/o/token/";
|
||||||
api_url = "https://authentik.le43.eu/application/o/userinfo/";
|
api_url = "https://authentik.le43.eu/application/o/userinfo/";
|
||||||
role_attribute_path = "contains(groups, 'admin') && 'Admin' || contains(groups, 'admin') && 'Editor' || 'Viewer';role_attribute_strict = false";
|
role_attribute_path = "contains(groups, 'admin') && 'Admin' || contains(groups, 'admin') && 'Editor' || 'Viewer';role_attribute_strict = false";
|
||||||
allow_assign_grafana_admin = "true";
|
allow_assign_grafana_admin = "true";
|
||||||
};
|
};
|
||||||
|
@ -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,18 +202,16 @@ 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";
|
schema = "v13";
|
||||||
schema = "v13";
|
index = {
|
||||||
index = {
|
prefix = "index_";
|
||||||
prefix = "index_";
|
period = "24h";
|
||||||
period = "24h";
|
};
|
||||||
};
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
storage_config = {
|
storage_config = {
|
||||||
boltdb_shipper = {
|
boltdb_shipper = {
|
||||||
|
@ -290,16 +255,14 @@ 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";
|
||||||
syslog = {
|
syslog = {
|
||||||
listen_address = "0.0.0.0:1514";
|
listen_address = "0.0.0.0:1514";
|
||||||
listen_protocol = "tcp";
|
listen_protocol = "tcp";
|
||||||
idle_timeout = "60s";
|
idle_timeout = "60s";
|
||||||
labels = {
|
labels = {
|
||||||
|
@ -308,27 +271,27 @@ in {
|
||||||
};
|
};
|
||||||
relabel_configs = [
|
relabel_configs = [
|
||||||
{
|
{
|
||||||
source_labels = ["__syslog_message_hostname"];
|
source_labels = [ "__syslog_message_hostname" ];
|
||||||
target_label = "host";
|
target_label = "host";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
source_labels = ["__syslog_message_hostname"];
|
source_labels = [ "__syslog_message_hostname" ];
|
||||||
target_label = "hostname";
|
target_label = "hostname";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
source_labels = ["__syslog_message_severity"];
|
source_labels = [ "__syslog_message_severity" ];
|
||||||
target_label = "level";
|
target_label = "level";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
source_labels = ["__syslog_message_app_name"];
|
source_labels = [ "__syslog_message_app_name" ];
|
||||||
target_label = "application";
|
target_label = "application";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
source_labels = ["__syslog_message_facility"];
|
source_labels = [ "__syslog_message_facility" ];
|
||||||
target_label = "facility";
|
target_label = "facility";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
source_labels = ["__syslog_connection_hostname"];
|
source_labels = [ "__syslog_connection_hostname" ];
|
||||||
target_label = "connection_hostname";
|
target_label = "connection_hostname";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -338,7 +301,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
networking.firewall.allowedTCPPorts = [3000 3100 3101 8086 9001 1514 514];
|
networking.firewall.allowedTCPPorts = [ 3000 3100 3101 8086 9001 1514 514 ];
|
||||||
networking.firewall.allowedUDPPorts = [514];
|
networking.firewall.allowedUDPPorts = [ 514 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
{
|
{ 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";
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = [pkgs.cifs-utils];
|
environment.systemPackages = [ pkgs.cifs-utils ];
|
||||||
services.jellyfin = {
|
services.jellyfin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "tbarnouin";
|
user = "tbarnouin";
|
||||||
|
|
|
@ -1,25 +1,20 @@
|
||||||
|
{ config, pkgs, lib, inputs, modulesPath, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
./lxc.nix
|
./lxc.nix
|
||||||
./vm.nix
|
./vm.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
settings.experimental-features = ["nix-command" "flakes"];
|
settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
settings.trusted-users = ["root" "@wheel"];
|
settings.trusted-users = [ "root" "@wheel" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [22 9002];
|
allowedTCPPorts = [ 22 9002 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +22,7 @@
|
||||||
console.keyMap = "fr";
|
console.keyMap = "fr";
|
||||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||||
environment.sessionVariables = rec {
|
environment.sessionVariables = rec {
|
||||||
TERM = "xterm-256color";
|
TERM = "xterm-256color";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
|
@ -40,7 +35,7 @@
|
||||||
users = {
|
users = {
|
||||||
users.tbarnouin = {
|
users.tbarnouin = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["wheel"];
|
extraGroups = [ "wheel" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
||||||
|
@ -63,7 +58,7 @@
|
||||||
};
|
};
|
||||||
ohMyZsh = {
|
ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = ["git"];
|
plugins = [ "git" ];
|
||||||
theme = "bira";
|
theme = "bira";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -75,21 +70,21 @@
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
environment = {
|
environment = {
|
||||||
localBinInPath = true;
|
localBinInPath = true;
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
bash
|
bash
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
git
|
git
|
||||||
htop
|
htop
|
||||||
tree
|
tree
|
||||||
dig
|
dig
|
||||||
ncdu
|
ncdu
|
||||||
nmap
|
nmap
|
||||||
iperf3
|
iperf3
|
||||||
netcat-openbsd
|
netcat-openbsd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
openssh = {
|
openssh = {
|
||||||
|
@ -115,7 +110,7 @@
|
||||||
exporters = {
|
exporters = {
|
||||||
node = {
|
node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enabledCollectors = ["systemd"];
|
enabledCollectors = [ "systemd" ];
|
||||||
port = 9002;
|
port = 9002;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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";
|
||||||
};
|
};
|
||||||
|
|
|
@ -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";
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 {
|
||||||
|
@ -56,8 +53,8 @@ in {
|
||||||
"opcache.memory_consumption" = "512";
|
"opcache.memory_consumption" = "512";
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
trusted_proxies = ["${cfg.proxy_ip}"];
|
trusted_proxies = [ "${cfg.proxy_ip}" ];
|
||||||
trusted_domains = ["${cfg.proxy_ip}"];
|
trusted_domains = [ "${cfg.proxy_ip}" ];
|
||||||
overwriteprotocol = "http";
|
overwriteprotocol = "http";
|
||||||
overwrite.cli.url = "http://${cfg.proxy_ip}/cloud/";
|
overwrite.cli.url = "http://${cfg.proxy_ip}/cloud/";
|
||||||
"overwritehost" = "${cfg.proxy_ip}";
|
"overwritehost" = "${cfg.proxy_ip}";
|
||||||
|
@ -71,11 +68,11 @@ in {
|
||||||
dbuser = "nextcloud";
|
dbuser = "nextcloud";
|
||||||
dbtype = "pgsql";
|
dbtype = "pgsql";
|
||||||
dbpassFile = "/run/secrets/nextcloud/nextcloud-dbpass";
|
dbpassFile = "/run/secrets/nextcloud/nextcloud-dbpass";
|
||||||
adminuser = "tbarnouin";
|
adminuser = "tbarnouin";
|
||||||
adminpassFile = "/run/secrets/nextcloud/nextcloud-adminpass";
|
adminpassFile = "/run/secrets/nextcloud/nextcloud-adminpass";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [80];
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,18 +146,9 @@ in {
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"actual.le43.eu" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://192.168.1.125:5006";
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [80 443];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
@ -16,11 +13,11 @@ in {
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
office-dbpass = {
|
office-dbpass = {
|
||||||
file = ./secrets/office-dbpass.age;
|
file = ./secrets/office-dbpass.age;
|
||||||
owner = "onlyoffice";
|
owner = "onlyoffice";
|
||||||
};
|
};
|
||||||
office-jwtpass = {
|
office-jwtpass = {
|
||||||
file = ./secrets/office-jwtpass.age;
|
file = ./secrets/office-jwtpass.age;
|
||||||
owner = "onlyoffice";
|
owner = "onlyoffice";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -36,6 +33,6 @@ in {
|
||||||
jwtSecretFile = config.age.secrets.office-jwtpass.path;
|
jwtSecretFile = config.age.secrets.office-jwtpass.path;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [80 4369 5432 5672 6379 8000 8080];
|
networking.firewall.allowedTCPPorts = [ 80 4369 5432 5672 6379 8000 8080 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
};
|
};
|
||||||
|
@ -47,6 +44,6 @@ in {
|
||||||
alter user nextcloud with password 'password';
|
alter user nextcloud with password 'password';
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [5432];
|
networking.firewall.allowedTCPPorts = [ 5432 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
};
|
};
|
||||||
|
@ -21,6 +18,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [6379];
|
networking.firewall.allowedTCPPorts = [ 6379 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
|
{ 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" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [22 9002];
|
allowedTCPPorts = [ 22 9002 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +30,7 @@
|
||||||
console.keyMap = "fr";
|
console.keyMap = "fr";
|
||||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||||
environment.sessionVariables = rec {
|
environment.sessionVariables = rec {
|
||||||
TERM = "xterm-256color";
|
TERM = "xterm-256color";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
|
@ -48,7 +43,7 @@
|
||||||
users = {
|
users = {
|
||||||
users.tbarnouin = {
|
users.tbarnouin = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["wheel"];
|
extraGroups = [ "wheel" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
||||||
|
@ -71,7 +66,7 @@
|
||||||
};
|
};
|
||||||
ohMyZsh = {
|
ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = ["git"];
|
plugins = [ "git" ];
|
||||||
theme = "bira";
|
theme = "bira";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -83,21 +78,21 @@
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
environment = {
|
environment = {
|
||||||
localBinInPath = true;
|
localBinInPath = true;
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
bash
|
bash
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
git
|
git
|
||||||
htop
|
htop
|
||||||
tree
|
tree
|
||||||
dig
|
dig
|
||||||
ncdu
|
ncdu
|
||||||
nmap
|
nmap
|
||||||
iperf3
|
iperf3
|
||||||
netcat-openbsd
|
netcat-openbsd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
openssh = {
|
openssh = {
|
||||||
|
@ -123,7 +118,7 @@
|
||||||
exporters = {
|
exporters = {
|
||||||
node = {
|
node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enabledCollectors = ["systemd"];
|
enabledCollectors = [ "systemd" ];
|
||||||
port = 9002;
|
port = 9002;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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";
|
||||||
|
@ -84,14 +76,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
settings.experimental-features = ["nix-command" "flakes"];
|
settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
settings.trusted-users = ["root" "@wheel"];
|
settings.trusted-users = [ "root" "@wheel" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [22 9002];
|
allowedTCPPorts = [ 22 9002 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,7 +91,7 @@ in {
|
||||||
console.keyMap = "fr";
|
console.keyMap = "fr";
|
||||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||||
environment.sessionVariables = rec {
|
environment.sessionVariables = rec {
|
||||||
TERM = "xterm-256color";
|
TERM = "xterm-256color";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
|
@ -112,7 +104,7 @@ in {
|
||||||
users = {
|
users = {
|
||||||
users.tbarnouin = {
|
users.tbarnouin = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["wheel"];
|
extraGroups = [ "wheel" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
||||||
|
@ -135,7 +127,7 @@ in {
|
||||||
};
|
};
|
||||||
ohMyZsh = {
|
ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = ["git"];
|
plugins = [ "git" ];
|
||||||
theme = "bira";
|
theme = "bira";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -147,21 +139,21 @@ in {
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
environment = {
|
environment = {
|
||||||
localBinInPath = true;
|
localBinInPath = true;
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
bash
|
bash
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
git
|
git
|
||||||
htop
|
htop
|
||||||
tree
|
tree
|
||||||
dig
|
dig
|
||||||
ncdu
|
ncdu
|
||||||
nmap
|
nmap
|
||||||
iperf3
|
iperf3
|
||||||
netcat-openbsd
|
netcat-openbsd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
openssh = {
|
openssh = {
|
||||||
|
@ -187,7 +179,7 @@ in {
|
||||||
exporters = {
|
exporters = {
|
||||||
node = {
|
node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enabledCollectors = ["systemd"];
|
enabledCollectors = [ "systemd" ];
|
||||||
port = 9002;
|
port = 9002;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -200,3 +192,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
|
{ 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" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [22 9002];
|
allowedTCPPorts = [ 22 9002 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,7 +17,7 @@
|
||||||
console.keyMap = "fr";
|
console.keyMap = "fr";
|
||||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||||
environment.sessionVariables = rec {
|
environment.sessionVariables = rec {
|
||||||
TERM = "xterm-256color";
|
TERM = "xterm-256color";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
|
@ -35,7 +30,7 @@
|
||||||
users = {
|
users = {
|
||||||
users.tbarnouin = {
|
users.tbarnouin = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["wheel"];
|
extraGroups = [ "wheel" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxccGxdfOFXeEClqz3ULl94ubzaJnk4pUus+ek18G0B tbarnouin@nixos"
|
||||||
|
@ -58,7 +53,7 @@
|
||||||
};
|
};
|
||||||
ohMyZsh = {
|
ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = ["git"];
|
plugins = [ "git" ];
|
||||||
theme = "bira";
|
theme = "bira";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -70,21 +65,21 @@
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
environment = {
|
environment = {
|
||||||
localBinInPath = true;
|
localBinInPath = true;
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
bash
|
bash
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
git
|
git
|
||||||
htop
|
htop
|
||||||
tree
|
tree
|
||||||
dig
|
dig
|
||||||
ncdu
|
ncdu
|
||||||
nmap
|
nmap
|
||||||
iperf3
|
iperf3
|
||||||
netcat-openbsd
|
netcat-openbsd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
cloud-init.network.enable = true;
|
cloud-init.network.enable = true;
|
||||||
|
@ -111,7 +106,7 @@
|
||||||
exporters = {
|
exporters = {
|
||||||
node = {
|
node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enabledCollectors = ["systemd"];
|
enabledCollectors = [ "systemd" ];
|
||||||
port = 9002;
|
port = 9002;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue