diff --git a/ops/nixos/default.nix b/ops/nixos/default.nix index 846ab1af54..adfb1160c5 100644 --- a/ops/nixos/default.nix +++ b/ops/nixos/default.nix @@ -27,6 +27,7 @@ let "porcorosso" "howl" "nausicaa" + "nausicaa-wsl" "clouvider-fra01" "totoro" "swann" @@ -59,6 +60,7 @@ let allEvaledSystems = mapAttrs systemFor systemCfgs; evaledSystems = lib.filterAttrs (n: v: v.config.my.systemType == system) allEvaledSystems; systemDrvs = mapAttrs (_: sys: sys.config.system.build.toplevel) evaledSystems; + wslSystemTarballBuilders = mapAttrs (_: sys: sys.config.system.build.tarballBuilder) (lib.filterAttrs (n: sys: lib.hasAttrByPath ["config" "system" "build" "tarballBuilder"] sys) evaledSystems); systemTailscaleIPs = lib.mapAttrs' (n: v: lib.nameValuePair v [n]) (lib.filterAttrs (n: v: v != null) (mapAttrs (_: sys: sys.config.my.ip.tailscale) evaledSystems)); systemExporters = let @@ -92,6 +94,7 @@ let installcdSystem = systemFor "installcd" (import ./installcd); in systemDrvs // { systems = systemDrvs; + inherit wslSystemTarballBuilders; systemConfigs = allEvaledSystems; systemExporters = systemExporters; tailscaleIPs = systemTailscaleIPs; diff --git a/ops/nixos/lib/wsl.nix b/ops/nixos/lib/wsl.nix new file mode 100644 index 0000000000..e6db57a1fd --- /dev/null +++ b/ops/nixos/lib/wsl.nix @@ -0,0 +1,16 @@ +{ depot, lib, ... }: + +{ + imports = [ + depot.third_party.nixosWSL.nixosModules.wsl + ]; + + config = { + services.resolved.enable = lib.mkForce false; + wsl = { + enable = true; + useWindowsDriver = true; + defaultUser = "lukegb"; + }; + }; +} diff --git a/ops/nixos/nausicaa-wsl/default.nix b/ops/nixos/nausicaa-wsl/default.nix new file mode 100644 index 0000000000..a1ed56ccad --- /dev/null +++ b/ops/nixos/nausicaa-wsl/default.nix @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: 2024 Luke Granger-Brown <depot@lukegb.com> +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, lib, pkgs, config, ... }: +let + inherit (depot.ops) secrets; +in { + imports = [ + ../lib/wsl.nix + ../lib/graphical-client-wayland.nix + ../lib/rexxar-distributed.nix + ]; + + # Laptop, don't autodeploy. + my.deploy.enable = false; + my.rundeck.expectedOnline = false; + my.scrapeJournal.enable = false; + #my.ip.tailscale = "100.125.26.108"; + #my.ip.tailscale6 = "fd7a:115c:a1e0:ab12:4843:cd96:627d:1a6c"; + + nix.settings.max-jobs = lib.mkDefault 12; + + networking.hostName = "nausicaa-wsl"; + networking.domain = "int.as205479.net"; + networking.hostId = "13ea3374"; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "25.05"; # Did you read the comment? +} diff --git a/third_party/default.nix b/third_party/default.nix index 9c1787c6a6..5716302cb2 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -167,6 +167,14 @@ rec { }; nixDarwinEval = import (nixDarwinSrc + /eval-config.nix); + nixosWSLSrc = nixpkgs.fetchFromGitHub { + owner = "nix-community"; + repo = "NixOS-WSL"; + rev = "5d76001e33ee19644a598ad80e7318ab0957b122"; + hash = "sha256-odXRdNZGdXg1LmwlAeWL85kgy/FVHsgKlDwrvbR2BsU="; + }; + nixosWSL = import nixosWSLSrc; + disko = nixpkgs.fetchFromGitHub { owner = "nix-community"; repo = "disko";