diff --git a/home-nix/flake.nix b/home-nix/flake.nix index 51c3fac..fd4bb7e 100644 --- a/home-nix/flake.nix +++ b/home-nix/flake.nix @@ -69,6 +69,8 @@ myHome = { username = "nixos"; homeDirectory = "/home/nixos"; + shellInitExtra = '' + '' + x11_wsl; }; }; }; @@ -83,10 +85,7 @@ username = "ubuntu_admin"; homeDirectory = "/home/ubuntu_admin"; shellInitExtra = '' - # x11 output for WSL - export DISPLAY=$(ip route list default | awk '{print $3}'):0 - export LIBGL_ALWAYS_INDIRECT=1 - ''; + '' + x11_wsl; }; }; }; diff --git a/system-nix/configuration.nix b/system-nix/configuration.nix index a06dcbc..20fcf53 100755 --- a/system-nix/configuration.nix +++ b/system-nix/configuration.nix @@ -1,15 +1,18 @@ { lib, pkgs, config, modulesPath, specialArgs, ... }: -let hostname = specialArgs.hostname; - enableSSH = specialArgs.enableSSH or true; - networking = {hostName = hostname;} // (specialArgs.networking or {}); - boot = specialArgs.boot or {}; - services = specialArgs.services or {}; +let + hostname = specialArgs.hostname; + enableSSH = specialArgs.enableSSH or true; + networking = { hostName = hostname; } // (specialArgs.networking or { }); + boot = specialArgs.boot or { }; + services = specialArgs.services or { }; + includeHardware = specialArgs.includeHardware or true; in with lib; { - imports = [ + imports = (if includeHardware then [ ./profiles/${hostname}/hardware-configuration.nix - "${modulesPath}/profiles/minimal.nix" + ] else []) ++ [ + "${modulesPath}/profiles/minimal.nix" ]; inherit networking; inherit boot; @@ -25,31 +28,31 @@ with lib; experimental-features = nix-command flakes ''; users.users.hungtr = { - isNormalUser = true; - home = "/home/hungtr"; - description = "pegasust/hungtr"; - extraGroups = [ "wheel" "networkmanager" ]; - openssh.authorizedKeys.keys = lib.strings.splitString "\n" (builtins.readFile ../ssh/authorized_keys); + isNormalUser = true; + home = "/home/hungtr"; + description = "pegasust/hungtr"; + extraGroups = [ "wheel" "networkmanager" ]; + openssh.authorizedKeys.keys = lib.strings.splitString "\n" (builtins.readFile ../ssh/authorized_keys); }; # Some basic programs programs.neovim = { - enable = true; - defaultEditor = true; + enable = true; + defaultEditor = true; }; programs.git = { - enable = true; - # more information should be configured under user level + enable = true; + # more information should be configured under user level }; environment.systemPackages = [ - pkgs.gnumake - pkgs.wget - pkgs.inetutils - pkgs.mtr - pkgs.sysstat - pkgs.mosh + pkgs.gnumake + pkgs.wget + pkgs.inetutils + pkgs.mtr + pkgs.sysstat + pkgs.mosh ]; -} + } diff --git a/system-nix/flake.nix b/system-nix/flake.nix index 59ad161..8c67c0c 100644 --- a/system-nix/flake.nix +++ b/system-nix/flake.nix @@ -13,6 +13,7 @@ ./wsl-configuration.nix ]; specialArgs = { + # includeHardware = false; hostname = "Felia"; }; }; diff --git a/system-nix/profiles/Felia/hardware-configuration.nix b/system-nix/profiles/Felia/hardware-configuration.nix index 37ce530..97c93fb 100644 --- a/system-nix/profiles/Felia/hardware-configuration.nix +++ b/system-nix/profiles/Felia/hardware-configuration.nix @@ -11,24 +11,26 @@ boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - 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"; - }; + ## NOTE: These filesystems are mounted by a wrapper script from nix-wsl + # 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" = # { # device = "drivers";