nix-dots/machines/work/configuration.nix
2022-01-17 03:28:40 +00:00

60 lines
1.5 KiB
Nix

{ lib, pkgs, config, modulesPath, ... }:
with lib;
let
defaultUser = "michael";
syschdemd = import ./syschdemd.nix { inherit lib pkgs config defaultUser; };
in
{
imports = [
"${modulesPath}/profiles/minimal.nix"
];
# WSL is closer to a container than anything else
boot.isContainer = true;
environment.etc.hosts.enable = false;
environment.etc."resolv.conf".enable = false;
programs.adb.enable = true;
networking.dhcpcd.enable = false;
# Proxychains
programs.proxychains = {
enable = true;
proxies.main = {
enable = true;
type = "http";
host = "172.21.32.1";
port = 1080;
};
};
users.users.${defaultUser} = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
shell = pkgs.zsh;
};
users.users.root = {
shell = "${syschdemd}/bin/syschdemd";
# Otherwise WSL fails to login as root with "initgroups failed 5"
extraGroups = [ "root" ];
};
security.sudo.wheelNeedsPassword = false;
# Disable systemd units that don't make sense on WSL
systemd.services."serial-getty@ttyS0".enable = false;
systemd.services."serial-getty@hvc0".enable = false;
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@".enable = false;
systemd.services.firewall.enable = false;
systemd.services.systemd-resolved.enable = false;
systemd.services.systemd-udevd.enable = false;
# Don't allow emergency mode, because we don't have a console.
systemd.enableEmergencyMode = false;
}