!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

346 Members
https://github.com/nix-community/NixOS-WSL60 Servers

Load older messages


SenderMessageTime
21 Feb 2023
@nzbr:nzbr.deArson CopperflameCould we just find out what executable PID 1 currently is?09:11:46
@sandro:supersandro.deSandro 🐧
In reply to @k900:0upti.me
Anyway found a script that automates the dance: https://github.com/okibcn/wslcompact

you need to have full hyperv installed and run this in powershell started as admin

wsl.exe –shutdown
optimize-vhd -Path C:\Users\User\NixOS\ext4.vhdx -Mode full
11:57:54
@k900:0upti.meK900That doesn't quite do it11:58:06
@k900:0upti.meK900It will release discarded blocks, but the blocks are too big11:58:22
@sandro:supersandro.deSandro 🐧and that can only be fixed by copying it into a new image?12:02:05
@sandro:supersandro.deSandro 🐧btw what did you do with rsync?12:02:11
@k900:0upti.meK900Basically, create a new VHD out of band, wsl --mount --vhd it, rsync the rootfs onto it, wsl --shutdown, move new VHD over old VHD12:02:46
23 Feb 2023
@mart-w:mart-w.demart-w joined the room.18:43:39
24 Feb 2023
@peterldowns:matrix.orgpeterldowns joined the room.21:09:17
27 Feb 2023
@houstdav000:gh0st.ems.hostCynthia changed their display name from houstdav000 to Cynthia.17:53:19
1 Mar 2023
@sandro:supersandro.deSandro 🐧Shouldn't lib.mkAfter move $PATH to the end here https://github.com/nix-community/NixOS-WSL/blob/4640199aeafcbb63cfbe8318bdf06f4402134f66/modules/wsl-distro.nix#L202 ?16:29:54
@sandro:supersandro.deSandro 🐧 I am trying to move /run/current-system/sw/bin before and WSL PATHs to work around a potential bug in envfs 16:30:31
3 Mar 2023
@teoc:matrix.orgTeo (he/they) joined the room.18:54:34
5 Mar 2023
@ajhalili2006:envs.net~ajhalili2006 [ ctrl-c.club / sr.ht / vern.cc ] joined the room.01:37:17
6 Mar 2023
@sandro:supersandro.deSandro 🐧Something about the sudo wrapper changed and it is broken for me.13:21:13
@sandro:supersandro.deSandro 🐧

I suspect that the permissions are wrong:

 ▶ ls -lah /run/wrappers/bin/sudo
.r-s--x--- root wheel 17 KB Mon Mar  6 14:19:11 2023  /run/wrappers/bin/sudo
13:21:33
@sandro:supersandro.deSandro 🐧

groups are fine

 ▶ id
uid=1000(sandro) gid=100(users) groups=100(users),1(wheel)
13:22:04
@sandro:supersandro.deSandro 🐧🤦13:22:25
@sandro:supersandro.deSandro 🐧I was testing PATH ordering last week and that messes it up13:23:23
@e-nikolov:matrix.orgEmil Nikolov joined the room.15:40:39
7 Mar 2023
@rdmolony:matrix.orgRowan Molony joined the room.17:25:23
@i97henka:matrix.orghenrik-ch

I am trying to get gpg working for my user on nixos wsl.

I have the following in my configuration.nix:

{ pkgs, config, modulesPath, ... }:

let
  #nixvim = import (builtins.fetchGit {
  #  url = "https://github.com/pta2002/nixvim";
  #});
  nixos-wsl = import ./nixos-wsl;
in
{
  imports = [
    #nixvim.nixosModules.nixvim
    nixos-wsl.nixosModules.wsl
    <home-manager/nixos>
  ];

  wsl = {
    enable = true;
    nativeSystemd = true;
    wslConf.automount.root = "/mnt";
    defaultUser = "nixos";
    startMenuLaunchers = true;

    # Enable native Docker support
    # docker-native.enable = true;

    # Enable integration with Docker Desktop (needs to be installed)
    # docker-desktop.enable = true;

  };

  # Enable nix flakes
  nix.package = pkgs.nixFlakes;
  nix.extraOptions = ''
    experimental-features = nix-command flakes
  '';

  #programs.nixvim.enable = true;

  users.users.i97henka = {
    isNormalUser = true;
    extraGroups = [ "wheel"];
  };

  home-manager.users.i97henka = { pkgs, ... }: {
    home.stateVersion = "22.11";
    home.packages = [ pkgs.jq pkgs.ripgrep pkgs.gh ];

    programs.bash = {
      enable = true;
      shellAliases = {
        ll = "ls -l";
        ".." = "cd ..";
        gst = "git status";
        glo = "git log --oneline";
        gfa = "git fetch --all";
        ggfl = "git push --force-with-lease";
      };
    };

    programs.git.enable = true;
    programs.direnv.enable = true;
    programs.direnv.nix-direnv.enable = true;
    programs.fzf.enable = true;
    programs.bat.enable = true;

    programs.gpg.enable = true;

    programs.neovim = {
      enable = true;
      defaultEditor = true;
      viAlias = true;
      vimAlias = true;
      vimdiffAlias = true;
    };
  };


  environment.systemPackages = with pkgs; [
    bat
    git
    vim
  ];

  system.stateVersion = "22.11";
}

I have added programs.gpg.enable = true;
but it didn't improve things.

I have seen this discourse thread:
https://discourse.nixos.org/t/cant-get-gnupg-to-work-no-pinentry/15373

but I am not sure how to apply it to my configuration.nix - I only added gpg in the home manager part - but maybe it should
be in a different part?

17:38:01
@k900:0upti.meK900What exactly is not working?17:39:10
@i97henka:matrix.orghenrik-ch

Thank you for chatting back K900 .
This is the command and the error:
gpg --symmetric --cipher-algo AES256 file_with_secrets.env

gpg: problem with the agent: No pinentry
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of 'file_with_secrets.env' failed: Operation cancelled
17:40:38
@k900:0upti.meK900Maybe use the NixOS setting instead of the home-manager one?17:41:42

There are no newer messages yet.


Back to Room ListRoom Version: 9