<commit_before>{ inputs, defaultUser }:
{ lib, pkgs, config, ... }:

with lib;

let
  syschdemd = import ./syschdemd.nix { inherit lib pkgs config defaultUser; };
in
{
  imports = [
    (import "${inputs.nixpkgs}/nixos/modules/profiles/minimal.nix")
    (import "${inputs.home-manager}/nixos")
  ];

  nixpkgs.config.allowUnfree = true;
  environment.noXlibs = lib.mkForce false;
  environment.systemPackages = with pkgs; [
    dconf
  ];
  system.activationScripts.specialfs = mkForce "true";

  home-manager.useGlobalPkgs = true;
  home-manager.useUserPackages = false;
  home-manager.users.${defaultUser} = (import ../configuration.nix { inherit inputs; contextFile = ../contexts/wsl.nix; });
  hardware.opengl.enable = true;

  programs.nix-ld.enable = true;
  environment.etc."binfmt.d/WSLInterop.conf".text = ''
    :WSLInterop:M::MZ::/init:PF
  '';

  virtualisation.docker.enable = true;
  virtualisation.docker.extraOptions = "--iptables=False";

  services.dbus.enable = true;
  programs.mosh.enable = true;

  services.gnome.gnome-keyring.enable = true;

  services.timesyncd.enable = true;
  time.timeZone = "Europe/Helsinki";

  # WSL is closer to a container than anything else
  boot.isContainer = true;

  environment.etc.hosts.enable = false;
  environment.etc."resolv.conf".enable = false;

  networking.dhcpcd.enable = false;

  users.users.${defaultUser} = {
    isNormalUser = true;
    extraGroups = [ "wheel" ];
    shell = pkgs.zsh;
    uid = 1000;
  };

  users.users.root = {
    shell = "${syschdemd}/bin/syschdemd";
    # Otherwise WSL fails to login as root with "initgroups failed 5"
    extraGroups = [ "root" ];
  };

  # Described as "it should not be overwritten" in NixOS documentation,
  # but it's on /run per default and WSL mounts /run as a tmpfs, hence
  # hiding the wrappers.
  security.wrapperDir = "/wrappers";

  security.sudo.wheelNeedsPassword = false;

  # Disable systemd units that don't make sense on WSL
  systemd.services."serial-getty@ttyS0".enable = false;
  systemd.services."serial-getty@hvc0".enable = false;
  systemd.services."getty@tty1".enable = false;
  systemd.services."autovt@".enable = false;

  systemd.services.firewall.enable = false;
  systemd.services.systemd-resolved.enable = false;
  systemd.services.systemd-udevd.enable = false;

  # Don't allow emergency mode, because we don't have a console.
  systemd.enableEmergencyMode = false;

  system.stateVersion = "22.11";
}<commit_msg>fix(wsl): disable ommd<commit_after>{ inputs, defaultUser }:
{ lib, pkgs, config, ... }:

with lib;

let
  syschdemd = import ./syschdemd.nix { inherit lib pkgs config defaultUser; };
in
{
  imports = [
    (import "${inputs.nixpkgs}/nixos/modules/profiles/minimal.nix")
    (import "${inputs.home-manager}/nixos")
  ];

  nixpkgs.config.allowUnfree = true;
  environment.noXlibs = lib.mkForce false;
  environment.systemPackages = with pkgs; [
    dconf
  ];
  system.activationScripts.specialfs = mkForce "true";

  home-manager.useGlobalPkgs = true;
  home-manager.useUserPackages = false;
  home-manager.users.${defaultUser} = (import ../configuration.nix { inherit inputs; contextFile = ../contexts/wsl.nix; });
  hardware.opengl.enable = true;

  programs.nix-ld.enable = true;
  environment.etc."binfmt.d/WSLInterop.conf".text = ''
    :WSLInterop:M::MZ::/init:PF
  '';

  virtualisation.docker.enable = true;
  virtualisation.docker.extraOptions = "--iptables=False";

  services.dbus.enable = true;
  programs.mosh.enable = true;

  services.gnome.gnome-keyring.enable = true;

  services.timesyncd.enable = true;
  time.timeZone = "Europe/Helsinki";

  # WSL is closer to a container than anything else
  boot.isContainer = true;

  environment.etc.hosts.enable = false;
  environment.etc."resolv.conf".enable = false;

  networking.dhcpcd.enable = false;

  users.users.${defaultUser} = {
    isNormalUser = true;
    extraGroups = [ "wheel" ];
    shell = pkgs.zsh;
    uid = 1000;
  };

  users.users.root = {
    shell = "${syschdemd}/bin/syschdemd";
    # Otherwise WSL fails to login as root with "initgroups failed 5"
    extraGroups = [ "root" ];
  };

  # Described as "it should not be overwritten" in NixOS documentation,
  # but it's on /run per default and WSL mounts /run as a tmpfs, hence
  # hiding the wrappers.
  security.wrapperDir = "/wrappers";

  security.sudo.wheelNeedsPassword = false;

  # Disable systemd units that don't make sense on WSL
  systemd.services."serial-getty@ttyS0".enable = false;
  systemd.services."serial-getty@hvc0".enable = false;
  systemd.services."getty@tty1".enable = false;
  systemd.services."autovt@".enable = false;

  systemd.services.firewall.enable = false;
  systemd.services.systemd-resolved.enable = false;
  systemd.services.systemd-udevd.enable = false;
  systemd.oomd.enable = false;

  # Don't allow emergency mode, because we don't have a console.
  systemd.enableEmergencyMode = false;

  system.stateVersion = "22.11";
}
{'fraction_non_alphanumeric': 0.134180790960452, 'fraction_numerical': 0.004842615012106538, 'mean_word_length': 3.650093808630394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5436661', 'n_tokens_mistral': 1754, 'n_tokens_neox': 1661, 'n_words': 356}