mirror of
https://github.com/arnaucube/configs.git
synced 2026-02-10 04:26:41 +01:00
small nix update
This commit is contained in:
12
nixos/README.md
Normal file
12
nixos/README.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from time to time run the following commands to remove stuff from old generations
|
||||||
|
```
|
||||||
|
# list old generations
|
||||||
|
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
|
||||||
|
|
||||||
|
# remove old generations
|
||||||
|
sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations 9 10 11 12 13 X...
|
||||||
|
|
||||||
|
|
||||||
|
# to remove old programs
|
||||||
|
nix-collect-garbage --delete-old
|
||||||
|
```
|
||||||
@@ -83,6 +83,7 @@
|
|||||||
tig
|
tig
|
||||||
mosh
|
mosh
|
||||||
bat
|
bat
|
||||||
|
lf
|
||||||
ripgrep
|
ripgrep
|
||||||
fzf
|
fzf
|
||||||
python3
|
python3
|
||||||
|
|||||||
@@ -37,62 +37,65 @@
|
|||||||
# add pulseaudio support to manage audio
|
# add pulseaudio support to manage audio
|
||||||
hardware.pulseaudio.enable = true;
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
# next sleep & wake is code from: https://github.com/hpfr/system/blob/2e5b3b967b0436203d7add6adbd6b6f55e87cf3c/hosts/linux-surface.nix
|
# prevent suspend on folding
|
||||||
systemd.services = {
|
services.logind.lidSwitch = "ignore";
|
||||||
surface-sleep = {
|
|
||||||
enable = lib.versionOlder config.boot.kernelPackages.kernel.version "5.4";
|
|
||||||
before = [ "suspend.target" ];
|
|
||||||
wantedBy = [ "suspend.target" ];
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
path = with pkgs; [ procps kmod bluez ];
|
|
||||||
script = ''
|
|
||||||
# Disable bluetooth if no device is connected
|
|
||||||
if ps cax | grep bluetoothd && ! bluetoothctl info; then
|
|
||||||
bluetoothctl power off
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Disable bluetooth regardless if devices are connected (see notes below)
|
# next sleep & wake is code from: https://github.com/hpfr/system/blob/2e5b3b967b0436203d7add6adbd6b6f55e87cf3c/hosts/linux-surface.nix
|
||||||
# if ps cax | grep bluetoothd; then
|
# systemd.services = {
|
||||||
|
# surface-sleep = {
|
||||||
|
# enable = lib.versionOlder config.boot.kernelPackages.kernel.version "5.4";
|
||||||
|
# before = [ "suspend.target" ];
|
||||||
|
# wantedBy = [ "suspend.target" ];
|
||||||
|
# serviceConfig.Type = "oneshot";
|
||||||
|
# path = with pkgs; [ procps kmod bluez ];
|
||||||
|
# script = ''
|
||||||
|
# # Disable bluetooth if no device is connected
|
||||||
|
# if ps cax | grep bluetoothd && ! bluetoothctl info; then
|
||||||
# bluetoothctl power off
|
# bluetoothctl power off
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
## > Remove IPTS from ME side
|
# ## Disable bluetooth regardless if devices are connected (see notes below)
|
||||||
modprobe -r ipts_surface
|
# # if ps cax | grep bluetoothd; then
|
||||||
modprobe -r intel_ipts
|
# # bluetoothctl power off
|
||||||
# modprobe -r mei_hdcp
|
# # fi
|
||||||
modprobe -r mei_me
|
|
||||||
modprobe -r mei
|
|
||||||
## > Remove IPTS from i915 side
|
|
||||||
for i in $(find /sys/kernel/debug/dri -name i915_ipts_cleanup); do
|
|
||||||
echo 1 > $i
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
surface-wake = {
|
|
||||||
enable = lib.versionOlder config.boot.kernelPackages.kernel.version "5.4";
|
|
||||||
after = [ "post-resume.target" ];
|
|
||||||
wantedBy = [ "post-resume.target" ];
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
path = with pkgs; [ procps kmod bluez ];
|
|
||||||
script = ''
|
|
||||||
## > Load IPTS from i915 side
|
|
||||||
for i in $(find /sys/kernel/debug/dri -name i915_ipts_init); do
|
|
||||||
echo 1 > $i
|
|
||||||
done
|
|
||||||
## > Load IPTS from ME side
|
|
||||||
modprobe mei
|
|
||||||
modprobe mei_me
|
|
||||||
# modprobe mei_hdcp
|
|
||||||
modprobe intel_ipts
|
|
||||||
modprobe ipts_surface
|
|
||||||
|
|
||||||
# Restart bluetooth
|
# ## > Remove IPTS from ME side
|
||||||
if ps cax | grep bluetoothd; then
|
# modprobe -r ipts_surface
|
||||||
bluetoothctl power on
|
# modprobe -r intel_ipts
|
||||||
fi
|
# # modprobe -r mei_hdcp
|
||||||
'';
|
# modprobe -r mei_me
|
||||||
};
|
# modprobe -r mei
|
||||||
};
|
# ## > Remove IPTS from i915 side
|
||||||
|
# for i in $(find /sys/kernel/debug/dri -name i915_ipts_cleanup); do
|
||||||
|
# echo 1 > $i
|
||||||
|
# done
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
|
# surface-wake = {
|
||||||
|
# enable = lib.versionOlder config.boot.kernelPackages.kernel.version "5.4";
|
||||||
|
# after = [ "post-resume.target" ];
|
||||||
|
# wantedBy = [ "post-resume.target" ];
|
||||||
|
# serviceConfig.Type = "oneshot";
|
||||||
|
# path = with pkgs; [ procps kmod bluez ];
|
||||||
|
# script = ''
|
||||||
|
# ## > Load IPTS from i915 side
|
||||||
|
# for i in $(find /sys/kernel/debug/dri -name i915_ipts_init); do
|
||||||
|
# echo 1 > $i
|
||||||
|
# done
|
||||||
|
# ## > Load IPTS from ME side
|
||||||
|
# modprobe mei
|
||||||
|
# modprobe mei_me
|
||||||
|
# # modprobe mei_hdcp
|
||||||
|
# modprobe intel_ipts
|
||||||
|
# modprobe ipts_surface
|
||||||
|
|
||||||
|
# # Restart bluetooth
|
||||||
|
# if ps cax | grep bluetoothd; then
|
||||||
|
# bluetoothctl power on
|
||||||
|
# fi
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
## NOTES:
|
## NOTES:
|
||||||
# Susspend issue:
|
# Susspend issue:
|
||||||
|
|||||||
Reference in New Issue
Block a user