Compare commits

..

28 commits

Author SHA1 Message Date
Leonardo Eugênio 2f67b084d2 treewide: remove variables from pkgs 2024-06-05 01:20:42 -03:00
Leonardo Eugênio 36a717072a sway: only enable vrr on fullscreen 2024-06-05 01:20:42 -03:00
Leonardo Eugênio 43dd44d237 monolith: remove corectrl 2024-06-05 01:20:42 -03:00
Leonardo Eugênio 655baa24b0 monolith: only set kernel version here 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 085ca01d56 waybar: always show mpd icon 2024-06-05 01:20:01 -03:00
lelgenio 26ca820d4e kak: add javascript region to blade templates 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 36636a8a98 qutebrowser: remove config, not used anymore 2024-06-05 01:20:01 -03:00
Leonardo Eugênio e9b3ed69c9 gnome: disable open tablet driver 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 20d72d7787 gnome: don't manage mimeapps 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 07be28a2fb gnome: enable variable refresh rate 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 6859150622 monolith: forced disks to use mq-deadline scheduler 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 9137829f02 nix: don't optimise on every build
this makes builds slower
2024-06-05 01:20:01 -03:00
Leonardo Eugênio 90a08dfaa9 gnome: add workaround for autologin bug 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 49074303af controller: add auto-connect service 2024-06-05 01:20:01 -03:00
Leonardo Eugênio ad12a22346 flake: set formatter to nixfmt-rfc-style 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 15c5e33060 treewide: format using nixfmt-rfc-style 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 5218277b3e kakoune: use rfc-style nixfmt 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 2ce8246287 nix: lower frequency of gc 2024-06-05 01:20:01 -03:00
Leonardo Eugênio cbeaa72101 monolith: add docker subvolume 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 3b411b0c6d configuration: extract nixos config into more files 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 3333772c23 kdeconect: update config 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 686f605a6d gnome: update autologin config 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 2215da6dc5 scripts: add pass export script 2024-06-05 01:20:01 -03:00
Leonardo Eugênio a30f87ec71 qutebrowser: don't install if not the default browser 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 48c074f1f4 monolith: disable virtualbox while it's borked 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 9f2382ef2d flake: update to 24.05 2024-06-05 01:20:01 -03:00
Leonardo Eugênio 96c86f2cc8 Revert "sshd: disable until xz is secure"
This reverts commit b0d1b2fbff.
2024-06-05 01:20:01 -03:00
Leonardo Eugênio 4ddc0a4acd sway: don't require rebuilding sway dependencies 2024-06-05 01:20:01 -03:00
41 changed files with 106 additions and 78 deletions

View file

@ -40,7 +40,6 @@ in
"zenpower" "zenpower"
]; ];
boot.kernelParams = [ boot.kernelParams = [
"amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug
"video=DP-1:1920x1080@144" "video=DP-1:1920x1080@144"
# hibernation # hibernation
"resume=LABEL=BTRFS_ROOT" # findmnt -o LABEL --noheadings /swap/ "resume=LABEL=BTRFS_ROOT" # findmnt -o LABEL --noheadings /swap/
@ -64,14 +63,6 @@ in
rocmPackages.rocm-smi rocmPackages.rocm-smi
]; ];
programs.corectrl = {
enable = true;
gpuOverclock = {
enable = true;
ppfeaturemask = "0xffffffff";
};
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-label/BTRFS_ROOT"; device = "/dev/disk/by-label/BTRFS_ROOT";
fsType = "btrfs"; fsType = "btrfs";

View file

@ -6,7 +6,6 @@ rec {
themes themes
new-packages new-packages
patches patches
variables
lib_extended lib_extended
]; ];
@ -80,8 +79,6 @@ rec {
} }
); );
variables = (final: prev: { uservars = import ../user/variables.nix; });
lib_extended = ( lib_extended = (
final: prev: { final: prev: {
lib = prev.lib // rec { lib = prev.lib // rec {

View file

@ -126,6 +126,7 @@
wl-clipboard wl-clipboard
]; ];
auto_connect_gamepad = [ bluez ]; auto_connect_gamepad = [ bluez ];
vrr-fullscreen = [ ];
} }
// lib.mapAttrs import_script { // lib.mapAttrs import_script {
wdmenu = ./wdmenu.nix; wdmenu = ./wdmenu.nix;

28
scripts/vrr-fullscreen Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
# List of supported outputs for VRR
output_vrr_whitelist=(
"DP-1"
"DP-2"
)
# Toggle VRR for fullscreened apps in prespecified displays to avoid stutters while in desktop
swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do
window_event=$(echo ${window_json} | jq -r '.change')
# Process only focus change and fullscreen toggle
if [[ $window_event = "focus" || $window_event = "fullscreen_mode" ]]; then
output_json=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused == true)')
output_name=$(echo ${output_json} | jq -r '.name')
# Use only VRR in whitelisted outputs
if [[ ${output_vrr_whitelist[*]} =~ ${output_name} ]]; then
output_vrr_status=$(echo ${output_json} | jq -r '.adaptive_sync_status')
window_fullscreen_status=$(echo ${window_json} | jq -r '.container.fullscreen_mode')
# Only update output if nesseccary to avoid flickering
[[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]] && swaymsg output "${output_name}" adaptive_sync 1
[[ $output_vrr_status = "enabled" && $window_fullscreen_status = "0" ]] && swaymsg output "${output_name}" adaptive_sync 0
fi
fi
done

View file

@ -1,12 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs.uservars) dmenu;
available_menus = {
bmenu = "bmenu";
rofi = "rofi -dmenu -sort";
};
menu_cmd = available_menus.${dmenu};
in
pkgs.writeShellScriptBin "wdmenu" '' pkgs.writeShellScriptBin "wdmenu" ''
exec ${menu_cmd} "$@" exec bmenu "$@"
'' ''

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
let let
inherit (pkgs.uservars) dmenu; inherit (config.my) dmenu;
available_menus = { available_menus = {
bmenu = "bmenu run"; bmenu = "bmenu run";
rofi = "rofi -show drun -sort"; rofi = "rofi -show drun -sort";

View file

@ -1,12 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs.uservars) dmenu;
available_menus = {
bmenu = "bmenu run";
rofi = "rofi -show drun -sort";
};
menu_cmd = available_menus.${dmenu};
in
pkgs.writeShellScriptBin "wlauncher" '' pkgs.writeShellScriptBin "wlauncher" ''
exec ${menu_cmd} "$@" exec bmenu run "$@"
'' ''

6
settings/default.nix Normal file
View file

@ -0,0 +1,6 @@
{ lib, ... }:
{
options = {
my = lib.mkOption { };
};
}

View file

@ -43,7 +43,7 @@
}; };
plymouth = { plymouth = {
enable = true; enable = true;
theme = lib.mkIf (pkgs.uservars.desktop == "sway") "red_loader"; theme = lib.mkIf (config.my.desktop == "sway") "red_loader";
themePackages = with pkgs; [ themePackages = with pkgs; [
(adi1090x-plymouth-themes.override { selected_themes = [ "red_loader" ]; }) (adi1090x-plymouth-themes.override { selected_themes = [ "red_loader" ]; })
]; ];

View file

@ -22,9 +22,10 @@
./users.nix ./users.nix
./containers.nix ./containers.nix
./network.nix ./network.nix
../settings
]; ];
boot.kernelPackages = pkgs.linuxPackages_latest; my = import ../user/variables.nix;
zramSwap.enable = true; zramSwap.enable = true;

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font
@ -71,7 +71,7 @@ in
enable = true; enable = true;
settings = { settings = {
initial_session = { initial_session = {
command = "${pkgs.sway}/bin/sway"; command = desktop;
user = "lelgenio"; user = "lelgenio";
}; };
default_session = { default_session = {

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
accent accent

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
accent accent

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) desktop browser; inherit (config.my) desktop browser;
bugfixedFirefox = pkgs.firefox-esr-unwrapped // { bugfixedFirefox = pkgs.firefox-esr-unwrapped // {
requireSigning = false; requireSigning = false;
allowAddonSideload = true; allowAddonSideload = true;

View file

@ -5,15 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my) accent editor desktop;
key
theme
color
accent
font
editor
desktop
;
in in
{ {
config = { config = {

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
accent accent

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) username mail; inherit (config.my) username mail;
in in
{ {
config = { config = {

View file

@ -2,9 +2,10 @@
pkgs, pkgs,
lib, lib,
inputs, inputs,
config,
... ...
}: }:
lib.mkIf (pkgs.uservars.desktop == "gnome") { lib.mkIf (config.my.desktop == "gnome") {
home.pointerCursor = { home.pointerCursor = {
name = "Adwaita"; name = "Adwaita";

View file

@ -1,6 +1,11 @@
{ pkgs, lib, ... }: {
pkgs,
lib,
config,
...
}:
let let
inherit (pkgs.uservars) accent theme editor; inherit (config.my) accent theme editor;
inherit (theme) color; inherit (theme) color;
in in
{ {

View file

@ -44,8 +44,11 @@
./xdg-dirs.nix ./xdg-dirs.nix
inputs.hyprland.homeManagerModules.default inputs.hyprland.homeManagerModules.default
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
../settings
]; ];
my = import ./variables.nix;
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.
home.username = "lelgenio"; home.username = "lelgenio";

View file

@ -5,7 +5,7 @@
... ...
}: }:
{ {
config = lib.mkIf (pkgs.uservars.desktop == "hyprland") { config = lib.mkIf (config.my.desktop == "hyprland") {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = false; enable = false;
extraConfig = '' extraConfig = ''

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
dmenu dmenu
editor editor

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
color color

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
color color

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) browser; inherit (config.my) browser;
cfg = config.xdg.defaultApplications; cfg = config.xdg.defaultApplications;
in in
{ {

View file

@ -5,7 +5,7 @@
... ...
}: }:
{ {
config = lib.mkIf (pkgs.uservars.desktop != "gnome") { config = lib.mkIf (config.my.desktop != "gnome") {
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = config.home.homeDirectory + "/Música"; musicDirectory = config.home.homeDirectory + "/Música";

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
color color

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
accent accent

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) username mail; inherit (config.my) username mail;
in in
{ {
config = { config = {

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font
@ -24,7 +24,7 @@ in
./swaylock.nix ./swaylock.nix
./theme.nix ./theme.nix
]; ];
config = lib.mkIf (pkgs.uservars.desktop == "sway") { config = lib.mkIf (config.my.desktop == "sway") {
services.mako.enable = true; services.mako.enable = true;
services.swayidle.enable = true; services.swayidle.enable = true;
services.kanshi.enable = true; services.kanshi.enable = true;
@ -69,7 +69,7 @@ in
}; };
output = { output = {
"*" = { "*" = {
adaptive_sync = "enabled"; adaptive_sync = "off";
bg = "${theme.background} fill"; bg = "${theme.background} fill";
mode = "1920x1080@144.000Hz"; mode = "1920x1080@144.000Hz";
}; };
@ -104,7 +104,6 @@ in
exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
exec swaymsg workspace 2 exec swaymsg workspace 2
exec_always systemctl --user restart waybar.service exec_always systemctl --user restart waybar.service
exec corectrl --minimize-systray
''; '';
}; };
services.gammastep = { services.gammastep = {
@ -117,6 +116,21 @@ in
indicator = true; indicator = true;
}; };
systemd.user.services.vrr-fullscreen = {
Unit = {
Description = "Enable VRR for fullscreen windows";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${lib.getExe pkgs.vrr-fullscreen}";
Restart = "on-failure";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json; xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json;
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font

View file

@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
in in
# inherit (pkgs.uservars) key accent font theme; # inherit (config.my) key accent font theme;
# inherit (theme) color; # inherit (theme) color;
# inherit (pkgs) lib; # inherit (pkgs) lib;
# mod = "Mod4"; # mod = "Mod4";

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) theme font desktop; inherit (config.my) theme font desktop;
inherit (theme) inherit (theme)
color color
gtk_theme gtk_theme

View file

@ -1,6 +1,11 @@
{ pkgs, lib, ... }: {
pkgs,
lib,
config,
...
}:
let let
inherit (pkgs.uservars) nextcloud; inherit (config.my) nextcloud;
pass_cmd = ( pass_cmd = (
pkgs.writeShellScript "get_pass" '' pkgs.writeShellScript "get_pass" ''
pass "${nextcloud.pass}" | head -n1 pass "${nextcloud.pass}" | head -n1

View file

@ -7,7 +7,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
theme theme
accent accent
@ -137,7 +137,7 @@ in
{ {
format = "{stateIcon} {title} - {artist}"; format = "{stateIcon} {title} - {artist}";
format-paused = "{stateIcon}"; format-paused = "{stateIcon}";
format-stopped = ""; format-stopped = "{stateIcon}";
state-icons = { state-icons = {
stopped = ""; stopped = "";
paused = ""; paused = "";

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
inherit (pkgs.uservars) inherit (config.my)
key key
accent accent
font font