rofi, osu-lazer-bin, etc

This commit is contained in:
chayleaf 2023-02-20 00:49:39 +07:00
parent cb5a5cdb5a
commit 159542369d
13 changed files with 141 additions and 57 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
flake.lock
private.nix private.nix

View file

@ -1,5 +1,8 @@
[ [
{ {
"slug": "youtube-nonstop" "slug": "youtube-nonstop"
},
{
"slug": "middle-mouse-button-scroll"
} }
] ]

View file

@ -1,17 +0,0 @@
{ buildFirefoxXpiAddon, fetchurl, lib, stdenv }:
{
"youtube-nonstop" = buildFirefoxXpiAddon {
pname = "youtube-nonstop";
version = "0.9.1";
addonId = "{0d7cafdd-501c-49ca-8ebb-e3341caaa55e}";
url = "https://addons.mozilla.org/firefox/downloads/file/3848483/youtube_nonstop-0.9.1.xpi";
sha256 = "8340d57622a663949ec1768eb37d47651c809fadf0ffaa5ff546c48fdd28e33d";
meta = with lib;
{
homepage = "https://github.com/lawfx/YoutubeNonStop";
description = "Tired of getting that \"Video paused. Continue watching?\" confirmation dialog?\nThis extension autoclicks it, so you can listen to your favorite music uninterrupted.\n\nWorking on YouTube and YouTube Music!";
license = licenses.mit;
platforms = platforms.all;
};
};
}

View file

@ -78,7 +78,7 @@ let firefoxWithCcache = ({ useSccache, firefox-unwrapped }:
rust-search-extension rust-search-extension
return-youtube-dislikes return-youtube-dislikes
protondb-for-steam protondb-for-steam
privacy-redirect libredirect
privacy-pass privacy-pass
noscript noscript
localcdn localcdn
@ -92,6 +92,7 @@ let firefoxWithCcache = ({ useSccache, firefox-unwrapped }:
# my packages # my packages
yomichan yomichan
youtube-nonstop youtube-nonstop
middle-mouse-button-scroll
]; ];
}; };
}; };

View file

