This commit is contained in:
albert 2023-08-25 08:02:10 +09:00
parent 30cad71684
commit 6ab59cf453
8 changed files with 47 additions and 20 deletions

View file

@ -19,8 +19,8 @@
libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; };
in {
nixosConfigurations = {
nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; graphics = "nvidia"; };
nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; graphics = "nvidia"; };
nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; gpu = "intel"; };
nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; gpu = "nvidia"; };
};
homeConfigurations = {
"albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; };

View file

@ -174,32 +174,51 @@
# Laptop specific config
# Set up the FN keys:
# F1 - Mute
bind = , XF86AudioMute, exec, amixer set Master toggle
# bind = , XF86AudioMute, exec, amixer set Master toggle && swayosd --output-volume=mute-toggle
bind = , XF86AudioMute, exec, swayosd --output-volume=mute-toggle
# F2 - Volume Down
binde = , XF86AudioLowerVolume, exec, amixer set Master 3%-
# binde = , XF86AudioLowerVolume, exec, amixer set Master 3%-
binde = , XF86AudioLowerVolume, exec, swayosd --output-volume=lower
# F3 - Volume Up
binde = , XF86AudioRaiseVolume, exec, amixer set Master 3%+
# binde = , XF86AudioRaiseVolume, exec, amixer set Master 3%+
binde = , XF86AudioRaiseVolume, exec, swayosd --output-volume=raise
# F4 - Mute Microphone
bind = , XF86AudioMicMute, exec, amixer set Capture toggle
# bind = , XF86AudioMicMute, exec, amixer set Capture toggle
bind = , XF86AudioMicMute, exec, swayosd --input-volume=mute-toggle
# F5 - Brightness Down
binde = , XF86MonBrightnessDown, exec, light -U 5
# binde = , XF86MonBrightnessDown, exec, light -U 5
binde = , XF86MonBrightnessDown, exec, swayosd --brightness=lower
# F6 - Brightness Up
binde = , XF86MonBrightnessUp, exec, light -A 5
# binde = , XF86MonBrightnessUp, exec, light -A 5
binde = , XF86MonBrightnessUp, exec, swayosd --brightness=raise
# F7 - External Displays
# bind = , XF86
# F8 - Airplane Mode
# bind = , XF86
# F9 - Notifications?
# bind = , XF86
# F10 - Call Answer?
# bind = , XF86
# F11 - Call Hang Up?
# bind = , XF86
# F12 - Favorites?
# bind = , XF86
# Use rofi as an alt-tab switcher
bind = ALT, TAB, exec, rofi -show window
# bind = ALT, TAB, exec, rofi -show window
# Start the config:
exec-once=bash ~/.config/hypr/start.sh
@ -220,7 +239,11 @@
waybar &
# Set up the idle management daemon
swayidle -w timeout 300 'swaylock -f -c 000000' timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' before-sleep 'swaylock -f -c 000000'
swayidle -w \
timeout 300 'swaylock -f' \
timeout 600 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
before-sleep 'swaylock -f'
mako
'';
};

View file

@ -15,7 +15,7 @@
clock = true;
timestr = "%R";
datestr = "%a, %b %d";
grace = 15;
grace = 5;
indicator = true;
indicator-radius = "120";

View file

@ -10,9 +10,9 @@
};
# Helper function for generating host configs
mkHost = { hostname, username, desktop ? null, installer ? null, graphics ? null }: inputs.nixpkgs.lib.nixosSystem {
mkHost = { hostname, username, desktop ? null, installer ? null, gpu ? null }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs desktop hostname username stateVersion graphics;
inherit inputs outputs desktop hostname username stateVersion gpu;
};
modules = [
../nixos

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, hostname, graphics, ... }: {
{ lib, config, pkgs, hostname, gpu, ... }: {
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
@ -17,7 +17,7 @@
xkbVariant = "";
autorun = true;
# When you play games, change this to nvidia
videoDrivers = [ graphics ];
videoDrivers = [ gpu ];
};
##### disable nvidia, very nice battery life.

View file

@ -1,5 +1,5 @@
{pkgs, graphics, ...}: {
services.xserver.videoDrivers = [ graphics ];
{pkgs, gpu, ...}: {
services.xserver.videoDrivers = [ gpu ];
# tuigreet
services.greetd = {
@ -12,6 +12,10 @@
};
};
services.tlp = {
enable = true;
};
# Brightness and volume control
# https://haikarainen.github.io/light/
programs.light.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, hostname, stateVersion, username, desktop, graphics, ... }: {
{ lib, config, pkgs, hostname, stateVersion, username, desktop, gpu, ... }: {
imports = [
# Services
./common/services/openssh.nix

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, desktop, username, graphics, ... }: {
{ config, lib, pkgs, modulesPath, desktop, username, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
../../common/services/powertop.nix
@ -94,7 +94,7 @@
environment.systemPackages = with pkgs; [
# Fingerprint software
fprintd
# nVidia graphics options
# nVidia gpu options
vulkan-loader
vulkan-validation-layers
vulkan-tools