From efc2ca7526646cbb9fbf1f2ad94e8d507ab266f5 Mon Sep 17 00:00:00 2001 From: Cottand Date: Mon, 10 Mar 2025 23:49:09 +0000 Subject: [PATCH 1/2] test: add ad-hoc darwin VM for testing --- .gitignore | 3 ++- flake.nix | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5ff746b..9d8f60e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ leng.log leng.toml .DS_Store -result \ No newline at end of file +result +*.qcow2 diff --git a/flake.nix b/flake.nix index 26073b0..d73a789 100644 --- a/flake.nix +++ b/flake.nix @@ -160,6 +160,30 @@ ]; }; }; + + + # this is a simple NixOS VM that can be used for trying out the NixOS module outside of a NixOS test + nixosConfigurations.aarch-darwin-leng-test = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + self.nixosModules.default + { + virtualisation.vmVariant.virtualisation.graphics = false; + virtualisation.vmVariant.virtualisation.host.pkgs = nixpkgs.legacyPackages.aarch64-darwin; + services.getty.autologinUser = "root"; + system.stateVersion = "24.11"; + + services.leng = { + enable = true; + configuration = { + api = "127.0.0.1:8080"; + metrics.enabled = true; + blocking.sourcesStore = "/var/lib/leng-sources"; + }; + }; + } + ]; + }; }; } From 22e6eb1f3ded8bb2329a8fd71d10c576222a457c Mon Sep 17 00:00:00 2001 From: Cottand Date: Sun, 16 Mar 2025 11:34:17 +0000 Subject: [PATCH 2/2] add localhost as a resolver for test machine --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index d73a789..88a557f 100644 --- a/flake.nix +++ b/flake.nix @@ -172,6 +172,12 @@ virtualisation.vmVariant.virtualisation.host.pkgs = nixpkgs.legacyPackages.aarch64-darwin; services.getty.autologinUser = "root"; system.stateVersion = "24.11"; + # fileSystems."/" = { + # device = "rpool/local/root"; + # fsType = "zfs"; + # }; + networking.nameservers = [ "127.0.0.1" ]; + services.leng = { enable = true; @@ -179,6 +185,7 @@ api = "127.0.0.1:8080"; metrics.enabled = true; blocking.sourcesStore = "/var/lib/leng-sources"; + upstream.doh = "https://1.1.1.1/dns-query"; }; }; }