diff --git a/hosts/h001/flake.nix b/hosts/h001/flake.nix index ef4508be..ceaed299 100644 --- a/hosts/h001/flake.nix +++ b/hosts/h001/flake.nix @@ -39,7 +39,6 @@ }@inputs: let configuration_name = "h001"; - system = "x86_64-linux"; stateVersion = "24.11"; primaryUser = "luser"; overlayIp = "100.64.0.13"; @@ -49,7 +48,6 @@ nixosConfigurations = { "${configuration_name}" = ( lib.nixosSystem { - inherit system; specialArgs = { inherit inputs; }; diff --git a/hosts/h001/mods/litellm.nix b/hosts/h001/mods/litellm.nix index dbf2a6f4..65196625 100644 --- a/hosts/h001/mods/litellm.nix +++ b/hosts/h001/mods/litellm.nix @@ -1,19 +1,20 @@ { inputs, + pkgs, ... }: let declaration = "services/misc/litellm.nix"; - nixpkgs = inputs.litellm-nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; + nixpkgsLitellm = inputs.litellm-nixpkgs; + pkgsLitellm = import nixpkgsLitellm { + inherit (pkgs) system; config.allowUnfree = true; }; port = 8094; in { disabledModules = [ declaration ]; - imports = [ "${nixpkgs}/nixos/modules/${declaration}" ]; + imports = [ "${nixpkgsLitellm}/nixos/modules/${declaration}" ]; options = { }; config = { networking.firewall.enable = true; @@ -25,7 +26,7 @@ in inherit port; host = "0.0.0.0"; openFirewall = false; - package = pkgs.litellm; + package = pkgsLitellm.litellm; environment = { SCARF_NO_ANALYTICS = "True"; DO_NOT_TRACK = "True"; @@ -33,7 +34,7 @@ in GITHUB_COPILOT_TOKEN_DIR = "/var/lib/litellm/github_copilot"; XDG_CONFIG_HOME = "/var/lib/litellm/.config"; }; - settings = { + settings = { environment_variables = { LITELLM_PROXY_API_KEY = "na"; }; @@ -50,11 +51,11 @@ in litellm_params = { model = "github_copilot/${m}"; extra_headers = { - editor-version = "vscode/${pkgs.vscode.version}"; - editor-plugin-version = "copilot/${pkgs.vscode-extensions.github.copilot.version}"; + editor-version = "vscode/${pkgsLitellm.vscode.version}"; + editor-plugin-version = "copilot/${pkgsLitellm.vscode-extensions.github.copilot.version}"; Copilot-Integration-Id = "vscode-chat"; Copilot-Vision-Request = "true"; - user-agent = "GithubCopilot/${pkgs.vscode-extensions.github.copilot.version}"; + user-agent = "GithubCopilot/${pkgsLitellm.vscode-extensions.github.copilot.version}"; }; }; @@ -80,7 +81,7 @@ in api_key = "na"; }; }) - # curl -L "http://100.64.0.8:9010/azure/openai/models?api-version=2025-04-01-preview" | jq '.data.[].id' + # curl -L "http://100.64.0.8:9010/azure/openai/models?api-version=2025-04-01-preview" | jq '.data.[].id' [ "gpt-5.1-2025-11-13" "gpt-4o-2024-05-13" diff --git a/hosts/h001/mods/monitoring_hub.nix b/hosts/h001/mods/monitoring_hub.nix index a780b5e7..31433e2a 100644 --- a/hosts/h001/mods/monitoring_hub.nix +++ b/hosts/h001/mods/monitoring_hub.nix @@ -1,21 +1,22 @@ { inputs, + pkgs, ... }: let declaration = "services/monitoring/beszel-hub.nix"; - nixpkgs = inputs.beszel-nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; + nixpkgsBeszel = inputs.beszel-nixpkgs; + pkgsBeszel = import nixpkgsBeszel { + inherit (pkgs) system; config.allowUnfree = true; }; in { disabledModules = [ declaration ]; - imports = [ "${nixpkgs}/nixos/modules/${declaration}" ]; + imports = [ "${nixpkgsBeszel}/nixos/modules/${declaration}" ]; config = { services.beszel.hub = { - package = pkgs.beszel; + package = pkgsBeszel.beszel; enable = true; port = 8090; host = "100.64.0.13"; diff --git a/hosts/h001/mods/oauth2-proxy.nix b/hosts/h001/mods/oauth2-proxy.nix index 73d6f2f0..551a7d0e 100644 --- a/hosts/h001/mods/oauth2-proxy.nix +++ b/hosts/h001/mods/oauth2-proxy.nix @@ -1,14 +1,15 @@ { inputs, config, + pkgs, lib, ... }: let declaration = "services/security/oauth2-proxy.nix"; - nixpkgs = inputs.oauth2-proxy-nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; + nixpkgsOauth2Proxy = inputs.oauth2-proxy-nixpkgs; + pkgsOauth2Proxy = import nixpkgsOauth2Proxy { + inherit (pkgs) system; config.allowUnfree = true; }; hasSecret = @@ -20,12 +21,12 @@ let in { disabledModules = [ declaration ]; - imports = [ "${nixpkgs}/nixos/modules/${declaration}" ]; + imports = [ "${nixpkgsOauth2Proxy}/nixos/modules/${declaration}" ]; config = lib.mkIf (hasSecret "oauth2_proxy_key_file") { services.oauth2-proxy = { enable = true; httpAddress = "http://127.0.0.1:4180"; - package = pkgs.oauth2-proxy; + package = pkgsOauth2Proxy.oauth2-proxy; provider = "oidc"; reverseProxy = true; redirectURL = "https://sso-proxy.joshuabell.xyz/oauth2/callback"; diff --git a/hosts/h001/mods/openwebui.nix b/hosts/h001/mods/openwebui.nix index d6c0e5a4..a76aa6b4 100644 --- a/hosts/h001/mods/openwebui.nix +++ b/hosts/h001/mods/openwebui.nix @@ -1,14 +1,15 @@ { inputs, config, + pkgs, lib, ... }: let declaration = "services/misc/open-webui.nix"; - nixpkgs = inputs.open-webui-nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; + nixpkgsOpenWebui = inputs.open-webui-nixpkgs; + pkgsOpenWebui = import nixpkgsOpenWebui { + inherit (pkgs) system; config.allowUnfree = true; }; hasSecret = @@ -20,7 +21,7 @@ let in { disabledModules = [ declaration ]; - imports = [ "${nixpkgs}/nixos/modules/${declaration}" ]; + imports = [ "${nixpkgsOpenWebui}/nixos/modules/${declaration}" ]; options = { }; config = lib.mkIf (hasSecret "openwebui_env") { services.nginx.virtualHosts."chat.joshuabell.xyz" = { @@ -44,7 +45,7 @@ in port = 8084; host = "127.0.0.1"; openFirewall = false; - package = pkgs.open-webui; + package = pkgsOpenWebui.open-webui; environmentFile = config.age.secrets.openwebui_env.path; environment = { # Declarative config, we don't use admin panel for anything @@ -76,11 +77,11 @@ in # OAUTH_PICTURE_CLAIM = "picture"; # OAUTH_UPDATE_PICTURE_ON_LOGIN = "True"; - BYPASS_MODEL_ACCESS_CONTROL="True"; + BYPASS_MODEL_ACCESS_CONTROL = "True"; # Other settings - CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE="10485760"; - REPLACE_IMAGE_URLS_IN_CHAT_RESPONSE="True"; + CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE = "10485760"; + REPLACE_IMAGE_URLS_IN_CHAT_RESPONSE = "True"; }; }; }; diff --git a/hosts/h001/mods/pinchflat.nix b/hosts/h001/mods/pinchflat.nix index abd3183d..d4e30b55 100644 --- a/hosts/h001/mods/pinchflat.nix +++ b/hosts/h001/mods/pinchflat.nix @@ -1,22 +1,23 @@ { lib, inputs, + pkgs, ... }: let declaration = "services/misc/pinchflat.nix"; - nixpkgs = inputs.pinchflat-nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; + nixpkgsPinchflat = inputs.pinchflat-nixpkgs; + pkgsPinchflat = import nixpkgsPinchflat { + inherit (pkgs) system; config.allowUnfree = true; }; in { disabledModules = [ declaration ]; - imports = [ "${nixpkgs}/nixos/modules/${declaration}" ]; + imports = [ "${nixpkgsPinchflat}/nixos/modules/${declaration}" ]; config = { services.pinchflat = { - package = pkgs.pinchflat; + package = pkgsPinchflat.pinchflat; enable = true; port = 8945; selfhosted = true; diff --git a/hosts/h001/mods/trilium.nix b/hosts/h001/mods/trilium.nix index cc053442..c8aa6f6f 100644 --- a/hosts/h001/mods/trilium.nix +++ b/hosts/h001/mods/trilium.nix @@ -1,22 +1,23 @@ { inputs, + pkgs, ... }: let declaration = "services/web-apps/trilium.nix"; - nixpkgs = inputs.trilium-nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; + nixpkgsTrilium = inputs.trilium-nixpkgs; + pkgsTrilium = import nixpkgsTrilium { + inherit (pkgs) system; config.allowUnfree = true; }; in { disabledModules = [ declaration ]; - imports = [ "${nixpkgs}/nixos/modules/${declaration}" ]; + imports = [ "${nixpkgsTrilium}/nixos/modules/${declaration}" ]; config = { services.trilium-server = { enable = true; - package = pkgs.trilium-server; + package = pkgsTrilium.trilium-server; port = 9111; host = "127.0.0.1"; dataDir = "/var/lib/trilium"; diff --git a/hosts/oracle/o001/flake.nix b/hosts/oracle/o001/flake.nix index 2e5e0eba..33caff14 100644 --- a/hosts/oracle/o001/flake.nix +++ b/hosts/oracle/o001/flake.nix @@ -28,7 +28,6 @@ }@inputs: let configuration_name = "o001"; - system = "aarch64-linux"; stateVersion = "23.11"; primaryUser = "root"; overlayIp = "100.64.0.11"; @@ -41,12 +40,14 @@ "-i" "/run/agenix/nix2oracle" ]; - nodes.${configuration_name} = { + nodes.${configuration_name} = rec { hostname = "64.181.210.7"; - targetPlatform = system; + targetPlatform = "aarch64-linux"; profiles.system = { user = "root"; - path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${configuration_name}; + path = + deploy-rs.lib.${targetPlatform}.activate.nixos + self.nixosConfigurations.${configuration_name}; }; }; };