mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-24 02:34:52 +00:00
improve comments and general tweaks
This commit is contained in:
parent
3ea0e40121
commit
3ba26ccfd5
@ -11,14 +11,33 @@
|
||||
../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 = {
|
||||
|
||||
# Enable features in Nix commands
|
||||
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;
|
||||
|
||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||
# using multiple profiles
|
||||
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!";
|
||||
};
|
||||
programs.fish = {
|
||||
shellAliases = { vim = "nvim"; };
|
||||
shellAbbrs = { vll = "vim -c 'Telescope oldfiles'"; };
|
||||
shellAbbrs = {
|
||||
v = lib.mkForce "nvim";
|
||||
vl = lib.mkForce "nvim -c 'normal! `0'";
|
||||
vll = "nvim -c 'Telescope oldfiles'";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -95,13 +95,13 @@ in {
|
||||
|
||||
# Adjust screen brightness
|
||||
"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" =
|
||||
"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" =
|
||||
"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" =
|
||||
"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
|
||||
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
|
@ -32,8 +32,11 @@ in {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
sound.enable = true;
|
||||
|
||||
# Enable PulseAudio
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
||||
# These aren't necessary, but helpful for the user
|
||||
environment.systemPackages = with pkgs; [
|
||||
pamixer # Audio control
|
||||
volnoti # Volume notifications
|
||||
@ -44,15 +47,28 @@ in {
|
||||
# Graphical volume notifications
|
||||
services.volnoti.enable = true;
|
||||
|
||||
# i3 keybinds for changing the volume
|
||||
xsession.windowManager.i3.config.keybindings = {
|
||||
"XF86AudioRaiseVolume" =
|
||||
"exec --no-startup-id ${increaseVolume}/bin/increaseVolume";
|
||||
"XF86AudioLowerVolume" =
|
||||
"exec --no-startup-id ${decreaseVolume}/bin/decreaseVolume";
|
||||
"XF86AudioMute" = "exec --no-startup-id ${toggleMute}/bin/toggleMute";
|
||||
"XF86AudioMicMute" =
|
||||
"exec --no-startup-id pamixer --default-source --toggle-mute";
|
||||
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
|
||||
keybindings = {
|
||||
"XF86AudioRaiseVolume" =
|
||||
"exec --no-startup-id ${increaseVolume}/bin/increaseVolume";
|
||||
"XF86AudioLowerVolume" =
|
||||
"exec --no-startup-id ${decreaseVolume}/bin/decreaseVolume";
|
||||
"XF86AudioMute" = "exec --no-startup-id ${toggleMute}/bin/toggleMute";
|
||||
# We can mute the mic by adding "--default-source"
|
||||
"XF86AudioMicMute" =
|
||||
"exec --no-startup-id ${pkgs.pamixer}/bin/pamixer --default-source --toggle-mute";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
{ ... }: {
|
||||
|
||||
# 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.efi.canTouchEfiVariables = true;
|
||||
|
||||
|
@ -1,13 +1,16 @@
|
||||
{ ... }: {
|
||||
|
||||
services.xserver = {
|
||||
|
||||
layout = "us";
|
||||
|
||||
# Keyboard responsiveness
|
||||
autoRepeatDelay = 250;
|
||||
autoRepeatInterval = 40;
|
||||
|
||||
# Configure keymap in X11
|
||||
layout = "us";
|
||||
# Swap escape key with caps lock key
|
||||
xkbOptions = "eurosign:e,caps:swapescape";
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -19,10 +19,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Detect monitors (brightness)
|
||||
# Detect monitors (brightness) for ddcutil
|
||||
hardware.i2c.enable = true;
|
||||
|
||||
# Grant user access to external monitors
|
||||
# Grant main user access to external monitors
|
||||
users.users.${config.user}.extraGroups = [ "i2c" ];
|
||||
|
||||
services.xserver.displayManager = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
|
||||
# Mouse config
|
||||
# Mouse customization
|
||||
services.ratbagd.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
# Prevent wake from keyboard
|
||||
powerManagement.powerDownCommands = ''
|
||||
echo disabled > /sys/bus/usb/devices/1-6/power/wakeup
|
||||
echo disabled > /sys/bus/usb/devices/1-8/power/wakeup
|
||||
for wakeup in /sys/bus/usb/devices/1-*/power/wakeup; do echo disabled > $wakeup; done
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
{ ... }: {
|
||||
|
||||
networking.wireless.enable =
|
||||
true; # Enables wireless support via wpa_supplicant.
|
||||
# Enables wireless support via wpa_supplicant.
|
||||
networking.wireless.enable = true;
|
||||
|
||||
# Allows the user to control the WiFi settings.
|
||||
networking.wireless.userControlled.enable = true;
|
||||
|
||||
}
|
||||
|
@ -3,11 +3,7 @@
|
||||
home-manager.users.${config.user}.programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
config = {
|
||||
whitelist = {
|
||||
prefix = [ "/home/${config.user}/dev/personal/dotfiles/" ];
|
||||
};
|
||||
};
|
||||
config = { whitelist = { prefix = [ config.dotfilesPath ]; }; };
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
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} = {
|
||||
|
||||
# Packages used in abbreviations and aliases
|
||||
home.packages = with pkgs; [ curl ];
|
||||
|
||||
programs.fish = {
|
||||
@ -89,7 +91,7 @@
|
||||
tan = "tmux attach-session -t noah";
|
||||
tnn = "tmux new-session -s noah";
|
||||
|
||||
# Vim
|
||||
# Vim (overwritten by Neovim)
|
||||
v = "vim";
|
||||
vl = "vim -c 'normal! `0'";
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
shellAbbrs = { lf = "ls -lh | fzf"; };
|
||||
};
|
||||
|
||||
# Global fzf configuration
|
||||
home.sessionVariables = let fzfCommand = "fd --type file";
|
||||
in {
|
||||
FZF_DEFAULT_COMMAND = fzfCommand;
|
||||
|
@ -19,7 +19,7 @@ in {
|
||||
|
||||
home-manager.users.root.programs.git = {
|
||||
enable = true;
|
||||
extraConfig.safe.directory = "/home/${config.user}/dev/personal/dotfiles";
|
||||
extraConfig.safe.directory = config.dotfilesPath;
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
@ -29,7 +29,7 @@ in {
|
||||
userEmail = config.gitEmail;
|
||||
extraConfig = {
|
||||
pager = { branch = "false"; };
|
||||
safe = { directory = "/home/${config.user}/dev/personal/dotfiles"; };
|
||||
safe = { directory = config.dotfilesPath; };
|
||||
pull = { ff = "only"; };
|
||||
init = { defaultBranch = "master"; };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user