Compare commits

...

15 commits

Author SHA1 Message Date
Leonardo Eugênio 2ae616758b amdgpu: update fan controller 2025-01-17 20:29:22 -03:00
Leonardo Eugênio 72dfd33750 phantom: add mastodon storage device 2025-01-17 00:34:11 -03:00
Leonardo Eugênio a36385a4d2 docker: block external connections 2025-01-10 11:06:58 -03:00
Leonardo Eugênio e1601a0aef update 2025-01-08 21:25:01 -03:00
Leonardo Eugênio 8012d3835d OpenTabletDriver: fix shortcuts and revert draw-area to fullscreen 2025-01-08 21:23:37 -03:00
Leonardo Eugênio cf2cc34311 sway: don't force steam into floating window 2025-01-08 21:23:18 -03:00
Leonardo Eugênio eda788a912 monolith: revert to LTS kernel 2025-01-08 21:22:29 -03:00
Leonardo Eugênio 26e013d88f factorio: wait for network connection before starting 2025-01-08 21:21:11 -03:00
Leonardo Eugênio d84480a40d amdgpu: always restart the fan control script 2025-01-08 21:20:45 -03:00
Leonardo Eugênio f98e1ef0b7 amdgpu: remove semingly useless configurations
OBS was causing gpu panics
2025-01-08 21:20:08 -03:00
Leonardo Eugênio 5ff7906392 update 2024-12-30 21:25:58 -03:00
Leonardo Eugênio 56b1f8133e update 2024-12-22 01:21:40 -03:00
Leonardo Eugênio 5d4cfc70a7 factorio: 2.0.23 -> 2.0.28 2024-12-22 01:21:36 -03:00
Leonardo Eugênio 4fecc91b73 chat: switch do vesktop -> discordcanary 2024-12-20 12:51:37 -03:00
lelgenio fad066b258 git: add clean-deleted-remotes command 2024-12-17 16:12:37 -03:00
17 changed files with 145 additions and 64 deletions

View file

