-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwsl.nix
64 lines (58 loc) · 1.79 KB
/
wsl.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{pkgs, ...}: {
# https://github.com/nix-community/NixOS-WSL/issues/185
systemd.services = {
nixos-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"];
};
mount-home-stuff = {
unitConfig.After = ["mnt-c.mount" "mnt-e.mount"];
serviceConfig = {
Type = "oneshot";
ExecStart = [
"${pkgs.coreutils-full}/bin/mkdir -p /home/bandithedoge/dotfiles /home/bandithedoge/git /home/bandithedoge/sql"
"/run/wrappers/bin/mount --bind /mnt/c/Users/bandithedoge/dotfiles /home/bandithedoge/dotfiles"
"/run/wrappers/bin/mount --bind /mnt/e/git /home/bandithedoge/git"
"/run/wrappers/bin/mount --bind /mnt/e/sql /home/bandithedoge/sql"
];
};
wantedBy = ["sysinit.target"];
};
};
wsl = {
enable = true;
defaultUser = "bandithedoge";
};
users.users.bandithedoge = {
name = "bandithedoge";
shell = pkgs.fish;
uid = 1000;
extraGroups = ["wheel"];
isNormalUser = true;
};
environment = {
systemPackages = with pkgs; [
wslu
];
shells = with pkgs; [
fish
bashInteractive
];
};
programs.fish.enable = true;
system.stateVersion = "23.05";
}