refactor(glance): moved to nixos module

This commit is contained in:
Mohammad Rafiq 2025-04-28 19:34:43 +08:00
parent 36b1088d34
commit 5745510e1a
No known key found for this signature in database
4 changed files with 36 additions and 15 deletions

View file

@ -1,6 +1,5 @@
{
imports = [
./services/glance.nix
./services/wakapi.nix
./services/nginx.nix
];

View file

@ -5,4 +5,5 @@
];
boot-config.bootloader = "systemd-boot";
hardware-config.cpu = "intel";
service-glance.enable = true;
}

View file

@ -15,6 +15,7 @@ in
./gaming.nix
./filesystems.nix
./networking.nix
./services/glance.nix
];
options = {

View file

@ -1,4 +1,12 @@
{
config,
lib,
...
}:
let
moduleName = "service-glance";
cfg = config."${moduleName}";
glancePort = 1227;
homeColumn = {
size = "full";
@ -65,7 +73,17 @@ let
};
in
{
home-manager.users.rafiq.services.glance = {
options = {
"${moduleName}" = {
enable = lib.mkEnableOption "Enable ${moduleName}.";
};
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
networking.firewall.allowedTCPPorts = [ glancePort ];
services.glance = {
enable = true;
settings.server = {
host = "0.0.0.0";
@ -80,5 +98,7 @@ in
}
];
};
networking.firewall.allowedTCPPorts = [ glancePort ];
}
]
);
}