Created options; Moved tailscale to network folder; Disabled networkmanager wait online; Added repl command; updated firefox interface; other smaller stuff

This commit is contained in:
Jurn Wubben 2025-03-09 15:23:13 +01:00
parent 8d59cbf644
commit c087c07d02
37 changed files with 542 additions and 255 deletions

View file

@ -1,6 +1,8 @@
{
imports = [
./firefox.nix
./games.nix
./mpv.nix
./neovim.nix
./other.nix
];

View file

@ -1,6 +1,11 @@
{pkgs, ...}: {
{
osConfig,
pkgs,
lib,
...
}: {
programs.firefox = {
enable = true;
enable = osConfig.niksos.desktop;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
DisableFirefoxStudies = true;
@ -49,6 +54,7 @@
"jid1-QoFqdK4qzUfGWQ@jetpack".install_url = "https://addons.mozilla.org/firefox/downloads/latest/dark-background-light-text/latest.xpi"; # Dark reader alternative
# "{34daeb50-c2d2-4f14-886a-7160b24d66a4}".install_url = "https://addons.mozilla.org/firefox/downloads/latest/youtube-shorts-block/latest.xpi"; # Youtube short blocker
"vimium-c@gdh1995.cn".install_url = "https://addons.mozilla.org/firefox/downloads/latest/vimium-c/latest.xpi"; # Extension info here.
"ff2mpv@yossarian.net".install_url = "https://addons.mozilla.org/firefox/downloads/latest/ff2mpv/latest.xpi";
};
};
};
@ -73,8 +79,16 @@
"gfx.webrender.all" = true;
"media.ffmpeg.vaapi.enabled" = true;
"browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":["ublock0_raymondhill_net-browser-action","queryamoid_kaply_com-browser-action","_34daeb50-c2d2-4f14-886a-7160b24d66a4_-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","customizableui-special-spring1","vertical-spacer","urlbar-container","customizableui-special-spring2","save-to-pocket-button","downloads-button","fxa-toolbar-menu-button","unified-extensions-button","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","jid1-qofqdk4qzufgwq_jetpack-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["firefox-view-button","tabbrowser-tabs","new-tab-button","alltabs-button"],"vertical-tabs":[],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["save-to-pocket-button","developer-button","jid1-qofqdk4qzufgwq_jetpack-browser-action","ublock0_raymondhill_net-browser-action","queryamoid_kaply_com-browser-action","_34daeb50-c2d2-4f14-886a-7160b24d66a4_-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action"],"dirtyAreaCache":["nav-bar","vertical-tabs","PersonalToolbar","toolbar-menubar","TabsToolbar","unified-extensions-area"],"currentVersion":21,"newElementCount":2}'';
"browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":["ublock0_raymondhill_net-browser-action","queryamoid_kaply_com-browser-action","_34daeb50-c2d2-4f14-886a-7160b24d66a4_-browser-action","firefox_tampermonkey_net-browser-action","vimium-c_gdh1995_cn-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","customizableui-special-spring1","vertical-spacer","urlbar-container","customizableui-special-spring2","save-to-pocket-button","downloads-button","fxa-toolbar-menu-button","unified-extensions-button","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","jid1-qofqdk4qzufgwq_jetpack-browser-action","ff2mpv_yossarian_net-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["firefox-view-button","tabbrowser-tabs","new-tab-button","alltabs-button"],"vertical-tabs":[],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["save-to-pocket-button","developer-button","jid1-qofqdk4qzufgwq_jetpack-browser-action","ublock0_raymondhill_net-browser-action","queryamoid_kaply_com-browser-action","_34daeb50-c2d2-4f14-886a-7160b24d66a4_-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","ff2mpv_yossarian_net-browser-action","firefox_tampermonkey_net-browser-action","vimium-c_gdh1995_cn-browser-action"],"dirtyAreaCache":["nav-bar","vertical-tabs","PersonalToolbar","toolbar-menubar","TabsToolbar","unified-extensions-area"],"currentVersion":21,"newElementCount":2}'';
};
};
};
home.file.".mozilla/native-messaging-hosts/ff2mpv.json".text = builtins.toJSON {
name = "ff2mpv";
description = "ff2mpv's external manifest";
path = lib.getExe pkgs.ff2mpv-rust;
type = "stdio";
allowed_extensions = ["ff2mpv@yossarian.net"];
};
}

3
home/programs/games.nix Normal file
View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
# Also look at system/programs/games.nix
}

27
home/programs/mpv.nix Normal file
View file

@ -0,0 +1,27 @@
{
pkgs,
osConfig,
...
}: {
programs.mpv = {
enable = osConfig.niksos.desktop;
config = {
vo = "gpu";
profile = "gpu-hq";
hwdec = "auto-safe";
gpu-context = "wayland";
ytdl-format = "bestvideo+bestaudio";
volume-max = 200;
fs = true;
save-position-on-quit = true;
};
scripts = with pkgs.mpvScripts; [
uosc
youtube-upnext
thumbfast
sponsorblock
mpv-cheatsheet
];
};
}

