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 = [
|
imports = [
|
||||||
./services/glance.nix
|
|
||||||
./services/wakapi.nix
|
./services/wakapi.nix
|
||||||
./services/nginx.nix
|
./services/nginx.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -5,4 +5,5 @@
|
||||||
];
|
];
|
||||||
boot-config.bootloader = "systemd-boot";
|
boot-config.bootloader = "systemd-boot";
|
||||||
hardware-config.cpu = "intel";
|
hardware-config.cpu = "intel";
|
||||||
|
service-glance.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ in
|
||||||
./gaming.nix
|
./gaming.nix
|
||||||
./filesystems.nix
|
./filesystems.nix
|
||||||
./networking.nix
|
./networking.nix
|
||||||
|
./services/glance.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
|
moduleName = "service-glance";
|
||||||
|
cfg = config."${moduleName}";
|
||||||
|
|
||||||
glancePort = 1227;
|
glancePort = 1227;
|
||||||
homeColumn = {
|
homeColumn = {
|
||||||
size = "full";
|
size = "full";
|
||||||
|
@ -65,7 +73,17 @@ let
|
||||||
};
|
};
|
||||||
in
|
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;
|
enable = true;
|
||||||
settings.server = {
|
settings.server = {
|
||||||
host = "0.0.0.0";
|
host = "0.0.0.0";
|
||||||
|
@ -80,5 +98,7 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ glancePort ];
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue