chore: nix fmt
This commit is contained in:
parent
a80bd4ed3b
commit
7266fff06e
128 changed files with 3402 additions and 2013 deletions
|
@ -1,26 +1,44 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ... }: with lib; let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.global.io;
|
||||
gui = with config.global.gpu; enable && session;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.global.io = {
|
||||
betaflight = mkEnableOption "betaflight udev rules" // { default = gui; };
|
||||
bluetooth = mkEnableOption "bluetooth daemons and state persistence" // { default = gui; };
|
||||
audio = mkEnableOption "pulseaudio server configuration" // { default = gui; };
|
||||
betaflight = mkEnableOption "betaflight udev rules" // {
|
||||
default = gui;
|
||||
};
|
||||
bluetooth = mkEnableOption "bluetooth daemons and state persistence" // {
|
||||
default = gui;
|
||||
};
|
||||
audio = mkEnableOption "pulseaudio server configuration" // {
|
||||
default = gui;
|
||||
};
|
||||
coredump = mkEnableOption "save coredumps handled by systemd";
|
||||
};
|
||||
|
||||
config = {
|
||||
services.udev.extraRules = ''
|
||||
# ignore zvols
|
||||
KERNEL=="zd*", ENV{UDISKS_IGNORE}="1"
|
||||
'' + (if cfg.betaflight then ''
|
||||
# DFU (Internal bootloader for STM32 and AT32 MCUs)
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||
'' else "");
|
||||
services.udev.extraRules =
|
||||
''
|
||||
# ignore zvols
|
||||
KERNEL=="zd*", ENV{UDISKS_IGNORE}="1"
|
||||
''
|
||||
+ (
|
||||
if cfg.betaflight then
|
||||
''
|
||||
# DFU (Internal bootloader for STM32 and AT32 MCUs)
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||
''
|
||||
else
|
||||
""
|
||||
);
|
||||
|
||||
networking.networkmanager.enable = mkDefault true;
|
||||
networking.hosts = {
|
||||
|
@ -43,20 +61,25 @@ in {
|
|||
jack.enable = true;
|
||||
};
|
||||
|
||||
security.pam.loginLimits = mkIf (!cfg.coredump) (singleton { domain = "*"; item = "core"; type = "hard"; value = "0"; });
|
||||
security.pam.loginLimits = mkIf (!cfg.coredump) (singleton {
|
||||
domain = "*";
|
||||
item = "core";
|
||||
type = "hard";
|
||||
value = "0";
|
||||
});
|
||||
systemd.coredump.extraConfig = mkIf (!cfg.coredump) "Storage=none";
|
||||
|
||||
environment.persistence."/nix/persist/fhs".directories = [
|
||||
"/var/log"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/backlight"
|
||||
] ++
|
||||
optional config.networking.networkmanager.enable "/etc/NetworkManager/system-connections" ++
|
||||
optional cfg.bluetooth "/var/lib/bluetooth" ++
|
||||
optional cfg.coredump "/var/lib/systemd/coredump";
|
||||
environment.persistence."/nix/persist/fhs".directories =
|
||||
[
|
||||
"/var/log"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/backlight"
|
||||
]
|
||||
++ optional config.networking.networkmanager.enable "/etc/NetworkManager/system-connections"
|
||||
++ optional cfg.bluetooth "/var/lib/bluetooth"
|
||||
++ optional cfg.coredump "/var/lib/systemd/coredump";
|
||||
environment.persistence."/nix/persist/fhs".hideMounts = true;
|
||||
|
||||
users.home.persist.directories = [ ] ++
|
||||
optional cfg.audio ".local/state/wireplumber";
|
||||
users.home.persist.directories = [ ] ++ optional cfg.audio ".local/state/wireplumber";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue