Compare commits

..

No commits in common. "c58ab9638af1a1f267970b3c411e68dc1704fb5b" and "cf5e56ebaabed8bd3bb9a3e76f5bf6354fd92fbc" have entirely different histories.

34 changed files with 440 additions and 512 deletions

View file

@ -209,11 +209,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739353546, "lastModified": 1739841949,
"narHash": "sha256-YTqXhBZvCdZLMBupWlCDvRFaTEhaHa2/Xc/p1sUdSZU=", "narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "26ade1005191e0602a78b0f141970648445bafd9", "rev": "15dbf8cebd8e2655a883b74547108e089f051bf0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -440,11 +440,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736373539, "lastModified": 1739757849,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56", "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -481,11 +481,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739071773, "lastModified": 1739676768,
"narHash": "sha256-/Ak+Quinhmdxa9m3shjm4lwwwqmzG8zzGhhhhgR1k9I=", "narHash": "sha256-U1HQ7nzhJyVVXUgjU028UCkbLQLEIkg42+G7iIiBmlU=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "895d81b6228bbd50a6ef22f5a58a504ca99763ea", "rev": "ae15068e79e22b76c344f0d7f8aed1bb1c5b0b63",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -551,11 +551,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1739446958, "lastModified": 1739736696,
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=", "narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0", "rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -612,11 +612,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1739357830, "lastModified": 1739758141,
"narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", "narHash": "sha256-uq6A2L7o1/tR6VfmYhZWoVAwb3gTy7j4Jx30MIrH0rE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", "rev": "c618e28f70257593de75a7044438efc1c1fc0791",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -922,11 +922,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1738953846, "lastModified": 1739829690,
"narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=", "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "4f09b473c936d41582dd744e19f34ec27592c5fd", "rev": "3d0579f5cc93436052d94b73925b48973a104204",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -102,17 +102,10 @@
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(
{ config, ... }:
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.lelgenio = { home-manager.users.lelgenio = import ./user/home.nix;
my = config.my;
imports = [
./user/home.nix
];
};
home-manager.backupFileExtension = "bkp"; home-manager.backupFileExtension = "bkp";
# Optionally, use home-manager.extraSpecialArgs to pass # Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix # arguments to home.nix
@ -120,7 +113,6 @@
inherit inputs; inherit inputs;
}; };
} }
)
] ]
++ lib.optional (desktop == "gnome") ./system/gnome.nix ++ lib.optional (desktop == "gnome") ./system/gnome.nix
++ lib.optional (desktop == "kde") ./system/kde.nix; ++ lib.optional (desktop == "kde") ./system/kde.nix;
@ -141,6 +133,7 @@
./system/monolith-gitlab-runner.nix ./system/monolith-gitlab-runner.nix
./system/monolith-forgejo-runner.nix ./system/monolith-forgejo-runner.nix
./system/nix-serve.nix ./system/nix-serve.nix
./system/steam.nix
] ++ common_modules; ] ++ common_modules;
}; };
double-rainbow = lib.nixosSystem { double-rainbow = lib.nixosSystem {
@ -158,6 +151,7 @@
++ [ ++ [
{ {
packages.media-packages.enable = lib.mkOverride 0 false; packages.media-packages.enable = lib.mkOverride 0 false;
programs.steam.enable = lib.mkOverride 0 false;
services.flatpak.enable = lib.mkOverride 0 false; services.flatpak.enable = lib.mkOverride 0 false;
} }
]; ];

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: { pkgs, ... }:
let let
undervoltGpu = pkgs.writeShellScript "undervolt-gpu" '' undervoltGpu = pkgs.writeShellScript "undervolt-gpu" ''
set -xe set -xe
@ -17,17 +17,6 @@ in
"amdgpu.ppfeaturemask=0xfffd7fff" # enable undervolting "amdgpu.ppfeaturemask=0xfffd7fff" # enable undervolting
]; ];
systemd.services.amd-fan-control = {
script = ''
${lib.getExe pkgs.amd-fan-control} /sys/class/drm/card1/device 60 85
'';
serviceConfig = {
Restart = "always";
RestartSec = 10;
};
wantedBy = [ "multi-user.target" ];
};
hardware.graphics.enable32Bit = true; hardware.graphics.enable32Bit = true;
hardware.graphics.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [

View file

@ -41,8 +41,6 @@ in
package = pkgs.unstable.opentabletdriver; package = pkgs.unstable.opentabletdriver;
}; };
my.gaming.enable = true;
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];

View file

