laptop stuff

This commit is contained in:
Vivian 2022-09-26 17:17:27 +02:00
parent 57ad1d09f7
commit b0461e98a7
10 changed files with 62 additions and 65 deletions

View file

@ -142,7 +142,7 @@ in {
toString cfg.port toString cfg.port
} ${ } ${
if cfg.ssl then "--ssl" else "" if cfg.ssl then "--ssl" else ""
} --auth ${cfg.authMode} --rtsocket ${cfg.rpcSocket} --allowedpath ${cfg.downloadDir}"; } --auth ${cfg.authMode} --rtsocket ${cfg.rpcSocket} --allowedpath ${cfg.downloadDir}";
}; };
}; };

View file

@ -53,14 +53,6 @@ in
type = lib.types.submodule { type = lib.types.submodule {
freeformType = settingsFormat.type; freeformType = settingsFormat.type;
}; };
# example = ''
# global:
# scrape_interval: 5s
# scrape_configs:
# - job_name: 'apache'
# static_configs:
# - targets: ['apache-exporter:9117']
# '';
description = '' description = ''
Config for prometheus style metrics Config for prometheus style metrics
''; '';

View file

@ -36,6 +36,7 @@ in
[ [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./networking.nix
]; ];
# home-manager # home-manager
@ -79,33 +80,8 @@ in
boot.loader.efi.efiSysMountPoint = "/boot/efi"; boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
# networking.wireless.iwd.enable = false;
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
# Enable networking
networking.networkmanager.enable = false;
networking.wireless = {
enable = true;
environmentFile = "/var/lib/secrets/wireless.env";
userControlled.enable = true;
networks = {
eduroam = {
auth = ''
proto=RSN
key_mgmt=WPA-EAP
eap=PEAP
identity="vroest@tudelft.nl"
password=hash:@EDUROAM_PASSWORD_HASH@
domain_suffix_match="radius.tudelft.nl"
anonymous_identity="anonymous@tudelft.nl"
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
ca_cert="/etc/ssl/certs/ca-bundle.crt"
'';
};
};
};
fileSystems."/".options = [ "compress=zstd" ]; fileSystems."/".options = [ "compress=zstd" ];
# Filesystem dedup # Filesystem dedup
services.beesd.filesystems = { services.beesd.filesystems = {
@ -231,21 +207,6 @@ in
services.fstrim.enable = true; services.fstrim.enable = true;
# Allow reverse path for wireguard
networking.firewall = {
# if packets are still dropped, they will show up in dmesg
logReversePathDrops = true;
# wireguard trips rpfilter up
extraCommands = ''
ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
nix.extraOptions = '' nix.extraOptions = ''
keep-outputs = true keep-outputs = true
keep-derivations = true keep-derivations = true

View file

@ -75,7 +75,6 @@
programs.mako = { programs.mako = {
enable = true; enable = true;
# makoctl mode -a do-not-disturb will hide all notifications, makoctl mode -r do-not-disturb will show them again.
extraConfig = '' extraConfig = ''
[mode=do-not-disturb] [mode=do-not-disturb]
invisible=1 invisible=1
@ -92,9 +91,6 @@
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox-devedition-bin; package = pkgs.firefox-devedition-bin;
# profiles.dev-edition-default = {
# isDefault = true;
# };
}; };
programs.vscode = { programs.vscode = {
@ -104,6 +100,7 @@
catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc
codezombiech.gitignore codezombiech.gitignore
editorconfig.editorconfig editorconfig.editorconfig
foxundermoon.shell-format
james-yu.latex-workshop james-yu.latex-workshop
jnoortheen.nix-ide jnoortheen.nix-ide
matklad.rust-analyzer matklad.rust-analyzer

View file

@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#! nix-shell -p jq -i bash #! nix-shell -p jq -i bash
if makoctl mode | grep -Fxq "do-not-disturb"; then if makoctl mode | rg -q "do-not-disturb"; then
eww update dnd="" eww update dnd=""
makoctl mode -r do-not-disturb > /dev/null makoctl mode -r do-not-disturb > /dev/null
else else

View file

@ -2,7 +2,7 @@
per="$(pamixer --get-volume)" per="$(pamixer --get-volume)"
if pamixer --get-mute | grep -q true; then if pamixer --get-mute | rg -q true; then
icon="婢" icon="婢"
elif [ "$per" -gt 66 ]; then elif [ "$per" -gt 66 ]; then
icon="墳" # high icon="墳" # high

View file

@ -1,13 +1,8 @@
#!/bin/sh #!/bin/sh
if nmcli g | rg -q "\bconnected\b"; then if wpa_cli status | rg -q "wpa_state=COMPLETED"; then
icon="直" icon="直"
ssid=$(nmcli -t -f name connection show --active | sed -z 's/\n/,/g;s/,$/\n/') status="Connected"
if echo $ssid | rg -q "Wired"; then
status="Connected via cable"
else
status="Connected to ${ssid}"
fi
else else
icon="睊" icon="睊"
status="offline" status="offline"

View file

@ -1,8 +1,10 @@
#!/bin/sh #!/bin/sh
workspaces() { workspaces() {
./scripts/workspaces.lua ./scripts/workspaces.lua
} }
workspaces workspaces
tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep --line-buffered "Changed to workspace" | while read -r; do tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep --line-buffered "Changed to workspace" | while read -r; do
workspaces workspaces
done done

View file

@ -68,6 +68,9 @@
bind=SUPER,S,togglefloating, bind=SUPER,S,togglefloating,
bind=SUPER,P,pseudo, bind=SUPER,P,pseudo,
bindm=SUPER,mouse:272,movewindow
bindm=SUPER,mouse:273,resizewindow
bind=SUPER,left,movefocus,l bind=SUPER,left,movefocus,l
bind=SUPER,right,movefocus,r bind=SUPER,right,movefocus,r
bind=SUPER,up,movefocus,u bind=SUPER,up,movefocus,u
@ -114,6 +117,8 @@
bind=SUPER,g,togglegroup bind=SUPER,g,togglegroup
bind=SUPER,tab,changegroupactive bind=SUPER,tab,changegroupactive
bind=SUPER,m,fullscreen,1
bind=SUPERSHIFT,m,fullscreen,0
bind=,XF86MonBrightnessUp,exec,brightnessctl -q s +5% bind=,XF86MonBrightnessUp,exec,brightnessctl -q s +5%
bind=,XF86MonBrightnessDown,exec,brightnessctl -q s 5%- bind=,XF86MonBrightnessDown,exec,brightnessctl -q s 5%-

View file

@ -0,0 +1,45 @@
{ ... }@a:
{
networking = {
networkmanager.enable = false;
wireless = {
enable = true;
environmentFile = "/var/lib/secrets/wireless.env";
userControlled.enable = true;
networks = {
eduroam = {
auth = ''
proto=RSN
key_mgmt=WPA-EAP
eap=PEAP
identity="vroest@tudelft.nl"
password=hash:@EDUROAM_PASSWORD_HASH@
domain_suffix_match="radius.tudelft.nl"
anonymous_identity="anonymous@tudelft.nl"
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
ca_cert="/etc/ssl/certs/ca-bundle.crt"
'';
};
"Pikachu 5G" = {
psk = "@PIKACHU_PASSWORD@";
};
};
};
# Allow reverse path for wireguard
# firewall = {
# # if packets are still dropped, they will show up in dmesg
# logReversePathDrops = true;
# # wireguard trips rpfilter up
# extraCommands = ''
# ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
# ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
# '';
# extraStopCommands = ''
# ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
# ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
# '';
# };
};
}