Merge remote-tracking branch 'ni/master'
This commit is contained in:
commit
62bd490d1e
@ -1,5 +1,6 @@
|
|||||||
with import ../../lib;
|
with import ../../lib;
|
||||||
{ config, ... }: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
|
||||||
hostDefaults = hostName: host: flip recursiveUpdate host ({
|
hostDefaults = hostName: host: flip recursiveUpdate host ({
|
||||||
ci = false;
|
ci = false;
|
||||||
@ -13,62 +14,15 @@ with import ../../lib;
|
|||||||
(krebs.genipv6 "wiregrill" "external" { inherit hostName; }).address;
|
(krebs.genipv6 "wiregrill" "external" { inherit hostName; }).address;
|
||||||
});
|
});
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
hosts = mapAttrs hostDefaults {
|
hosts = mapAttrs hostDefaults {
|
||||||
pepe = {
|
|
||||||
owner = config.krebs.users.palo;
|
|
||||||
nets = {
|
|
||||||
retiolum = {
|
|
||||||
ip4.addr = "10.243.23.1";
|
|
||||||
tinc.port = 720;
|
|
||||||
aliases = [ "pepe.r" ];
|
|
||||||
tinc.pubkey = builtins.readFile ./retiolum.pub;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
schasch = {
|
|
||||||
owner = config.krebs.users.palo;
|
|
||||||
nets = {
|
|
||||||
retiolum = {
|
|
||||||
ip4.addr = "10.243.23.2";
|
|
||||||
tinc.port = 720;
|
|
||||||
aliases = [ "schasch.r" ];
|
|
||||||
tinc.pubkey = builtins.readFile ./retiolum.pub;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
syncthing.id = "FLY7DHI-TJLEQBJ-JZNC4YV-NBX53Z2-ZBRWADL-BKSFXYZ-L4FMDVH-MOSEVAQ";
|
|
||||||
};
|
|
||||||
sterni = {
|
sterni = {
|
||||||
owner = config.krebs.users.palo;
|
owner = config.krebs.users.palo;
|
||||||
nets = {
|
nets = {
|
||||||
retiolum = {
|
retiolum = {
|
||||||
ip4.addr = "10.243.23.3";
|
|
||||||
tinc.port = 720;
|
tinc.port = 720;
|
||||||
aliases = [
|
aliases = [ "sterni.r" ];
|
||||||
"sterni.r"
|
|
||||||
];
|
|
||||||
tinc.pubkey = builtins.readFile ./retiolum.pub;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
workhorse = {
|
|
||||||
owner = config.krebs.users.palo;
|
|
||||||
nets = {
|
|
||||||
retiolum = {
|
|
||||||
ip4.addr = "10.243.23.5";
|
|
||||||
tinc.port = 720;
|
|
||||||
aliases = [ "workhorse.r" ];
|
|
||||||
tinc.pubkey = builtins.readFile ./retiolum.pub;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
workout = {
|
|
||||||
owner = config.krebs.users.palo;
|
|
||||||
nets = {
|
|
||||||
retiolum = {
|
|
||||||
ip4.addr = "10.243.23.4";
|
|
||||||
tinc.port = 720;
|
|
||||||
aliases = [ "workout.r" ];
|
|
||||||
tinc.pubkey = builtins.readFile ./retiolum.pub;
|
tinc.pubkey = builtins.readFile ./retiolum.pub;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
1
kartei/tv/wiregrill/ru.pub
Normal file
1
kartei/tv/wiregrill/ru.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
+3GdhwFYmBr46bBwyqrY3UH9fU1b8c2Vqmx9JTY4syU=
|
@ -26,10 +26,7 @@ with import <stockholm/lib>;
|
|||||||
Port = ${toString tinc.config.host.nets.${netname}.tinc.port}
|
Port = ${toString tinc.config.host.nets.${netname}.tinc.port}
|
||||||
${tinc.config.extraConfig}
|
${tinc.config.extraConfig}
|
||||||
'';
|
'';
|
||||||
"tinc-up" = pkgs.writeDash "${netname}-tinc-up" ''
|
"tinc-up" = pkgs.writeDash "${netname}-tinc-up" tinc.config.tincUp;
|
||||||
${tinc.config.iproutePackage}/sbin/ip link set ${netname} up
|
|
||||||
${tinc.config.tincUp}
|
|
||||||
'';
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -60,7 +57,8 @@ with import <stockholm/lib>;
|
|||||||
default = let
|
default = let
|
||||||
net = tinc.config.host.nets.${netname};
|
net = tinc.config.host.nets.${netname};
|
||||||
iproute = tinc.config.iproutePackage;
|
iproute = tinc.config.iproutePackage;
|
||||||
in ''
|
in /* sh */ ''
|
||||||
|
${tinc.config.iproutePackage}/sbin/ip link set ${netname} up
|
||||||
${optionalString (net.ip4 != null) /* sh */ ''
|
${optionalString (net.ip4 != null) /* sh */ ''
|
||||||
${iproute}/sbin/ip -4 addr add ${net.ip4.addr} dev ${netname}
|
${iproute}/sbin/ip -4 addr add ${net.ip4.addr} dev ${netname}
|
||||||
${iproute}/sbin/ip -4 route add ${net.ip4.prefix} dev ${netname}
|
${iproute}/sbin/ip -4 route add ${net.ip4.prefix} dev ${netname}
|
||||||
@ -69,14 +67,13 @@ with import <stockholm/lib>;
|
|||||||
${iproute}/sbin/ip -6 addr add ${net.ip6.addr} dev ${netname}
|
${iproute}/sbin/ip -6 addr add ${net.ip6.addr} dev ${netname}
|
||||||
${iproute}/sbin/ip -6 route add ${net.ip6.prefix} dev ${netname}
|
${iproute}/sbin/ip -6 route add ${net.ip6.prefix} dev ${netname}
|
||||||
''}
|
''}
|
||||||
${tinc.config.tincUpExtra}
|
|
||||||
'';
|
'';
|
||||||
defaultText = ''
|
defaultText = /* sh */ ''
|
||||||
ip -4 addr add ‹net.ip4.addr› dev ${netname}
|
ip link set ‹netname› up
|
||||||
ip -4 route add ‹net.ip4.prefix› dev ${netname}
|
ip -4 addr add ‹net.ip4.addr› dev ‹netname›
|
||||||
ip -6 addr add ‹net.ip6.addr› dev ${netname}
|
ip -4 route add ‹net.ip4.prefix› dev ‹netname›
|
||||||
ip -6 route add ‹net.ip6.prefix› dev ${netname}
|
ip -6 addr add ‹net.ip6.addr› dev ‹netname›
|
||||||
${tinc.config.tincUpExtra}
|
ip -6 route add ‹net.ip6.prefix› dev ‹netname›
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
tinc-up script to be used. Defaults to setting the
|
tinc-up script to be used. Defaults to setting the
|
||||||
@ -85,11 +82,6 @@ with import <stockholm/lib>;
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
tincUpExtra = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
tincPackage = mkOption {
|
tincPackage = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.tinc_pre;
|
default = pkgs.tinc_pre;
|
||||||
@ -128,9 +120,9 @@ with import <stockholm/lib>;
|
|||||||
default =
|
default =
|
||||||
pkgs.write "${tinc.config.netname}-tinc-hosts"
|
pkgs.write "${tinc.config.netname}-tinc-hosts"
|
||||||
(mapAttrs'
|
(mapAttrs'
|
||||||
(_: host: (nameValuePair "/${host.name}" {
|
(_: host: nameValuePair "/${host.name}" {
|
||||||
text = host.nets.${tinc.config.netname}.tinc.config;
|
text = host.nets.${tinc.config.netname}.tinc.config;
|
||||||
}))
|
})
|
||||||
tinc.config.hosts);
|
tinc.config.hosts);
|
||||||
defaultText = "‹netname›-tinc-hosts";
|
defaultText = "‹netname›-tinc-hosts";
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -9,20 +9,6 @@ self: super: {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
flameshot = super.flameshot.overrideAttrs (old: rec {
|
|
||||||
name = "flameshot-${version}";
|
|
||||||
version = "0.10.2";
|
|
||||||
src = self.fetchFromGitHub {
|
|
||||||
owner = "flameshot-org";
|
|
||||||
repo = "flameshot";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "sha256-rZUiaS32C77tFJmEkw/9MGbVTVscb6LOCyWaWO5FyR4=";
|
|
||||||
};
|
|
||||||
patches = old.patches or [] ++ [
|
|
||||||
./flameshot/flameshot_imgur_0.10.2.patch
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
# https://github.com/proot-me/PRoot/issues/106
|
# https://github.com/proot-me/PRoot/issues/106
|
||||||
proot = self.writeDashBin "proot" ''
|
proot = self.writeDashBin "proot" ''
|
||||||
export PROOT_NO_SECCOMP=1
|
export PROOT_NO_SECCOMP=1
|
||||||
|
@ -8,7 +8,7 @@ writeDashBin "q-power_supply" ''
|
|||||||
s/^\([A-Z_]\+=[0-9A-Za-z_-]*\)$/export \1/p
|
s/^\([A-Z_]\+=[0-9A-Za-z_-]*\)$/export \1/p
|
||||||
' $uevent)"
|
' $uevent)"
|
||||||
case $POWER_SUPPLY_NAME in
|
case $POWER_SUPPLY_NAME in
|
||||||
AC)
|
AC|Mains)
|
||||||
exit # not battery
|
exit # not battery
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -24,24 +24,41 @@ writeDashBin "q-power_supply" ''
|
|||||||
return sprintf("%dh%dm", h, m)
|
return sprintf("%dh%dm", h, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_bar(n, r, t1, t2, t_col) {
|
function print_bar(r) {
|
||||||
t1 = int(r * n)
|
return \
|
||||||
t2 = n - t1
|
(r >= .1 ? bar_gradient[0] : bar_background) "■" \
|
||||||
if (r >= .42) t_col = "1;32"
|
(r >= .2 ? bar_gradient[1] : bar_background) "■" \
|
||||||
else if (r >= 23) t_col = "1;33"
|
(r >= .3 ? bar_gradient[2] : bar_background) "■" \
|
||||||
else if (r >= 11) t_col = "1;31"
|
(r >= .4 ? bar_gradient[3] : bar_background) "■" \
|
||||||
else t_col = "5;1;31"
|
(r >= .5 ? bar_gradient[4] : bar_background) "■" \
|
||||||
return sgr(t_col) strdup("■", t1) sgr(";30") strdup("■", t2) sgr()
|
(r >= .6 ? bar_gradient[5] : bar_background) "■" \
|
||||||
|
(r >= .7 ? bar_gradient[6] : bar_background) "■" \
|
||||||
|
(r >= .8 ? bar_gradient[7] : bar_background) "■" \
|
||||||
|
(r >= .9 ? bar_gradient[8] : bar_background) "■" \
|
||||||
|
(r >= 1 ? bar_gradient[9] : bar_background) "■" \
|
||||||
|
sgr()
|
||||||
|
}
|
||||||
|
|
||||||
|
function rgb(r, g, b) {
|
||||||
|
return sgr("38;2;" r ";" g ";" b)
|
||||||
}
|
}
|
||||||
|
|
||||||
function sgr(p) {
|
function sgr(p) {
|
||||||
return "\x1b[" p "m"
|
return "\x1b[" p "m"
|
||||||
}
|
}
|
||||||
|
|
||||||
function strdup(s,n,t) {
|
BEGIN {
|
||||||
t = sprintf("%"n"s","")
|
bar_gradient[0] = rgb(216, 100, 83)
|
||||||
gsub(/ /,s,t)
|
bar_gradient[1] = rgb(210, 113, 72)
|
||||||
return t
|
bar_gradient[2] = rgb(201, 125, 65)
|
||||||
|
bar_gradient[3] = rgb(190, 137, 63)
|
||||||
|
bar_gradient[4] = rgb(178, 148, 67)
|
||||||
|
bar_gradient[5] = rgb(166, 158, 75)
|
||||||
|
bar_gradient[6] = rgb(153, 167, 88)
|
||||||
|
bar_gradient[7] = rgb(140, 174, 104)
|
||||||
|
bar_gradient[8] = rgb(127, 181, 122)
|
||||||
|
bar_gradient[9] = rgb(116, 187, 141)
|
||||||
|
bar_background = rgb( 64, 64, 64)
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
@ -101,7 +118,7 @@ writeDashBin "q-power_supply" ''
|
|||||||
charge_ratio = charge_now / charge_full
|
charge_ratio = charge_now / charge_full
|
||||||
|
|
||||||
out = out name
|
out = out name
|
||||||
out = out sprintf(" %s", print_bar(10, charge_ratio))
|
out = out sprintf(" %s", print_bar(charge_ratio))
|
||||||
out = out sprintf(" %d%", charge_ratio * 100)
|
out = out sprintf(" %d%", charge_ratio * 100)
|
||||||
out = out sprintf(" %.2f%s", charge_now, charge_unit)
|
out = out sprintf(" %.2f%s", charge_now, charge_unit)
|
||||||
if (current_now != 0) {
|
if (current_now != 0) {
|
||||||
|
@ -1,7 +1,21 @@
|
|||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
../smartd.nix
|
||||||
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ];
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ];
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [
|
||||||
|
"amd-pstate"
|
||||||
|
"kvm-amd"
|
||||||
|
];
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
boot.kernelParams = [
|
||||||
|
"amd_pstate=passive"
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = true;
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
@ -25,6 +39,10 @@
|
|||||||
|
|
||||||
services.illum.enable = true;
|
services.illum.enable = true;
|
||||||
|
|
||||||
|
services.logind.extraConfig = /* ini */ ''
|
||||||
|
HandlePowerKey=ignore
|
||||||
|
'';
|
||||||
|
|
||||||
tv.lidControl.enable = true;
|
tv.lidControl.enable = true;
|
||||||
|
|
||||||
tv.hw.screens.primary.width = 2560;
|
tv.hw.screens.primary.width = 2560;
|
||||||
|
@ -1,19 +1,8 @@
|
|||||||
|
with import ./lib;
|
||||||
{
|
{
|
||||||
imports = [
|
imports =
|
||||||
./charybdis
|
map
|
||||||
./dnsmasq.nix
|
(name: ./. + "/${name}")
|
||||||
./ejabberd
|
(attrNames
|
||||||
./focus.nix
|
(filterAttrs isNixDirEntry (readDir ./.)));
|
||||||
./hosts.nix
|
|
||||||
./hw.nix
|
|
||||||
./im.nix
|
|
||||||
./iptables.nix
|
|
||||||
./lidControl.nix
|
|
||||||
./org.freedesktop.machine1.host-shell.nix
|
|
||||||
./systemd.nix
|
|
||||||
./slock.nix
|
|
||||||
./x0vncserver.nix
|
|
||||||
./Xresources.nix
|
|
||||||
./wwan.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,7 @@ with import ./lib;
|
|||||||
|
|
||||||
interface=$(get-interface)
|
interface=$(get-interface)
|
||||||
|
|
||||||
|
ip addr flush "$interface"
|
||||||
ip link set dev "$interface" down
|
ip link set dev "$interface" down
|
||||||
uqmi --stop-network 0xFFFFFFFF --autoconnect
|
uqmi --stop-network 0xFFFFFFFF --autoconnect
|
||||||
uqmi --sync
|
uqmi --sync
|
||||||
|
15
tv/5pkgs/override/flameshot/default.nix
Normal file
15
tv/5pkgs/override/flameshot/default.nix
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
self: super:
|
||||||
|
|
||||||
|
super.flameshot.overrideAttrs (old: rec {
|
||||||
|
name = "flameshot-${version}";
|
||||||
|
version = "0.10.2";
|
||||||
|
src = self.fetchFromGitHub {
|
||||||
|
owner = "flameshot-org";
|
||||||
|
repo = "flameshot";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "sha256-rZUiaS32C77tFJmEkw/9MGbVTVscb6LOCyWaWO5FyR4=";
|
||||||
|
};
|
||||||
|
patches = old.patches or [] ++ [
|
||||||
|
./flameshot/flameshot_imgur_0.10.2.patch
|
||||||
|
];
|
||||||
|
})
|
20
tv/5pkgs/override/iosevka-tv-1.nix
Normal file
20
tv/5pkgs/override/iosevka-tv-1.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
self: super:
|
||||||
|
|
||||||
|
let
|
||||||
|
srcpkg = super.iosevka-tv-1;
|
||||||
|
binpkg = self.fetchzip {
|
||||||
|
inherit (srcpkg) pname version;
|
||||||
|
stripRoot = false;
|
||||||
|
hash = "sha256-QIuTS70vUQSvDDXjY4uI6SCcu1XT4HjvzpthvrNX4h0=";
|
||||||
|
urls = [
|
||||||
|
"https://c.krebsco.de/${srcpkg.name}.tar.gz"
|
||||||
|
"https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
if srcpkg.version == binpkg.version then
|
||||||
|
binpkg
|
||||||
|
|
||||||
|
else
|
||||||
|
srcpkg
|
20
tv/5pkgs/override/iosevka-tv-2.nix
Normal file
20
tv/5pkgs/override/iosevka-tv-2.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
self: super:
|
||||||
|
|
||||||
|
let
|
||||||
|
srcpkg = super.iosevka-tv-2;
|
||||||
|
binpkg = self.fetchzip {
|
||||||
|
inherit (srcpkg) pname version;
|
||||||
|
stripRoot = false;
|
||||||
|
hash = "sha256-PuIrW1ftYD5PW4du6gq1XpUM3v0potwmj+vAxJImF/A=";
|
||||||
|
urls = [
|
||||||
|
"https://c.krebsco.de/${srcpkg.name}.tar.gz"
|
||||||
|
"https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
if srcpkg.version == binpkg.version then
|
||||||
|
binpkg
|
||||||
|
|
||||||
|
else
|
||||||
|
srcpkg
|
@ -53,10 +53,10 @@ let
|
|||||||
window.dimensions.lines = 9;
|
window.dimensions.lines = 9;
|
||||||
};
|
};
|
||||||
variants.hidpi = {
|
variants.hidpi = {
|
||||||
font.normal.family = "iosevka-tv-1";
|
font.normal.family = "iosevka tv 2 Light";
|
||||||
font.bold.family = "iosevka-tv-1";
|
font.italic.family = "iosevka tv 2 Light";
|
||||||
font.italic.family = "iosevka-tv-1";
|
font.bold.family = "iosevka tv 2 Medium";
|
||||||
font.bold_italic.family = "iosevka-tv-1";
|
font.bold_italic.family = "iosevka tv 2 Medium";
|
||||||
font.size = 5;
|
font.size = 5;
|
||||||
key_bindings = [
|
key_bindings = [
|
||||||
{ key = "Up"; mods = "Control"; action = "IncreaseFontSize"; }
|
{ key = "Up"; mods = "Control"; action = "IncreaseFontSize"; }
|
||||||
@ -104,7 +104,7 @@ let
|
|||||||
ref=$(! test -e "$HOME"/ref || ${pkgs.coreutils}/bin/cat "$HOME"/ref)
|
ref=$(! test -e "$HOME"/ref || ${pkgs.coreutils}/bin/cat "$HOME"/ref)
|
||||||
if test "$ref" != ${config-file}; then
|
if test "$ref" != ${config-file}; then
|
||||||
echo ${config-file} > "$HOME"/ref
|
echo ${config-file} > "$HOME"/ref
|
||||||
${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml
|
${pkgs.coreutils}/bin/install -m 644 ${config-file} "$HOME"/.alacritty.yml
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
pkgs.writeDashBin "ff" ''
|
pkgs.writeDashBin "ff" ''
|
||||||
|
case $TOUCHSCREEN in 1)
|
||||||
|
export MOZ_USE_XINPUT2=1
|
||||||
|
esac
|
||||||
exec ${pkgs.firefox}/bin/firefox "$@"
|
exec ${pkgs.firefox}/bin/firefox "$@"
|
||||||
''
|
''
|
||||||
|
@ -6,7 +6,7 @@ pkgs.writeDashBin "font-size-alacritty" ''
|
|||||||
|
|
||||||
set -efu
|
set -efu
|
||||||
|
|
||||||
min_size=8
|
min_size=5
|
||||||
|
|
||||||
op=''${1%%[0-9]*}
|
op=''${1%%[0-9]*}
|
||||||
op=''${op:-=}
|
op=''${op:-=}
|
@ -3,7 +3,7 @@
|
|||||||
pkgs.iosevka.override {
|
pkgs.iosevka.override {
|
||||||
# https://typeof.net/Iosevka/customizer
|
# https://typeof.net/Iosevka/customizer
|
||||||
privateBuildPlan = {
|
privateBuildPlan = {
|
||||||
family = "iosevka-tv-1";
|
family = "iosevka tv 1";
|
||||||
spacing = "term";
|
spacing = "term";
|
||||||
serifs = "sans";
|
serifs = "sans";
|
||||||
export-glyph-names = true;
|
export-glyph-names = true;
|
||||||
@ -14,5 +14,5 @@ pkgs.iosevka.override {
|
|||||||
widths.normal.menu = 5;
|
widths.normal.menu = 5;
|
||||||
widths.normal.css = "normal";
|
widths.normal.css = "normal";
|
||||||
};
|
};
|
||||||
set = "iosevka-tv-1";
|
set = "tv-1";
|
||||||
}
|
}
|
||||||
|
20
tv/5pkgs/simple/iosevka-tv-2.nix
Normal file
20
tv/5pkgs/simple/iosevka-tv-2.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
pkgs.iosevka.override {
|
||||||
|
# https://typeof.net/Iosevka/customizer
|
||||||
|
privateBuildPlan = {
|
||||||
|
family = "iosevka tv 2";
|
||||||
|
spacing = "term";
|
||||||
|
serifs = "sans";
|
||||||
|
export-glyph-names = true;
|
||||||
|
no-ligation = true;
|
||||||
|
no-cv-ss = false;
|
||||||
|
|
||||||
|
variants.inherits = "ss10";
|
||||||
|
|
||||||
|
widths.normal.shape = 600;
|
||||||
|
widths.normal.menu = 5;
|
||||||
|
widths.normal.css = "normal";
|
||||||
|
};
|
||||||
|
set = "tv-2";
|
||||||
|
}
|
11
tv/5pkgs/simple/libinput-tv.nix
Normal file
11
tv/5pkgs/simple/libinput-tv.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
pkgs.libinput.overrideAttrs (old: {
|
||||||
|
patches = old.patches or [] ++ [
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
name = "libinput-winmax2.patch";
|
||||||
|
url = "https://github.com/4z3/libinput/commit/2d0ff41.patch";
|
||||||
|
sha256 = "0ipsxzjf98g9w2m163gp49zl14wbxs84s0psdnvk7wfiivgcnm1f";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
})
|
@ -10,71 +10,44 @@ let
|
|||||||
hspace = 2;
|
hspace = 2;
|
||||||
|
|
||||||
# Return number of columns required to print n calenders side by side.
|
# Return number of columns required to print n calenders side by side.
|
||||||
need_width = n:
|
need_width = n: assert n >= 1; n * calwidth + (n - 1) * hspace;
|
||||||
assert n >= 1;
|
|
||||||
n * calwidth + (n - 1) * hspace;
|
|
||||||
|
|
||||||
pad = /* sh */ ''{
|
|
||||||
${pkgs.gnused}/bin/sed '
|
|
||||||
# rtrim
|
|
||||||
s/ *$//
|
|
||||||
|
|
||||||
# delete last empty line
|
|
||||||
''${/^$/d}
|
|
||||||
' \
|
|
||||||
| ${pkgs.gawk}/bin/awk '{printf "%-${toString calwidth}s\n", $0}' \
|
|
||||||
| ${pkgs.gnused}/bin/sed '
|
|
||||||
# colorize header
|
|
||||||
1,2s/.*/[38;5;238;1m&[39;22m/
|
|
||||||
|
|
||||||
# colorize week number
|
|
||||||
s/^[ 1-9][0-9]/[38;5;238;1m&[39;22m/
|
|
||||||
'
|
|
||||||
}'';
|
|
||||||
in /* sh */ ''
|
in /* sh */ ''
|
||||||
cols=$(${pkgs.ncurses}/bin/tput cols)
|
cols=$(${pkgs.ncurses}/bin/tput cols)
|
||||||
${pkgs.coreutils}/bin/paste \
|
if test $cols -ge ${toString (need_width 3)}; then
|
||||||
<(if test $cols -ge ${toString (need_width 3)}; then
|
${pkgs.utillinux}/bin/cal --color=always -mw3
|
||||||
${pkgs.utillinux}/bin/cal -mw \
|
elif test $cols -ge ${toString (need_width 2)}; then
|
||||||
$(${pkgs.coreutils}/bin/date +'%m %Y' -d 'last month') \
|
${pkgs.utillinux}/bin/cal --color=always -mw -n 2
|
||||||
| ${pad}
|
elif test $cols -ge ${toString (need_width 1)}; then
|
||||||
fi) \
|
${pkgs.utillinux}/bin/cal --color=always -mw1
|
||||||
<(if test $cols -ge ${toString (need_width 1)}; then
|
else
|
||||||
${pkgs.utillinux}/bin/cal -mw \
|
:
|
||||||
| ${pkgs.gnused}/bin/sed '
|
fi |
|
||||||
# colorize day of month
|
${pkgs.gnused}/bin/sed -r '
|
||||||
s/\(^\| \)'"$(${pkgs.coreutils}/bin/date +%e)"'\>/[31;1m&[39;22m/
|
# dim week numbers
|
||||||
' \
|
s/((^ *| )[ 1-5][0-9]( *)?)(([ 1-3][0-9])*)/[38;5;243m\1[m\4/g
|
||||||
| ${pad}
|
# dim month and day names
|
||||||
fi) \
|
s/^ *[A-Z].*/[38;5;243m&[m/
|
||||||
<(if test $cols -ge ${toString (need_width 2)}; then
|
# highlight current date
|
||||||
${pkgs.utillinux}/bin/cal -mw \
|
s/\[7m/[38;5;009;1m/
|
||||||
$(${pkgs.coreutils}/bin/date +'%m %Y' -d 'next month') \
|
s/\[27m/[m/
|
||||||
| ${pad}
|
|
||||||
fi) \
|
|
||||||
| ${pkgs.gnused}/bin/sed '
|
|
||||||
s/^\t//
|
|
||||||
s/\t$//
|
|
||||||
s/\t/${lpad hspace " " ""}/g
|
|
||||||
'
|
'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-isodate = /* sh */ ''
|
q-isodate = TZ: color: /* sh */ ''
|
||||||
|
TZ=${shell.escape TZ} \
|
||||||
${pkgs.coreutils}/bin/date \
|
${pkgs.coreutils}/bin/date \
|
||||||
'+[1m%Y-%m-%d[;30mT[;38;5;085m%H:%M[m:%S%:z'
|
'+[m%Y-%m-%d[38;5;243mT[;'${shell.escape color}'m%H:%M[38;5;243m:[m%S%:z'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
q-deudate = q-isodate "Europe/Berlin" "38;5;085";
|
||||||
|
|
||||||
# Singapore's red is #ED2E38
|
# Singapore's red is #ED2E38
|
||||||
q-sgtdate = /* sh */ ''
|
q-sgtdate = q-isodate "Asia/Singapore" "38;2;237;46;56";
|
||||||
TZ=Asia/Singapore \
|
|
||||||
${pkgs.coreutils}/bin/date \
|
|
||||||
'+[1m%Y-%m-%d[;30mT[;38;5;088m%H:%M[m:%S%:z'
|
|
||||||
'';
|
|
||||||
|
|
||||||
q-utcdate = /* sh */ ''
|
q-thadate = q-isodate "Asia/Bangkok" "38;5;226";
|
||||||
${pkgs.coreutils}/bin/date -u \
|
|
||||||
'+[1m%Y-%m-%d[;30mT[;38;5;065m%H:%M[m:%S%:z'
|
q-utcdate = q-isodate "UTC" "38;5;065";
|
||||||
'';
|
|
||||||
|
|
||||||
q-gitdir = /* sh */ ''
|
q-gitdir = /* sh */ ''
|
||||||
if test -d .git; then
|
if test -d .git; then
|
||||||
@ -106,31 +79,34 @@ let
|
|||||||
echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)"
|
echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-wireless = /* sh */ ''
|
q-net = /* sh */ ''
|
||||||
for dev in $(
|
for dev in $(
|
||||||
${pkgs.iw}/bin/iw dev \
|
${pkgs.iproute}/bin/ip a |
|
||||||
| ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p'
|
${pkgs.gnused}/bin/sed -rn 's/^[0-9]+: ([^:]+):.*/\1/p' |
|
||||||
|
${pkgs.gnugrep}/bin/grep -Ev '^(lo|retiolum|wiregrill)$'
|
||||||
|
# TODO wiregrill ping ni.w, retiolum ping ni.r
|
||||||
); do
|
); do
|
||||||
|
{
|
||||||
inet=$(${pkgs.iproute}/bin/ip addr show $dev \
|
inet=$(${pkgs.iproute}/bin/ip addr show $dev \
|
||||||
| ${pkgs.gnused}/bin/sed -n '
|
| ${pkgs.gnused}/bin/sed -n '
|
||||||
s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p
|
s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p
|
||||||
') \
|
')
|
||||||
|| unset inet
|
|
||||||
ssid=$(${pkgs.iw}/bin/iw dev $dev link \
|
ssid=$(${pkgs.iw}/bin/iw dev $dev link \
|
||||||
| ${pkgs.gnused}/bin/sed -n '
|
| ${pkgs.gnused}/bin/sed -n '
|
||||||
s/.*\tSSID: \(.*\)/\1/p
|
s/.*\tSSID: \(.*\)/\1/p
|
||||||
') \
|
')
|
||||||
|| unset ssid
|
latency=$(
|
||||||
echo "$dev''${inet+ $inet}''${ssid+ $ssid}"
|
/run/wrappers/bin/ping -W .25 -c 1 -I "$dev" ni.i 2>&1 |
|
||||||
|
${pkgs.gnused}/bin/sed -rn '
|
||||||
|
s/.*time=([0-9.]+).*/online ni=[38;5;085m\1[m/p
|
||||||
|
s/.*Network is unreachable.*/offline/p
|
||||||
|
s/.*100% packet loss.*/offline/p
|
||||||
|
'
|
||||||
|
)
|
||||||
|
echo "$dev''${inet:+ $inet}''${ssid:+ $ssid} $latency"
|
||||||
|
} &
|
||||||
done
|
done
|
||||||
'';
|
wait
|
||||||
|
|
||||||
q-online = /* sh */ ''
|
|
||||||
if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then
|
|
||||||
echo '[32;1monline[m'
|
|
||||||
else
|
|
||||||
echo offline
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-thermal_zone = /* sh */ ''
|
q-thermal_zone = /* sh */ ''
|
||||||
@ -173,14 +149,13 @@ pkgs.writeBashBin "q" ''
|
|||||||
export PATH=/var/empty
|
export PATH=/var/empty
|
||||||
${q-cal}
|
${q-cal}
|
||||||
${q-utcdate}
|
${q-utcdate}
|
||||||
${q-isodate}
|
${q-deudate}
|
||||||
${q-sgtdate}
|
${q-sgtdate}
|
||||||
(${q-gitdir}) &
|
(${q-gitdir}) &
|
||||||
(${q-intel_backlight}) &
|
(${q-intel_backlight}) &
|
||||||
${pkgs.q-power_supply}/bin/q-power_supply &
|
${pkgs.q-power_supply}/bin/q-power_supply &
|
||||||
(${q-virtualization}) &
|
(${q-virtualization}) &
|
||||||
(${q-wireless}) &
|
(${q-net}) &
|
||||||
(${q-online}) &
|
|
||||||
(${q-thermal_zone}) &
|
(${q-thermal_zone}) &
|
||||||
wait
|
wait
|
||||||
if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then
|
if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then
|
||||||
|
Loading…
Reference in New Issue
Block a user