Files
vmimages/hosts/wsl2/default.nix
2023-02-24 14:03:39 -05:00

74 lines
2.0 KiB
Nix

{ lib, pkgs, config, modulesPath, ... }: {
# nixpkgs.overlays = overlays;
# Enable nix flakes
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
system.stateVersion = "22.11";
wsl = {
enable = true;
wslConf.automount.root = "/mnt";
defaultUser = "sstent";
startMenuLaunchers = true;
interop.preserveArgvZero = true;
nativeSystemd = true;
# Enable native Docker support
docker-native.enable = true;
# Enable integration with Docker Desktop (needs to be installed)
# docker-desktop.enable = true;
};
services.vscode-server.enable = true;
mymods = { user_sstent.enable = true; beets.enable = true;};
sops.defaultSopsFile = ./secrets.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.secrets.discogs.token = { };
sops.secrets.discogs.secret = { };
environment.systemPackages = [
pkgs.socat
pkgs.npiperelay
#pkgs.wsl-ssh-agent-relay
];
nixpkgs.config.packageOverrides = pkgs:
with pkgs; rec {
npiperelay = callPackage ../../pkgs/npiperelay { };
#wsl-ssh-agent-relay = callPackage ../../pkgs/wsl-ssh-agent-relay { };
};
fileSystems."/mnt/Public" = {
device = "//192.168.1.109/Public";
fsType = "cifs";
options = ["uid=0,gid=1000"];
};
systemd.services.nixs-wsl-systemd-fix = {
description = "Fix the /dev/shm symlink to be a mount";
unitConfig = {
DefaultDependencies = "no";
Before = [
"sysinit.target"
"systemd-tmpfiles-setup-dev.service"
"systemd-tmpfiles-setup.service"
"systemd-sysctl.service"
];
ConditionPathExists = "/dev/shm";
ConditionPathIsSymbolicLink = "/dev/shm";
ConditionPathIsMountPoint = "/run/shm";
};
serviceConfig = {
Type = "oneshot";
ExecStart = [
"${pkgs.coreutils-full}/bin/rm /dev/shm"
"/run/wrappers/bin/mount --bind -o X-mount.mkdir /run/shm /dev/shm"
];
};
wantedBy = [ "sysinit.target" ];
};
}