mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-02-22 22:33:56 +01:00
(feat): reformatted code for flakes usage
This commit is contained in:
parent
d29d6f0133
commit
c3956d6fa4
|
@ -11,7 +11,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./vm-hardware.nix # or hardware-configuration.nix
|
||||
./hardware/vm-hardware.nix # or hardware-configuration.nix
|
||||
./server-configuration.nix
|
||||
"${(import ./nix/sources.nix).sops-nix}/modules/sops"
|
||||
];
|
||||
|
@ -33,6 +33,11 @@
|
|||
keyMap = "fr";
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
users.users.homelab = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
|
@ -45,7 +50,6 @@
|
|||
neovim
|
||||
btop
|
||||
tree
|
||||
git
|
||||
];
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
|
@ -60,11 +64,14 @@
|
|||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
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
|
||||
niv
|
||||
];
|
||||
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> { };
|
||||
|
||||
in
|
||||
{
|
||||
name = "caddy";
|
||||
buildInputs = with pkgs; [
|
||||
xcaddy
|
||||
go
|
||||
];
|
||||
}
|
|
@ -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
|
||||
'';
|
||||
*/
|
||||
};
|
||||
|
||||
}
|
0
features/client/backups.nix
Normal file
0
features/client/backups.nix
Normal file
69
features/server/caddy.nix
Normal file
69
features/server/caddy.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
imports = [
|
||||
./crafty-controller.nix
|
||||
./flaresolverr.nix
|
||||
# ./freshrss.nix
|
||||
./freshrss.nix
|
||||
./sonarr.nix
|
||||
#./pihole-exporter.nix
|
||||
];
|
|
@ -14,7 +14,7 @@ in
|
|||
config = {
|
||||
|
||||
sops.secrets.slskd = {
|
||||
sopsFile = ../../secrets/slskd.env;
|
||||
sopsFile = ../../../secrets/slskd.env;
|
||||
format = "dotenv";
|
||||
};
|
||||
|
|
@ -16,7 +16,7 @@ in
|
|||
|
||||
config = {
|
||||
sops.secrets.transmission = {
|
||||
sopsFile = ../../secrets/transmission.json;
|
||||
sopsFile = ../../../secrets/transmission.json;
|
||||
path = "/var/lib/secrets/transmission/settings.json";
|
||||
};
|
||||
|
5
features/server/services/forgejo-smtp.nix
Normal file
5
features/server/services/forgejo-smtp.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
U2FsdGVkX18oY3efQYeXqacnpNaOkre/hn/Ck1shbtZiKPQbD7G+tdQBjxPdZxIL
|
||||
7oZi2qay/Z6ZKgjmd5zMW+jFejxl9/PSbDFbydn3nADkOCgPO5QSjN2QX+cswV/T
|
||||
MlSQovYhJzhBgy37cPNU4oZBM8u5ZyRKLgBdUcbaKOJShyzirwKaKdn4abN0QC9B
|
||||
nPIRIY5INzJPDHJEi/hgOfp4PLeiJTOvrGjvKF2N65f4Uyi8BOW3NSDK+qp6VcUI
|
||||
tfF/C6r6XQF4w3p9GD2Zxw==
|
7
features/server/services/i2p.nix
Normal file
7
features/server/services/i2p.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.i2pd = {
|
||||
enable = true;
|
||||
upnp.enable = true;
|
||||
};
|
||||
}
|
7
features/server/tailscale.nix
Normal file
7
features/server/tailscale.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "server";
|
||||
};
|
||||
}
|
|
@ -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
0
features/shared/nvim.nix
Normal file
18
flake.nix
Normal file
18
flake.nix
Normal 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -11,14 +11,14 @@ let
|
|||
in
|
||||
{
|
||||
imports = [
|
||||
./features/containers/default.nix
|
||||
./features/multimedia/default.nix
|
||||
./features/databases/default.nix
|
||||
./features/services/default.nix
|
||||
./features/backups.nix
|
||||
./features/caddy.nix
|
||||
./features/prometheus.nix
|
||||
./features/samba-shares.nix
|
||||
./features/server/containers/default.nix
|
||||
./features/server/multimedia/default.nix
|
||||
./features/server/databases/default.nix
|
||||
./features/server/services/default.nix
|
||||
./features/server/backups.nix
|
||||
./features/server/caddy.nix
|
||||
./features/server/prometheus.nix
|
||||
./features/server/samba-shares.nix
|
||||
];
|
||||
|
||||
# setting up networking!!
|
||||
|
@ -36,7 +36,10 @@ in
|
|||
nameservers = [
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
"2606:4700:4700::1111"
|
||||
"2606:4700:4700::1001"
|
||||
];
|
||||
|
||||
nftables.enable = true;
|
||||
# firewall rules
|
||||
firewall = {
|
||||
|
@ -112,11 +115,6 @@ in
|
|||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "server";
|
||||
};
|
||||
|
||||
services = {
|
||||
networkd-dispatcher = {
|
||||
enable = true;
|
||||
|
|
Loading…
Reference in a new issue