View file

@ -1,8 +1,12 @@
{inputs, ...}: {
{
inputs,
osConfig,
...
}: {
imports = [inputs.nvf.homeManagerModules.default];
programs.nvf = {
enable = true;
enable = osConfig.niksos.neovim;
settings.vim = {
viAlias = true;
vimAlias = true;
@ -69,6 +73,7 @@
autocomplete.nvim-cmp.enable = true;
snippets.luasnip.enable = true;
mini.surround.enable = true;
# This can also be themed with stylix. Remove `targets.nvf.enable = false` in `../style/default.nix`
theme = {
enable = true;
name = "catppuccin";

View file

@ -1,5 +1,10 @@
{pkgs, ...}: {
home.packages = [
{
pkgs,
lib,
osConfig,
...
}: {
home.packages = lib.mkIf osConfig.niksos.desktop [
pkgs.spotify
pkgs.signal-desktop
];

View file

@ -1,9 +1,10 @@
{
imports = [
./fish.nix
./other.nix
./repl
./starship.nix
./yazi.nix
./zoxide.nix
./other.nix
];
}

View file

@ -5,5 +5,7 @@
pkgs.ear2ctl # FIXME: only when bluetooth enabled
pkgs.bluetui
pkgs.typst #FIXME: move to flake shell
];
}

View file

@ -0,0 +1,26 @@
# copied from https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix
{pkgs, ...}: let
repl = ./lib.nix;
example = command: desc: ''\n\u001b[33m ${command}\u001b[0m - ${desc}'';
in {
home.packages = [
(pkgs.writeShellScriptBin
"repl"
''
case "$1" in
"-h"|"--help"|"help")
printf "%b\n\e[4mUsage\e[0m: \
${example "repl" "Loads system flake if available."} \
${example "repl /path/to/flake.nix" "Loads specified flake."}\n"
;;
*)
if [ -z "$1" ]; then
nix repl ${repl}
else
nix repl --arg flakePath $(${pkgs.coreutils}/bin/readlink -f $1 | ${pkgs.gnused}/bin/sed 's|/flake.nix||') ${repl}
fi
;;
esac
'')
];
}

50
home/shell/repl/lib.nix Normal file
View file

@ -0,0 +1,50 @@
# Copied from https://github.com/fufexan/dotfiles/blob/main/lib/repl.nix
{
flakePath ? null,
hostnamePath ? "/etc/hostname",
registryPath ? /etc/nix/registry.json,
}: let
inherit (builtins) getFlake head match currentSystem readFile pathExists filter fromJSON;
selfFlake =
if pathExists registryPath
then filter (it: it.from.id == "self") (fromJSON (readFile registryPath)).flakes
else [];
flakePath' =
toString
(
if flakePath != null
then flakePath
else if selfFlake != []
then (head selfFlake).to.path
else "/etc/nixos"
);
flake =
if pathExists flakePath'
then getFlake flakePath'
else {};
hostname =
if pathExists hostnamePath
then head (match "([a-zA-Z0-9\\-]+)\n" (readFile hostnamePath))
else "";
nixpkgsFromInputsPath = flake.inputs.nixpkgs.outPath or "";
nixpkgs =
flake.pkgs.${currentSystem}.nixpkgs
or (
if nixpkgsFromInputsPath != ""
then import nixpkgsFromInputsPath {}
else {}
);
nixpkgsOutput = removeAttrs (nixpkgs // nixpkgs.lib or {}) ["options" "config"];
in
{inherit flake;}
// flake
// builtins
// (flake.nixosConfigurations or {})
// flake.nixosConfigurations.${hostname} or {}
// nixpkgsOutput
// {getFlake = path: getFlake (toString path);}

View file

@ -1,4 +1,5 @@
{
osConfig,
config,
inputs,
pkgs,
@ -9,7 +10,7 @@
];
stylix = {
enable = true;
enable = osConfig.niksos.desktop;
image = ./background.png;
polarity = "dark";
@ -25,9 +26,14 @@
};
iconTheme = {
enable = true;
package = pkgs.tela-circle-icon-theme; #FIXME: Swap out for normal tela icons once https://github.com/NixOS/nixpkgs/issues/381521 is upstream.
dark = "Tela-circle-dark";
light = "Tela-circle-dark";
package = pkgs.tela-icon-theme;
dark = "Tela-dark";
light = "Tela-dark";
};
targets = {
gnome-text-editor.enable = false; # Creates an overlay in home-manager land which isn't allowed with globalPkgs.
nvf.enable = false; # I'd like to be able to read my code, thank you.
};
# base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-frappe.yaml";

View file

@ -1,4 +1,12 @@
{pkgs, ...}: {
{
pkgs,
lib,
osConfig,
...
}: let
inherit (lib) mkIf;
inherit (osConfig.niksos) desktop;
in {
imports = [
./fuzzel.nix
./hyprland
@ -6,11 +14,11 @@
./mako.nix
];
home.packages = [
home.packages = mkIf desktop [
pkgs.wl-clipboard
];
home.sessionVariables = {
home.sessionVariables = mkIf desktop {
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
XDG_SESSION_TYPE = "wayland";

View file

@ -1,11 +1,11 @@
{
config,
osConfig,
pkgs,
lib,
...
}: {
programs.fuzzel = {
enable = true;
enable = osConfig.niksos.desktop;
settings.main = {
launch-prefix = "${lib.getExe pkgs.uwsm} app --";
};

View file

@ -1,5 +1,6 @@
{
config,
osConfig,
lib,
pkgs,
...
@ -49,68 +50,74 @@
)
10);
in {
wayland.windowManager.hyprland.settings = {
"$mod" = "ALT";
config = lib.mkIf osConfig.niksos.desktop {
home.file.".XCompose".text = ''
<Multi_key> <s> <h> <r> <u> <g> : "¯\\_()_/¯" # Shrug.
'';
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
wayland.windowManager.hyprland.settings = {
"$mod" = "ALT";
bind =
[
"$mod SHIFT, E, exec, uwsm stop"
"$mod, Q, killactive,"
"$mod, F, fullscreen,"
"$mod, SPACE, togglefloating,"
"$mod, O, pseudo,"
"$mod ALT, ,resizeactive,"
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
"$mod, D, exec, ${fuzzel}"
"$mod, Return, exec, ${foot}"
"$mod Shift, Return, exec, ${firefox}"
"$mod, Escape, exec, ${hyprlock}"
bind =
[
"$mod SHIFT, E, exec, uwsm stop"
"$mod, Q, killactive,"
"$mod, F, fullscreen,"
"$mod, SPACE, togglefloating,"
"$mod, O, pseudo,"
"$mod ALT, ,resizeactive,"
"$mod, A, exec, ${pulsemixer}"
"$mod, B, exec, ${bluetui}"
"$mod, N, exec, ${nmtui}"
''
$mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./scripts.nix {inherit pkgs;}).statusnotify})"'
''
"$mod, D, exec, ${fuzzel}"
"$mod, Return, exec, ${foot}"
"$mod Shift, Return, exec, ${firefox}"
"$mod, Escape, exec, ${hyprlock}"
"$mod, Print, exec, ${grimblast} copy area"
", Print, exec, ${grimblast} save area - | ${swappy} -f -"
"$mod, A, exec, ${pulsemixer}"
"$mod, B, exec, ${bluetui}"
"$mod, N, exec, ${nmtui}"
''
$mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./scripts.nix {inherit pkgs;}).statusnotify})"'
''
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod, Print, exec, ${grimblast} copy area"
", Print, exec, ${grimblast} save area - | ${swappy} -f -"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
]
++ workspaces;
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
bindl = [
# media controls
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioPrev, exec, ${playerctl} previous"
", XF86AudioNext, exec, ${playerctl} next"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
]
++ workspaces;
# volume
", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
];
bindl = [
# media controls
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioPrev, exec, ${playerctl} previous"
", XF86AudioNext, exec, ${playerctl} next"
bindle = [
# volume
", XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+"
", XF86AudioLowerVolume, exec, ${wpctl} set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-"
",XF86MonBrightnessUp, exec, ${brightnessctl} s 10%+"
",XF86MonBrightnessDown, exec, ${brightnessctl} s 10%-"
];
# volume
", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
];
bindle = [
# volume
", XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+"
", XF86AudioLowerVolume, exec, ${wpctl} set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-"
",XF86MonBrightnessUp, exec, ${brightnessctl} s 10%+"
",XF86MonBrightnessDown, exec, ${brightnessctl} s 10%-"
];
};
};
}

View file

@ -1,4 +1,5 @@
{
osConfig,
lib,
pkgs,
...
@ -14,10 +15,11 @@ in {
];
wayland.windowManager.hyprland = {
enable = true;
enable = osConfig.niksos.desktop;
settings = {
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"NIXOS_OZONE_WL,1"
];
exec-once = [
"${uwsm} finalize"

View file

@ -1,8 +1,12 @@
{config, ...}: let
{
config,
osConfig,
...
}: let
inherit (config.lib.stylix.colors) base05;
in {
programs.hyprlock = {
enable = true;
enable = osConfig.niksos.desktop;
settings = {
general = {

View file

@ -1,3 +1,6 @@
{
services.mako.enable = true;
{osConfig, ...}: {
services.mako = {
enable = osConfig.niksos.desktop;
defaultTimeout = 5000;
};
}