add conditional x11 display to user; Felia: only mount c,d,f drives

nix-components
pegasust 2022-11-15 22:43:30 +00:00
parent f4b9629c06
commit df9fbf05ea
4 changed files with 49 additions and 44 deletions

View File

@ -69,6 +69,8 @@
myHome = { myHome = {
username = "nixos"; username = "nixos";
homeDirectory = "/home/nixos"; homeDirectory = "/home/nixos";
shellInitExtra = ''
'' + x11_wsl;
}; };
}; };
}; };
@ -83,10 +85,7 @@
username = "ubuntu_admin"; username = "ubuntu_admin";
homeDirectory = "/home/ubuntu_admin"; homeDirectory = "/home/ubuntu_admin";
shellInitExtra = '' shellInitExtra = ''
# x11 output for WSL '' + x11_wsl;
export DISPLAY=$(ip route list default | awk '{print $3}'):0
export LIBGL_ALWAYS_INDIRECT=1
'';
}; };
}; };
}; };

View File

@ -1,15 +1,18 @@
{ lib, pkgs, config, modulesPath, specialArgs, ... }: { lib, pkgs, config, modulesPath, specialArgs, ... }:
let hostname = specialArgs.hostname; let
enableSSH = specialArgs.enableSSH or true; hostname = specialArgs.hostname;
networking = {hostName = hostname;} // (specialArgs.networking or {}); enableSSH = specialArgs.enableSSH or true;
boot = specialArgs.boot or {}; networking = { hostName = hostname; } // (specialArgs.networking or { });
services = specialArgs.services or {}; boot = specialArgs.boot or { };
services = specialArgs.services or { };
includeHardware = specialArgs.includeHardware or true;
in in
with lib; with lib;
{ {
imports = [ imports = (if includeHardware then [
./profiles/${hostname}/hardware-configuration.nix ./profiles/${hostname}/hardware-configuration.nix
"${modulesPath}/profiles/minimal.nix" ] else []) ++ [
"${modulesPath}/profiles/minimal.nix"
]; ];
inherit networking; inherit networking;
inherit boot; inherit boot;
@ -25,31 +28,31 @@ with lib;
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
users.users.hungtr = { users.users.hungtr = {
isNormalUser = true; isNormalUser = true;
home = "/home/hungtr"; home = "/home/hungtr";
description = "pegasust/hungtr"; description = "pegasust/hungtr";
extraGroups = [ "wheel" "networkmanager" ]; extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = lib.strings.splitString "\n" (builtins.readFile ../ssh/authorized_keys); openssh.authorizedKeys.keys = lib.strings.splitString "\n" (builtins.readFile ../ssh/authorized_keys);
}; };
# Some basic programs # Some basic programs
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
}; };
programs.git = { programs.git = {
enable = true; enable = true;
# more information should be configured under user level # more information should be configured under user level
}; };
environment.systemPackages = [ environment.systemPackages = [
pkgs.gnumake pkgs.gnumake
pkgs.wget pkgs.wget
pkgs.inetutils pkgs.inetutils
pkgs.mtr pkgs.mtr
pkgs.sysstat pkgs.sysstat
pkgs.mosh pkgs.mosh
]; ];
} }

View File

@ -13,6 +13,7 @@
./wsl-configuration.nix ./wsl-configuration.nix
]; ];
specialArgs = { specialArgs = {
# includeHardware = false;
hostname = "Felia"; hostname = "Felia";
}; };
}; };

View File

@ -11,24 +11,26 @@
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = ## NOTE: These filesystems are mounted by a wrapper script from nix-wsl
{
device = "/dev/sde";
fsType = "ext4";
};
fileSystems."/mnt/wsl" =
{
device = "tmpfs";
fsType = "tmpfs";
};
fileSystems."/mnt/wsl/docker-desktop/shared-sockets/guest-services" =
{
device = "none";
fsType = "tmpfs";
};
# fileSystems."/" =
# {
# device = "/dev/sdc";
# fsType = "ext4";
# };
#
# fileSystems."/mnt/wsl" =
# {
# device = "tmpfs";
# fsType = "tmpfs";
# };
#
# fileSystems."/mnt/wsl/docker-desktop/shared-sockets/guest-services" =
# {
# device = "none";
# fsType = "tmpfs";
# };
#
# fileSystems."/usr/lib/wsl/drivers" = # fileSystems."/usr/lib/wsl/drivers" =
# { # {
# device = "drivers"; # device = "drivers";