@ -1,61 +0,0 @@
#!/usr/bin/env bash
set -e
DEVICE="$1" # eg: /sys/class/drm/card1/device
HWMON=$(echo "$DEVICE"/hwmon/hwmon*)
exit() {
echo "Setting controll to auto" >&2
echo 2 > "$HWMON/pwm1_enable"
}
trap exit EXIT INT
bail() {
echo "Error: $@" >&2
echo "Exiting..." >&2
exit 1
}
if ! [ -d "$HWMON" ]; then
bail "Invalid HWMON"
fi
TEMP_INPUT="$HWMON/temp2_input"
if ! [ -f $TEMP_INPUT ]; then
bail "Invalid TEMP_INPUT"
fi
TEMP_MIN="$2"
TEMP_MAX="$3"
if [ -z "$TEMP_MIN" ];then
bail "No minimum temperature provided"
fi
if [ -z "$TEMP_MAX" ];then
bail "No maximum temperature provided"
fi
PWM_MIN=0
PWM_MAX=255
echo "Running..." >&2
while true; do
TEMPERATURE_RAW=$(cat "$TEMP_INPUT")
TEMPERATURE="$(( $TEMPERATURE_RAW / 1000 ))"
# Remap from a number between 60_000..90_000 to 0..255
PWM=$(( ($TEMPERATURE - $TEMP_MIN) * $PWM_MAX / ($TEMP_MAX - $TEMP_MIN) ))
if [ "$PWM" -gt $PWM_MAX ]; then
PWM=$PWM_MAX
elif [ "$PWM" -lt $PWM_MIN ]; then
PWM=$PWM_MIN
fi
echo 1 > "$HWMON/pwm1_enable"
echo "$PWM" > "$HWMON/pwm1"
sleep .1s
done

View file

@ -23,7 +23,6 @@
in in
with final; with final;
createScripts { createScripts {
amd-fan-control = [ bash ];
br = [ ]; br = [ ];
bmenu = [ bmenu = [
bemenu bemenu
@ -137,6 +136,7 @@
libinput libinput
libratbag libratbag
]; ];
vrr-fullscreen = [ ];
controller-battery = [ ]; controller-battery = [ ];
_docker-block-external-connections = [ _docker-block-external-connections = [
iptables iptables

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,18 +1,6 @@
{ lib, ... }: { lib, ... }:
{ {
options = { options = {
my = { my = lib.mkOption { };
themes = lib.mkOption { };
key = lib.mkOption { };
theme = lib.mkOption { };
accent = lib.mkOption { };
font = lib.mkOption { };
username = lib.mkOption { type = lib.types.str; };
mail = lib.mkOption { };
dmenu = lib.mkOption { type = lib.types.str; };
desktop = lib.mkOption { type = lib.types.str; };
browser = lib.mkOption { type = lib.types.str; };
editor = lib.mkOption { type = lib.types.str; };
};
}; };
} }

View file

@ -1,17 +0,0 @@
{
config,
pkgs,
lib,
...
}:
{
options.my.android.enable = lib.mkEnableOption { };
config = lib.mkIf config.my.android.enable {
# Open kde connect ports
programs.kdeconnect.enable = true;
programs.adb.enable = true;
services.udev.packages = [ pkgs.android-udev-rules ];
};
}

View file

@ -2,6 +2,7 @@
config, config,
pkgs, pkgs,
lib, lib,
inputs,
... ...
}: }:
{ {

18
system/cachix.nix Normal file
View file

@ -0,0 +1,18 @@
{
pkgs,
lib,
config,
...
}:
{
services.cachix-watch-store = {
enable = true;
cacheName = "lelgenio";
cachixTokenFile = config.age.secrets.lelgenio-cachix.path;
};
systemd.services.cachix-watch-store-agent = {
serviceConfig.TimeoutStopSec = 3;
# If we don't do this, cachix tends to timeout
serviceConfig.KillMode = lib.mkForce "control-group";
};
}

View file

@ -1,11 +1,16 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ pkgs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
imports = [ imports = [
./android.nix ./gamemode.nix
./gaming.nix ./cachix.nix
./media-packages.nix ./media-packages.nix
./boot.nix ./boot.nix
./thunar.nix ./thunar.nix
@ -21,27 +26,39 @@
../settings ../settings
]; ];
my = import ../user/variables.nix // { my = import ../user/variables.nix;
android.enable = true;
media-packages.enable = true;
containers.enable = true;
};
zramSwap.enable = true; zramSwap.enable = true;
programs.adb.enable = true;
services.udev.packages = [ pkgs.android-udev-rules ];
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true; services.libinput.enable = true;
packages.media-packages.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pavucontrol pavucontrol
glib # gsettings glib # gsettings
usbutils usbutils
# dracula-theme # gtk theme
adwaita-icon-theme # default gnome cursors adwaita-icon-theme # default gnome cursors
nix-output-monitor
]; ];
services.geoclue2.enable = true; services.geoclue2.enable = true;
# Workaround for nm-wait-online hanging??
# Ref: https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online = {
serviceConfig.ExecStart = [
""
"${pkgs.networkmanager}/bin/nm-online -q"
];
};
systemd.extraConfig = '' systemd.extraConfig = ''
DefaultTimeoutStopSec=10s DefaultTimeoutStopSec=10s
''; '';

