diff options
| author | Jakub Stachurski <jakub@wilkuu.nl> | 2026-07-21 20:28:13 +0200 |
|---|---|---|
| committer | Jakub Stachurski <jakub@wilkuu.nl> | 2026-07-21 20:28:13 +0200 |
| commit | 8da770badb7fe21df138e770c8d1a8b6c4604882 (patch) | |
| tree | 947cc879a2b00c02e682f63cd6b8e0a36da6a742 | |
| parent | 381984fc596c3cf268d4bcf061164158fbcfb95a (diff) | |
nixfmt
| -rw-r--r-- | flake.nix | 15 | ||||
| -rw-r--r-- | home-modules/apps/desktop/default.nix | 8 | ||||
| -rw-r--r-- | home-modules/theming.nix | 2 | ||||
| -rw-r--r-- | hosts/apocalypse/default.nix | 4 | ||||
| -rw-r--r-- | hosts/omega-relay/default.nix | 1 | ||||
| -rw-r--r-- | hosts/tacitus/default.nix | 12 | ||||
| -rw-r--r-- | hosts/tacitus/network.nix | 2 | ||||
| -rw-r--r-- | inventory.nix | 48 | ||||
| -rw-r--r-- | modules/default.nix | 2 | ||||
| -rw-r--r-- | modules/mjmap.nix | 77 | ||||
| -rw-r--r-- | services/firefly_iii.nix | 32 | ||||
| -rw-r--r-- | services/kanboard.nix | 63 |
12 files changed, 144 insertions, 122 deletions
@@ -57,7 +57,7 @@ }@inputs: let lib = nixpkgs.lib; - inventory = (import ./inventory.nix) { inherit inputs; } ; + inventory = (import ./inventory.nix) { inherit inputs; }; systems = [ "x86_64-linux" "x86_64-darwin" @@ -90,11 +90,12 @@ checks = forAllSystems (_: system: { formatting = treefmt.${system}.config.build.check self; }); nixosConfigurations = lib.mapAttrs ( - self_name: host: lib.nixosSystem { + self_name: host: + lib.nixosSystem { specialArgs = { inherit inputs; - inherit inventory; - inherit self_name; + inherit inventory; + inherit self_name; }; inherit (host) system; modules = [ @@ -103,9 +104,9 @@ home-manager.nixosModules.default sops-nix.nixosModules.default disko.nixosModules.disko - ] ++ host.nix-modules; + ] + ++ host.nix-modules; } - ) - (lib.filterAttrs (n: h: (h.nix && h.type != "live")) inventory); + ) (lib.filterAttrs (_n: h: (h.nix && h.type != "live")) inventory); }; } diff --git a/home-modules/apps/desktop/default.nix b/home-modules/apps/desktop/default.nix index c1a8a84..16acc95 100644 --- a/home-modules/apps/desktop/default.nix +++ b/home-modules/apps/desktop/default.nix @@ -67,11 +67,9 @@ in ]; }) (lib.mkIf cfg.note-taking.enable { - home.packages = - with pkgs; - [ - obsidian - ]; + home.packages = with pkgs; [ + obsidian + ]; # Todo force synthing to be on here }) (lib.mkIf cfg.art.enable { diff --git a/home-modules/theming.nix b/home-modules/theming.nix index 23dc0e0..6655f3b 100644 --- a/home-modules/theming.nix +++ b/home-modules/theming.nix @@ -21,7 +21,7 @@ }; home.pointerCursor = { - enable = true; + enable = true; gtk.enable = true; package = pkgs.catppuccin-cursors.mochaDark; name = "catppuccin-mocha-dark-cursors"; diff --git a/hosts/apocalypse/default.nix b/hosts/apocalypse/default.nix index 2bc3fab..cb81aa7 100644 --- a/hosts/apocalypse/default.nix +++ b/hosts/apocalypse/default.nix @@ -20,9 +20,9 @@ }; wilkuu.mjmap = { - enable = true; + enable = true; # users = ["wilkuu"]; - }; + }; ## Addons for this system addons = { desktop.hyprland.enable = false; diff --git a/hosts/omega-relay/default.nix b/hosts/omega-relay/default.nix index cd0e9dc..79543c3 100644 --- a/hosts/omega-relay/default.nix +++ b/hosts/omega-relay/default.nix @@ -212,7 +212,6 @@ }; }; - }; networking.hostName = "omega-relay"; diff --git a/hosts/tacitus/default.nix b/hosts/tacitus/default.nix index fa39daa..8ddd221 100644 --- a/hosts/tacitus/default.nix +++ b/hosts/tacitus/default.nix @@ -14,16 +14,16 @@ ]; wilkuu.mjmap = { - enable = true; - users = ["wilkuu"]; - }; + enable = true; + users = [ "wilkuu" ]; + }; wilkuu.services = { prometheus.enableScraper = true; prometheus.enableExporters = true; - test_endpoint.enable = false; + test_endpoint.enable = false; mysql.enable = true; kanboard = { - enable = true; + enable = true; domain = "kb.wilkuu.xyz"; }; firefly-iii = { @@ -124,7 +124,7 @@ health = true; poe = true; wlansta = false; - wlanif = false; + wlanif = false; monitor = true; routes = true; firware = true; diff --git a/hosts/tacitus/network.nix b/hosts/tacitus/network.nix index 2409ba1..513d89c 100644 --- a/hosts/tacitus/network.nix +++ b/hosts/tacitus/network.nix @@ -8,7 +8,7 @@ let 443 config.services.grafana.settings.server.http_port config.services.prometheus.port - config.services.mysql.settings.mysqld.port + config.services.mysql.settings.mysqld.port ] ++ lib.mapAttrsToList (_: opt: opt.port) ( lib.filterAttrs ( diff --git a/inventory.nix b/inventory.nix index 98cd259..db3d3f9 100644 --- a/inventory.nix +++ b/inventory.nix @@ -1,41 +1,41 @@ -{inputs, ...}: { +{ inputs, ... }: { omega-relay = { type = "server"; - system = "x86_64-linux"; - nix = true; - nix-modules = [ - ./users/wilkuu-server.nix + system = "x86_64-linux"; + nix = true; + nix-modules = [ + ./users/wilkuu-server.nix inputs.stalwart-nix.nixosModules.default ]; - interfaces = {}; - }; + interfaces = { }; + }; apocalypse = { - type = "desktop"; - system = "x86_64-linux"; - nix = true; + type = "desktop"; + system = "x86_64-linux"; + nix = true; nix-modules = [ ./users/wilkuu.nix - ]; - interfaces = {}; - }; + ]; + interfaces = { }; + }; tacitus = { - type = "desktop"; - system = "x86_64-linux"; - nix = true; + type = "desktop"; + system = "x86_64-linux"; + nix = true; nix-modules = [ - ./users/wilkuu-server.nix - ]; - interfaces = {}; + ./users/wilkuu-server.nix + ]; + interfaces = { }; }; # TODO: Support for live images as packages # full-iso = { # type = "live"; - # system = "x86_64-linux"; - # nix = true; + # system = "x86_64-linux"; + # nix = true; # nix-paths = [ - # ./users/live-user.nix - # ]; - # interfaces = null; + # ./users/live-user.nix + # ]; + # interfaces = null; # }; } diff --git a/modules/default.nix b/modules/default.nix index 5c93f8e..6cc52d8 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -15,7 +15,7 @@ ./motd.nix ./locale.nix ./test_endpoint.nix - ./prometheus.nix + ./prometheus.nix ./mjmap.nix ]; diff --git a/modules/mjmap.nix b/modules/mjmap.nix index b826469..3229192 100644 --- a/modules/mjmap.nix +++ b/modules/mjmap.nix @@ -1,19 +1,32 @@ -{pkgs, config, lib, ...}: let - cfg = config.wilkuu.mjmap; - inherit (lib) mkEnableOption mkOption types mkIf; - # TODO: Once the mjmap patch is upstreamed, use this. +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.wilkuu.mjmap; + inherit (lib) + mkEnableOption + mkOption + types + mkIf + ; + # TODO: Once the mjmap patch is upstreamed, use this. #mjmap_wrap = (pkgs.writeScriptBin "mjmap" '' # #! ${pkgs.bash}/bin/bash # export MJMAP_CONFIG=${config.sops.secrets."mjmap-creds".path}; # exec ${pkgs.mjmap} "$@" - # ''); - + # ''); + # Workaround since the current version does not support setting config path; - mjmap_wrap = (pkgs.writeScriptBin "mjmap-send" '' - #! ${pkgs.bash}/bin/bash - export XDG_CONFIG_DIR=/etc/; - exec ${pkgs.mjmap}/bin/mjmap "$@" - ''); + mjmap_wrap = ( + pkgs.writeScriptBin "mjmap-send" '' + #! ${pkgs.bash}/bin/bash + export XDG_CONFIG_DIR=/etc/; + exec ${pkgs.mjmap}/bin/mjmap "$@" + '' + ); sendmail_wrap = pkgs.symlinkJoin { name = "sendmail-wrapper"; @@ -21,31 +34,37 @@ postBuild = '' ln -s $out/bin/mjmap-send $out/bin/sendmail ''; - }; + }; -in { +in +{ options.wilkuu.mjmap = { - enable = mkEnableOption "mjmap jmap email"; - users = mkOption { - type = types.listOf types.str; - description = "users that are allowed to view the credentials file and thus use mjmail"; + enable = mkEnableOption "mjmap jmap email"; + users = mkOption { + type = types.listOf types.str; + description = "users that are allowed to view the credentials file and thus use mjmail"; }; }; - config = mkIf cfg.enable{ - users.groups.mjmap = mkIf (cfg.users != []) {}; + config = mkIf cfg.enable { + users.groups.mjmap = mkIf (cfg.users != [ ]) { }; users.users = lib.genAttrs cfg.users (_: { - extraGroups = ["mjmap"]; - packages = [mjmap_wrap sendmail_wrap]; + extraGroups = [ "mjmap" ]; + packages = [ + mjmap_wrap + sendmail_wrap + ]; }); - sops.secrets."mjmap-creds" = mkIf (cfg.users != []) { - sopsFile = ../secrets/${config.networking.hostName}/mjmap.scfg.bin; - key = ""; + sops.secrets."mjmap-creds" = mkIf (cfg.users != [ ]) { + sopsFile = ../secrets/${config.networking.hostName}/mjmap.scfg.bin; + key = ""; format = "binary"; - group = "mjmap"; - mode = "440"; + group = "mjmap"; + mode = "440"; + }; + environment.etc."mjmap/config.scfg" = mkIf (cfg.users != [ ]) { + source = config.sops.secrets."mjmap-creds".path; }; - environment.etc."mjmap/config.scfg" = mkIf (cfg.users != []) { source = config.sops.secrets."mjmap-creds".path; }; environment.systemPackages = [ pkgs.mjmap ]; - }; -} + }; +} diff --git a/services/firefly_iii.nix b/services/firefly_iii.nix index 1f9bd64..e0f17c5 100644 --- a/services/firefly_iii.nix +++ b/services/firefly_iii.nix @@ -28,16 +28,16 @@ in }; config = mkIf cfg.enable { services.nginx.virtualHosts = { - ${cfg.domain} = { - enableACME = lib.mkForce false; - addSSL = lib.mkForce false; - forceSSL = lib.mkForce false; - }; - ${cfg.importer-domain} = { - enableACME = lib.mkForce false; - addSSL = lib.mkForce false; - forceSSL = lib.mkForce false; - }; + ${cfg.domain} = { + enableACME = lib.mkForce false; + addSSL = lib.mkForce false; + forceSSL = lib.mkForce false; + }; + ${cfg.importer-domain} = { + enableACME = lib.mkForce false; + addSSL = lib.mkForce false; + forceSSL = lib.mkForce false; + }; }; users.users."firefly_iii" = { isSystemUser = true; @@ -63,8 +63,8 @@ in allowedUsers = [ "firefly_iii" ]; }; users.firefly_iii = { - sopsPlaceholder = config.sops.placeholder."firefly_iii/db_password"; - host = "localhost"; + sopsPlaceholder = config.sops.placeholder."firefly_iii/db_password"; + host = "localhost"; }; }; services.firefly-iii = { @@ -80,10 +80,10 @@ in # DB DB_CONNECTION = "mysql"; DB_DATABASE = "firefly_iii"; - DB_HOST = "localhost"; - DB_PORT = config.services.mysql.settings.mysqld.port; - DB_USERNAME = "firefly_iii"; - DB_PASSWORD = config.sops.secrets."firefly_iii/db_password".path; + DB_HOST = "localhost"; + DB_PORT = config.services.mysql.settings.mysqld.port; + DB_USERNAME = "firefly_iii"; + DB_PASSWORD = config.sops.secrets."firefly_iii/db_password".path; # Proxying TRUSTED_PROXIES = "192.168.80.100"; diff --git a/services/kanboard.nix b/services/kanboard.nix index c19b673..6c7f0eb 100644 --- a/services/kanboard.nix +++ b/services/kanboard.nix @@ -1,57 +1,62 @@ -{pkgs, config, lib, ...}: - let - cfg = config.wilkuu.services.kanboard; - inherit (lib) mkEnableOption mkOption types mkIf; - in +{ config, lib, ... }: +let + cfg = config.wilkuu.services.kanboard; + inherit (lib) + mkEnableOption + mkOption + types + mkIf + ; +in { options.wilkuu.services.kanboard = { - enable = mkEnableOption "kanboard"; + enable = mkEnableOption "kanboard"; domain = mkOption { - type = types.str; + type = types.str; example = "kb.wilkuu.xyz"; }; - }; + }; config = mkIf cfg.enable { - wilkuu.services.mysql.unix_users = ["kanboard"]; - wilkuu.mjmap = { - enable = lib.mkDefault true; - users = ["kanboard"]; - }; + wilkuu.services.mysql.unix_users = [ "kanboard" ]; + wilkuu.mjmap = { + enable = lib.mkDefault true; + users = [ "kanboard" ]; + }; sops.secrets."kanboard/db_password" = { - sopsFile = ../secrets/${config.networking.hostName}/kanboard.yaml; - owner = "kanboard"; - mode = "500"; - }; + sopsFile = ../secrets/${config.networking.hostName}/kanboard.yaml; + owner = "kanboard"; + mode = "500"; + }; sops.templates."kanboard-env" = { content = '' DB_PASSWORD=${config.sops.placeholder."kanboard/db_password"} PLUGIN_INSTALLER=true - ''; - owner = "kanboard"; - mode = "500"; + ''; + owner = "kanboard"; + mode = "500"; }; systemd.services.phpfpm-kanboard.serviceConfig = { - EnvironmentFile = config.sops.templates."kanboard-env".path; - }; + EnvironmentFile = config.sops.templates."kanboard-env".path; + }; services.kanboard = { nginx = { enableACME = false; forceSSL = false; - addSSL = false; + addSSL = false; }; - domain = cfg.domain; - enable = true; + domain = cfg.domain; + enable = true; settings = { PLUGIN_INSTALLER = "$PLUGIN_INSTALLER"; PLUGINS_DIR = "${config.services.kanboard.dataDir}/plugins"; - MAIL_FROM = "Kanboard <noreply@wilkuu.nl>"; + MAIL_FROM = "Kanboard <noreply@wilkuu.nl>"; MAIL_TRANSPORT = "sendmail"; MAIL_SENDMAIL_COMMAND = "sendmail"; - DB_DRIVER = "mysql"; - DB_USERNAME = "kanboard"; + DB_DRIVER = "mysql"; + DB_USERNAME = "kanboard"; DB_HOSTNAME = "127.0.0.1;unix_socket=/run/mysqld/mysqld.sock"; - DB_PASSWORD = "$DB_PASSWORD"; + DB_PASSWORD = "$DB_PASSWORD"; ENABLE_URL_REWRITE = true; TRUSTED_PROXY_HEADERS = "HOST,X-REAL-IP,X-FORWARDED-FOR,X-FORWARDED-HOST,X-FORWARDED-SERVER"; TRUSTED_PROXY_NETWORKS = "192.168.80.0/24,192.168.88.0/24"; |
