Add http-proxy host
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m49s

This commit is contained in:
Torjus Håkestad 2024-10-20 22:09:23 +02:00
parent 819ae5e797
commit 504be31412
Signed by: torjus
SSH Key Fingerprint: SHA256:KjAds8wHfD2mBYK2H815s/+ABcSdcIHUndwHEdSxml4
5 changed files with 179 additions and 19 deletions

125
flake.nix
View File

@ -8,7 +8,15 @@
backup-helper.url = "git+https://git.t-juice.club/torjus/backup-helper?ref=master";
};
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, backup-helper, ... }@inputs:
outputs =
{
self,
nixpkgs,
nixpkgs-unstable,
sops-nix,
backup-helper,
...
}@inputs:
let
system = "x86_64-linux";
overlay-unstable = final: prev: {
@ -22,45 +30,80 @@
nixosConfigurations = {
ns1 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/ns1
sops-nix.nixosModules.sops
];
};
ns2 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/ns2
sops-nix.nixosModules.sops
];
};
ns3 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/ns3
sops-nix.nixosModules.sops
];
};
ns4 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/ns4
sops-nix.nixosModules.sops
];
};
nixos-test1 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/nixos-test1
sops-nix.nixosModules.sops
backup-helper.nixosModules.backup-helper
@ -68,9 +111,16 @@
};
ha1 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/ha1
sops-nix.nixosModules.sops
backup-helper.nixosModules.backup-helper
@ -78,9 +128,16 @@
};
inc1 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/inc1
sops-nix.nixosModules.sops
# backup-helper.nixosModules.backup-helper
@ -88,9 +145,16 @@
};
inc2 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/inc2
sops-nix.nixosModules.sops
# backup-helper.nixosModules.backup-helper
@ -98,13 +162,36 @@
};
template1 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self sops-nix; };
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/template
sops-nix.nixosModules.sops
];
};
http-proxy = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs self sops-nix;
};
modules = [
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./hosts/http-proxy
sops-nix.nixosModules.sops
];
};
};
};
}

View File

@ -0,0 +1,62 @@
{
pkgs,
...
}:
{
imports = [
../template/hardware-configuration.nix
../../system
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.grub = {
enable = true;
device = "/dev/sda";
configurationLimit = 3;
};
networking.hostName = "http-proxy";
networking.domain = "home.2rjus.net";
networking.useNetworkd = true;
networking.useDHCP = false;
services.resolved.enable = true;
networking.nameservers = [
"10.69.13.5"
"10.69.13.6"
];
systemd.network.enable = true;
systemd.network.networks."ens18" = {
matchConfig.Name = "ens18";
address = [
"10.69.13.11/24"
];
routes = [
{ routeConfig.Gateway = "10.69.13.1"; }
];
linkConfig.RequiredForOnline = "routable";
};
time.timeZone = "Europe/Oslo";
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.tarball-ttl = 0;
environment.systemPackages = with pkgs; [
vim
wget
git
];
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./configuration.nix
../../services/home-assistant
];
}

View File

@ -0,0 +1,3 @@
{ pkgs, config, ... }:
{
}

View File

@ -55,6 +55,7 @@ ns3 IN A 10.69.13.7
ns4 IN A 10.69.13.8
ha1 IN A 10.69.13.9
nixos-test1 IN A 10.69.13.10
http-proxy IN A 10.69.13.11
; 22_WLAN
unifi-ctrl IN A 10.69.22.5