@ -209,11 +209,11 @@
]
},
"locked": {
"lastModified": 1733168902,
"narHash": "sha256-8dupm9GfK+BowGdQd7EHK5V61nneLfr9xR6sc5vtDi0=",
"lastModified": 1736199437,
"narHash": "sha256-TdU0a/x8048rbbJmkKWzSY1CtsbbGKNkIJcMdr8Zf4Q=",
"owner": "nix-community",
"repo": "disko",
"rev": "785c1e02c7e465375df971949b8dcbde9ec362e5",
"rev": "49f8aa791f81ff2402039b3efe0c35b9386c4bcf",
"type": "github"
},
"original": {
@ -227,11 +227,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1733974299,
"narHash": "sha256-fPvJ/ZsQGVqGJqYL2gKotalQUoG1wpUYTJkRKG2BrwA=",
"lastModified": 1735940463,
"narHash": "sha256-qrjv3UrlcFQf8zFjV4lMDmcBnlow/sqyyjGFAXp8mLk=",
"owner": "lelgenio",
"repo": "dzgui-nix",
"rev": "580022e73efedb17ddf640115539cb9bd1423d44",
"rev": "fccedf1386f484375570e0195c7a08d7687b1df6",
"type": "github"
},
"original": {
@ -440,11 +440,11 @@
]
},
"locked": {
"lastModified": 1733951536,
"narHash": "sha256-Zb5ZCa7Xj+0gy5XVXINTSr71fCfAv+IKtmIXNrykT54=",
"lastModified": 1735344290,
"narHash": "sha256-oJDtWPH1oJT34RJK1FSWjwX4qcGOBRkcNQPD0EbSfNM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1318c3f3b068cdcea922fa7c1a0a1f0c96c22f5f",
"rev": "613691f285dad87694c2ba1c9e6298d04736292d",
"type": "github"
},
"original": {
@ -481,11 +481,11 @@
]
},
"locked": {
"lastModified": 1733629314,
"narHash": "sha256-U0vivjQFAwjNDYt49Krevs1murX9hKBFe2Ye0cHpgbU=",
"lastModified": 1736047960,
"narHash": "sha256-hutd85FA1jUJhhqBRRJ+u7UHO9oFGD/RVm2x5w8WjVQ=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "f1e477a7dd11e27e7f98b646349cd66bbabf2fb8",
"rev": "816a6ae88774ba7e74314830546c29e134e0dffb",
"type": "github"
},
"original": {
@ -501,16 +501,14 @@
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-24_05": [
"nixpkgs"
]
"nixpkgs-24_11": "nixpkgs-24_11"
},
"locked": {
"lastModified": 1722877200,
"narHash": "sha256-qgKDNJXs+od+1UbRy62uk7dYal3h98I4WojfIqMoGcg=",
"lastModified": 1735230346,
"narHash": "sha256-zgR8NTiNDPVNrfaiOlB9yHSmCqFDo7Ks2IavaJ2dZo4=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "af7d3bf5daeba3fc28089b015c0dd43f06b176f2",
"rev": "dc0569066e79ae96184541da6fa28f35a33fbf7b",
"type": "gitlab"
},
"original": {
@ -536,13 +534,28 @@
"type": "github"
}
},
"nixpkgs-unstable": {
"nixpkgs-24_11": {
"locked": {
"lastModified": 1733759999,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"lastModified": 1734083684,
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.11",
"type": "indirect"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1736012469,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d",
"type": "github"
},
"original": {
@ -568,11 +581,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1733749988,
"narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=",
"lastModified": 1732812356,
"narHash": "sha256-LNcgjOLArRlx2W6XSi0yc0xwLjrK3KF9LxAMqUgFDgw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68",
"rev": "581d7e4d23b91daf2afa0005a5d3d01d6a8884fe",
"type": "github"
},
"original": {
@ -599,11 +612,11 @@
},
"nixpkgs_5": {
"locked": {
"lastModified": 1733808091,
"narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=",
"lastModified": 1736061677,
"narHash": "sha256-DjkQPnkAfd7eB522PwnkGhOMuT9QVCZspDpJJYyOj60=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e",
"rev": "cbd8ec4de4469333c82ff40d057350c30e9f7d36",
"type": "github"
},
"original": {
@ -889,11 +902,11 @@
},
"vpsadminos": {
"locked": {
"lastModified": 1733157322,
"narHash": "sha256-lN6AY1zxZ0mQzpvLIfpdHdZ7oThHOlWFb2HUeOVcCJQ=",
"lastModified": 1734458258,
"narHash": "sha256-xZEbuwAAbxwujrGtuydDNBjzMLnE9YOcuLv3hdudZe4=",
"owner": "vpsfreecz",
"repo": "vpsadminos",
"rev": "8ba8b0885526f484da44c0aeb4894dbaf548e61f",
"rev": "83ddccf4462f155f12596af773e9291d7ebc37a3",
"type": "github"
},
"original": {

View file

@ -29,7 +29,6 @@
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-24_05.follows = "nixpkgs";
};
dzgui-nix.url = "github:lelgenio/dzgui-nix";

View file

@ -13,7 +13,6 @@ in
{
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelParams = [
"amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug
"video=DP-1:1920x1080@144"
"amdgpu.ppfeaturemask=0xfffd7fff" # enable undervolting
];
@ -22,6 +21,10 @@ in
script = ''
${lib.getExe pkgs.amd-fan-control} /sys/class/drm/card1/device 60 85
'';
serviceConfig = {
Restart = "always";
RestartSec = 10;
};
wantedBy = [ "multi-user.target" ];
};
@ -29,10 +32,6 @@ in
hardware.graphics.extraPackages = with pkgs; [
libva
libvdpau
vaapiVdpau
rocmPackages.clr
rocmPackages.rocm-smi
];
services.udev.extraRules = ''

View file

@ -41,8 +41,6 @@ in
package = pkgs.unstable.opentabletdriver;
};
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
boot.initrd.kernelModules = [ "amdgpu" ];

View file

@ -10,6 +10,11 @@
extraSettingsFile = config.age.secrets.factorio-settings.path;
};
systemd.services.factorio = {
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
};
age.secrets.factorio-settings = {
file = ../../secrets/factorio-settings.age;
mode = "777";

View file

@ -1,15 +1,14 @@
{
config,
pkgs,
inputs,
...
}:
{
fileSystems."/var/lib/syncthing-data" = {
device = "172.16.130.7:/nas/5749/syncthinng_data";
fsType = "nfs";
options = [ "nofail" ];
};
fileSystems."/var/lib/mastodon" = {
device = "172.16.130.7:/nas/5749/mastodon";
fsType = "nfs";
options = [ "nofail" ];
};
swapDevices = [
{

View file

@ -1,10 +1,10 @@
{ factorio-headless, pkgs }:
factorio-headless.overrideAttrs (_: rec {
version = "2.0.23";
version = "2.0.28";
src = pkgs.fetchurl {
name = "factorio_headless_x64-${version}.tar.xz";
url = "https://www.factorio.com/get-download/${version}/headless/linux64";
hash = "sha256-6Bn8mtbfBhv51L/8kZiN0Y0OOYLIscIsBSXXi9o+8hY=";
hash = "sha256-6pk3tq3HoY4XpOHmSZLsOJQHSXs25oKAuxT83UyITdM=";
};
})

View file

@ -0,0 +1,33 @@
#!/bin/sh
# Create the DOCKER-USER chain if it doesn't exist
iptables -N DOCKER-USER || true
# Flush existing rules in the DOCKER-USER chain
iptables -F DOCKER-USER
# Get all external network interfaces
interfaces=$(
ip -o -f inet addr show |
awk '{print $2}' |
grep -E '^(enp|eth|wlan|wlp)' |
sort -u
)
for iface in $interfaces; do
# Allow traffic from LAN
iptables -A DOCKER-USER -i "$iface" -s 127.0.0.1 -j ACCEPT
iptables -A DOCKER-USER -i "$iface" -s 10.0.0.0/8 -j ACCEPT
iptables -A DOCKER-USER -i "$iface" -s 192.168.0.0/16 -j ACCEPT
# Allow established and related connections
iptables -A DOCKER-USER -i "$iface" -m state --state RELATED,ESTABLISHED -j ACCEPT
# Drop all other traffic
iptables -A DOCKER-USER -i "$iface" -j DROP
echo "iptables rules have been set up for interface: $iface"
done
# Return to the previous chain
iptables -A DOCKER-USER -j RETURN

View file

@ -18,7 +18,7 @@ bail() {
exit 1
}
if ! [ -d $HWMON ]; then
if ! [ -d "$HWMON" ]; then
bail "Invalid HWMON"
fi
@ -28,20 +28,31 @@ if ! [ -f $TEMP_INPUT ]; then
bail "Invalid TEMP_INPUT"
fi
MIN="$2"
MAX="$3"
TEMP_MIN="$2"
TEMP_MAX="$3"
if [ -z "$TEMP_MIN" ];then
bail "No minimum temperature provided"
fi
if [ -z "$TEMP_MAX" ];then
bail "No maximum temperature provided"
fi
PWM_MIN=0
PWM_MAX=255
echo "Running..." >&2
while true; do
TEMPERATURE_RAW=$(cat "$TEMP_INPUT")
TEMPERATURE="$(( $TEMPERATURE_RAW / 1000 ))"
# Remap from a number between 60_000..90_000 to 0..255
PWM=$(( ($TEMPERATURE - $MIN) * 255 / ($MAX - $MIN) ))
PWM=$(( ($TEMPERATURE - $TEMP_MIN) * $PWM_MAX / ($TEMP_MAX - $TEMP_MIN) ))
if [ "$PWM" -gt 255 ]; then
PWM=255
elif [ "$PWM" -lt 0 ]; then
PWM=0
if [ "$PWM" -gt $PWM_MAX ]; then
PWM=$PWM_MAX
elif [ "$PWM" -lt $PWM_MIN ]; then
PWM=$PWM_MIN
fi
echo 1 > "$HWMON/pwm1_enable"

View file

@ -125,6 +125,12 @@
zbar
wl-clipboard
];
git_clean_remote_deleted = [
git
gnugrep
gawk
findutils
];
pint-fmt = [ ];
powerplay-led-idle = [
bash
@ -133,6 +139,12 @@
];
vrr-fullscreen = [ ];
controller-battery = [ ];
_docker-block-external-connections = [
iptables
gawk
gnugrep
iproute2
];
}
// lib.mapAttrs importScript {
wdmenu = ./wdmenu.nix;

View file

@ -0,0 +1,6 @@
#!/bin/sh
git branch -vv \
| grep ': gone]' \
| awk '{print $1}' \
| xargs git branch -D

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
services.flatpak.enable = true;
@ -22,6 +22,8 @@
};
};
networking.firewall.extraCommands = lib.getExe pkgs._docker-block-external-connections;
programs.extra-container.enable = true;
programs.firejail.enable = true;

View file

@ -9,15 +9,15 @@
wayland.windowManager.sway = {
extraConfig = ''
exec thunderbird
exec vesktop
exec discordcanary
exec telegram-desktop
'';
};
home.packages = with pkgs; [
tdesktop
vesktop
discord-canary
thunderbird
element-desktop-wayland
element-desktop
];
}

View file

@ -36,8 +36,13 @@ in
alias = {
graph = "log --graph --oneline --branches";
root = "rev-parse --show-toplevel";
clean-deleted-remotes = "!" + (lib.getExe pkgs.git_clean_remote_deleted);
};
};
};
home.packages = with pkgs; [
git_clean_remote_deleted
];
};
}

View file

@ -127,7 +127,7 @@ in
ranger
bmenu
kak-lsp
unstable.kak-tree-sitter
kak-tree-sitter
kak-pager
kak-man-pager

View file

@ -10,8 +10,8 @@
"Filters": [],
"AbsoluteModeSettings": {
"Display": {
"Width": 960.0,
"Height": 540.0,
"Width": 1920.0,
"Height": 1080.0,
"X": 960.0,
"Y": 540.0,
"Rotation": 0.0
@ -76,7 +76,7 @@
"Settings": [
{
"Property": "Keys",
"Value": "Control+O"
"Value": "Control+Shift+Z"
}
],
"Enable": true

View file

@ -58,7 +58,6 @@ in
{ app_id = "wdisplays"; }
{ app_id = "pavucontrol"; }
{ app_id = ".*[Hh]elvum.*"; }
{ workspace = "9"; }
];
};
};