(feat): reformatted code for flakes usage

This commit is contained in:
Harry 2024-08-16 15:28:32 +02:00
parent d29d6f0133
commit c3956d6fa4
40 changed files with 130 additions and 76 deletions

View file

@ -11,7 +11,7 @@
{ {
imports = [ imports = [
./vm-hardware.nix # or hardware-configuration.nix ./hardware/vm-hardware.nix # or hardware-configuration.nix
./server-configuration.nix ./server-configuration.nix
"${(import ./nix/sources.nix).sops-nix}/modules/sops" "${(import ./nix/sources.nix).sops-nix}/modules/sops"
]; ];
@ -33,6 +33,11 @@
keyMap = "fr"; keyMap = "fr";
}; };
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
users.users.homelab = { users.users.homelab = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ extraGroups = [
@ -45,7 +50,6 @@
neovim neovim
btop btop
tree tree
git
]; ];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
@ -60,11 +64,14 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. git
nvim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
curl curl
niv niv
]; ];
environment.variables.EDITOR = "nvim";
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true; # programs.mtr.enable = true;

View file

@ -1,11 +0,0 @@
let
pkgs = import <nixpkgs> { };
in
{
name = "caddy";
buildInputs = with pkgs; [
xcaddy
go
];
}

View file

@ -1,41 +0,0 @@
{ config, lib, ... }:
{
services.caddy = {
enable = true;
virtualHosts.":5050".extraConfig = ''
reverse_proxy :8083
'';
/*
virtualHosts."sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :8003
'';
*/
virtualHosts."git.hypervirtual.world".extraConfig = ''
reverse_proxy :3333
'';
virtualHosts."photos.hypervirtual.world".extraConfig = ''
reverse_proxy :2342
'';
virtualHosts."books.hypervirtual.world".extraConfig = ''
reverse_proxy :8083
'';
virtualHosts."fish.hypervirtual.world".extraConfig = ''
reverse_proxy :3030
'';
virtualHosts.":2344".extraConfig = ''
reverse_proxy :2342
'';
/*
virtualHosts."jellyfin.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :8096
'';
*/
};
}

View file

69
features/server/caddy.nix Normal file
View file

@ -0,0 +1,69 @@
{ config, lib, ... }:
{
services.caddy = {
enable = true;
virtualHosts = {
":5050".extraConfig = ''
reverse_proxy :8083
'';
"sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :8003
'';
"git.hypervirtual.world".extraConfig = ''
reverse_proxy :3333
'';
"photos.hypervirtual.world".extraConfig = ''
reverse_proxy :2342
'';
"books.hypervirtual.world".extraConfig = ''
reverse_proxy :8083
'';
"fish.hypervirtual.world".extraConfig = ''
reverse_proxy :3030
'';
":2344".extraConfig = ''
reverse_proxy :2342
'';
"jellyfin.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :8096
'';
"slskd.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :5030
'';
"radarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :7878
'';
"sonarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :8989
'';
"sonarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :8999
'';
"prowlarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :9696
'';
"grafana.sisyphe.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :3000
'';
"status.normandy.hypervirtual.world".extraConfig = ''
reverse_proxy :4000
'';
};
};
}

View file

@ -4,7 +4,7 @@
imports = [ imports = [
./crafty-controller.nix ./crafty-controller.nix
./flaresolverr.nix ./flaresolverr.nix
# ./freshrss.nix ./freshrss.nix
./sonarr.nix ./sonarr.nix
#./pihole-exporter.nix #./pihole-exporter.nix
]; ];

View file

@ -14,7 +14,7 @@ in
config = { config = {
sops.secrets.slskd = { sops.secrets.slskd = {
sopsFile = ../../secrets/slskd.env; sopsFile = ../../../secrets/slskd.env;
format = "dotenv"; format = "dotenv";
}; };

View file

@ -16,7 +16,7 @@ in
config = { config = {
sops.secrets.transmission = { sops.secrets.transmission = {
sopsFile = ../../secrets/transmission.json; sopsFile = ../../../secrets/transmission.json;
path = "/var/lib/secrets/transmission/settings.json"; path = "/var/lib/secrets/transmission/settings.json";
}; };

View file

@ -0,0 +1,5 @@
U2FsdGVkX18oY3efQYeXqacnpNaOkre/hn/Ck1shbtZiKPQbD7G+tdQBjxPdZxIL
7oZi2qay/Z6ZKgjmd5zMW+jFejxl9/PSbDFbydn3nADkOCgPO5QSjN2QX+cswV/T
MlSQovYhJzhBgy37cPNU4oZBM8u5ZyRKLgBdUcbaKOJShyzirwKaKdn4abN0QC9B
nPIRIY5INzJPDHJEi/hgOfp4PLeiJTOvrGjvKF2N65f4Uyi8BOW3NSDK+qp6VcUI
tfF/C6r6XQF4w3p9GD2Zxw==

View file

@ -0,0 +1,7 @@
{ config, pkgs, ... }:
{
services.i2pd = {
enable = true;
upnp.enable = true;
};
}

View file

@ -0,0 +1,7 @@
{ pkgs, config, ... }:
{
services.tailscale = {
enable = true;
useRoutingFeatures = "server";
};
}

View file

@ -1,5 +0,0 @@
U2FsdGVkX18/ZUWWb+ppxHPa/5EQsIQuaikkDlQyP/HTNbfhQqc0DOinQ7HF0Bov
yfoiw4mfPZGbGJKUyV+KVYMz8xDryYV+VkelwjbQNP2+43ffAAqO6+Yq23i5T6fY
83H8RFjcZMqyKhR8UXI1MSRfT3c2aT9Aqo+ogmn1MmeXRqY9m1Y4FVo7PohHocNX
Gm48e2RIrQ+vGgHeRJ+1Kzan4wRfNDFKZPSu6H8jffdi2DFtBABGl+a+cqKyeclO
7yMCgv1n6tam8sgFS/6YMw==

0
features/shared/nvim.nix Normal file
View file

18
flake.nix Normal file
View file

@ -0,0 +1,18 @@
{
description = "the silliest NixOS config!";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};
outputs =
{ self, nixpkgs, ... }@inputs:
{
nixosConfigurations.sisyphe = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
];
};
};
}

View file

@ -11,14 +11,14 @@ let
in in
{ {
imports = [ imports = [
./features/containers/default.nix ./features/server/containers/default.nix
./features/multimedia/default.nix ./features/server/multimedia/default.nix
./features/databases/default.nix ./features/server/databases/default.nix
./features/services/default.nix ./features/server/services/default.nix
./features/backups.nix ./features/server/backups.nix
./features/caddy.nix ./features/server/caddy.nix
./features/prometheus.nix ./features/server/prometheus.nix
./features/samba-shares.nix ./features/server/samba-shares.nix
]; ];
# setting up networking!! # setting up networking!!
@ -36,7 +36,10 @@ in
nameservers = [ nameservers = [
"1.1.1.1" "1.1.1.1"
"1.0.0.1" "1.0.0.1"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
]; ];
nftables.enable = true; nftables.enable = true;
# firewall rules # firewall rules
firewall = { firewall = {
@ -112,11 +115,6 @@ in
openFirewall = true; openFirewall = true;
}; };
services.tailscale = {
enable = true;
useRoutingFeatures = "server";
};
services = { services = {
networkd-dispatcher = { networkd-dispatcher = {
enable = true; enable = true;