From ab485dec3523b41265d741156a954771fdd9a41b Mon Sep 17 00:00:00 2001 From: Myned Date: Thu, 12 Sep 2024 20:50:53 -0500 Subject: [PATCH] nix: format with alejandra Signed-off-by: Myned --- configuration.nix | 135 ++++---- flake.nix | 3 +- machines/myarm/disko.nix | 2 +- machines/myarm/hardware-configuration.nix | 12 +- machines/myeck/default.nix | 2 +- machines/myeck/disko.nix | 2 +- machines/myeck/hardware-configuration.nix | 12 +- machines/myne/disko.nix | 2 +- machines/myne/hardware-configuration.nix | 12 +- machines/mynix/disko.nix | 2 +- machines/mynix/hardware-configuration.nix | 12 +- machines/myork/default.nix | 9 +- machines/myork/disko.nix | 2 +- machines/myork/hardware-configuration.nix | 12 +- machines/mypi3/default.nix | 2 +- machines/mypi3/hardware-configuration.nix | 16 +- options/custom/default.nix | 48 +-- options/custom/desktops/default.nix | 9 +- options/custom/desktops/gnome/default.nix | 14 +- options/custom/desktops/hyprland/default.nix | 14 +- options/custom/desktops/hyprland/plugins.nix | 12 +- options/custom/desktops/hyprland/settings.nix | 38 +- options/custom/desktops/kde/default.nix | 18 +- options/custom/files/agenix.nix | 18 +- options/custom/files/default.nix | 9 +- options/custom/files/dev.nix | 16 +- options/custom/files/mnt.nix | 18 +- options/custom/files/nixos.nix | 16 +- options/custom/programs/adb.nix | 18 +- options/custom/programs/ags/default.nix | 12 +- options/custom/programs/alacritty.nix | 16 +- .../custom/programs/anime-game-launcher.nix | 16 +- options/custom/programs/appimage.nix | 16 +- options/custom/programs/bitwarden-menu.nix | 16 +- options/custom/programs/chromium.nix | 16 +- options/custom/programs/clipse.nix | 10 +- options/custom/programs/dconf.nix | 16 +- options/custom/programs/default.nix | 9 +- options/custom/programs/direnv.nix | 16 +- options/custom/programs/discord.nix | 18 +- options/custom/programs/element-desktop.nix | 16 +- options/custom/programs/fastfetch.nix | 14 +- options/custom/programs/firefox.nix | 127 ++++--- options/custom/programs/fish.nix | 16 +- options/custom/programs/foot.nix | 16 +- options/custom/programs/fuzzel.nix | 16 +- options/custom/programs/gamemode.nix | 16 +- options/custom/programs/gamescope.nix | 16 +- options/custom/programs/git.nix | 16 +- options/custom/programs/gnome-shell.nix | 35 +- options/custom/programs/gnome-terminal.nix | 16 +- options/custom/programs/gpg.nix | 16 +- options/custom/programs/htop.nix | 48 +-- options/custom/programs/hyprlock.nix | 16 +- options/custom/programs/kdeconnect.nix | 16 +- options/custom/programs/kitty.nix | 16 +- options/custom/programs/libreoffice.nix | 16 +- options/custom/programs/librewolf.nix | 16 +- options/custom/programs/localsend.nix | 22 +- options/custom/programs/logseq.nix | 18 +- options/custom/programs/man.nix | 16 +- options/custom/programs/mangohud.nix | 10 +- options/custom/programs/mosh.nix | 16 +- options/custom/programs/nano.nix | 16 +- options/custom/programs/nautilus.nix | 10 +- .../custom/programs/networkmanager-dmenu.nix | 36 +- options/custom/programs/nh.nix | 16 +- options/custom/programs/nheko.nix | 16 +- options/custom/programs/nix-index.nix | 16 +- options/custom/programs/nix-ld.nix | 16 +- options/custom/programs/nushell.nix | 16 +- options/custom/programs/nvtop.nix | 16 +- options/custom/programs/obs-studio.nix | 16 +- options/custom/programs/onedrive.nix | 16 +- options/custom/programs/path-of-building.nix | 10 +- options/custom/programs/rbw.nix | 10 +- options/custom/programs/rofi-rbw.nix | 16 +- options/custom/programs/rofi.nix | 14 +- options/custom/programs/seahorse.nix | 16 +- options/custom/programs/slurp.nix | 16 +- options/custom/programs/ssh.nix | 16 +- options/custom/programs/steam.nix | 38 +- options/custom/programs/swaylock.nix | 12 +- options/custom/programs/thunderbird.nix | 10 +- options/custom/programs/tio.nix | 18 +- options/custom/programs/tmux.nix | 16 +- options/custom/programs/vscode.nix | 10 +- options/custom/programs/wezterm/default.nix | 16 +- options/custom/programs/wireshark.nix | 18 +- options/custom/programs/wofi.nix | 16 +- options/custom/programs/wpaperd.nix | 16 +- options/custom/scripts/default.nix | 326 +++++++++--------- options/custom/services/agenix.nix | 12 +- options/custom/services/auto-cpufreq.nix | 20 +- options/custom/services/avizo.nix | 16 +- options/custom/services/blueman-applet.nix | 16 +- options/custom/services/blueman.nix | 16 +- options/custom/services/borgmatic.nix | 26 +- options/custom/services/caddy.nix | 28 +- options/custom/services/clipcat.nix | 16 +- options/custom/services/cliphist.nix | 16 +- options/custom/services/create_ap.nix | 39 +-- options/custom/services/dbus.nix | 12 +- options/custom/services/default.nix | 9 +- options/custom/services/easyeffects.nix | 16 +- options/custom/services/flatpak.nix | 10 +- options/custom/services/fprintd.nix | 16 +- options/custom/services/fw-fanctrl.nix | 38 +- options/custom/services/fwupd.nix | 18 +- options/custom/services/gammastep.nix | 16 +- options/custom/services/geoclue2.nix | 28 +- options/custom/services/gnome-keyring.nix | 16 +- options/custom/services/gpg-agent.nix | 10 +- options/custom/services/greetd.nix | 10 +- options/custom/services/hypridle.nix | 10 +- options/custom/services/hyprpaper.nix | 14 +- options/custom/services/kdeconnect.nix | 16 +- options/custom/services/keyd.nix | 16 +- options/custom/services/libinput.nix | 16 +- options/custom/services/logind.nix | 16 +- options/custom/services/mako.nix | 16 +- options/custom/services/matrix-conduit.nix | 56 ++- options/custom/services/modufur.nix | 22 +- options/custom/services/netbird.nix | 16 +- options/custom/services/netdata.nix | 57 ++- .../services/network-manager-applet.nix | 16 +- options/custom/services/onedrive.nix | 16 +- options/custom/services/piped.nix | 12 +- options/custom/services/pipewire.nix | 16 +- options/custom/services/playerctld.nix | 16 +- .../custom/services/power-profiles-daemon.nix | 16 +- options/custom/services/ratbagd.nix | 12 +- options/custom/services/samba.nix | 16 +- options/custom/services/swayidle.nix | 10 +- options/custom/services/swaync/default.nix | 16 +- options/custom/services/swayosd.nix | 16 +- options/custom/services/syncthing.nix | 125 +++---- options/custom/services/tailscale.nix | 35 +- options/custom/services/udev.nix | 26 +- options/custom/services/upower.nix | 16 +- options/custom/services/xembed-sni-proxy.nix | 16 +- options/custom/settings/accounts.nix | 16 +- options/custom/settings/boot.nix | 30 +- .../settings/containers/actualbudget.nix | 14 +- options/custom/settings/containers/coturn.nix | 24 +- .../custom/settings/containers/default.nix | 39 ++- .../custom/settings/containers/forgejo.nix | 38 +- .../custom/settings/containers/foundryvtt.nix | 30 +- .../custom/settings/containers/headscale.nix | 26 +- .../settings/containers/homeassistant.nix | 14 +- .../custom/settings/containers/mastodon.nix | 38 +- .../custom/settings/containers/nextcloud.nix | 34 +- options/custom/settings/containers/redlib.nix | 12 +- .../settings/containers/searxng/default.nix | 30 +- options/custom/settings/dconf/apps.nix | 16 +- options/custom/settings/dconf/default.nix | 16 +- options/custom/settings/dconf/gnome-shell.nix | 80 ++--- options/custom/settings/dconf/gnome.nix | 112 +++--- options/custom/settings/default.nix | 9 +- options/custom/settings/environment.nix | 24 +- options/custom/settings/fonts.nix | 20 +- options/custom/settings/gtk/default.nix | 10 +- options/custom/settings/hardware.nix | 16 +- options/custom/settings/mounts.nix | 78 ++--- options/custom/settings/networking.nix | 32 +- options/custom/settings/packages.nix | 40 +-- options/custom/settings/qt.nix | 16 +- options/custom/settings/security.nix | 16 +- options/custom/settings/users.nix | 47 ++- options/custom/settings/vm.nix | 47 ++- options/custom/settings/waydroid.nix | 16 +- options/custom/settings/xdg.nix | 10 +- options/default.nix | 7 +- profiles/console/default.nix | 16 +- profiles/sbc/default.nix | 2 +- secrets/secrets.nix | 4 +- 176 files changed, 1852 insertions(+), 2126 deletions(-) diff --git a/configuration.nix b/configuration.nix index 24e49dc..7b9d316 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,86 +3,75 @@ inputs, lib, ... -}: - -{ - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "common/nix/access-tokens.conf" = secret "common/nix/access-tokens.conf"; +}: { + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "common/nix/access-tokens.conf" = secret "common/nix/access-tokens.conf"; + }; ### NixOS - nixpkgs = - let - config = { - allowUnfree = true; + nixpkgs = let + config = { + allowUnfree = true; - allowInsecurePredicate = - pkg: - let - name = lib.getName pkg; - in - # HACK: Allow all insecure electron versions - name == "electron" + allowInsecurePredicate = pkg: let + name = lib.getName pkg; + in + # HACK: Allow all insecure electron versions + name + == "electron" + # HACK: Some Matrix clients rely on libolm, which is deprecated + # https://github.com/NixOS/nixpkgs/pull/334638 + || name == "cinny" + || name == "cinny-unwrapped" + || name == "fluffychat-linux" + || name == "olm" + || name == "openssl"; # Cisco Packet Tracer + }; + in { + inherit config; - # HACK: Some Matrix clients rely on libolm, which is deprecated - # https://github.com/NixOS/nixpkgs/pull/334638 - || name == "cinny" - || name == "cinny-unwrapped" - || name == "fluffychat-linux" - || name == "olm" - || name == "openssl"; # Cisco Packet Tracer - }; - in - { - inherit config; - - overlays = [ - ( - final: prev: - let - nixpkgs = - branch: - import inputs."nixpkgs-${branch}" { - inherit config; - system = prev.system; - }; - - stable = nixpkgs "stable"; - unstable = nixpkgs "unstable"; - staging-next = nixpkgs "staging-next"; - local = nixpkgs "local"; - in - { - # Overlay nixpkgs branches - #?? nixpkgs.BRANCH.PACKAGE - inherit stable unstable staging-next; - - # Hypr* - hypridle = inputs.hypridle.packages.${prev.system}.default; - hyprland = inputs.hyprland.packages.${prev.system}.default; - hyprlock = inputs.hyprlock.packages.${prev.system}.default; - - # TODO: Remove when merged into unstable - # https://github.com/NixOS/nixpkgs/pull/338836 - xdg-desktop-portal-hyprland = - inputs.xdg-desktop-portal-hyprland.packages.${prev.system}.xdg-desktop-portal-hyprland; - - hyprlandPlugins = { - hyprbars = inputs.hyprland-plugins.packages.${prev.system}.hyprbars; + overlays = [ + ( + final: prev: let + nixpkgs = branch: + import inputs."nixpkgs-${branch}" { + inherit config; + system = prev.system; }; - # Development - ciscoPacketTracer8 = local.ciscoPacketTracer8; - } - ) - ]; - }; + stable = nixpkgs "stable"; + unstable = nixpkgs "unstable"; + staging-next = nixpkgs "staging-next"; + local = nixpkgs "local"; + in { + # Overlay nixpkgs branches + #?? nixpkgs.BRANCH.PACKAGE + inherit stable unstable staging-next; + + # Hypr* + hypridle = inputs.hypridle.packages.${prev.system}.default; + hyprland = inputs.hyprland.packages.${prev.system}.default; + hyprlock = inputs.hyprlock.packages.${prev.system}.default; + + # TODO: Remove when merged into unstable + # https://github.com/NixOS/nixpkgs/pull/338836 + xdg-desktop-portal-hyprland = + inputs.xdg-desktop-portal-hyprland.packages.${prev.system}.xdg-desktop-portal-hyprland; + + hyprlandPlugins = { + hyprbars = inputs.hyprland-plugins.packages.${prev.system}.hyprbars; + }; + + # Development + ciscoPacketTracer8 = local.ciscoPacketTracer8; + } + ) + ]; + }; nix = { #!! Override upstream nix diff --git a/flake.nix b/flake.nix index 52b0aaf..e706091 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,4 @@ # Do not modify! This file is generated. - { inputs = { aagl-gtk-on-nix-stable = { @@ -135,4 +134,4 @@ }; }; outputs = inputs: inputs.flakegen ./flake.in.nix inputs; -} \ No newline at end of file +} diff --git a/machines/myarm/disko.nix b/machines/myarm/disko.nix index 7a3734f..fd038fa 100644 --- a/machines/myarm/disko.nix +++ b/machines/myarm/disko.nix @@ -21,7 +21,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/machines/myarm/hardware-configuration.nix b/machines/myarm/hardware-configuration.nix index 07d3157..8d011cf 100644 --- a/machines/myarm/hardware-configuration.nix +++ b/machines/myarm/hardware-configuration.nix @@ -7,19 +7,17 @@ pkgs, modulesPath, ... -}: - -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; +}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_scsi" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/myeck/default.nix b/machines/myeck/default.nix index c748dc2..f0ac707 100644 --- a/machines/myeck/default.nix +++ b/machines/myeck/default.nix @@ -19,5 +19,5 @@ }; }; - systemd.tmpfiles.rules = [ "z /mnt/external 0755 myned users" ]; + systemd.tmpfiles.rules = ["z /mnt/external 0755 myned users"]; } diff --git a/machines/myeck/disko.nix b/machines/myeck/disko.nix index 3e33499..0e3964b 100644 --- a/machines/myeck/disko.nix +++ b/machines/myeck/disko.nix @@ -21,7 +21,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/machines/myeck/hardware-configuration.nix b/machines/myeck/hardware-configuration.nix index c06227c..502f799 100644 --- a/machines/myeck/hardware-configuration.nix +++ b/machines/myeck/hardware-configuration.nix @@ -7,10 +7,8 @@ pkgs, modulesPath, ... -}: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot.initrd.availableKernelModules = [ "nvme" @@ -21,9 +19,9 @@ "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/myne/disko.nix b/machines/myne/disko.nix index 596abc0..7967f51 100644 --- a/machines/myne/disko.nix +++ b/machines/myne/disko.nix @@ -26,7 +26,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/machines/myne/hardware-configuration.nix b/machines/myne/hardware-configuration.nix index 949e33f..deb8482 100644 --- a/machines/myne/hardware-configuration.nix +++ b/machines/myne/hardware-configuration.nix @@ -7,10 +7,8 @@ pkgs, modulesPath, ... -}: - -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; +}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.initrd.availableKernelModules = [ "ahci" @@ -20,9 +18,9 @@ "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/mynix/disko.nix b/machines/mynix/disko.nix index 0577352..65debfd 100644 --- a/machines/mynix/disko.nix +++ b/machines/mynix/disko.nix @@ -26,7 +26,7 @@ passwordFile = "/tmp/secret.key"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/machines/mynix/hardware-configuration.nix b/machines/mynix/hardware-configuration.nix index ab71533..cc7b604 100644 --- a/machines/mynix/hardware-configuration.nix +++ b/machines/mynix/hardware-configuration.nix @@ -7,10 +7,8 @@ pkgs, modulesPath, ... -}: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot.initrd.availableKernelModules = [ "xhci_pci" @@ -21,9 +19,9 @@ "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/myork/default.nix b/machines/myork/default.nix index 652bf6f..266ef27 100644 --- a/machines/myork/default.nix +++ b/machines/myork/default.nix @@ -4,12 +4,9 @@ lib, pkgs, ... -}: - -let +}: let brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; -in -{ +in { imports = [ inputs.nixos-hardware.nixosModules.framework-13-7040-amd @@ -35,7 +32,7 @@ in home-manager.users.${config.custom.username} = with lib; { wayland.windowManager.hyprland.settings = { - exec-once = [ "${brightnessctl} set 0%" ]; + exec-once = ["${brightnessctl} set 0%"]; master = { mfact = mkForce 0.5; diff --git a/machines/myork/disko.nix b/machines/myork/disko.nix index 0577352..65debfd 100644 --- a/machines/myork/disko.nix +++ b/machines/myork/disko.nix @@ -26,7 +26,7 @@ passwordFile = "/tmp/secret.key"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/machines/myork/hardware-configuration.nix b/machines/myork/hardware-configuration.nix index 5a0fef2..b1c0beb 100644 --- a/machines/myork/hardware-configuration.nix +++ b/machines/myork/hardware-configuration.nix @@ -7,10 +7,8 @@ pkgs, modulesPath, ... -}: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot.initrd.availableKernelModules = [ "nvme" @@ -20,9 +18,9 @@ "uas" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/mypi3/default.nix b/machines/mypi3/default.nix index 6eb21b0..0c9f85a 100644 --- a/machines/mypi3/default.nix +++ b/machines/mypi3/default.nix @@ -1,5 +1,5 @@ { - imports = [ ./hardware-configuration.nix ]; + imports = [./hardware-configuration.nix]; custom.hostname = "mypi3"; diff --git a/machines/mypi3/hardware-configuration.nix b/machines/mypi3/hardware-configuration.nix index d42fd9b..8758661 100644 --- a/machines/mypi3/hardware-configuration.nix +++ b/machines/mypi3/hardware-configuration.nix @@ -7,22 +7,20 @@ pkgs, modulesPath, ... -}: +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = []; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; fileSystems."/" = { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; fsType = "ext4"; }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/options/custom/default.nix b/options/custom/default.nix index 426b52e..fcff8e9 100644 --- a/options/custom/default.nix +++ b/options/custom/default.nix @@ -1,38 +1,38 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.custom; +in { options.custom = { ### Profiles - default = mkOption { default = true; }; - full = mkOption { default = false; }; - minimal = mkOption { default = cfg.full; }; - profile = mkOption { }; + default = mkOption {default = true;}; + full = mkOption {default = false;}; + minimal = mkOption {default = cfg.full;}; + profile = mkOption {}; ### Users - domain = mkOption { default = "bjork.tech"; }; - hostname = mkOption { }; - realname = mkOption { default = "Myned"; }; - username = mkOption { default = "myned"; }; + domain = mkOption {default = "bjork.tech";}; + hostname = mkOption {}; + realname = mkOption {default = "Myned";}; + username = mkOption {default = "myned";}; ### Hardware - width = mkOption { default = 1920; }; - height = mkOption { default = 1080; }; - ultrawide = mkOption { default = cfg.width * 9 / 16 > cfg.height; }; # Wider than 16:9 - hidpi = mkOption { default = cfg.scale > 1; }; - scale = mkOption { default = 1; }; + width = mkOption {default = 1920;}; + height = mkOption {default = 1080;}; + ultrawide = mkOption {default = cfg.width * 9 / 16 > cfg.height;}; # Wider than 16:9 + hidpi = mkOption {default = cfg.scale > 1;}; + scale = mkOption {default = 1;}; # TODO: Use option for border size - border = mkOption { default = 2; }; + border = mkOption {default = 2;}; - gap = mkOption { default = 10; }; - padding = mkOption { default = 56; }; # ?? journalctl --user -u waybar.service | grep height: + gap = mkOption {default = 10;}; + padding = mkOption {default = 56;}; # ?? journalctl --user -u waybar.service | grep height: ### Misc - wallpaper = mkOption { default = false; }; + wallpaper = mkOption {default = false;}; }; } diff --git a/options/custom/desktops/default.nix b/options/custom/desktops/default.nix index d1db652..1fc15f0 100644 --- a/options/custom/desktops/default.nix +++ b/options/custom/desktops/default.nix @@ -1,7 +1,8 @@ -{ config, lib, ... }: - -with lib; - { + config, + lib, + ... +}: +with lib; { config.custom.desktops.hyprland.enable = config.custom.full; } diff --git a/options/custom/desktops/gnome/default.nix b/options/custom/desktops/gnome/default.nix index f3512ea..5d7ab45 100644 --- a/options/custom/desktops/gnome/default.nix +++ b/options/custom/desktops/gnome/default.nix @@ -4,16 +4,12 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.desktops.gnome; -in -{ +in { options.custom.desktops.gnome = { - enable = mkOption { default = false; }; - gdm = mkOption { default = true; }; + enable = mkOption {default = false;}; + gdm = mkOption {default = true;}; }; config = mkIf cfg.enable { @@ -30,6 +26,6 @@ in # Remove default packages # https://wiki.nixos.org/wiki/GNOME#Excluding_GNOME_Applications - environment.gnome.excludePackages = [ pkgs.gnome-shell-extensions ]; + environment.gnome.excludePackages = [pkgs.gnome-shell-extensions]; }; } diff --git a/options/custom/desktops/hyprland/default.nix b/options/custom/desktops/hyprland/default.nix index dfada53..9d421a6 100644 --- a/options/custom/desktops/hyprland/default.nix +++ b/options/custom/desktops/hyprland/default.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.desktops.hyprland; -in -{ - options.custom.desktops.hyprland.enable = mkOption { default = false; }; +in { + options.custom.desktops.hyprland.enable = mkOption {default = false;}; config = mkIf cfg.enable { custom.desktops.hyprland = mkIf config.custom.full { @@ -26,7 +22,7 @@ in xdg.portal = { enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; # Prefer hyprland over gtk portal config.common.default = [ @@ -38,7 +34,7 @@ in # https://wiki.hyprland.org home-manager.users.${config.custom.username}.wayland.windowManager.hyprland = { enable = true; - systemd.variables = [ "--all" ]; # Import some environment variables into session + systemd.variables = ["--all"]; # Import some environment variables into session }; }; } diff --git a/options/custom/desktops/hyprland/plugins.nix b/options/custom/desktops/hyprland/plugins.nix index f27d97d..da9a8bc 100644 --- a/options/custom/desktops/hyprland/plugins.nix +++ b/options/custom/desktops/hyprland/plugins.nix @@ -4,22 +4,18 @@ pkgs, ... }: - -with lib; - -let +with lib; let hyprctl = "${pkgs.hyprland}/bin/hyprctl"; cfg = config.custom.desktops.hyprland.plugins; -in -{ - options.custom.desktops.hyprland.plugins.enable = mkOption { default = false; }; +in { + options.custom.desktops.hyprland.plugins.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { wayland.windowManager.hyprland = { # https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars # https://wiki.hyprland.org/Plugins/Using-Plugins - plugins = with pkgs.hyprlandPlugins; [ hyprbars ]; + plugins = with pkgs.hyprlandPlugins; [hyprbars]; settings = { #!! Static rules diff --git a/options/custom/desktops/hyprland/settings.nix b/options/custom/desktops/hyprland/settings.nix index e701db2..d8b55e2 100644 --- a/options/custom/desktops/hyprland/settings.nix +++ b/options/custom/desktops/hyprland/settings.nix @@ -4,10 +4,7 @@ pkgs, ... }: - -with lib; - -let +with lib; let clipse = "${pkgs.clipse}/bin/clipse"; firefox-esr = "${ config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage @@ -22,9 +19,8 @@ let }/bin/waybar"; cfg = config.custom.desktops.hyprland.settings; -in -{ - options.custom.desktops.hyprland.settings.enable = mkOption { default = false; }; +in { + options.custom.desktops.hyprland.settings.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { wayland.windowManager.hyprland.settings = { @@ -51,12 +47,12 @@ in #?? envd = VARIABLE, VALUE # HACK: Mapped home-manager variables to envd in lieu of upstream fix # https://github.com/nix-community/home-manager/issues/2659 - envd = - with builtins; + envd = with builtins; attrValues ( mapAttrs ( name: value: "${name}, ${toString value}" - ) config.home-manager.users.${config.custom.username}.home.sessionVariables + ) + config.home-manager.users.${config.custom.username}.home.sessionVariables ) ++ [ "EDITOR, gnome-text-editor" @@ -66,15 +62,16 @@ in #// exec = [ ]; # https://wiki.hyprland.org/Configuring/Keywords/#executing - exec-once = [ - "${rm} ~/.config/qalculate/qalc.dmenu.history" # Clear calc history - "${clipse} -clear" # Clear clipboard history - "${clipse} -listen" # Monitor clipboard - sway-audio-idle-inhibit # Inhibit idle while audio is playing + exec-once = + [ + "${rm} ~/.config/qalculate/qalc.dmenu.history" # Clear calc history + "${clipse} -clear" # Clear clipboard history + "${clipse} -listen" # Monitor clipboard + sway-audio-idle-inhibit # Inhibit idle while audio is playing - # TODO: Remove when systemd service fixed - # https://github.com/Alexays/Waybar/issues/2882 - "${sleep} 2 && ${systemctl} --user restart waybar" + # TODO: Remove when systemd service fixed + # https://github.com/Alexays/Waybar/issues/2882 + "${sleep} 2 && ${systemctl} --user restart waybar" "[group new lock; tile] ${firefox-esr}" ] @@ -143,7 +140,10 @@ in "col.inactive" = "rgba(6c71c440)"; "col.locked_active" = "rgb(d33682)"; "col.locked_inactive" = "rgba(d3368240)"; - font_size = if config.custom.hidpi then 16 else 10; + font_size = + if config.custom.hidpi + then 16 + else 10; height = 5; render_titles = false; text_color = "rgb(93a1a1)"; diff --git a/options/custom/desktops/kde/default.nix b/options/custom/desktops/kde/default.nix index c001859..077850f 100644 --- a/options/custom/desktops/kde/default.nix +++ b/options/custom/desktops/kde/default.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.desktops.kde; -in { - options.custom.desktops.kde.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.desktops.kde; +in { + options.custom.desktops.kde.enable = mkOption {default = false;}; - config = mkIf cfg.enable { services.desktopManager.plasma6.enable = true; }; + config = mkIf cfg.enable {services.desktopManager.plasma6.enable = true;}; } diff --git a/options/custom/files/agenix.nix b/options/custom/files/agenix.nix index e23188a..81abfef 100644 --- a/options/custom/files/agenix.nix +++ b/options/custom/files/agenix.nix @@ -1,16 +1,16 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.files.agenix; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.custom.files.agenix; +in { # https://wiki.nixos.org/wiki/Agenix # https://github.com/ryantm/agenix - options.custom.files.agenix.enable = mkOption { default = false; }; + options.custom.files.agenix.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.identityPaths = [ "/etc/ssh/id_ed25519" ]; # !! Must be set without sshd + age.identityPaths = ["/etc/ssh/id_ed25519"]; # !! Must be set without sshd }; } diff --git a/options/custom/files/default.nix b/options/custom/files/default.nix index b740578..a164ffb 100644 --- a/options/custom/files/default.nix +++ b/options/custom/files/default.nix @@ -1,8 +1,9 @@ -{ config, lib, ... }: - -with lib; - { + config, + lib, + ... +}: +with lib; { config.custom.files = mkIf config.custom.default { agenix.enable = true; dev.enable = true; diff --git a/options/custom/files/dev.nix b/options/custom/files/dev.nix index 1cc8a72..9a91fb7 100644 --- a/options/custom/files/dev.nix +++ b/options/custom/files/dev.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.files.dev; -in { - options.custom.files.dev.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.files.dev; +in { + options.custom.files.dev.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # .keep empty file needed to create empty directory diff --git a/options/custom/files/mnt.nix b/options/custom/files/mnt.nix index aeb5aa8..5c4b856 100644 --- a/options/custom/files/mnt.nix +++ b/options/custom/files/mnt.nix @@ -1,15 +1,15 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.files.mnt; -in { - options.custom.files.mnt.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.files.mnt; +in { + options.custom.files.mnt.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Set /mnt permissions - systemd.tmpfiles.rules = [ "z /mnt 0755 root root" ]; + systemd.tmpfiles.rules = ["z /mnt 0755 root root"]; }; } diff --git a/options/custom/files/nixos.nix b/options/custom/files/nixos.nix index c5040d1..028dc97 100644 --- a/options/custom/files/nixos.nix +++ b/options/custom/files/nixos.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.files.nixos; -in { - options.custom.files.nixos.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.files.nixos; +in { + options.custom.files.nixos.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html diff --git a/options/custom/programs/adb.nix b/options/custom/programs/adb.nix index 1d7140c..5df874f 100644 --- a/options/custom/programs/adb.nix +++ b/options/custom/programs/adb.nix @@ -1,17 +1,17 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.adb; -in { - options.custom.programs.adb.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.adb; +in { + options.custom.programs.adb.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Android # https://developer.android.com/tools/adb programs.adb.enable = true; - users.users.${config.custom.username}.extraGroups = [ "adbusers" ]; + users.users.${config.custom.username}.extraGroups = ["adbusers"]; }; } diff --git a/options/custom/programs/ags/default.nix b/options/custom/programs/ags/default.nix index 2ee45ff..ab2245e 100644 --- a/options/custom/programs/ags/default.nix +++ b/options/custom/programs/ags/default.nix @@ -4,17 +4,13 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.ags; -in -{ - options.custom.programs.ags.enable = mkOption { default = false; }; +in { + options.custom.programs.ags.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { - imports = [ inputs.ags.homeManagerModules.default ]; + imports = [inputs.ags.homeManagerModules.default]; # https://aylur.github.io/ags-docs # https://github.com/Aylur/ags diff --git a/options/custom/programs/alacritty.nix b/options/custom/programs/alacritty.nix index 31653d1..2b06708 100644 --- a/options/custom/programs/alacritty.nix +++ b/options/custom/programs/alacritty.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.alacritty; -in { - options.custom.programs.alacritty.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.alacritty; +in { + options.custom.programs.alacritty.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/alacritty/alacritty diff --git a/options/custom/programs/anime-game-launcher.nix b/options/custom/programs/anime-game-launcher.nix index ceece99..d74aa10 100644 --- a/options/custom/programs/anime-game-launcher.nix +++ b/options/custom/programs/anime-game-launcher.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.anime-game-launcher; -in { - options.custom.programs.anime-game-launcher.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.anime-game-launcher; +in { + options.custom.programs.anime-game-launcher.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/an-anime-team diff --git a/options/custom/programs/appimage.nix b/options/custom/programs/appimage.nix index 3a69ff6..08f16cd 100644 --- a/options/custom/programs/appimage.nix +++ b/options/custom/programs/appimage.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.appimage; -in { - options.custom.programs.appimage.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.appimage; +in { + options.custom.programs.appimage.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Appimage diff --git a/options/custom/programs/bitwarden-menu.nix b/options/custom/programs/bitwarden-menu.nix index 9264bc7..2970cce 100644 --- a/options/custom/programs/bitwarden-menu.nix +++ b/options/custom/programs/bitwarden-menu.nix @@ -1,14 +1,14 @@ -{ config, lib, ... }: - -with lib; - -let +{ + config, + lib, + ... +}: +with lib; let wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; cfg = config.custom.programs.bitwarden-menu; -in -{ - options.custom.programs.bitwarden-menu.enable = mkOption { default = false; }; +in { + options.custom.programs.bitwarden-menu.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/firecat53/bitwarden-menu diff --git a/options/custom/programs/chromium.nix b/options/custom/programs/chromium.nix index eae2bd6..31e9037 100644 --- a/options/custom/programs/chromium.nix +++ b/options/custom/programs/chromium.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.chromium; -in { - options.custom.programs.chromium.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.chromium; +in { + options.custom.programs.chromium.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Chromium diff --git a/options/custom/programs/clipse.nix b/options/custom/programs/clipse.nix index 6aa6019..d54d418 100644 --- a/options/custom/programs/clipse.nix +++ b/options/custom/programs/clipse.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.clipse; -in -{ - options.custom.programs.clipse.enable = mkOption { default = false; }; +in { + options.custom.programs.clipse.enable = mkOption {default = false;}; config = { # https://github.com/savedra1/clipse diff --git a/options/custom/programs/dconf.nix b/options/custom/programs/dconf.nix index 636d236..041f6ef 100644 --- a/options/custom/programs/dconf.nix +++ b/options/custom/programs/dconf.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.dconf; -in { - options.custom.programs.dconf.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.dconf; +in { + options.custom.programs.dconf.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://gitlab.gnome.org/GNOME/dconf diff --git a/options/custom/programs/default.nix b/options/custom/programs/default.nix index 6f2e270..f7f07c9 100644 --- a/options/custom/programs/default.nix +++ b/options/custom/programs/default.nix @@ -1,8 +1,9 @@ -{ config, lib, ... }: - -with lib; - { + config, + lib, + ... +}: +with lib; { config.custom.programs = mkMerge [ (mkIf config.custom.default { direnv.enable = true; diff --git a/options/custom/programs/direnv.nix b/options/custom/programs/direnv.nix index 4b48137..7cac240 100644 --- a/options/custom/programs/direnv.nix +++ b/options/custom/programs/direnv.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.direnv; -in { - options.custom.programs.direnv.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.direnv; +in { + options.custom.programs.direnv.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/direnv/direnv diff --git a/options/custom/programs/discord.nix b/options/custom/programs/discord.nix index 850fd9d..b1315f7 100644 --- a/options/custom/programs/discord.nix +++ b/options/custom/programs/discord.nix @@ -1,16 +1,16 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.discord; -in { - options.custom.programs.discord.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.discord; +in { + options.custom.programs.discord.enable = mkOption {default = false;}; config.home-manager.users.myned = mkIf cfg.enable { home.file.".config/BetterDiscord".source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink - "/home/${config.custom.username}/SYNC/common/config/discord/BetterDiscord"; + "/home/${config.custom.username}/SYNC/common/config/discord/BetterDiscord"; }; } diff --git a/options/custom/programs/element-desktop.nix b/options/custom/programs/element-desktop.nix index 0f7c0a2..36c7ad3 100644 --- a/options/custom/programs/element-desktop.nix +++ b/options/custom/programs/element-desktop.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.element-desktop; -in { - options.custom.programs.element-desktop.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.element-desktop; +in { + options.custom.programs.element-desktop.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # Element Desktop custom themes diff --git a/options/custom/programs/fastfetch.nix b/options/custom/programs/fastfetch.nix index e813748..9ef50fc 100644 --- a/options/custom/programs/fastfetch.nix +++ b/options/custom/programs/fastfetch.nix @@ -4,23 +4,19 @@ pkgs, ... }: - -with lib; - -let +with lib; let fastfetch = "${pkgs.fastfetch}/bin/fastfetch"; cfg = config.custom.programs.fastfetch; -in -{ +in { options.custom.programs.fastfetch = { - enable = mkOption { default = false; }; - greet = mkOption { default = false; }; + enable = mkOption {default = false;}; + greet = mkOption {default = false;}; }; config = mkIf cfg.enable { # https://github.com/fastfetch-cli/fastfetch - environment.systemPackages = [ pkgs.fastfetch ]; + environment.systemPackages = [pkgs.fastfetch]; # System info greeting programs.fish.interactiveShellInit = mkIf cfg.greet '' diff --git a/options/custom/programs/firefox.nix b/options/custom/programs/firefox.nix index 329ec10..5beb7b9 100644 --- a/options/custom/programs/firefox.nix +++ b/options/custom/programs/firefox.nix @@ -5,14 +5,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.firefox; -in -{ - options.custom.programs.firefox.enable = mkOption { default = false; }; +in { + options.custom.programs.firefox.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # TODO: Switch to librewolf when supported by module @@ -116,13 +112,12 @@ in # https://mozilla.github.io/policy-templates/#extensionsettings #?? https://addons.mozilla.org/en-US/firefox #?? about:support#addons - ExtensionSettings = - let - extension = id: { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi"; - installation_mode = "normal_installed"; - }; - in + ExtensionSettings = let + extension = id: { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi"; + installation_mode = "normal_installed"; + }; + in mkMerge [ (mkIf config.custom.minimal { "uBlock0@raymondhill.net" = extension "ublock-origin"; # uBlock Origin @@ -194,59 +189,57 @@ in #!! Only certain preferences are supported via policies # https://mozilla.github.io/policy-templates/#preferences #?? about:config - Preferences = - let - locked = value: { - Value = value; - Status = "locked"; - }; - in - { - "accessibility.browsewithcaret" = locked false; - "accessibility.typeaheadfind" = locked false; - "browser.aboutConfig.showWarning" = locked false; - "browser.contentblocking.category" = locked "standard"; - "browser.crashReports.unsubmittedCheck.autoSubmit2" = locked false; - "browser.ctrlTab.sortByRecentlyUsed" = locked false; - "browser.download.always_ask_before_handling_new_types" = locked false; - "browser.download.useDownloadDir" = locked true; - "browser.link.open_newwindow" = locked 3; # New tab - "browser.link.open_newwindow.restriction" = locked 0; # Popups in new tab - "browser.newtabpage.enabled" = locked true; - "browser.preferences.defaultPerformanceSettings.enabled" = locked true; - "browser.quitShortcut.disabled" = locked true; - "browser.search.widget.inNavBar" = locked false; - "browser.startup.homepage" = locked "about:home"; - "browser.startup.page" = locked 3; # Previous session - "browser.tabs.closeTabByDblclick" = locked true; - "browser.tabs.closeWindowWithLastTab" = locked false; - "browser.tabs.insertAfterCurrent" = locked false; - "browser.tabs.insertRelatedAfterCurrent" = locked false; - "browser.tabs.loadInBackground" = locked true; - "browser.tabs.warnOnClose" = locked false; - "browser.tabs.warnOnCloseOtherTabs" = locked false; - "browser.theme.dark-private-windows" = locked false; - "browser.toolbars.bookmarks.showOtherBookmarks" = locked false; - "browser.uidensity" = locked 0; - "browser.warnOnQuitShortcut" = locked true; - "dom.security.https_only_mode" = locked true; - "extensions.formautofill.addresses.enabled" = locked false; - "extensions.formautofill.creditCards.enabled" = locked false; - "general.autoScroll" = locked false; - "general.smoothScroll" = locked true; - "layers.acceleration.force-enabled" = locked true; - "layout.css.always_underline_links" = locked false; - "layout.css.backdrop-filter.enabled" = locked true; - "layout.spellcheckDefault" = locked 0; # Disabled - "media.eme.enabled" = locked true; # DRM - "media.hardwaremediakeys.enabled" = locked true; - "media.hardware-video-decoding.enabled" = locked false; # !! Disable video acceleration - #// "media.rdd-process.enabled" = locked false; # RDD sandbox #!! Insecure - "toolkit.legacyUserProfileCustomizations.stylesheets" = locked true; - "ui.key.menuAccessKey" = locked 0; # Disable menu key - "widget.gtk.overlay-scrollbars.enabled" = locked true; - "widget.gtk.rounded-bottom-corners.enabled" = locked true; + Preferences = let + locked = value: { + Value = value; + Status = "locked"; }; + in { + "accessibility.browsewithcaret" = locked false; + "accessibility.typeaheadfind" = locked false; + "browser.aboutConfig.showWarning" = locked false; + "browser.contentblocking.category" = locked "standard"; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = locked false; + "browser.ctrlTab.sortByRecentlyUsed" = locked false; + "browser.download.always_ask_before_handling_new_types" = locked false; + "browser.download.useDownloadDir" = locked true; + "browser.link.open_newwindow" = locked 3; # New tab + "browser.link.open_newwindow.restriction" = locked 0; # Popups in new tab + "browser.newtabpage.enabled" = locked true; + "browser.preferences.defaultPerformanceSettings.enabled" = locked true; + "browser.quitShortcut.disabled" = locked true; + "browser.search.widget.inNavBar" = locked false; + "browser.startup.homepage" = locked "about:home"; + "browser.startup.page" = locked 3; # Previous session + "browser.tabs.closeTabByDblclick" = locked true; + "browser.tabs.closeWindowWithLastTab" = locked false; + "browser.tabs.insertAfterCurrent" = locked false; + "browser.tabs.insertRelatedAfterCurrent" = locked false; + "browser.tabs.loadInBackground" = locked true; + "browser.tabs.warnOnClose" = locked false; + "browser.tabs.warnOnCloseOtherTabs" = locked false; + "browser.theme.dark-private-windows" = locked false; + "browser.toolbars.bookmarks.showOtherBookmarks" = locked false; + "browser.uidensity" = locked 0; + "browser.warnOnQuitShortcut" = locked true; + "dom.security.https_only_mode" = locked true; + "extensions.formautofill.addresses.enabled" = locked false; + "extensions.formautofill.creditCards.enabled" = locked false; + "general.autoScroll" = locked false; + "general.smoothScroll" = locked true; + "layers.acceleration.force-enabled" = locked true; + "layout.css.always_underline_links" = locked false; + "layout.css.backdrop-filter.enabled" = locked true; + "layout.spellcheckDefault" = locked 0; # Disabled + "media.eme.enabled" = locked true; # DRM + "media.hardwaremediakeys.enabled" = locked true; + "media.hardware-video-decoding.enabled" = locked false; # !! Disable video acceleration + #// "media.rdd-process.enabled" = locked false; # RDD sandbox #!! Insecure + "toolkit.legacyUserProfileCustomizations.stylesheets" = locked true; + "ui.key.menuAccessKey" = locked 0; # Disable menu key + "widget.gtk.overlay-scrollbars.enabled" = locked true; + "widget.gtk.rounded-bottom-corners.enabled" = locked true; + }; SearchBar = "unified"; @@ -552,7 +545,7 @@ in "Downloads/stg" = mkIf config.custom.full { source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink - "/home/myned/SYNC/common/config/extensions/Simple Tab Groups"; + "/home/myned/SYNC/common/config/extensions/Simple Tab Groups"; }; # Work around icon dissociation due to missing --name flag in actions diff --git a/options/custom/programs/fish.nix b/options/custom/programs/fish.nix index 578480f..a9ac6c7 100644 --- a/options/custom/programs/fish.nix +++ b/options/custom/programs/fish.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.fish; -in { - options.custom.programs.fish.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.fish; +in { + options.custom.programs.fish.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Fish diff --git a/options/custom/programs/foot.nix b/options/custom/programs/foot.nix index ac5ceb5..82c4084 100644 --- a/options/custom/programs/foot.nix +++ b/options/custom/programs/foot.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.foot; -in { - options.custom.programs.foot.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.foot; +in { + options.custom.programs.foot.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://codeberg.org/dnkl/foot diff --git a/options/custom/programs/fuzzel.nix b/options/custom/programs/fuzzel.nix index ec94bb0..9cc68b4 100644 --- a/options/custom/programs/fuzzel.nix +++ b/options/custom/programs/fuzzel.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.fuzzel; -in { - options.custom.programs.fuzzel.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.fuzzel; +in { + options.custom.programs.fuzzel.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://codeberg.org/dnkl/fuzzel diff --git a/options/custom/programs/gamemode.nix b/options/custom/programs/gamemode.nix index b5c5342..6172ac5 100644 --- a/options/custom/programs/gamemode.nix +++ b/options/custom/programs/gamemode.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.gamemode; -in { - options.custom.programs.gamemode.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.gamemode; +in { + options.custom.programs.gamemode.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/FeralInteractive/gamemode diff --git a/options/custom/programs/gamescope.nix b/options/custom/programs/gamescope.nix index c49bc86..d05e6c4 100644 --- a/options/custom/programs/gamescope.nix +++ b/options/custom/programs/gamescope.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.gamescope; -in { - options.custom.programs.gamescope.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.gamescope; +in { + options.custom.programs.gamescope.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/ValveSoftware/gamescope diff --git a/options/custom/programs/git.nix b/options/custom/programs/git.nix index 9a4f859..d45354d 100644 --- a/options/custom/programs/git.nix +++ b/options/custom/programs/git.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.git; -in { - options.custom.programs.git.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.git; +in { + options.custom.programs.git.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.archlinux.org/title/Git diff --git a/options/custom/programs/gnome-shell.nix b/options/custom/programs/gnome-shell.nix index 8244541..f98c8eb 100644 --- a/options/custom/programs/gnome-shell.nix +++ b/options/custom/programs/gnome-shell.nix @@ -4,43 +4,38 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.gnome-shell; -in -{ - options.custom.programs.gnome-shell.enable = mkOption { default = false; }; +in { + options.custom.programs.gnome-shell.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # BUG: programs.gnome-shell.theme option forces installation of gnome-shell-extensions programs.gnome-shell = { enable = true; - extensions = - with pkgs.gnomeExtensions; + extensions = with pkgs.gnomeExtensions; optionals config.custom.default [ - { package = appindicator; } # https://github.com/ubuntu/gnome-shell-extension-appindicator + {package = appindicator;} # https://github.com/ubuntu/gnome-shell-extension-appindicator ] ++ optionals config.custom.minimal [ - { package = caffeine; } # https://github.com/eonpatapon/gnome-shell-extension-caffeine - { package = dash-to-dock; } # https://github.com/micheleg/dash-to-dock + {package = caffeine;} # https://github.com/eonpatapon/gnome-shell-extension-caffeine + {package = dash-to-dock;} # https://github.com/micheleg/dash-to-dock #// { package = dash2dock-lite; } # https://github.com/icedman/dash2dock-lite - { package = gsconnect; } # https://github.com/GSConnect/gnome-shell-extension-gsconnect - { package = just-perfection; } # https://gitlab.gnome.org/jrahmatzadeh/just-perfection - { package = rounded-window-corners-reborn; } # https://github.com/flexagoon/rounded-window-corners + {package = gsconnect;} # https://github.com/GSConnect/gnome-shell-extension-gsconnect + {package = just-perfection;} # https://gitlab.gnome.org/jrahmatzadeh/just-perfection + {package = rounded-window-corners-reborn;} # https://github.com/flexagoon/rounded-window-corners #// { package = user-themes; } # https://gitlab.gnome.org/GNOME/gnome-shell-extensions ] ++ optionals config.custom.full [ #// { package = auto-move-windows; } # https://gitlab.gnome.org/GNOME/gnome-shell-extensions - { package = clipboard-indicator; } # https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator - { package = ddterm; } # https://github.com/ddterm/gnome-shell-extension-ddterm + {package = clipboard-indicator;} # https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator + {package = ddterm;} # https://github.com/ddterm/gnome-shell-extension-ddterm #// { package = hide-top-bar; } # https://gitlab.gnome.org/tuxor1337/hidetopbar - { package = media-controls; } # https://github.com/sakithb/media-controls + {package = media-controls;} # https://github.com/sakithb/media-controls #// { package = smart-auto-move; } # https://github.com/khimaros/smart-auto-move - { package = tailscale-qs; } # https://github.com/joaophi/tailscale-gnome-qs - { package = tiling-assistant; } # https://github.com/Leleat/Tiling-Assistant + {package = tailscale-qs;} # https://github.com/joaophi/tailscale-gnome-qs + {package = tiling-assistant;} # https://github.com/Leleat/Tiling-Assistant ]; }; }; diff --git a/options/custom/programs/gnome-terminal.nix b/options/custom/programs/gnome-terminal.nix index 54493f3..6cb33b9 100644 --- a/options/custom/programs/gnome-terminal.nix +++ b/options/custom/programs/gnome-terminal.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.gnome-terminal; -in { - options.custom.programs.gnome-terminal.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.gnome-terminal; +in { + options.custom.programs.gnome-terminal.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://gitlab.gnome.org/GNOME/gnome-terminal diff --git a/options/custom/programs/gpg.nix b/options/custom/programs/gpg.nix index ec39a33..aa8b817 100644 --- a/options/custom/programs/gpg.nix +++ b/options/custom/programs/gpg.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.gpg; -in { - options.custom.programs.gpg.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.gpg; +in { + options.custom.programs.gpg.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.archlinux.org/title/GnuPG diff --git a/options/custom/programs/htop.nix b/options/custom/programs/htop.nix index 9d99340..ac01710 100644 --- a/options/custom/programs/htop.nix +++ b/options/custom/programs/htop.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.htop; -in { - options.custom.programs.htop.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.htop; +in { + options.custom.programs.htop.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/htop-dev/htop @@ -71,25 +71,25 @@ in } // ( with config.home-manager.users.${config.custom.username}.lib.htop; - leftMeters [ - (bar "LeftCPUs4") - (text "Blank") - (bar "CPU") - (bar "MemorySwap") - (text "System") - (text "DateTime") - ] + leftMeters [ + (bar "LeftCPUs4") + (text "Blank") + (bar "CPU") + (bar "MemorySwap") + (text "System") + (text "DateTime") + ] ) // ( with config.home-manager.users.${config.custom.username}.lib.htop; - rightMeters [ - (bar "RightCPUs4") - (text "Blank") - (bar "NetworkIO") - (bar "DiskIO") - (text "Hostname") - (text "Uptime") - ] + rightMeters [ + (bar "RightCPUs4") + (text "Blank") + (bar "NetworkIO") + (bar "DiskIO") + (text "Hostname") + (text "Uptime") + ] ); }; diff --git a/options/custom/programs/hyprlock.nix b/options/custom/programs/hyprlock.nix index b9e46ff..3ef4985 100644 --- a/options/custom/programs/hyprlock.nix +++ b/options/custom/programs/hyprlock.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.hyprlock; -in { - options.custom.programs.hyprlock.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.hyprlock; +in { + options.custom.programs.hyprlock.enable = mkOption {default = false;}; config = mkIf cfg.enable { programs.hyprlock.enable = true; # Grant PAM access diff --git a/options/custom/programs/kdeconnect.nix b/options/custom/programs/kdeconnect.nix index f5be0fd..5819ab5 100644 --- a/options/custom/programs/kdeconnect.nix +++ b/options/custom/programs/kdeconnect.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.kdeconnect; -in { - options.custom.programs.kdeconnect.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.kdeconnect; +in { + options.custom.programs.kdeconnect.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/KDE/kdeconnect-kde diff --git a/options/custom/programs/kitty.nix b/options/custom/programs/kitty.nix index d2f31d9..452818b 100644 --- a/options/custom/programs/kitty.nix +++ b/options/custom/programs/kitty.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.kitty; -in { - options.custom.programs.kitty.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.kitty; +in { + options.custom.programs.kitty.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://sw.kovidgoyal.net/kitty/ diff --git a/options/custom/programs/libreoffice.nix b/options/custom/programs/libreoffice.nix index c5a1a3b..f1e76d7 100644 --- a/options/custom/programs/libreoffice.nix +++ b/options/custom/programs/libreoffice.nix @@ -4,25 +4,21 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.libreoffice; -in -{ +in { options.custom.programs.libreoffice = { - enable = mkOption { default = false; }; - package = mkOption { default = pkgs.libreoffice-fresh; }; + enable = mkOption {default = false;}; + package = mkOption {default = pkgs.libreoffice-fresh;}; }; config = mkIf cfg.enable { # https://www.libreoffice.org - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [cfg.package]; #!! Options not available, files synced home-manager.users.${config.custom.username}.home.file.".config/libreoffice/4/user".source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink - "/home/${config.custom.username}/SYNC/linux/config/libreoffice/user"; + "/home/${config.custom.username}/SYNC/linux/config/libreoffice/user"; }; } diff --git a/options/custom/programs/librewolf.nix b/options/custom/programs/librewolf.nix index 23eb1dc..407106d 100644 --- a/options/custom/programs/librewolf.nix +++ b/options/custom/programs/librewolf.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.librewolf; -in { - options.custom.programs.librewolf.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.librewolf; +in { + options.custom.programs.librewolf.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://codeberg.org/librewolf diff --git a/options/custom/programs/localsend.nix b/options/custom/programs/localsend.nix index bd601c8..3425b5d 100644 --- a/options/custom/programs/localsend.nix +++ b/options/custom/programs/localsend.nix @@ -1,15 +1,16 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.localsend; -in { - options.custom.programs.localsend.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.localsend; +in { + options.custom.programs.localsend.enable = mkOption {default = false;}; config = - if (versionAtLeast version "24.11") then + if (versionAtLeast version "24.11") + then (mkIf cfg.enable { # https://github.com/localsend/localsend programs.localsend = { @@ -17,6 +18,5 @@ in openFirewall = true; }; }) - else - { }; + else {}; } diff --git a/options/custom/programs/logseq.nix b/options/custom/programs/logseq.nix index cb0facf..aae8a22 100644 --- a/options/custom/programs/logseq.nix +++ b/options/custom/programs/logseq.nix @@ -1,17 +1,17 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.logseq; -in { - options.custom.programs.logseq.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.logseq; +in { + options.custom.programs.logseq.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { #!! Synced imperative configuration home.file.".logseq/".source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink - "/home/${config.custom.username}/SYNC/common/config/logseq/"; + "/home/${config.custom.username}/SYNC/common/config/logseq/"; }; } diff --git a/options/custom/programs/man.nix b/options/custom/programs/man.nix index d4dbe40..52dffa4 100644 --- a/options/custom/programs/man.nix +++ b/options/custom/programs/man.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.man; -in { - options.custom.programs.man.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.man; +in { + options.custom.programs.man.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Enable as much offline docs as possible diff --git a/options/custom/programs/mangohud.nix b/options/custom/programs/mangohud.nix index 2ec1a55..173e282 100644 --- a/options/custom/programs/mangohud.nix +++ b/options/custom/programs/mangohud.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.mangohud; -in -{ - options.custom.programs.mangohud.enable = mkOption { default = false; }; +in { + options.custom.programs.mangohud.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/flightlessmango/MangoHud diff --git a/options/custom/programs/mosh.nix b/options/custom/programs/mosh.nix index 8b74c77..cdbcdeb 100644 --- a/options/custom/programs/mosh.nix +++ b/options/custom/programs/mosh.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.mosh; -in { - options.custom.programs.mosh.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.mosh; +in { + options.custom.programs.mosh.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Mosh diff --git a/options/custom/programs/nano.nix b/options/custom/programs/nano.nix index 8767387..36646de 100644 --- a/options/custom/programs/nano.nix +++ b/options/custom/programs/nano.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nano; -in { - options.custom.programs.nano.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nano; +in { + options.custom.programs.nano.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.archlinux.org/title/Nano diff --git a/options/custom/programs/nautilus.nix b/options/custom/programs/nautilus.nix index 5b82f63..5502600 100644 --- a/options/custom/programs/nautilus.nix +++ b/options/custom/programs/nautilus.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.nautilus; -in -{ - options.custom.programs.nautilus.enable = mkOption { default = false; }; +in { + options.custom.programs.nautilus.enable = mkOption {default = false;}; config = mkIf cfg.enable { services.gvfs.enable = true; # Trash dependency diff --git a/options/custom/programs/networkmanager-dmenu.nix b/options/custom/programs/networkmanager-dmenu.nix index b11d99c..3b7f125 100644 --- a/options/custom/programs/networkmanager-dmenu.nix +++ b/options/custom/programs/networkmanager-dmenu.nix @@ -1,28 +1,26 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.networkmanager-dmenu; -in { - options.custom.programs.networkmanager-dmenu.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.networkmanager-dmenu; +in { + options.custom.programs.networkmanager-dmenu.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/firecat53/networkmanager-dmenu # https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example #!! Option not available, files written directly # FIXME: active_chars does not take effect - home.file.".config/networkmanager-dmenu/config.ini".text = - let - wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; - in - '' - [dmenu] - dmenu_command = ${wofi} --dmenu --lines 11 - active_chars = > - wifi_icons = 󰤯󰤟󰤢󰤥󰤨 - format = {icon} {name} - ''; + home.file.".config/networkmanager-dmenu/config.ini".text = let + wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; + in '' + [dmenu] + dmenu_command = ${wofi} --dmenu --lines 11 + active_chars = > + wifi_icons = 󰤯󰤟󰤢󰤥󰤨 + format = {icon} {name} + ''; }; } diff --git a/options/custom/programs/nh.nix b/options/custom/programs/nh.nix index feacad7..0cdeba7 100644 --- a/options/custom/programs/nh.nix +++ b/options/custom/programs/nh.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nh; -in { - options.custom.programs.nh.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nh; +in { + options.custom.programs.nh.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/viperML/nh diff --git a/options/custom/programs/nheko.nix b/options/custom/programs/nheko.nix index 6da0c19..541c31c 100644 --- a/options/custom/programs/nheko.nix +++ b/options/custom/programs/nheko.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nheko; -in { - options.custom.programs.nheko.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nheko; +in { + options.custom.programs.nheko.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/Nheko-Reborn/nheko diff --git a/options/custom/programs/nix-index.nix b/options/custom/programs/nix-index.nix index 90bc9f1..44bb54c 100644 --- a/options/custom/programs/nix-index.nix +++ b/options/custom/programs/nix-index.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nix-index; -in { - options.custom.programs.nix-index.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nix-index; +in { + options.custom.programs.nix-index.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/nix-community/nix-index diff --git a/options/custom/programs/nix-ld.nix b/options/custom/programs/nix-ld.nix index 02066d9..7d3cc70 100644 --- a/options/custom/programs/nix-ld.nix +++ b/options/custom/programs/nix-ld.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nix-ld; -in { - options.custom.programs.nix-ld.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nix-ld; +in { + options.custom.programs.nix-ld.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/nix-community/nix-ld diff --git a/options/custom/programs/nushell.nix b/options/custom/programs/nushell.nix index f16b2ba..0a49fad 100644 --- a/options/custom/programs/nushell.nix +++ b/options/custom/programs/nushell.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nushell; -in { - options.custom.programs.nushell.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nushell; +in { + options.custom.programs.nushell.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # TODO: Create config diff --git a/options/custom/programs/nvtop.nix b/options/custom/programs/nvtop.nix index 57923ae..f145b3f 100644 --- a/options/custom/programs/nvtop.nix +++ b/options/custom/programs/nvtop.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.nvtop; -in { - options.custom.programs.nvtop.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.nvtop; +in { + options.custom.programs.nvtop.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/Syllo/nvtop diff --git a/options/custom/programs/obs-studio.nix b/options/custom/programs/obs-studio.nix index 2ad3a39..85e4266 100644 --- a/options/custom/programs/obs-studio.nix +++ b/options/custom/programs/obs-studio.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.obs-studio; -in { - options.custom.programs.obs-studio.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.obs-studio; +in { + options.custom.programs.obs-studio.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/obsproject/obs-studio diff --git a/options/custom/programs/onedrive.nix b/options/custom/programs/onedrive.nix index fcb0110..5214359 100644 --- a/options/custom/programs/onedrive.nix +++ b/options/custom/programs/onedrive.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.onedrive; -in { - options.custom.programs.onedrive.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.onedrive; +in { + options.custom.programs.onedrive.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/abraunegg/onedrive diff --git a/options/custom/programs/path-of-building.nix b/options/custom/programs/path-of-building.nix index c43e1e3..fc89860 100644 --- a/options/custom/programs/path-of-building.nix +++ b/options/custom/programs/path-of-building.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.path-of-building; -in -{ - options.custom.programs.path-of-building.enable = mkOption { default = false; }; +in { + options.custom.programs.path-of-building.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { xdg.desktopEntries.path-of-building = { diff --git a/options/custom/programs/rbw.nix b/options/custom/programs/rbw.nix index c3bcf98..240e909 100644 --- a/options/custom/programs/rbw.nix +++ b/options/custom/programs/rbw.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.rbw; -in -{ - options.custom.programs.rbw.enable = mkOption { default = false; }; +in { + options.custom.programs.rbw.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/doy/rbw diff --git a/options/custom/programs/rofi-rbw.nix b/options/custom/programs/rofi-rbw.nix index f213faa..5b929e5 100644 --- a/options/custom/programs/rofi-rbw.nix +++ b/options/custom/programs/rofi-rbw.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.rofi-rbw; -in { - options.custom.programs.rofi-rbw.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.rofi-rbw; +in { + options.custom.programs.rofi-rbw.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/fdw/rofi-rbw diff --git a/options/custom/programs/rofi.nix b/options/custom/programs/rofi.nix index 47c3c19..a581ec0 100644 --- a/options/custom/programs/rofi.nix +++ b/options/custom/programs/rofi.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.rofi; -in -{ - options.custom.programs.rofi.enable = mkOption { default = false; }; +in { + options.custom.programs.rofi.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { #!! Creates package derivation @@ -30,8 +26,8 @@ in # Build against rofi-wayland due to ABI incompatibility with upstream # https://github.com/lbonn/rofi/issues/96 # https://github.com/NixOS/nixpkgs/issues/298539 - (rofi-calc.override { rofi-unwrapped = rofi-wayland-unwrapped; }) # Calculator - (rofi-top.override { rofi-unwrapped = rofi-wayland-unwrapped; }) # System monitor + (rofi-calc.override {rofi-unwrapped = rofi-wayland-unwrapped;}) # Calculator + (rofi-top.override {rofi-unwrapped = rofi-wayland-unwrapped;}) # System monitor ]; #?? rofi-theme-selector diff --git a/options/custom/programs/seahorse.nix b/options/custom/programs/seahorse.nix index 4432208..9986c6e 100644 --- a/options/custom/programs/seahorse.nix +++ b/options/custom/programs/seahorse.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.seahorse; -in { - options.custom.programs.seahorse.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.seahorse; +in { + options.custom.programs.seahorse.enable = mkOption {default = false;}; config = mkIf cfg.enable { programs.seahorse.enable = true; diff --git a/options/custom/programs/slurp.nix b/options/custom/programs/slurp.nix index 1685759..74eab88 100644 --- a/options/custom/programs/slurp.nix +++ b/options/custom/programs/slurp.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.slurp; -in { - options.custom.programs.slurp.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.slurp; +in { + options.custom.programs.slurp.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/emersion/slurp diff --git a/options/custom/programs/ssh.nix b/options/custom/programs/ssh.nix index 0d36c44..00330f6 100644 --- a/options/custom/programs/ssh.nix +++ b/options/custom/programs/ssh.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.ssh; -in { - options.custom.programs.ssh.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.ssh; +in { + options.custom.programs.ssh.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Disable prompt for new hosts diff --git a/options/custom/programs/steam.nix b/options/custom/programs/steam.nix index 981704b..f378b76 100644 --- a/options/custom/programs/steam.nix +++ b/options/custom/programs/steam.nix @@ -4,33 +4,31 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.steam; -in -{ +in { # https://wiki.nixos.org/wiki/Steam # https://store.steampowered.com options.custom.programs.steam = { - enable = mkOption { default = false; }; - extest = mkOption { default = false; }; + enable = mkOption {default = false;}; + extest = mkOption {default = false;}; }; config = mkIf cfg.enable { - programs.steam = { - enable = true; - extest.enable = cfg.extest; # Work around invisible cursor on Wayland - extraCompatPackages = [ pkgs.proton-ge-bin ]; - - gamescopeSession = { + programs.steam = + { enable = true; - # args = [ - # "--backend sdl" - # "--fullscreen" - # ]; - }; - } // optionalAttrs (versionAtLeast version "24.11") { protontricks.enable = true; }; + extest.enable = cfg.extest; # Work around invisible cursor on Wayland + extraCompatPackages = [pkgs.proton-ge-bin]; + + gamescopeSession = { + enable = true; + # args = [ + # "--backend sdl" + # "--fullscreen" + # ]; + }; + } + // optionalAttrs (versionAtLeast version "24.11") {protontricks.enable = true;}; }; } diff --git a/options/custom/programs/swaylock.nix b/options/custom/programs/swaylock.nix index 18f5531..2868654 100644 --- a/options/custom/programs/swaylock.nix +++ b/options/custom/programs/swaylock.nix @@ -4,19 +4,15 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.swaylock; -in -{ - options.custom.programs.swaylock.enable = mkOption { default = false; }; +in { + options.custom.programs.swaylock.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Allow swaylock to unlock the session # https://wiki.nixos.org/wiki/Sway#Swaylock_cannot_be_unlocked_with_the_correct_password - security.pam.services.swaylock = { }; + security.pam.services.swaylock = {}; # https://github.com/swaywm/swaylock home-manager.users.${config.custom.username}.programs.swaylock = { diff --git a/options/custom/programs/thunderbird.nix b/options/custom/programs/thunderbird.nix index 00cc1af..cc38733 100644 --- a/options/custom/programs/thunderbird.nix +++ b/options/custom/programs/thunderbird.nix @@ -5,14 +5,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.thunderbird; -in -{ - options.custom.programs.thunderbird.enable = mkOption { default = false; }; +in { + options.custom.programs.thunderbird.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Thunderbird diff --git a/options/custom/programs/tio.nix b/options/custom/programs/tio.nix index 179e928..7edd28b 100644 --- a/options/custom/programs/tio.nix +++ b/options/custom/programs/tio.nix @@ -1,17 +1,17 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.tio; -in { - options.custom.programs.tio.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.tio; +in { + options.custom.programs.tio.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Allow serial device access # https://github.com/tio/tio?tab=readme-ov-file#46-known-issues - users.users.${config.custom.username}.extraGroups = [ "dialout" ]; + users.users.${config.custom.username}.extraGroups = ["dialout"]; # https://github.com/tio/tio #!! Options not available, files written directly diff --git a/options/custom/programs/tmux.nix b/options/custom/programs/tmux.nix index eb60f05..e0d8604 100644 --- a/options/custom/programs/tmux.nix +++ b/options/custom/programs/tmux.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.tmux; -in { - options.custom.programs.tmux.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.tmux; +in { + options.custom.programs.tmux.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Tmux diff --git a/options/custom/programs/vscode.nix b/options/custom/programs/vscode.nix index bafdf25..58a11af 100644 --- a/options/custom/programs/vscode.nix +++ b/options/custom/programs/vscode.nix @@ -5,14 +5,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.programs.vscode; -in -{ - options.custom.programs.vscode.enable = mkOption { default = false; }; +in { + options.custom.programs.vscode.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.nixos.org/wiki/VSCodium diff --git a/options/custom/programs/wezterm/default.nix b/options/custom/programs/wezterm/default.nix index e28e513..1e4de34 100644 --- a/options/custom/programs/wezterm/default.nix +++ b/options/custom/programs/wezterm/default.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.wezterm; -in { - options.custom.programs.wezterm.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.wezterm; +in { + options.custom.programs.wezterm.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/wez/wezterm diff --git a/options/custom/programs/wireshark.nix b/options/custom/programs/wireshark.nix index 0114056..46f44bc 100644 --- a/options/custom/programs/wireshark.nix +++ b/options/custom/programs/wireshark.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.wireshark; -in { - options.custom.programs.wireshark.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.wireshark; +in { + options.custom.programs.wireshark.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://gitlab.com/wireshark/wireshark @@ -15,6 +15,6 @@ in package = pkgs.wireshark; # GUI }; - users.users.${config.custom.username}.extraGroups = [ "wireshark" ]; + users.users.${config.custom.username}.extraGroups = ["wireshark"]; }; } diff --git a/options/custom/programs/wofi.nix b/options/custom/programs/wofi.nix index 2d10e4e..5f574f6 100644 --- a/options/custom/programs/wofi.nix +++ b/options/custom/programs/wofi.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.wofi; -in { - options.custom.programs.wofi.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.wofi; +in { + options.custom.programs.wofi.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://hg.sr.ht/~scoopta/wofi diff --git a/options/custom/programs/wpaperd.nix b/options/custom/programs/wpaperd.nix index 33a302b..9c50cac 100644 --- a/options/custom/programs/wpaperd.nix +++ b/options/custom/programs/wpaperd.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.programs.wpaperd; -in { - options.custom.programs.wpaperd.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.programs.wpaperd; +in { + options.custom.programs.wpaperd.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/danyspin97/wpaperd diff --git a/options/custom/scripts/default.nix b/options/custom/scripts/default.nix index 52e1745..2b2b675 100644 --- a/options/custom/scripts/default.nix +++ b/options/custom/scripts/default.nix @@ -4,180 +4,174 @@ pkgs, ... }: - -with lib; - -let +with lib; let # Use packages from local derivation git = config.home-manager.users.${config.custom.username}.programs.git.package; hyprland = config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage; wofi = config.home-manager.users.${config.custom.username}.programs.wofi.package; -in -{ - config.home-manager.users.${config.custom.username}.home.file = - let - # Place script.ext in the same directory as this file - #?? pkg = (SHELL "NAME" [ DEPENDENCIES ]) - # https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-writeShellApplication - bash = name: dependencies: { - ".local/bin/${name}".source = - pkgs.writeShellApplication { - inherit name; - runtimeInputs = dependencies; - text = builtins.readFile ./${name}.sh; - } - + "/bin/${name}"; - }; +in { + config.home-manager.users.${config.custom.username}.home.file = let + # Place script.ext in the same directory as this file + #?? pkg = (SHELL "NAME" [ DEPENDENCIES ]) + # https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-writeShellApplication + bash = name: dependencies: { + ".local/bin/${name}".source = + pkgs.writeShellApplication { + inherit name; + runtimeInputs = dependencies; + text = builtins.readFile ./${name}.sh; + } + + "/bin/${name}"; + }; - # https://wiki.nixos.org/wiki/Nix-writers#Python3 - # Always latest python version in nixpkgs, use writers.makePythonWriter to pin version - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/writers/scripts.nix#L605 - python = name: dependencies: { - ".local/bin/${name}".source = - pkgs.writers.writePython3Bin name { libraries = dependencies; } - # Disable linting - # https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files - ("# flake8: noqa\n" + builtins.readFile ./${name}.py) - + "/bin/${name}"; - }; - in + # https://wiki.nixos.org/wiki/Nix-writers#Python3 + # Always latest python version in nixpkgs, use writers.makePythonWriter to pin version + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/writers/scripts.nix#L605 + python = name: dependencies: { + ".local/bin/${name}".source = + pkgs.writers.writePython3Bin name {libraries = dependencies;} + # Disable linting + # https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files + ("# flake8: noqa\n" + builtins.readFile ./${name}.py) + + "/bin/${name}"; + }; + in mkIf config.custom.full ( with pkgs; - mkMerge ( - [ - # Bash files with extension .sh - (bash "audio" [ - easyeffects - libnotify + mkMerge ( + [ + # Bash files with extension .sh + (bash "audio" [ + easyeffects + libnotify + ]) + (bash "bwm" [ + bitwarden-cli + coreutils + jq + libnotify + wl-clipboard + wofi + xclip + ]) + (bash "calc" [ + coreutils + libnotify + libqalculate + wl-clipboard + wofi + xclip + ]) + (bash "clipboard" [ + cliphist + libnotify + procps + wl-clipboard + wofi + xclip + ]) + (bash "close" [ + coreutils + hyprland + jq + libnotify + ]) + (bash "fingerprints" [ + fprintd + libnotify + ]) + (bash "flakegen" [ + git + libnotify + nix + ]) + (bash "inhibit" [ + coreutils + libnotify + systemd + ]) + (bash "left" [ + hyprland + jq + libnotify + ]) + (bash "minimize" [ + hyprland + jq + libnotify + ]) + (bash "network" [ + libnotify + networkmanager + ]) + (bash "power" [ + libnotify + power-profiles-daemon + ]) + (bash "rebuild" [ + libnotify + nixos-rebuild + ]) + (bash "repl" [ + libnotify + nixos-rebuild + ]) + (bash "screenshot" [ + coreutils + grimblast + imagemagick + libnotify + swappy + ]) + (bash "target" [ + libnotify + nixos-rebuild + ]) + (bash "toggle" [ + gnugrep + hyprland + jq + libnotify + ]) + (bash "upgrade" [ + libnotify + nix + nixos-rebuild + ]) + (bash "vm" [ + coreutils + freerdp3 + iputils + libnotify + libvirt + remmina + ]) + (bash "vpn" [ + gnused + jq + libnotify + tailscale + ]) + (bash "vrr" [ + hyprland + jq + libnotify + ]) + (bash "wallpaper" [ + coreutils + fd + imagemagick + libnotify + rsync + swww + tailscale + ]) + ] + ++ (with pkgs.python3Packages; [ + # Python files with extension .py + (python "bcrypt" [bcrypt]) ]) - (bash "bwm" [ - bitwarden-cli - coreutils - jq - libnotify - wl-clipboard - wofi - xclip - ]) - (bash "calc" [ - coreutils - libnotify - libqalculate - wl-clipboard - wofi - xclip - ]) - (bash "clipboard" [ - cliphist - libnotify - procps - wl-clipboard - wofi - xclip - ]) - (bash "close" [ - coreutils - hyprland - jq - libnotify - ]) - (bash "fingerprints" [ - fprintd - libnotify - ]) - (bash "flakegen" [ - git - libnotify - nix - ]) - (bash "inhibit" [ - coreutils - libnotify - systemd - ]) - (bash "left" [ - hyprland - jq - libnotify - ]) - (bash "minimize" [ - hyprland - jq - libnotify - ]) - (bash "network" [ - libnotify - networkmanager - ]) - (bash "power" [ - libnotify - power-profiles-daemon - ]) - (bash "rebuild" [ - libnotify - nixos-rebuild - ]) - (bash "repl" [ - libnotify - nixos-rebuild - ]) - (bash "screenshot" [ - coreutils - grimblast - imagemagick - libnotify - swappy - ]) - (bash "target" [ - libnotify - nixos-rebuild - ]) - (bash "toggle" [ - gnugrep - hyprland - jq - libnotify - ]) - (bash "upgrade" [ - libnotify - nix - nixos-rebuild - ]) - (bash "vm" [ - coreutils - freerdp3 - iputils - libnotify - libvirt - remmina - ]) - (bash "vpn" [ - gnused - jq - libnotify - tailscale - ]) - (bash "vrr" [ - hyprland - jq - libnotify - ]) - (bash "wallpaper" [ - coreutils - fd - imagemagick - libnotify - rsync - swww - tailscale - ]) - - ] - ++ (with pkgs.python3Packages; [ - # Python files with extension .py - (python "bcrypt" [ bcrypt ]) - ]) - ) + ) ); } diff --git a/options/custom/services/agenix.nix b/options/custom/services/agenix.nix index 3bdc956..cea99c4 100644 --- a/options/custom/services/agenix.nix +++ b/options/custom/services/agenix.nix @@ -4,17 +4,13 @@ pkgs, ... }: - -with lib; - -let +with lib; let cat = "${pkgs.coreutils}/bin/cat"; sed = "${pkgs.gnused}/bin/sed"; cfg = config.custom.services.agenix; -in -{ - options.custom.services.agenix.enable = mkOption { default = false; }; +in { + options.custom.services.agenix.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { xdg.configFile."hypr/hyprland.conf".force = true; @@ -40,7 +36,7 @@ in }; Install = { - WantedBy = [ "default.target" ]; + WantedBy = ["default.target"]; }; }; }; diff --git a/options/custom/services/auto-cpufreq.nix b/options/custom/services/auto-cpufreq.nix index b564a37..e01b4e8 100644 --- a/options/custom/services/auto-cpufreq.nix +++ b/options/custom/services/auto-cpufreq.nix @@ -1,17 +1,17 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.auto-cpufreq; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.auto-cpufreq; +in { options.custom.services.auto-cpufreq = { - enable = mkOption { default = false; }; + enable = mkOption {default = false;}; max = { - battery = mkOption { default = null; }; # GHz - charger = mkOption { default = null; }; # GHz + battery = mkOption {default = null;}; # GHz + charger = mkOption {default = null;}; # GHz }; }; diff --git a/options/custom/services/avizo.nix b/options/custom/services/avizo.nix index b3a5a32..9f25e41 100644 --- a/options/custom/services/avizo.nix +++ b/options/custom/services/avizo.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.avizo; -in { - options.custom.services.avizo.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.avizo; +in { + options.custom.services.avizo.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/misterdanb/avizo diff --git a/options/custom/services/blueman-applet.nix b/options/custom/services/blueman-applet.nix index 3375c28..b9c67da 100644 --- a/options/custom/services/blueman-applet.nix +++ b/options/custom/services/blueman-applet.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.blueman-applet; -in { - options.custom.services.blueman-applet.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.blueman-applet; +in { + options.custom.services.blueman-applet.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/blueman-project/blueman diff --git a/options/custom/services/blueman.nix b/options/custom/services/blueman.nix index a7ae5a3..a274251 100644 --- a/options/custom/services/blueman.nix +++ b/options/custom/services/blueman.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.blueman; -in { - options.custom.services.blueman.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.blueman; +in { + options.custom.services.blueman.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/blueman-project/blueman diff --git a/options/custom/services/borgmatic.nix b/options/custom/services/borgmatic.nix index 2762627..b3f8986 100644 --- a/options/custom/services/borgmatic.nix +++ b/options/custom/services/borgmatic.nix @@ -5,15 +5,11 @@ pkgs, ... }: - -with lib; - -let +with lib; let cat = "${pkgs.coreutils}/bin/cat"; cfg = config.custom.services.borgmatic; -in -{ +in { # https://wiki.nixos.org/wiki/Borg_backup # https://github.com/borgmatic-collective/borgmatic #!! Imperative initialization @@ -21,9 +17,9 @@ in #?? sudo borgmatic key export #?? sudo borgmatic -v 1 create --progress --stats options.custom.services.borgmatic = { - enable = mkOption { default = false; }; - repositories = mkOption { default = [ ]; }; - sources = mkOption { default = [ ]; }; + enable = mkOption {default = false;}; + repositories = mkOption {default = [];}; + sources = mkOption {default = [];}; }; config = mkIf cfg.enable { @@ -68,12 +64,10 @@ in }; }; - age.secrets = - let - secret = filename: { file = "${inputs.self}/secrets/${filename}"; }; - in - { - "${config.custom.profile}/borgmatic/borgbase.${config.custom.hostname}" = secret "${config.custom.profile}/borgmatic/borgbase.${config.custom.hostname}"; - }; + age.secrets = let + secret = filename: {file = "${inputs.self}/secrets/${filename}";}; + in { + "${config.custom.profile}/borgmatic/borgbase.${config.custom.hostname}" = secret "${config.custom.profile}/borgmatic/borgbase.${config.custom.hostname}"; + }; }; } diff --git a/options/custom/services/caddy.nix b/options/custom/services/caddy.nix index 84afe90..75815d1 100644 --- a/options/custom/services/caddy.nix +++ b/options/custom/services/caddy.nix @@ -4,27 +4,21 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.caddy; -in -{ - options.custom.services.caddy.enable = mkOption { default = false; }; +in { + options.custom.services.caddy.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - owner = "caddy"; - group = "caddy"; - }; - in - { - "${config.custom.profile}/caddy/Caddyfile" = secret "${config.custom.profile}/caddy/Caddyfile"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; + owner = "caddy"; + group = "caddy"; }; + in { + "${config.custom.profile}/caddy/Caddyfile" = secret "${config.custom.profile}/caddy/Caddyfile"; + }; # https://caddyserver.com/ # https://github.com/caddyserver/caddy diff --git a/options/custom/services/clipcat.nix b/options/custom/services/clipcat.nix index 4d0cadd..dbd6473 100644 --- a/options/custom/services/clipcat.nix +++ b/options/custom/services/clipcat.nix @@ -1,14 +1,14 @@ -{ config, lib, ... }: - -with lib; - -let +{ + config, + lib, + ... +}: +with lib; let wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; cfg = config.custom.services.clipcat; -in -{ - options.custom.services.clipcat.enable = mkOption { default = false; }; +in { + options.custom.services.clipcat.enable = mkOption {default = false;}; config = mkIf cfg.enable { # BUG: Random high CPU usage diff --git a/options/custom/services/cliphist.nix b/options/custom/services/cliphist.nix index 2510e34..2ed0e01 100644 --- a/options/custom/services/cliphist.nix +++ b/options/custom/services/cliphist.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.cliphist; -in { - options.custom.services.cliphist.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.cliphist; +in { + options.custom.services.cliphist.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/sentriz/cliphist diff --git a/options/custom/services/create_ap.nix b/options/custom/services/create_ap.nix index 1688770..34db7b7 100644 --- a/options/custom/services/create_ap.nix +++ b/options/custom/services/create_ap.nix @@ -5,10 +5,7 @@ pkgs, ... }: - -with lib; - -let +with lib; let bash = "${pkgs.bash}/bin/bash"; cat = "${pkgs.coreutils}/bin/cat"; sleep = "${pkgs.coreutils}/bin/sleep"; @@ -18,23 +15,20 @@ let }/bin/create_ap"; cfg = config.custom.services.create_ap; -in -{ +in { options.custom.services.create_ap = { - enable = mkOption { default = false; }; - internet = mkOption { default = "eth0"; }; - wifi = mkOption { default = "wlan0"; }; + enable = mkOption {default = false;}; + internet = mkOption {default = "eth0";}; + wifi = mkOption {default = "wlan0";}; }; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { file = "${inputs.self}/secrets/${filename}"; }; - in - { - "${config.custom.profile}/create_ap/passphrase" = secret "${config.custom.profile}/create_ap/passphrase"; - "${config.custom.profile}/create_ap/ssid" = secret "${config.custom.profile}/create_ap/ssid"; - }; + age.secrets = let + secret = filename: {file = "${inputs.self}/secrets/${filename}";}; + in { + "${config.custom.profile}/create_ap/passphrase" = secret "${config.custom.profile}/create_ap/passphrase"; + "${config.custom.profile}/create_ap/ssid" = secret "${config.custom.profile}/create_ap/ssid"; + }; # https://github.com/lakinduakash/linux-wifi-hotspot services.create_ap = { @@ -58,12 +52,11 @@ in systemd.services.create_ap.serviceConfig = { ExecStartPre = "${sleep} 15s"; # Some cards like Intel force regulatory domain discovery - ExecStart = - let - configFile = pkgs.writeText "create_ap.conf" ( - generators.toKeyValue { } config.services.create_ap.settings - ); - in + ExecStart = let + configFile = pkgs.writeText "create_ap.conf" ( + generators.toKeyValue {} config.services.create_ap.settings + ); + in mkForce ( concatStringsSep " " [ "${bash} -c" diff --git a/options/custom/services/dbus.nix b/options/custom/services/dbus.nix index d431246..7366b1c 100644 --- a/options/custom/services/dbus.nix +++ b/options/custom/services/dbus.nix @@ -4,19 +4,15 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.dbus; -in -{ - options.custom.services.dbus.enable = mkOption { default = false; }; +in { + options.custom.services.dbus.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/bus1/dbus-broker # TODO: Scour journal for dbus errors - environment.systemPackages = with pkgs; [ dbus ]; + environment.systemPackages = with pkgs; [dbus]; services.dbus.implementation = "broker"; # Newer message bus }; } diff --git a/options/custom/services/default.nix b/options/custom/services/default.nix index 448311c..4278512 100644 --- a/options/custom/services/default.nix +++ b/options/custom/services/default.nix @@ -1,8 +1,9 @@ -{ config, lib, ... }: - -with lib; - { + config, + lib, + ... +}: +with lib; { config.custom.services = mkMerge [ (mkIf config.custom.default { #// agenix.enable = true; diff --git a/options/custom/services/easyeffects.nix b/options/custom/services/easyeffects.nix index 4864551..4697d24 100644 --- a/options/custom/services/easyeffects.nix +++ b/options/custom/services/easyeffects.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.easyeffects; -in { - options.custom.services.easyeffects.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.easyeffects; +in { + options.custom.services.easyeffects.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/wwmm/easyeffects diff --git a/options/custom/services/flatpak.nix b/options/custom/services/flatpak.nix index 9e1e47c..b1019f0 100644 --- a/options/custom/services/flatpak.nix +++ b/options/custom/services/flatpak.nix @@ -5,14 +5,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.flatpak; -in -{ - options.custom.services.flatpak.enable = mkOption { default = false; }; +in { + options.custom.services.flatpak.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Flatpak diff --git a/options/custom/services/fprintd.nix b/options/custom/services/fprintd.nix index ef694c8..b104dac 100644 --- a/options/custom/services/fprintd.nix +++ b/options/custom/services/fprintd.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.fprintd; -in { - options.custom.services.fprintd.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.fprintd; +in { + options.custom.services.fprintd.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.archlinux.org/title/Fprint diff --git a/options/custom/services/fw-fanctrl.nix b/options/custom/services/fw-fanctrl.nix index a70b7b0..ce5c046 100644 --- a/options/custom/services/fw-fanctrl.nix +++ b/options/custom/services/fw-fanctrl.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.fw-fanctrl; -in { - options.custom.services.fw-fanctrl.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.fw-fanctrl; +in { + options.custom.services.fw-fanctrl.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/TamtamHero/fw-fanctrl/tree/packaging/nix @@ -21,18 +21,16 @@ in strategies.custom = { fanSpeedUpdateFrequency = 3; # Seconds movingAverageInterval = 30; # Seconds - speedCurve = - let - curve = temp: speed: { inherit temp speed; }; - in - [ - (curve 0 0) - (curve 40 20) - (curve 50 30) - (curve 60 40) - (curve 70 50) - #!! Max fan speed of 50% - ]; + speedCurve = let + curve = temp: speed: {inherit temp speed;}; + in [ + (curve 0 0) + (curve 40 20) + (curve 50 30) + (curve 60 40) + (curve 70 50) + #!! Max fan speed of 50% + ]; }; }; }; diff --git a/options/custom/services/fwupd.nix b/options/custom/services/fwupd.nix index 13d4a59..f5d9557 100644 --- a/options/custom/services/fwupd.nix +++ b/options/custom/services/fwupd.nix @@ -1,19 +1,19 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.fwupd; -in { - options.custom.services.fwupd.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.fwupd; +in { + options.custom.services.fwupd.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Fwupd # https://github.com/fwupd/fwupd services.fwupd = { enable = true; - extraRemotes = [ "lvfs-testing" ]; + extraRemotes = ["lvfs-testing"]; }; }; } diff --git a/options/custom/services/gammastep.nix b/options/custom/services/gammastep.nix index 4f4f53e..ddd0dcf 100644 --- a/options/custom/services/gammastep.nix +++ b/options/custom/services/gammastep.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.gammastep; -in { - options.custom.services.gammastep.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.gammastep; +in { + options.custom.services.gammastep.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://gitlab.com/chinstrap/gammastep diff --git a/options/custom/services/geoclue2.nix b/options/custom/services/geoclue2.nix index 262ba4b..1060427 100644 --- a/options/custom/services/geoclue2.nix +++ b/options/custom/services/geoclue2.nix @@ -4,27 +4,21 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.geoclue2; -in -{ - options.custom.services.geoclue2.enable = mkOption { default = false; }; +in { + options.custom.services.geoclue2.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - owner = "geoclue"; - group = "geoclue"; - }; - in - { - "desktop/geoclue2/geolocation" = secret "desktop/geoclue2/geolocation"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; + owner = "geoclue"; + group = "geoclue"; }; + in { + "desktop/geoclue2/geolocation" = secret "desktop/geoclue2/geolocation"; + }; # https://gitlab.freedesktop.org/geoclue/geoclue # FIXME: geoclue2 relies on MLS, which is retired diff --git a/options/custom/services/gnome-keyring.nix b/options/custom/services/gnome-keyring.nix index 84c104d..d28d4a6 100644 --- a/options/custom/services/gnome-keyring.nix +++ b/options/custom/services/gnome-keyring.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.gnome-keyring; -in { - options.custom.services.gnome-keyring.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.gnome-keyring; +in { + options.custom.services.gnome-keyring.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.archlinux.org/title/GNOME/Keyring diff --git a/options/custom/services/gpg-agent.nix b/options/custom/services/gpg-agent.nix index f558022..95f4b39 100644 --- a/options/custom/services/gpg-agent.nix +++ b/options/custom/services/gpg-agent.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.gpg-agent; -in -{ - options.custom.services.gpg-agent.enable = mkOption { default = false; }; +in { + options.custom.services.gpg-agent.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.archlinux.org/title/GnuPG#gpg-agent diff --git a/options/custom/services/greetd.nix b/options/custom/services/greetd.nix index 691252c..7e32387 100644 --- a/options/custom/services/greetd.nix +++ b/options/custom/services/greetd.nix @@ -4,18 +4,14 @@ pkgs, ... }: - -with lib; - -let +with lib; let Hyprland = "${config.programs.hyprland.package}/bin/Hyprland"; systemd-cat = "${pkgs.systemd}/bin/systemd-cat"; tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; cfg = config.custom.services.greetd; -in -{ - options.custom.services.greetd.enable = mkOption { default = false; }; +in { + options.custom.services.greetd.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://sr.ht/~kennylevinsen/greetd diff --git a/options/custom/services/hypridle.nix b/options/custom/services/hypridle.nix index 437708b..dc8a1cd 100644 --- a/options/custom/services/hypridle.nix +++ b/options/custom/services/hypridle.nix @@ -4,10 +4,7 @@ pkgs, ... }: - -with lib; - -let +with lib; let grep = "${pkgs.gnugrep}/bin/grep"; hyprctl = "${ config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage @@ -21,9 +18,8 @@ let systemctl = "${pkgs.systemd}/bin/systemctl"; cfg = config.custom.services.hypridle; -in -{ - options.custom.services.hypridle.enable = mkOption { default = false; }; +in { + options.custom.services.hypridle.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/hyprwm/hypridle diff --git a/options/custom/services/hyprpaper.nix b/options/custom/services/hyprpaper.nix index 57aaada..caf295f 100644 --- a/options/custom/services/hyprpaper.nix +++ b/options/custom/services/hyprpaper.nix @@ -3,14 +3,10 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.hyprpaper; -in -{ - options.custom.services.hyprpaper.enable = mkOption { default = false; }; +in { + options.custom.services.hyprpaper.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://wiki.hyprland.org/Hypr-Ecosystem/hyprpaper @@ -19,8 +15,8 @@ in enable = true; settings = { - preload = [ "/tmp/altered.png" ]; - wallpaper = [ ", /tmp/altered.png" ]; + preload = ["/tmp/altered.png"]; + wallpaper = [", /tmp/altered.png"]; }; }; }; diff --git a/options/custom/services/kdeconnect.nix b/options/custom/services/kdeconnect.nix index da879bf..d1cf951 100644 --- a/options/custom/services/kdeconnect.nix +++ b/options/custom/services/kdeconnect.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.kdeconnect; -in { - options.custom.services.kdeconnect.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.kdeconnect; +in { + options.custom.services.kdeconnect.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/KDE/kdeconnect-kde diff --git a/options/custom/services/keyd.nix b/options/custom/services/keyd.nix index f24562e..38d4250 100644 --- a/options/custom/services/keyd.nix +++ b/options/custom/services/keyd.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.keyd; -in { - options.custom.services.keyd.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.keyd; +in { + options.custom.services.keyd.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/rvaiya/keyd diff --git a/options/custom/services/libinput.nix b/options/custom/services/libinput.nix index 3af4e9b..eddf533 100644 --- a/options/custom/services/libinput.nix +++ b/options/custom/services/libinput.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.libinput; -in { - options.custom.services.libinput.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.libinput; +in { + options.custom.services.libinput.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://gitlab.freedesktop.org/libinput/libinput diff --git a/options/custom/services/logind.nix b/options/custom/services/logind.nix index 6ad618c..f27ba9d 100644 --- a/options/custom/services/logind.nix +++ b/options/custom/services/logind.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.logind; -in { - options.custom.services.logind.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.logind; +in { + options.custom.services.logind.enable = mkOption {default = false;}; config = mkIf cfg.enable { services.logind = { diff --git a/options/custom/services/mako.nix b/options/custom/services/mako.nix index 16d9d22..cbee405 100644 --- a/options/custom/services/mako.nix +++ b/options/custom/services/mako.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.mako; -in { - options.custom.services.mako.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.mako; +in { + options.custom.services.mako.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/emersion/mako diff --git a/options/custom/services/matrix-conduit.nix b/options/custom/services/matrix-conduit.nix index add2a53..63b990a 100644 --- a/options/custom/services/matrix-conduit.nix +++ b/options/custom/services/matrix-conduit.nix @@ -5,27 +5,21 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.matrix-conduit; -in -{ - options.custom.services.matrix-conduit.enable = mkOption { default = false; }; +in { + options.custom.services.matrix-conduit.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - owner = "300"; - group = "300"; - }; - in - { - "${config.custom.profile}/matrix-conduit/conduwuit.toml" = secret "${config.custom.profile}/matrix-conduit/conduwuit.toml"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; + owner = "300"; + group = "300"; }; + in { + "${config.custom.profile}/matrix-conduit/conduwuit.toml" = secret "${config.custom.profile}/matrix-conduit/conduwuit.toml"; + }; # https://wiki.nixos.org/wiki/Matrix # https://conduwuit.puppyirl.gay/deploying/nixos.html @@ -37,30 +31,28 @@ in # Bind conduwuit service to media mount # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/matrix/conduit.nix#L113 - systemd.services.conduit = - let - mount = "mnt-remote-conduwuit.mount"; - in - { - after = [ mount ]; - bindsTo = [ mount ]; + systemd.services.conduit = let + mount = "mnt-remote-conduwuit.mount"; + in { + after = [mount]; + bindsTo = [mount]; - # Override with static uid for media mount - serviceConfig.User = lib.mkForce "300"; # 400-499 is reserved for system users + # Override with static uid for media mount + serviceConfig.User = lib.mkForce "300"; # 400-499 is reserved for system users - # Override module's attempt to use conduit default config - # https://github.com/girlbossceo/conduwuit/blob/main/conduwuit-example.toml - environment = lib.mkForce { - CONDUWUIT_CONFIG = config.age.secrets."${config.custom.profile}/matrix-conduit/conduwuit.toml".path; - }; + # Override module's attempt to use conduit default config + # https://github.com/girlbossceo/conduwuit/blob/main/conduwuit-example.toml + environment = lib.mkForce { + CONDUWUIT_CONFIG = config.age.secrets."${config.custom.profile}/matrix-conduit/conduwuit.toml".path; }; + }; # Create bind mount to remote media in lieu of conduwuit.toml setting # https://nixos.wiki/wiki/Filesystems#Bind_mounts fileSystems."/var/lib/matrix-conduit/media" = { device = "/mnt/remote/conduwuit/media"; fsType = "none"; - options = [ "bind" ]; + options = ["bind"]; }; }; } diff --git a/options/custom/services/modufur.nix b/options/custom/services/modufur.nix index d6e8344..3e146ed 100644 --- a/options/custom/services/modufur.nix +++ b/options/custom/services/modufur.nix @@ -4,29 +4,25 @@ pkgs, ... }: - -with lib; - -let +with lib; let poetry = "${pkgs.poetry}/bin/poetry"; cfg = config.custom.services.modufur; -in -{ - options.custom.services.modufur.enable = mkOption { default = false; }; +in { + options.custom.services.modufur.enable = mkOption {default = false;}; config = mkIf cfg.enable { #!! Imperative source control #?? git clone https://github.com/Myned/modufur systemd.user.services.modufur = { - description = [ "Modufur" ]; - requires = [ "default.target" ]; - after = [ "default.target" ]; - wantedBy = [ "default.target" ]; + description = ["Modufur"]; + requires = ["default.target"]; + after = ["default.target"]; + wantedBy = ["default.target"]; serviceConfig = { - WorkingDirectory = [ "/home/myned/.git/modufur" ]; - ExecStart = [ "${poetry}/bin/poetry run python -OO run.py >&2" ]; + WorkingDirectory = ["/home/myned/.git/modufur"]; + ExecStart = ["${poetry}/bin/poetry run python -OO run.py >&2"]; }; }; }; diff --git a/options/custom/services/netbird.nix b/options/custom/services/netbird.nix index 810ecf8..8a21613 100644 --- a/options/custom/services/netbird.nix +++ b/options/custom/services/netbird.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.netbird; -in { - options.custom.services.netbird.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.netbird; +in { + options.custom.services.netbird.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/netbirdio/netbird diff --git a/options/custom/services/netdata.nix b/options/custom/services/netdata.nix index 55edffa..404e500 100644 --- a/options/custom/services/netdata.nix +++ b/options/custom/services/netdata.nix @@ -4,29 +4,23 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.netdata; -in -{ +in { options.custom.services.netdata = { - enable = mkOption { default = false; }; - parent = mkOption { default = false; }; - child = mkOption { default = false; }; + enable = mkOption {default = false;}; + parent = mkOption {default = false;}; + child = mkOption {default = false;}; }; - config = - let - role = - if cfg.parent then - "parent" - else if cfg.child then - "child" - else - ""; - in + config = let + role = + if cfg.parent + then "parent" + else if cfg.child + then "child" + else ""; + in mkIf cfg.enable { # https://github.com/netdata/netdata # https://wiki.nixos.org/wiki/Netdata @@ -35,7 +29,7 @@ in # Override package to include v2 dashboard # https://learn.netdata.cloud/docs/developer-and-contributor-corner/redistributed-software - package = mkIf cfg.parent pkgs.netdata.override { withCloudUi = true; }; # !! NCUL1 non-free license + package = mkIf cfg.parent pkgs.netdata.override {withCloudUi = true;}; # !! NCUL1 non-free license # Minimize overhead for children # https://learn.netdata.cloud/docs/netdata-agent/configuration/daemon-configuration @@ -51,19 +45,20 @@ in }; }; - configDir."stream.conf" = mkIf ( - role != "" - ) config.age.secrets."${config.custom.profile}/netdata/${role}.conf".path; + configDir."stream.conf" = + mkIf ( + role != "" + ) + config.age.secrets."${config.custom.profile}/netdata/${role}.conf".path; }; - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - owner = "netdata"; - group = "netdata"; - }; - in + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; + owner = "netdata"; + group = "netdata"; + }; + in mkIf (role != "") { "${config.custom.profile}/netdata/${role}.conf" = secret "${config.custom.profile}/netdata/${role}.conf"; }; diff --git a/options/custom/services/network-manager-applet.nix b/options/custom/services/network-manager-applet.nix index 4850b4d..d9d2676 100644 --- a/options/custom/services/network-manager-applet.nix +++ b/options/custom/services/network-manager-applet.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.network-manager-applet; -in { - options.custom.services.network-manager-applet.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.network-manager-applet; +in { + options.custom.services.network-manager-applet.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://gitlab.gnome.org/GNOME/network-manager-applet diff --git a/options/custom/services/onedrive.nix b/options/custom/services/onedrive.nix index 6e4e303..ad1258a 100644 --- a/options/custom/services/onedrive.nix +++ b/options/custom/services/onedrive.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.onedrive; -in { - options.custom.services.onedrive.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.onedrive; +in { + options.custom.services.onedrive.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/abraunegg/onedrive diff --git a/options/custom/services/piped.nix b/options/custom/services/piped.nix index b96fa30..bbda24e 100644 --- a/options/custom/services/piped.nix +++ b/options/custom/services/piped.nix @@ -4,18 +4,14 @@ pkgs, ... }: - -with lib; - -let +with lib; let curl = "${pkgs.curl}/bin/curl"; docker = "${pkgs.docker}/bin/docker"; parallel = "${pkgs.parallel}/bin/parallel"; cfg = config.custom.services.piped; -in -{ - options.custom.services.piped.enable = mkOption { default = false; }; +in { + options.custom.services.piped.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Systemd/timers @@ -39,7 +35,7 @@ in }; timers."fetch-channels" = { - wantedBy = [ "timers.target" ]; + wantedBy = ["timers.target"]; timerConfig = { OnBootSec = "1h"; diff --git a/options/custom/services/pipewire.nix b/options/custom/services/pipewire.nix index e427b98..4d1c1eb 100644 --- a/options/custom/services/pipewire.nix +++ b/options/custom/services/pipewire.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.pipewire; -in { - options.custom.services.pipewire.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.pipewire; +in { + options.custom.services.pipewire.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/PipeWire diff --git a/options/custom/services/playerctld.nix b/options/custom/services/playerctld.nix index c34dda7..4260534 100644 --- a/options/custom/services/playerctld.nix +++ b/options/custom/services/playerctld.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.playerctld; -in { - options.custom.services.playerctld.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.playerctld; +in { + options.custom.services.playerctld.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/altdesktop/playerctl diff --git a/options/custom/services/power-profiles-daemon.nix b/options/custom/services/power-profiles-daemon.nix index ddf898a..a827b06 100644 --- a/options/custom/services/power-profiles-daemon.nix +++ b/options/custom/services/power-profiles-daemon.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.power-profiles-daemon; -in { - options.custom.services.power-profiles-daemon.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.power-profiles-daemon; +in { + options.custom.services.power-profiles-daemon.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://gitlab.freedesktop.org/upower/power-profiles-daemon diff --git a/options/custom/services/ratbagd.nix b/options/custom/services/ratbagd.nix index 709701d..de510f9 100644 --- a/options/custom/services/ratbagd.nix +++ b/options/custom/services/ratbagd.nix @@ -4,19 +4,15 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.ratbagd; -in -{ - options.custom.services.ratbagd.enable = mkOption { default = false; }; +in { + options.custom.services.ratbagd.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://github.com/libratbag/libratbag # https://github.com/libratbag/piper services.ratbagd.enable = true; - environment.systemPackages = with pkgs; [ piper ]; + environment.systemPackages = with pkgs; [piper]; }; } diff --git a/options/custom/services/samba.nix b/options/custom/services/samba.nix index 33dcb32..1a9f1ca 100644 --- a/options/custom/services/samba.nix +++ b/options/custom/services/samba.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.samba; -in { - options.custom.services.samba.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.samba; +in { + options.custom.services.samba.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Samba diff --git a/options/custom/services/swayidle.nix b/options/custom/services/swayidle.nix index b6a87b2..20f7a9f 100644 --- a/options/custom/services/swayidle.nix +++ b/options/custom/services/swayidle.nix @@ -4,10 +4,7 @@ pkgs, ... }: - -with lib; - -let +with lib; let chayang = "${pkgs.chayang}/bin/chayang"; hyprctl = "${ config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.package @@ -20,9 +17,8 @@ let systemctl = "${pkgs.systemd}/bin/systemctl"; cfg = config.custom.services.swayidle; -in -{ - options.custom.services.swayidle.enable = mkOption { default = false; }; +in { + options.custom.services.swayidle.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/swaywm/swayidle diff --git a/options/custom/services/swaync/default.nix b/options/custom/services/swaync/default.nix index 2a67fa3..68d1ed5 100644 --- a/options/custom/services/swaync/default.nix +++ b/options/custom/services/swaync/default.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.swaync; -in { - options.custom.services.swaync.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.swaync; +in { + options.custom.services.swaync.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/ErikReider/SwayNotificationCenter diff --git a/options/custom/services/swayosd.nix b/options/custom/services/swayosd.nix index e3408ee..27ba9b4 100644 --- a/options/custom/services/swayosd.nix +++ b/options/custom/services/swayosd.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.swayosd; -in { - options.custom.services.swayosd.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.swayosd; +in { + options.custom.services.swayosd.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://github.com/ErikReider/SwayOSD diff --git a/options/custom/services/syncthing.nix b/options/custom/services/syncthing.nix index bab6c4f..50d7b5c 100644 --- a/options/custom/services/syncthing.nix +++ b/options/custom/services/syncthing.nix @@ -1,18 +1,18 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.syncthing; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.syncthing; +in { # https://github.com/syncthing/syncthing # https://wiki.nixos.org/wiki/Syncthing # https://docs.syncthing.net/users/config.html options.custom.services.syncthing = { - enable = mkOption { default = false; }; - configDir = mkOption { default = "${cfg.dataDir}/.config/syncthing"; }; - dataDir = mkOption { default = "/home/${cfg.user}"; }; + enable = mkOption {default = false;}; + configDir = mkOption {default = "${cfg.dataDir}/.config/syncthing";}; + dataDir = mkOption {default = "/home/${cfg.user}";}; devices = mkOption { default = [ "myarm" @@ -20,12 +20,12 @@ in "myork" ]; }; - ignorePerms = mkOption { default = false; }; - mount = mkOption { default = null; }; - order = mkOption { default = "alphabetic"; }; - type = mkOption { default = "sendreceive"; }; - user = mkOption { default = config.custom.username; }; - group = mkOption { default = "users"; }; + ignorePerms = mkOption {default = false;}; + mount = mkOption {default = null;}; + order = mkOption {default = "alphabetic";}; + type = mkOption {default = "sendreceive";}; + user = mkOption {default = config.custom.username;}; + group = mkOption {default = "users";}; versioning = mkOption { default = { @@ -36,41 +36,41 @@ in # Per folder attributes override config folders = mkOption { - default = - let - #?? "FOLDER" = folder "ID" [ "DEVICES" ] - folder = id: devices: { inherit id devices; }; - in - { - "SYNC/.backup" = folder "oxdvq-dfzjk" [ ]; - "SYNC/.ignore" = folder "qpvfw-j127s" [ - "myeck" - "myxel" - ]; - "SYNC/android" = folder "y3omj-gpjch" [ "myxel" ]; - "SYNC/common" = folder "fcsij-g7cnw" [ "myxel" ]; - "SYNC/dev" = folder "fsmar-4wsd3" [ "myxel" ]; - "SYNC/edu" = folder "4nyqw-jfkq2" [ "myxel" ]; - "SYNC/game" = folder "xvdpp-mxlki" [ - "myeck" + default = let + #?? "FOLDER" = folder "ID" [ "DEVICES" ] + folder = id: devices: {inherit id devices;}; + in { + "SYNC/.backup" = folder "oxdvq-dfzjk" []; + "SYNC/.ignore" = folder "qpvfw-j127s" [ + "myeck" + "myxel" + ]; + "SYNC/android" = folder "y3omj-gpjch" ["myxel"]; + "SYNC/common" = folder "fcsij-g7cnw" ["myxel"]; + "SYNC/dev" = folder "fsmar-4wsd3" ["myxel"]; + "SYNC/edu" = folder "4nyqw-jfkq2" ["myxel"]; + "SYNC/game" = folder "xvdpp-mxlki" [ + "myeck" + "zendows" + ]; + "SYNC/linux" = folder "ieikk-bnm7u" ["myxel"]; + "SYNC/mac" = folder "yjmt6-z7u4m" []; + "SYNC/owo" = folder "ervqc-ebnzz" ["myxel"]; + "SYNC/windows" = folder "2hmna-vfap9" []; + "ZEL/android" = + folder "gn2l3-2hxtu" [ "zendows" - ]; - "SYNC/linux" = folder "ieikk-bnm7u" [ "myxel" ]; - "SYNC/mac" = folder "yjmt6-z7u4m" [ ]; - "SYNC/owo" = folder "ervqc-ebnzz" [ "myxel" ]; - "SYNC/windows" = folder "2hmna-vfap9" [ ]; - "ZEL/android" = - folder "gn2l3-2hxtu" [ - "zendows" - "zexel" - ] - // { - type = "receiveonly"; - }; - "ZEL/music" = folder "nytcx-uwqs7" [ "zendows" ] // { + "zexel" + ] + // { type = "receiveonly"; }; - }; + "ZEL/music" = + folder "nytcx-uwqs7" ["zendows"] + // { + type = "receiveonly"; + }; + }; }; }; @@ -79,7 +79,7 @@ in enable = true; configDir = cfg.configDir; dataDir = cfg.dataDir; - extraFlags = [ "-no-default-folder" ]; # Disable automatic creation of Sync folder + extraFlags = ["-no-default-folder"]; # Disable automatic creation of Sync folder guiAddress = "0.0.0.0:8384"; # Open to all interfaces openDefaultPorts = true; # Open transfer/discovery ports user = cfg.user; @@ -138,15 +138,20 @@ in }; # Simplify boilerplate folders - folders = concatMapAttrs (name: folder: { - "~/${name}" = { - ignorePerms = cfg.ignorePerms; - label = name; - order = cfg.order; - type = cfg.type; - versioning = cfg.versioning; - } // folder // { devices = cfg.devices ++ folder.devices or [ ]; }; - }) cfg.folders; + folders = + concatMapAttrs (name: folder: { + "~/${name}" = + { + ignorePerms = cfg.ignorePerms; + label = name; + order = cfg.order; + type = cfg.type; + versioning = cfg.versioning; + } + // folder + // {devices = cfg.devices ++ folder.devices or [];}; + }) + cfg.folders; }; }; @@ -154,8 +159,8 @@ in # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/syncthing.nix#L646 #?? systemctl status systemd.services.syncthing = mkIf (isString cfg.mount) { - after = [ cfg.mount ]; - bindsTo = [ cfg.mount ]; # Start/stop service on mount/unmount + after = [cfg.mount]; + bindsTo = [cfg.mount]; # Start/stop service on mount/unmount }; }; } diff --git a/options/custom/services/tailscale.nix b/options/custom/services/tailscale.nix index 1e04ce4..af5dff8 100644 --- a/options/custom/services/tailscale.nix +++ b/options/custom/services/tailscale.nix @@ -5,39 +5,33 @@ pkgs, ... }: - -with lib; - -let +with lib; let cat = "${pkgs.coreutils}/bin/cat"; tailscale = "${config.services.tailscale.package}/bin/tailscale"; cfg = config.custom.services.tailscale; -in -{ +in { # TODO: Enact recommendations # https://tailscale.com/kb/1320/performance-best-practices # https://github.com/tailscale/tailscale #!! Configuration is imperative #?? sudo tailscale up --ssh --advertise-exit-node --accept-routes --operator=$USER --reset --qr options.custom.services.tailscale = { - enable = mkOption { default = false; }; - cert = mkOption { default = false; }; + enable = mkOption {default = false;}; + cert = mkOption {default = false;}; }; # TODO: Use caddy plugin for provisioning when supported by NixOS # https://github.com/NixOS/nixpkgs/pull/317881 # https://github.com/tailscale/caddy-tailscale config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "common/tailscale/tailnet" = secret "common/tailscale/tailnet"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "common/tailscale/tailnet" = secret "common/tailscale/tailnet"; + }; services.tailscale = { enable = true; @@ -46,10 +40,9 @@ in }; # Provision Tailscale certificates in the background per machine - systemd = - let - hostname = config.custom.hostname; - in + systemd = let + hostname = config.custom.hostname; + in mkIf cfg.cert { #!! Needs to be run on the machine # tailscale cert always writes to /var/lib/tailscale/certs/ regardless of flags @@ -62,7 +55,7 @@ in ]; timers."tailscale-cert-${hostname}" = { - wantedBy = [ "timers.target" ]; + wantedBy = ["timers.target"]; timerConfig = { OnCalendar = "daily"; diff --git a/options/custom/services/udev.nix b/options/custom/services/udev.nix index 0435d4d..47a24f8 100644 --- a/options/custom/services/udev.nix +++ b/options/custom/services/udev.nix @@ -4,27 +4,21 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.services.udev; -in -{ - options.custom.services.udev.enable = mkOption { default = false; }; +in { + options.custom.services.udev.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.archlinux.org/title/Udev # Allow video group to change display brightness # https://raw.githubusercontent.com/ErikReider/SwayOSD/main/data/udev/99-swayosd.rules - services.udev.extraRules = - let - chgrp = "${pkgs.coreutils}/bin/chgrp"; - chmod = "${pkgs.coreutils}/bin/chmod"; - in - '' - ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chgrp} video /sys/class/backlight/%k/brightness" - ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chmod} g+w /sys/class/backlight/%k/brightness" - ''; + services.udev.extraRules = let + chgrp = "${pkgs.coreutils}/bin/chgrp"; + chmod = "${pkgs.coreutils}/bin/chmod"; + in '' + ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chgrp} video /sys/class/backlight/%k/brightness" + ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chmod} g+w /sys/class/backlight/%k/brightness" + ''; }; } diff --git a/options/custom/services/upower.nix b/options/custom/services/upower.nix index d0962e9..386870d 100644 --- a/options/custom/services/upower.nix +++ b/options/custom/services/upower.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.upower; -in { - options.custom.services.upower.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.upower; +in { + options.custom.services.upower.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://gitlab.freedesktop.org/upower/upower diff --git a/options/custom/services/xembed-sni-proxy.nix b/options/custom/services/xembed-sni-proxy.nix index 0c04899..eec9658 100644 --- a/options/custom/services/xembed-sni-proxy.nix +++ b/options/custom/services/xembed-sni-proxy.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.services.xembed-sni-proxy; -in { - options.custom.services.xembed-sni-proxy.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.services.xembed-sni-proxy; +in { + options.custom.services.xembed-sni-proxy.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { services.xembed-sni-proxy.enable = true; # Support XEmbed tray icons diff --git a/options/custom/settings/accounts.nix b/options/custom/settings/accounts.nix index 56ea581..fa399e2 100644 --- a/options/custom/settings/accounts.nix +++ b/options/custom/settings/accounts.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.accounts; -in { - options.custom.settings.accounts.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.accounts; +in { + options.custom.settings.accounts.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { accounts = { diff --git a/options/custom/settings/boot.nix b/options/custom/settings/boot.nix index 2033a27..319699b 100644 --- a/options/custom/settings/boot.nix +++ b/options/custom/settings/boot.nix @@ -4,25 +4,29 @@ pkgs, ... }: - -with lib; - -let +with lib; let sed = "${pkgs.gnused}/bin/sed"; cfg = config.custom.settings.boot; -in -{ +in { options.custom.settings.boot = { - enable = mkOption { default = false; }; - console-mode = mkOption { default = "max"; }; - grub = mkOption { default = false; }; + enable = mkOption {default = false;}; + console-mode = mkOption {default = "max";}; + grub = mkOption {default = false;}; kernel = mkOption { - default = if config.custom.full then pkgs.linuxPackages_zen else pkgs.linuxPackages; + default = + if config.custom.full + then pkgs.linuxPackages_zen + else pkgs.linuxPackages; }; - systemd-boot = mkOption { default = config.custom.minimal; }; - timeout = mkOption { default = if config.custom.minimal then 2 else 10; }; - u-boot = mkOption { default = false; }; + systemd-boot = mkOption {default = config.custom.minimal;}; + timeout = mkOption { + default = + if config.custom.minimal + then 2 + else 10; + }; + u-boot = mkOption {default = false;}; }; config = mkIf cfg.enable { diff --git a/options/custom/settings/containers/actualbudget.nix b/options/custom/settings/containers/actualbudget.nix index fa0c26d..b38a32c 100644 --- a/options/custom/settings/containers/actualbudget.nix +++ b/options/custom/settings/containers/actualbudget.nix @@ -3,14 +3,10 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.actualbudget; -in -{ - options.custom.settings.containers.actualbudget.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.actualbudget.enable = mkOption {default = false;}; config = mkIf cfg.enable { #?? arion-actualbudget pull @@ -23,9 +19,9 @@ in actualbudget.service = { container_name = "actualbudget"; image = "actualbudget/actual-server:24.9.0"; - ports = [ "5006:5006" ]; + ports = ["5006:5006"]; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/actualbudget/data:/data" ]; + volumes = ["${config.custom.settings.containers.directory}/actualbudget/data:/data"]; # TODO: Set up trusted proxies }; }; diff --git a/options/custom/settings/containers/coturn.nix b/options/custom/settings/containers/coturn.nix index a4bbc3a..28b952c 100644 --- a/options/custom/settings/containers/coturn.nix +++ b/options/custom/settings/containers/coturn.nix @@ -4,25 +4,19 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.coturn; -in -{ - options.custom.settings.containers.coturn.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.coturn.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/coturn/coturn.conf" = secret "${config.custom.profile}/coturn/coturn.conf"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/coturn/coturn.conf" = secret "${config.custom.profile}/coturn/coturn.conf"; + }; #?? arion-coturn pull environment.shellAliases.arion-coturn = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.coturn.settings.out.dockerComposeYaml}"; diff --git a/options/custom/settings/containers/default.nix b/options/custom/settings/containers/default.nix index c13a3ba..8205f59 100644 --- a/options/custom/settings/containers/default.nix +++ b/options/custom/settings/containers/default.nix @@ -5,18 +5,14 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers; -in -{ +in { options.custom.settings.containers = { - enable = mkOption { default = false; }; - boot = mkOption { default = false; }; - directory = mkOption { default = "/containers"; }; - docker = mkOption { default = true; }; + enable = mkOption {default = false;}; + boot = mkOption {default = false;}; + directory = mkOption {default = "/containers";}; + docker = mkOption {default = true;}; }; config = mkIf cfg.enable { @@ -24,10 +20,16 @@ in # https://github.com/hercules-ci/arion # https://docs.hercules-ci.com/arion/options # https://docs.hercules-ci.com/arion/deployment#_nixos_module - arion.backend = if cfg.docker then "docker" else "podman-socket"; + arion.backend = + if cfg.docker + then "docker" + else "podman-socket"; # https://wiki.nixos.org/wiki/NixOS_Containers - oci-containers.backend = if cfg.docker then "docker" else "podman"; + oci-containers.backend = + if cfg.docker + then "docker" + else "podman"; # https://github.com/containers/common/blob/main/docs/containers.conf.5.md containers = { @@ -61,8 +63,7 @@ in }; }; - environment.systemPackages = - with pkgs; + environment.systemPackages = with pkgs; [ # https://github.com/hercules-ci/arion/issues/210 #?? arion-CONTAINER @@ -78,7 +79,13 @@ in podman-tui ]; - systemd.tmpfiles.rules = [ "d /containers 0700 root root" ]; # Custom directory for containers - users.users.${config.custom.username}.extraGroups = [ (if cfg.docker then "docker" else "podman") ]; + systemd.tmpfiles.rules = ["d /containers 0700 root root"]; # Custom directory for containers + users.users.${config.custom.username}.extraGroups = [ + ( + if cfg.docker + then "docker" + else "podman" + ) + ]; }; } diff --git a/options/custom/settings/containers/forgejo.nix b/options/custom/settings/containers/forgejo.nix index f6194a3..b163ff9 100644 --- a/options/custom/settings/containers/forgejo.nix +++ b/options/custom/settings/containers/forgejo.nix @@ -4,31 +4,25 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.forgejo; -in -{ - options.custom.settings.containers.forgejo.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.forgejo.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/forgejo/.env" = secret "${config.custom.profile}/forgejo/.env"; - "${config.custom.profile}/forgejo/db.env" = secret "${config.custom.profile}/forgejo/db.env"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/forgejo/.env" = secret "${config.custom.profile}/forgejo/.env"; + "${config.custom.profile}/forgejo/db.env" = secret "${config.custom.profile}/forgejo/db.env"; + }; #?? arion-forgejo pull environment.shellAliases.arion-forgejo = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.forgejo.settings.out.dockerComposeYaml}"; - networking.firewall.allowedTCPPorts = [ 22 ]; # SSH + networking.firewall.allowedTCPPorts = [22]; # SSH virtualisation.arion.projects.forgejo = { serviceName = "forgejo"; @@ -40,11 +34,11 @@ in #?? sudo -u git forgejo admin user create --username USERNAME --random-password --email EMAIL --admin forgejo.service = { container_name = "forgejo"; - depends_on = [ "db" ]; - env_file = [ config.age.secrets."${config.custom.profile}/forgejo/.env".path ]; + depends_on = ["db"]; + env_file = [config.age.secrets."${config.custom.profile}/forgejo/.env".path]; image = "codeberg.org/forgejo/forgejo:8"; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/forgejo/data:/data" ]; + volumes = ["${config.custom.settings.containers.directory}/forgejo/data:/data"]; ports = [ "127.0.0.1:3333:3000" @@ -54,10 +48,10 @@ in db.service = { container_name = "forgejo-db"; - env_file = [ config.age.secrets."${config.custom.profile}/forgejo/db.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/forgejo/db.env".path]; image = "postgres:15"; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/forgejo/db:/var/lib/postgresql/data" ]; + volumes = ["${config.custom.settings.containers.directory}/forgejo/db:/var/lib/postgresql/data"]; }; }; }; diff --git a/options/custom/settings/containers/foundryvtt.nix b/options/custom/settings/containers/foundryvtt.nix index 7f56152..f3fcc5e 100644 --- a/options/custom/settings/containers/foundryvtt.nix +++ b/options/custom/settings/containers/foundryvtt.nix @@ -4,25 +4,19 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.foundryvtt; -in -{ - options.custom.settings.containers.foundryvtt.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.foundryvtt.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/foundryvtt/.env" = secret "${config.custom.profile}/foundryvtt/.env"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/foundryvtt/.env" = secret "${config.custom.profile}/foundryvtt/.env"; + }; #?? arion-foundryvtt pull environment.shellAliases.arion-foundryvtt = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.foundryvtt.settings.out.dockerComposeYaml}"; @@ -33,11 +27,11 @@ in settings.services = { foundryvtt.service = { container_name = "foundryvtt"; - env_file = [ config.age.secrets."${config.custom.profile}/foundryvtt/.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/foundryvtt/.env".path]; image = "felddy/foundryvtt:12"; - ports = [ "127.0.0.1:30000:30000" ]; + ports = ["127.0.0.1:30000:30000"]; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/foundryvtt/data:/data" ]; + volumes = ["${config.custom.settings.containers.directory}/foundryvtt/data:/data"]; }; }; }; diff --git a/options/custom/settings/containers/headscale.nix b/options/custom/settings/containers/headscale.nix index 395726e..6ffb517 100644 --- a/options/custom/settings/containers/headscale.nix +++ b/options/custom/settings/containers/headscale.nix @@ -5,25 +5,19 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.headscale; -in -{ - options.custom.settings.containers.headscale.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.headscale.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/headscale/.env" = secret "${config.custom.profile}/headscale/.env"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/headscale/.env" = secret "${config.custom.profile}/headscale/.env"; + }; #?? arion-headscale pull environment.shellAliases.arion-headscale = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.headscale.settings.out.dockerComposeYaml}"; @@ -39,7 +33,7 @@ in headscale.service = { command = "serve"; container_name = "headscale"; - env_file = [ config.age.secrets."${config.custom.profile}/headscale/.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/headscale/.env".path]; image = "headscale/headscale:v0.23.0-beta.4"; restart = "unless-stopped"; diff --git a/options/custom/settings/containers/homeassistant.nix b/options/custom/settings/containers/homeassistant.nix index 4f9b449..c6fd403 100644 --- a/options/custom/settings/containers/homeassistant.nix +++ b/options/custom/settings/containers/homeassistant.nix @@ -3,14 +3,10 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.homeassistant; -in -{ - options.custom.settings.containers.homeassistant.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.homeassistant.enable = mkOption {default = false;}; config = mkIf cfg.enable { #?? arion-homeassistant pull @@ -23,9 +19,9 @@ in homeassistant.service = { container_name = "homeassistant"; image = "homeassistant/home-assistant:2024.9.1"; - ports = [ "8123:8123" ]; + ports = ["8123:8123"]; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/homeassistant/config:/config" ]; + volumes = ["${config.custom.settings.containers.directory}/homeassistant/config:/config"]; }; }; }; diff --git a/options/custom/settings/containers/mastodon.nix b/options/custom/settings/containers/mastodon.nix index 5324d92..2155bfb 100644 --- a/options/custom/settings/containers/mastodon.nix +++ b/options/custom/settings/containers/mastodon.nix @@ -4,26 +4,20 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.mastodon; -in -{ - options.custom.settings.containers.mastodon.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.mastodon.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/mastodon/.env" = secret "${config.custom.profile}/mastodon/.env"; - "${config.custom.profile}/mastodon/db.env" = secret "${config.custom.profile}/mastodon/db.env"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/mastodon/.env" = secret "${config.custom.profile}/mastodon/.env"; + "${config.custom.profile}/mastodon/db.env" = secret "${config.custom.profile}/mastodon/db.env"; + }; #?? arion-mastodon pull environment.shellAliases.arion-mastodon = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.mastodon.settings.out.dockerComposeYaml}"; @@ -36,11 +30,11 @@ in # https://github.com/mastodon/mastodon/blob/main/docker-compose.yml mastodon.service = { container_name = "mastodon"; - env_file = [ config.age.secrets."${config.custom.profile}/mastodon/.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/mastodon/.env".path]; image = "lscr.io/linuxserver/mastodon:4.2.12"; - ports = [ "3000:443" ]; + ports = ["3000:443"]; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/mastodon/config:/config" ]; + volumes = ["${config.custom.settings.containers.directory}/mastodon/config:/config"]; depends_on = [ "cache" @@ -52,15 +46,15 @@ in container_name = "mastodon-cache"; image = "redis:latest"; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/mastodon/cache:/data" ]; + volumes = ["${config.custom.settings.containers.directory}/mastodon/cache:/data"]; }; db.service = { container_name = "mastodon-db"; - env_file = [ config.age.secrets."${config.custom.profile}/mastodon/db.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/mastodon/db.env".path]; image = "postgres:15"; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/mastodon/db:/var/lib/postgresql/data" ]; + volumes = ["${config.custom.settings.containers.directory}/mastodon/db:/var/lib/postgresql/data"]; }; }; }; diff --git a/options/custom/settings/containers/nextcloud.nix b/options/custom/settings/containers/nextcloud.nix index b688021..56ba278 100644 --- a/options/custom/settings/containers/nextcloud.nix +++ b/options/custom/settings/containers/nextcloud.nix @@ -4,26 +4,20 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.nextcloud; -in -{ - options.custom.settings.containers.nextcloud.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.nextcloud.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/nextcloud/.env" = secret "${config.custom.profile}/nextcloud/.env"; - "${config.custom.profile}/nextcloud/db.env" = secret "${config.custom.profile}/nextcloud/db.env"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/nextcloud/.env" = secret "${config.custom.profile}/nextcloud/.env"; + "${config.custom.profile}/nextcloud/db.env" = secret "${config.custom.profile}/nextcloud/db.env"; + }; #?? arion-nextcloud pull environment.shellAliases.arion-nextcloud = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.nextcloud.settings.out.dockerComposeYaml}"; @@ -35,9 +29,9 @@ in # https://github.com/nextcloud/docker nextcloud.service = { container_name = "nextcloud"; - env_file = [ config.age.secrets."${config.custom.profile}/nextcloud/.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/nextcloud/.env".path]; image = "nextcloud:29-apache"; - ports = [ "127.0.0.1:8181:80" ]; + ports = ["127.0.0.1:8181:80"]; restart = "unless-stopped"; volumes = [ @@ -69,12 +63,12 @@ in container_name = "nextcloud-cache"; image = "redis:latest"; restart = "unless-stopped"; - volumes = [ "${config.custom.settings.containers.directory}/nextcloud/cache:/data" ]; + volumes = ["${config.custom.settings.containers.directory}/nextcloud/cache:/data"]; }; db.service = { container_name = "nextcloud-db"; - env_file = [ config.age.secrets."${config.custom.profile}/nextcloud/db.env".path ]; + env_file = [config.age.secrets."${config.custom.profile}/nextcloud/db.env".path]; image = "postgres:15"; restart = "unless-stopped"; diff --git a/options/custom/settings/containers/redlib.nix b/options/custom/settings/containers/redlib.nix index e1d61e0..34dd852 100644 --- a/options/custom/settings/containers/redlib.nix +++ b/options/custom/settings/containers/redlib.nix @@ -3,14 +3,10 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.redlib; -in -{ - options.custom.settings.containers.redlib.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.redlib.enable = mkOption {default = false;}; config = mkIf cfg.enable { #?? arion-redlib pull @@ -23,7 +19,7 @@ in redlib.service = { container_name = "redlib"; image = "quay.io/redlib/redlib:latest"; - ports = [ "127.0.0.1:8888:8080" ]; + ports = ["127.0.0.1:8888:8080"]; restart = "unless-stopped"; environment = { diff --git a/options/custom/settings/containers/searxng/default.nix b/options/custom/settings/containers/searxng/default.nix index fa4e9d3..3e1b7bd 100644 --- a/options/custom/settings/containers/searxng/default.nix +++ b/options/custom/settings/containers/searxng/default.nix @@ -4,25 +4,19 @@ lib, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.containers.searxng; -in -{ - options.custom.settings.containers.searxng.enable = mkOption { default = false; }; +in { + options.custom.settings.containers.searxng.enable = mkOption {default = false;}; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/searxng/.env" = secret "${config.custom.profile}/searxng/.env"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/searxng/.env" = secret "${config.custom.profile}/searxng/.env"; + }; #?? arion-searxng pull environment.shellAliases.arion-searxng = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.searxng.settings.out.dockerComposeYaml}"; @@ -35,10 +29,10 @@ in # https://github.com/searxng/searxng-docker searxng.service = { container_name = "searxng"; - depends_on = [ "cache" ]; - env_file = [ config.age.secrets."${config.custom.profile}/searxng/.env".path ]; + depends_on = ["cache"]; + env_file = [config.age.secrets."${config.custom.profile}/searxng/.env".path]; image = "searxng/searxng:latest"; - ports = [ "127.0.0.1:8000:8080" ]; + ports = ["127.0.0.1:8000:8080"]; restart = "unless-stopped"; volumes = [ diff --git a/options/custom/settings/dconf/apps.nix b/options/custom/settings/dconf/apps.nix index 4a463b0..35d7c94 100644 --- a/options/custom/settings/dconf/apps.nix +++ b/options/custom/settings/dconf/apps.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.dconf.apps; -in { - options.custom.settings.dconf.apps.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.dconf.apps; +in { + options.custom.settings.dconf.apps.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { # https://nix-community.github.io/home-manager/index.xhtml#sec-option-types diff --git a/options/custom/settings/dconf/default.nix b/options/custom/settings/dconf/default.nix index 9836c19..b985356 100644 --- a/options/custom/settings/dconf/default.nix +++ b/options/custom/settings/dconf/default.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.dconf; -in { - options.custom.settings.dconf.default = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.dconf; +in { + options.custom.settings.dconf.default = mkOption {default = false;}; config.custom.settings.dconf = mkIf cfg.default { apps.enable = true; diff --git a/options/custom/settings/dconf/gnome-shell.nix b/options/custom/settings/dconf/gnome-shell.nix index 4de8432..a73d19b 100644 --- a/options/custom/settings/dconf/gnome-shell.nix +++ b/options/custom/settings/dconf/gnome-shell.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.dconf.gnome-shell; -in { - options.custom.settings.dconf.gnome-shell.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.dconf.gnome-shell; +in { + options.custom.settings.dconf.gnome-shell.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { dconf.settings = with config.home-manager.users.${config.custom.username}.lib.gvariant; { @@ -16,7 +16,7 @@ in #!! Concatenated with home-manager extensions #?? [as] - enabled-extensions = mkArray type.string [ "rounded-window-corners@fxgn" ]; + enabled-extensions = mkArray type.string ["rounded-window-corners@fxgn"]; }; # Auto Move Windows @@ -39,7 +39,7 @@ in duration-timer = mkInt32 4; #?? [as] - toggle-shortcut = mkArray type.string [ "Delete" ]; + toggle-shortcut = mkArray type.string ["Delete"]; }; # Clipboard Indicator @@ -51,11 +51,11 @@ in preview-size = mkInt32 100; #?? [as] - clear-history = mkArray type.string [ ]; - next-entry = mkArray type.string [ ]; - prev-entry = mkArray type.string [ ]; - private-mode-binding = mkArray type.string [ ]; - toggle-menu = mkArray type.string [ "v" ]; + clear-history = mkArray type.string []; + next-entry = mkArray type.string []; + prev-entry = mkArray type.string []; + private-mode-binding = mkArray type.string []; + toggle-menu = mkArray type.string ["v"]; }; # Dash to Dock @@ -167,15 +167,15 @@ in window-position = mkString "bottom"; #?? [as] - ddterm-toggle-hotkey = mkArray type.string [ "space" ]; - shortcut-move-tab-next = mkArray type.string [ "" ]; - shortcut-move-tab-prev = mkArray type.string [ "" ]; - shortcut-next-tab = mkArray type.string [ "" ]; - shortcut-prev-tab = mkArray type.string [ "" ]; - shortcut-toggle-maximize = mkArray type.string [ "" ]; - shortcut-win-new-tab = mkArray type.string [ "t" ]; - shortcut-window-size-dec = mkArray type.string [ "" ]; - shortcut-window-size-inc = mkArray type.string [ "" ]; + ddterm-toggle-hotkey = mkArray type.string ["space"]; + shortcut-move-tab-next = mkArray type.string [""]; + shortcut-move-tab-prev = mkArray type.string [""]; + shortcut-next-tab = mkArray type.string [""]; + shortcut-prev-tab = mkArray type.string [""]; + shortcut-toggle-maximize = mkArray type.string [""]; + shortcut-win-new-tab = mkArray type.string ["t"]; + shortcut-window-size-dec = mkArray type.string [""]; + shortcut-window-size-inc = mkArray type.string [""]; palette = mkArray type.string [ "rgb(7,54,66)" @@ -257,22 +257,22 @@ in active-window-hint-color = mkString "rgb(211,54,130)"; #?? [as] - center-window = mkArray type.string [ ]; - favorite-layouts = mkArray type.string [ "0" ]; - restore-window = mkArray type.string [ "BackSpace" ]; - tile-edit-mode = mkArray type.string [ ]; - tile-maximize = mkArray type.string [ "Return" ]; - tile-maximize-vertically = mkArray type.string [ ]; - tile-maximize-horizontally = mkArray type.string [ ]; - tile-bottom-half = mkArray type.string [ "r" ]; - tile-bottomleft-quarter = mkArray type.string [ ]; - tile-bottomright-quarter = mkArray type.string [ ]; - tile-left-half = mkArray type.string [ "a" ]; - tile-right-half = mkArray type.string [ "s" ]; - tile-top-half = mkArray type.string [ "w" ]; - tile-topleft-quarter = mkArray type.string [ ]; - tile-topright-quarter = mkArray type.string [ ]; - toggle-always-on-top = mkArray type.string [ ]; + center-window = mkArray type.string []; + favorite-layouts = mkArray type.string ["0"]; + restore-window = mkArray type.string ["BackSpace"]; + tile-edit-mode = mkArray type.string []; + tile-maximize = mkArray type.string ["Return"]; + tile-maximize-vertically = mkArray type.string []; + tile-maximize-horizontally = mkArray type.string []; + tile-bottom-half = mkArray type.string ["r"]; + tile-bottomleft-quarter = mkArray type.string []; + tile-bottomright-quarter = mkArray type.string []; + tile-left-half = mkArray type.string ["a"]; + tile-right-half = mkArray type.string ["s"]; + tile-top-half = mkArray type.string ["w"]; + tile-topleft-quarter = mkArray type.string []; + tile-topright-quarter = mkArray type.string []; + toggle-always-on-top = mkArray type.string []; }; }; }; diff --git a/options/custom/settings/dconf/gnome.nix b/options/custom/settings/dconf/gnome.nix index e75a622..c206a39 100644 --- a/options/custom/settings/dconf/gnome.nix +++ b/options/custom/settings/dconf/gnome.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.dconf.gnome; -in { - options.custom.settings.dconf.gnome.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.dconf.gnome; +in { + options.custom.settings.dconf.gnome.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { dconf.settings = with config.home-manager.users.${config.custom.username}.lib.gvariant; { @@ -60,39 +60,39 @@ in "org/gnome/desktop/wm/keybindings" = { #?? [as] - activate-window-menu = mkArray type.string [ ]; - begin-move = mkArray type.string [ ]; - begin-resize = mkArray type.string [ ]; - close = mkArray type.string [ "q" ]; - cycle-group = mkArray type.string [ ]; - cycle-group-backward = mkArray type.string [ ]; - cycle-panels = mkArray type.string [ ]; - cycle-panels-backward = mkArray type.string [ ]; - cycle-windows = mkArray type.string [ ]; - cycle-windows-backward = mkArray type.string [ ]; - maximize = mkArray type.string [ ]; - minimize = mkArray type.string [ ]; - move-to-monitor-down = mkArray type.string [ ]; - move-to-monitor-left = mkArray type.string [ ]; - move-to-monitor-right = mkArray type.string [ ]; - move-to-monitor-up = mkArray type.string [ ]; - move-to-workspace-1 = mkArray type.string [ ]; - move-to-workspace-last = mkArray type.string [ ]; - move-to-workspace-left = mkArray type.string [ "z" ]; - move-to-workspace-right = mkArray type.string [ "x" ]; - panel-run-dialog = mkArray type.string [ ]; - switch-group = mkArray type.string [ ]; - switch-group-backward = mkArray type.string [ ]; - switch-input-source = mkArray type.string [ ]; - switch-input-source-backward = mkArray type.string [ ]; - switch-panels = mkArray type.string [ ]; - switch-panels-backward = mkArray type.string [ ]; - switch-to-workspace-1 = mkArray type.string [ ]; - switch-to-workspace-last = mkArray type.string [ ]; - switch-to-workspace-left = mkArray type.string [ "z" ]; - switch-to-workspace-right = mkArray type.string [ "x" ]; - toggle-maximized = mkArray type.string [ ]; - unmaximize = mkArray type.string [ ]; + activate-window-menu = mkArray type.string []; + begin-move = mkArray type.string []; + begin-resize = mkArray type.string []; + close = mkArray type.string ["q"]; + cycle-group = mkArray type.string []; + cycle-group-backward = mkArray type.string []; + cycle-panels = mkArray type.string []; + cycle-panels-backward = mkArray type.string []; + cycle-windows = mkArray type.string []; + cycle-windows-backward = mkArray type.string []; + maximize = mkArray type.string []; + minimize = mkArray type.string []; + move-to-monitor-down = mkArray type.string []; + move-to-monitor-left = mkArray type.string []; + move-to-monitor-right = mkArray type.string []; + move-to-monitor-up = mkArray type.string []; + move-to-workspace-1 = mkArray type.string []; + move-to-workspace-last = mkArray type.string []; + move-to-workspace-left = mkArray type.string ["z"]; + move-to-workspace-right = mkArray type.string ["x"]; + panel-run-dialog = mkArray type.string []; + switch-group = mkArray type.string []; + switch-group-backward = mkArray type.string []; + switch-input-source = mkArray type.string []; + switch-input-source-backward = mkArray type.string []; + switch-panels = mkArray type.string []; + switch-panels-backward = mkArray type.string []; + switch-to-workspace-1 = mkArray type.string []; + switch-to-workspace-last = mkArray type.string []; + switch-to-workspace-left = mkArray type.string ["z"]; + switch-to-workspace-right = mkArray type.string ["x"]; + toggle-maximized = mkArray type.string []; + unmaximize = mkArray type.string []; }; "org/gnome/desktop/wm/preferences" = { @@ -119,12 +119,12 @@ in workspaces-only-on-primary = mkBoolean true; #?? [as] - experimental-features = mkArray type.string [ "variable-refresh-rate" ]; + experimental-features = mkArray type.string ["variable-refresh-rate"]; }; "org/gnome/mutter/wayland/keybindings" = { #?? [as] - restore-shortcuts = mkArray type.string [ ]; + restore-shortcuts = mkArray type.string []; }; "org/gnome/settings-daemon/plugins/color" = { @@ -135,12 +135,12 @@ in "org/gnome/settings-daemon/plugins/media-keys" = { #?? [as] - help = mkArray type.string [ ]; - logout = mkArray type.string [ ]; - magnifier = mkArray type.string [ ]; - magnifier-zoom-in = mkArray type.string [ ]; - magnifier-zoom-out = mkArray type.string [ ]; - screenreader = mkArray type.string [ ]; + help = mkArray type.string []; + logout = mkArray type.string []; + magnifier = mkArray type.string []; + magnifier-zoom-in = mkArray type.string []; + magnifier-zoom-out = mkArray type.string []; + screenreader = mkArray type.string []; }; "org/gnome/settings-daemon/plugins/power" = { @@ -169,13 +169,13 @@ in "org/gnome/shell/keybindings" = { #?? [as] - focus-active-notification = mkArray type.string [ ]; - screenshot = mkArray type.string [ ]; - screenshot-window = mkArray type.string [ ]; - show-screen-recording-ui = mkArray type.string [ ]; - toggle-application-view = mkArray type.string [ ]; - toggle-quick-settings = mkArray type.string [ ]; - toggle-message-tray = mkArray type.string [ ]; + focus-active-notification = mkArray type.string []; + screenshot = mkArray type.string []; + screenshot-window = mkArray type.string []; + show-screen-recording-ui = mkArray type.string []; + toggle-application-view = mkArray type.string []; + toggle-quick-settings = mkArray type.string []; + toggle-message-tray = mkArray type.string []; }; "org/gnome/system/location" = { diff --git a/options/custom/settings/default.nix b/options/custom/settings/default.nix index 8495aea..e15b016 100644 --- a/options/custom/settings/default.nix +++ b/options/custom/settings/default.nix @@ -1,8 +1,9 @@ -{ config, lib, ... }: - -with lib; - { + config, + lib, + ... +}: +with lib; { config.custom.settings = mkMerge [ (mkIf config.custom.default { boot.enable = true; diff --git a/options/custom/settings/environment.nix b/options/custom/settings/environment.nix index 8eb02e7..3cf0aef 100644 --- a/options/custom/settings/environment.nix +++ b/options/custom/settings/environment.nix @@ -1,23 +1,23 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.environment; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.environment; +in { options.custom.settings.environment = { - enable = mkOption { default = false; }; - builder = mkOption { default = config.custom.full; }; - timezone = mkOption { default = "America/Chicago"; }; - wayland = mkOption { default = config.custom.minimal; }; + enable = mkOption {default = false;}; + builder = mkOption {default = config.custom.full;}; + timezone = mkOption {default = "America/Chicago";}; + wayland = mkOption {default = config.custom.minimal;}; }; config = mkIf cfg.enable { time.timeZone = cfg.timezone; # https://wiki.nixos.org/wiki/Cross_Compiling - boot.binfmt.emulatedSystems = mkIf cfg.builder [ "aarch64-linux" ]; # Emulate architecture + boot.binfmt.emulatedSystems = mkIf cfg.builder ["aarch64-linux"]; # Emulate architecture #// nixpkgs.buildPlatform = "x86_64-linux"; # Binary caches often not available environment = { diff --git a/options/custom/settings/fonts.nix b/options/custom/settings/fonts.nix index 7d98954..310e0b2 100644 --- a/options/custom/settings/fonts.nix +++ b/options/custom/settings/fonts.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.fonts; -in -{ - options.custom.settings.fonts.enable = mkOption { default = false; }; +in { + options.custom.settings.fonts.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Fonts @@ -20,7 +16,7 @@ in packages = with pkgs; [ # Monospace - (nerdfonts.override { fonts = [ "Iosevka" ]; }) + (nerdfonts.override {fonts = ["Iosevka"];}) # Sans Serif (google-fonts.override { @@ -41,10 +37,10 @@ in #?? fc-list --brief | grep family: | sort fontconfig.defaultFonts = { - emoji = [ "Noto Color Emoji" ]; - monospace = [ "Iosevka NFP SemiBold" ]; - sansSerif = [ "Outfit" ]; - serif = [ "Liberation Serif" ]; + emoji = ["Noto Color Emoji"]; + monospace = ["Iosevka NFP SemiBold"]; + sansSerif = ["Outfit"]; + serif = ["Liberation Serif"]; }; }; diff --git a/options/custom/settings/gtk/default.nix b/options/custom/settings/gtk/default.nix index b1382ab..c581ca1 100644 --- a/options/custom/settings/gtk/default.nix +++ b/options/custom/settings/gtk/default.nix @@ -4,14 +4,10 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.gtk; -in -{ - options.custom.settings.gtk.enable = mkOption { default = false; }; +in { + options.custom.settings.gtk.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { home.pointerCursor = { diff --git a/options/custom/settings/hardware.nix b/options/custom/settings/hardware.nix index 1f1a363..4969a81 100644 --- a/options/custom/settings/hardware.nix +++ b/options/custom/settings/hardware.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.hardware; -in { - options.custom.settings.hardware.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.hardware; +in { + options.custom.settings.hardware.enable = mkOption {default = false;}; config.hardware = mkIf cfg.enable { enableAllFirmware = config.custom.default; # Non-free firmware diff --git a/options/custom/settings/mounts.nix b/options/custom/settings/mounts.nix index 88c766d..be2721d 100644 --- a/options/custom/settings/mounts.nix +++ b/options/custom/settings/mounts.nix @@ -1,55 +1,53 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.mounts; -in { - options.custom.settings.mounts.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.mounts; +in { + options.custom.settings.mounts.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Enforce permissions for mountpoint directory - systemd.tmpfiles.rules = [ "d /mnt/remote 0755 root root" ]; + systemd.tmpfiles.rules = ["d /mnt/remote 0755 root root"]; #!! FUSE does not support remount, sometimes causing activation errors on switch # https://github.com/libfuse/libfuse/issues/717 #?? sudo umount /mnt/remote && sudo mount /mnt/remote # https://wiki.nixos.org/wiki/SSHFS # https://man.archlinux.org/man/sshfs.1 - fileSystems = - let - #?? "/mnt/PATH" = remote "PATH" UID GID "UMASK" - remote = path: uid: gid: umask: { - # https://robot.hetzner.com/storage - device = "u415778@u415778.your-storagebox.de:/home/${path}"; - fsType = "sshfs"; + fileSystems = let + #?? "/mnt/PATH" = remote "PATH" UID GID "UMASK" + remote = path: uid: gid: umask: { + # https://robot.hetzner.com/storage + device = "u415778@u415778.your-storagebox.de:/home/${path}"; + fsType = "sshfs"; - options = [ - "noatime" # Do not modify access time - "reconnect" # Gracefully handle network issues - "default_permissions" # Check local permissions - "allow_other" # Grant other users access - "umask=${umask}" # Set permissions mask - "uid=${toString uid}" # Set user id - "gid=${toString gid}" # Set group id - "idmap=user" # Map local users to remote - "transform_symlinks" # Convert absolute symlinks to relative - "compression=no" # Save CPU cycles at the cost of transfer speed - "port=23" - "IdentityFile=/etc/ssh/id_ed25519" # !! SSH key configured imperatively - "ServerAliveInterval=15" # Prevent application hangs on reconnect - ]; - }; - in - { - # Use umask to set sshfs permissions - #!! Up to 10 simultaneous connections with Hetzner - #?? docker compose exec CONTAINER cat /etc/passwd - "/mnt/remote/conduwuit" = remote "conduwuit" 300 300 "0077"; # conduit:conduit @ 0700 - #// "/mnt/remote/nextcloud" = remote "nextcloud" 33 33 "0007"; # www-data:www-data @ 0700 - "/mnt/remote/syncthing" = remote "syncthing" 237 237 "0077"; # syncthing:syncthing @ 0700 + options = [ + "noatime" # Do not modify access time + "reconnect" # Gracefully handle network issues + "default_permissions" # Check local permissions + "allow_other" # Grant other users access + "umask=${umask}" # Set permissions mask + "uid=${toString uid}" # Set user id + "gid=${toString gid}" # Set group id + "idmap=user" # Map local users to remote + "transform_symlinks" # Convert absolute symlinks to relative + "compression=no" # Save CPU cycles at the cost of transfer speed + "port=23" + "IdentityFile=/etc/ssh/id_ed25519" # !! SSH key configured imperatively + "ServerAliveInterval=15" # Prevent application hangs on reconnect + ]; }; + in { + # Use umask to set sshfs permissions + #!! Up to 10 simultaneous connections with Hetzner + #?? docker compose exec CONTAINER cat /etc/passwd + "/mnt/remote/conduwuit" = remote "conduwuit" 300 300 "0077"; # conduit:conduit @ 0700 + #// "/mnt/remote/nextcloud" = remote "nextcloud" 33 33 "0007"; # www-data:www-data @ 0700 + "/mnt/remote/syncthing" = remote "syncthing" 237 237 "0077"; # syncthing:syncthing @ 0700 + }; # https://wiki.nixos.org/wiki/Rclone # https://docs.hetzner.com/robot/storage-box/access/access-ssh-rsync-borg/#rclone diff --git a/options/custom/settings/networking.nix b/options/custom/settings/networking.nix index 6dbd253..dc3fc95 100644 --- a/options/custom/settings/networking.nix +++ b/options/custom/settings/networking.nix @@ -1,20 +1,20 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.networking; -in { + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.networking; +in { options.custom.settings.networking = { - enable = mkOption { default = false; }; - dns = mkOption { default = config.custom.default; }; - ipv4 = mkOption { default = null; }; - ipv6 = mkOption { default = null; }; - networkd = mkOption { default = !cfg.networkmanager; }; - networkmanager = mkOption { default = config.custom.minimal; }; - static = mkOption { default = false; }; # Falls back to DHCP/RA - wifi = mkOption { default = config.custom.minimal; }; + enable = mkOption {default = false;}; + dns = mkOption {default = config.custom.default;}; + ipv4 = mkOption {default = null;}; + ipv6 = mkOption {default = null;}; + networkd = mkOption {default = !cfg.networkmanager;}; + networkmanager = mkOption {default = config.custom.minimal;}; + static = mkOption {default = false;}; # Falls back to DHCP/RA + wifi = mkOption {default = config.custom.minimal;}; interface = mkOption { default = [ @@ -39,7 +39,7 @@ in }; }; - users.users.${config.custom.username}.extraGroups = mkIf cfg.networkmanager [ "networkmanager" ]; + users.users.${config.custom.username}.extraGroups = mkIf cfg.networkmanager ["networkmanager"]; # Declarative networking #?? networkctl diff --git a/options/custom/settings/packages.nix b/options/custom/settings/packages.nix index 2bccc02..6d311d1 100644 --- a/options/custom/settings/packages.nix +++ b/options/custom/settings/packages.nix @@ -5,21 +5,16 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.packages; -in -{ +in { options.custom.settings.packages = { - enable = mkOption { default = false; }; - extra = mkOption { default = [ ]; }; + enable = mkOption {default = false;}; + extra = mkOption {default = [];}; }; config = mkIf cfg.enable ( - with pkgs; - { + with pkgs; { environment.systemPackages = cfg.extra ++ [ @@ -56,7 +51,7 @@ in # TODO: Remove when v14 released on nixpkgs # https://github.com/sonic2kk/steamtinkerlaunch/issues/992 # Build from latest commit - (steamtinkerlaunch.overrideAttrs { src = inputs.steamtinkerlaunch; }) + (steamtinkerlaunch.overrideAttrs {src = inputs.steamtinkerlaunch;}) # Dependencies p7zip # steamtinkerlaunch (Special K) @@ -165,17 +160,18 @@ in # https://wiki.nixos.org/wiki/Python#Package_unavailable_in_Nixpkgs # https://wiki.nixos.org/wiki/Packaging/Python (python311.withPackages ( - ps: with ps; [ - # lifx-cli - # https://github.com/Rawa/lifx-cli - (buildPythonPackage { - pname = "lifx-cli"; - version = "master"; - src = inputs.lifx-cli; - doCheck = false; - propagatedBuildInputs = with python311Packages; [ requests ]; - }) - ] + ps: + with ps; [ + # lifx-cli + # https://github.com/Rawa/lifx-cli + (buildPythonPackage { + pname = "lifx-cli"; + version = "master"; + src = inputs.lifx-cli; + doCheck = false; + propagatedBuildInputs = with python311Packages; [requests]; + }) + ] )) ]; } diff --git a/options/custom/settings/qt.nix b/options/custom/settings/qt.nix index 2a292b7..ed7f9da 100644 --- a/options/custom/settings/qt.nix +++ b/options/custom/settings/qt.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.qt; -in { - options.custom.settings.qt.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.qt; +in { + options.custom.settings.qt.enable = mkOption {default = false;}; config.home-manager.users.${config.custom.username} = mkIf cfg.enable { qt = { diff --git a/options/custom/settings/security.nix b/options/custom/settings/security.nix index 986ecb1..a621f0c 100644 --- a/options/custom/settings/security.nix +++ b/options/custom/settings/security.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.security; -in { - options.custom.settings.security.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.security; +in { + options.custom.settings.security.enable = mkOption {default = false;}; config = mkIf cfg.enable { # Bypass password prompts diff --git a/options/custom/settings/users.nix b/options/custom/settings/users.nix index cde3423..df9d526 100644 --- a/options/custom/settings/users.nix +++ b/options/custom/settings/users.nix @@ -5,44 +5,37 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.users; -in -{ +in { options.custom.settings.users = { - enable = mkOption { default = false; }; - shell = mkOption { default = pkgs.fish; }; + enable = mkOption {default = false;}; + shell = mkOption {default = pkgs.fish;}; ${config.custom.username} = { groups = mkOption { default = - if config.custom.full then - [ - "input" - "video" - ] - else - [ ]; + if config.custom.full + then [ + "input" + "video" + ] + else []; }; - linger = mkOption { default = false; }; - packages = mkOption { default = [ ]; }; + linger = mkOption {default = false;}; + packages = mkOption {default = [];}; }; }; config = mkIf cfg.enable { - age.secrets = - let - secret = filename: { - file = "${inputs.self}/secrets/${filename}"; - }; - in - { - "${config.custom.profile}/users/${config.custom.username}.pass" = secret "${config.custom.profile}/users/${config.custom.username}.pass"; - "${config.custom.profile}/users/root.pass" = secret "${config.custom.profile}/users/root.pass"; + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; }; + in { + "${config.custom.profile}/users/${config.custom.username}.pass" = secret "${config.custom.profile}/users/${config.custom.username}.pass"; + "${config.custom.profile}/users/root.pass" = secret "${config.custom.profile}/users/root.pass"; + }; users = { defaultUserShell = cfg.shell; @@ -55,7 +48,7 @@ in ${config.custom.username} = { isNormalUser = true; - extraGroups = [ "wheel" ] ++ cfg.${config.custom.username}.groups; + extraGroups = ["wheel"] ++ cfg.${config.custom.username}.groups; hashedPasswordFile = config.age.secrets."${config.custom.profile}/users/${config.custom.username}.pass".path; linger = cfg.${config.custom.username}.linger; diff --git a/options/custom/settings/vm.nix b/options/custom/settings/vm.nix index ae3e149..64ebf97 100644 --- a/options/custom/settings/vm.nix +++ b/options/custom/settings/vm.nix @@ -5,17 +5,13 @@ pkgs, ... }: - -with lib; - -let +with lib; let cfg = config.custom.settings.vm; -in -{ +in { options.custom.settings.vm = { - enable = mkOption { default = false; }; - libvirt = mkOption { default = true; }; - virtualbox = mkOption { default = false; }; + enable = mkOption {default = false;}; + libvirt = mkOption {default = true;}; + virtualbox = mkOption {default = false;}; }; config = mkIf cfg.enable { @@ -35,7 +31,8 @@ in (pkgs.OVMF.override { secureBoot = true; tpmSupport = true; - }).fd + }) + .fd ]; }; @@ -83,23 +80,21 @@ in # Fix resume messages polluting tty services.libvirt-guests.serviceConfig.StandardOutput = "journal"; - tmpfiles.rules = - let - firmware = pkgs.runCommandLocal "qemu-firmware" { } '' - mkdir $out - cp ${pkgs.qemu}/share/qemu/firmware/*.json $out - substituteInPlace $out/*.json --replace ${pkgs.qemu} /run/current-system/sw - ''; - in - [ - # HACK: Fix libvirt not automatically locating firmware - # https://github.com/NixOS/nixpkgs/issues/115996#issuecomment-2224296279 - # https://libvirt.org/formatdomain.html#bios-bootloader - "L+ /var/lib/qemu/firmware - - - - ${firmware}" + tmpfiles.rules = let + firmware = pkgs.runCommandLocal "qemu-firmware" {} '' + mkdir $out + cp ${pkgs.qemu}/share/qemu/firmware/*.json $out + substituteInPlace $out/*.json --replace ${pkgs.qemu} /run/current-system/sw + ''; + in [ + # HACK: Fix libvirt not automatically locating firmware + # https://github.com/NixOS/nixpkgs/issues/115996#issuecomment-2224296279 + # https://libvirt.org/formatdomain.html#bios-bootloader + "L+ /var/lib/qemu/firmware - - - - ${firmware}" - # HACK: Manually link image to default directory - "L+ /var/lib/libvirt/images/virtio-win.iso - - - - ${inputs.virtio-win}" - ]; + # HACK: Manually link image to default directory + "L+ /var/lib/libvirt/images/virtio-win.iso - - - - ${inputs.virtio-win}" + ]; }; }; } diff --git a/options/custom/settings/waydroid.nix b/options/custom/settings/waydroid.nix index 1dacbdd..81048f7 100644 --- a/options/custom/settings/waydroid.nix +++ b/options/custom/settings/waydroid.nix @@ -1,12 +1,12 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.custom.settings.waydroid; -in { - options.custom.settings.waydroid.enable = mkOption { default = false; }; + config, + lib, + ... +}: +with lib; let + cfg = config.custom.settings.waydroid; +in { + options.custom.settings.waydroid.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/WayDroid diff --git a/options/custom/settings/xdg.nix b/options/custom/settings/xdg.nix index 13d70e7..c30c4ab 100644 --- a/options/custom/settings/xdg.nix +++ b/options/custom/settings/xdg.nix @@ -3,10 +3,7 @@ lib, ... }: - -with lib; - -let +with lib; let evince = "org.gnome.Evince.desktop"; firefox-esr = config.home-manager.users.${config.custom.username}.programs.firefox.package.desktopItem.name; @@ -15,9 +12,8 @@ let nautilus = "org.gnome.Nautilus.desktop"; cfg = config.custom.settings.xdg; -in -{ - options.custom.settings.xdg.enable = mkOption { default = false; }; +in { + options.custom.settings.xdg.enable = mkOption {default = false;}; config = mkIf cfg.enable { # https://wiki.archlinux.org/title/XDG_Desktop_Portal diff --git a/options/default.nix b/options/default.nix index d9f2081..3f02363 100644 --- a/options/default.nix +++ b/options/default.nix @@ -1,8 +1,5 @@ -{ lib, ... }: - -with lib; - -{ +{lib, ...}: +with lib; { # Import all *.nix options from custom directory imports = filter (f: strings.hasSuffix ".nix" f) (filesystem.listFilesRecursive ./custom); } diff --git a/profiles/console/default.nix b/profiles/console/default.nix index 1544ca9..11c6267 100644 --- a/profiles/console/default.nix +++ b/profiles/console/default.nix @@ -5,10 +5,8 @@ options, pkgs, ... -}: - -{ - imports = [ inputs.jovian-nixos.nixosModules.default ]; +}: { + imports = [inputs.jovian-nixos.nixosModules.default]; custom = { minimal = true; @@ -30,10 +28,12 @@ services.syncthing = { enable = true; - folders = lib.getAttrs [ - "SYNC/.ignore" - "SYNC/game" - ] options.custom.services.syncthing.folders.default; + folders = + lib.getAttrs [ + "SYNC/.ignore" + "SYNC/game" + ] + options.custom.services.syncthing.folders.default; }; settings = { diff --git a/profiles/sbc/default.nix b/profiles/sbc/default.nix index 40c1b9f..eb02294 100644 --- a/profiles/sbc/default.nix +++ b/profiles/sbc/default.nix @@ -8,7 +8,7 @@ borgmatic = { enable = true; - sources = [ "/containers" ]; + sources = ["/containers"]; repositories = [ { diff --git a/secrets/secrets.nix b/secrets/secrets.nix index aef5be3..d222b15 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -4,7 +4,6 @@ let #?? cd secrets/ #?? agenix --edit file.age #?? agenix --rekey - # Users that imperatively encrypt age files #!! Imperative client key generation #?? ssh-keygen -f ~/.ssh/id_ed25519 -N '' @@ -38,8 +37,7 @@ let desktop = users ++ desktops; sbc = users ++ sbcs; server = users ++ servers; -in -{ +in { # TODO: Move secrets into each profile #?? config.age.secrets."PROFILE/SECRET".path