!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

331 Members
https://github.com/nix-community/NixOS-WSL54 Servers

Load older messages


SenderMessageTime
9 Mar 2024
@jee_mj:matrix.orgmj

I'm going to continue with this video but I imported the outdated packages into the current one, which saw me compiling 3000 items, which I don't know what that's done to my system now:

 nixos@nixos  ~  cat /etc/nixos/configuration.nix                                                                                                                                                      04:12:21
# 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, modulesPath, ... }:

with lib;
let
  nixos-wsl = import ./NixOS-WSL;
in
{
  imports = [
    # include NixOS-WSL modules
    "${modulesPath}/profiles/minimal.nix"

    nixos-wsl.nixosModules.wsl
  ];

  wsl = {
    enable = true;
    automountPath = "/mnt";
    defaultUser = "nixos";
    startMenuLaunchers = true;

    # docker.enable = true;
  };

  # flakes

  nix = {
    package = pkgs.nixFlakes;
    settings.experimental-features = [ "nix-command" "flakes" ];
  };


  environment.systemPackages = with pkgs; [
    file
    fish
    git
    neovim
    nodejs
    wget
  ];

  programs = {
    fzf = {
      keybindings = true;
      fuzzyCompletion = true;
    };
    fish.enable = true;
  };

  users.users.nixos.shell = pkgs.fish;
  users.users.root.shell = pkgs.fish;

  # 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 = "23.11"; # Did you read the comment?
04:20:40
@jee_mj:matrix.orgmj * Prior, I built this out in a full NixOS host,
It worked fine mostly, besides supportfor my PHP database server with phpmyadmin, which I thought might be better addressed in the actual environment it's supposed to be running on. Which is this.
04:21:00
@jucax:matrix.orgjucax joined the room.05:38:08
@k900:0upti.meK900Please just use the official tarball06:50:41
@k900:0upti.meK900It's set up correctly06:50:44
@jee_mj:matrix.orgmji did thats what I started with06:53:13
@k900:0upti.meK900Then what is happening here?06:54:13
@k900:0upti.meK900
with lib;
let
  nixos-wsl = import ./NixOS-WSL;
in
{
  imports = [
    # include NixOS-WSL modules
    "${modulesPath}/profiles/minimal.nix"

    nixos-wsl.nixosModules.wsl
  ];
06:54:15
@jee_mj:matrix.orgmjthat was me trying the old latest fixed tarball configuration file from that video06:57:37
@jee_mj:matrix.orgmjthat was actually great timing thank you so much, it fixed an issue that came from merging my github conf with the wsl hardware conf06:58:06
@jee_mj:matrix.orgmj
In reply to @k900:0upti.me
with lib;
let
  nixos-wsl = import ./NixOS-WSL;
in
{
  imports = [
    # include NixOS-WSL modules
    "${modulesPath}/profiles/minimal.nix"

    nixos-wsl.nixosModules.wsl
  ];
this looks like an excellent way to import a custom module
06:58:49
@k900:0upti.meK900Yeah I have no idea what's going on there, and you shouldn't need a hardware-configuration.nix at all06:59:08
@jee_mj:matrix.orgmjthen it'll get built by nixos06:59:12
@k900:0upti.meK900Just use the tarball and start with the default config in the tarball06:59:27
@jee_mj:matrix.orgmjI'm just getting this error mainly nixos@URIEL-WSL  /m/c/U/mj  code . 17:59:20 /home/nixos/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651/bin/remote-cli/code: line 12: /home/nixos/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651/node: cannot execute: required file not found06:59:38
@k900:0upti.meK900That's an unrelated issue which has to do with how NixOS work07:00:06
@k900:0upti.meK900* That's an unrelated issue which has to do with how NixOS works07:00:07
@jee_mj:matrix.orgmj

I have this configuration file now

───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/nixos/configuration.nix
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ { config, lib, pkgs, ... }:
   2   │
   3   │ {
   4   │   imports = [
   5   │
   6   │     /etc/nixos/.nix/system.nix
   7   │     /etc/nixos/.nix/environment.nix
   8   │     <nixos-wsl/modules>
   9   │   ];
  10   │
  11   │   wsl = {
  12   │     enable = true;
  13   │     defaultUser = "nixos";
  14   │     startMenuLaunchers = true;
  15   │
  16   │     # docker.enable = true;
  17   │   };
  18   │
  19   │   system.stateVersion = "23.11";
  20   │ }
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 
07:00:23
@k900:0upti.meK900OK yes that looks a lot more normal07:00:49
@jee_mj:matrix.orgmjis there documentation of the options anywhere?"07:00:53
@jee_mj:matrix.orgmj e.g. wsl.automountPath 07:01:12
@k900:0upti.meK900https://nix-community.github.io/NixOS-WSL/07:01:16
@k900:0upti.meK900Literally linked in the readme07:01:19
@jee_mj:matrix.orgmj

what's this option for?

wsl.usbip.enable

Whether to enable USB/IP integration.

Type: boolean

Default: false

Example: true

Declared by:

    <nixos-wsl>/modules/usbip.nix

07:16:57
@jee_mj:matrix.orgmj *

what's this option for?

wsl.usbip.enable
Whether to enable USB/IP integration.
Type: boolean
Default: false
Example: true
Declared by:
    <nixos-wsl>/modules/usbip.nix

07:17:09
@k900:0upti.meK900For forwarding USB devices directly to the VM07:19:17
@ktemkin:katesiria.org@ktemkin:katesiria.orgyou can pair it with this usbipd-win (https://github.com/dorssel/usbipd-win) and it'll let you forward USB devices as mentioned in microsoft's documentation: https://learn.microsoft.com/en-us/windows/wsl/connect-usb07:50:19
@k900:0upti.meK900It's such a weird solution too07:50:44
@k900:0upti.meK900Like07:50:46
@k900:0upti.meK900It's literally a Hyper-V VM07:50:50

Show newer messages


Back to Room ListRoom Version: 9