!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

334 Members
https://github.com/nix-community/NixOS-WSL55 Servers

Load older messages


SenderMessageTime
25 Mar 2024
@peepojuice:matrix.orgPeepsi made sure to edit server-env-setup with: PATH=$PATH:/run/current-system/sw/bin/12:17:32
@peepojuice:matrix.orgPeepsoh wait i should restart wsl12:18:22
@peepojuice:matrix.orgPeepsNope, same thing. Also, this error never got resolved: Unable to detect if server is already installed: Error: Failed to probe if server is already installed: code: Failed to probe if server is already installed: code: 127, /nix/store/41l3q7yi1ab5s1830k2pi023s5c5vhrl-bash-interactive-5.2p26/bin/sh: line 1: uname: command not found12:19:42
@peepojuice:matrix.orgPeepsUgh, i have to go now but il be back in an hour. But this is progress lol.12:20:53
@peepojuice:matrix.orgPeepsokay so I was being dumb. my configuration.nix was not correct. But now im getting undefined 'inputs' again. Ughhh13:18:14
@peepojuice:matrix.orgPeepsim reading everywhere that u use "specialArgs = { inherit inputs; };" to get that to work but thats already in the flake :/13:39:11
@k900:0upti.meK900 You need to use nixos-rebuild --flake /etc/nixos switch 13:40:53
@k900:0upti.meK900Otherwise it uses your existing configuration.nix13:41:00
@peepojuice:matrix.orgPeepsIt didnt work :/13:42:35
@k900:0upti.meK900What exactly "didn't work"?13:42:46
@peepojuice:matrix.orgPeepsThe command u provided. inputs still undefined and points to it in the configuration.nix13:43:28
@peepojuice:matrix.orgPeepsit wont rebuild13:43:41
@k900:0upti.meK900Post the exact output13:43:49
@k900:0upti.meK900And the exact contents of your flake.nix and configuration.nix13:43:59
@peepojuice:matrix.orgPeeps
 nixos-rebuild --flake /etc/nixos switch
error:
       … while calling the 'seq' builtin

         at /nix/store/r66pr19ny80412ghfmn4wa9a8yzxj3c7-source/lib/modules.nix:322:18:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          323|         _module = checked (config._module);

       … while evaluating a branch condition

         at /nix/store/r66pr19ny80412ghfmn4wa9a8yzxj3c7-source/lib/modules.nix:261:9:

          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          262|           let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: undefined variable 'inputs'

       at /nix/store/k4ylkra2j2zdrygjhvywcda18i4879k8-source/configuration.nix:52:15:

           51|     enable = true;
           52|     package = inputs.nix-ld-rs.packages."${pkgs.system}".nix-ld-rs;
             |               ^
           53|   };

configuration.nix:

{
  wsl = {
    enable = true;
    defaultUser = "nixos";
  };
  
  nix.settings.experimental-features = [ "nix-command" "flakes" ];


  programs.nix-ld = {
    enable = true;
    package = inputs.nix-ld-rs.packages."${pkgs.system}".nix-ld-rs;
  };
}

flake:

{
  inputs = {
    nixpkgs.url = "nixpkgs";
    nixos-wsl = {
      url = "github:nix-community/NixOS-WSL";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nix-ld-rs = {
      url = "github:nix-community/nix-ld-rs";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs: with inputs; {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = { inherit inputs; };
      modules = [
        nixos-wsl.nixosModules.default
        ./configuration.nix
      ];
    };
  };
}
13:45:42
@peepojuice:matrix.orgPeepsand i got the flake file right next to configuration.nix13:46:24
@k900:0upti.meK900 Your configuration.nix looks very incomplete 13:46:37
@k900:0upti.meK900Though actually that may be enough13:46:54
@k900:0upti.meK900 If you just replace the first { with { inputs, ... }: { 13:47:06
@peepojuice:matrix.orgPeepsYeah i was just following: https://github.com/nix-community/NixOS-WSL/issues/294#issuecomment-200907553313:47:19
@peepojuice:matrix.orgPeepsomg, something different happened. now pkgs is undefined13:48:09
@k900:0upti.meK900Oh13:48:15
@k900:0upti.meK900 You need { inputs, pkgs, ... }: { 13:48:25
@peepojuice:matrix.orgPeepsI had to read the stateVersion too, but looks like its working! fingers crossed. Thanks btw! u have been very helpful :)13:50:45
@peepojuice:matrix.orgPeeps * I had to re-add the stateVersion too, but looks like its working! fingers crossed. Thanks btw! u have been very helpful :)13:50:52
@peepojuice:matrix.orgPeepsNo wayyy vscode also works now hahahaha13:51:52
@peepojuice:matrix.orgPeepsITs aliiiiiiiiiiiiive13:51:57
@peepojuice:matrix.orgPeepsIdk how their configuration.nix was working, it felt like it was using function parameters in a function without parameters :/13:52:59
@peepojuice:matrix.orgPeeps * Idk how their configuration.nix was working, it felt like i was using function parameters in a function without parameters :/13:53:10
28 Mar 2024
@emma:conduit.rory.gayEmma [it/its] ⚡️did something break in regards to wayland? i cant launch nheko under WSL anymore15:19:16

Show newer messages


Back to Room ListRoom Version: 9