@ -1,5 +1,18 @@
{ buildFirefoxXpiAddon, fetchurl, lib, stdenv }: { buildFirefoxXpiAddon, fetchurl, lib, stdenv }:
{ {
"middle-mouse-button-scroll" = buildFirefoxXpiAddon {
pname = "middle-mouse-button-scroll";
version = "0.3.2";
addonId = "{b687f6ef-3299-4a75-8279-8b1c30dfcc9d}";
url = "https://addons.mozilla.org/firefox/downloads/file/3505309/middle_mouse_button_scroll-0.3.2.xpi";
sha256 = "d21d29b29a7bd3fae5407d995737c4c41d66daf73729b88ad39d149223362412";
meta = with lib;
{
homepage = "https://github.com/StoyanDimitrov/middle-mouse-button-scroll";
description = "Scroll fast or precise through long documents with pressed middle mouse button";
platforms = platforms.all;
};
};
"youtube-nonstop" = buildFirefoxXpiAddon { "youtube-nonstop" = buildFirefoxXpiAddon {
pname = "youtube-nonstop"; pname = "youtube-nonstop";
version = "0.9.1"; version = "0.9.1";

View file

@ -135,6 +135,10 @@
mutableTrust = true; mutableTrust = true;
}; };
nix-index.enable = true; nix-index.enable = true;
readline = {
enable = true;
variables.editing-mode = "vi";
};
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -1,5 +1,5 @@
{ lib, pkgs, ... }: { lib, rustPlatform }:
pkgs.rustPlatform.buildRustPackage { rustPlatform.buildRustPackage {
pname = "home-daemon"; pname = "home-daemon";
version = "0.1"; version = "0.1";

View file

@ -44,9 +44,16 @@ barConfig = {
}; };
}; };
commonConfig = { commonConfig = {
modifier = modifier; inherit modifier;
startup = [ startup = [
{ command = "~/scripts/initwm.sh"; } { command = builtins.toString (with pkgs; writeShellScript "init-wm" ''
${callPackage ./home-daemon.nix {}}/bin/dotfiles-home-daemon system76-scheduler&
${gnome.zenity}/bin/zenity --password | (${keepassxc}/bin/keepassxc --pw-stdin ~/Nextcloud/keepass.kdbx&)
# nextcloud and nheko need secret service access
${nextcloud-client}/bin/nextcloud --background&
${nheko}/bin/nheko&
${tdesktop}/bin/telegram-desktop -startintray&
''); }
]; ];
colors = { colors = {
focused = { focused = {
@ -85,7 +92,6 @@ commonConfig = {
}; };
floating.criteria = [ floating.criteria = [
{ class = "Anki"; title = "Add"; } { class = "Anki"; title = "Add"; }
# { class = "Anki"; title = "Browse .*"; }
{ class = "Anki"; title = "Statistics"; } { class = "Anki"; title = "Statistics"; }
{ class = "Anki"; title = "Preferences"; } { class = "Anki"; title = "Preferences"; }
]; ];
@ -99,7 +105,6 @@ commonConfig = {
smartGaps = true; smartGaps = true;
inner = 10; inner = 10;
}; };
menu = "${pkgs.bemenu}/bin/bemenu-run --no-overlap --prompt '>' --tb '#24101a' --tf '#ebbe5f' --fb '#24101a' --nb '#24101ac0' --ab '#24101ac0' --nf '#ebdadd' --af '#ebdadd' --hb '#394893' --hf '#e66e6e' --list 30 --prefix '*' --scrollbar autohide --fn 'Noto Sans Mono' --line-height 23 --sb '#394893' --sf '#ebdadd' --scb '#6b4d52' --scf '#e66e6e'";
window.hideEdgeBorders = "smart"; window.hideEdgeBorders = "smart";
workspaceAutoBackAndForth = true; workspaceAutoBackAndForth = true;
}; };
@ -124,10 +129,9 @@ genKeybindings = (default_options: kb:
); );
in in
{ {
# TODO merge with colors in gui.nix # TODO merge with colors in gui.nix and terminal.nix
imports = [ ./options.nix ./gui.nix ./waybar.nix ]; imports = [ ./options.nix ./gui.nix ./waybar.nix ];
home.sessionVariables = { home.sessionVariables = {
BEMENU_OPTS = "--no-overlap --prompt '>' --tb '#24101a' --tf '#ebbe5f' --fb '#24101a' --nb '#24101ac0' --ab '#24101ac0' --nf '#ebdadd' --af '#ebdadd' --hb '#394893' --hf '#e66e6e' --list 30 --prefix '*' --scrollbar autohide --fn 'Noto Sans Mono' --line-height 23 --sb '#394893' --sf '#ebdadd' --scb '#6b4d52' --scf '#e66e6e'";
_JAVA_AWT_WM_NONREPARENTING = "1"; _JAVA_AWT_WM_NONREPARENTING = "1";
GTK_IM_MODULE = "fcitx"; GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx"; QT_IM_MODULE = "fcitx";
@ -165,6 +169,7 @@ in
statusCommand = "${pkgs.i3status}/bin/i3status"; statusCommand = "${pkgs.i3status}/bin/i3status";
}) })
]; ];
menu = "${pkgs.rofi}/bin/rofi -show drun";
keybindings = genKeybindings options.xsession.windowManager.i3 { keybindings = genKeybindings options.xsession.windowManager.i3 {
XF86AudioRaiseVolume = "exec ${pkgs.pamixer}/bin/pamixer --increase 5"; XF86AudioRaiseVolume = "exec ${pkgs.pamixer}/bin/pamixer --increase 5";
XF86AudioLowerVolume = "exec ${pkgs.pamixer}/bin/pamixer --decrease 5"; XF86AudioLowerVolume = "exec ${pkgs.pamixer}/bin/pamixer --decrease 5";
@ -174,7 +179,7 @@ in
XF86AudioPrev = "exec ${pkgs.playerctl}/bin/playerctl previous"; XF86AudioPrev = "exec ${pkgs.playerctl}/bin/playerctl previous";
}; };
terminal = config.terminalBinX; terminal = config.terminalBinX;
}; in i3Config // commonConfig // i3Config; }; in commonConfig // i3Config;
}; };
home.file.".xinitrc".text = '' home.file.".xinitrc".text = ''
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
@ -189,12 +194,6 @@ in
xsession.initExtra = '' xsession.initExtra = ''
setxkbmap -layout jp,ru -option compose:ralt,grp:win_space_toggle setxkbmap -layout jp,ru -option compose:ralt,grp:win_space_toggle
''; '';
home.packages = with pkgs; if config.wayland.windowManager.sway.enable then [
wl-clipboard
xdg-desktop-portal
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
] else [];
wayland.windowManager.sway = { wayland.windowManager.sway = {
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
config = let swayConfig = { config = let swayConfig = {
@ -207,13 +206,13 @@ in
} }
]; ];
terminal = config.terminalBin; terminal = config.terminalBin;
window.commands = [ window = commonConfig.window // { commands = [
{ command = "floating enable; move workspace current"; { command = "floating enable; move workspace current";
criteria = { criteria = {
app_id = "^org.keepassxc.KeePassXC$"; app_id = "^org.keepassxc.KeePassXC$";
title = "^KeePassXC - (?:Browser |)?(?:Access Request|)$"; title = "^KeePassXC - (?:Browser |)?(?:Access Request|)$";
}; } }; }
]; ]; };
assigns = { assigns = {
"2" = [ "2" = [
{ app_id = "org.telegram.desktop"; } { app_id = "org.telegram.desktop"; }
@ -272,14 +271,11 @@ in
"--locked --inhibited XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; "--locked --inhibited XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"--locked --inhibited XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "--locked --inhibited XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
}); });
startup = [ startup = commonConfig.startup ++ [
{ {
always = true; always = true;
command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"; command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP";
} }
{
command = "~/scripts/initwm.sh";
}
{ {
command = "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store --no-persist"; command = "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store --no-persist";
} }
@ -297,9 +293,9 @@ in
xkb_options = "compose:ralt,grp:win_space_toggle"; xkb_options = "compose:ralt,grp:win_space_toggle";
}; };
}; };
}; in swayConfig // commonConfig // swayConfig; menu = "${pkgs.rofi-wayland}/bin/rofi -show drun";
}; in commonConfig // swayConfig;
extraSessionCommands = '' extraSessionCommands = ''
export BEMENU_BACKEND=wayland
export SDL_VIDEODRIVER=wayland export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
@ -327,7 +323,8 @@ in
command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\""; command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; } resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
{ timeout = 600; { timeout = 600;
command = swaylock-start; } command = swaylock-start;
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
]; ];
}; };
programs.swaylock.settings = rec { programs.swaylock.settings = rec {
@ -370,4 +367,62 @@ in
text-wrong-color = text-color; text-wrong-color = text-color;
ring-wrong-color = "#e64e4e"; # deep-ish red ring-wrong-color = "#e64e4e"; # deep-ish red
}; };
home.packages = with pkgs; if config.wayland.windowManager.sway.enable then [
wl-clipboard
xdg-desktop-portal
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
] else [];
programs.rofi = {
enable = true;
font = "Noto Sans Mono 12";
package = lib.mkIf config.wayland.windowManager.sway.enable pkgs.rofi-wayland;
plugins = with pkgs; [
rofi-calc
];
theme = with config.lib.formats.rasi; let transparent = mkLiteral "transparent"; in {
"*" = rec {
highlight = mkLiteral "bold italic";
scrollbar = true;
background = transparent;
background-color = mkLiteral "#24101a80";
foreground = mkLiteral "#ebdadd";
border-color = foreground;
separatorcolor = border-color;
scrollbar-handle = border-color;
normal-background = transparent;
normal-foreground = foreground;
alternate-normal-background = transparent;
alternate-normal-foreground = normal-foreground;
selected-normal-background = mkLiteral "#394893";
selected-normal-foreground = mkLiteral "#e66e6e";
active-background = foreground;
active-foreground = mkLiteral "#24101a";
alternate-active-background = active-background;
alternate-active-foreground = active-foreground;
selected-active-background = mkLiteral "#e66e6e";
selected-active-foreground = mkLiteral "#394893";
urgent-background = mkLiteral "#e66e6e";
urgent-foreground = foreground;
alternate-urgent-background = urgent-background;
alternate-urgent-foreground = urgent-foreground;
selected-urgent-background = mkLiteral "#394893";
selected-urgent-foreground = mkLiteral "#ebbe5f";
};
"@import" = "gruvbox-common.rasi";
};
terminal = config.terminalBin;
extraConfig = {
icon-theme = "hicolor";
drun-match-fields = "name,generic,exec,keywords";
show-icons = true;
sort = true;
sorting-method = "fzf";
steal-focus = true;
};
};
} }

