Compare commits

..

4 Commits

5 changed files with 87 additions and 44 deletions

View File

@ -10,7 +10,8 @@
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
networking.firewall.allowedTCPPorts = [ 1900 ];
networking.firewall.allowedUDPPorts = [ 1900 7359];
materus.profile.nixpkgs.enable = true; materus.profile.nixpkgs.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
libraspberrypi libraspberrypi

View File

@ -11,6 +11,7 @@
./samba.nix ./samba.nix
./syncthing.nix ./syncthing.nix
./jellyfin.nix ./jellyfin.nix
./grafana.nix
./auth ./auth
]; ];
waffentragerService.elements.enable = true; waffentragerService.elements.enable = true;
@ -22,4 +23,5 @@
waffentragerService.samba.enable = true; waffentragerService.samba.enable = true;
waffentragerService.jellyfin.enable = true; waffentragerService.jellyfin.enable = true;
waffentragerService.syncthing.enable = true; waffentragerService.syncthing.enable = true;
waffentragerService.grafana.enable = false;
} }

View File

@ -0,0 +1,39 @@
{ materusArg, config, lib, ... }:
{
options.waffentragerService.grafana.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable grafana";
config =
let
cfg = config.waffentragerService.grafana;
in
lib.mkIf cfg.enable {
services.grafana = {
dataDir = "${config.waffentragerService.elements.path}/services/grafana";
enable = true;
settings = {
server = {
# Listening Address
http_addr = "127.0.0.1";
# and Port
http_port = 3232;
# Grafana needs to know on which domain and URL it's running
domain = "watchman.materus.pl";
serve_from_sub_path = true;
};
};
};
services.nginx.virtualHosts."watchman.materus.pl" = {
addSSL = true;
sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem";
sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem";
sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem";
http2 = false;
http3 = true;
locations."/" = {
proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}";
proxyWebsockets = true;
recommendedProxySettings = true;
};
};
};
}

View File

