Standardize networking, add more Librewolf configs, standardize synatxing for Waybar, generalize app usage
This commit is contained in:
parent
5ae5531455
commit
0b699858fc
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"nodes": {
|
||||
"blender-bin": {
|
||||
"blender": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
|
@ -442,7 +442,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"blender-bin": "blender-bin",
|
||||
"blender": "blender",
|
||||
"disko": "disko",
|
||||
"home-manager": "home-manager",
|
||||
"impermanence": "impermanence",
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
};
|
||||
|
||||
nur.url = "github:nix-community/NUR";
|
||||
blender-bin.url = "https://flakehub.com/f/edolstra/blender-bin/1.0.11.tar.gz";
|
||||
blender.url = "https://flakehub.com/f/edolstra/blender-bin/1.0.11.tar.gz";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
|
@ -38,7 +38,7 @@
|
|||
minecraft,
|
||||
home-manager,
|
||||
nur,
|
||||
blender-bin,
|
||||
blender,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -54,7 +54,7 @@
|
|||
minecraft
|
||||
home-manager
|
||||
nur
|
||||
blender-bin
|
||||
blender
|
||||
;
|
||||
};
|
||||
};
|
||||
|
@ -64,7 +64,7 @@
|
|||
inherit
|
||||
unstable
|
||||
nur
|
||||
blender-bin
|
||||
blender
|
||||
;
|
||||
};
|
||||
};
|
||||
|
|
4
hosts/extern/default.nix
vendored
4
hosts/extern/default.nix
vendored
|
@ -9,12 +9,8 @@
|
|||
../../modules/system
|
||||
];
|
||||
|
||||
system.wireless.enable = false;
|
||||
|
||||
system.wireguard.client.enable = true;
|
||||
networking.wireguard.interfaces.wgc.ips = [ "10.100.0.21/24" ];
|
||||
|
||||
boot.binfmt.emulatedSystems = [ "x86_64-linux" ];
|
||||
|
||||
networking.hostName = "extern";
|
||||
}
|
||||
|
|
2
hosts/extern/hardware/default.nix
vendored
2
hosts/extern/hardware/default.nix
vendored
|
@ -5,6 +5,6 @@
|
|||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
|
5
hosts/extern/modules/default.nix
vendored
5
hosts/extern/modules/default.nix
vendored
|
@ -1,4 +1,7 @@
|
|||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
imports = [
|
||||
(modulesPath + "/profiles/all-hardware.nix")
|
||||
#(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
networking = {
|
||||
firewall = {
|
||||
allowPing = false;
|
||||
extraInputRules = ''
|
||||
firewall.extraInputRules = ''
|
||||
ip saddr { ${config.ips.localSpan}.0/24, 10.100.0.0/24 } tcp dport 2049 accept comment "Accept NFS"
|
||||
ip saddr { ${config.ips.pc}, ${config.secrets.lunaIP}, ${config.secrets.cornIP} } tcp dport { 1935, 1945 } accept comment "Accept RTMP"
|
||||
'';
|
||||
};
|
||||
|
||||
# Nftables configuration only if server is enabled
|
||||
nftables.tables.forwarding = {
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
|
||||
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
|
||||
};
|
||||
"/prev" = {
|
||||
mountpoint = "/prev";
|
||||
|
|
|
@ -129,6 +129,10 @@ in {
|
|||
name = "Kernel";
|
||||
url = "https://www.kernel.org";
|
||||
}
|
||||
{
|
||||
name = "Github";
|
||||
url = "https://github.com";
|
||||
}
|
||||
];
|
||||
commonSettings = {
|
||||
"general.autoScroll" = true;
|
||||
|
@ -234,6 +238,7 @@ in {
|
|||
"datareporting.healthreport.uploadEnabled" = false;
|
||||
"svg.context-properties.content.enabled" = true;
|
||||
"services.sync.engine.addresses.available" = false;
|
||||
"full-screen-api.ignore-widgets" = true;
|
||||
"device.sensors.motion.enabled" = false;
|
||||
"security.OCSP.require" = true;
|
||||
"gnomeTheme.hideSingleTab" = true;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{ pkgs, config, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
vesktop
|
||||
fractal
|
||||
telegram-desktop
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{ pkgs, blender-bin, ... }:
|
||||
{ pkgs, blender, ... }:
|
||||
{
|
||||
imports = [ ./obs ];
|
||||
|
||||
nixpkgs.overlays = [ blender.overlays.default ];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
krita
|
||||
audacity
|
||||
blender_4_3
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [ blender-bin.overlays.default ];
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
{ command = "librewolf -P Misc --name=MiscBrowser"; }
|
||||
{ command = "vesktop"; }
|
||||
{ command = "fractal"; }
|
||||
{ command = "telegram-desktop"; }
|
||||
{ command = "thunderbird"; }
|
||||
];
|
||||
};
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
libnotify
|
||||
grim
|
||||
slurp
|
||||
swappy
|
||||
lm_sensors
|
||||
wl-clipboard
|
||||
wdisplays
|
||||
jq
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.writeScriptBin "swayshot" ''
|
||||
# Swappy
|
||||
handle_swappy() {
|
||||
# Create an imv window to act as a static screen
|
||||
grim -t jpeg -q 90 - | imv -w "GlobalShot" - & imv_pid=$!
|
||||
|
@ -15,11 +14,10 @@
|
|||
kill $imv_pid
|
||||
|
||||
# Copy the screenshot to the clipboard and clear the temp
|
||||
swappy -f - < "$temp_file"
|
||||
${pkgs.swappy}/bin/swappy -f - < "$temp_file"
|
||||
rm "$temp_file"
|
||||
}
|
||||
|
||||
# Screen
|
||||
handle_screen() {
|
||||
temp_file=$(mktemp -u).png
|
||||
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') "$temp_file"
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
];
|
||||
};
|
||||
assigns = {
|
||||
# Broconfig.wsers
|
||||
# Browsers
|
||||
"${config.ws.w1}" = [{ app_id = "MainBrowser"; }];
|
||||
"${config.ws.w1a}" = [{ app_id = "AltBrowser"; }];
|
||||
|
||||
|
@ -120,7 +120,10 @@
|
|||
{ app_id = "vesktop"; }
|
||||
{ class = "vesktop"; }
|
||||
];
|
||||
"${config.ws.w8}" = [{ app_id = "org.gnome.Fractal"; }];
|
||||
"${config.ws.w8}" = [
|
||||
{ app_id = "org.gnome.Fractal"; }
|
||||
{ app_id = "org.telegram.desktop"; }
|
||||
];
|
||||
"${config.ws.w9}" = [{ app_id = "thunderbird"; }];
|
||||
|
||||
# Etc
|
||||
|
|
|
@ -32,7 +32,10 @@
|
|||
on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
on-click-middle = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%";
|
||||
on-click-right = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 60%";
|
||||
ignored-sinks = ["Easy Effects Sink" "USB FS AUDIO Analog Stereo"];
|
||||
ignored-sinks = [
|
||||
"Easy Effects Sink"
|
||||
"USB FS AUDIO Analog Stereo"
|
||||
];
|
||||
};
|
||||
|
||||
# CPU, Ram and Vram
|
||||
|
@ -43,6 +46,7 @@
|
|||
ramModule = {
|
||||
format = " {used}G";
|
||||
tooltip = false;
|
||||
interval = 3;
|
||||
};
|
||||
vramModule = {
|
||||
exec = pkgs.writeScript "vramScript" ''
|
||||
|
@ -56,7 +60,7 @@
|
|||
|
||||
elif [ "$gpu_driver" == "amdgpu" ]; then
|
||||
vram_usage_mb=$(echo "$(cat /sys/class/drm/card0/device/mem_info_vram_used || cat /sys/class/drm/card1/device/mem_info_vram_used) / 1024 / 1024" | bc)
|
||||
temperature=$(sensors | grep 'edge' | awk '{print $2}' | sed 's/[^0-9.-]//g')
|
||||
temperature=$(${pkgs.lm_sensors}/bin/sensors | grep 'edge' | awk '{print $2}' | sed 's/[^0-9.-]//g')
|
||||
fi
|
||||
|
||||
# Check if VRAM usage is under 1GB
|
||||
|
@ -80,7 +84,6 @@
|
|||
# Clocks
|
||||
longClockModule = {
|
||||
exec = pkgs.writeScript "longClock" ''
|
||||
# Long clock format, with a numeric date and military time tooltip
|
||||
time=$(date +'%a %b %d %l:%M:%S%p' | tr -s ' ')
|
||||
date=$(date "+%Y-%m-%d")
|
||||
echo "{\"text\":\" $time\",\"tooltip\":\"$date\"}"
|
||||
|
@ -99,9 +102,7 @@
|
|||
};
|
||||
|
||||
# Tray, gamemode, bluetooth, and network tray modules
|
||||
trayModule = {
|
||||
spacing = 5;
|
||||
};
|
||||
trayModule.spacing = 5;
|
||||
networkModule = {
|
||||
format-ethernet = "";
|
||||
format-wifi = "";
|
||||
|
@ -140,37 +141,11 @@
|
|||
|
||||
# Special per-bar modules
|
||||
mediaModule = {
|
||||
exec-if = "mpc status | grep -q '^\\[playing\\] \\|^\\[paused\\]'";
|
||||
exec = pkgs.writeScript "mpvMetadata" ''
|
||||
get_metadata() {
|
||||
mpc | head -n 1
|
||||
}
|
||||
|
||||
truncate_string() {
|
||||
local str="$1"
|
||||
local max_length=30
|
||||
if [ $(expr length "$str") -gt $max_length ]; then
|
||||
str=$(expr substr "$str" 1 $max_length)...
|
||||
fi
|
||||
echo "$str"
|
||||
}
|
||||
|
||||
if mpc status 2>/dev/null | grep -q playing; then
|
||||
song_name=$(get_metadata | awk -F ' - ' '{print $2}')
|
||||
if [ -z "$song_name" ]; then
|
||||
song_name=$(get_metadata)
|
||||
fi
|
||||
echo "{\"text\":\"$(truncate_string " $song_name")\",\"tooltip\":\"$(get_metadata)\"}"
|
||||
elif mpc status 2>/dev/null | grep -q paused; then
|
||||
artist_name=$(get_metadata | awk -F ' - ' '{print $1}')
|
||||
if [ -z "$artist_name" ]; then
|
||||
artist_name=$(get_metadata)
|
||||
fi
|
||||
echo "{\"text\":\"$(truncate_string " $artist_name")\",\"tooltip\":\"$(get_metadata)\",\"class\":\"paused\"}"
|
||||
fi
|
||||
'';
|
||||
format = "{}";
|
||||
return-type = "json";
|
||||
format = " {title}";
|
||||
format-paused = " {artist}";
|
||||
format-stopped = "";
|
||||
format-disconnected = "";
|
||||
tooltip-format = "{artist} - {title}";
|
||||
interval = 2;
|
||||
max-length = 30;
|
||||
on-click = "mpc toggle";
|
||||
|
@ -196,33 +171,11 @@
|
|||
on-click = "makotoggle";
|
||||
};
|
||||
weatherModule = {
|
||||
exec = let
|
||||
weatherConf = pkgs.writeText "weather.jsonc" ''
|
||||
{
|
||||
"logo": {
|
||||
"source": "none"
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "weather",
|
||||
"outputFormat": "%0A%t%0A%C%0A%l"
|
||||
}
|
||||
]
|
||||
}
|
||||
'';
|
||||
in pkgs.writeScript "weatherScript" ''
|
||||
# Fetch weather data
|
||||
fetch=$(fastfetch -c ${weatherConf} | sed 's/[[:space:]]*$//')
|
||||
temp=$(echo "$fetch" | sed -n '2s/^\+//p')
|
||||
condition=$(echo "$fetch" | sed -n '3p')
|
||||
location=$(echo "$fetch" | sed -n '4p')
|
||||
|
||||
# Display weather emoji and temperature
|
||||
echo {\"text\":\" $temp\",\"tooltip\":\"$location: $condition\"}
|
||||
'';
|
||||
format = "<span font_size='11pt'>{}</span>";
|
||||
exec = "${pkgs.wttrbar}/bin/wttrbar --ampm";
|
||||
format = "{}°";
|
||||
tooltip = true;
|
||||
return-type = "json";
|
||||
interval = 150;
|
||||
interval = 3600;
|
||||
};
|
||||
|
||||
# Laptop modules
|
||||
|
@ -247,8 +200,14 @@
|
|||
name = "bar1";
|
||||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ config.displays.d1 "VGA-1" ];
|
||||
modules-left = ["sway/workspaces" "sway/window"];
|
||||
output = [
|
||||
config.displays.d1
|
||||
"VGA-1"
|
||||
];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"cpu"
|
||||
|
@ -279,10 +238,13 @@
|
|||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ config.displays.d2 ];
|
||||
modules-left = ["sway/workspaces" "sway/window"];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"custom/media"
|
||||
"mpd"
|
||||
"custom/notifs"
|
||||
"cpu"
|
||||
"memory"
|
||||
|
@ -292,7 +254,7 @@
|
|||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"custom/media" = mediaModule;
|
||||
"mpd" = mediaModule;
|
||||
"custom/notifs" = notificationModule;
|
||||
"cpu" = cpuModule;
|
||||
"memory" = ramModule;
|
||||
|
@ -304,7 +266,10 @@
|
|||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ config.displays.d3 ];
|
||||
modules-left = ["sway/workspaces" "sway/window"];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"custom/weather"
|
||||
|
@ -326,11 +291,19 @@
|
|||
name = "laptop";
|
||||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ "eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1" ];
|
||||
modules-left = [ "sway/workspaces" "sway/window" ];
|
||||
output = [
|
||||
"eDP-1"
|
||||
"LVDS-1"
|
||||
"DSI-1"
|
||||
"HDMI-A-1"
|
||||
];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"custom/media"
|
||||
"mpd"
|
||||
"custom/notifs"
|
||||
"custom/weather2"
|
||||
"cpu"
|
||||
|
@ -348,7 +321,7 @@
|
|||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"custom/media" = mediaModule;
|
||||
"mpd" = mediaModule;
|
||||
"custom/notifs" = notificationModule;
|
||||
"custom/weather2" = weatherModule;
|
||||
"cpu" = cpuModule;
|
||||
|
@ -411,7 +384,7 @@
|
|||
#scratchpad {
|
||||
margin-left: 2px;
|
||||
}
|
||||
#cpu, #memory, #custom-vram, #custom-media, #custom-clock-long, #custom-clock-short, #backlight, #battery, #custom-weather, #custom-weather2, #custom-notifs {
|
||||
#cpu, #memory, #custom-vram, #mpd, #custom-clock-long, #custom-clock-short, #backlight, #battery, #custom-weather, #custom-weather2, #custom-notifs {
|
||||
margin: 0 5px 0 2px;
|
||||
}
|
||||
#cpu {
|
||||
|
@ -423,9 +396,12 @@
|
|||
#custom-vram {
|
||||
border-bottom: 3px solid #33FF00;
|
||||
}
|
||||
#custom-media {
|
||||
#mpd {
|
||||
border-bottom: 3px solid #ffb066;
|
||||
}
|
||||
#mpd.paused {
|
||||
color: #888;
|
||||
}
|
||||
#custom-clock-long {
|
||||
border-bottom: 3px solid #0a6cf5;
|
||||
}
|
||||
|
@ -438,9 +414,6 @@
|
|||
#battery {
|
||||
border-bottom: 3px solid #fcfc16;
|
||||
}
|
||||
#custom-media.paused {
|
||||
color: #888;
|
||||
}
|
||||
#custom-weather {
|
||||
border-bottom: 3px solid #3823C4;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, unstable, nur, blender-bin, ... }:
|
||||
{ pkgs, config, unstable, nur, blender, ... }:
|
||||
{
|
||||
users.users = {
|
||||
jimbo = {
|
||||
|
@ -45,7 +45,7 @@
|
|||
inherit
|
||||
unstable
|
||||
nur
|
||||
blender-bin
|
||||
blender
|
||||
;
|
||||
};
|
||||
users.jimbo = import ../../../../home;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
wireless.enable = false;
|
||||
dhcpcd.enable = true;
|
||||
nftables.enable = true;
|
||||
firewall.allowPing = false;
|
||||
nameservers = [
|
||||
"1.1.1.1"
|
||||
"1.1.1.2"
|
||||
|
|
Loading…
Reference in a new issue