View file

@ -1,13 +1,5 @@
{ pkgs, lib, ... }:
{ {
pkgs,
lib,
config,
...
}:
{
options.my.containers.enable = lib.mkEnableOption { };
config = lib.mkIf config.my.containers.enable {
services.flatpak.enable = true; services.flatpak.enable = true;
virtualisation.docker = { virtualisation.docker = {
@ -35,5 +27,4 @@
programs.extra-container.enable = true; programs.extra-container.enable = true;
programs.firejail.enable = true; programs.firejail.enable = true;
};
} }

27
system/gamemode.nix Normal file
View file

@ -0,0 +1,27 @@
{
config,
pkgs,
inputs,
...
}:
{
programs.gamemode.enable = true;
programs.gamemode.enableRenice = true;
programs.gamemode.settings = {
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
}

View file

@ -1,63 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
{
options.my.gaming.enable = lib.mkEnableOption { };
config = lib.mkIf config.my.gaming.enable {
programs.steam.enable = true;
programs.steam.extraPackages =
config.fonts.packages
++ (with pkgs; [
capitaine-cursors
bibata-cursors
mangohud
xdg-user-dirs
gamescope
# gamescope compatibility??
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
]);
environment.systemPackages = with pkgs; [
protontricks
bottles
inputs.dzgui-nix.packages.${pkgs.system}.default
];
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
};
}

View file

@ -5,10 +5,10 @@
... ...
}: }:
let let
cfg = config.my.media-packages; cfg = config.packages.media-packages;
in in
{ {
options.my.media-packages = { options.packages.media-packages = {
enable = lib.mkEnableOption "media packages"; enable = lib.mkEnableOption "media packages";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -6,6 +6,8 @@
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Open kde connect ports
programs.kdeconnect.enable = true;
networking.firewall = { networking.firewall = {
enable = true; enable = true;
@ -13,7 +15,7 @@
}; };
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; # services.printing.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
services.openssh = { services.openssh = {
@ -25,13 +27,4 @@
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
}; };
}; };
# Workaround for nm-wait-online hanging??
# Ref: https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online = {
serviceConfig.ExecStart = [
""
"${pkgs.networkmanager}/bin/nm-online -q"
];
};
} }

36
system/steam.nix Normal file
View file

@ -0,0 +1,36 @@
{
config,
pkgs,
inputs,
...
}:
{
programs.steam.enable = true;
programs.steam.extraPackages =
config.fonts.packages
++ (with pkgs; [
capitaine-cursors
bibata-cursors
mangohud
xdg-user-dirs
gamescope
# gamescope compatibility??
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
]);
environment.systemPackages = with pkgs; [
protontricks
bottles
inputs.dzgui-nix.packages.${pkgs.system}.default
];
}

View file

@ -1,8 +0,0 @@
{ lib, ... }:
{
options.my = {
android.enable = lib.mkEnableOption { };
media-packages.enable = lib.mkEnableOption { };
containers.enable = lib.mkEnableOption { };
};
}

View file