@ -36,6 +36,7 @@
mangled names = no mangled names = no
dos charset = CP850 dos charset = CP850
unix charset = UTF-8 unix charset = UTF-8
catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6
''; '';
shares = { shares = {
materus = { materus = {

View File

@ -159,11 +159,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1724433242, "lastModified": 1725267572,
"narHash": "sha256-/rX20nvm6EKtmsyJS4DoazcYPyRNKJ1oMSS1yhAce/w=", "narHash": "sha256-s5+GUIs8OewO1McYn3bhMz31Q+Xl0WRxUTKp+lPZLno=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "b569d3ae7d60c901a19944b00440c3a11e4da48a", "rev": "2f7c7275d542f59760bd307e5805572cee65ae37",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -186,11 +186,11 @@
"nixpkgs-stable": "nixpkgs-stable_3" "nixpkgs-stable": "nixpkgs-stable_3"
}, },
"locked": { "locked": {
"lastModified": 1724433242, "lastModified": 1725267572,
"narHash": "sha256-/rX20nvm6EKtmsyJS4DoazcYPyRNKJ1oMSS1yhAce/w=", "narHash": "sha256-s5+GUIs8OewO1McYn3bhMz31Q+Xl0WRxUTKp+lPZLno=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "b569d3ae7d60c901a19944b00440c3a11e4da48a", "rev": "2f7c7275d542f59760bd307e5805572cee65ae37",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -351,11 +351,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724422166, "lastModified": 1725180166,
"narHash": "sha256-l9zifWrZe6sRTwl/Padz+a6zwGeE9eaU+0PFWtUQl2w=", "narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "5dc25356567119127f046b347c3060a8dd607365", "rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -437,11 +437,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1724067415, "lastModified": 1724878143,
"narHash": "sha256-WJBAEFXAtA41RMpK8mvw0cQ62CJkNMBtzcEeNIJV7b0=", "narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "b09c46430ffcf18d575acf5c339b38ac4e1db5d2", "rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -453,11 +453,11 @@
}, },
"nixos-hardware_2": { "nixos-hardware_2": {
"locked": { "locked": {
"lastModified": 1724067415, "lastModified": 1724878143,
"narHash": "sha256-WJBAEFXAtA41RMpK8mvw0cQ62CJkNMBtzcEeNIJV7b0=", "narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "b09c46430ffcf18d575acf5c339b38ac4e1db5d2", "rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -485,11 +485,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1724316499, "lastModified": 1725001927,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -517,11 +517,11 @@
}, },
"nixpkgs-stable_3": { "nixpkgs-stable_3": {
"locked": { "locked": {
"lastModified": 1724316499, "lastModified": 1725001927,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -549,11 +549,11 @@
}, },
"nixpkgs-stable_5": { "nixpkgs-stable_5": {
"locked": { "locked": {
"lastModified": 1724316499, "lastModified": 1725001927,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -565,11 +565,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1724224976, "lastModified": 1725103162,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -594,11 +594,11 @@
}, },
"nur_2": { "nur_2": {
"locked": { "locked": {
"lastModified": 1724437005, "lastModified": 1725282210,
"narHash": "sha256-BVB8Cn7FaCn2Kssj5CJe12xKFoOPuZmZRrShOVGMHSc=", "narHash": "sha256-z+eGHYNm3C68fY5QCp1qZdAdzSvNsJuYJ5BiLh9JrGo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "d298400a803182527b3cdc7c010b7ecbdaf0dbd6", "rev": "4f3ba94e14d4215a3471284fd05df08c95e6669d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -623,11 +623,11 @@
}, },
"nur_4": { "nur_4": {
"locked": { "locked": {
"lastModified": 1724437005, "lastModified": 1725282210,
"narHash": "sha256-BVB8Cn7FaCn2Kssj5CJe12xKFoOPuZmZRrShOVGMHSc=", "narHash": "sha256-z+eGHYNm3C68fY5QCp1qZdAdzSvNsJuYJ5BiLh9JrGo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "d298400a803182527b3cdc7c010b7ecbdaf0dbd6", "rev": "4f3ba94e14d4215a3471284fd05df08c95e6669d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -639,10 +639,10 @@
}, },
"nur_5": { "nur_5": {
"locked": { "locked": {
"lastModified": 1723578304, "lastModified": 1724437005,
"narHash": "sha256-p/G1yrUyJ84lh0JpBHXMwNuHWLKLLKSpdIufPJljvY4=", "narHash": "sha256-BVB8Cn7FaCn2Kssj5CJe12xKFoOPuZmZRrShOVGMHSc=",
"path": "/nix/store/4bwi1xnp0wdss4kncd6sy1bx1d6a8r4w-source", "path": "/nix/store/2qa76bjwbjxw2p90slqrmir8c8c25i5y-source",
"rev": "c7ba591cead34c21172cca76f1aabcb130c40508", "rev": "d298400a803182527b3cdc7c010b7ecbdaf0dbd6",
"type": "path" "type": "path"
}, },
"original": { "original": {
@ -687,11 +687,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1723501126, "lastModified": 1725201042,
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=", "narHash": "sha256-lj5pxOwidP0W//E7IvyhbhXrnEUW99I07+QpERnzTS4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34", "rev": "5db5921e40ae382d6716dce591ea23b0a39d96f7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -710,11 +710,11 @@
"nixpkgs-stable": "nixpkgs-stable_4" "nixpkgs-stable": "nixpkgs-stable_4"
}, },
"locked": { "locked": {
"lastModified": 1723501126, "lastModified": 1725201042,
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=", "narHash": "sha256-lj5pxOwidP0W//E7IvyhbhXrnEUW99I07+QpERnzTS4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34", "rev": "5db5921e40ae382d6716dce591ea23b0a39d96f7",
"type": "github" "type": "github"
}, },
"original": { "original": {