mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 18:04:41 +02:00
split config and pkgs in separate folders
This commit is contained in:
parent
ab3ece7522
commit
b8149f88ed
9 changed files with 112 additions and 17 deletions
|
@ -26,7 +26,10 @@ let
|
|||
{
|
||||
imports = [
|
||||
({ pkgs, ... }: {
|
||||
nixpkgs.overlays = [ overlay-unstable ];
|
||||
nixpkgs.overlays = [
|
||||
overlay-unstable
|
||||
(import ../pkgs)
|
||||
];
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${pkgs.path}"
|
||||
];
|
||||
|
@ -35,6 +38,7 @@ let
|
|||
sops-nix.nixosModules.sops
|
||||
];
|
||||
}
|
||||
../modules
|
||||
];
|
||||
defaultModules = baseModules ++ customModules;
|
||||
in
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.webapps = {
|
||||
dashboardCategories = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Category name.
|
||||
'';
|
||||
example = "Applications";
|
||||
};
|
||||
tag = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Category tag.
|
||||
'';
|
||||
example = "app";
|
||||
};
|
||||
};
|
||||
});
|
||||
description = ''
|
||||
App categories to display on the dashboard.
|
||||
'';
|
||||
example = [
|
||||
{
|
||||
name = "Application";
|
||||
tag = "app";
|
||||
}
|
||||
];
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
apps = lib.mkOption {
|
||||
type = lib.types.attrsOf
|
||||
(lib.types.submodule {
|
||||
options = {
|
||||
dashboard.link = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = ''
|
||||
Link to webapp
|
||||
'';
|
||||
example = "http://192.168.1.10:1234";
|
||||
default = null;
|
||||
};
|
||||
dashboard.name = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = ''
|
||||
Application name.
|
||||
'';
|
||||
example = "App";
|
||||
default = null;
|
||||
};
|
||||
dashboard.category = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = ''
|
||||
App category tag.
|
||||
'';
|
||||
example = "app";
|
||||
default = null;
|
||||
};
|
||||
dashboard.icon = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = ''
|
||||
Font Awesome application icon.
|
||||
'';
|
||||
example = "rss";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
});
|
||||
description = ''
|
||||
Defines a web application.
|
||||
'';
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
cfg = config.webapps;
|
||||
in {
|
||||
lib.webapps.homerServices =
|
||||
let
|
||||
apps = builtins.filter (a: a.dashboard.name != null) (lib.attrValues cfg.apps);
|
||||
in
|
||||
lib.forEach cfg.dashboardCategories (cat:
|
||||
let
|
||||
catApps = lib.sort (a: b: a.dashboard.name < b.dashboard.name) (
|
||||
builtins.filter
|
||||
(a:
|
||||
a.dashboard.category != null && a.dashboard.category == cat.tag ||
|
||||
a.dashboard.category == null && cat.tag == "misc")
|
||||
apps);
|
||||
in
|
||||
{
|
||||
name = cat.name;
|
||||
items = lib.forEach catApps (a: {
|
||||
name = a.dashboard.name;
|
||||
icon = lib.optionalString (a.dashboard.icon != null) "fas fa-${a.dashboard.icon}";
|
||||
url = a.dashboard.link;
|
||||
target = "_blank";
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
|
@ -9,10 +9,10 @@ let
|
|||
|
||||
ip4_gw = "38.242.192.1";
|
||||
ip4_dns = [
|
||||
"79.143.183.251"
|
||||
"79.143.183.252"
|
||||
"213.136.95.10"
|
||||
"213.136.95.11"
|
||||
"8.8.8.8"
|
||||
"79.143.182.242"
|
||||
"178.238.234.231"
|
||||
"5.189.191.29"
|
||||
];
|
||||
|
||||
ip6_addr = "2a02:c206:3009:3317::1";
|
||||
|
@ -30,9 +30,8 @@ in
|
|||
useDHCP = false;
|
||||
|
||||
nameservers = ip4_dns ++ ip6_dns;
|
||||
search = [
|
||||
"buehler.rocks"
|
||||
];
|
||||
domain = "buehler.rocks";
|
||||
search = [ "buehler.rocks" ];
|
||||
|
||||
defaultGateway = {
|
||||
address = ip4_gw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue