chore(linter/formatter): Apply linter and formatter

This commit is contained in:
DashieTM 2025-09-06 16:18:00 +02:00
parent aefd89f89d
commit 68d16b8212
24 changed files with 469 additions and 448 deletions

View file

@ -105,7 +105,7 @@ in {
// {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.firefox.extensions
++ (
if (config.mods.browser.firefox.darkreader)
if config.mods.browser.firefox.darkreader
then [
{
"addon@darkreader.org" = {

View file

@ -99,7 +99,7 @@ in {
// {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.librewolf.extensions
++ (
if (config.mods.browser.firefox.darkreader)
if config.mods.browser.firefox.darkreader
then [
{
"addon@darkreader.org" = {

View file

@ -134,7 +134,7 @@ in {
// {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.zen.extensions
++ (
if (config.mods.browser.firefox.darkreader)
if config.mods.browser.firefox.darkreader
then [
{
"addon@darkreader.org" = {

View file

@ -517,28 +517,30 @@ in {
lib.optionalAttrs (options ? home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true;
colorscheme = config.mods.stylix.colorscheme;
inherit (config.mods.stylix) colorscheme;
};
programs.vscode = lib.mkIf config.mods.coding.vscodium.enable {
enable = true;
package = mkDashDefault pkgs.vscodium;
profiles.default.extensions = config.mods.coding.vscodium.extensions;
};
xdg.configFile."neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) {
source =
(pkgs.formats.toml {}).generate "neovide"
config.mods.coding.neovide.config;
};
xdg.configFile = {
"neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) {
source =
(pkgs.formats.toml {}).generate "neovide"
config.mods.coding.neovide.config;
};
xdg.configFile."gh/config.yml" = lib.mkIf config.mods.coding.gh.enable {
source =
(pkgs.formats.yaml {}).generate "config"
config.mods.coding.gh.config;
};
xdg.configFile."gh/hosts.yml" = lib.mkIf config.mods.coding.gh.enable {
source =
(pkgs.formats.yaml {}).generate "hosts"
config.mods.coding.gh.hosts;
"gh/config.yml" = lib.mkIf config.mods.coding.gh.enable {
source =
(pkgs.formats.yaml {}).generate "config"
config.mods.coding.gh.config;
};
"gh/hosts.yml" = lib.mkIf config.mods.coding.gh.enable {
source =
(pkgs.formats.yaml {}).generate "hosts"
config.mods.coding.gh.hosts;
};
};
home.packages = with pkgs;

View file

@ -43,39 +43,37 @@
description = "Container packages";
};
};
config = (
lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages =
(lib.lists.optionals (
config.mods.containers.variant == "podman"
)
config.mods.containers.podmanPackages)
++ (lib.lists.optionals (
config.mods.containers.variant == "docker"
)
config.mods.containers.dockerPackages)
++ (lib.lists.optionals (
config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker"
)
config.mods.containers.combinedPackages);
virtualisation =
if (config.mods.containers.variant == "podman")
then {
containers.enable = true;
podman = {
enable = true;
dockerCompat = mkDashDefault true;
defaultNetwork.settings.dns_enabled = mkDashDefault true;
};
}
else if (config.mods.containers.variant == "docker")
then {
containers.enable = true;
docker = {
enable = true;
};
}
else {};
}
);
config = lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages =
(lib.lists.optionals (
config.mods.containers.variant == "podman"
)
config.mods.containers.podmanPackages)
++ (lib.lists.optionals (
config.mods.containers.variant == "docker"
)
config.mods.containers.dockerPackages)
++ (lib.lists.optionals (
config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker"
)
config.mods.containers.combinedPackages);
virtualisation =
if (config.mods.containers.variant == "podman")
then {
containers.enable = true;
podman = {
enable = true;
dockerCompat = mkDashDefault true;
defaultNetwork.settings.dns_enabled = mkDashDefault true;
};
}
else if (config.mods.containers.variant == "docker")
then {
containers.enable = true;
docker = {
enable = true;
};
}
else {};
};
}

View file

@ -159,25 +159,143 @@
};
};
config = (
lib.optionalAttrs (options ? fileSystems) {
boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) (
builtins.listToAttrs (
map (
{
name,
drive,
}: {
cryptstorage.device = lib.mkIf (name != "root") drive?device;
cryptoroot.device = lib.mkIf (name == "root") drive?device;
}
)
config.mods.drives.extraDrives
config = lib.optionalAttrs (options ? fileSystems) {
boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) (
builtins.listToAttrs (
map (
{
name,
drive,
}: {
cryptstorage.device = lib.mkIf (name != "root") drive?device;
cryptoroot.device = lib.mkIf (name == "root") drive?device;
}
)
);
config.mods.drives.extraDrives
)
);
fileSystems = lib.mkIf (config.mods.drives.variant == "manual" && !config.conf.wsl) (
builtins.listToAttrs (
fileSystems = lib.mkIf (config.mods.drives.variant == "manual" && !config.conf.wsl) (
builtins.listToAttrs (
map (
{
name,
drive,
}: {
name = "/" + name;
value = drive;
}
)
config.mods.drives.extraDrives
)
// (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
"/" = {
device = "/dev/disk/by-label/ROOT";
fsType = config.mods.drives.homeAndRootFsTypes;
options = [
"noatime"
"nodiratime"
"discard"
];
};
"/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
"/home" = {
device = "/dev/disk/by-label/HOME";
fsType = config.mods.drives.homeAndRootFsTypes;
options = [
"noatime"
"nodiratime"
"discard"
];
};
}
);
swapDevices = lib.mkIf (config.mods.drives.useSwap && config.mods.drives.variant == "manual" && !config.conf.wsl) [
{device = "/dev/disk/by-label/SWAP";}
];
disko.devices = lib.mkIf (config.mods.drives.variant == "disko") {
disk =
{
main = (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
device = "${config.mods.drives.disko.defaultDiskId}";
type = "disk";
content = {
type = "gpt";
partitions = {
root = {
start = "${
if config.mods.drives.useSwap
then builtins.toString config.mods.drives.disko.swapAmount
else builtins.toString 1
}G";
end = "${builtins.toString config.mods.drives.disko.rootAmount}%";
content = {
type = "filesystem";
format = config.mods.drives.homeAndRootFsTypes;
mountpoint = "/";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
};
plainSwap = {
start = "1G";
end = "33G";
content = {
type = "swap";
discardPolicy = "both";
resumeDevice = true;
};
};
boot = {
start = "0G";
end = "1G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
};
home = {
start = "${builtins.toString config.mods.drives.disko.rootAmount}%";
end = "100%";
content = {
type = "filesystem";
format = config.mods.drives.homeAndRootFsTypes;
mountpoint = "/home";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
};
};
};
};
}
// builtins.listToAttrs (
map (
{
name,
@ -188,127 +306,7 @@
}
)
config.mods.drives.extraDrives
)
// (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
"/" = {
device = "/dev/disk/by-label/ROOT";
fsType = config.mods.drives.homeAndRootFsTypes;
options = [
"noatime"
"nodiratime"
"discard"
];
};
"/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
"/home" = {
device = "/dev/disk/by-label/HOME";
fsType = config.mods.drives.homeAndRootFsTypes;
options = [
"noatime"
"nodiratime"
"discard"
];
};
}
);
swapDevices = lib.mkIf (config.mods.drives.useSwap && config.mods.drives.variant == "manual" && !config.conf.wsl) [
{device = "/dev/disk/by-label/SWAP";}
];
disko.devices = lib.mkIf (config.mods.drives.variant == "disko") {
disk =
{
main = (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
device = "${config.mods.drives.disko.defaultDiskId}";
type = "disk";
content = {
type = "gpt";
partitions = {
root = {
start = "${
if config.mods.drives.useSwap
then builtins.toString config.mods.drives.disko.swapAmount
else builtins.toString 1
}G";
end = "${builtins.toString config.mods.drives.disko.rootAmount}%";
content = {
type = "filesystem";
format = config.mods.drives.homeAndRootFsTypes;
mountpoint = "/";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
};
plainSwap = {
start = "1G";
end = "33G";
content = {
type = "swap";
discardPolicy = "both";
resumeDevice = true;
};
};
boot = {
start = "0G";
end = "1G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
};
home = {
start = "${builtins.toString config.mods.drives.disko.rootAmount}%";
end = "100%";
content = {
type = "filesystem";
format = config.mods.drives.homeAndRootFsTypes;
mountpoint = "/home";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
};
};
};
};
}
// builtins.listToAttrs (
map (
{
name,
drive,
}: {
name = "/" + name;
value = drive;
}
)
config.mods.drives.extraDrives
);
};
}
);
);
};
};
}

View file

@ -1,5 +1,6 @@
{
lib,
pkgs,
config,
options,
...
@ -20,7 +21,7 @@
};
config = lib.mkIf config.mods.fancontrol.enable (
lib.optionalAttrs (options ? home.packages) {
programs.fancontrol-gui.enable = true;
home.packages = [pkgs.fancontrol-gui];
}
// (lib.optionalAttrs (options ? boot.kernelModules) {
boot = {

View file

@ -56,7 +56,7 @@
};
config = lib.optionalAttrs (options ? home.packages) {
xdg.configFile."fastfetch/config.jsonc" = lib.mkIf (config.mods.dashfetch.enable) {
xdg.configFile."fastfetch/config.jsonc" = lib.mkIf config.mods.dashfetch.enable {
source =
(pkgs.formats.json {}).generate "config.jsonc"
{

View file

@ -47,15 +47,13 @@
description = "ssh configuration (keys for git)";
};
};
config = (
lib.optionalAttrs (options ? programs.git && options ? home.file) {
programs.git = {
enable = true;
userName = config.mods.git.username;
userEmail = config.mods.git.email;
extraConfig = config.mods.git.additionalConfig;
};
home.file.".ssh/config".text = config.mods.git.sshConfig;
}
);
config = lib.optionalAttrs (options ? programs.git && options ? home.file) {
programs.git = {
enable = true;
userName = config.mods.git.username;
userEmail = config.mods.git.email;
extraConfig = config.mods.git.additionalConfig;
};
home.file.".ssh/config".text = config.mods.git.sshConfig;
};
}

View file

@ -130,9 +130,13 @@
'';
# unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = mkDashDefault true;
security.pam.services.greetd.sshAgentAuth = mkDashDefault true;
security.pam.sshAgentAuth.enable = mkDashDefault true;
security.pam = {
services.greetd = {
enableGnomeKeyring = mkDashDefault true;
sshAgentAuth = mkDashDefault true;
};
sshAgentAuth.enable = mkDashDefault true;
};
}
// lib.optionalAttrs (options ? home) {
xdg.configFile."regreet/regreet.toml".source =

View file

@ -24,102 +24,100 @@
description = "More scripts to be passed. (check existing ones for types and examples)";
};
};
config = (
lib.optionalAttrs (options ? home.packages) {
home.packages =
[
(lib.mkIf config.mods.scripts.changeBrightness (
pkgs.writeShellScriptBin "changeBrightness" ''
brightnessctl set "$1"
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
notify-send -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%"
''
))
(lib.mkIf config.mods.scripts.audioControl (
pkgs.writeShellScriptBin "audioControl" ''
ncspot() {
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%"
}
config = lib.optionalAttrs (options ? home.packages) {
home.packages =
[
(lib.mkIf config.mods.scripts.changeBrightness (
pkgs.writeShellScriptBin "changeBrightness" ''
brightnessctl set "$1"
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
notify-send -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%"
''
))
(lib.mkIf config.mods.scripts.audioControl (
pkgs.writeShellScriptBin "audioControl" ''
ncspot() {
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%"
}
firefox() {
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
# NUMS=',' read -r -a array <<< "$STRING"
readarray -td, NUMS <<<"$STRING"
declare -p NUMS
for index in "''${!NUMS[@]}"; do #"''${!array[@]}"
NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
done
VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%"
}
firefox() {
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
# NUMS=',' read -r -a array <<< "$STRING"
readarray -td, NUMS <<<"$STRING"
declare -p NUMS
for index in "''${!NUMS[@]}"; do #"''${!array[@]}"
NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
done
VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%"
}
internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
set_volume_sink() {
pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%"
}
set_volume_sink() {
pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%"
}
set_volume_source() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%"
}
set_volume_source() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%"
}
bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
mute() {
pactl set-sink-mute @DEFAULT_SINK@ toggle
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
}
mute() {
pactl set-sink-mute @DEFAULT_SINK@ toggle
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
}
if [ "$1" == "internal" ]; then
internal
elif [ "$1" == "bluetooth" ]; then
bluetooth
elif [ "$1" == "firefox" ]; then
firefox "$2"
elif [ "$1" == "ncspot" ]; then
ncspot "$2"
elif [ "$1" == "mute" ]; then
mute
elif [ "$1" == "sink" ]; then
set_volume_sink "$2"
elif [ "$1" == "source" ]; then
set_volume_source "$2"
fi
''
))
]
++ config.mods.scripts.scripts;
}
);
if [ "$1" == "internal" ]; then
internal
elif [ "$1" == "bluetooth" ]; then
bluetooth
elif [ "$1" == "firefox" ]; then
firefox "$2"
elif [ "$1" == "ncspot" ]; then
ncspot "$2"
elif [ "$1" == "mute" ]; then
mute
elif [ "$1" == "sink" ]; then
set_volume_sink "$2"
elif [ "$1" == "source" ]; then
set_volume_source "$2"
fi
''
))
]
++ config.mods.scripts.scripts;
};
}

