mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 23:55:37 +00:00
improve comments and general tweaks
This commit is contained in:
parent
3ea0e40121
commit
3ba26ccfd5
@ -11,14 +11,33 @@
|
|||||||
../modules/mail/himalaya.nix
|
../modules/mail/himalaya.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
options = with lib; {
|
||||||
|
dotfilesPath = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
description = "Path of dotfiles repository.";
|
||||||
|
default = builtins.toPath "/home/${config.user}/dev/personal/dotfiles";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
|
# Enable features in Nix commands
|
||||||
nix.extraOptions = "experimental-features = nix-command flakes";
|
nix.extraOptions = "experimental-features = nix-command flakes";
|
||||||
|
|
||||||
|
# Basic common system packages for all devices
|
||||||
|
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
||||||
|
|
||||||
|
# Use the system-level nixpkgs instead of Home Manager's
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
||||||
|
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||||
|
# using multiple profiles
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
# Set a variable for dotfiles repo, not necessary but convenient
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
home.sessionVariables = { DOTS = config.dotfilesPath; };
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,8 +47,11 @@
|
|||||||
MANPAGER = "nvim +Man!";
|
MANPAGER = "nvim +Man!";
|
||||||
};
|
};
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
shellAliases = { vim = "nvim"; };
|
shellAbbrs = {
|
||||||
shellAbbrs = { vll = "vim -c 'Telescope oldfiles'"; };
|
v = lib.mkForce "nvim";
|
||||||
|
vl = lib.mkForce "nvim -c 'normal! `0'";
|
||||||
|
vll = "nvim -c 'Telescope oldfiles'";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -95,13 +95,13 @@ in {
|
|||||||
|
|
||||||
# Adjust screen brightness
|
# Adjust screen brightness
|
||||||
"Shift+F12" =
|
"Shift+F12" =
|
||||||
"exec ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ddcutil --display 2 setvcp 10 + 30";
|
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 + 30";
|
||||||
"Shift+F11" =
|
"Shift+F11" =
|
||||||
"exec ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ddcutil --display 2 setvcp 10 - 30";
|
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 - 30";
|
||||||
"XF86MonBrightnessUp" =
|
"XF86MonBrightnessUp" =
|
||||||
"exec ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ddcutil --display 2 setvcp 10 + 30";
|
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 + 30";
|
||||||
"XF86MonBrightnessDown" =
|
"XF86MonBrightnessDown" =
|
||||||
"exec ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ddcutil --display 2 setvcp 10 - 30";
|
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 - 30";
|
||||||
|
|
||||||
# Media player controls
|
# Media player controls
|
||||||
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||||
|
@ -32,8 +32,11 @@ in {
|
|||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config = lib.mkIf config.gui.enable {
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
|
# Enable PulseAudio
|
||||||
hardware.pulseaudio.enable = true;
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
|
# These aren't necessary, but helpful for the user
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
pamixer # Audio control
|
pamixer # Audio control
|
||||||
volnoti # Volume notifications
|
volnoti # Volume notifications
|
||||||
@ -44,15 +47,28 @@ in {
|
|||||||
# Graphical volume notifications
|
# Graphical volume notifications
|
||||||
services.volnoti.enable = true;
|
services.volnoti.enable = true;
|
||||||
|
|
||||||
|
xsession.windowManager.i3.config = {
|
||||||
|
|
||||||
|
# Make sure that Volnoti actually starts (home-manager doesn't start
|
||||||
|
# user daemon's automatically)
|
||||||
|
startup = [{
|
||||||
|
command = "systemctl --user restart volnoti";
|
||||||
|
always = true;
|
||||||
|
notification = false;
|
||||||
|
}];
|
||||||
|
|
||||||
# i3 keybinds for changing the volume
|
# i3 keybinds for changing the volume
|
||||||
xsession.windowManager.i3.config.keybindings = {
|
keybindings = {
|
||||||
"XF86AudioRaiseVolume" =
|
"XF86AudioRaiseVolume" =
|
||||||
"exec --no-startup-id ${increaseVolume}/bin/increaseVolume";
|
"exec --no-startup-id ${increaseVolume}/bin/increaseVolume";
|
||||||
"XF86AudioLowerVolume" =
|
"XF86AudioLowerVolume" =
|
||||||
"exec --no-startup-id ${decreaseVolume}/bin/decreaseVolume";
|
"exec --no-startup-id ${decreaseVolume}/bin/decreaseVolume";
|
||||||
"XF86AudioMute" = "exec --no-startup-id ${toggleMute}/bin/toggleMute";
|
"XF86AudioMute" = "exec --no-startup-id ${toggleMute}/bin/toggleMute";
|
||||||
|
# We can mute the mic by adding "--default-source"
|
||||||
"XF86AudioMicMute" =
|
"XF86AudioMicMute" =
|
||||||
"exec --no-startup-id pamixer --default-source --toggle-mute";
|
"exec --no-startup-id ${pkgs.pamixer}/bin/pamixer --default-source --toggle-mute";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{ ... }: {
|
{ ... }: {
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
# These came with the system and I don't know if they're required.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
{ ... }: {
|
{ ... }: {
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
|
||||||
|
layout = "us";
|
||||||
|
|
||||||
# Keyboard responsiveness
|
# Keyboard responsiveness
|
||||||
autoRepeatDelay = 250;
|
autoRepeatDelay = 250;
|
||||||
autoRepeatInterval = 40;
|
autoRepeatInterval = 40;
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Swap escape key with caps lock key
|
||||||
layout = "us";
|
|
||||||
xkbOptions = "eurosign:e,caps:swapescape";
|
xkbOptions = "eurosign:e,caps:swapescape";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Detect monitors (brightness)
|
# Detect monitors (brightness) for ddcutil
|
||||||
hardware.i2c.enable = true;
|
hardware.i2c.enable = true;
|
||||||
|
|
||||||
# Grant user access to external monitors
|
# Grant main user access to external monitors
|
||||||
users.users.${config.user}.extraGroups = [ "i2c" ];
|
users.users.${config.user}.extraGroups = [ "i2c" ];
|
||||||
|
|
||||||
services.xserver.displayManager = {
|
services.xserver.displayManager = {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config = lib.mkIf config.gui.enable {
|
||||||
|
|
||||||
# Mouse config
|
# Mouse customization
|
||||||
services.ratbagd.enable = true;
|
services.ratbagd.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
# Prevent wake from keyboard
|
# Prevent wake from keyboard
|
||||||
powerManagement.powerDownCommands = ''
|
powerManagement.powerDownCommands = ''
|
||||||
echo disabled > /sys/bus/usb/devices/1-6/power/wakeup
|
for wakeup in /sys/bus/usb/devices/1-*/power/wakeup; do echo disabled > $wakeup; done
|
||||||
echo disabled > /sys/bus/usb/devices/1-8/power/wakeup
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{ ... }: {
|
{ ... }: {
|
||||||
|
|
||||||
networking.wireless.enable =
|
# Enables wireless support via wpa_supplicant.
|
||||||
true; # Enables wireless support via wpa_supplicant.
|
networking.wireless.enable = true;
|
||||||
|
|
||||||
|
# Allows the user to control the WiFi settings.
|
||||||
networking.wireless.userControlled.enable = true;
|
networking.wireless.userControlled.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,7 @@
|
|||||||
home-manager.users.${config.user}.programs.direnv = {
|
home-manager.users.${config.user}.programs.direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
config = {
|
config = { whitelist = { prefix = [ config.dotfilesPath ]; }; };
|
||||||
whitelist = {
|
|
||||||
prefix = [ "/home/${config.user}/dev/personal/dotfiles/" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
users.users.${config.user}.shell = pkgs.fish;
|
users.users.${config.user}.shell = pkgs.fish;
|
||||||
programs.fish.enable = true; # Needed for LightDM to remember username
|
programs.fish.enable =
|
||||||
|
true; # Needed for LightDM to remember username (TODO: fix)
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
# Packages used in abbreviations and aliases
|
||||||
home.packages = with pkgs; [ curl ];
|
home.packages = with pkgs; [ curl ];
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
@ -89,7 +91,7 @@
|
|||||||
tan = "tmux attach-session -t noah";
|
tan = "tmux attach-session -t noah";
|
||||||
tnn = "tmux new-session -s noah";
|
tnn = "tmux new-session -s noah";
|
||||||
|
|
||||||
# Vim
|
# Vim (overwritten by Neovim)
|
||||||
v = "vim";
|
v = "vim";
|
||||||
vl = "vim -c 'normal! `0'";
|
vl = "vim -c 'normal! `0'";
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
shellAbbrs = { lf = "ls -lh | fzf"; };
|
shellAbbrs = { lf = "ls -lh | fzf"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Global fzf configuration
|
||||||
home.sessionVariables = let fzfCommand = "fd --type file";
|
home.sessionVariables = let fzfCommand = "fd --type file";
|
||||||
in {
|
in {
|
||||||
FZF_DEFAULT_COMMAND = fzfCommand;
|
FZF_DEFAULT_COMMAND = fzfCommand;
|
||||||
|
@ -19,7 +19,7 @@ in {
|
|||||||
|
|
||||||
home-manager.users.root.programs.git = {
|
home-manager.users.root.programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig.safe.directory = "/home/${config.user}/dev/personal/dotfiles";
|
extraConfig.safe.directory = config.dotfilesPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
@ -29,7 +29,7 @@ in {
|
|||||||
userEmail = config.gitEmail;
|
userEmail = config.gitEmail;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
pager = { branch = "false"; };
|
pager = { branch = "false"; };
|
||||||
safe = { directory = "/home/${config.user}/dev/personal/dotfiles"; };
|
safe = { directory = config.dotfilesPath; };
|
||||||
pull = { ff = "only"; };
|
pull = { ff = "only"; };
|
||||||
init = { defaultBranch = "master"; };
|
init = { defaultBranch = "master"; };
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user