1
0
Fork 0
nixos/akame/default.nix

123 lines
3.6 KiB
Nix

{ config, pkgs, ... }:
{
boot = {
extraModulePackages = [ config.boot.kernelPackages.rtl8812au ];
tmp = {
useTmpfs = true;
tmpfsSize = "10%";
};
};
hardware = {
bluetooth = {
disabledPlugins = [ "input" ];
enable = true;
};
nvidia = {
modesetting.enable = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
powerManagement.enable = true;
};
opengl.enable = true;
};
home-manager.users.${config.lwad.definitions.username}.home.stateVersion =
"22.11";
imports = [
../components/desktop-environment.nix
../lwad
./hardware-configuration.nix
];
lwad = {
applications.i3 = {
autoRun = {
always = [ "${pkgs.openrgb}/bin/openrgb --profile Default" ];
startup = [
"${pkgs.signal-desktop}/bin/signal-desktop --start-in-tray"
"${pkgs.whatsapp-for-linux}/bin/whatsapp-for-linux"
];
};
audioControls = {
bluetooth.enable = true;
commands = let
mute_audio = pkgs.writeScript "mute_audio.sh" ''
IFS=$'\n'
sinks=$(${pactl} list short sinks | cut -f 1)
for sink in $sinks; do
${pactl} set-sink-volume $sink 0
done
'';
pactl = "${pkgs.pulseaudio}/bin/pactl";
in {
headphones = ''
${mute_audio} && ${pactl} set-default-sink $(${pactl} list sinks | rg "Name: " | cut -d " " -f 2 | rg "Focusrite_Scarlett_2i2") && ${pkgs.pamixer}/bin/pamixer --set-volume 0'';
speakers = ''
${mute_audio} && ${pactl} set-default-sink $(${pactl} list sinks | rg "Name: " | cut -d " " -f 2 | rg "C-Media_Electronics_Inc._USB_Audio_Device") && ${pkgs.pamixer}/bin/pamixer --set-volume 0'';
};
enable = true;
};
outputWorkspaceMappings = let strings = map (x: toString x);
in {
"HDMI-0" = strings [ 1 2 3 4 5 ];
"DVI-D-0" = strings [ 6 7 8 9 10 ];
};
};
filesystems.simple.enable = true;
utilities.btrbk.snapshots = [{
volume = "/";
subvolume = "home/${config.lwad.definitions.username}/Documents";
snapshotDir = "home/${config.lwad.definitions.username}/snapshots";
sync = {
enable = false;
serverAddress = "shinobu";
serverBackupDir = "/backups/${config.networking.hostName}";
};
}];
};
networking = {
hostName = "akame";
firewall.interfaces."tailscale0".allowedTCPPorts = [ 8081 ];
};
programs = {
bash.shellAliases = {
keyboard-leds =
"${config.lwad.definitions.sudoas.command} ${pkgs.g810-led}/bin/g810-led -a FF0000";
rdiff =
"rsync -nilrc --delete ryuko:Documents/ ~/Documents/ --exclude-from=/home/${config.lwad.definitions.username}/Documents/exclude";
};
tmux.extraConfigBeforePlugins = ''
set-option -g status-right ""
'';
};
services = {
hardware.openrgb = {
enable = true;
motherboard = "intel";
};
xserver = {
videoDrivers = [ "nvidia" ];
xrandrHeads = [
{
output = "HDMI-0";
primary = true;
monitorConfig = ''
Option "Position" "0 0"
Option "PreferredMode" "2560x1080"
Option "DPMS" "false"
'';
}
{
output = "DVI-D-0";
primary = false;
monitorConfig = ''
Option "Position" "2560 0"
Option "PreferredMode" "1920x1080"
Option "DPMS" "false"
'';
}
];
};
};
system.stateVersion =
"22.11"; # Do not change this value, even in the event of an upgrade
}