forked from mirrors_public/oddlama_nix-config
feat: add lidswitch and some modules
This commit is contained in:
parent
4b4268b537
commit
4db499a5d3
12 changed files with 222 additions and 47 deletions
26
modules/bluetooth.nix
Normal file
26
modules/bluetooth.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [bluetuith];
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
disabledPlugins = ["sap"];
|
||||
settings = {
|
||||
General = {
|
||||
FastConnectable = "true";
|
||||
JustWorksRepairing = "always";
|
||||
MultiProfile = "multiple";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hardware.pulseaudio = {
|
||||
package = pkgs.pulseaudio.override {bluetoothSupport = true;};
|
||||
extraConfig = ''
|
||||
load-module module-bluetooth-discover
|
||||
load-module module-bluetooth-policy
|
||||
load-module module-switch-on-connect
|
||||
'';
|
||||
extraModules = with pkgs; [pulseaudio-modules-bt];
|
||||
};
|
||||
}
|
11
modules/efi.nix
Normal file
11
modules/efi.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{lib, ...}: {
|
||||
boot.loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 15;
|
||||
};
|
||||
timeout = lib.mkDefault 2;
|
||||
};
|
||||
console.earlySetup = true;
|
||||
}
|
15
modules/laptop.nix
Normal file
15
modules/laptop.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
services.logind = {
|
||||
lidSwitch = "ignore";
|
||||
lidSwitchDocked = "ignore";
|
||||
lidSwitchExternalPower = "ignore";
|
||||
extraConfig = ''
|
||||
HandlePowerKey=suspend
|
||||
HandleSuspendKey=suspend
|
||||
HandleHibernateKey=suspend
|
||||
PowerKeyIgnoreInhibited=yes
|
||||
SuspendKeyIgnoreInhibited=yes
|
||||
HibernateKeyIgnoreInhibited=yes
|
||||
'';
|
||||
};
|
||||
}
|
19
modules/nvidia.nix
Normal file
19
modules/nvidia.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
boot.blacklistedKernelModules = ["nouveau"];
|
||||
|
||||
hardware = {
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaPersistenced = true;
|
||||
};
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
virtualisation.docker.enableNvidia = true;
|
||||
virtualisation.podman.enableNvidia = true;
|
||||
}
|
39
modules/sound-pipewire.nix
Normal file
39
modules/sound-pipewire.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [pulseaudio];
|
||||
|
||||
hardware.pulseaudio.enable = lib.mkForce false;
|
||||
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
jack.enable = true;
|
||||
pulse.enable = true;
|
||||
media-session.enable = false;
|
||||
wireplumber.enable = true;
|
||||
config = {
|
||||
pipewire."context.properties"."default.clock.allowed-rates" = [
|
||||
44100
|
||||
48000
|
||||
88200
|
||||
96000
|
||||
176400
|
||||
192000
|
||||
358000
|
||||
384000
|
||||
716000
|
||||
768000
|
||||
];
|
||||
pipewire-pulse."stream.properties"."resample.quality" = 15;
|
||||
client."stream.properties"."resample.quality" = 15;
|
||||
client-rt."stream.properties"."resample.quality" = 15;
|
||||
};
|
||||
};
|
||||
|
||||
sound.enable = true;
|
||||
}
|
4
modules/yubikey.nix
Normal file
4
modules/yubikey.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
services.udev.packages = with pkgs; [yubikey-personalization libu2f-host];
|
||||
services.pcscd.enable = true;
|
||||
}
|
17
modules/zfs.nix
Normal file
17
modules/zfs.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{pkgs, ...}: {
|
||||
boot.supportedFilesystems = ["zfs"];
|
||||
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||
|
||||
environment.systemPackages = with pkgs; [zfs];
|
||||
|
||||
services.zfs = {
|
||||
autoScrub = {
|
||||
enable = true;
|
||||
interval = "weekly";
|
||||
};
|
||||
trim = {
|
||||
enable = true;
|
||||
interval = "weekly";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue