separate xorg and i3

This commit is contained in:
Noah Masur
2022-04-28 21:56:21 -04:00
parent 2a225debe5
commit 2a5c896322
9 changed files with 110 additions and 92 deletions

View File

@ -1,5 +1,12 @@
{ pkgs, lib, user, gui, ... }:
{
home-manager.users.${user}.home.packages = [ (lib.mkIf gui pkgs.firefox) ];
config = lib.mkIf gui {
home-manager.users.${user}.home.packages = [ pkgs.firefox ];
# Required for setting GTK theme (for preferred-color-scheme in browser)
services.dbus.packages = [ pkgs.dconf ];
programs.dconf.enable = true;
};
}

5
modules/desktop/i3.nix Normal file
View File

@ -0,0 +1,5 @@
{ ... }: {
services.xserver.windowManager = { i3 = { enable = true; }; };
}

53
modules/desktop/xorg.nix Normal file
View File

@ -0,0 +1,53 @@
{ pkgs, ... }: {
# Enable the X11 windowing system.
services.xserver = {
enable = true;
# Enable touchpad support
libinput.enable = true;
# Disable mouse acceleration
libinput.mouse.accelProfile = "flat";
libinput.mouse.accelSpeed = "1.15";
# Keyboard responsiveness
autoRepeatDelay = 250;
autoRepeatInterval = 40;
# Configure keymap in X11
layout = "us";
xkbOptions = "eurosign:e,caps:swapescape";
# Login screen
displayManager = {
lightdm = {
enable = true;
# Make the login screen dark
greeters.gtk.theme.name = "Adwaita-dark";
# Put the login screen on the left monitor
greeters.gtk.extraConfig = ''
active-monitor=0
'';
};
setupCommands = ''
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 \
--mode 1920x1200 \
--pos 1920x0 \
--rotate left \
--output HDMI-0 \
--primary \
--mode 1920x1080 \
--pos 0x559 \
--rotate normal \
--output DVI-0 --off \
--output DVI-1 --off \
'';
};
};
}

View File

@ -16,4 +16,7 @@
};
# Used for icons in Vim
fonts.fonts = with pkgs; [ nerdfonts ];
}

View File

@ -1,5 +1,7 @@
{ pkgs, user, ... }: {
users.users.${user}.shell = pkgs.fish;
home-manager.users.${user} = {
programs.fish = {
enable = true;

20
modules/system/user.nix Normal file
View File

@ -0,0 +1,20 @@
{ user, ... }: {
# Define a user account. Don't forget to set a password with passwd.
users.users.${user} = {
# Create a home directory for human user
isNormalUser = true;
# Automatically create a password to start
initialPassword = "changeme";
# Enable sudo privileges
extraGroups = [
"wheel" # Sudo privileges
"i2c" # Access to external monitors
];
};
}