mirror of
https://github.com/nmasur/dotfiles
synced 2025-02-12 15:52:03 +00:00
move inherits and add attrset for imports
This commit is contained in:
parent
6217871960
commit
59a52dc033
16
hosts/default.nix
Normal file
16
hosts/default.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Return a list of all hosts
|
||||||
|
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
lib.pipe (lib.filesystem.listFilesRecursive ./.) [
|
||||||
|
# Get only files ending in default.nix
|
||||||
|
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
||||||
|
# Import each host function
|
||||||
|
map
|
||||||
|
(file: {
|
||||||
|
name = builtins.baseNameOf (builtins.dirOf file);
|
||||||
|
value = import file;
|
||||||
|
})
|
||||||
|
# Convert to an attrset of hostname -> host function
|
||||||
|
(builtins.listToAttrs)
|
||||||
|
]
|
@ -13,7 +13,7 @@ let
|
|||||||
packagesDirectory = lib.filesystem.listFilesRecursive ../pkgs;
|
packagesDirectory = lib.filesystem.listFilesRecursive ../pkgs;
|
||||||
packages = lib.pipe packagesDirectory [
|
packages = lib.pipe packagesDirectory [
|
||||||
# Get only files called package.nix
|
# Get only files called package.nix
|
||||||
(builtins.filter (name: (lib.hasSuffix "package.nix" name)))
|
(builtins.filter (name: (name == "package.nix")))
|
||||||
# Apply callPackage to create a derivation
|
# Apply callPackage to create a derivation
|
||||||
(builtins.map prev.callPackage)
|
(builtins.map prev.callPackage)
|
||||||
# Convert the list to an attrset
|
# Convert the list to an attrset
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = lib.filesystem.listFilesRecursive ./.;
|
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
|
||||||
|
# Get only files ending in .nix
|
||||||
|
(builtins.filter (name: lib.hasSuffix ".nix" name))
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = lib.filesystem.listFilesRecursive ./.;
|
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
|
||||||
|
# Get only files ending in .nix
|
||||||
|
(builtins.filter (name: lib.hasSuffix ".nix" name))
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = lib.filesystem.listFilesRecursive ./.;
|
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
|
||||||
|
# Get only files ending in .nix
|
||||||
|
(builtins.filter (name: lib.hasSuffix ".nix" name))
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.actualbudget;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.actualbudget;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.nmasur.presets.services.actualbudget;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.actualbudget;
|
||||||
|
|
||||||
# This config specifies ports for Prometheus to scrape information
|
# This config specifies ports for Prometheus to scrape information
|
||||||
arrConfig = {
|
arrConfig = {
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.bind;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.bind;
|
||||||
|
|
||||||
localIp = "192.168.1.218";
|
localIp = "192.168.1.218";
|
||||||
localServices = [
|
localServices = [
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.nmasur.presets.services.calibre-web;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.calibre-web;
|
||||||
libraryPath = "/data/books";
|
libraryPath = "/data/books";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.filebrowser;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.filebrowser;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.gitea-runner-local;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.gitea-runner-local;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.gitea;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.gitea;
|
||||||
giteaPath = "/var/lib/gitea"; # Default service directory
|
giteaPath = "/var/lib/gitea"; # Default service directory
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.nmasur.presets.services.grafana;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.grafana;
|
||||||
promUid = "victoriametrics";
|
promUid = "victoriametrics";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.immich;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.immich;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.influxdb2;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.influxdb2;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.jellyfin;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.jellyfin;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.minecraft-server;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.minecraft-server;
|
||||||
localPort = 25564;
|
localPort = 25564;
|
||||||
publicPort = 49732;
|
publicPort = 49732;
|
||||||
rconPort = 25575;
|
rconPort = 25575;
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.n8n;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.n8n;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.nextcloud;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.nextcloud;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.ntfy-sh;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.ntfy-sh;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.paperless;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.paperless;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.prometheus-remote-write;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.prometheus-remote-write;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.thelounge;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.thelounge;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.transmission;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.transmission;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.uptime-kuma;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.uptime-kuma;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.services.vaultwarden;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.vaultwarden;
|
||||||
vaultwardenPath = "/var/lib/bitwarden_rs"; # Default service directory
|
vaultwardenPath = "/var/lib/bitwarden_rs"; # Default service directory
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.nmasur.presets.services.victoriametrics;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.victoriametrics;
|
||||||
|
|
||||||
username = "prometheus";
|
username = "prometheus";
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.nmasur.presets.services.vm-agent;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.nmasur.presets.services.vm-agent;
|
||||||
|
|
||||||
username = "prometheus";
|
username = "prometheus";
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.filebrowser;
|
|
||||||
inherit (config.nmasur.settings) hostnames;
|
inherit (config.nmasur.settings) hostnames;
|
||||||
|
cfg = config.services.filebrowser;
|
||||||
|
|
||||||
dataDir = "/var/lib/filebrowser";
|
dataDir = "/var/lib/filebrowser";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user