!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

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

Load older messages


SenderMessageTime
25 Mar 2024
@peepojuice:matrix.orgPeepsTrying to build with the configuration.nix, i get "undefined variable inputs" which is sensible.11:49:27
@peepojuice:matrix.orgPeepsOh thats from the flake thing11:50:11
@peepojuice:matrix.orgPeepsAh i just put it beside configuration.nix. waiting for it to build now...12:01:35
@peepojuice:matrix.orgPeepsWell, less errors now but its still complaining about inputs being undefined12:03:34
@peepojuice:matrix.orgPeepsoh nvm i think i got it..12:11:01
@sandro:supersandro.deSandro 🐧
In reply to @peepojuice:matrix.org
This is new, did not come up with my research yesterday, so ty. But, being new to nixos i haven't l learned flake yet, and i didn't plan on doing that today. What do i do with the flake.nix part?
Flakes are not a big thing, it's just a way to define channels. People are just sometimes like they change everything, which is not true.
12:12:40
@peepojuice:matrix.orgPeepsyeah I wanted to do my own research later to make my own decision, since it seem a bit controversial, but Im getting annoyed because i see it a lot and im just like "well, how do i do it without flake, lol?" so i think im just gonna cave and join the party.12:14:02
@peepojuice:matrix.orgPeepsrebuild was a success.. now to try vscode12:14:30
@peepojuice:matrix.orgPeepsCould not start dynamically linked executable: /home/nixos/.vscode-server/bin/863d2581ecda6849923a2118d93a088b0745d9d6/node [2024-03-25 12:14:46.189] NixOS cannot run dynamically linked executables intended for generic [2024-03-25 12:14:46.189] linux environments out of the box. For more information, see: [2024-03-25 12:14:46.189] https://nix.dev/permalink/stub-ld12:15:23
@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

Show newer messages


Back to Room ListRoom Version: 9