View file

@ -23,7 +23,7 @@ in {
};
config = lib.mkIf config.mods.teams.enable (
lib.optionalAttrs (options ? home.packages) {
home.packages = [(callPackage ../../override/teams.nix {chromium = pkgs.chromium;})];
home.packages = [(callPackage ../../override/teams.nix {inherit (pkgs) chromium;})];
}
// (lib.optionalAttrs (options ? boot.kernelModules) {
boot = {

View file

@ -18,13 +18,11 @@
description = "Your variant";
};
};
config = (
lib.optionalAttrs (options ? services.xserver) {
# Configure keymap in X11
services.xserver = {
xkb.layout = "${config.mods.xkb.layout}";
xkb.variant = "${config.mods.xkb.variant}";
};
}
);
config = lib.optionalAttrs (options ? services.xserver) {
# Configure keymap in X11
services.xserver = {
xkb.layout = "${config.mods.xkb.layout}";
xkb.variant = "${config.mods.xkb.variant}";
};
};
}

View file

@ -52,7 +52,7 @@
lib.mkIf config.mods.yazi.enable {
home.packages = [pkgs.glow];
programs.yazi = {
enable = conf.enable;
inherit (conf) enable;
settings = conf.settings // config.mods.yazi.additionalKeymap;
keymap = conf.keymap // config.mods.yazi.additionalConfig;
plugins = config.mods.yazi.plugins;