-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15b403c
commit 5810762
Showing
10 changed files
with
377 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ inputs | ||
, config | ||
, ... | ||
}: | ||
{ | ||
imports = [ inputs.attic.nixosModules.atticd ]; | ||
|
||
|
||
sops.secrets."atticd/env" = { | ||
sopsFile = "${inputs.self}/secrets/cache.yaml"; | ||
}; | ||
|
||
security.acme = { | ||
defaults.email = "[email protected]"; | ||
acceptTerms = true; | ||
certs."cache.xnee.net" = { }; | ||
}; | ||
|
||
networking.firewall.allowedTCPPorts = [ 80 443 ]; | ||
|
||
services = { | ||
atticd = { | ||
enable = true; | ||
credentialsFile = config.sops.secrets."atticd/env".path; | ||
|
||
settings = { | ||
listen = "127.0.0.1:8080"; | ||
|
||
storage = { | ||
type = "s3"; | ||
endpoint = "https://s3.wasabisys.com"; | ||
region = "eu-central-2"; | ||
bucket = "cache-xnee-net"; | ||
}; | ||
|
||
# Data chunking | ||
# | ||
# Warning: If you change any of the values here, it will be | ||
# difficult to reuse existing chunks for newly-uploaded NARs | ||
# since the cutpoints will be different. As a result, the | ||
# deduplication ratio will suffer for a while after the change. | ||
chunking = { | ||
# The minimum NAR size to trigger chunking | ||
# | ||
# If 0, chunking is disabled entirely for newly-uploaded NARs. | ||
# If 1, all NARs are chunked. | ||
nar-size-threshold = 64 * 1024; # 64 KiB | ||
|
||
# The preferred minimum size of a chunk, in bytes | ||
min-size = 16 * 1024; # 16 KiB | ||
|
||
# The preferred average size of a chunk, in bytes | ||
avg-size = 64 * 1024; # 64 KiB | ||
|
||
# The preferred maximum size of a chunk, in bytes | ||
max-size = 256 * 1024; # 256 KiB | ||
}; | ||
}; | ||
}; | ||
|
||
nginx = { | ||
enable = true; | ||
recommendedTlsSettings = true; | ||
recommendedOptimisation = true; | ||
recommendedProxySettings = true; | ||
virtualHosts."cache.xnee.net" = { | ||
enableACME = true; | ||
forceSSL = true; | ||
locations."/" = { | ||
proxyPass = "http://${config.services.atticd.settings.listen}"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
imports = [ | ||
./disko.nix | ||
./hardware-configuration.nix | ||
./networking.nix | ||
./attic.nix | ||
]; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
disko.devices = { | ||
disk = { | ||
sda = { | ||
device = "/dev/sda"; | ||
type = "disk"; | ||
content = { | ||
type = "gpt"; | ||
partitions = { | ||
ESP = { | ||
label = "EFI"; | ||
type = "EF00"; | ||
size = "500M"; | ||
content = { | ||
type = "filesystem"; | ||
format = "vfat"; | ||
mountpoint = "/boot"; | ||
}; | ||
}; | ||
root = { | ||
label = "NIXOS"; | ||
size = "100%"; | ||
content = { | ||
type = "filesystem"; | ||
format = "ext4"; | ||
mountpoint = "/"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.