init
This commit is contained in:
82
flake.nix
Normal file
82
flake.nix
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
description = "Flake for server muffin";
|
||||
|
||||
inputs = {
|
||||
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/master";
|
||||
quadlet-nix.url = "github:SEIAROTg/quadlet-nix";
|
||||
quadlet-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
nixpkgs,
|
||||
quadlet-nix,
|
||||
...
|
||||
}:
|
||||
let
|
||||
username = "primary";
|
||||
hostname = "muffin";
|
||||
eth_interface = "enp3s0";
|
||||
|
||||
service_configs = {
|
||||
hdd_path = "/mnt/hdd";
|
||||
|
||||
# TODO: add checks to make sure none of these collide
|
||||
ports = {
|
||||
https = 443;
|
||||
immich = 3001;
|
||||
jellyfin = 8096;
|
||||
torrent = 6011;
|
||||
minecraft = 25565;
|
||||
git-server = 3281;
|
||||
};
|
||||
|
||||
https = {
|
||||
certs = "/tank/services/http_certs";
|
||||
data_dir = "/tank/services/http";
|
||||
};
|
||||
|
||||
gitea = {
|
||||
dir = "/tank/services/gitea";
|
||||
};
|
||||
|
||||
postgres = {
|
||||
socket = "/run/postgresql";
|
||||
};
|
||||
|
||||
immich = {
|
||||
dir = "/tank/services/immich";
|
||||
};
|
||||
|
||||
minecraft = {
|
||||
dir = "/tank/services/minecraft";
|
||||
};
|
||||
|
||||
gluetun = {
|
||||
dir = "/tank/services/gluetun";
|
||||
};
|
||||
|
||||
torrent = {
|
||||
config_dir = "/tank/services/qbittorrent/config";
|
||||
download_dir = "${service_configs.hdd_path}/torrents";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit
|
||||
username
|
||||
hostname
|
||||
eth_interface
|
||||
service_configs
|
||||
;
|
||||
};
|
||||
modules = [
|
||||
./configuration.nix
|
||||
quadlet-nix.nixosModules.quadlet
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user