some stuff

This commit is contained in:
xunuwu 2024-06-18 19:43:43 +02:00
parent cc83f63010
commit 4ae26b48df
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
10 changed files with 51 additions and 80 deletions

View file

@ -1,6 +1,8 @@
{
outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
inputs.flake-parts.lib.mkFlake {
inherit inputs;
} {
systems = ["x86_64-linux"];
imports = [
./home/profiles
@ -9,7 +11,11 @@
];
flake = {
};
perSystem = {pkgs, ...}: {
perSystem = {
pkgs,
system,
...
}: {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
alejandra

View file

@ -33,6 +33,7 @@
../../programs/misc/ardour.nix
../../programs/misc/foliate.nix
../../programs/misc/obsidian.nix
../../programs/misc/pavucontrol.nix
../../programs/misc/thunderbird.nix
#../../programs/music
#../../programs/music/yams.nix

View file

@ -39,17 +39,6 @@
wobVolume = "${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_SINK@ | awk '{print $2*100}' > $XDG_RUNTIME_DIR/wob.sock";
setVolume = limit: amount: "${pkgs.wireplumber}/bin/wpctl set-volume -l ${limit} @DEFAULT_AUDIO_SINK@ ${amount}";
perMonitor = workspace: "\"$(swaymsg -t get_outputs | ${lib.getExe pkgs.jq} -r '.[] | select(.focused == true).name' | ${lib.getExe pkgs.perl} -ne '$s=0;for(split//){$s+=ord}print\"$s\"')${toString workspace}\"";
#perMonitor = workspace: "${lib.getExe (pkgs.writeShellScriptBin "perMonitor" ''
# id=$( md5sum <<< ${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs | ${lib.getExe pkgs.jq} -r '.[] | select(.focused == true).id' )
# echo $((0x''${id%% *}))
#'')} workspace";
#perMonitor = pkgs.writeShellScriptBin "perMonitor" ''
# args=( "$@" )
# id=$( ${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs | ${lib.getExe pkgs.jq} -r '.[] | select(.focused == true).id' )
# # args[$#-1]=$(( ''${args[$#-1]} + $id * 10 ))
# args[$#-1]="$id:''${args[$#-1]}"
# swaymsg ''${args[@]}
#'';
dir = with config.wayland.windowManager.sway.config; {
inherit up down left right;
};
@ -79,14 +68,16 @@
"XF86AudioPrev" = "exec ${lib.getExe pkgs.playerctl} previous";
}
// builtins.listToAttrs (lib.flatten
(builtins.map (x: [
(builtins.map (x: let
x' = toString x;
in [
{
name = "${mod}+${toString x}";
value = "exec swaymsg workspace number ${perMonitor x}:${toString x}";
name = "${mod}+${x'}";
value = "exec swaymsg workspace number ${perMonitor x'}:${x'}";
}
{
name = "${mod}+Shift+${toString x}";
value = "exec swaymsg move container to workspace number ${perMonitor x}:${toString x}";
name = "${mod}+Shift+${toString x'}";
value = "exec swaymsg move container to workspace number ${perMonitor x'}:${x'}";
}
]) (lib.range 0 9)))
);

View file

@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
pavucontrol
];
}

View file

@ -10,7 +10,12 @@
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}";
set-option -g status-style bg=default
set -g status-style bg=default
setw -g window-status-current-style fg=#be95ff
set -g status-justify absolute-centre
set -g status-interval 5
set -g status-right "#[fg=#25be6a]#(free -h | awk 'NR==2{print $3\"/\"$2}')"
set -ag status-right "#[fg=default] %a %d %b %H:%M"
'';
};
}

View file

@ -1,37 +0,0 @@
{
pkgs,
lib,
...
}: {
# From https://github.com/NixOS/nixos-hardware/blob/master/gigabyte/b550/b550-fix-suspend.nix using until
# it has been merged into the flake.
systemd.services.bugfixSuspend-GPP0 = {
enable = lib.mkDefault true;
description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)";
unitConfig = {
Type = "oneshot";
};
serviceConfig = {
User = "root"; # root may not be necessary
# check for gppN, disable if enabled
# lifted from https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/ /u/Demotay
ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP0' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP0' > /proc/acpi/wakeup; fi'";
RemainAfterExit = "yes"; # required to not toggle when `nixos-rebuild switch` is ran
};
wantedBy = ["multi-user.target"];
};
systemd.services.bugfixSuspend-GPP8 = {
enable = lib.mkDefault true;
description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)";
unitConfig = {
Type = "oneshot";
};
serviceConfig = {
User = "root";
ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP8' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP8' > /proc/acpi/wakeup; fi'";
RemainAfterExit = "yes";
};
wantedBy = ["multi-user.target"];
};
}

View file

@ -9,7 +9,6 @@
inputs.hardware.nixosModules.common-gpu-amd
inputs.hardware.nixosModules.common-pc-ssd
inputs.hardware.nixosModules.gigabyte-b550
#./gigabyte-b550-fix.nix
];
boot = {

View file

@ -1,4 +1,4 @@
{...}: {
{
nixpkgs = {
config.allowUnfree = true;
config.permittedInsecurePackages = [];

View file

@ -1,6 +1,6 @@
{
programs.gamescope = {
enable = true;
capSysNice = true;
capSysNice = false; # breaks in steam & heroic
};
}

View file

@ -1,9 +1,4 @@
{
pkgs,
config,
inputs,
...
}: {
{pkgs, ...}: {
environment.systemPackages = [
pkgs.protontricks
pkgs.steamtinkerlaunch
@ -11,6 +6,15 @@
programs.steam = {
enable = true;
#package = pkgs.steam.overrideAttrs (final: prev: {
# nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.breakpointHook];
# postInstall =
# prev.postInstall
# ++ ''
# exit 33
# '';
#});
remotePlay.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
extraCompatPackages = with pkgs; [
@ -18,9 +22,7 @@
];
gamescopeSession.enable = true;
## Fixes gamescope
package = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
extraPackages = with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
@ -33,5 +35,4 @@
keyutils
];
};
};
}