View file

@ -16,14 +16,14 @@ in {
terminalBinX = getTerminalBin (lib.lists.findFirst (term: term != "foot") null config.terminals); terminalBinX = getTerminalBin (lib.lists.findFirst (term: term != "foot") null config.terminals);
colors = { colors = {
base = [ base = [
"523b3f" "523b3f" # black
"e66e6e" "e66e6e" # red
"8cbf73" "8cbf73" # green
"ebbe5f" "ebbe5f" # yellow
"5968b3" "5968b3" # blue
"a64999" "a64999" # magenta
"77c7c2" "77c7c2" # cyan
"f0e4e6" "f0e4e6" # white
"6b4d52" "6b4d52"
"e66e6e" "e66e6e"
"8cbf73" "8cbf73"

View file

@ -21,6 +21,26 @@
"type": "github" "type": "github"
} }
}, },
"nix-gaming": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1676564857,
"narHash": "sha256-E2O086asoR2sFhsEvPVCdneVYNoP1JbQ4B8OcIdpdPU=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "dbe7029d83ff8ab3db3e379c7a1fb65a309c5c54",
"type": "github"
},
"original": {
"owner": "fufexan",
"repo": "nix-gaming",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1676795730, "lastModified": 1676795730,
@ -52,6 +72,7 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-gaming": "nix-gaming",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur" "nur": "nur"
} }

