From 693d4e3c70f602dca7997e12f37c894df56657d6 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 15 Feb 2025 16:23:22 +0100 Subject: [PATCH] Use alejandra formatter / fix warnings --- base/common_hardware.nix | 30 +-- base/env.nix | 5 +- base/xkb_layout.nix | 10 +- docs/default.nix | 35 ++-- example/flake.nix | 8 +- example/hosts/example/configuration.nix | 3 +- flake.nix | 112 +++++----- home/common.nix | 8 +- home/default.nix | 17 +- home/sync.nix | 89 ++++---- home/themes/kdeglobals.nix | 33 ++- home/themes/oxiced.nix | 12 +- home/themes/qt.nix | 63 ++---- iso/configuration.nix | 6 +- lib/default.nix | 192 +++++++++-------- modules/conf.nix | 39 ++-- modules/programs/acpid.nix | 6 +- modules/programs/basePackages.nix | 91 ++++---- modules/programs/bluetooth.nix | 3 +- modules/programs/browser/brave.nix | 5 +- modules/programs/browser/chromium.nix | 5 +- modules/programs/browser/firefox.nix | 5 +- modules/programs/browser/zen.nix | 5 +- modules/programs/coding.nix | 87 ++++---- modules/programs/containers.nix | 59 +++--- modules/programs/drives.nix | 19 +- modules/programs/fish.nix | 16 +- modules/programs/flatpak.nix | 21 +- modules/programs/gaming.nix | 5 +- modules/programs/gdm.nix | 7 +- modules/programs/git.nix | 30 ++- modules/programs/gnome.nix | 28 ++- modules/programs/gnomeServices.nix | 22 +- modules/programs/gpu.nix | 55 +++-- modules/programs/greetd.nix | 36 ++-- modules/programs/homePackages.nix | 140 ++++++------- modules/programs/hyprland/anyrun.nix | 21 +- modules/programs/hyprland/hyprland.nix | 97 ++++----- modules/programs/hyprland/hyprlock.nix | 5 +- modules/programs/hyprland/hyprpaper.nix | 7 +- modules/programs/hyprland/ironbar.nix | 206 +++++++++--------- modules/programs/kde.nix | 4 +- modules/programs/kdeConnect.nix | 6 +- modules/programs/keepassxc.nix | 5 +- modules/programs/kitty.nix | 148 ++++++------- modules/programs/media.nix | 92 ++++---- modules/programs/mime.nix | 111 +++++----- modules/programs/ncspot.nix | 9 +- modules/programs/nextcloud.nix | 6 +- modules/programs/oxi/default.nix | 3 +- modules/programs/oxi/oxidash.nix | 3 +- modules/programs/oxi/oxinoti.nix | 6 +- modules/programs/oxi/oxipaste.nix | 3 +- modules/programs/oxi/oxishut.nix | 3 +- modules/programs/piper.nix | 7 +- modules/programs/plymouth.nix | 5 +- modules/programs/printing.nix | 5 +- modules/programs/scripts.nix | 189 ++++++++--------- modules/programs/sddm.nix | 5 +- modules/programs/sops.nix | 24 +-- modules/programs/starship.nix | 267 ++++++++++++------------ modules/programs/stylix.nix | 17 +- modules/programs/supersonic.nix | 77 +++---- modules/programs/teams.nix | 13 +- modules/programs/virtmanager.nix | 31 ++- modules/programs/xkb.nix | 3 +- modules/programs/xone.nix | 6 +- modules/programs/yazi/default.nix | 18 +- modules/programs/yazi/yazi.nix | 254 +++++++++++----------- override/teams.nix | 8 +- 70 files changed, 1424 insertions(+), 1547 deletions(-) diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 24edad2..8a0ba4b 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -5,12 +5,13 @@ hostName, modulesPath, ... -}: -let +}: let username = config.conf.username; -in -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; +in { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + #(modulesPath + "/misc/nixpkgs/read-only.nix") + ]; # Bootloader. boot = { @@ -34,11 +35,13 @@ in "sd_mod" ]; }; - kernelParams = [ - ''resume="PARTLABEL=SWAP"'' - ''quiet'' - ''udev.log_level=3'' - ] ++ config.conf.bootParams; + kernelParams = + [ + ''resume="PARTLABEL=SWAP"'' + ''quiet'' + ''udev.log_level=3'' + ] + ++ config.conf.bootParams; }; # Enable networking @@ -59,6 +62,8 @@ in flatpak.enable = true; xserver.enable = true; fstrim.enable = lib.mkDefault true; + # Enable sound with pipewire. + pulseaudio.enable = false; pipewire = { enable = true; alsa = { @@ -78,16 +83,14 @@ in options = "--delete-older-than 7d --delete-generations +5"; }; settings = { - trusted-users = [ username ]; + trusted-users = [username]; auto-optimise-store = true; experimental-features = "nix-command flakes"; }; }; - # Enable sound with pipewire. hardware = { - pulseaudio.enable = false; cpu.${config.conf.cpu}.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; @@ -124,5 +127,4 @@ in password = "firstlogin"; }; }; - } diff --git a/base/env.nix b/base/env.nix index f4de6c3..8d6b97e 100644 --- a/base/env.nix +++ b/base/env.nix @@ -1,5 +1,8 @@ -{ pkgs, config, ... }: { + pkgs, + config, + ... +}: { environment = { variables = { GSETTINGS_SCHEMA_DIR = "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}"; diff --git a/base/xkb_layout.nix b/base/xkb_layout.nix index ecbc97c..0324c99 100644 --- a/base/xkb_layout.nix +++ b/base/xkb_layout.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let layout = pkgs.writeText "dashie" '' xkb_symbols "dashie" { @@ -10,12 +9,11 @@ let key { [ u, U, udiaeresis, Udiaeresis ] }; }; ''; -in -{ - environment.systemPackages = [ pkgs.xorg.xkbcomp ]; +in { + environment.systemPackages = [pkgs.xorg.xkbcomp]; services.xserver.xkb.extraLayouts.dashie = { description = "US layout with 'umlaut'"; - languages = [ "eng" ]; + languages = ["eng"]; symbolsFile = "${layout}"; }; } diff --git a/docs/default.nix b/docs/default.nix index 42ae80c..f7e9622 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -4,9 +4,8 @@ build_systems, lib, ... -}: -let - makeOptionsDoc = configuration: pkgs.nixosOptionsDoc { options = configuration; }; +}: let + makeOptionsDoc = configuration: pkgs.nixosOptionsDoc {options = configuration;}; generateDocs = obj: '' touch src/${obj.fst}.md sed '/*Declared by:*/,/^$/d' <${obj.snd.optionsCommonMark} >> src/${obj.fst}.md @@ -14,8 +13,8 @@ let summaryAppend = name: '' echo "- [${name}](${name}.md)" >> src/SUMMARY.md ''; - system = (build_systems { root = ../example/.; })."example".options; - makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc { options = system.mods.${name}; }; + system = (build_systems {root = ../example/.;})."example".options; + makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc {options = system.mods.${name};}; conf = makeOptionsDoc system.conf; paths = builtins.readDir ../modules/programs; names = lib.lists.remove "default" ( @@ -25,18 +24,18 @@ let docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods)); summary = lib.strings.concatStringsSep " " (map summaryAppend names); in -pkgs.stdenvNoCC.mkDerivation { - name = "dashNix-book"; - src = ./.; + pkgs.stdenvNoCC.mkDerivation { + name = "dashNix-book"; + src = ./.; - patchPhase = '' - sed '/*Declared by:*/,/^$/d' <${conf.optionsCommonMark} >> src/conf.md - ${docs} - echo "[README](README.md)\n # Options\n - [Base Config](conf.md)" >> src/SUMMARY.md - ${summary} - ''; + patchPhase = '' + sed '/*Declared by:*/,/^$/d' <${conf.optionsCommonMark} >> src/conf.md + ${docs} + echo "[README](README.md)\n # Options\n - [Base Config](conf.md)" >> src/SUMMARY.md + ${summary} + ''; - buildPhase = '' - ${pkgs.mdbook}/bin/mdbook build --dest-dir $out - ''; -} + buildPhase = '' + ${pkgs.mdbook}/bin/mdbook build --dest-dir $out + ''; + } diff --git a/example/flake.nix b/example/flake.nix index d4c1e09..0ad08bc 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -21,11 +21,9 @@ }; }; - outputs = - { ... }@inputs: - { - nixosConfigurations = inputs.dashNix.dashNixLib.build_systems { root = ./.; }; - }; + outputs = {...} @ inputs: { + nixosConfigurations = inputs.dashNix.dashNixLib.build_systems {root = ./.;}; + }; nixConfig = { builders-use-substitutes = true; diff --git a/example/hosts/example/configuration.nix b/example/hosts/example/configuration.nix index ef9d710..c39c104 100644 --- a/example/hosts/example/configuration.nix +++ b/example/hosts/example/configuration.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{config, ...}: { # variables for system # TODO important changes conf = { diff --git a/flake.nix b/flake.nix index 1cdbd0e..7665cfe 100644 --- a/flake.nix +++ b/flake.nix @@ -48,66 +48,62 @@ }; }; - outputs = - { self, ... }@inputs: - let - permittedPackages = [ - "olm-3.2.16" - # well done dotnet... - # this is just for omnisharp - "dotnet-core-combined" - "dotnet-wrapped-combined" - "dotnet-combined" - "dotnet-sdk-6.0.428" - "dotnet-sdk-wrapped-6.0.428" - "dotnet-sdk-6.0.136" - "dotnet-sdk-wrapped-6.0.136" - "dotnet-sdk-7.0.120" - "dotnet-sdk-wrapped-7.0.120" - "dotnet-sdk-7.0.410" - "dotnet-sdk-wrapped-7.0.410" - "jitsi-meet-1.0.8043" - "nextcloud-27.1.11" - ]; - stable = import inputs.stable { - system = "x86_64-linux"; - config = { - allowUnfree = true; - allowBroken = true; - permittedInsecurePackages = permittedPackages; - }; + outputs = {self, ...} @ inputs: let + permittedPackages = [ + "olm-3.2.16" + # well done dotnet... + # this is just for omnisharp + "dotnet-core-combined" + "dotnet-wrapped-combined" + "dotnet-combined" + "dotnet-sdk-6.0.428" + "dotnet-sdk-wrapped-6.0.428" + "dotnet-sdk-6.0.136" + "dotnet-sdk-wrapped-6.0.136" + "dotnet-sdk-7.0.120" + "dotnet-sdk-wrapped-7.0.120" + "dotnet-sdk-7.0.410" + "dotnet-sdk-wrapped-7.0.410" + "jitsi-meet-1.0.8043" + "nextcloud-27.1.11" + ]; + stable = import inputs.stable { + system = "x86_64-linux"; + config = { + allowUnfree = true; + permittedInsecurePackages = permittedPackages; }; - pkgs = import inputs.nixpkgs { - system = "x86_64-linux"; - config = { - allowUnsupportedSystem = true; - permittedInsecurePackages = permittedPackages; - allowBroken = true; - allowUnfree = true; - }; - }; - in - rec { - dashNixLib = import ./lib { - inherit - self - inputs - pkgs - stable - ; - lib = inputs.nixpkgs.lib; - }; - docs = import ./docs { - inherit inputs pkgs stable; - lib = inputs.nixpkgs.lib; - build_systems = dashNixLib.build_systems; - }; - dashNixInputs = inputs; - stablePkgs = stable; - unstablePkgs = pkgs; - modules = ./modules; - iso = dashNixLib.buildIso.config.system.build.isoImage; }; + pkgs = import inputs.nixpkgs { + system = "x86_64-linux"; + config = { + allowUnsupportedSystem = true; + permittedInsecurePackages = permittedPackages; + allowBroken = true; + allowUnfree = true; + }; + }; + in rec { + dashNixLib = import ./lib { + inherit + self + inputs + pkgs + stable + ; + lib = inputs.nixpkgs.lib; + }; + docs = import ./docs { + inherit inputs pkgs stable; + lib = inputs.nixpkgs.lib; + build_systems = dashNixLib.build_systems; + }; + dashNixInputs = inputs; + stablePkgs = stable; + unstablePkgs = pkgs; + modules = ./modules; + iso = dashNixLib.buildIso.config.system.build.isoImage; + }; nixConfig = { builders-use-substitutes = true; diff --git a/home/common.nix b/home/common.nix index 19d704d..c1df32a 100644 --- a/home/common.nix +++ b/home/common.nix @@ -2,11 +2,9 @@ config, lib, ... -}: -let +}: let username = config.conf.username; -in -{ +in { manual = { html.enable = false; json.enable = false; @@ -18,7 +16,7 @@ in home = { username = username; homeDirectory = "/home/${username}"; - sessionPath = [ "$HOME/.cargo/bin" ]; + sessionPath = ["$HOME/.cargo/bin"]; enableNixpkgsReleaseCheck = false; sessionVariables = { diff --git a/home/default.nix b/home/default.nix index 3764e3e..662028e 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,22 +1,21 @@ { - inputs, - pkgs, - config, - lib, - mod, additionalHomeConfig, - homeMods, additionalHomeMods, additionalInputs, + config, + homeMods, + inputs, + lib, + mod, + pkgs, root, ... -}: -{ +}: { xdg = { portal.config.common.default = "*"; portal = { enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; }; }; home-manager = { diff --git a/home/sync.nix b/home/sync.nix index d82e269..06b6a02 100644 --- a/home/sync.nix +++ b/home/sync.nix @@ -4,53 +4,56 @@ pkgs, lib, ... -}: -let +}: let username = config.mods.nextcloud.username; password = - if (config.sops.secrets ? nextcloud.path) then config.sops.secrets.nextcloud.path else ""; + if (config.sops.secrets ? nextcloud.path) + then config.sops.secrets.nextcloud.path + else ""; url = config.mods.nextcloud.url; synclist = config.mods.nextcloud.synclist; in -lib.mkIf config.mods.nextcloud.enable { - systemd.user = { - services = ( - builtins.listToAttrs ( - map (opts: { - name = "${opts.name}"; - value = { - Unit = { - Description = "Auto sync Nextcloud"; - After = "network-online.target"; + lib.mkIf config.mods.nextcloud.enable { + systemd.user = { + services = ( + builtins.listToAttrs ( + map (opts: { + name = "${opts.name}"; + value = { + Unit = { + Description = "Auto sync Nextcloud"; + After = "network-online.target"; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'"; + TimeoutStopSec = "180"; + KillMode = "process"; + KillSignal = "SIGINT"; + }; + Install.WantedBy = ["multi-user.target"]; }; - Service = { - Type = "simple"; - ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'"; - TimeoutStopSec = "180"; - KillMode = "process"; - KillSignal = "SIGINT"; + }) + synclist + ) + ); + timers = ( + builtins.listToAttrs ( + map (opts: { + name = "${opts.name}"; + value = { + Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes"; + Timer.OnBootSec = "1min"; + Timer.OnUnitActiveSec = "60min"; + Install.WantedBy = [ + "multi-user.target" + "timers.target" + ]; }; - Install.WantedBy = [ "multi-user.target" ]; - }; - }) synclist - ) - ); - timers = ( - builtins.listToAttrs ( - map (opts: { - name = "${opts.name}"; - value = { - Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes"; - Timer.OnBootSec = "1min"; - Timer.OnUnitActiveSec = "60min"; - Install.WantedBy = [ - "multi-user.target" - "timers.target" - ]; - }; - }) synclist - ) - ); - startServices = true; - }; -} + }) + synclist + ) + ); + startServices = true; + }; + } diff --git a/home/themes/kdeglobals.nix b/home/themes/kdeglobals.nix index 1a7f217..8fa5003 100644 --- a/home/themes/kdeglobals.nix +++ b/home/themes/kdeglobals.nix @@ -1,24 +1,21 @@ # This is ABSOLUTE GARGABE, KDE srsly, remove this! -# props to catppuccin mocha for sparing me from doing this manually: https://github.com/catppuccin/kde/blob/main/Resources/Base.colors +# props to catppuccin mocha for sparing me from doing this manually: https://github.com/catppuccin/kde/blob/main/Resources/Base.colors { pkgs, config, lib, inputs, ... -}: -let - base16 = pkgs.callPackage inputs.base16.lib { }; +}: let + base16 = pkgs.callPackage inputs.base16.lib {}; - baseScheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); - power = - number: powerIndex: - if powerIndex == 1 then - number - else if powerIndex == 0 then - 1 - else - number * power number (powerIndex - 1); + baseScheme = base16.mkSchemeAttrs config.stylix.base16Scheme; + power = number: powerIndex: + if powerIndex == 1 + then number + else if powerIndex == 0 + then 1 + else number * power number (powerIndex - 1); lookupTable = powerIndex: { "0" = 0 * (power 16 powerIndex); @@ -39,16 +36,14 @@ let "f" = 15 * (power 16 powerIndex); }; - convertHex = - hexChars: + convertHex = hexChars: recombineColors [ (convertColor (lib.lists.take 2 hexChars)) (convertColor (lib.lists.take 2 (lib.lists.drop 2 hexChars))) (convertColor (lib.lists.take 2 (lib.lists.drop 4 hexChars))) ]; - convertColor = - color: (lookupTable 1).${(lib.lists.head color)} + (lookupTable 0).${(lib.lists.last color)}; + convertColor = color: (lookupTable 1).${(lib.lists.head color)} + (lookupTable 0).${(lib.lists.last color)}; recombineColors = colors: lib.lists.foldr (a: b: (toString a) + "," + (toString b)) "end" colors; scheme = { @@ -101,9 +96,7 @@ let convertHex (lib.strings.stringToCharacters baseScheme.base0F) ); }; - -in -{ +in { # temp # crust -> surface1 # subtext0 -> surface2 diff --git a/home/themes/oxiced.nix b/home/themes/oxiced.nix index 4440b22..562ddd8 100644 --- a/home/themes/oxiced.nix +++ b/home/themes/oxiced.nix @@ -3,16 +3,14 @@ inputs, pkgs, ... -}: -let +}: let # at time of using this here, stylix might not be evaluated yet # hence ensure it is by using base16 mkSchemeAttrs - base16 = pkgs.callPackage inputs.base16.lib { }; - scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); -in -{ + base16 = pkgs.callPackage inputs.base16.lib {}; + scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; +in { xdg.configFile."oxiced/theme.toml" = { - source = (pkgs.formats.toml { }).generate "oxiced" { + source = (pkgs.formats.toml {}).generate "oxiced" { name = scheme.scheme; base00 = scheme.base00; base01 = scheme.base01; diff --git a/home/themes/qt.nix b/home/themes/qt.nix index 488efb6..042c0f6 100644 --- a/home/themes/qt.nix +++ b/home/themes/qt.nix @@ -4,23 +4,25 @@ pkgs, lib, ... -}: -let +}: let username = config.conf.username; # at time of using this here, stylix might not be evaluated yet # hence ensure it is by using base16 mkSchemeAttrs - base16 = pkgs.callPackage inputs.base16.lib { }; - scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); + base16 = pkgs.callPackage inputs.base16.lib {}; + scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; # active_colors=#ffc0caf5, #${scheme.base00}, #ff373949, #ff2b2c3b, #ff1a1b26, #ff2b2c3b, #ffc0caf5, #ffc0caf5, #ffc0caf5, #ff1a1b26, #ff1a1b26, #19000000, #ff2b2c3b, #ffc0caf5, #ff3584e4, #ff1b6acb, #ff1a1b26, #ff242530, #ff1a1b26, #ffc0caf5, #ffc0caf5 # disabled_colors=#ff6d728d, #${scheme.base00}, #ff373949, #ff2b2c3b, #ff1a1b26, #ff2b2c3b, #ff6d728d, #ff6d728d, #ff6d728d, #ff1a1b26, #ff1a1b26, #19000000, #ff2b2c3b, #ff6d728d, #ff3584e4, #ff1b6acb, #ff1a1b26, #ff242530, #ff1a1b26, #ff6d728d, #ff6d728d # inactive_colors=#ff6d728d, #${scheme.base00}, #ff373949, #ff2b2c3b, #ff1a1b26, #ff2b2c3b, #ff6d728d, #ff6d728d, #ff6d728d, #ff1a1b26, #ff1a1b26, #19000000, #ff2b2c3b, #ff6d728d, #ff3584e4, #ff1b6acb, #ff1a1b26, #ff242530, #ff1a1b26, #ff6d728d, #ff6d728d color = '' + + [ColorScheme] active_colors=#ff${scheme.base05}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base00}, #ff${scheme.base05}, #ff${scheme.base04}, #ff${scheme.base05}, #ff${scheme.base00}, #ff${scheme.base00}, #00${scheme.base01}, #ff${scheme.base02}, #ff${scheme.base04}, #ff${scheme.base08}, #ff${scheme.base04}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base01}, #ff${scheme.base05}, #ff${scheme.base04} disabled_colors=#ff${scheme.base05}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base00}, #ff${scheme.base05}, #ff${scheme.base04}, #ff${scheme.base05}, #ff${scheme.base00}, #ff${scheme.base00}, #00${scheme.base01}, #ff${scheme.base02}, #ff${scheme.base04}, #ff${scheme.base08}, #ff${scheme.base04}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base01}, #ff${scheme.base05}, #ff${scheme.base04} inactive_colors=#ff${scheme.base05}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base00}, #ff${scheme.base05}, #ff${scheme.base04}, #ff${scheme.base05}, #ff${scheme.base00}, #ff${scheme.base00}, #00${scheme.base01}, #ff${scheme.base02}, #ff${scheme.base04}, #ff${scheme.base08}, #ff${scheme.base04}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base01}, #ff${scheme.base05}, #ff${scheme.base04} ''; qss = '' + QTabBar::tab:selected { color: palette(highlight); } @@ -28,33 +30,7 @@ let border: none; } ''; - - ## test - #cfg = config.stylix.targets.qt; - kvconfig = config.lib.stylix.colors { - template = ./kvconfig.mustache; - extension = ".kvconfig"; - }; - svg = config.lib.stylix.colors { - template = ./kvantum-svg.mustache; - extension = "svg"; - }; - kvantumPackage = pkgs.runCommandLocal "base16-kvantum" { } '' - directory="$out/share/Kvantum/Base16Kvantum" - mkdir --parents "$directory" - cat ${kvconfig} >>"$directory/Base16Kvantum.kvconfig" - cat ${svg} >>"$directory/Base16Kvantum.svg" - ''; - - xdg.configFile."Kvantum/kvantum.kvconfig".source = - (pkgs.formats.ini { }).generate "kvantum.kvconfig" - { - General.theme = "Base16Kvantum"; - }; - - xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum"; -in -{ +in { xdg.configFile."qt5ct/colors/tokyonight.conf" = { text = "${color}"; }; @@ -64,34 +40,18 @@ in xdg.configFile."qt5ct/qss/tab.qss" = { text = "${qss}"; }; + stylix.targets.qt = { + enable = false; + }; qt = { enable = true; style.package = pkgs.libsForQt5.breeze-qt5; style.name = lib.mkForce "breeze-dark"; }; - # ## test - # xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { - # General.theme = "Base16Kvantum"; - # }; - - # xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum"; - - # xdg.configFile."qt5ct/qt5ct.conf".text = '' - # [Appearance] - # style=kvantum - # ''; - - # #icon_theme=${cfg.iconThemeName} - - # xdg.configFile."qt6ct/qt6ct.conf".text = '' - # [Appearance] - # style=kvantum - # ''; - # #icon_theme=${cfg.iconThemeName} - xdg.configFile."qt5ct/qt5ct.conf" = { text = '' + [Appearance] color_scheme_path=/home/${username}/.config/qt5ct/colors/tokyonight.conf custom_palette=true @@ -128,6 +88,7 @@ in }; xdg.configFile."qt6ct/qt6ct.conf" = { text = '' + [Appearance] color_scheme_path=/home/${username}/.config/qt6ct/colors/tokyonight.conf custom_palette=true diff --git a/iso/configuration.nix b/iso/configuration.nix index e002625..a17ba81 100644 --- a/iso/configuration.nix +++ b/iso/configuration.nix @@ -4,10 +4,8 @@ modulesPath, self, ... -}: -{ - - imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" ]; +}: { + imports = ["${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"]; nixpkgs.hostPlatform = { system = "x86_64-linux"; }; diff --git a/lib/default.nix b/lib/default.nix index f3a174b..757fdf4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,32 +1,31 @@ { inputs, + lib, pkgs, self, stable, - lib, ... -}: -{ +}: { /* - * - # build_systems + * + # build_systems - Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well. + Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well. - A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration. + A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration. - The second parameter is the root of your configuration, which should be ./. in most cases. + The second parameter is the root of your configuration, which should be ./. in most cases. - `root` + `root` - : the root path of your configuration + : the root path of your configuration - # Example usage - :::{.example} - ```nix - nixosConfigurations = build_systems { root = ./.; }; - ``` - ::: + # Example usage + :::{.example} + ```nix + nixosConfigurations = build_systems { root = ./.; }; + ``` + ::: */ # let # paths = builtins.readDir ; @@ -35,89 +34,102 @@ # ); # in - build_systems = - { - root, - additionalMods ? { - nixos = [ ]; - home = [ ]; - }, - mods ? { - nixos = [ - inputs.home-manager.nixosModules.home-manager - inputs.stylix.nixosModules.stylix - ../base - ../home - ../modules - ]; - home = [ - inputs.anyrun.homeManagerModules.default - inputs.ironbar.homeManagerModules.default - inputs.oxicalc.homeManagerModules.default - inputs.oxishut.homeManagerModules.default - inputs.oxinoti.homeManagerModules.default - inputs.oxidash.homeManagerModules.default - inputs.oxipaste.homeManagerModules.default - inputs.hyprdock.homeManagerModules.default - inputs.hyprland.homeManagerModules.default - inputs.reset.homeManagerModules.default - inputs.nix-flatpak.homeManagerModules.nix-flatpak - inputs.sops-nix.homeManagerModules.sops - inputs.dashvim.homeManagerModules.dashvim - ../modules - ]; - }, - additionalInputs ? { }, - overridePkgs ? false, - ... - }: + build_systems = { + root, + additionalMods ? { + nixos = []; + home = []; + }, + mods ? { + nixos = [ + inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix + ../base + ../home + ../modules + ]; + home = [ + inputs.anyrun.homeManagerModules.default + inputs.ironbar.homeManagerModules.default + inputs.oxicalc.homeManagerModules.default + inputs.oxishut.homeManagerModules.default + inputs.oxinoti.homeManagerModules.default + inputs.oxidash.homeManagerModules.default + inputs.oxipaste.homeManagerModules.default + inputs.hyprdock.homeManagerModules.default + inputs.hyprland.homeManagerModules.default + inputs.reset.homeManagerModules.default + inputs.nix-flatpak.homeManagerModules.nix-flatpak + inputs.sops-nix.homeManagerModules.sops + inputs.dashvim.homeManagerModules.dashvim + ../modules + ]; + }, + additionalInputs ? {}, + overridePkgs ? false, + ... + }: builtins.listToAttrs ( map - (name: { - name = name; - value = - let - mod = root + /hosts/${name}/configuration.nix; - additionalNixosConfig = root + /hosts/${name}/hardware.nix; - additionalHomeConfig = root + /hosts/${name}/home.nix; - in - inputs.nixpkgs.lib.nixosSystem { - specialArgs = { - inherit - self - inputs - mod - additionalHomeConfig - root - ; - pkgs = if overridePkgs then stable else pkgs; - alternativePkgs = if overridePkgs then pkgs else stable; - hostName = name; - homeMods = mods.home; - additionalHomeMods = additionalMods.home; - additionalInputs = additionalInputs; - }; - modules = - [ mod ] - ++ mods.nixos - ++ additionalMods.nixos - ++ inputs.nixpkgs.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig - ++ inputs.nixpkgs.lib.optional (builtins.pathExists mod) mod; - }; - }) - ( - lib.lists.remove "" ( - lib.attrsets.mapAttrsToList (name: fType: if fType == "directory" then name else "") ( - builtins.readDir (root + /hosts) - ) + (name: { + name = name; + value = let + mod = root + /hosts/${name}/configuration.nix; + additionalNixosConfig = root + /hosts/${name}/hardware.nix; + additionalHomeConfig = root + /hosts/${name}/home.nix; + args = { + inherit + self + inputs + mod + additionalHomeConfig + root + ; + pkgs = lib.mkForce ( + if overridePkgs + then stable + else pkgs + ); + alternativePkgs = + if overridePkgs + then pkgs + else stable; + hostName = name; + homeMods = mods.home; + additionalHomeMods = additionalMods.home; + additionalInputs = additionalInputs; + }; + in + inputs.nixpkgs.lib.nixosSystem { + modules = + [ + {_module.args = args;} + mod + ] + ++ mods.nixos + ++ additionalMods.nixos + ++ inputs.nixpkgs.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig + ++ inputs.nixpkgs.lib.optional (builtins.pathExists mod) mod; + }; + }) + ( + lib.lists.remove "" ( + lib.attrsets.mapAttrsToList (name: fType: + if fType == "directory" + then name + else "") ( + builtins.readDir (root + /hosts) ) ) + ) ); buildIso = inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit self inputs pkgs; }; - modules = [ ../iso/configuration.nix ]; + modules = [ + ../iso/configuration.nix + ]; }; } diff --git a/modules/conf.nix b/modules/conf.nix index 5645abb..91f83db 100644 --- a/modules/conf.nix +++ b/modules/conf.nix @@ -4,20 +4,16 @@ pkgs, options, ... -}: -{ +}: { options.conf = { - system = lib.mkOption { default = "x86_64-linux"; # no fisherprice unix support - type = - with lib.types; - (enum [ - "x86_64-linux" - "aarch64-linux" - "aarch64-linux-android" - ]); + type = with lib.types; (enum [ + "x86_64-linux" + "aarch64-linux" + "aarch64-linux-android" + ]); example = "aarch64-linux"; description = '' System architecture. @@ -27,12 +23,10 @@ cpu = lib.mkOption { # TODO: how to enable arm? default = "amd"; - type = - with lib.types; - (enum [ - "amd" - "intel" - ]); + type = with lib.types; (enum [ + "amd" + "intel" + ]); example = "intel"; description = '' cpu microcode. @@ -43,7 +37,7 @@ default = [ "video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}" ]; - example = [ ]; + example = []; type = with lib.types; listOf str; description = '' additional kernelParams passed to bootloader @@ -79,7 +73,7 @@ ironbar = { modules = lib.mkOption { - default = [ ]; + default = []; example = [ { type = "upower"; @@ -94,8 +88,8 @@ }; bootParams = lib.mkOption { - default = [ ]; - example = [ "resume=something" ]; + default = []; + example = ["resume=something"]; type = with lib.types; listOf str; description = '' Boot params @@ -164,7 +158,7 @@ default = "23.05"; type = lib.types.str; description = '' - System state version + System state version ''; }; homeStateVersion = lib.mkOption { @@ -172,10 +166,9 @@ example = "23.05"; type = lib.types.str; description = '' - Home state version + Home state version ''; }; - }; config = diff --git a/modules/programs/acpid.nix b/modules/programs/acpid.nix index 2c0eeab..228c402 100644 --- a/modules/programs/acpid.nix +++ b/modules/programs/acpid.nix @@ -3,9 +3,7 @@ config, options, ... -}: -{ - +}: { options.mods = { acpid.enable = lib.mkOption { default = false; @@ -18,6 +16,6 @@ }; config = lib.mkIf config.mods.acpid.enable ( - lib.optionalAttrs (options ? virtualisation.virtualbox.host) { services.acpid.enable = true; } + lib.optionalAttrs (options ? virtualisation.virtualbox.host) {services.acpid.enable = true;} ); } diff --git a/modules/programs/basePackages.nix b/modules/programs/basePackages.nix index 519e715..635a2a7 100644 --- a/modules/programs/basePackages.nix +++ b/modules/programs/basePackages.nix @@ -3,10 +3,8 @@ lib, options, pkgs, - inputs, ... -}: -{ +}: { options.mods = { basePackages = { enable = lib.mkOption { @@ -18,8 +16,8 @@ ''; }; additionalPackages = lib.mkOption { - default = [ ]; - example = [ pkgs.openssl ]; + default = []; + example = [pkgs.openssl]; type = with lib.types; listOf package; description = '' Additional packages to install. @@ -27,16 +25,16 @@ ''; }; specialPrograms = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' special program configuration to be added which require programs.something notation. ''; }; specialServices = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' special services configuration to be added which require an services.something notation. @@ -47,42 +45,43 @@ config = lib.optionalAttrs (options ? environment.systemPackages) { environment.systemPackages = - if config.mods.basePackages.enable then + if config.mods.basePackages.enable + then with pkgs; - [ - adwaita-icon-theme - dbus - dconf - direnv - glib - gnome.nixos-gsettings-overrides - gsettings-desktop-schemas - gtk-layer-shell - gtk3 - gtk4 - gtk4-layer-shell - hicolor-icon-theme - icon-library - kdePackages.breeze-icons - kdePackages.breeze - libsForQt5.breeze-qt5 - kdePackages.qtstyleplugin-kvantum - libsForQt5.qtstyleplugin-kvantum - libadwaita - libxkbcommon - nixfmt-rfc-style - openssl - seahorse - upower - xorg.xkbutils - ] - ++ config.mods.basePackages.additionalPackages - else - config.mods.basePackages.additionalPackages; + [ + adwaita-icon-theme + dbus + dconf + direnv + glib + gnome.nixos-gsettings-overrides + gsettings-desktop-schemas + gtk-layer-shell + gtk3 + gtk4 + gtk4-layer-shell + hicolor-icon-theme + icon-library + kdePackages.breeze-icons + kdePackages.breeze + libsForQt5.breeze-qt5 + kdePackages.qtstyleplugin-kvantum + libsForQt5.qtstyleplugin-kvantum + libadwaita + libxkbcommon + alejandra + openssl + seahorse + upower + xorg.xkbutils + ] + ++ config.mods.basePackages.additionalPackages + else config.mods.basePackages.additionalPackages; gtk.iconCache.enable = false; services = - if config.mods.basePackages.enable then + if config.mods.basePackages.enable + then { upower.enable = true; dbus = { @@ -95,11 +94,11 @@ }; } // config.mods.basePackages.specialServices - else - config.mods.basePackages.specialServices; + else config.mods.basePackages.specialServices; programs = - if config.mods.basePackages.enable then + if config.mods.basePackages.enable + then { nix-ld = { enable = true; @@ -121,8 +120,6 @@ gnupg.agent.enable = true; } // config.mods.basePackages.specialPrograms - else - config.mods.basePackages.specialPrograms; + else config.mods.basePackages.specialPrograms; }; - } diff --git a/modules/programs/bluetooth.nix b/modules/programs/bluetooth.nix index 7818d34..e09b382 100644 --- a/modules/programs/bluetooth.nix +++ b/modules/programs/bluetooth.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods = { bluetooth.enable = lib.mkOption { default = false; diff --git a/modules/programs/browser/brave.nix b/modules/programs/browser/brave.nix index 5e71638..9a09e7e 100644 --- a/modules/programs/browser/brave.nix +++ b/modules/programs/browser/brave.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.browser.brave = { enable = lib.mkOption { default = false; @@ -17,7 +16,7 @@ }; config = lib.mkIf config.mods.browser.brave.enable ( lib.optionalAttrs (options ? home.packages) { - home.packages = with pkgs; [ brave ]; + home.packages = with pkgs; [brave]; } ); } diff --git a/modules/programs/browser/chromium.nix b/modules/programs/browser/chromium.nix index b5d91f4..7ed237a 100644 --- a/modules/programs/browser/chromium.nix +++ b/modules/programs/browser/chromium.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.browser.chromium = { enable = lib.mkOption { default = false; @@ -17,7 +16,7 @@ }; config = lib.mkIf config.mods.browser.chromium.enable ( lib.optionalAttrs (options ? home.packages) { - home.packages = with pkgs; [ chromium ]; + home.packages = with pkgs; [chromium]; } ); } diff --git a/modules/programs/browser/firefox.nix b/modules/programs/browser/firefox.nix index 69d5799..0220cf8 100644 --- a/modules/programs/browser/firefox.nix +++ b/modules/programs/browser/firefox.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.browser.firefox = { enable = lib.mkOption { default = false; @@ -43,7 +42,7 @@ SkipOnboarding = true; }; }; - example = { }; + example = {}; type = with lib.types; attrsOf anything; description = "Firefox policy configuration. See https://mozilla.github.io/policy-templates/ for more information."; }; diff --git a/modules/programs/browser/zen.nix b/modules/programs/browser/zen.nix index 96de349..96ef32c 100644 --- a/modules/programs/browser/zen.nix +++ b/modules/programs/browser/zen.nix @@ -5,8 +5,7 @@ system, inputs, ... -}: -{ +}: { options.mods.browser.zen = { enable = lib.mkOption { default = false; @@ -18,7 +17,7 @@ }; config = lib.mkIf config.mods.browser.zen.enable ( lib.optionalAttrs (options ? home.packages) { - home.packages = [ inputs.zen-browser.packages."${system}".default ]; + home.packages = [inputs.zen-browser.packages."${system}".default]; } ); } diff --git a/modules/programs/coding.nix b/modules/programs/coding.nix index 4e2afc4..dbf78f3 100644 --- a/modules/programs/coding.nix +++ b/modules/programs/coding.nix @@ -4,8 +4,7 @@ pkgs, options, ... -}: -{ +}: { options.mods = { coding = { enable = lib.mkOption { @@ -42,8 +41,8 @@ ''; }; extensions = lib.mkOption { - default = [ ]; - example = [ ]; + default = []; + example = []; type = with lib.types; listOf package; description = "Extensions to be installed"; }; @@ -55,8 +54,8 @@ description = "Use default base packages (only additionalPackages are installed if false)"; }; additionalPackages = lib.mkOption { - default = [ ]; - example = [ ]; + default = []; + example = []; type = with lib.types; listOf package; description = "Additional packages to be installed"; }; @@ -76,7 +75,7 @@ ghc haskellPackages.haskell-language-server ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' haskell packages @@ -98,7 +97,7 @@ tinymist ltex-ls ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' typst packages @@ -119,7 +118,7 @@ go gopls ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' Go packages @@ -136,8 +135,8 @@ ''; }; packages = lib.mkOption { - default = with pkgs; [ rustup ]; - example = [ ]; + default = with pkgs; [rustup]; + example = []; type = with lib.types; listOf package; description = '' Rust packages @@ -161,7 +160,7 @@ nodePackages.typescript-language-server nodePackages.prettier ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' TS/JS packages @@ -182,7 +181,7 @@ zig zls ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' zig packages @@ -205,7 +204,7 @@ jdt-language-server temurin-jre-bin ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' Java packages @@ -232,7 +231,7 @@ fsharp #fsautocomplete ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' C#/F# packages @@ -255,7 +254,7 @@ gcc clang-tools ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' C/C++ packages @@ -278,7 +277,7 @@ python312Packages.python-lsp-ruff python312Packages.python-lsp-black ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' python packages @@ -304,7 +303,7 @@ #json jq ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' packages for said filetypes @@ -325,7 +324,7 @@ bash-language-server shfmt ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' bash packages @@ -347,7 +346,7 @@ tailwindcss-language-server # html-tidy ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' html/css packages @@ -368,7 +367,7 @@ nodePackages.sql-formatter sqls ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = '' sql packages @@ -385,8 +384,8 @@ ''; }; packages = lib.mkOption { - default = with pkgs; [ gleam ]; - example = [ ]; + default = with pkgs; [gleam]; + example = []; type = with lib.types; listOf package; description = '' gleam packages @@ -403,8 +402,8 @@ ''; }; packages = lib.mkOption { - default = with pkgs; [ asm-lsp ]; - example = [ ]; + default = with pkgs; [asm-lsp]; + example = []; type = with lib.types; listOf package; description = '' assembly packages @@ -415,23 +414,22 @@ }; }; - config = - let - basePackages = with pkgs; [ - gitui - meson - ninja - tree-sitter - unzip - pkg-config - sqlite - plantuml - d-spy - tmux - tmate - ]; - font_family = "${config.mods.stylix.fonts.monospace.name}"; - in + config = let + basePackages = with pkgs; [ + gitui + meson + ninja + tree-sitter + unzip + pkg-config + sqlite + plantuml + d-spy + tmux + tmate + ]; + font_family = "${config.mods.stylix.fonts.monospace.name}"; + in lib.mkIf config.mods.coding.enable ( lib.optionalAttrs (options ? home.packages) { programs.dashvim = lib.mkIf config.mods.coding.dashvim { @@ -444,7 +442,7 @@ extensions = config.mods.coding.vscodium.extensions; }; xdg.configFile."neovide/config.toml" = lib.mkIf config.mods.coding.dashvim { - source = (pkgs.formats.toml { }).generate "neovide" { + source = (pkgs.formats.toml {}).generate "neovide" { font = { size = 12; normal = { @@ -466,8 +464,7 @@ }; }; }; - home.packages = - with pkgs; + home.packages = with pkgs; [ (lib.mkIf config.mods.coding.dashvim neovide) (lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox) diff --git a/modules/programs/containers.nix b/modules/programs/containers.nix index 6f9f605..aacf6f4 100644 --- a/modules/programs/containers.nix +++ b/modules/programs/containers.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.containers = { variant = lib.mkOption { default = ""; @@ -22,7 +21,7 @@ podman-tui podman-compose ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = "Podman packages"; }; @@ -30,7 +29,7 @@ default = with pkgs; [ docker-compose ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = "Docker packages"; }; @@ -38,7 +37,7 @@ default = with pkgs; [ dive ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = "Container packages"; }; @@ -47,33 +46,35 @@ lib.optionalAttrs (options ? environment.systemPackages) { environment.systemPackages = (lib.lists.optionals ( - config.mods.containers.variant == "podman" - ) config.mods.containers.podmanPackages) + config.mods.containers.variant == "podman" + ) + config.mods.containers.podmanPackages) ++ (lib.lists.optionals ( - config.mods.containers.variant == "docker" - ) config.mods.containers.dockerPackages) + config.mods.containers.variant == "docker" + ) + config.mods.containers.dockerPackages) ++ (lib.lists.optionals ( - config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker" - ) config.mods.containers.combinedPackages); + config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker" + ) + config.mods.containers.combinedPackages); virtualisation = - if (config.mods.containers.variant == "podman") then - { - containers.enable = true; - podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - } - else if (config.mods.containers.variant == "docker") then - { - containers.enable = true; - docker = { - enable = true; - }; - } - else - { }; + if (config.mods.containers.variant == "podman") + then { + containers.enable = true; + podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + } + else if (config.mods.containers.variant == "docker") + then { + containers.enable = true; + docker = { + enable = true; + }; + } + else {}; } ); } diff --git a/modules/programs/drives.nix b/modules/programs/drives.nix index 9c0ecfe..35bf396 100644 --- a/modules/programs/drives.nix +++ b/modules/programs/drives.nix @@ -3,9 +3,7 @@ config, options, ... -}: -let - +}: let driveModule = lib.types.submodule { options = { name = lib.mkOption { @@ -20,7 +18,7 @@ let drive = lib.mkOption { type = lib.types.attrsOf lib.types.anything; description = "The attrs of the drive"; - default = { }; + default = {}; example = { device = "/dev/disk/by-label/DRIVE2"; fsType = "ext4"; @@ -33,8 +31,7 @@ let }; }; }; -in -{ +in { options.mods = { drives = { useSwap = { @@ -59,7 +56,6 @@ in }; extraDrives = lib.mkOption { default = [ - ]; example = [ { @@ -90,12 +86,15 @@ in fileSystems = builtins.listToAttrs ( map ( - { name, drive }: { + name, + drive, + }: { name = "/" + name; value = drive; } - ) config.mods.drives.extraDrives + ) + config.mods.drives.extraDrives ) // (lib.optionalAttrs config.mods.drives.defaultDrives.enable) { "/" = { @@ -131,7 +130,7 @@ in }; # TODO make this convert to choice of drives -> thanks to funny types this doesn't work... swapDevices = lib.mkIf config.mods.drives.useSwap.enable [ - { device = "/dev/disk/by-label/SWAP"; } + {device = "/dev/disk/by-label/SWAP";} ]; } ); diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 722b101..ffeea1e 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -5,12 +5,10 @@ config, options, ... -}: -let - base16 = pkgs.callPackage inputs.base16.lib { }; - scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); -in -{ +}: let + base16 = pkgs.callPackage inputs.base16.lib {}; + scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; +in { options.mods.fish = { enable = lib.mkOption { default = true; @@ -36,7 +34,8 @@ in programs.fish = { enable = true; shellInit = - if config.mods.fish.useDefaultConfig then + if config.mods.fish.useDefaultConfig + then '' if status is-interactive # Commands to run in interactive sessions can go here @@ -182,8 +181,7 @@ in direnv hook fish | source '' + config.mods.fish.additionalConfig - else - config.mods.fish.additionalConfig; + else config.mods.fish.additionalConfig; }; } ); diff --git a/modules/programs/flatpak.nix b/modules/programs/flatpak.nix index 3ffd068..7c13e9b 100644 --- a/modules/programs/flatpak.nix +++ b/modules/programs/flatpak.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.flatpak = { enable = lib.mkOption { default = true; @@ -14,15 +13,15 @@ description = "Enables the flatpak package manager"; }; additional_packages = lib.mkOption { - default = [ ]; - example = [ ]; + default = []; + example = []; type = with lib.types; listOf str; description = "Flatpak packages"; }; }; config = lib.mkIf config.mods.flatpak.enable ( lib.optionalAttrs (options ? services.flatpak.remote) { - environment.systemPackages = [ pkgs.flatpak ]; + environment.systemPackages = [pkgs.flatpak]; services.flatpak.remotes = lib.mkOptionDefault [ { name = "flathub-stable"; @@ -32,11 +31,13 @@ services.flatpak.uninstallUnmanaged = true; } // lib.optionalAttrs (options ? services.flatpak.packages) { - services.flatpak.packages = [ - # fallback if necessary, but generally avoided as nix is superior :) - # default flatseal installation since flatpak permissions are totally not a broken idea - "com.github.tchx84.Flatseal" - ] ++ config.mods.flatpak.additional_packages; + services.flatpak.packages = + [ + # fallback if necessary, but generally avoided as nix is superior :) + # default flatseal installation since flatpak permissions are totally not a broken idea + "com.github.tchx84.Flatseal" + ] + ++ config.mods.flatpak.additional_packages; } ); } diff --git a/modules/programs/gaming.nix b/modules/programs/gaming.nix index f3d857c..18b95c0 100644 --- a/modules/programs/gaming.nix +++ b/modules/programs/gaming.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.gaming = { enable = lib.mkOption { default = false; @@ -24,7 +23,7 @@ #heroic mangohud ]; - example = [ ]; + example = []; type = with lib.types; listOf package; description = "Install gaming related packages"; }; diff --git a/modules/programs/gdm.nix b/modules/programs/gdm.nix index 2bb3e47..343c6cd 100644 --- a/modules/programs/gdm.nix +++ b/modules/programs/gdm.nix @@ -3,8 +3,7 @@ options, config, ... -}: -{ +}: { options.mods.gdm = { enable = lib.mkOption { default = false; @@ -13,8 +12,8 @@ description = "Enables the gdm displayManager"; }; extraOptions = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = "Extra options to be applied to the gnome config"; }; diff --git a/modules/programs/git.nix b/modules/programs/git.nix index f409106..dec2aa5 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.git = { username = lib.mkOption { default = "DashieTM"; @@ -38,25 +37,22 @@ default = '' Host github.com ${ - if (config ? sops.secrets && config.sops.secrets ? hub.path) then - "IdentityFile ${config.sops.secrets.hub.path}" - else - "" - } + if (config ? sops.secrets && config.sops.secrets ? hub.path) + then "IdentityFile ${config.sops.secrets.hub.path}" + else "" + } Host gitlab.com ${ - if (config ? sops.secrets && config.sops.secrets ? lab.path) then - "IdentityFile ${config.sops.secrets.lab.path}" - else - "" - } + if (config ? sops.secrets && config.sops.secrets ? lab.path) + then "IdentityFile ${config.sops.secrets.lab.path}" + else "" + } Host dashie.org ${ - if (config ? sops.secrets && config.sops.secrets ? dashie.path) then - "IdentityFile ${config.sops.secrets.dashie.path}" - else - "" - } + if (config ? sops.secrets && config.sops.secrets ? dashie.path) + then "IdentityFile ${config.sops.secrets.dashie.path}" + else "" + } ''; example = ""; type = lib.types.lines; diff --git a/modules/programs/gnome.nix b/modules/programs/gnome.nix index 885eb2f..faf2b1e 100644 --- a/modules/programs/gnome.nix +++ b/modules/programs/gnome.nix @@ -4,8 +4,7 @@ config, pkgs, ... -}: -{ +}: { options.mods.gnome = { enable = lib.mkOption { default = false; @@ -20,27 +19,26 @@ description = "Use default options provided by module. If disabled, will only apply extraOptions."; }; extraOptions = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = "Extra options to be applied to the gnome config"; }; extraDconf = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = "Extra options to be applied to the dconf config"; }; }; - config = - let - defaultExtensions = with pkgs.gnomeExtensions; [ - blur-my-shell - dash-to-dock - tray-icons-reloaded - ]; - in + config = let + defaultExtensions = with pkgs.gnomeExtensions; [ + blur-my-shell + dash-to-dock + tray-icons-reloaded + ]; + in lib.mkIf config.mods.gnome.enable ( lib.optionalAttrs (options ? services.xserver.desktopManager.gnome) ( { @@ -49,7 +47,7 @@ desktopManager.gnome.enable = true; }; } - // lib.mkIf config.mods.gnome.useDefaultOptions { environment.systemPackages = defaultExtensions; } + // lib.mkIf config.mods.gnome.useDefaultOptions {environment.systemPackages = defaultExtensions;} // { services.xserver.desktopManager.gnome = config.mods.gnome.extraOptions; } diff --git a/modules/programs/gnomeServices.nix b/modules/programs/gnomeServices.nix index ffd8a06..01ab872 100644 --- a/modules/programs/gnomeServices.nix +++ b/modules/programs/gnomeServices.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods = { gnomeServices.enable = lib.mkOption { default = true; @@ -43,7 +42,7 @@ ]; }; environment.extraInit = '' - export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/keyring/ssh" + export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/keyring/ssh" ''; services = { # needed for GNOME services outside of GNOME Desktop @@ -66,15 +65,14 @@ }; }; home = { - packages = - let - packages = with pkgs; [ - gcr - nautilus - sushi - nautilus-python - ]; - in + packages = let + packages = with pkgs; [ + gcr + nautilus + sushi + nautilus-python + ]; + in lib.mkIf config.mods.nautilus.enable packages; }; } diff --git a/modules/programs/gpu.nix b/modules/programs/gpu.nix index 69592a2..5efa416 100644 --- a/modules/programs/gpu.nix +++ b/modules/programs/gpu.nix @@ -4,9 +4,7 @@ options, pkgs, ... -}: -{ - +}: { options.mods = { gpu = { nvidia.enable = lib.mkOption { @@ -57,35 +55,34 @@ config = (lib.optionalAttrs (options ? hardware.graphics) { boot = lib.mkIf config.mods.amdgpu.enable { - kernelModules = [ "kvm-amd" ]; - initrd.kernelModules = [ "amdgpu" ]; - kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ]; + kernelModules = ["kvm-amd"]; + initrd.kernelModules = ["amdgpu"]; + kernelParams = ["amdgpu.ppfeaturemask=0xffffffff"]; }; hardware = { - graphics = - let - amdPackages = [ - (lib.mkIf (config.mods.gpu.intelgpu && lib.mkIf config.mods.gpu.vapi.enable) pkgs.vpl-gpu-rt) - (lib.mkIf ( + graphics = let + amdPackages = [ + (lib.mkIf (config.mods.gpu.intelgpu && lib.mkIf config.mods.gpu.vapi.enable) pkgs.vpl-gpu-rt) + (lib.mkIf ( config.mods.gpu.intelgpu && lib.mkIf config.mods.gpu.vapi.enable - ) pkgs.intel-media-driver) - (lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl) - (lib.mkIf config.mods.gpu.vapi.enable pkgs.vaapiVdpau) - (lib.mkIf (config.mods.gpu.intelgpu || config.mods.gpu.amdgpu) pkgs.mesa.drivers) - ]; - rocmPackages = [ - pkgs.rocmPackages.clr.icd - pkgs.rocm-opencl-runtime - ]; - in - { - enable = true; - enable32Bit = lib.mkDefault true; - extraPackages = - amdPackages - ++ (lib.lists.optionals (config.mods.gpu.vapi.rocm.enable && config.mods.gpu.amdgpu) rocmPackages); - }; + ) + pkgs.intel-media-driver) + (lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl) + (lib.mkIf config.mods.gpu.vapi.enable pkgs.vaapiVdpau) + (lib.mkIf (config.mods.gpu.intelgpu || config.mods.gpu.amdgpu) pkgs.mesa.drivers) + ]; + rocmPackages = [ + pkgs.rocmPackages.clr.icd + pkgs.rocm-opencl-runtime + ]; + in { + enable = true; + enable32Bit = lib.mkDefault true; + extraPackages = + amdPackages + ++ (lib.lists.optionals (config.mods.gpu.vapi.rocm.enable && config.mods.gpu.amdgpu) rocmPackages); + }; }; }) // lib.optionalAttrs (options ? hardware.graphics) ( @@ -98,7 +95,7 @@ nvidiaSettings = true; package = config.boot.kernelPackages.nvidiaPackages.beta; }; - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; } ); } diff --git a/modules/programs/greetd.nix b/modules/programs/greetd.nix index a88e700..d00baa6 100644 --- a/modules/programs/greetd.nix +++ b/modules/programs/greetd.nix @@ -5,8 +5,7 @@ pkgs, options, ... -}: -{ +}: { options.mods = { greetd = { enable = lib.mkOption { @@ -32,7 +31,7 @@ type = lib.types.str; description = '' Scale used by the monitor in the login screen. - By default the scale of the main monitor is used. + By default the scale of the main monitor is used. ''; }; resolution = lib.mkOption { @@ -40,7 +39,7 @@ example = "3440x1440@180"; type = lib.types.str; description = '' - Resolution/refreshrate used by the monitor in the login screen. + Resolution/refreshrate used by the monitor in the login screen. ''; }; environments = lib.mkOption { @@ -54,13 +53,13 @@ ''; type = lib.types.lines; description = '' - List of environments that should be available in the login prompt. + List of environments that should be available in the login prompt. ''; }; regreet = { customSettings = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' Custom regret settings. See https://github.com/rharish101/ReGreet/blob/main/regreet.sample.toml for more information. @@ -70,16 +69,15 @@ }; }; - config = - let - username = config.conf.username; - session = { - command = "${ - lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland - } --config /etc/greetd/hyprgreet.conf"; - user = username; - }; - in + config = let + username = config.conf.username; + session = { + command = "${ + lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland + } --config /etc/greetd/hyprgreet.conf"; + user = username; + }; + in lib.mkIf config.mods.greetd.enable ( lib.optionalAttrs (options ? environment) { services.xserver.displayManager.session = [ @@ -136,8 +134,8 @@ } // lib.optionalAttrs (options ? home) { xdg.configFile."regreet/regreet.toml".source = - (pkgs.formats.toml { }).generate "regreet" - config.mods.greetd.regreet.customSettings; + (pkgs.formats.toml {}).generate "regreet" + config.mods.greetd.regreet.customSettings; } ); } diff --git a/modules/programs/homePackages.nix b/modules/programs/homePackages.nix index 3b98eb9..07b599b 100644 --- a/modules/programs/homePackages.nix +++ b/modules/programs/homePackages.nix @@ -5,8 +5,7 @@ pkgs, inputs, ... -}: -{ +}: { options.mods.homePackages = { useDefaultPackages = lib.mkOption { default = true; @@ -15,8 +14,8 @@ description = "Use default packages (will use additional_packages only if disabled)"; }; additionalPackages = lib.mkOption { - default = [ ]; - example = [ pkgs.flatpak ]; + default = []; + example = [pkgs.flatpak]; type = with lib.types; listOf package; description = '' Additional Home manager packages. @@ -24,16 +23,16 @@ ''; }; specialPrograms = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' special program configuration to be added which require programs.something notation. ''; }; specialServices = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' special services configuration to be added which require an services.something notation. @@ -72,66 +71,67 @@ browser = lib.mkOption { default = inputs.zen-browser.packages.${pkgs.system}.default; example = "firefox"; - type = - with lib.types; + type = with lib.types; nullOr ( either (enum [ "firefox" - ]) package + ]) + package ); description = "The browser (the enum variants have preconfigured modules)"; }; }; config = lib.optionalAttrs (options ? home.packages) { home.packages = - if config.mods.homePackages.useDefaultPackages then + if config.mods.homePackages.useDefaultPackages + then with pkgs; - [ - (lib.mkIf config.mods.homePackages.ncspot ncspot) - (lib.mkIf config.mods.homePackages.vesktop vesktop) - (lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client) - (lib.mkIf (!isNull config.mods.homePackages.matrixClient) config.mods.homePackages.matrixClient) - (lib.mkIf (!isNull config.mods.homePackages.mailClient) config.mods.homePackages.mailClient) - (lib.mkIf ( - # NOTE: This should be package, but nix doesn't have that.... - builtins.isAttrs config.mods.homePackages.browser && !isNull config.mods.homePackages.browser - ) config.mods.homePackages.browser) - adw-gtk3 - bat - brightnessctl - dbus - fastfetch - fd - ffmpeg - flake-checker - gnome-keyring - gnutar - greetd.regreet - killall - kitty - libnotify - lsd - networkmanager - nh - nix-index - playerctl - poppler_utils - pulseaudio - libsForQt5.qt5ct - qt6ct - fcp - ripgrep - rm-improved - system-config-printer - xournalpp - zenith - zoxide - ] - ++ config.mods.homePackages.additionalPackages - else - config.mods.homePackages.additionalPackages; + [ + (lib.mkIf config.mods.homePackages.ncspot ncspot) + (lib.mkIf config.mods.homePackages.vesktop vesktop) + (lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client) + (lib.mkIf (!isNull config.mods.homePackages.matrixClient) config.mods.homePackages.matrixClient) + (lib.mkIf (!isNull config.mods.homePackages.mailClient) config.mods.homePackages.mailClient) + (lib.mkIf ( + # NOTE: This should be package, but nix doesn't have that.... + builtins.isAttrs config.mods.homePackages.browser && !isNull config.mods.homePackages.browser + ) + config.mods.homePackages.browser) + adw-gtk3 + bat + brightnessctl + dbus + fastfetch + fd + ffmpeg + flake-checker + gnome-keyring + gnutar + greetd.regreet + killall + kitty + libnotify + lsd + networkmanager + nh + nix-index + playerctl + poppler_utils + pulseaudio + libsForQt5.qt5ct + qt6ct + fcp + ripgrep + rm-improved + system-config-printer + xournalpp + zenith + zoxide + ] + ++ config.mods.homePackages.additionalPackages + else config.mods.homePackages.additionalPackages; - xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml { }).generate "direnv" { + xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml {}).generate "direnv" { global = { warn_timeout = "-1s"; }; @@ -139,21 +139,19 @@ programs = config.mods.homePackages.specialPrograms // ( - if config.mods.homePackages.browser == "firefox" then - { - firefox = { - enable = true; - policies = config.mods.browser.firefox.configuration; - profiles = builtins.listToAttrs config.mods.browser.firefox.profiles; - }; - } - else - { } + if config.mods.homePackages.browser == "firefox" + then { + firefox = { + enable = true; + policies = config.mods.browser.firefox.configuration; + profiles = builtins.listToAttrs config.mods.browser.firefox.profiles; + }; + } + else {} ); services = - if config.mods.homePackages.useDefaultPackages then - config.mods.homePackages.specialServices - else - config.mods.homePackages.specialServices; + if config.mods.homePackages.useDefaultPackages + then config.mods.homePackages.specialServices + else config.mods.homePackages.specialServices; }; } diff --git a/modules/programs/hyprland/anyrun.nix b/modules/programs/hyprland/anyrun.nix index 5e7d9d8..832a0be 100644 --- a/modules/programs/hyprland/anyrun.nix +++ b/modules/programs/hyprland/anyrun.nix @@ -5,8 +5,7 @@ options, inputs, ... -}: -{ +}: { options.mods = { hyprland = { anyrun = { @@ -25,8 +24,8 @@ ''; }; customConfig = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' Custom anyrun configuration. @@ -63,7 +62,8 @@ programs.anyrun = { enable = true; config = - if config.mods.hyprland.anyrun.useDefaultConfig then + if config.mods.hyprland.anyrun.useDefaultConfig + then { plugins = [ inputs.anyrun.packages.${pkgs.system}.applications @@ -84,15 +84,15 @@ closeOnClick = true; } // config.mods.hyprland.anyrun.customConfig - else - config.mods.hyprland.anyrun.customConfig; + else config.mods.hyprland.anyrun.customConfig; extraCss = - if config.mods.hyprland.anyrun.useDefaultCss then + if config.mods.hyprland.anyrun.useDefaultCss + then '' #window { border-radius: 10px; - background-color: none; + background-color: none; } box#main { @@ -138,8 +138,7 @@ } '' + config.mods.hyprland.anyrun.customCss - else - config.mods.hyprland.anyrun.customCss; + else config.mods.hyprland.anyrun.customCss; }; } ); diff --git a/modules/programs/hyprland/hyprland.nix b/modules/programs/hyprland/hyprland.nix index 0d06c81..503c992 100644 --- a/modules/programs/hyprland/hyprland.nix +++ b/modules/programs/hyprland/hyprland.nix @@ -5,19 +5,14 @@ pkgs, inputs, ... -}: -let +}: let browserName = - if (builtins.isString config.mods.homePackages.browser) then - config.mods.homePackages.browser - else if - config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram - then - config.mods.homePackages.browser.meta.mainProgram - else - config.mods.homePackages.browser.pname; -in -{ + if (builtins.isString config.mods.homePackages.browser) + then config.mods.homePackages.browser + else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram + then config.mods.homePackages.browser.meta.mainProgram + else config.mods.homePackages.browser.pname; +in { options.mods = { hyprland = { enable = lib.mkOption { @@ -35,15 +30,15 @@ in # all others ",highrr,auto,1" ]; - example = [ "DP-1,3440x1440@180,2560x0,1,vrr,0" ]; + example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"]; type = with lib.types; listOf str; description = '' The monitor configuration for hyprland. ''; }; workspace = lib.mkOption { - default = [ ]; - example = [ "2,monitor:DP-1, default:true" ]; + default = []; + example = ["2,monitor:DP-1, default:true"]; type = with lib.types; listOf str; description = '' The workspace configuration for hyprland. @@ -58,8 +53,8 @@ in ''; }; extraAutostart = lib.mkOption { - default = [ ]; - example = [ "your application" ]; + default = []; + example = ["your application"]; type = lib.types.listOf lib.types.str; description = '' Extra exec_once. @@ -74,8 +69,8 @@ in ''; }; customConfig = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' Custom Hyprland configuration. @@ -83,16 +78,16 @@ in ''; }; plugins = lib.mkOption { - default = [ ]; - example = [ ]; + default = []; + example = []; type = with lib.types; listOf package; description = '' Plugins to be added to Hyprland. ''; }; pluginConfig = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' Plugin configuration to be added to Hyprland. @@ -129,7 +124,8 @@ in wayland.windowManager.hyprland = { enable = true; settings = - if config.mods.hyprland.useDefaultConfig then + if config.mods.hyprland.useDefaultConfig + then { "$mod" = "SUPER"; @@ -366,34 +362,39 @@ in "immediate,class:^(.*)(needforspeedheat.exe)$" ]; - exec-once = [ - # environment - "systemctl --user import-environment" - "dbus-update-activation-environment --systemd --all" - "hyprctl setcursor Bibata-Modern-Classic 24" + exec-once = + [ + # environment + "systemctl --user import-environment" + "dbus-update-activation-environment --systemd --all" + "hyprctl setcursor Bibata-Modern-Classic 24" - # other programs - "hyprpaper" - "ironbar" - "${browserName}" - "oxipaste_daemon" - "oxinoti" - ] ++ config.mods.hyprland.extraAutostart; + # other programs + "hyprpaper" + "ironbar" + "${browserName}" + "oxipaste_daemon" + "oxinoti" + ] + ++ config.mods.hyprland.extraAutostart; - plugin = { - hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { - bind = [ - "SUPER, W, overview:toggle, toggle" - ]; - }; - } // config.mods.hyprland.pluginConfig; + plugin = + { + hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { + bind = [ + "SUPER, W, overview:toggle, toggle" + ]; + }; + } + // config.mods.hyprland.pluginConfig; } // config.mods.hyprland.customConfig - else - lib.mkForce config.mods.hyprland.customConfig; - plugins = [ - (lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace) - ] ++ config.mods.hyprland.plugins; + else lib.mkForce config.mods.hyprland.customConfig; + plugins = + [ + (lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace) + ] + ++ config.mods.hyprland.plugins; }; } ); diff --git a/modules/programs/hyprland/hyprlock.nix b/modules/programs/hyprland/hyprlock.nix index a33243f..0a807ea 100644 --- a/modules/programs/hyprland/hyprlock.nix +++ b/modules/programs/hyprland/hyprlock.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods = { hyprland.hyprlock = { enable = lib.mkOption { @@ -22,7 +21,7 @@ stylix.targets.hyprlock = { enable = false; }; - home.packages = with pkgs; [ hyprlock ]; + home.packages = with pkgs; [hyprlock]; programs.hyprlock = lib.mkIf config.mods.hyprland.hyprlock.enable { enable = true; settings = { diff --git a/modules/programs/hyprland/hyprpaper.nix b/modules/programs/hyprland/hyprpaper.nix index a16e975..31c4d05 100644 --- a/modules/programs/hyprland/hyprpaper.nix +++ b/modules/programs/hyprland/hyprpaper.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods = { hyprland.hyprpaper = { enable = lib.mkOption { @@ -17,7 +16,7 @@ config = lib.mkOption { default = ""; example = '' - preload = path/to/wallpaper + preload = path/to/wallpaper wallpaper = YOURMONITOR,path/to/wallpaper ''; type = lib.types.lines; @@ -30,7 +29,7 @@ config = lib.mkIf config.mods.hyprland.hyprpaper.enable ( lib.optionalAttrs (options ? xdg.configFile) { - home.packages = with pkgs; [ hyprpaper ]; + home.packages = with pkgs; [hyprpaper]; xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hyprland.hyprpaper.enable { text = config.mods.hyprland.hyprpaper.config; }; diff --git a/modules/programs/hyprland/ironbar.nix b/modules/programs/hyprland/ironbar.nix index 81b2711..cb16289 100644 --- a/modules/programs/hyprland/ironbar.nix +++ b/modules/programs/hyprland/ironbar.nix @@ -3,11 +3,9 @@ config, options, ... -}: -let +}: let username = config.conf.username; -in -{ +in { options.mods = { hyprland.ironbar = { enable = lib.mkOption { @@ -25,8 +23,8 @@ in ''; }; customConfig = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' Custom ironbar configuration. @@ -61,7 +59,8 @@ in programs.ironbar = { enable = true; style = - if config.mods.hyprland.ironbar.useDefaultCss then + if config.mods.hyprland.ironbar.useDefaultCss + then '' @import url("/home/${username}/.config/gtk-3.0/gtk.css"); @@ -197,106 +196,108 @@ in } '' + config.mods.hyprland.ironbar.customCss - else - config.mods.hyprland.ironbar.customCss; + else config.mods.hyprland.ironbar.customCss; features = [ #"another_feature" ]; config = { monitors."${config.conf.defaultMonitor}" = - if config.mods.hyprland.ironbar.useDefaultConfig then + if config.mods.hyprland.ironbar.useDefaultConfig + then { - end = config.conf.ironbar.modules ++ [ - { - type = "sys_info"; - format = [ " {memory_percent}" ]; - interval.memory = 30; - class = "memory-usage"; - } - { - type = "custom"; - bar = [ - { - type = "button"; - class = "popup-button"; - label = ""; - on_click = "popup:toggle"; - } - ]; - class = "popup-button-box"; - popup = [ - { - type = "box"; - orientation = "vertical"; - class = "audio-box"; - widgets = [ - { - type = "box"; - orientation = "horizontal"; - widgets = [ - { - type = "button"; - class = "audio-button"; - label = ""; - on_click = (lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth"); - } - { - type = "button"; - class = "audio-button"; - label = "󰋋"; - on_click = (lib.mkIf config.mods.scripts.audioControl "!audioControl internal"); - } - ]; - class = "audio-button-box"; - } - { - type = "label"; - label = "Output"; - } - { - type = "slider"; - class = "audio-slider"; - step = 1.0; - length = 200; - value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'"; - on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%"; - } - { - type = "label"; - label = "Input"; - } - { - type = "slider"; - class = "audio-slider"; - step = 1.0; - length = 200; - value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'"; - on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%"; - } - ]; - } - ]; - } - { - type = "custom"; - bar = [ - { - type = "button"; - class = "popup-button"; - label = ""; - on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css"; - } - ]; - class = "popup-button-box"; - } - { - type = "clock"; - format = "%I:%M"; - format_popup = "%I:%M:%S"; - locale = "en_US"; - } - { type = "tray"; } - ]; + end = + config.conf.ironbar.modules + ++ [ + { + type = "sys_info"; + format = [" {memory_percent}"]; + interval.memory = 30; + class = "memory-usage"; + } + { + type = "custom"; + bar = [ + { + type = "button"; + class = "popup-button"; + label = ""; + on_click = "popup:toggle"; + } + ]; + class = "popup-button-box"; + popup = [ + { + type = "box"; + orientation = "vertical"; + class = "audio-box"; + widgets = [ + { + type = "box"; + orientation = "horizontal"; + widgets = [ + { + type = "button"; + class = "audio-button"; + label = ""; + on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth"; + } + { + type = "button"; + class = "audio-button"; + label = "󰋋"; + on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl internal"; + } + ]; + class = "audio-button-box"; + } + { + type = "label"; + label = "Output"; + } + { + type = "slider"; + class = "audio-slider"; + step = 1.0; + length = 200; + value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'"; + on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%"; + } + { + type = "label"; + label = "Input"; + } + { + type = "slider"; + class = "audio-slider"; + step = 1.0; + length = 200; + value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'"; + on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%"; + } + ]; + } + ]; + } + { + type = "custom"; + bar = [ + { + type = "button"; + class = "popup-button"; + label = ""; + on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css"; + } + ]; + class = "popup-button-box"; + } + { + type = "clock"; + format = "%I:%M"; + format_popup = "%I:%M:%S"; + locale = "en_US"; + } + {type = "tray";} + ]; position = "top"; height = 10; anchor_to_edges = true; @@ -317,8 +318,7 @@ in ]; } // config.mods.hyprland.ironbar.customConfig - else - config.mods.hyprland.ironbar.customConfig; + else config.mods.hyprland.ironbar.customConfig; }; }; } diff --git a/modules/programs/kde.nix b/modules/programs/kde.nix index 1497094..f81194d 100644 --- a/modules/programs/kde.nix +++ b/modules/programs/kde.nix @@ -3,8 +3,7 @@ options, config, ... -}: -{ +}: { options.mods.kde = { enable = lib.mkOption { default = false; @@ -20,5 +19,4 @@ services.desktopManager.plasma6.enable = true; } ); - } diff --git a/modules/programs/kdeConnect.nix b/modules/programs/kdeConnect.nix index 169814c..46b12e8 100644 --- a/modules/programs/kdeConnect.nix +++ b/modules/programs/kdeConnect.nix @@ -4,9 +4,7 @@ options, pkgs, ... -}: -{ - +}: { options.mods = { kdeConnect.enable = lib.mkOption { default = false; @@ -38,7 +36,7 @@ }; } // lib.optionalAttrs (options ? home.packages) { - home.packages = with pkgs; [ kdePackages.kdeconnect-kde ]; + home.packages = with pkgs; [kdePackages.kdeconnect-kde]; } ); } diff --git a/modules/programs/keepassxc.nix b/modules/programs/keepassxc.nix index 4dda211..93c9142 100644 --- a/modules/programs/keepassxc.nix +++ b/modules/programs/keepassxc.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.keepassxc = { enable = lib.mkOption { default = true; @@ -34,7 +33,7 @@ }; config = lib.mkIf config.mods.keepassxc.enable ( lib.optionalAttrs (options ? home.file) { - home.packages = [ pkgs.keepassxc ]; + home.packages = [pkgs.keepassxc]; xdg.configFile."keepassxc/keepassxc.ini" = { text = '' [General] diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index 56b8126..eb41e44 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -5,10 +5,9 @@ pkgs, inputs, ... -}: -let - base16 = pkgs.callPackage inputs.base16.lib { }; - scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); +}: let + base16 = pkgs.callPackage inputs.base16.lib {}; + scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; hexTable = { "0" = "1"; "1" = "0"; @@ -32,10 +31,9 @@ let "#" + lib.strings.concatStrings ( (lib.lists.take 5 (lib.strings.stringToCharacters scheme.base00)) - ++ [ hexTable."${(lib.lists.last (lib.strings.stringToCharacters scheme.base00))}" ] + ++ [hexTable."${(lib.lists.last (lib.strings.stringToCharacters scheme.base00))}"] ); -in -{ +in { options.mods.kitty = { enable = lib.mkOption { default = true; @@ -44,7 +42,7 @@ in description = "Enables kitty"; }; additionalConfig = lib.mkOption { - default = { }; + default = {}; example = { # for the insane people out there :P enable_audio_bell = "yes"; @@ -60,79 +58,81 @@ in }; programs.kitty = { enable = true; - settings = { - enable_audio_bell = "no"; - window_alert_on_bell = "no"; - cursor_blink_interval = "0"; - window_padding_width = "1"; - shell_integration = "yes"; - sync_with_monitor = "no"; - background_opacity = "0.8"; + settings = + { + enable_audio_bell = "no"; + window_alert_on_bell = "no"; + cursor_blink_interval = "0"; + window_padding_width = "1"; + shell_integration = "yes"; + sync_with_monitor = "no"; + background_opacity = "0.8"; - font_family = "${config.mods.stylix.fonts.monospace.name}"; - bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold"; - italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic"; - bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic"; + font_family = "${config.mods.stylix.fonts.monospace.name}"; + bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold"; + italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic"; + bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic"; - background = base; - foreground = "#" + scheme.base05; - selection_foreground = "#" + scheme.base05; - selection_background = base; - url_color = "#" + scheme.base04; - cursor = "#" + scheme.base05; - active_border_color = "#" + scheme.base03; - inactive_border_color = "#" + scheme.base01; - active_tab_background = base; - active_tab_foreground = "#" + scheme.base05; - inactive_tab_background = "#" + scheme.base01; - inactive_tab_foreground = "#" + scheme.base04; - tab_bar_background = "#" + scheme.base01; + background = base; + foreground = "#" + scheme.base05; + selection_foreground = "#" + scheme.base05; + selection_background = base; + url_color = "#" + scheme.base04; + cursor = "#" + scheme.base05; + active_border_color = "#" + scheme.base03; + inactive_border_color = "#" + scheme.base01; + active_tab_background = base; + active_tab_foreground = "#" + scheme.base05; + inactive_tab_background = "#" + scheme.base01; + inactive_tab_foreground = "#" + scheme.base04; + tab_bar_background = "#" + scheme.base01; - mark1_foreground = "#" + scheme.base00; - mark1_background = "#" + scheme.base07; - mark2_foreground = "#" + scheme.base00; - mark2_background = "#" + scheme.base0E; - mark3_foreground = "#" + scheme.base00; - mark3_background = "#" + scheme.base08; + mark1_foreground = "#" + scheme.base00; + mark1_background = "#" + scheme.base07; + mark2_foreground = "#" + scheme.base00; + mark2_background = "#" + scheme.base0E; + mark3_foreground = "#" + scheme.base00; + mark3_background = "#" + scheme.base08; - color0 = "#" + scheme.base03; - color1 = "#" + scheme.base08; - color2 = "#" + scheme.base0B; - color3 = "#" + scheme.base0A; - color4 = "#" + scheme.base0D; - color5 = "#" + scheme.base06; - color6 = "#" + scheme.base0C; - color7 = "#" + scheme.base07; + color0 = "#" + scheme.base03; + color1 = "#" + scheme.base08; + color2 = "#" + scheme.base0B; + color3 = "#" + scheme.base0A; + color4 = "#" + scheme.base0D; + color5 = "#" + scheme.base06; + color6 = "#" + scheme.base0C; + color7 = "#" + scheme.base07; - color8 = "#" + scheme.base04; - color9 = "#" + scheme.base08; - color10 = "#" + scheme.base0B; - color11 = "#" + scheme.base0A; - color12 = "#" + scheme.base0D; - color13 = "#" + scheme.base06; - color14 = "#" + scheme.base0C; - color15 = "#" + scheme.base0B; + color8 = "#" + scheme.base04; + color9 = "#" + scheme.base08; + color10 = "#" + scheme.base0B; + color11 = "#" + scheme.base0A; + color12 = "#" + scheme.base0D; + color13 = "#" + scheme.base06; + color14 = "#" + scheme.base0C; + color15 = "#" + scheme.base0B; - # color0 = base; - # color1 = "#" + scheme.base08; - # color2 = "#" + scheme.base0B; - # color3 = "#" + scheme.base0A; - # color4 = "#" + scheme.base0D; - # color5 = "#" + scheme.base0E; - # color6 = "#" + scheme.base0C; - # color7 = "#" + scheme.base05; - # - # color8 = "#" + scheme.base03; - # color9 = "#" + scheme.base08; - # color10 = "#" + scheme.base0B; - # color11 = "#" + scheme.base0A; - # color12 = "#" + scheme.base0D; - # color13 = "#" + scheme.base0E; - # color14 = "#" + scheme.base0C; - # color15 = "#" + scheme.base07; + # color0 = base; + # color1 = "#" + scheme.base08; + # color2 = "#" + scheme.base0B; + # color3 = "#" + scheme.base0A; + # color4 = "#" + scheme.base0D; + # color5 = "#" + scheme.base0E; + # color6 = "#" + scheme.base0C; + # color7 = "#" + scheme.base05; + # + # color8 = "#" + scheme.base03; + # color9 = "#" + scheme.base08; + # color10 = "#" + scheme.base0B; + # color11 = "#" + scheme.base0A; + # color12 = "#" + scheme.base0D; + # color13 = "#" + scheme.base0E; + # color14 = "#" + scheme.base0C; + # color15 = "#" + scheme.base07; - shell = lib.mkIf config.mods.fish.enable "fish"; - } // config.mods.kitty.additionalConfig; + shell = lib.mkIf config.mods.fish.enable "fish"; + } + // config.mods.kitty.additionalConfig; }; } ); diff --git a/modules/programs/media.nix b/modules/programs/media.nix index a8f3cf5..4bb57b6 100644 --- a/modules/programs/media.nix +++ b/modules/programs/media.nix @@ -4,8 +4,7 @@ config, pkgs, ... -}: -{ +}: { options.mods.media = { useBasePackages = lib.mkOption { default = true; @@ -14,24 +13,24 @@ description = "Default media packages (If disabled, only the additional packages will be installed)"; }; additionalPackages = lib.mkOption { - default = [ ]; - example = [ pkgs.flatpak ]; + default = []; + example = [pkgs.flatpak]; type = with lib.types; listOf package; description = '' Additional media packages. ''; }; specialPrograms = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' special program configuration to be added which require programs.something notation. ''; }; specialServices = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' special services configuration to be added which require an services.something notation. @@ -40,51 +39,50 @@ }; config = lib.optionalAttrs (options ? home.packages) { home.packages = - if config.mods.media.useBasePackages then + if config.mods.media.useBasePackages + then with pkgs; - [ - # base audio - pipewire - wireplumber - # audio control - playerctl - # images - imv - # videos - mpv - # pdf - zathura - evince - libreoffice-fresh - onlyoffice-bin - pdftk - pdfpc - polylux2pdfpc - # spotify - # video editing - kdenlive - # image creation - inkscape - gimp - krita - yt-dlp - ] - ++ config.mods.media.additionalPackages - else - config.mods.media.additionalPackages; + [ + # base audio + pipewire + wireplumber + # audio control + playerctl + # images + imv + # videos + mpv + # pdf + zathura + evince + libreoffice-fresh + onlyoffice-bin + pdftk + pdfpc + polylux2pdfpc + # spotify + # video editing + kdenlive + # image creation + inkscape + gimp + krita + yt-dlp + ] + ++ config.mods.media.additionalPackages + else config.mods.media.additionalPackages; programs = - if config.mods.media.useBasePackages then + if config.mods.media.useBasePackages + then { obs-studio.enable = true; - obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ]; + obs-studio.plugins = with pkgs; [obs-studio-plugins.obs-vaapi]; } // config.mods.media.specialPrograms - else - config.mods.media.specialPrograms; + else config.mods.media.specialPrograms; services = - if config.mods.media.useBasePackages then - config.mods.media.specialServices - else - config.mods.media.specialServices; + if config.mods.media.useBasePackages + then config.mods.media.specialServices + else config.mods.media.specialServices; }; } diff --git a/modules/programs/mime.nix b/modules/programs/mime.nix index 89dad89..1f193d2 100644 --- a/modules/programs/mime.nix +++ b/modules/programs/mime.nix @@ -5,19 +5,14 @@ lib, options, ... -}: -let +}: let browserName = - if (builtins.isString config.mods.homePackages.browser) then - config.mods.homePackages.browser - else if - config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram - then - config.mods.homePackages.browser.meta.mainProgram - else - config.mods.homePackages.browser.pname; -in -{ + if (builtins.isString config.mods.homePackages.browser) + then config.mods.homePackages.browser + else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram + then config.mods.homePackages.browser.meta.mainProgram + else config.mods.homePackages.browser.pname; +in { options.mods.mime = { enable = lib.mkOption { default = true; @@ -32,7 +27,7 @@ in "jpeg" "gif" ]; - example = [ ]; + example = []; type = with lib.types; listOf str; description = "Image mime handlers"; }; @@ -42,7 +37,7 @@ in "avi" "mkv" ]; - example = [ ]; + example = []; type = with lib.types; listOf str; description = "Video mime handlers"; }; @@ -53,7 +48,7 @@ in "wav" "aac" ]; - example = [ ]; + example = []; type = with lib.types; listOf str; description = "Audio mime handlers"; }; @@ -66,7 +61,7 @@ in "x-extension-xht" "x-extension-xhtml" ]; - example = [ ]; + example = []; type = with lib.types; listOf str; description = "Browser mime handlers"; }; @@ -78,71 +73,71 @@ in "https" "unknown" ]; - example = [ ]; + example = []; type = with lib.types; listOf str; description = "Browser X mime handlers"; }; browserApplications = lib.mkOption { - default = [ "${browserName}" ]; - example = [ ]; + default = ["${browserName}"]; + example = []; type = with lib.types; listOf str; description = "Applications used for handling browser mime types"; }; imageApplications = lib.mkOption { - default = [ "imv" ]; - example = [ ]; + default = ["imv"]; + example = []; type = with lib.types; listOf str; description = "Applications used for handling image mime types"; }; videoApplications = lib.mkOption { - default = [ "mpv" ]; - example = [ ]; + default = ["mpv"]; + example = []; type = with lib.types; listOf str; description = "Applications used for handling video mime types"; }; audioApplications = lib.mkOption { - default = [ "io.bassi.Amberol" ]; - example = [ ]; + default = ["io.bassi.Amberol"]; + example = []; type = with lib.types; listOf str; description = "Applications used for handling audio mime types"; }; # TODO additional config }; config = lib.optionalAttrs (options ? home) { - xdg = - let - xdgAssociations = - type: program: list: - builtins.listToAttrs ( - map (e: { - name = "${type}/${e}"; - value = program; - }) list - ); - - imageAc = xdgAssociations "image" config.mods.mime.imageApplications config.mods.mime.imageTypes; - videoAc = xdgAssociations "video" config.mods.mime.videoApplications config.mods.mime.videoTypes; - audioAc = xdgAssociations "audio" config.mods.mime.audioApplications config.mods.mime.audioTypes; - browserAc = - (xdgAssociations "application" config.mods.mime.browserApplications config.mods.mime.browserTypes) - // (xdgAssociations "x-scheme-handler" config.mods.mime.browserApplications - config.mods.mime.browserXTypes - ); - associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) ( - # TODO make configurable - { - "application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ]; - "text/html" = config.mods.mime.browserApplications; - "text/plain" = [ "neovide" ]; - "x-scheme-handler/chrome" = [ "com.brave.browser" ]; - "inode/directory" = [ "yazi" ]; - } - // imageAc - // audioAc - // videoAc - // browserAc + xdg = let + xdgAssociations = type: program: list: + builtins.listToAttrs ( + map (e: { + name = "${type}/${e}"; + value = program; + }) + list ); - in + + imageAc = xdgAssociations "image" config.mods.mime.imageApplications config.mods.mime.imageTypes; + videoAc = xdgAssociations "video" config.mods.mime.videoApplications config.mods.mime.videoTypes; + audioAc = xdgAssociations "audio" config.mods.mime.audioApplications config.mods.mime.audioTypes; + browserAc = + (xdgAssociations "application" config.mods.mime.browserApplications config.mods.mime.browserTypes) + // ( + xdgAssociations "x-scheme-handler" config.mods.mime.browserApplications + config.mods.mime.browserXTypes + ); + associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) ( + # TODO make configurable + { + "application/pdf" = ["org.pwmt.zathura-pdf-mupdf"]; + "text/html" = config.mods.mime.browserApplications; + "text/plain" = ["neovide"]; + "x-scheme-handler/chrome" = ["com.brave.browser"]; + "inode/directory" = ["yazi"]; + } + // imageAc + // audioAc + // videoAc + // browserAc + ); + in lib.mkIf config.mods.mime.enable { enable = true; cacheHome = config.home.homeDirectory + "/.local/cache"; diff --git a/modules/programs/ncspot.nix b/modules/programs/ncspot.nix index 98dfe96..8e9064d 100644 --- a/modules/programs/ncspot.nix +++ b/modules/programs/ncspot.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.ncspot = { enable = lib.mkOption { default = false; @@ -16,13 +15,13 @@ }; config = lib.mkIf config.mods.ncspot.enable ( lib.optionalAttrs (options ? home.packages) { - home.packages = with pkgs; [ ncspot ]; - xdg.configFile."ncspot/config.toml".source = (pkgs.formats.toml { }).generate "ncspot" { + home.packages = with pkgs; [ncspot]; + xdg.configFile."ncspot/config.toml".source = (pkgs.formats.toml {}).generate "ncspot" { notify = true; shuffle = true; cover_max_scale = 2; initial_screen = "library"; - library_tabs = [ "playlists" ]; + library_tabs = ["playlists"]; theme = { background = "#1a1b26"; primary = "#9aa5ce"; diff --git a/modules/programs/nextcloud.nix b/modules/programs/nextcloud.nix index ab2333a..16b2d29 100644 --- a/modules/programs/nextcloud.nix +++ b/modules/programs/nextcloud.nix @@ -1,5 +1,4 @@ -{ lib, ... }: -{ +{lib, ...}: { options.mods = { nextcloud = { enable = lib.mkOption { @@ -21,7 +20,7 @@ description = "Your url"; }; synclist = lib.mkOption { - default = [ ]; + default = []; example = [ { name = "sync globi folder"; @@ -36,5 +35,4 @@ }; }; }; - } diff --git a/modules/programs/oxi/default.nix b/modules/programs/oxi/default.nix index 7dee3fd..ad31d84 100644 --- a/modules/programs/oxi/default.nix +++ b/modules/programs/oxi/default.nix @@ -4,8 +4,7 @@ options, inputs, ... -}: -{ +}: { imports = [ ./oxidash.nix ./oxinoti.nix diff --git a/modules/programs/oxi/oxidash.nix b/modules/programs/oxi/oxidash.nix index 03cb684..476eb60 100644 --- a/modules/programs/oxi/oxidash.nix +++ b/modules/programs/oxi/oxidash.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.oxi.oxidash = { enable = lib.mkOption { default = true; diff --git a/modules/programs/oxi/oxinoti.nix b/modules/programs/oxi/oxinoti.nix index 188ec11..b3ecafc 100644 --- a/modules/programs/oxi/oxinoti.nix +++ b/modules/programs/oxi/oxinoti.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.oxi.oxinoti = { enable = lib.mkOption { default = true; @@ -17,7 +16,8 @@ lib.optionalAttrs (options ? xdg.configFile) { programs.oxinoti.enable = true; xdg.configFile."oxinoti/style.css" = { - text = # css + text = + # css '' @import url("/home/${config.conf.username}/.config/gtk-3.0/gtk.css"); diff --git a/modules/programs/oxi/oxipaste.nix b/modules/programs/oxi/oxipaste.nix index aa4af70..4ec7b1d 100644 --- a/modules/programs/oxi/oxipaste.nix +++ b/modules/programs/oxi/oxipaste.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.oxi.oxipaste = { enable = lib.mkOption { default = true; diff --git a/modules/programs/oxi/oxishut.nix b/modules/programs/oxi/oxishut.nix index 466be06..25ebe0b 100644 --- a/modules/programs/oxi/oxishut.nix +++ b/modules/programs/oxi/oxishut.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.oxi.oxishut = { enable = lib.mkOption { default = true; diff --git a/modules/programs/piper.nix b/modules/programs/piper.nix index dac9ece..24beced 100644 --- a/modules/programs/piper.nix +++ b/modules/programs/piper.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.piper = { enable = lib.mkOption { default = false; @@ -15,7 +14,7 @@ }; }; config = lib.mkIf config.mods.piper.enable ( - lib.optionalAttrs (options ? services.ratbagd) { services.ratbagd.enable = true; } - // lib.optionalAttrs (options ? home.packages) { home.packages = with pkgs; [ piper ]; } + lib.optionalAttrs (options ? services.ratbagd) {services.ratbagd.enable = true;} + // lib.optionalAttrs (options ? home.packages) {home.packages = with pkgs; [piper];} ); } diff --git a/modules/programs/plymouth.nix b/modules/programs/plymouth.nix index 5bffa2d..af9c615 100644 --- a/modules/programs/plymouth.nix +++ b/modules/programs/plymouth.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.plymouth = { enable = lib.mkOption { default = true; @@ -14,6 +13,6 @@ }; }; config = lib.mkIf config.mods.plymouth.enable ( - lib.optionalAttrs (options ? boot.plymouth) { boot.plymouth.enable = true; } + lib.optionalAttrs (options ? boot.plymouth) {boot.plymouth.enable = true;} ); } diff --git a/modules/programs/printing.nix b/modules/programs/printing.nix index ad75719..848ffef 100644 --- a/modules/programs/printing.nix +++ b/modules/programs/printing.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.printing = { enable = lib.mkOption { default = true; @@ -21,7 +20,7 @@ printing = { enable = true; browsing = true; - drivers = [ pkgs.hplip ]; + drivers = [pkgs.hplip]; startWhenNeeded = true; # optional }; avahi = { diff --git a/modules/programs/scripts.nix b/modules/programs/scripts.nix index 99a75b0..e17a96b 100644 --- a/modules/programs/scripts.nix +++ b/modules/programs/scripts.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.scripts = { changeBrightness = lib.mkOption { default = true; @@ -20,111 +19,113 @@ description = "Enables the audioControl script"; }; scripts = lib.mkOption { - default = [ ]; - example = [ ]; + default = []; + example = []; description = "More scripts to be passed. (check existing ones for types and examples)"; }; }; config = ( lib.optionalAttrs (options ? home.packages) { - home.packages = [ - (lib.mkIf config.mods.scripts.changeBrightness ( - pkgs.writeShellScriptBin "changeBrightness" '' - set_brightness() { - brightnessctl set "$1" - CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}') - dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%" - } + home.packages = + [ + (lib.mkIf config.mods.scripts.changeBrightness ( + pkgs.writeShellScriptBin "changeBrightness" '' + set_brightness() { + brightnessctl set "$1" + CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}') + dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%" + } - if [ "$1" == "brightness" ]; then - set_brightness "$2" - fi - '' - )) - (lib.mkIf config.mods.scripts.audioControl ( - pkgs.writeShellScriptBin "audioControl" '' - ncspot() { - NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n') - CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') - pactl set-sink-input-volume "$CHANGE" "$1" - VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') - notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%" - } + if [ "$1" == "brightness" ]; then + set_brightness "$2" + fi + '' + )) + (lib.mkIf config.mods.scripts.audioControl ( + pkgs.writeShellScriptBin "audioControl" '' + ncspot() { + NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n') + CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') + pactl set-sink-input-volume "$CHANGE" "$1" + VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') + notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%" + } - firefox() { - STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n') - # NUMS=',' read -r -a array <<< "$STRING" - readarray -td, NUMS <<<"$STRING" - declare -p NUMS - for index in "''${!NUMS[@]}"; do #"''${!array[@]}" - NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n') - CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') - pactl set-sink-input-volume "$CHANGE" "$1" - done - VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') - notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%" - } + firefox() { + STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n') + # NUMS=',' read -r -a array <<< "$STRING" + readarray -td, NUMS <<<"$STRING" + declare -p NUMS + for index in "''${!NUMS[@]}"; do #"''${!array[@]}" + NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n') + CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') + pactl set-sink-input-volume "$CHANGE" "$1" + done + VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') + notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%" + } - internal() { - SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }') - if [ "$SPEAKER" != "" ]; then - pactl set-default-sink "$SPEAKER" - pactl set-sink-mute "$SPEAKER" false - DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') - notify-send "changed audio to "$DEVICE" " - else - notify-send "failed, not available!" - fi - } + internal() { + SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }') + if [ "$SPEAKER" != "" ]; then + pactl set-default-sink "$SPEAKER" + pactl set-sink-mute "$SPEAKER" false + DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') + notify-send "changed audio to "$DEVICE" " + else + notify-send "failed, not available!" + fi + } - set_volume_sink() { - pactl set-sink-volume @DEFAULT_SINK@ "$1" - CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %') - notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%" - } + set_volume_sink() { + pactl set-sink-volume @DEFAULT_SINK@ "$1" + CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %') + notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%" + } - set_volume_source() { - pactl set-source-volume @DEFAULT_SOURCE@ "$1" - CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %') - notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%" - } + set_volume_source() { + pactl set-source-volume @DEFAULT_SOURCE@ "$1" + CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %') + notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%" + } - bluetooth() { - SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }') - if [ "$SPEAKER" != "" ]; then - pactl set-default-sink "$SPEAKER" - pactl set-sink-mute "$SPEAKER" false - DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') - notify-send "changed audio to "$DEVICE" " - else - notify-send "failed, not available!" - fi - } + bluetooth() { + SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }') + if [ "$SPEAKER" != "" ]; then + pactl set-default-sink "$SPEAKER" + pactl set-sink-mute "$SPEAKER" false + DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') + notify-send "changed audio to "$DEVICE" " + else + notify-send "failed, not available!" + fi + } - mute() { - pactl set-sink-mute @DEFAULT_SINK@ toggle - MUTE=$(pactl get-sink-mute @DEFAULT_SINK@) - notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE" - } + mute() { + pactl set-sink-mute @DEFAULT_SINK@ toggle + MUTE=$(pactl get-sink-mute @DEFAULT_SINK@) + notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE" + } - if [ "$1" == "internal" ]; then - internal - elif [ "$1" == "bluetooth" ]; then - bluetooth - elif [ "$1" == "firefox" ]; then - firefox "$2" - elif [ "$1" == "ncspot" ]; then - ncspot "$2" - elif [ "$1" == "mute" ]; then - mute - elif [ "$1" == "sink" ]; then - set_volume_sink "$2" - elif [ "$1" == "source" ]; then - set_volume_source "$2" - fi - '' - )) - ] ++ config.mods.scripts.scripts; + if [ "$1" == "internal" ]; then + internal + elif [ "$1" == "bluetooth" ]; then + bluetooth + elif [ "$1" == "firefox" ]; then + firefox "$2" + elif [ "$1" == "ncspot" ]; then + ncspot "$2" + elif [ "$1" == "mute" ]; then + mute + elif [ "$1" == "sink" ]; then + set_volume_sink "$2" + elif [ "$1" == "source" ]; then + set_volume_source "$2" + fi + '' + )) + ] + ++ config.mods.scripts.scripts; } ); } diff --git a/modules/programs/sddm.nix b/modules/programs/sddm.nix index d358777..57328d4 100644 --- a/modules/programs/sddm.nix +++ b/modules/programs/sddm.nix @@ -3,8 +3,7 @@ options, config, ... -}: -{ +}: { options.mods.sddm = { enable = lib.mkOption { default = false; @@ -19,7 +18,7 @@ description = "Use default options provided by module. If disabled, will only apply extraOptions."; }; extraOptions = lib.mkOption { - default = { }; + default = {}; example = { wayland.enable = false; }; diff --git a/modules/programs/sops.nix b/modules/programs/sops.nix index 726bd9c..5897eaa 100644 --- a/modules/programs/sops.nix +++ b/modules/programs/sops.nix @@ -5,8 +5,7 @@ options, root, ... -}: -{ +}: { options.mods.sops = { enable = lib.mkOption { default = true; @@ -15,13 +14,13 @@ description = "Enable sops secrets"; }; secrets = lib.mkOption { - default = { }; + default = {}; example = { - hub = { }; - lab = { }; - ${config.conf.username} = { }; - nextcloud = { }; - access = { }; + hub = {}; + lab = {}; + ${config.conf.username} = {}; + nextcloud = {}; + access = {}; }; type = with lib.types; attrsOf anything; description = "secrets for sops"; @@ -29,8 +28,7 @@ sopsPath = lib.mkOption { default = root + /secrets/secrets.yaml; example = "/your/path"; - type = - with lib.types; + type = with lib.types; oneOf [ str path @@ -46,18 +44,18 @@ }; config = lib.mkIf config.mods.sops.enable ( lib.optionalAttrs (options ? home.packages) { - home.packages = with pkgs; [ sops ]; + home.packages = with pkgs; [sops]; sops = { gnupg = { home = "~/.gnupg"; - sshKeyPaths = [ ]; + sshKeyPaths = []; }; defaultSopsFile = config.mods.sops.sopsPath; validateSopsFiles = config.mods.sops.validateSopsFile; secrets = config.mods.sops.secrets; }; - systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ]; + systemd.user.services.mbsync.Unit.After = ["sops-nix.service"]; } ); } diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index f4a5def..25fc53b 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -5,8 +5,7 @@ pkgs, inputs, ... -}: -{ +}: { options.mods = { starship = { enable = lib.mkOption { @@ -26,8 +25,8 @@ ''; }; customPrompt = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = '' Custom configuration for prompt. @@ -40,138 +39,136 @@ # environment.systemPackages needed in order to configure systemwide config = lib.mkIf config.mods.starship.enable ( lib.optionalAttrs (options ? environment.systemPackages) { - programs.starship = - let - base16 = pkgs.callPackage inputs.base16.lib { }; - scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); - code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)"; - in - { - enable = true; - interactiveOnly = true; - presets = lib.mkIf config.mods.starship.useDefaultPrompt [ "pastel-powerline" ]; - settings = - lib.mkIf config.mods.starship.useDefaultPrompt { - # derived from https://starship.rs/presets/pastel-powerline - format = "$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)"; - right_format = "$c$elixir$elm$golang$gradle$haskell$java$julia$nodejs$nim$rust$scala$python$ocaml$opa$perl$zig$dart$dotnet$nix_shell$shell$solidity[](bg:prev_bg fg:#3465A4)$time$os"; - username = { - show_always = false; - style_user = "bg:#5277C3 fg:#${scheme.base05}"; - style_root = "bg:#5277C3 fg:#${scheme.base05}"; - format = "[ $user ]($style)[](bg:#3465A4 fg:#5277C3)"; - disabled = false; + programs.starship = let + base16 = pkgs.callPackage inputs.base16.lib {}; + scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; + code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)"; + in { + enable = true; + interactiveOnly = true; + presets = lib.mkIf config.mods.starship.useDefaultPrompt ["pastel-powerline"]; + settings = + lib.mkIf config.mods.starship.useDefaultPrompt { + # derived from https://starship.rs/presets/pastel-powerline + format = "$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)"; + right_format = "$c$elixir$elm$golang$gradle$haskell$java$julia$nodejs$nim$rust$scala$python$ocaml$opa$perl$zig$dart$dotnet$nix_shell$shell$solidity[](bg:prev_bg fg:#3465A4)$time$os"; + username = { + show_always = false; + style_user = "bg:#5277C3 fg:#${scheme.base05}"; + style_root = "bg:#5277C3 fg:#${scheme.base05}"; + format = "[ $user ]($style)[](bg:#3465A4 fg:#5277C3)"; + disabled = false; + }; + os = { + symbols = { + NixOS = "  "; }; - os = { - symbols = { - NixOS = "  "; - }; - style = "bg:#3465A4 fg:#${scheme.base05}"; - disabled = false; - }; - directory = { - style = "bg:#3465A4 fg:#${scheme.base05}"; - format = "[ $path ]($style)"; - truncation_length = 3; - truncation_symbol = "…/"; - }; - git_branch = { - always_show_remote = true; - symbol = ""; - style = "bg:#5256c3 fg:#${scheme.base05}"; - format = "[ ](bg:#5256c3 fg:prev_bg)[$symbol ($remote_name )$branch ]($style)"; - }; - git_status = { - staged = "+\${count} (fg:#C4A000)"; - ahead = "⇡\${count} (fg:#C4A000)"; - diverged = "⇕⇡\${count} (fg:#C4A000)"; - behind = "⇣\${count} (fg:#C4A000)"; - stashed = " "; - untracked = "?\${count} (fg:#C4A000)"; - modified = "!\${count} (fg:#C4A000)"; - deleted = "✘\${count} (fg:#C4A000)"; - conflicted = "=\${count} (fg:#C4A000)"; - renamed = "»\${count} (fg:#C4A000)"; - style = "bg:#5256c3 fg:fg:#C4A000"; - format = "[$all_status$ahead_behind]($style)"; - }; - git_metrics = { - disabled = false; - format = "([| ](bg:#5256c3)[+$added]($added_style bg:#5256c3)[ -$deleted]($deleted_style bg:#5256c3))"; - }; - c = { - format = code_format; - }; - elixir = { - format = code_format; - }; - elm = { - format = code_format; - }; - golang = { - format = code_format; - }; - gradle = { - format = code_format; - }; - haskell = { - format = code_format; - }; - java = { - format = code_format; - }; - julia = { - format = code_format; - }; - nodejs = { - format = code_format; - }; - nim = { - format = code_format; - }; - nix_shell = { - symbol = ""; - format = code_format; - }; - rust = { - format = code_format; - }; - scala = { - format = code_format; - }; - typst = { - format = code_format; - }; - python = { - format = code_format; - }; - ocaml = { - format = code_format; - }; - opa = { - format = code_format; - }; - perl = { - format = code_format; - }; - zig = { - format = code_format; - }; - dart = { - format = code_format; - }; - dotnet = { - format = code_format; - }; - time = { - disabled = false; - time_format = "%R"; # Hour:Minute Format - style = "bg:#3465A4 fg:#${scheme.base05}"; - format = "[ $time ]($style)"; - }; - } - // config.mods.starship.customPrompt; - }; + style = "bg:#3465A4 fg:#${scheme.base05}"; + disabled = false; + }; + directory = { + style = "bg:#3465A4 fg:#${scheme.base05}"; + format = "[ $path ]($style)"; + truncation_length = 3; + truncation_symbol = "…/"; + }; + git_branch = { + always_show_remote = true; + symbol = ""; + style = "bg:#5256c3 fg:#${scheme.base05}"; + format = "[ ](bg:#5256c3 fg:prev_bg)[$symbol ($remote_name )$branch ]($style)"; + }; + git_status = { + staged = "+\${count} (fg:#C4A000)"; + ahead = "⇡\${count} (fg:#C4A000)"; + diverged = "⇕⇡\${count} (fg:#C4A000)"; + behind = "⇣\${count} (fg:#C4A000)"; + stashed = " "; + untracked = "?\${count} (fg:#C4A000)"; + modified = "!\${count} (fg:#C4A000)"; + deleted = "✘\${count} (fg:#C4A000)"; + conflicted = "=\${count} (fg:#C4A000)"; + renamed = "»\${count} (fg:#C4A000)"; + style = "bg:#5256c3 fg:fg:#C4A000"; + format = "[$all_status$ahead_behind]($style)"; + }; + git_metrics = { + disabled = false; + format = "([| ](bg:#5256c3)[+$added]($added_style bg:#5256c3)[ -$deleted]($deleted_style bg:#5256c3))"; + }; + c = { + format = code_format; + }; + elixir = { + format = code_format; + }; + elm = { + format = code_format; + }; + golang = { + format = code_format; + }; + gradle = { + format = code_format; + }; + haskell = { + format = code_format; + }; + java = { + format = code_format; + }; + julia = { + format = code_format; + }; + nodejs = { + format = code_format; + }; + nim = { + format = code_format; + }; + nix_shell = { + symbol = ""; + format = code_format; + }; + rust = { + format = code_format; + }; + scala = { + format = code_format; + }; + typst = { + format = code_format; + }; + python = { + format = code_format; + }; + ocaml = { + format = code_format; + }; + opa = { + format = code_format; + }; + perl = { + format = code_format; + }; + zig = { + format = code_format; + }; + dart = { + format = code_format; + }; + dotnet = { + format = code_format; + }; + time = { + disabled = false; + time_format = "%R"; # Hour:Minute Format + style = "bg:#3465A4 fg:#${scheme.base05}"; + format = "[ $time ]($style)"; + }; + } + // config.mods.starship.customPrompt; + }; } ); } diff --git a/modules/programs/stylix.nix b/modules/programs/stylix.nix index 6792ba4..3e80808 100644 --- a/modules/programs/stylix.nix +++ b/modules/programs/stylix.nix @@ -4,8 +4,7 @@ options, pkgs, ... -}: -{ +}: { options.mods.stylix = { colorscheme = lib.mkOption { default = "catppuccin-mocha"; @@ -34,8 +33,7 @@ base0E = "BB9AF7"; base0F = "F7768E"; }; - type = - with lib.types; + type = with lib.types; oneOf [ str attrs @@ -57,7 +55,7 @@ name = "catppuccin-mocha-lavender-cursors"; size = 24; }; - example = { }; + example = {}; type = with lib.types; attrsOf anything; description = "Xcursor config"; }; @@ -83,7 +81,7 @@ name = "Noto Color Emoji"; }; }; - example = { }; + example = {}; type = with lib.types; attrsOf anything; description = "font config"; }; @@ -101,10 +99,9 @@ fonts = config.mods.stylix.fonts; cursor = config.mods.stylix.cursor; base16Scheme = ( - if builtins.isAttrs config.mods.stylix.colorscheme then - config.mods.stylix.colorscheme - else - "${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml" + if builtins.isAttrs config.mods.stylix.colorscheme + then config.mods.stylix.colorscheme + else "${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml" ); }; }) diff --git a/modules/programs/supersonic.nix b/modules/programs/supersonic.nix index b4074bf..3b732df 100644 --- a/modules/programs/supersonic.nix +++ b/modules/programs/supersonic.nix @@ -5,12 +5,10 @@ pkgs, inputs, ... -}: -let - base16 = pkgs.callPackage inputs.base16.lib { }; +}: let + base16 = pkgs.callPackage inputs.base16.lib {}; scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; -in -{ +in { options.mods.supersonic = { enable = lib.mkOption { default = false; @@ -31,42 +29,45 @@ in config = lib.mkIf config.mods.supersonic.enable ( lib.optionalAttrs (options ? home.packages) { home.packages = with pkgs; [ - (if config.mods.supersonic.variant == "wayland" then supersonic-wayland else supersonic) + ( + if config.mods.supersonic.variant == "wayland" + then supersonic-wayland + else supersonic + ) ]; xdg.configFile."supersonic/themes/custom.toml".source = - (pkgs.formats.toml { }).generate "customTheme" - { - SupersonicTheme = { - Name = "Custom"; - Version = "0.2"; - SupportsDark = true; - SupportsLight = true; - }; - - DarkColors = { - PageBackground = "#${scheme.base00}"; - ListHeader = "#${scheme.base02}"; - PageHeader = "#${scheme.base02}"; - Background = "#${scheme.base01}"; - ScrollBar = "#${scheme.base02}"; - Button = "#${scheme.base02}"; - Foreground = "#${scheme.base04}"; - InputBackground = "#${scheme.base02}"; - }; - - # just define the same as base 16 doesn't define if it is light or not - LightColors = { - PageBackground = "#${scheme.base00}"; - ListHeader = "#${scheme.base02}"; - PageHeader = "#${scheme.base02}"; - Background = "#${scheme.base01}"; - ScrollBar = "#${scheme.base02}"; - Button = "#${scheme.base02}"; - Foreground = "#${scheme.base04}"; - InputBackground = "#${scheme.base02}"; - }; + (pkgs.formats.toml {}).generate "customTheme" + { + SupersonicTheme = { + Name = "Custom"; + Version = "0.2"; + SupportsDark = true; + SupportsLight = true; }; - } + DarkColors = { + PageBackground = "#${scheme.base00}"; + ListHeader = "#${scheme.base02}"; + PageHeader = "#${scheme.base02}"; + Background = "#${scheme.base01}"; + ScrollBar = "#${scheme.base02}"; + Button = "#${scheme.base02}"; + Foreground = "#${scheme.base04}"; + InputBackground = "#${scheme.base02}"; + }; + + # just define the same as base 16 doesn't define if it is light or not + LightColors = { + PageBackground = "#${scheme.base00}"; + ListHeader = "#${scheme.base02}"; + PageHeader = "#${scheme.base02}"; + Background = "#${scheme.base01}"; + ScrollBar = "#${scheme.base02}"; + Button = "#${scheme.base02}"; + Foreground = "#${scheme.base04}"; + InputBackground = "#${scheme.base02}"; + }; + }; + } ); } diff --git a/modules/programs/teams.nix b/modules/programs/teams.nix index 15b8748..dc159a9 100644 --- a/modules/programs/teams.nix +++ b/modules/programs/teams.nix @@ -3,12 +3,11 @@ config, options, pkgs, + stable, ... -}: -let +}: let callPackage = lib.callPackageWith pkgs; -in -{ +in { options.mods.teams = { enable = lib.mkOption { default = false; @@ -25,12 +24,12 @@ in }; config = lib.mkIf config.mods.teams.enable ( lib.optionalAttrs (options ? home.packages) { - home.packages = [ (callPackage ../../override/teams.nix { }) ]; + home.packages = [(callPackage ../../override/teams.nix {pkgs = stable;})]; } // (lib.optionalAttrs (options ? boot.kernelModules) { boot = { - extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; - kernelModules = [ "v4l2loopback" ]; + extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; + kernelModules = ["v4l2loopback"]; extraModprobeConfig = '' options v4l2loopback exclusive_caps=1 card_label="Virtual Camera" ''; diff --git a/modules/programs/virtmanager.nix b/modules/programs/virtmanager.nix index cfcb0df..84c7c0a 100644 --- a/modules/programs/virtmanager.nix +++ b/modules/programs/virtmanager.nix @@ -4,27 +4,23 @@ options, pkgs, ... -}: -let +}: let module = - if config.conf.cpu == "intel" then - "kvm-intel" - else if config.conf.cpu == "amd" then - "kvm-amd" - else - ""; -in -{ - + if config.conf.cpu == "intel" + then "kvm-intel" + else if config.conf.cpu == "amd" + then "kvm-amd" + else ""; +in { options.mods = { virtmanager.enable = lib.mkOption { default = false; type = lib.types.bool; example = true; description = '' - - - Enables virt-manager kvm. + + + Enables virt-manager kvm. ''; }; }; @@ -48,7 +44,7 @@ in package = pkgs.qemu_kvm; swtpm.enable = true; ovmf.enable = true; - ovmf.packages = [ pkgs.OVMFFull.fd ]; + ovmf.packages = [pkgs.OVMFFull.fd]; }; }; spiceUSBRedirection.enable = true; @@ -60,13 +56,12 @@ in "kvm" "qemu-libvirtd" ]; - } // lib.optionalAttrs (options ? dconf.settings) { dconf.settings = { "org/virt-manager/virt-manager/connections" = { - autoconnect = [ "qemu:///system" ]; - uris = [ "qemu:///system" ]; + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; }; }; }; diff --git a/modules/programs/xkb.nix b/modules/programs/xkb.nix index c0e162c..7ae8414 100644 --- a/modules/programs/xkb.nix +++ b/modules/programs/xkb.nix @@ -3,8 +3,7 @@ options, config, ... -}: -{ +}: { options.mods.xkb = { layout = lib.mkOption { default = "dashie"; diff --git a/modules/programs/xone.nix b/modules/programs/xone.nix index 0779744..36d92f0 100644 --- a/modules/programs/xone.nix +++ b/modules/programs/xone.nix @@ -3,9 +3,7 @@ config, options, ... -}: -{ - +}: { options.mods = { xone.enable = lib.mkOption { default = false; @@ -17,5 +15,5 @@ }; }; - config = lib.optionalAttrs (options ? hardware) { hardware.xone.enable = true; }; + config = lib.optionalAttrs (options ? hardware) {hardware.xone.enable = true;}; } diff --git a/modules/programs/yazi/default.nix b/modules/programs/yazi/default.nix index 58e9354..4e7fb59 100644 --- a/modules/programs/yazi/default.nix +++ b/modules/programs/yazi/default.nix @@ -3,8 +3,7 @@ config, options, ... -}: -{ +}: { options.mods.yazi = { enable = lib.mkOption { default = true; @@ -19,8 +18,8 @@ description = "Use default yazi config (if disabled only additionalConfig is used)"; }; additionalConfig = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = "Additional config for yazi"; }; @@ -31,16 +30,15 @@ description = "Use default yazi keymap (if disabled only additionalKeymap is used)"; }; additionalKeymap = lib.mkOption { - default = { }; - example = { }; + default = {}; + example = {}; type = with lib.types; attrsOf anything; description = "Additional keymap for yazi"; }; }; - config = - let - conf = import ./yazi.nix; - in + config = let + conf = import ./yazi.nix; + in lib.optionalAttrs (options ? home.packages) ( lib.mkIf config.mods.yazi.enable { programs.yazi = { diff --git a/modules/programs/yazi/yazi.nix b/modules/programs/yazi/yazi.nix index 92853d0..233ab22 100644 --- a/modules/programs/yazi/yazi.nix +++ b/modules/programs/yazi/yazi.nix @@ -99,125 +99,125 @@ keymap = { manager.keymap = [ { - on = [ "" ]; + on = [""]; run = "escape"; desc = "Exit visual mode clear selected or cancel search"; } { - on = [ "q" ]; + on = ["q"]; run = "quit"; desc = "Exit the process"; } { - on = [ "Q" ]; + on = ["Q"]; run = "quit --no-cwd-file"; desc = "Exit the process without writing cwd-file"; } { - on = [ "" ]; + on = [""]; run = "close"; desc = "Close the current tab or quit if it is last tab"; } { - on = [ "" ]; + on = [""]; run = "suspend"; desc = "Suspend the process"; } # Navigation { - on = [ "l" ]; + on = ["l"]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "k" ]; + on = ["k"]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "L" ]; + on = ["L"]; run = "arrow -5"; desc = "Move cursor up 5 lines"; } { - on = [ "K" ]; + on = ["K"]; run = "arrow 5"; desc = "Move cursor down 5 lines"; } { - on = [ "" ]; + on = [""]; run = "arrow -50%"; desc = "Move cursor up half page"; } { - on = [ "" ]; + on = [""]; run = "arrow 50%"; desc = "Move cursor down half page"; } { - on = [ "" ]; + on = [""]; run = "arrow -100%"; desc = "Move cursor up one page"; } { - on = [ "" ]; + on = [""]; run = "arrow 100%"; desc = "Move cursor down one page"; } { - on = [ "j" ]; + on = ["j"]; run = "leave"; desc = "Go back to the parent directory"; } { - on = [ ";" ]; + on = [";"]; run = "enter"; desc = "Enter the child directory"; } { - on = [ "J" ]; + on = ["J"]; run = "back"; desc = "Go back to the previous directory"; } { - on = [ "P" ]; + on = ["P"]; run = "forward"; desc = "Go forward to the next directory"; } { - on = [ "" ]; + on = [""]; run = "peek -5"; desc = "Peek up 5 units in the preview"; } { - on = [ "" ]; + on = [""]; run = "peek 5"; desc = "Peek down 5 units in the preview"; } { - on = [ "" ]; + on = [""]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "" ]; + on = [""]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "" ]; + on = [""]; run = "leave"; desc = "Go back to the parent directory"; } { - on = [ "" ]; + on = [""]; run = "enter"; desc = "Enter the child directory"; } @@ -231,116 +231,116 @@ desc = "Move cursor to the top"; } { - on = [ "G" ]; + on = ["G"]; run = "arrow 99999999"; desc = "Move cursor to the bottom"; } # Selection { - on = [ "v" ]; + on = ["v"]; run = "visual_mode"; desc = "Enter visual mode (selection mode)"; } { - on = [ "V" ]; + on = ["V"]; run = "visual_mode --unset"; desc = "Enter visual mode (unset mode)"; } { - on = [ "" ]; + on = [""]; run = "select_all --state=true"; desc = "Select all files"; } { - on = [ "" ]; + on = [""]; run = "select_all --state=none"; desc = "Inverse selection of all files"; } # Operation { - on = [ "o" ]; + on = ["o"]; run = "open"; desc = "Open the selected files"; } { - on = [ "O" ]; + on = ["O"]; run = "open --interactive"; desc = "Open the selected files interactively"; } { - on = [ "" ]; + on = [""]; run = "open"; desc = "Open the selected files"; } { - on = [ "" ]; + on = [""]; run = "open --interactive"; desc = "Open the selected files interactively"; } # It's cool if you're using a terminal that supports CSI u { - on = [ "y" ]; + on = ["y"]; run = "yank"; desc = "Copy the selected files"; } { - on = [ "x" ]; + on = ["x"]; run = "yank --cut"; desc = "Cut the selected files"; } { - on = [ "p" ]; + on = ["p"]; run = "paste"; desc = "Paste the files"; } { - on = [ "P" ]; + on = ["P"]; run = "paste --force"; desc = "Paste the files (overwrite if the destination exists)"; } { - on = [ "-" ]; + on = ["-"]; run = "link"; desc = "Symlink the absolute path of files"; } { - on = [ "_" ]; + on = ["_"]; run = "link --relative"; desc = "Symlink the relative path of files"; } { - on = [ "d" ]; + on = ["d"]; run = "remove"; desc = "Move the files to the trash"; } { - on = [ "D" ]; + on = ["D"]; run = "remove --permanently"; desc = "Permanently delete the files"; } { - on = [ "a" ]; + on = ["a"]; run = "create"; desc = "Create a file or directory (ends with / for directories)"; } { - on = [ "r" ]; + on = ["r"]; run = "rename"; desc = "Rename a file or directory"; } { - on = [ ";" ]; + on = [";"]; run = "shell"; desc = "Run a shell command"; } { - on = [ ":" ]; + on = [":"]; run = "shell --block"; desc = "Run a shell command (block the UI until the command finishes)"; } { - on = [ "." ]; + on = ["."]; run = "hidden toggle"; desc = "Toggle the visibility of hidden files"; } @@ -363,17 +363,17 @@ desc = "Search files by content using ripgrep"; } { - on = [ "" ]; + on = [""]; run = "search none"; desc = "Cancel the ongoing search"; } { - on = [ "z" ]; + on = ["z"]; run = "jump zoxide"; desc = "Jump to a directory using zoxide"; } { - on = [ "Z" ]; + on = ["Z"]; run = "jump fzf"; desc = "Jump to a directory or reveal a file using fzf"; } @@ -414,19 +414,19 @@ # Find { - on = [ "/" ]; + on = ["/"]; run = "find --smart"; } { - on = [ "?" ]; + on = ["?"]; run = "find --previous --smart"; } { - on = [ "n" ]; + on = ["n"]; run = "find_arrow"; } { - on = [ "N" ]; + on = ["N"]; run = "find_arrow --previous"; } @@ -514,82 +514,82 @@ # Tabs { - on = [ "t" ]; + on = ["t"]; run = "tab_create --current"; desc = "Create a new tab using the current path"; } { - on = [ "1" ]; + on = ["1"]; run = "tab_switch 0"; desc = "Switch to the first tab"; } { - on = [ "2" ]; + on = ["2"]; run = "tab_switch 1"; desc = "Switch to the second tab"; } { - on = [ "3" ]; + on = ["3"]; run = "tab_switch 2"; desc = "Switch to the third tab"; } { - on = [ "4" ]; + on = ["4"]; run = "tab_switch 3"; desc = "Switch to the fourth tab"; } { - on = [ "5" ]; + on = ["5"]; run = "tab_switch 4"; desc = "Switch to the fifth tab"; } { - on = [ "6" ]; + on = ["6"]; run = "tab_switch 5"; desc = "Switch to the sixth tab"; } { - on = [ "7" ]; + on = ["7"]; run = "tab_switch 6"; desc = "Switch to the seventh tab"; } { - on = [ "8" ]; + on = ["8"]; run = "tab_switch 7"; desc = "Switch to the eighth tab"; } { - on = [ "9" ]; + on = ["9"]; run = "tab_switch 8"; desc = "Switch to the ninth tab"; } { - on = [ "[" ]; + on = ["["]; run = "tab_switch -1 --relative"; desc = "Switch to the previous tab"; } { - on = [ "]" ]; + on = ["]"]; run = "tab_switch 1 --relative"; desc = "Switch to the next tab"; } { - on = [ "{" ]; + on = ["{"]; run = "tab_swap -1"; desc = "Swap the current tab with the previous tab"; } { - on = [ "}" ]; + on = ["}"]; run = "tab_swap 1"; desc = "Swap the current tab with the next tab"; } # Tasks { - on = [ "w" ]; + on = ["w"]; run = "tasks_show"; desc = "Show the tasks manager"; } @@ -638,7 +638,7 @@ # Help { - on = [ "~" ]; + on = ["~"]; run = "help"; desc = "Open help"; } @@ -646,56 +646,56 @@ tasks.keymap = [ { - on = [ "" ]; + on = [""]; run = "close"; desc = "Hide the task manager"; } { - on = [ "" ]; + on = [""]; run = "close"; desc = "Hide the task manager"; } { - on = [ "w" ]; + on = ["w"]; run = "close"; desc = "Hide the task manager"; } { - on = [ "k" ]; + on = ["k"]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "j" ]; + on = ["j"]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "" ]; + on = [""]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "" ]; + on = [""]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "" ]; + on = [""]; run = "inspect"; desc = "Inspect the task"; } { - on = [ "x" ]; + on = ["x"]; run = "cancel"; desc = "Cancel the task"; } { - on = [ "~" ]; + on = ["~"]; run = "help"; desc = "Open help"; } @@ -703,56 +703,56 @@ select.keymap = [ { - on = [ "" ]; + on = [""]; run = "close"; desc = "Cancel selection"; } { - on = [ "" ]; + on = [""]; run = "close"; desc = "Cancel selection"; } { - on = [ "" ]; + on = [""]; run = "close --submit"; desc = "Submit the selection"; } { - on = [ "k" ]; + on = ["k"]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "j" ]; + on = ["j"]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "K" ]; + on = ["K"]; run = "arrow -5"; desc = "Move cursor up 5 lines"; } { - on = [ "J" ]; + on = ["J"]; run = "arrow 5"; desc = "Move cursor down 5 lines"; } { - on = [ "" ]; + on = [""]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "" ]; + on = [""]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "~" ]; + on = ["~"]; run = "help"; desc = "Open help"; } @@ -760,39 +760,39 @@ input.keymap = [ { - on = [ "" ]; + on = [""]; run = "close"; desc = "Cancel input"; } { - on = [ "" ]; + on = [""]; run = "close --submit"; desc = "Submit the input"; } { - on = [ "" ]; + on = [""]; run = "escape"; desc = "Go back the normal mode or cancel input"; } # Mode { - on = [ "i" ]; + on = ["i"]; run = "insert"; desc = "Enter insert mode"; } { - on = [ "a" ]; + on = ["a"]; run = "insert --append"; desc = "Enter append mode"; } { - on = [ "v" ]; + on = ["v"]; run = "visual"; desc = "Enter visual mode"; } { - on = [ "V" ]; + on = ["V"]; run = [ "move -999" "visual" @@ -803,28 +803,28 @@ # Navigation { - on = [ "h" ]; + on = ["h"]; run = "move -1"; desc = "Move cursor left"; } { - on = [ "l" ]; + on = ["l"]; run = "move 1"; desc = "Move cursor right"; } { - on = [ "0" ]; + on = ["0"]; run = "move -999"; desc = "Move to the BOL"; } { - on = [ "$" ]; + on = ["$"]; run = "move 999"; desc = "Move to the EOL"; } { - on = [ "I" ]; + on = ["I"]; run = [ "move -999" "insert" @@ -832,7 +832,7 @@ desc = "Move to the BOL and enter insert mode"; } { - on = [ "A" ]; + on = ["A"]; run = [ "move 999" "insert --append" @@ -841,40 +841,40 @@ } { - on = [ "" ]; + on = [""]; run = "move -1"; desc = "Move cursor left"; } { - on = [ "" ]; + on = [""]; run = "move 1"; desc = "Move cursor right"; } { - on = [ "b" ]; + on = ["b"]; run = "backward"; desc = "Move to the beginning of the previous word"; } { - on = [ "w" ]; + on = ["w"]; run = "forward"; desc = "Move to the beginning of the next word"; } { - on = [ "e" ]; + on = ["e"]; run = "forward --end-of-word"; desc = "Move to the end of the next word"; } # Deletion { - on = [ "d" ]; + on = ["d"]; run = "delete --cut"; desc = "Cut the selected characters"; } { - on = [ "D" ]; + on = ["D"]; run = [ "delete --cut" "move 999" @@ -882,12 +882,12 @@ desc = "Cut until the EOL"; } { - on = [ "c" ]; + on = ["c"]; run = "delete --cut --insert"; desc = "Cut the selected characters and enter insert mode"; } { - on = [ "C" ]; + on = ["C"]; run = [ "delete --cut --insert" "move 999" @@ -895,7 +895,7 @@ desc = "Cut until the EOL and enter insert mode"; } { - on = [ "x" ]; + on = ["x"]; run = [ "delete --cut" "move 1 --in-operating" @@ -905,36 +905,36 @@ # Yank/Paste { - on = [ "y" ]; + on = ["y"]; run = "yank"; desc = "Copy the selected characters"; } { - on = [ "p" ]; + on = ["p"]; run = "paste"; desc = "Paste the copied characters after the cursor"; } { - on = [ "P" ]; + on = ["P"]; run = "paste --before"; desc = "Paste the copied characters before the cursor"; } # Undo/Redo { - on = [ "u" ]; + on = ["u"]; run = "undo"; desc = "Undo the last operation"; } { - on = [ "" ]; + on = [""]; run = "redo"; desc = "Redo the last operation"; } # Help { - on = [ "~" ]; + on = ["~"]; run = "help"; desc = "Open help"; } @@ -942,58 +942,58 @@ help.keymap = [ { - on = [ "" ]; + on = [""]; run = "escape"; desc = "Clear the filter or hide the help"; } { - on = [ "q" ]; + on = ["q"]; run = "close"; desc = "Exit the process"; } { - on = [ "" ]; + on = [""]; run = "close"; desc = "Hide the help"; } # Navigation { - on = [ "k" ]; + on = ["k"]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "j" ]; + on = ["j"]; run = "arrow 1"; desc = "Move cursor down"; } { - on = [ "K" ]; + on = ["K"]; run = "arrow -5"; desc = "Move cursor up 5 lines"; } { - on = [ "J" ]; + on = ["J"]; run = "arrow 5"; desc = "Move cursor down 5 lines"; } { - on = [ "" ]; + on = [""]; run = "arrow -1"; desc = "Move cursor up"; } { - on = [ "" ]; + on = [""]; run = "arrow 1"; desc = "Move cursor down"; } # Filtering { - on = [ "/" ]; + on = ["/"]; run = "filter"; desc = "Apply a filter for the help items"; } diff --git a/override/teams.nix b/override/teams.nix index 4370d7a..7d4f454 100644 --- a/override/teams.nix +++ b/override/teams.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation (final: { pname = "teams-pwa"; name = final.pname; - nativeBuildInputs = [ copyDesktopItems ]; + nativeBuildInputs = [copyDesktopItems]; dontUnpack = true; desktopItems = [ @@ -21,15 +21,15 @@ stdenv.mkDerivation (final: { } --app=https://teams.microsoft.com"; desktopName = "Microsoft Teams PWA"; genericName = "Progressive Web App for Microsoft Teams"; - categories = [ "Network" ]; - mimeTypes = [ "x-scheme-handler/msteams" ]; + categories = ["Network"]; + mimeTypes = ["x-scheme-handler/msteams"]; }) ]; meta = with lib; { description = "Microsoft Teams PWA"; homepage = "https://teams.microsoft.com"; - maintainers = with maintainers; [ ners ]; + maintainers = with maintainers; [ners]; platforms = chromium.meta.platforms; }; })