Skip to content

Commit

Permalink
+ what?
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Oct 1, 2024
1 parent 6c41240 commit b67deda
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 80 deletions.
5 changes: 4 additions & 1 deletion hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ let
(i: i.host)
(map (i: i.name))
]
++ [ "bootstrap" ];
++ [
"bootstrap"
"livecd"
];
in
{
flake.nixosConfigurations = genAttrs hosts (
Expand Down
27 changes: 27 additions & 0 deletions hosts/hastur/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,33 @@
];
match = [ { host = [ "s3.nyaw.xyz" ]; } ];
}

{
match = [
{
host = [ config.networking.fqdn ];
path = [
"/prom"
"/prom/*"
];
}
];
handle = [
{
handler = "authentication";
providers.http_basic.accounts = [
{
username = "prometheus";
password = "$2b$05$eZjq0oUqZzxgqdRaCRsKROuE96w9Y0aKSri3uGPccckPivESAinB6";
}
];
}
{
handler = "reverse_proxy";
upstreams = [ { dial = "127.0.0.1:9090"; } ];
}
];
}
];
tls_connection_policies = [
{
Expand Down
5 changes: 2 additions & 3 deletions hosts/livecd/additions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@

systemd.services.nix-daemon = {
serviceConfig.LimitNOFILE = lib.mkForce 500000000;
path = [ pkgs.netcat-openbsd ];
};
nix = {
package = pkgs.nixVersions.git;
package = pkgs.nixVersions.stable;
registry = {
nixpkgs.flake = inputs.nixpkgs;
self.flake = inputs.self;
Expand Down Expand Up @@ -117,7 +116,7 @@
sudo mkdir /mnt/{persist,etc,var,efi,nix}
sudo mount -o compress=zstd,discard=async,noatime,subvol=nix /dev/$1 /mnt/nix
sudo mount -o compress=zstd,discard=async,noatime,subvol=persist /dev/$1 /mnt/persist
sudo mount /dev/nvme0n1p1 /mnt/efi
echo "please manually mount efi system"
sudo mount -o bind /mnt/persist/etc /mnt/etc
sudo mount -o bind /mnt/persist/var /mnt/var
echo "mount finished."
Expand Down
58 changes: 29 additions & 29 deletions hosts/livecd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
inputs,
...
}:
{
flake.nixosConfigurations.livecd = withSystem "x86_64-linux" (
_ctx@{
config,
inputs',
system,
...
}:
let
inherit (self) lib;
in
lib.nixosSystem {
specialArgs = {
inherit lib inputs;
inherit (lib) data;
user = "nixos";
};
modules = [
{
nixpkgs = {
hostPlatform = system;
};
}
./additions.nix
"${self}/modules/sing-box.nix"
];
}
);
}

withSystem "x86_64-linux" (
_ctx@{
config,
inputs',
system,
...
}:
let
inherit (self) lib;
in
lib.nixosSystem {
specialArgs = {
inherit lib inputs;
inherit (lib) data;
user = "nixos";
};
modules = [
{
nixpkgs = {
hostPlatform = system;
};
}
./additions.nix
inputs.lix-module.nixosModules.default
"${self}/modules/sing-box.nix"
];
}
)
21 changes: 0 additions & 21 deletions hosts/yidhra/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,5 @@
match = [ { host = [ "s3.nyaw.xyz" ]; } ];
}
];
settings.apps.http.servers.srv0.tls_connection_policies = [
{
match = {
sni = [
"s3.nyaw.xyz"
];
};
certificate_selection = {
any_tag = [ "cert0" ];
};
}
];

settings.apps.tls.certificates.load_files = [
{
certificate = "/run/credentials/caddy.service/nyaw.cert";
key = "/run/credentials/caddy.service/nyaw.key";
tags = [ "cert0" ];
}
];

};
}
26 changes: 0 additions & 26 deletions repack/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,6 @@ in
listen = [ ":443" ];
strict_sni_host = false;
routes = [
{
match = [
{
host = [ config.networking.fqdn ];
path = [
"/prom"
"/prom/*"
];
}
];
handle = [
{
handler = "authentication";
providers.http_basic.accounts = [
{
username = "prometheus";
password = "$2b$05$eZjq0oUqZzxgqdRaCRsKROuE96w9Y0aKSri3uGPccckPivESAinB6";
}
];
}
{
handler = "reverse_proxy";
upstreams = [ { dial = "10.0.1.2:9090"; } ];
}
];
}
{
match = [
{
Expand Down

0 comments on commit b67deda

Please sign in to comment.