@ -6,12 +6,9 @@
}: }:
let let
inherit (config.my) accent editor desktop; inherit (config.my) accent editor desktop;
cfg = config.my.fish;
in in
{ {
options.my.fish.enable = lib.mkEnableOption { }; config = {
config = lib.mkIf cfg.enable {
programs.fish = { programs.fish = {
enable = true; enable = true;
shellInit = '' shellInit = ''

View file

@ -2,10 +2,16 @@
config, config,
pkgs, pkgs,
lib, lib,
inputs,
... ...
}: }:
let let
inherit (config.my) theme accent; inherit (config.my)
key
theme
accent
font
;
inherit (theme) color; inherit (theme) color;
colors = { colors = {

View file

@ -1,24 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.my.gaming;
in
{
options.my.gaming.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
my.mangohud.enable = true;
home.packages = with pkgs; [
# lutris-unwrapped
# steam # It's enabled in the system config
tlauncher
gamescope
glxinfo
vulkan-tools
];
};
}

View file

@ -7,13 +7,9 @@
let let
inherit (config.my) accent theme editor; inherit (config.my) accent theme editor;
inherit (theme) color; inherit (theme) color;
cfg = config.my.helix;
in in
{ {
options.my.helix.enable = lib.mkEnableOption "Enable helix config"; config = {
config = lib.mkIf cfg.enable {
programs.helix = { programs.helix = {
enable = true; enable = true;
settings = { settings = {

View file

@ -8,7 +8,6 @@
}: }:
{ {
imports = [ imports = [
./dummy.nix
./waybar ./waybar
./helix.nix ./helix.nix
./kakoune ./kakoune
@ -22,7 +21,6 @@
./rofi.nix ./rofi.nix
./mpv.nix ./mpv.nix
./mangohud.nix ./mangohud.nix
./gaming.nix
./pipewire.nix ./pipewire.nix
./mimeapps.nix ./mimeapps.nix
./desktop-entries.nix ./desktop-entries.nix
@ -46,11 +44,7 @@
./powerplay-led-idle.nix ./powerplay-led-idle.nix
]; ];
my = import ./variables.nix // { my = import ./variables.nix;
sway.enable = true;
pass.enable = true;
fish.enable = true;
};
# 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.
@ -97,6 +91,14 @@
mate.engrampa mate.engrampa
# gnome.nautilus # gnome.nautilus
## games
# lutris-unwrapped
# steam # It's enabled in the system config
tlauncher
gamescope
glxinfo
vulkan-tools
## Theming ## Theming
orchis_theme_compact orchis_theme_compact
papirus_red papirus_red
@ -128,8 +130,6 @@
unstable.blade-formatter unstable.blade-formatter
nixfmt-rfc-style nixfmt-rfc-style
nix-output-monitor
]; ];
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;

View file

@ -1,11 +1,22 @@
{ config, lib, ... }: {
config,
pkgs,
lib,
font,
...
}:
let let
cfg = config.my.mangohud; inherit (config.my)
key
theme
color
accent
font
;
in in
{ {
options.my.mangohud.enable = lib.mkEnableOption { }; config = {
programs.mangohud = {
config.programs.mangohud = lib.mkIf cfg.enable {
enable = true; enable = true;
enableSessionWide = true; enableSessionWide = true;
settings = { settings = {
@ -65,4 +76,5 @@ in
# output_folder = "/home/lelgenio"; # output_folder = "/home/lelgenio";
}; };
}; };
};
} }

View file

@ -4,13 +4,8 @@
config, config,
... ...
}: }:
let
cfg = config.my.mpd;
in
{ {
options.my.mpd.enable = lib.mkEnableOption { }; config = lib.mkIf (config.my.desktop != "gnome") {
config = lib.mkIf cfg.enable {
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = config.home.homeDirectory + "/Música"; musicDirectory = config.home.homeDirectory + "/Música";

View file

@ -2,15 +2,11 @@
config, config,
pkgs, pkgs,
lib, lib,
inputs,
... ...
}: }:
let
cfg = config.my.pass;
in
{ {
options.my.pass.enable = lib.mkEnableOption { }; config = {
config = lib.mkIf cfg.enable {
programs.password-store = { programs.password-store = {
enable = true; enable = true;
package = pkgs.pass.withExtensions ( package = pkgs.pass.withExtensions (

View file

@ -5,10 +5,13 @@
... ...
}: }:
let let
inherit (config.my) accent font theme; inherit (config.my)
key
accent
font
theme
;
inherit (theme) color; inherit (theme) color;
cfg = config.my.sway;
in in
{ {
imports = [ imports = [
@ -21,17 +24,10 @@ in
./swaylock.nix ./swaylock.nix
./theme.nix ./theme.nix
]; ];
config = lib.mkIf (config.my.desktop == "sway") {
options.my.sway.enable = lib.mkEnableOption { }; services.mako.enable = true;
services.swayidle.enable = true;
config = lib.mkIf cfg.enable { services.kanshi.enable = true;
my.mako.enable = true;
my.kanshi.enable = true;
my.swayidle.enable = true;
my.swaylock.enable = true;
my.mpd.enable = true;
my.zathura.enable = true;
my.waybar.enable = true;
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
@ -40,7 +36,7 @@ in
bars = [ ]; bars = [ ];
floating.modifier = "Mod4"; floating.modifier = "Mod4";
terminal = lib.getExe pkgs.alacritty; terminal = pkgs.alacritty.executable;
window.titlebar = false; window.titlebar = false;
gaps = { gaps = {
@ -73,7 +69,7 @@ in
}; };
output = { output = {
"*" = { "*" = {
adaptive_sync = "on"; adaptive_sync = "off";
bg = "${theme.background} fill"; bg = "${theme.background} fill";
mode = "1920x1080@144.000Hz"; mode = "1920x1080@144.000Hz";
}; };
@ -126,6 +122,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" ];
};
};
services.gpg-agent.pinentryPackage = pkgs.pinentry-all; services.gpg-agent.pinentryPackage = pkgs.pinentry-all;
xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json; xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json;
@ -136,6 +147,7 @@ in
swaylock swaylock
wdisplays wdisplays
waybar
dhist dhist
demoji demoji
bmenu bmenu

View file

@ -1,12 +1,20 @@
{ config, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.my.kanshi; inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
in in
{ {
options.my.kanshi.enable = lib.mkEnableOption { }; services.kanshi = {
config.services.kanshi = lib.mkIf cfg.enable {
enable = true;
settings = [ settings = [
{ {
profile = { profile = {

View file

@ -6,20 +6,15 @@
}: }:
let let
inherit (config.my) inherit (config.my)
key
accent accent
font font
theme theme
; ;
inherit (theme) color; inherit (theme) color;
cfg = config.my.mako;
in in
{ {
options.my.mako.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
services.mako = { services.mako = {
enable = true;
borderSize = 2; borderSize = 2;
padding = "5"; padding = "5";
margin = "15"; margin = "15";
@ -67,5 +62,4 @@ in
WantedBy = [ "sway-session.target" ]; WantedBy = [ "sway-session.target" ];
}; };
}; };
};
} }

View file

@ -5,15 +5,18 @@
... ...
}: }:
let let
asScript = filename: text: toString (pkgs.writeShellScript filename text); inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
cfg = config.my.swayidle; asScript = filename: text: toString (pkgs.writeShellScript filename text);
in in
{ {
options.my.swayidle.enable = lib.mkEnableOption { }; services.swayidle = {
config.services.swayidle = {
enable = cfg.enable;
timeouts = [ timeouts = [
{ {
timeout = 360; timeout = 360;

View file

@ -1,14 +1,20 @@
{ config, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
inherit (config.my) accent font theme; inherit (config.my)
key
accent
font
theme
;
inherit (theme) color; inherit (theme) color;
cfg = config.my.swaylock;
in in
{ {
options.my.swaylock.enable = lib.mkEnableOption { }; programs.swaylock.settings = {
config.programs.swaylock.settings = lib.mkIf cfg.enable {
image = toString theme.background; image = toString theme.background;
font = font.interface; font = font.interface;
font-size = font.size.medium; font-size = font.size.medium;

View file

@ -14,13 +14,9 @@ let
font font
; ;
inherit (theme) color; inherit (theme) color;
cfg = config.my.waybar;
in in
{ {
options.my.waybar.enable = lib.mkEnableOption { }; config = {
config = lib.mkIf cfg.enable {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;

View file

@ -1,4 +1,10 @@
{ config, lib, ... }: {
config,
pkgs,
lib,
font,
...
}:
let let
inherit (config.my) inherit (config.my)
key key
@ -7,16 +13,11 @@ let
theme theme
; ;
inherit (theme) color; inherit (theme) color;
cfg = config.my.zathura;
in in
{ {
options.my.zathura.enable = lib.mkEnableOption { }; config = {
programs.zathura.enable = true;
config = lib.mkIf cfg.enable { programs.zathura.options = {
programs.zathura = {
enable = true;
options = {
font = "${font.mono} ${toString font.size.small}"; font = "${font.mono} ${toString font.size.small}";
guioptions = "s"; guioptions = "s";
@ -48,7 +49,7 @@ in
index-active-bg = accent.color; index-active-bg = accent.color;
index-active-fg = accent.fg; index-active-fg = accent.fg;
}; };
mappings = { programs.zathura.mappings = {
"<C-b>" = "toggle_statusbar"; "<C-b>" = "toggle_statusbar";
${key.left} = "scroll left"; ${key.left} = "scroll left";
${key.down} = "scroll down"; ${key.down} = "scroll down";
@ -64,5 +65,4 @@ in
${lib.toUpper key.next} = "search backward"; ${lib.toUpper key.next} = "search backward";
}; };
}; };
};
} }