View file

@ -9,9 +9,13 @@
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, home-manager, nur }: outputs = { self, nixpkgs, home-manager, nur, nix-gaming }:
let let
# IRL-related private config # IRL-related private config
priv = if builtins.pathExists ./private.nix then (import ./private.nix) else {}; priv = if builtins.pathExists ./private.nix then (import ./private.nix) else {};
@ -22,6 +26,7 @@
pkgs = nixpkgs.legacyPackages."x86_64-linux"; pkgs = nixpkgs.legacyPackages."x86_64-linux";
modules = [ modules = [
nur.nixosModules.nur nur.nixosModules.nur
{ nixpkgs.overlays = [ nix-gaming.overlays.default ]; }
./hosts/nixmsi.nix ./hosts/nixmsi.nix
(getPriv "nixmsi") (getPriv "nixmsi")
]; ];

View file

@ -35,6 +35,7 @@
"steam-original" "steam-original"
"steam-runtime" "steam-runtime"
"steamcmd" "steamcmd"
"osu-lazer-bin"
]; ];
home.sessionVariables = let sources = (import ../_sources/generated.nix { home.sessionVariables = let sources = (import ../_sources/generated.nix {
inherit (pkgs) fetchgit fetchurl fetchFromGitHub dockerTools; inherit (pkgs) fetchgit fetchurl fetchFromGitHub dockerTools;
@ -51,18 +52,17 @@
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
openrgb piper openrgb piper
steam-run steam steam-run steam
osu-lazer-bin
easyeffects easyeffects
# wineWowPackages.waylandFull # wineWowPackages.waylandFull
winetricks winetricks
protontricks # proton-caller protontricks # proton-caller
bottles # bottles
virtmanager virtmanager
gimp krita blender gimp krita blender
tdesktop tdesktop
clang rustc rustfmt cargo clippy clang rustc rustfmt cargo clippy
(import ../common/home-daemon.nix { inherit lib pkgs; })
# waiting until the PR gets merged # waiting until the PR gets merged
(looking-glass-client.overrideAttrs (old: { (looking-glass-client.overrideAttrs (old: {
version = "B6"; version = "B6";

View file

@ -1,2 +1,2 @@
# [ (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) ] # [ (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) ]
[ (import <rust-overlay>) ] [ (import <rust-overlay>) (import <nix-gaming>).overlays.default ]