From 88fb1877eaaf653d3c250b7d9788f63be5e4fe64 Mon Sep 17 00:00:00 2001 From: subcrip Date: Thu, 10 Oct 2024 19:17:14 +0800 Subject: [PATCH] Add nixos/configuration-wsl.nix Signed-off-by: subcrip --- nixos/configuration-wsl.nix | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 nixos/configuration-wsl.nix diff --git a/nixos/configuration-wsl.nix b/nixos/configuration-wsl.nix new file mode 100644 index 0000000..e64bf2a --- /dev/null +++ b/nixos/configuration-wsl.nix @@ -0,0 +1,80 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +# NixOS-WSL specific options are documented on the NixOS-WSL repository: +# https://github.com/nix-community/NixOS-WSL + +{ config, lib, pkgs, ... }: + +{ + imports = [ + # include NixOS-WSL modules + + ]; + + users.users.nixos = { + isNormalUser = true; + extraGroups = [ + "wheel" + "wireshark" + ]; + packages = with pkgs; [ + home-manager + ]; + }; + + time.timeZone = "Asia/Shanghai"; + + environment.sessionVariables = rec { + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; + }; + + environment.enableAllTerminfo = true; + + environment.systemPackages = with pkgs; [ + file + neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + sqlite + # clash-verge-rev + bind + pciutils + iptables + ]; + + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + programs.dconf.enable = true; + programs.nix-ld.enable = true; + + services.openssh.enable = true; + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config.common.default = "gtk"; + }; + services.flatpak.enable = true; + + networking.firewall.enable = false; + + system.copySystemConfiguration = true; + + wsl.enable = true; + wsl.defaultUser = "nixos"; + + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? +}