refactor(glance): moved to nixos module
This commit is contained in:
parent
36b1088d34
commit
5745510e1a
4 changed files with 36 additions and 15 deletions
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./services/glance.nix
|
||||
./services/wakapi.nix
|
||||
./services/nginx.nix
|
||||
];
|
||||
|
|
|
@ -5,4 +5,5 @@
|
|||
];
|
||||
boot-config.bootloader = "systemd-boot";
|
||||
hardware-config.cpu = "intel";
|
||||
service-glance.enable = true;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ in
|
|||
./gaming.nix
|
||||
./filesystems.nix
|
||||
./networking.nix
|
||||
./services/glance.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
moduleName = "service-glance";
|
||||
cfg = config."${moduleName}";
|
||||
|
||||
glancePort = 1227;
|
||||
homeColumn = {
|
||||
size = "full";
|
||||
|
@ -65,20 +73,32 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
home-manager.users.rafiq.services.glance = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
host = "0.0.0.0";
|
||||
port = glancePort;
|
||||
options = {
|
||||
"${moduleName}" = {
|
||||
enable = lib.mkEnableOption "Enable ${moduleName}.";
|
||||
};
|
||||
settings.pages = [
|
||||
{
|
||||
name = "Home";
|
||||
columns = [
|
||||
homeColumn
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ glancePort ];
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [ glancePort ];
|
||||
services.glance = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
host = "0.0.0.0";
|
||||
port = glancePort;
|
||||
};
|
||||
settings.pages = [
|
||||
{
|
||||
name = "Home";
|
||||
columns = [
|
||||
homeColumn
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue