From 681e1372b52f52e7a25871a304d2bd7be9f26ea7 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 27 Feb 2026 20:32:24 +0100 Subject: Sync dev setup to laptop --- host/Rory-desktop/configuration.nix | 12 +++- host/Rory-laptop/configuration.nix | 17 ++--- host/Rory-laptop/mariadb.nix | 14 ---- host/Rory-laptop/nginx.nix | 42 ------------ host/Rory-laptop/nginx/discord.localhost.nix | 36 ----------- host/Rory-laptop/nginx/hse.localhost.nix | 75 ---------------------- host/Rory-laptop/ollama.nix | 44 ------------- host/Rory-laptop/postgres.nix | 45 ------------- host/Rory-laptop/printing.nix | 54 ---------------- host/Rory-laptop/services/mariadb.nix | 14 ++++ host/Rory-laptop/services/nginx.nix | 42 ++++++++++++ .../services/nginx/discord.localhost.nix | 36 +++++++++++ host/Rory-laptop/services/nginx/hse.localhost.nix | 75 ++++++++++++++++++++++ host/Rory-laptop/services/nginx/nix-bincache.nix | 12 ++++ host/Rory-laptop/services/nix-bincache.nix | 11 ++++ host/Rory-laptop/services/ollama.nix | 44 +++++++++++++ host/Rory-laptop/services/postgres.nix | 45 +++++++++++++ host/Rory-laptop/services/printing.nix | 54 ++++++++++++++++ 18 files changed, 353 insertions(+), 319 deletions(-) delete mode 100644 host/Rory-laptop/mariadb.nix delete mode 100644 host/Rory-laptop/nginx.nix delete mode 100644 host/Rory-laptop/nginx/discord.localhost.nix delete mode 100755 host/Rory-laptop/nginx/hse.localhost.nix delete mode 100644 host/Rory-laptop/ollama.nix delete mode 100644 host/Rory-laptop/postgres.nix delete mode 100644 host/Rory-laptop/printing.nix create mode 100644 host/Rory-laptop/services/mariadb.nix create mode 100644 host/Rory-laptop/services/nginx.nix create mode 100644 host/Rory-laptop/services/nginx/discord.localhost.nix create mode 100755 host/Rory-laptop/services/nginx/hse.localhost.nix create mode 100644 host/Rory-laptop/services/nginx/nix-bincache.nix create mode 100644 host/Rory-laptop/services/nix-bincache.nix create mode 100644 host/Rory-laptop/services/ollama.nix create mode 100644 host/Rory-laptop/services/postgres.nix create mode 100644 host/Rory-laptop/services/printing.nix diff --git a/host/Rory-desktop/configuration.nix b/host/Rory-desktop/configuration.nix index 8329adf..5558a08 100644 --- a/host/Rory-desktop/configuration.nix +++ b/host/Rory-desktop/configuration.nix @@ -237,6 +237,16 @@ args@{ enableGhostscriptFonts = lib.mkForce false; }; + services.cockpit = { + enable = true; + settings = { + WebService = { + AllowUnencrypted = true; + }; + }; + }; + + nix.settings.auto-optimise-store = lib.mkForce false; nixpkgs = { config = { allowUnfree = true; @@ -263,7 +273,7 @@ args@{ # }; monitoring = { - monitorAll = true; + monitorAll = false; localPrometheus = true; exposePrometheus = true; localGrafana = true; diff --git a/host/Rory-laptop/configuration.nix b/host/Rory-laptop/configuration.nix index 320a5d9..ef678f8 100644 --- a/host/Rory-laptop/configuration.nix +++ b/host/Rory-laptop/configuration.nix @@ -16,14 +16,11 @@ args@{ # ../../modules/environments/home.nix ../../modules/environments/nethost-Rory-desktop.nix #../../modules/software-templates/profilers.nix -# ../../modules/software-templates/dotnet.client.nix - #../../modules/software-templates/devenv/dotnet.nix - #./postgres.nix - #./nginx.nix - - #./edu/vmware.nix - #./edu/nodejs-dev.nix + ../../modules/software-templates/eid-mw.nix + ../../modules/software-templates/devenv/dotnet.nix + ../../modules/software-templates/devenv/javascript.nix + ./services/nix-bincache.nix # hardware-specific imports #./optional/hardware-specific/nvidia.nix @@ -33,7 +30,11 @@ args@{ boot = { kernelPackages = pkgs.linuxPackages_latest; - blacklistedKernelModules = [ "nova" "nova_core" "nouveau" ]; + blacklistedKernelModules = [ + "nova" + "nova_core" + "nouveau" + ]; loader = { grub = { configurationLimit = 10; diff --git a/host/Rory-laptop/mariadb.nix b/host/Rory-laptop/mariadb.nix deleted file mode 100644 index 758cb3d..0000000 --- a/host/Rory-laptop/mariadb.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - services.mysql = { - enable = true; - package = pkgs.mariadb; - }; - -} diff --git a/host/Rory-laptop/nginx.nix b/host/Rory-laptop/nginx.nix deleted file mode 100644 index 3a0e622..0000000 --- a/host/Rory-laptop/nginx.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - services = { - nginx = { - enable = true; - recommendedProxySettings = true; - #recommendedTlsSettings = true; - #recommendedZstdSettings = true; - # recommendedGzipSettings = true; - recommendedBrotliSettings = true; - recommendedOptimisation = true; - #defaultMimeTypes = ../../../../packages/nginx/mime.types; - appendConfig = '' - #worker_processes 16; - ''; - eventsConfig = '' - #use kqueue; - #worker_connections 512; - ''; - appendHttpConfig = '' - #sendfile on; - disable_symlinks off; - ''; - additionalModules = with pkgs.nginxModules; [ moreheaders ]; - virtualHosts = { - "discord.localhost" = import ./nginx/discord.localhost.nix { inherit pkgs; }; - "hse.localhost" = import ./nginx/hse.localhost.nix { inherit pkgs; }; - - }; - }; - }; - systemd.services.nginx.serviceConfig = { - LimitNOFILE = 5000000; - }; - -} diff --git a/host/Rory-laptop/nginx/discord.localhost.nix b/host/Rory-laptop/nginx/discord.localhost.nix deleted file mode 100644 index b40e13c..0000000 --- a/host/Rory-laptop/nginx/discord.localhost.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: - -{ - root = "/www/discord"; - addSSL = true; - enableACME = false; - - # We don't care about certificates around here... - sslCertificate = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.cert.pem"; - sslCertificateKey = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.key.pem"; - - extraConfig = '' - autoindex on; - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS'; - more_set_headers 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; - more_set_headers 'Access-Control-Expose-Headers: Content-Length,Content-Range'; - more_set_headers 'Access-Control-Allow-Credentials: true'; - ''; - - locations = { - "/" = { - index = "index.html"; - extraConfig = '' - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: *'; - more_set_headers 'Access-Control-Allow-Headers: *'; - more_set_headers 'Access-Control-Expose-Headers: *'; - more_set_headers 'Access-Control-Max-Age' 1728000; - - # default to /index.html if file not found - try_files $uri $uri/ /index.html; - ''; - }; - }; -} diff --git a/host/Rory-laptop/nginx/hse.localhost.nix b/host/Rory-laptop/nginx/hse.localhost.nix deleted file mode 100755 index c3c1731..0000000 --- a/host/Rory-laptop/nginx/hse.localhost.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ pkgs, ... }: -{ - enableACME = false; - addSSL = true; - # We don't care about certificates around here... - sslCertificate = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.cert.pem"; - sslCertificateKey = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.key.pem"; - locations."/" = { - #proxyPass = "http://127.0.0.1:9001"; - proxyPass = "http://localhost:5298"; - extraConfig = '' - if ($request_method = 'OPTIONS') { - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: *'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - more_set_headers 'Access-Control-Max-Age: 1728000'; - more_set_headers 'Content-Type: text/plain; charset=utf-8'; - more_set_headers 'Content-Length: 0'; - return 204; - } - ''; - }; - - # locations."= /.well-known/matrix/server".extraConfig = '' - # more_set_headers 'Content-Type application/json'; - # more_set_headers 'Access-Control-Allow-Origin *'; - # return 200 '${builtins.toJSON { "m.server" = "hse.localhost:5298"; }}'; - # ''; - # locations."= /.well-known/matrix/client".extraConfig = '' - # more_set_headers 'Content-Type application/json'; - # more_set_headers 'Access-Control-Allow-Origin *'; - # return 200 '${ - # builtins.toJSON { - # "m.homeserver".base_url = "http://hse.localhost:5298"; - # "org.matrix.msc3575.proxy".url = "https://matrix.rory.gay"; - # } - # }'; - # ''; - locations."= /.well-known/matrix/support".extraConfig = '' - more_set_headers 'Content-Type application/json'; - more_set_headers 'Access-Control-Allow-Origin *'; - return 200 '${ - builtins.toJSON { - admins = [ - { - matrix_id = "@emma:rory.gay"; - role = "admin"; - } - { - matrix_id = "@alicia:rory.gay"; - role = "admin"; - } - { - matrix_id = "@root:rory.gay"; - role = "admin"; - } - { - matrix_id = "@rory:rory.gay"; - role = "admin"; - } - ]; - } - }'; - ''; - - locations."~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync)" = { - proxyPass = "http://localhost:8100"; - }; -} diff --git a/host/Rory-laptop/ollama.nix b/host/Rory-laptop/ollama.nix deleted file mode 100644 index b1b0a7a..0000000 --- a/host/Rory-laptop/ollama.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - # systemd.tmpfiles.rules = [ "d /data/ollama 0750 ostgres postgres" ]; - - #overlays - #nixpkgs.overlays = [ - # (final: old: { - # rocmPackages = old.rocmPackages // { - # rocblas = (old.rocmPackages.rocblas.overrideAttrs (oldAttrs: { - # gpuTargets = [ "gfx1102" ]; - # })); - # }; - # } - # ) - #]; - - services.ollama = { - enable = true; - home = "/data/ollama/home"; - models = "/data/ollama/home/models"; - environmentVariables = { - OLLAMA_LLM_LIBRARY = "rocm"; - HCC_AMDGPU_TARGET = "gfx1102"; - }; - # writablePaths = [ "/data/ollama/home" ]; - #listenAddress = "0.0.0.0:11434"; - host = "0.0.0.0"; - port = 11434; - user = "ollama"; - group = "ollama"; - acceleration = "rocm"; - rocmOverrideGfx = "11.0.2"; - }; - - #services.nextjs-ollama-llm-ui = { - - #}; -} diff --git a/host/Rory-laptop/postgres.nix b/host/Rory-laptop/postgres.nix deleted file mode 100644 index c201b04..0000000 --- a/host/Rory-laptop/postgres.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - #systemd.tmpfiles.rules = [ "d /mnt/postgres/data 0750 postgres postgres" ]; - - services.postgresql = { - enable = true; - package = pkgs.postgresql_16; - enableTCPIP = true; - authentication = pkgs.lib.mkOverride 10 '' - # TYPE, DATABASE, USER, ADDRESS, METHOD - local all all trust - host all all 127.0.0.1/32 trust - host all all ::1/128 trust - host discordbots discordbots 192.168.1.2/32 trust - host matrix-synapse-rory-gay matrix-synapse-rory-gay 192.168.1.5/32 trust - host all all 0.0.0.0/0 md5 - ''; - # initialScript = pkgs.writeText "backend-initScript" '' - # CREATE ROLE nixcloud WITH LOGIN PASSWORD 'nixcloud' CREATEDB; - # CREATE DATABASE nixcloud; - # GRANT ALL PRIVILEGES ON DATABASE nixcloud TO nixcloud; - # ''; - #dataDir = "/mnt/postgres/data"; - settings = { - "max_connections" = "1000"; - "shared_buffers" = "512MB"; - "max_wal_size" = "1GB"; - "min_wal_size" = "80MB"; - - shared_preload_libraries = "pg_stat_statements"; - track_io_timing = "on"; - track_functions = "pl"; - "pg_stat_statements.max" = "10000"; # additional - "pg_stat_statements.track" = "all"; # additional - - }; - }; - -} diff --git a/host/Rory-laptop/printing.nix b/host/Rory-laptop/printing.nix deleted file mode 100644 index 4f86347..0000000 --- a/host/Rory-laptop/printing.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ ]; - - users.users = { - Rory = { - extraGroups = [ - "lp" - "scanner" - ]; - }; - }; - - environment.systemPackages = with pkgs; [ - xsane - simple-scan - ]; - - hardware = { - sane.enable = true; - sane.extraBackends = [ - pkgs.hplipWithPlugin - pkgs.sane-airscan - ]; - }; - - programs.system-config-printer.enable = true; - - services = { - gvfs.enable = true; - saned.enable = true; - system-config-printer.enable = true; - ipp-usb.enable = true; - printing = { - enable = true; - browsing = true; - drivers = with pkgs; [ hplip ]; - }; - avahi = { - enable = true; - nssmdns4 = true; - reflector = true; - publish = { - workstation = true; - userServices = true; - hinfo = true; - enable = true; - domain = true; - addresses = true; - }; - }; - }; -} diff --git a/host/Rory-laptop/services/mariadb.nix b/host/Rory-laptop/services/mariadb.nix new file mode 100644 index 0000000..758cb3d --- /dev/null +++ b/host/Rory-laptop/services/mariadb.nix @@ -0,0 +1,14 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + services.mysql = { + enable = true; + package = pkgs.mariadb; + }; + +} diff --git a/host/Rory-laptop/services/nginx.nix b/host/Rory-laptop/services/nginx.nix new file mode 100644 index 0000000..5735b9d --- /dev/null +++ b/host/Rory-laptop/services/nginx.nix @@ -0,0 +1,42 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + services = { + nginx = { + enable = true; + recommendedProxySettings = true; + #recommendedTlsSettings = true; + #recommendedZstdSettings = true; + # recommendedGzipSettings = true; + recommendedBrotliSettings = true; + recommendedOptimisation = true; + #defaultMimeTypes = ../../../../packages/nginx/mime.types; + appendConfig = '' + #worker_processes 16; + ''; + eventsConfig = '' + #use kqueue; + #worker_connections 512; + ''; + appendHttpConfig = '' + #sendfile on; + disable_symlinks off; + ''; + additionalModules = with pkgs.nginxModules; [ moreheaders ]; + virtualHosts = { + "discord.localhost" = import ./nginx/discord.localhost.nix { inherit pkgs; }; + "hse.localhost" = import ./nginx/hse.localhost.nix { inherit pkgs; }; + "nix-bincache.rory-desktop.local" = import ./nginx/nix-bincache.nix { inherit config; }; + }; + }; + }; + systemd.services.nginx.serviceConfig = { + LimitNOFILE = 5000000; + }; + +} diff --git a/host/Rory-laptop/services/nginx/discord.localhost.nix b/host/Rory-laptop/services/nginx/discord.localhost.nix new file mode 100644 index 0000000..b40e13c --- /dev/null +++ b/host/Rory-laptop/services/nginx/discord.localhost.nix @@ -0,0 +1,36 @@ +{ pkgs, ... }: + +{ + root = "/www/discord"; + addSSL = true; + enableACME = false; + + # We don't care about certificates around here... + sslCertificate = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.cert.pem"; + sslCertificateKey = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.key.pem"; + + extraConfig = '' + autoindex on; + more_set_headers 'Access-Control-Allow-Origin: *'; + more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS'; + more_set_headers 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + more_set_headers 'Access-Control-Expose-Headers: Content-Length,Content-Range'; + more_set_headers 'Access-Control-Allow-Credentials: true'; + ''; + + locations = { + "/" = { + index = "index.html"; + extraConfig = '' + more_set_headers 'Access-Control-Allow-Origin: *'; + more_set_headers 'Access-Control-Allow-Methods: *'; + more_set_headers 'Access-Control-Allow-Headers: *'; + more_set_headers 'Access-Control-Expose-Headers: *'; + more_set_headers 'Access-Control-Max-Age' 1728000; + + # default to /index.html if file not found + try_files $uri $uri/ /index.html; + ''; + }; + }; +} diff --git a/host/Rory-laptop/services/nginx/hse.localhost.nix b/host/Rory-laptop/services/nginx/hse.localhost.nix new file mode 100755 index 0000000..c3c1731 --- /dev/null +++ b/host/Rory-laptop/services/nginx/hse.localhost.nix @@ -0,0 +1,75 @@ +{ pkgs, ... }: +{ + enableACME = false; + addSSL = true; + # We don't care about certificates around here... + sslCertificate = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.cert.pem"; + sslCertificateKey = "${pkgs.path}/nixos/tests/common/acme/server/acme.test.key.pem"; + locations."/" = { + #proxyPass = "http://127.0.0.1:9001"; + proxyPass = "http://localhost:5298"; + extraConfig = '' + if ($request_method = 'OPTIONS') { + more_set_headers 'Access-Control-Allow-Origin: *'; + more_set_headers 'Access-Control-Allow-Methods: *'; + # + # Custom headers and headers various browsers *should* be OK with but aren't + # + more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; + # + # Tell client that this pre-flight info is valid for 20 days + # + more_set_headers 'Access-Control-Max-Age: 1728000'; + more_set_headers 'Content-Type: text/plain; charset=utf-8'; + more_set_headers 'Content-Length: 0'; + return 204; + } + ''; + }; + + # locations."= /.well-known/matrix/server".extraConfig = '' + # more_set_headers 'Content-Type application/json'; + # more_set_headers 'Access-Control-Allow-Origin *'; + # return 200 '${builtins.toJSON { "m.server" = "hse.localhost:5298"; }}'; + # ''; + # locations."= /.well-known/matrix/client".extraConfig = '' + # more_set_headers 'Content-Type application/json'; + # more_set_headers 'Access-Control-Allow-Origin *'; + # return 200 '${ + # builtins.toJSON { + # "m.homeserver".base_url = "http://hse.localhost:5298"; + # "org.matrix.msc3575.proxy".url = "https://matrix.rory.gay"; + # } + # }'; + # ''; + locations."= /.well-known/matrix/support".extraConfig = '' + more_set_headers 'Content-Type application/json'; + more_set_headers 'Access-Control-Allow-Origin *'; + return 200 '${ + builtins.toJSON { + admins = [ + { + matrix_id = "@emma:rory.gay"; + role = "admin"; + } + { + matrix_id = "@alicia:rory.gay"; + role = "admin"; + } + { + matrix_id = "@root:rory.gay"; + role = "admin"; + } + { + matrix_id = "@rory:rory.gay"; + role = "admin"; + } + ]; + } + }'; + ''; + + locations."~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync)" = { + proxyPass = "http://localhost:8100"; + }; +} diff --git a/host/Rory-laptop/services/nginx/nix-bincache.nix b/host/Rory-laptop/services/nginx/nix-bincache.nix new file mode 100644 index 0000000..29ffc4d --- /dev/null +++ b/host/Rory-laptop/services/nginx/nix-bincache.nix @@ -0,0 +1,12 @@ +{ config }: +{ + locations."/" = { + proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; + extraConfig = '' + allow 10.0.0.0/8; + allow 192.168.0.0/16; + allow 127.0.0.0/8; + deny all; + ''; + }; +} diff --git a/host/Rory-laptop/services/nix-bincache.nix b/host/Rory-laptop/services/nix-bincache.nix new file mode 100644 index 0000000..811ca63 --- /dev/null +++ b/host/Rory-laptop/services/nix-bincache.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + services.nix-serve = { + enable = true; + package = pkgs.nix-serve-ng; + port = 3642; + bindAddress = "127.0.0.1"; + secretKeyFile = "/data/secrets/nix-bincache-priv-key.pem"; + }; +} diff --git a/host/Rory-laptop/services/ollama.nix b/host/Rory-laptop/services/ollama.nix new file mode 100644 index 0000000..b1b0a7a --- /dev/null +++ b/host/Rory-laptop/services/ollama.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + # systemd.tmpfiles.rules = [ "d /data/ollama 0750 ostgres postgres" ]; + + #overlays + #nixpkgs.overlays = [ + # (final: old: { + # rocmPackages = old.rocmPackages // { + # rocblas = (old.rocmPackages.rocblas.overrideAttrs (oldAttrs: { + # gpuTargets = [ "gfx1102" ]; + # })); + # }; + # } + # ) + #]; + + services.ollama = { + enable = true; + home = "/data/ollama/home"; + models = "/data/ollama/home/models"; + environmentVariables = { + OLLAMA_LLM_LIBRARY = "rocm"; + HCC_AMDGPU_TARGET = "gfx1102"; + }; + # writablePaths = [ "/data/ollama/home" ]; + #listenAddress = "0.0.0.0:11434"; + host = "0.0.0.0"; + port = 11434; + user = "ollama"; + group = "ollama"; + acceleration = "rocm"; + rocmOverrideGfx = "11.0.2"; + }; + + #services.nextjs-ollama-llm-ui = { + + #}; +} diff --git a/host/Rory-laptop/services/postgres.nix b/host/Rory-laptop/services/postgres.nix new file mode 100644 index 0000000..c201b04 --- /dev/null +++ b/host/Rory-laptop/services/postgres.nix @@ -0,0 +1,45 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + #systemd.tmpfiles.rules = [ "d /mnt/postgres/data 0750 postgres postgres" ]; + + services.postgresql = { + enable = true; + package = pkgs.postgresql_16; + enableTCPIP = true; + authentication = pkgs.lib.mkOverride 10 '' + # TYPE, DATABASE, USER, ADDRESS, METHOD + local all all trust + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + host discordbots discordbots 192.168.1.2/32 trust + host matrix-synapse-rory-gay matrix-synapse-rory-gay 192.168.1.5/32 trust + host all all 0.0.0.0/0 md5 + ''; + # initialScript = pkgs.writeText "backend-initScript" '' + # CREATE ROLE nixcloud WITH LOGIN PASSWORD 'nixcloud' CREATEDB; + # CREATE DATABASE nixcloud; + # GRANT ALL PRIVILEGES ON DATABASE nixcloud TO nixcloud; + # ''; + #dataDir = "/mnt/postgres/data"; + settings = { + "max_connections" = "1000"; + "shared_buffers" = "512MB"; + "max_wal_size" = "1GB"; + "min_wal_size" = "80MB"; + + shared_preload_libraries = "pg_stat_statements"; + track_io_timing = "on"; + track_functions = "pl"; + "pg_stat_statements.max" = "10000"; # additional + "pg_stat_statements.track" = "all"; # additional + + }; + }; + +} diff --git a/host/Rory-laptop/services/printing.nix b/host/Rory-laptop/services/printing.nix new file mode 100644 index 0000000..4f86347 --- /dev/null +++ b/host/Rory-laptop/services/printing.nix @@ -0,0 +1,54 @@ +{ pkgs, ... }: + +{ + imports = [ ]; + + users.users = { + Rory = { + extraGroups = [ + "lp" + "scanner" + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + xsane + simple-scan + ]; + + hardware = { + sane.enable = true; + sane.extraBackends = [ + pkgs.hplipWithPlugin + pkgs.sane-airscan + ]; + }; + + programs.system-config-printer.enable = true; + + services = { + gvfs.enable = true; + saned.enable = true; + system-config-printer.enable = true; + ipp-usb.enable = true; + printing = { + enable = true; + browsing = true; + drivers = with pkgs; [ hplip ]; + }; + avahi = { + enable = true; + nssmdns4 = true; + reflector = true; + publish = { + workstation = true; + userServices = true; + hinfo = true; + enable = true; + domain = true; + addresses = true; + }; + }; + }; +} -- cgit 1.5.1