working on screens and power stuff

This commit is contained in:
Matt Nish-Lapidus 2025-02-16 16:24:34 -05:00
parent 6d3a143ce2
commit 2002da4dcf
14 changed files with 237 additions and 150 deletions

View file

@ -15,25 +15,40 @@
# TODO add screen dimming and test configurations with different monitors
listener = [
# battery timers
{
timeout = "60";
on-timeout = "systemd-ac-power || dim-all-monitors";
on-resume = "brillo -e -u 150000 -I";
}
{
timeout = "120";
on-timeout = "systemd-ac-power || lock-power-off-monitors";
}
{
timeout = "300";
on-timeout = "systemd-ac-power || lock-suspend";
}
# ac power timers
{
timeout = "90";
on-timeout = "systemd-ac-power && dim-all-monitors";
on-resume = "brillo -e -u 150000 -I";
}
{
timeout = "180";
on-timeout = "systemd-ac-power && loginctl lock-session";
}
{
timeout = "200";
on-timeout = "systemd-ac-power && lock-power-off-monitors";
}
{
timeout = "600";
on-timeout = "systemd-ac-power && loginctl lock-session && systemctl suspend";
on-timeout = "systemd-ac-power && lock-suspend";
}
];

View file

@ -14,7 +14,7 @@ in {
{ command = ["maestral_qt"]; }
{ command = ["clipse" "-listen"]; }
{ command = ["waybar"]; }
{ command = [ "systemctl" "--user" "restart" "xwayland-satellite.service" ]; }
{ command = [ "systemctl" "--user" "restart" "xwayland-satellite.service" "shikane.service" ]; }
];
workspaces = {
@ -222,8 +222,6 @@ in {
action = spawn "swayosd-client" "--input-volume" "mute-toggle";
};
# TODO write shell script that sets swayosd and light -O to store new value for recall
"XF86MonBrightnessUp" = {
allow-when-locked=true;
action = spawn "swayosd-client" "--brightness" "raise";

View file

@ -24,7 +24,7 @@
tldr
glow
delta
btop
btop-rocm
gnupg
imagemagick
gnutls
@ -61,6 +61,7 @@
powertop
age
kdotool
manix
caligula

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ pkgs, ... }:
{
home.packages = [ pkgs.shikane ];
@ -6,7 +6,7 @@
systemd.user.services.shikane = {
Unit = {
Description = "Shikane";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];

View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
{
fileSystems =
let
automount-opts = "x-systemd.automount,noauto,users,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,uid=1000";
filez-opts = automount-opts + ",credentials=/etc/nixos/filez-secrets";
media-server-opts = automount-opts + ",credentials=/etc/nixos/media-server-secrets";
in {
"/mnt/filez/media" = {
device = "//100.70.114.113/Media";
fsType = "smb3";
options = [ "${filez-opts}" ];
};
"/mnt/filez/music-production" = {
device = "//100.70.114.113/Music Production";
fsType = "smb3";
options = [ "${filez-opts}" ];
};
"/mnt/filez/storage" = {
device = "//100.70.114.113/Storage";
fsType = "smb3";
options = [ "${filez-opts}" ];
};
"/mnt/filez/photos" = {
device = "//100.70.114.113/Photo Storage";
fsType = "smb3";
options = [ "${filez-opts}" ];
};
"/mnt/beets-import" = {
device = "//100.103.170.132/media";
fsType = "smb3";
options = [ "${media-server-opts}" ];
};
};
}

67
modules/system/kanata.nix Normal file
View file

@ -0,0 +1,67 @@
{ config, lib, pkgs, ... }:
{
services.kanata = {
enable = true;
keyboards = {
sinc = {
devices = [ "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd" ];
config = ''
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc ins
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
tab q w e r t y u i o p [ ] bspc end
caps a s d f g h j k l ; ' ret pgup
lsft z x c v b n m , . / rsft up pgdn
lctl slck lmet lalt spc ralt rmet rctrl left down right)
(defalias
supesc (tap-hold-press 100 200 esc lmet)
sp-lsft (tap-hold-press 100 200 S-9 lsft)
sp-rsft (tap-hold-press 100 200 S-0 lsft)
controls (layer-while-held controls))
(deflayer qwerty
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc ins
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
tab q w e r t y u i o p [ ] bspc end
@supesc a s d f g h j k l ; ' ret pgup
@sp-lsft z x c v b n m , . / @sp-rsft up pgdn
lmet @controls lalt lctrl spc rctrl ralt rmet left down right)
(deflayer controls
esc VolumeMute VolumeDown VolumeUp f4 f5 MediaPlayPause MediaTrackPrevious MediaTrackNext f9 f10 f11 f12 prtsc ins
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
tab q w e r t y u i o p [ ] bspc end
@supesc a s d f g h j k l ; ' ret pgup
@sp-lsft z x c v b n m , . / @sp-rsft pgup _
lmet lmet lalt lctrl spc rctrl ralt rmet home pgdn end)
'';
};
razer = {
devices = [];
config = ''
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctrl lmet lalt spc ralt rctrl)
(defalias
supesc (tap-hold-press 200 200 esc lmet)
sp-lsft (tap-hold-press 200 200 S-9 lsft)
sp-rsft (tap-hold-press 200 200 S-0 lsft))
(deflayer qwerty
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@supesc a s d f g h j k l ; ' ret
@sp-lsft z x c v b n m , . / @sp-rsft
lmet lalt lctrl spc rctrl ralt)
'';
};
};
};
}

View file

@ -0,0 +1,22 @@
filez: ENC[AES256_GCM,data:pOnl/B+dFc+Fks7Yb3c=,iv:V99CfTUmFq9ijFHU88OIvySvKw91a9hx0fXLikaAOdY=,tag:L1E2Wur2yVYaGeY+3Ku1WA==,type:str]
media-server: ENC[AES256_GCM,data:dqwbLUXItYrx7w==,iv:lo356taPBlPPD4CqtlbQzvUJRcym0SQc1sHMYW593vw=,tag:nzhLMzVnOc0eDa/7cfnLuA==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age10k8v6pfm3p7cmsgn6wu5ufpcquqgpvqh76l23xf326et55dacc0qlr8fe8
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBFS1BoNnpoWnZGNGQreXVZ
RjNGUWhoYmJPbWplcFIwOU1mdlNOYmhkblU0CmFkNkg1ZDVxU1FNbnlUMXpKWXR1
elZ0RFZaRDRsMkVjcFhkMXU4Q1RYTDQKLS0tIHBRZlovWlFJUDFidzBnby9VNzlm
OFJGS2ljaTVFcWJDL3h2S0tLR3pyekkKBY4veCtc5cmVxoDeFf1LufbFhMHnYu7U
jWaEgDUHHPpiR7+4XZI+Es71kyM+0q2UK0KSU5227eDCLkFvRN5uYg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-02-15T16:32:18Z"
mac: ENC[AES256_GCM,data:drTH1sdk/KUXfeFXJVyB+21orb7maspVaDr2zZRT2z3PqLKtXVUHqSTaXKb7hETi052ibLqSfyrSCgpNcLMB4yAPrLz/u7nADcxvrnmugAkGgR/w4sK8YPNqw0F04Xx1GQV1SNcFi5lj2xBhRI862sUUiEkUEGM8UieVMgx5pFM=,iv:qBwza6BLls0WiW2DpDkb7PIt5vpjj3LmQaArDGgRXIo=,tag:W/REzW4zCNpptvbXDVCpCA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.4

View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
{
sops = {
age.keyFile = "/home/emenel/.config/sops/age/keys.txt"; # must have no password!
defaultSopsFile = ./secrets.yaml;
secrets = {
filez = {};
media-server = {};
};
templates."media-server-secrets".content = ''
username=media
password=${config.sops.placeholder.media-server}
'';
templates."filez-secrets".content = ''
username=admin
password=${config.sops.placeholder.filez}
'';
};
environment.etc = {
"nixos/filez-secrets" = {
source = config.sops.templates."filez-secrets".path;
group = "users";
};
"nixos/media-server-secrets" = {
source = config.sops.templates."media-server-secrets".path;
group = "users";
};
};
}