Add the x220 host

I don't have the time to split this commit
This commit is contained in:
caem 2024-10-30 15:32:07 +01:00
parent c0e985d51c
commit d8ce89bd77
Signed by: caem
GPG key ID: 69A830D03203405F
10 changed files with 539 additions and 217 deletions

View file

@ -0,0 +1,305 @@
{ pkgs, ...}:
{
imports = [
../../system/fonts.nix
../../packages/foot.nix
];
nixpkgs.overlays = [
(final: prev: {
sandbar = prev.sandbar.overrideAttrs (old: {
src = prev.fetchFromGitHub {
owner = "c4em";
repo = "sandbar";
rev = "45a8b6aa20066f1136c9acb7526fa98f208a74b6";
hash = "sha256-dNYYlm5CEdnvLjskrPJgquptIQpYgU+gxOu+bt+7sbw=";
};
});
})
];
environment.systemPackages = with pkgs; [
foot # to be replaced with ghostty
wl-clipboard
sandbar
pamixer
pavucontrol
tofi
swaybg
fnott
slurp
wf-recorder
grim
libnotify
seahorse
];
environment.sessionVariables = {
NIXOS_OZONE_WL = 1;
};
programs.river.enable = true;
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal";
TTYReset = true;
TTYHangup = true;
TTYVTDisallocate = true;
};
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --asterisks --cmd river";
user = "greeter";
};
};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
home-manager.users.hu = {
home.file."/home/hu/.config/tofi/config" = {
text = ''
width = 100%
height = 100%
border-width = 0
outline-width = 0
padding-left = 35%
padding-top = 35%
result-spacing = 25
num-results = 5
font = Go Mono Nerd Font
background-color = #000A
'';
};
home.file."/home/hu/.config/river/bar" = {
text = ''
#!/usr/bin/env sh
FIFO="$XDG_RUNTIME_DIR/sandbar"
[ -e "$FIFO" ] && rm -f "$FIFO"
mkfifo "$FIFO"
while cat "$FIFO"; do :; done | sandbar \
-hide-normal-mode \
-no-layout \
-font "Go Mono Nerd Font:12" \
-active-fg-color "#bbbbbb" \
-active-bg-color "#222222" \
-inactive-fg-color "#888888" \
-inactive-bg-color "#111111" \
-urgent-fg-color "#ab5656" \
-title-fg-color "#bbbbbb" \
-title-bg-color "#222222"
'';
executable = true;
};
home.file."/home/hu/.config/river/status" = {
text = ''
#!/usr/bin/env sh
FIFO="$XDG_RUNTIME_DIR/sandbar"
[ -e "$FIFO" ] || mkfifo "$FIFO"
bat () {
read -r bat_status < /sys/class/power_supply/BAT0/status
read -r bat_capacity < /sys/class/power_supply/BAT0/capacity
case "$bat_status" in
"Charging")
bat_status="󱟦"
;;
"Discharging")
bat_status="󱟤"
;;
"Full")
bat_status="󱟢"
;;
"Not charging")
bat_status="󱞜"
;;
"Empty")
bat_status="󱟨"
;;
esac
bat="[$bat_status $bat_capacity]"
}
datetime () {
dat="[$(date "+%H:%M")]"
}
while true; do
if [ -d /sys/class/power_supply/BAT0/ ]; then
bat
fi
datetime
echo "all status $bat$dat" > "$FIFO"
sleep 20
done
'';
executable = true;
};
wayland.windowManager.river = {
enable = true;
systemd.enable = true;
settings = {
map.normal = {
"Super+Shift Return" = "spawn foot";
"Super+Shift C" = "close";
"Super J" = "focus-view next";
"Super K"= "focus-view previous";
"Super+Shift J" = "swap next";
"Super+Shift K" = "swap previous";
"Super Space" = "toggle-float";
"Super+Shift R" = "spawn ~/.config/river/init";
"Super+Shift Q" = "exit";
"Super H" = "send-layout-cmd rivertile 'main-ratio -0.05'";
"Super L" = "send-layout-cmd rivertile 'main-ratio +0.05'";
"Super P" = "spawn '$(tofi-drun)'";
"Super S" = "spawn ~/.config/river/screenshot.sh";
"Super O" = "spawn ~/.config/river/screencast.sh";
"Super+Shift O" = "spawn ~/.config/river/screencast.sh audio";
"None XF86AudioRaiseVolume" = "spawn 'pamixer -i 5'";
"None XF86AudioLowerVolume" = "spawn 'pamixer -d 5'";
"None XF86AudioMute" = "spawn 'pamixer --toggle-mute'";
"None XF86AudioMicMute" = "spawn 'pamixer --default-source --toggle-mute'";
};
map-pointer.normal = {
"Super BTN_LEFT" = "move-view";
"Super BTN_RIGHT" = "resize-view";
};
keyboard-layout = "de";
default-layout = "rivertile";
rule-add."-app-id" = {
"'bar'" = "csd";
};
set-repeat = "50 300";
spawn = [
"'swaybg -i /nix/config/assets/wallpapers/river.png'"
"/home/hu/.config/river/status"
"/home/hu/.config/river/bar"
"'fnott --config /home/hu/.config/fnott/fnott.conf.ini'"
"'gnome-keyring-daemon --start'"
];
border-width = 1;
border-color-focused = "0x333333";
border-color-unfocused = "0x000000";
};
extraConfig = "
for i in $(seq 1 9); do
tags=$((1 << ($i - 1)))
riverctl map normal Super $i set-focused-tags $tags
riverctl map normal Super+Shift $i set-view-tags $tags
done
rivertile -main-ratio 0.5 -view-padding 0 -outer-padding 0
";
};
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
gtk = {
enable = true;
theme = {
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
iconTheme = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
};
};
home.file."/home/hu/.config/river/screenshot.sh" = {
executable = true;
text = ''
#!/usr/bin/env sh
mkdir -p "$HOME/images/screenshots"
screenshot_file="$HOME/images/screenshots/$(date +%s).png"
area="$(slurp)"
if [ "$area" = "selection cancelled" ]; then
exit 0
fi
grim -g "$area" "$screenshot_file"
notify-send "Screenshot saved" "$screenshot_file"
wl-copy < "$screenshot_file"
'';
};
home.file."/home/hu/.config/river/screencast.sh" = {
executable = true;
text = ''
#!/usr/bin/env sh
if [ -n "$(pidof wf-recorder)" ]; then
kill -s SIGINT $(pidof wf-recorder)
notify-send "Screencast saved" "$(cat "$HOME/.cache/last_screencast")"
wl-copy < "$(cat "$HOME/.cache/last_screencast")"
exit 0
fi
mkdir -p "$HOME/videos/screencasts/"
screencast_file="$HOME/videos/screencasts/$(date +%s).mp4"
area="$(slurp)"
if [ "$area" = "selection cancelled" ]; then
exit 0
fi
echo "$screencast_file" > "$HOME/.cache/last_screencast"
if [ "$1" = "audio" ]; then
wf-recorder -g "$area" --file="$screencast_file" --audio
else
wf-recorder -g "$area" --file="$screencast_file"
fi
'';
};
services.fnott = {
enable = true;
configFile = "/home/hu/.config/fnott/fnott.conf.ini";
};
home.file."/home/hu/.config/fnott/fnott.conf.ini" = {
text = ''
title-font=Go Mono Nerd Font
body-font=Go Mono Nerd Font
background=111111ff
title-color=888888ff
body-color=888888ff
summary-color=888888ff
default-timeout=10
'';
};
};
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
# You could theoretically, like I did for a while, maintain this file
# to manage your Firefox and waste your time on this or you could just use
# Firefox accounts and become a functioning member of society. This file is
# now only a starting point and will not be kept up to date with my setup.
{
environment.persistence."/nix/persist".users.hu.directories = [
@ -19,8 +24,8 @@
DisableTelemetry = true;
DisablePocket = true;
DisableFirefoxStudies = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxAccounts = false;
DisableAccounts = false;
DontCheckDefaultBrowser = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
@ -34,23 +39,18 @@
Remove = [ "Bing" "Google" "DuckDuckGo" "Wikipedia (en)" ];
};
ExtensionSettings = {
"wikipedia@search.mozilla.org" = {
installation_mode = "blocked";
# https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265/17
ExtensionSettings = with builtins;
let extension = shortId: uuid: {
name = uuid;
value = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_installed";
};
};
"google@search.mozilla.org" = {
installation_mode = "blocked";
};
"bing@search.mozilla.org" = {
installation_mode = "blocked";
};
"ddg@search.mozilla.org" = {
installation_mode = "blocked";
};
};
in listToAttrs [
(extension "ublock-origin" "uBlock0@raymondhill.net")
];
"3rdparty".Extensions = {
"uBlock0@raymondhill.net".adminSettings = {
@ -62,75 +62,16 @@
};
selectedFilterLists = [
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt"
"user-filters"
"ublock-filters"
"ublock-badware"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"easylist"
"adguard-generic"
"adguard-mobile"
"easyprivacy"
"adguard-spyware"
"adguard-spyware-url"
"block-lan"
"urlhaus-1"
"curben-phishing"
"plowe-0"
"dpollock-0"
"fanboy-cookiemonster"
"ublock-cookies-easylist"
"adguard-cookies"
"ublock-cookies-adguard"
"fanboy-social"
"adguard-social"
"fanboy-thirdparty_social"
"easylist-chat"
"easylist-newsletters"
"easylist-notifications"
"easylist-annoyances"
"adguard-mobile-app-banners"
"adguard-other-annoyances"
"adguard-popup-overlays"
"adguard-widgets"
"ublock-annoyances"
"ALB-0"
"BGR-0"
"CHN-0"
"CZE-0"
"DEU-0"
"EST-0"
"ara-0"
"spa-1"
"spa-0"
"FIN-0"
"FRA-0"
"GRC-0"
"HRV-0"
"HUN-0"
"IDN-0"
"ISR-0"
"IND-0"
"IRN-0"
"ISL-0"
"ITA-0"
"JPN-1"
"KOR-1"
"LTU-0"
"LVA-0"
"MKD-0"
"NLD-0"
"NOR-0"
"POL-0"
"POL-2"
"ROU-1"
"RUS-0"
"SWE-1"
"SVN-0"
"THA-0"
"TUR-0"
"VIE-1"
"user-filters" "ublock-filters" "ublock-badware" "ublock-privacy" "ublock-quick-fixes"
"ublock-unbreak" "easylist" "adguard-generic" "adguard-mobile" "easyprivacy" "adguard-spyware"
"adguard-spyware-url" "block-lan" "urlhaus-1" "curben-phishing" "plowe-0" "dpollock-0" "fanboy-cookiemonster"
"ublock-cookies-easylist" "adguard-cookies" "ublock-cookies-adguard" "fanboy-social" "adguard-social"
"fanboy-thirdparty_social" "easylist-chat" "easylist-newsletters" "easylist-notifications"
"easylist-annoyances" "adguard-mobile-app-banners" "adguard-other-annoyances" "adguard-popup-overlays"
"adguard-widgets" "ublock-annoyances" "ALB-0" "BGR-0" "CHN-0" "CZE-0" "DEU-0" "EST-0" "ara-0" "spa-1"
"spa-0" "FIN-0" "FRA-0" "GRC-0" "HRV-0" "HUN-0" "IDN-0" "ISR-0" "IND-0" "IRN-0" "ISL-0" "ITA-0"
"JPN-1" "KOR-1" "LTU-0" "LVA-0" "MKD-0" "NLD-0" "NOR-0" "POL-0" "POL-2" "ROU-1" "RUS-0" "SWE-1"
"SVN-0" "THA-0" "TUR-0" "VIE-1"
];
};
};
@ -139,10 +80,23 @@
profiles.shaga = {
isDefault = true;
search = {
force = true;
default = "Gruble";
order = [ "Gruble" "Nix Packages" "Nix Options" "Home-manager options" ];
force = false;
default = "Kagi";
order = [ "Kagi" "Gruble" "Nix Packages" "Nix Options" "Home-manager options" ];
engines = {
"Kagi" = {
urls = [
{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}
];
iconUpdateURL = "https://kagi.com/favicon.ico";
updateInterval = 7 * 24 * 60 * 60 * 1000; # Weekly
definedAliases = [ "@k" ];
};
"Gruble" = {
urls = [
{
@ -197,14 +151,6 @@
};
};
extensions = with config.nur.repos.rycee.firefox-addons; [
ublock-origin
image-search-options
bitwarden
translate-web-pages
tampermonkey
];
settings = {
"browser.urlbar.quicksuggest.contextualOptIn.topPosition" = false;
"extensions.postDownloadThirdPartyPrompt" = false;
@ -250,10 +196,10 @@
"network.connectivity-service.enabled" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.urlbar.speculativeConnect.enabled" = false;
"browser.search.suggest.enabled" = false;
"browser.search.suggest.enabled" = true;
"browser.urlbar.suggest.quicksuggest.nonsponsored" = false;
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
"browser.urlbar.suggest.searches" = false;
"browser.urlbar.suggest.searches" = true;
"browser.urlbar.suggest.bookmark" = false;
"browser.urlbar.suggest.addons" = false;
"browser.urlbar.suggest.calculator" = false;
@ -318,93 +264,6 @@
"browser.urlbar.showSearchTerms.enabled" = false;
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = "";
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines" = "";
# https://github.com/elFarto/nvidia-vaapi-driver?tab=readme-ov-file#firefox
"media.ffmpeg.vaapi.enabled" = true;
"media.rdd-ffmpeg.enabled" = true;
"media.av1.enabled" = false;
# Options for the firefox-ui-fix using Photon
# https://github.com/black7375/Firefox-UI-Fix/blob/master/user.js
"userChrome.tab.connect_to_window" = true;
"userChrome.tab.color_like_toolbar" = true;
"userChrome.tab.lepton_like_padding" = false;
"userChrome.tab.photon_like_padding" = true;
"userChrome.tab.dynamic_separator" = false;
"userChrome.tab.static_separator" = true;
"userChrome.tab.static_separator.selected_accent" = false;
"userChrome.tab.newtab_button_like_tab" = false;
"userChrome.tab.newtab_button_smaller" = true;
"userChrome.tab.newtab_button_proton" = false;
"userChrome.icon.panel_full" = false;
"userChrome.icon.panel_photon" = true;
"userChrome.icon.panel_sparse" = false;
"userChrome.tab.box_shadow" = false;
"userChrome.tab.bottom_rounded_corner" = false;
"userChrome.tab.photon_like_contextline" = true;
"userChrome.rounding.square_tab" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"svg.context-properties.content.enabled" = true;
"browser.compactmode.show" = true;
"browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar" = false;
"layout.css.has-selector.enabled" = true;
"userChrome.compatibility.theme" = true;
"userChrome.compatibility.os" = true;
"userChrome.theme.built_in_contrast" = true;
"userChrome.theme.system_default" = true;
"userChrome.theme.proton_color" = true;
"userChrome.theme.proton_chrome" = true;
"userChrome.theme.fully_color" = true;
"userChrome.theme.fully_dark" = true;
"userChrome.decoration.cursor" = true;
"userChrome.decoration.field_border" = true;
"userChrome.decoration.download_panel" = true;
"userChrome.decoration.animate" = true;
"userChrome.padding.tabbar_width" = true;
"userChrome.padding.tabbar_height" = true;
"userChrome.padding.toolbar_button" = true;
"userChrome.padding.navbar_width" = true;
"userChrome.padding.urlbar" = true;
"userChrome.padding.bookmarkbar" = true;
"userChrome.padding.infobar" = true;
"userChrome.padding.menu" = true;
"userChrome.padding.bookmark_menu" = true;
"userChrome.padding.global_menubar" = true;
"userChrome.padding.panel" = true;
"userChrome.padding.popup_panel" = true;
"userChrome.tab.multi_selected" = true;
"userChrome.tab.unloaded" = true;
"userChrome.tab.letters_cleary" = true;
"userChrome.tab.close_button_at_hover" = true;
"userChrome.tab.sound_hide_label" = true;
"userChrome.tab.sound_with_favicons" = true;
"userChrome.tab.pip" = true;
"userChrome.tab.container" = true;
"userChrome.tab.crashed" = true;
"userChrome.fullscreen.overlap" = true;
"userChrome.fullscreen.show_bookmarkbar" = true;
"userChrome.icon.library" = true;
"userChrome.icon.panel" = true;
"userChrome.icon.menu" = true;
"userChrome.icon.context_menu" = true;
"userChrome.icon.global_menu" = true;
"userChrome.icon.global_menubar" = true;
"userChrome.icon.1-25px_stroke" = true;
"userContent.player.ui" = true;
"userContent.player.icon" = true;
"userContent.player.noaudio" = true;
"userContent.player.size" = true;
"userContent.player.click_to_play" = true;
"userContent.player.animate" = true;
"userContent.newTab.full_icon" = true;
"userContent.newTab.animate" = true;
"userContent.newTab.pocket_to_last" = true;
"userContent.newTab.searchbar" = true;
"userContent.page.field_border" = true;
"userContent.page.illustration" = true;
"userContent.page.proton_color" = true;
"userContent.page.dark_mode" = true;
"userContent.page.proton" = true;
};
};
};

View file

@ -6,7 +6,7 @@
enable = true;
settings = {
main = {
pad = "6x6 center";
pad = "2x2 center";
font = "Go Mono Nerd Font:size=12";
};