From 16d3816918c075962b703a2c278f047cbc0cfa52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Wed, 3 Apr 2024 23:12:53 +0200 Subject: [PATCH] refactor: rfc formatting --- flake.nix | 48 ++++-- hosts/MONSTER/default.nix | 29 +++- hosts/MONSTER/hardware-configuration.nix | 25 ++- modules/home-manager/clean-home-dir.nix | 6 +- modules/home-manager/default.nix | 10 +- modules/home-manager/packages/default.nix | 6 +- .../packages/hid-fanatecff-tools.nix | 7 +- .../home-manager/packages/threema-desktop.nix | 8 +- modules/home-manager/programs/default.nix | 7 +- modules/home-manager/programs/firefox.nix | 38 ++--- modules/home-manager/programs/neovide.nix | 3 +- .../home-manager/programs/nixvim/default.nix | 159 ++++++++++-------- .../home-manager/programs/nixvim/keymaps.nix | 3 +- modules/home-manager/services/default.nix | 3 +- modules/nixos/boot/quiet.nix | 11 +- modules/nixos/default.nix | 3 +- modules/nixos/desktops/hyprland.nix | 21 ++- modules/nixos/fonts/fira-code.nix | 40 +++-- modules/nixos/fonts/nerdfonts.nix | 23 +-- modules/nixos/fonts/noto-sans.nix | 25 ++- modules/nixos/hardware/amdgpu.nix | 22 ++- modules/nixos/hardware/audio.nix | 14 +- modules/nixos/hardware/cc1.nix | 20 ++- modules/nixos/hardware/fv43u.nix | 18 +- modules/nixos/hardware/gbmonctl.nix | 14 +- modules/nixos/hardware/nvidia-nouveau.nix | 17 +- modules/nixos/hardware/nvidia-proprietary.nix | 43 +++-- modules/nixos/hardware/virtual-camera.nix | 23 ++- modules/nixos/locales/theaninova.nix | 14 +- modules/nixos/services/airprint.nix | 20 ++- overlays/cura/default.nix | 9 +- overlays/darkman/default.nix | 12 +- overlays/gbmonctl/default.nix | 17 +- overlays/lpc21isp/default.nix | 10 +- 34 files changed, 477 insertions(+), 251 deletions(-) diff --git a/flake.nix b/flake.nix index dd2b2cb..f6c9cb4 100644 --- a/flake.nix +++ b/flake.nix @@ -19,11 +19,21 @@ }; outputs = - { nixpkgs, nur, home-manager, ags, nixvim, anyrun, hyprland, ... }@inputs: + { + nixpkgs, + nur, + home-manager, + ags, + nixvim, + anyrun, + hyprland, + ... + }@inputs: let inherit (nixpkgs.lib) genAttrs listToAttrs; eachSystem = genAttrs [ "x86_64-linux" ]; - legacyPackages = eachSystem (system: + legacyPackages = eachSystem ( + system: import nixpkgs { inherit system; config = { @@ -31,17 +41,14 @@ allowUnsupportedSystem = true; experimental-features = "nix-command flakes"; substituters = [ "https://hyprland.cachix.org" ]; - trusted-public-keys = [ - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; }; overlays = [ nur.overlay (final: prev: { anyrunPlugins = anyrun.packages.${prev.system}; hyprland = hyprland.packages.${prev.system}.hyprland; - xdg-desktop-portal-hyprland = - hyprland.packages.${prev.system}.xdg-desktop-portal-hyprland; + xdg-desktop-portal-hyprland = hyprland.packages.${prev.system}.xdg-desktop-portal-hyprland; ags = ags.packages.${prev.system}.default; gbmonctl = prev.callPackage ./overlays/gbmonctl { }; lpc21isp = prev.callPackage ./overlays/lpc21isp { }; @@ -49,9 +56,15 @@ cura = prev.callPackage ./overlays/cura { }; }) ]; - }); + } + ); - mkHost = { hostname, username, system }: + mkHost = + { + hostname, + username, + system, + }: nixpkgs.lib.nixosSystem { pkgs = legacyPackages.${system}; modules = [ @@ -59,22 +72,29 @@ ./hosts/${hostname} home-manager.nixosModules.home-manager { - _module.args = { inherit username; }; + _module.args = { + inherit username; + }; networking.hostName = hostname; home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { inherit username inputs; }; + extraSpecialArgs = { + inherit username inputs; + }; users.${username} = { - imports = - [ ./modules/home-manager ./hosts/${hostname}/home.nix ]; + imports = [ + ./modules/home-manager + ./hosts/${hostname}/home.nix + ]; }; }; } ]; specialArgs = inputs; }; - in { + in + { nixosConfigurations.MONSTER = mkHost { hostname = "MONSTER"; username = "theaninova"; diff --git a/hosts/MONSTER/default.nix b/hosts/MONSTER/default.nix index e18d6d2..3649b82 100644 --- a/hosts/MONSTER/default.nix +++ b/hosts/MONSTER/default.nix @@ -1,8 +1,17 @@ -{ config, pkgs, username, ... }: { +{ + config, + pkgs, + username, + ... +}: +{ imports = [ ./hardware-configuration.nix ]; nix = { - settings.experimental-features = [ "nix-command" "flakes" ]; + settings.experimental-features = [ + "nix-command" + "flakes" + ]; gc = { automatic = true; randomizedDelaySec = "14m"; @@ -54,7 +63,10 @@ services.airprint.enable = true; - services.udev.packages = with pkgs; [ oversteer android-udev-rules ]; + services.udev.packages = with pkgs; [ + oversteer + android-udev-rules + ]; virtualisation.docker.rootless = { enable = true; @@ -111,7 +123,11 @@ networking = { firewall = { - allowedTCPPorts = [ 8100 5037 5173 ]; + allowedTCPPorts = [ + 8100 + 5037 + 5173 + ]; allowedUDPPorts = [ 50765 ]; }; @@ -129,7 +145,10 @@ fileSystems."/mnt/media" = { device = "kookaborrow:/media"; fsType = "nfs"; - options = [ "x-systemd-automount" "noauto" ]; + options = [ + "x-systemd-automount" + "noauto" + ]; }; fileSystems."/run/media/theaninova/heart-drive" = { diff --git a/hosts/MONSTER/hardware-configuration.nix b/hosts/MONSTER/hardware-configuration.nix index 8b7db83..edb875d 100644 --- a/hosts/MONSTER/hardware-configuration.nix +++ b/hosts/MONSTER/hardware-configuration.nix @@ -1,13 +1,26 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -22,8 +35,7 @@ fsType = "vfat"; }; - swapDevices = - [{ device = "/dev/disk/by-uuid/b09fbba2-c97a-41bc-a3cd-8204e30204f8"; }]; + swapDevices = [ { device = "/dev/disk/by-uuid/b09fbba2-c97a-41bc-a3cd-8204e30204f8"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -33,6 +45,5 @@ # networking.interfaces.eno1.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/modules/home-manager/clean-home-dir.nix b/modules/home-manager/clean-home-dir.nix index ba3ad98..87a41ad 100644 --- a/modules/home-manager/clean-home-dir.nix +++ b/modules/home-manager/clean-home-dir.nix @@ -1,4 +1,5 @@ -{ config, ... }: { +{ config, ... }: +{ xdg.enable = true; xdg.userDirs.enable = true; home.sessionVariables = { @@ -7,8 +8,7 @@ NPM_CONFIG_CACHE = "${config.xdg.cacheHome}/npm"; NPM_CONFIG_TMP = "${config.xdg.stateHome}/npm"; WINEPREFIX = "${config.xdg.configHome}/wineprefixes/default"; - _JAVA_OPTGRADLE_USER_HOMEIONS = - ''-Djava.util.prefs.userRoot="${config.xdg.configHome}"/java''; + _JAVA_OPTGRADLE_USER_HOMEIONS = ''-Djava.util.prefs.userRoot="${config.xdg.configHome}"/java''; GRADLE_USER_HOME = "${config.xdg.configHome}/gradle"; DVDCSS_CACHE = "${config.xdg.cacheHome}/dvdcss"; DOCKER_CONFIG = "${config.xdg.configHome}/docker"; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 2718e6b..b7a8a97 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,4 +1,12 @@ -{ username, desktop, stateVersion, osConfig, inputs, ... }: { +{ + username, + desktop, + stateVersion, + osConfig, + inputs, + ... +}: +{ home = { stateVersion = osConfig.system.stateVersion; inherit username; diff --git a/modules/home-manager/packages/default.nix b/modules/home-manager/packages/default.nix index 001d2fd..0ef81b2 100644 --- a/modules/home-manager/packages/default.nix +++ b/modules/home-manager/packages/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ xdg.configFile."ranger/rc.conf".source = ./ranger.conf; home.packages = with pkgs; [ # nix @@ -15,7 +16,7 @@ # media jellyfin-media-player youtube-dl - tartube + # tartube yt-dlp f3d mpv @@ -41,7 +42,6 @@ audacity pinta kdePackages.kdenlive - # friture TODO: broken blender-hip openscad-unstable diff --git a/modules/home-manager/packages/hid-fanatecff-tools.nix b/modules/home-manager/packages/hid-fanatecff-tools.nix index 60ade05..811dd12 100644 --- a/modules/home-manager/packages/hid-fanatecff-tools.nix +++ b/modules/home-manager/packages/hid-fanatecff-tools.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, pkgs, }: +{ + lib, + stdenv, + fetchFromGitHub, + pkgs, +}: stdenv.mkDerivation rec { pname = "hid-fanatecff-tools"; version = "0.1.0"; diff --git a/modules/home-manager/packages/threema-desktop.nix b/modules/home-manager/packages/threema-desktop.nix index 2ec1730..edfd48e 100644 --- a/modules/home-manager/packages/threema-desktop.nix +++ b/modules/home-manager/packages/threema-desktop.nix @@ -1,6 +1,8 @@ { pkgs }: pkgs.threema-desktop.overrideAttrs (prev: { - postFixup = prev.postFixup + '' - echo "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}" >> $out/bin/threema - ''; + postFixup = + prev.postFixup + + '' + echo "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}" >> $out/bin/threema + ''; }) diff --git a/modules/home-manager/programs/default.nix b/modules/home-manager/programs/default.nix index 508d026..19b2bbb 100644 --- a/modules/home-manager/programs/default.nix +++ b/modules/home-manager/programs/default.nix @@ -1,4 +1,5 @@ -{ pkgs, config, ... }: { +{ pkgs, config, ... }: +{ programs = { home-manager.enable = true; rbw = { @@ -16,7 +17,9 @@ gpg.enable = true; btop = { enable = true; - settings = { vim_keys = true; }; + settings = { + vim_keys = true; + }; }; zsh = { enable = true; diff --git a/modules/home-manager/programs/firefox.nix b/modules/home-manager/programs/firefox.nix index 4149eac..4164d3b 100644 --- a/modules/home-manager/programs/firefox.nix +++ b/modules/home-manager/programs/firefox.nix @@ -1,4 +1,5 @@ -{ pkgs }: { +{ pkgs }: +{ enable = true; package = pkgs.wrapFirefox pkgs.firefox-unwrapped { extraPolicies = { @@ -43,27 +44,26 @@ default = "Google"; engines = { "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; - icon = - "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; "NixOS Wiki" = { - urls = [{ - template = "https://nixos.wiki/index.php?search={searchTerms}"; - }]; + urls = [ { template = "https://nixos.wiki/index.php?search={searchTerms}"; } ]; iconUpdateURL = "https://nixos.wiki/favicon.png"; updateInterval = 24 * 60 * 60 * 1000; definedAliases = [ "@nw" ]; diff --git a/modules/home-manager/programs/neovide.nix b/modules/home-manager/programs/neovide.nix index 5b7c317..f8ad505 100644 --- a/modules/home-manager/programs/neovide.nix +++ b/modules/home-manager/programs/neovide.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = [ pkgs.neovide ]; xdg.configFile."neovide/config.toml".source = ./neovide.toml; } diff --git a/modules/home-manager/programs/nixvim/default.nix b/modules/home-manager/programs/nixvim/default.nix index e2d9653..bde3818 100644 --- a/modules/home-manager/programs/nixvim/default.nix +++ b/modules/home-manager/programs/nixvim/default.nix @@ -17,7 +17,8 @@ let ''; }; }; -in { +in +{ enable = true; defaultEditor = true; vimAlias = true; @@ -33,7 +34,9 @@ in { smartindent = true; signcolumn = "yes"; - undodir = { __raw = "os.getenv('HOME') .. '/.config/nvim/undodir'"; }; + undodir = { + __raw = "os.getenv('HOME') .. '/.config/nvim/undodir'"; + }; undofile = true; scrolloff = 12; @@ -116,30 +119,37 @@ in { right = "┊"; }; sections = { - lualine_a = [{ - name = "mode"; - separator = { - right = ""; - left = ""; - }; - icon = ""; - }]; + lualine_a = [ + { + name = "mode"; + separator = { + right = ""; + left = ""; + }; + icon = ""; + } + ]; lualine_x = [ "(vim.g.disable_autoformat or vim.b.disable_autoformat) and '󱌓' or nil" { name = "filetype"; } ]; - lualine_z = [{ - name = "location"; - separator = { - right = ""; - left = ""; - }; - }]; + lualine_z = [ + { + name = "location"; + separator = { + right = ""; + left = ""; + }; + } + ]; }; }; auto-save = { enable = true; - triggerEvents = [ "FocusLost" "BufLeave" ]; + triggerEvents = [ + "FocusLost" + "BufLeave" + ]; }; indent-blankline = { enable = true; @@ -259,51 +269,55 @@ in { lsp = { enable = true; - keymaps = { diagnostic = { }; }; - enabledServers = [{ - name = "angularls"; - extraOptions = { - cmd = [ - "ngserver" - "--stdio" - "--tsProbeLocations" - "" - "--ngProbeLocations" - "" - ]; - on_new_config = { - __raw = '' - function(new_config, new_root_dir) - new_config.cmd = { - new_root_dir .. "/node_modules/@angular/language-server/bin/ngserver", - "--stdio", - "--tsProbeLocations", - new_root_dir .. "/node_modules", - "--ngProbeLocations", - new_root_dir .. "/node_modules", - } - end - ''; - }; - filetypes = [ - "typescript" - "html" - "typescriptreact" - "typescript.tsx" - "angular" - "html.angular" - ]; - on_attach = { - __raw = '' - function(client, bufnr) - if vim.bo[bufnr].filetype == "html" then - vim.bo[bufnr].filetype = "angular" + keymaps = { + diagnostic = { }; + }; + enabledServers = [ + { + name = "angularls"; + extraOptions = { + cmd = [ + "ngserver" + "--stdio" + "--tsProbeLocations" + "" + "--ngProbeLocations" + "" + ]; + on_new_config = { + __raw = '' + function(new_config, new_root_dir) + new_config.cmd = { + new_root_dir .. "/node_modules/@angular/language-server/bin/ngserver", + "--stdio", + "--tsProbeLocations", + new_root_dir .. "/node_modules", + "--ngProbeLocations", + new_root_dir .. "/node_modules", + } end - end - ''; + ''; + }; + filetypes = [ + "typescript" + "html" + "typescriptreact" + "typescript.tsx" + "angular" + "html.angular" + ]; + on_attach = { + __raw = '' + function(client, bufnr) + if vim.bo[bufnr].filetype == "html" then + vim.bo[bufnr].filetype = "angular" + end + end + ''; + }; }; - }; - }]; + } + ]; servers = { html.enable = true; cssls.enable = true; @@ -323,7 +337,10 @@ in { clangd = { enable = true; - cmd = [ "clangd" "--offset-encoding=utf-16" ]; + cmd = [ + "clangd" + "--offset-encoding=utf-16" + ]; }; nixd.enable = true; @@ -347,16 +364,16 @@ in { end ''; }; - symbolMap = { Copilot = ""; }; + symbolMap = { + Copilot = ""; + }; }; cmp = { enable = true; settings = { mapping = { - "" = - "cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select})"; - "" = - "cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select})"; + "" = "cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select})"; + "" = "cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select})"; "" = "cmp.mapping.confirm({select = true})"; "" = "cmp.mapping.complete()"; }; @@ -372,9 +389,11 @@ in { { name = "nvim_lsp_signature_help"; } { name = "nvim_lsp_document_symbol"; } ]; - formatting.fields = [ "abbr" "kind" ]; - snippet.expand = - "function(args) require('luasnip').lsp_expand(args.body) end"; + formatting.fields = [ + "abbr" + "kind" + ]; + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; window = { completion.border = "rounded"; documentation.border = "rounded"; diff --git a/modules/home-manager/programs/nixvim/keymaps.nix b/modules/home-manager/programs/nixvim/keymaps.nix index 838e781..0be00c4 100644 --- a/modules/home-manager/programs/nixvim/keymaps.nix +++ b/modules/home-manager/programs/nixvim/keymaps.nix @@ -82,8 +82,7 @@ key = "xw"; mode = "n"; lua = true; - action = - "function() require('trouble').toggle('workspace_diagnostics') end"; + action = "function() require('trouble').toggle('workspace_diagnostics') end"; } { key = "xd"; diff --git a/modules/home-manager/services/default.nix b/modules/home-manager/services/default.nix index d5bb27f..adad91d 100644 --- a/modules/home-manager/services/default.nix +++ b/modules/home-manager/services/default.nix @@ -1,4 +1,5 @@ -{ pkgs, homeDirectory, ... }: { +{ pkgs, homeDirectory, ... }: +{ services = { gpg-agent = { enable = true; diff --git a/modules/nixos/boot/quiet.nix b/modules/nixos/boot/quiet.nix index 05fe370..56c9891 100644 --- a/modules/nixos/boot/quiet.nix +++ b/modules/nixos/boot/quiet.nix @@ -2,10 +2,13 @@ with lib; -let cfg = config.boot.quiet; - -in { - options.boot.quiet = { enable = mkEnableOption (mdDoc "Clean, quiet boot"); }; +let + cfg = config.boot.quiet; +in +{ + options.boot.quiet = { + enable = mkEnableOption (mdDoc "Clean, quiet boot"); + }; config = mkIf cfg.enable { boot = { diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 8cf1920..215bb24 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ imports = [ ./boot/quiet.nix diff --git a/modules/nixos/desktops/hyprland.nix b/modules/nixos/desktops/hyprland.nix index c22419f..5481b67 100644 --- a/modules/nixos/desktops/hyprland.nix +++ b/modules/nixos/desktops/hyprland.nix @@ -1,10 +1,17 @@ -{ config, lib, pkgs, username, ... }: +{ + config, + lib, + pkgs, + username, + ... +}: with lib; -let cfg = config.desktops.hyprland; - -in { +let + cfg = config.desktops.hyprland; +in +{ options.desktops.hyprland = { enable = mkEnableOption (mdDoc "Enable a DE based on Hyprland"); }; @@ -12,8 +19,10 @@ in { config = mkIf cfg.enable { xdg.portal = { enable = true; - extraPortals = - [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-kde ]; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-kde + ]; }; services = { diff --git a/modules/nixos/fonts/fira-code.nix b/modules/nixos/fonts/fira-code.nix index 678e316..6adaee5 100644 --- a/modules/nixos/fonts/fira-code.nix +++ b/modules/nixos/fonts/fira-code.nix @@ -1,17 +1,31 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.fonts.fira-code; - -in { +let + cfg = config.fonts.fira-code; +in +{ options.fonts.fira-code = { enable = mkEnableOption "Enable the preset for Fira Code"; stylisticSets = mkOption { type = types.listOf types.str; - description = mdDoc - "[Stylistic sets](https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets) for Fira Code"; - default = - [ "zero" "onum" "ss04" "cv19" "cv23" "ss09" "ss06" "ss07" "ss10" ]; + description = mdDoc "[Stylistic sets](https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets) for Fira Code"; + default = [ + "zero" + "onum" + "ss04" + "cv19" + "cv23" + "ss09" + "ss06" + "ss07" + "ss10" + ]; }; default = mkOption { type = types.bool; @@ -26,10 +40,7 @@ in { nerdfonts.additionalFonts = [ "FiraCode" ]; fontconfig = { defaultFonts.monospace = mkIf cfg.default [ - (if (config.fonts.nerdfonts.enable) then - "Fira Code Nerd Font" - else - "FiraCode") + (if (config.fonts.nerdfonts.enable) then "Fira Code Nerd Font" else "FiraCode") ]; localConf = '' @@ -37,10 +48,7 @@ in { Fira - ${ - lib.concatStringsSep " " - (map (set: "${set}") cfg.stylisticSets) - } + ${lib.concatStringsSep " " (map (set: "${set}") cfg.stylisticSets)} ''; diff --git a/modules/nixos/fonts/nerdfonts.nix b/modules/nixos/fonts/nerdfonts.nix index 9823cec..95b390b 100644 --- a/modules/nixos/fonts/nerdfonts.nix +++ b/modules/nixos/fonts/nerdfonts.nix @@ -1,9 +1,15 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.fonts.nerdfonts; - -in { +let + cfg = config.fonts.nerdfonts; +in +{ options.fonts.nerdfonts = { enable = mkEnableOption "Enable nerdfonts"; additionalFonts = mkOption { @@ -15,12 +21,9 @@ in { config = mkIf cfg.enable { fonts = { - packages = with pkgs; - [ - (nerdfonts.override { - fonts = [ "NerdFontsSymbolsOnly" ] ++ cfg.additionalFonts; - }) - ]; + packages = with pkgs; [ + (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ] ++ cfg.additionalFonts; }) + ]; }; }; } diff --git a/modules/nixos/fonts/noto-sans.nix b/modules/nixos/fonts/noto-sans.nix index 0f54cbf..cb870d1 100644 --- a/modules/nixos/fonts/noto-sans.nix +++ b/modules/nixos/fonts/noto-sans.nix @@ -1,9 +1,15 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.fonts.noto-sans; - -in { +let + cfg = config.fonts.noto-sans; +in +{ options.fonts.noto-sans = { enable = mkEnableOption "Enable the Noto Sans font"; default = mkOption { @@ -15,14 +21,15 @@ in { config = mkIf cfg.enable { fonts = { - packages = with pkgs; [ noto-fonts noto-fonts-cjk noto-fonts-emoji ]; + packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + ]; nerdfonts.additionalFonts = [ "Noto" ]; fontconfig = { defaultFonts.sansSerif = mkIf cfg.default [ - (if (config.fonts.nerdfonts.enable) then - "Noto Sans Nerd Font" - else - "Noto Sans") + (if (config.fonts.nerdfonts.enable) then "Noto Sans Nerd Font" else "Noto Sans") ]; }; }; diff --git a/modules/nixos/hardware/amdgpu.nix b/modules/nixos/hardware/amdgpu.nix index 61592b8..55e544d 100644 --- a/modules/nixos/hardware/amdgpu.nix +++ b/modules/nixos/hardware/amdgpu.nix @@ -1,12 +1,17 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.hardware.amdgpu.preset.default; - -in { +let + cfg = config.hardware.amdgpu.preset.default; +in +{ options.hardware.amdgpu.preset.default = { - enable = - mkEnableOption "Enable ADM GPU driver support with some sane defaults"; + enable = mkEnableOption "Enable ADM GPU driver support with some sane defaults"; }; config = mkIf cfg.enable { @@ -19,7 +24,10 @@ in { boot = { # https://docs.kernel.org/gpu/amdgpu/module-parameters.html - kernelParams = [ "amdgpu.seamless=1" "amdgpu.freesync_video=1" ]; + kernelParams = [ + "amdgpu.seamless=1" + "amdgpu.freesync_video=1" + ]; initrd.kernelModules = [ "amdgpu" ]; }; diff --git a/modules/nixos/hardware/audio.nix b/modules/nixos/hardware/audio.nix index 7b4611a..e5481f5 100644 --- a/modules/nixos/hardware/audio.nix +++ b/modules/nixos/hardware/audio.nix @@ -1,9 +1,15 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.hardware.audio.preset.pipewire; - -in { +let + cfg = config.hardware.audio.preset.pipewire; +in +{ options.hardware.audio.preset.pipewire = { enable = mkEnableOption "Enable pipewire with sane defaults"; }; diff --git a/modules/nixos/hardware/cc1.nix b/modules/nixos/hardware/cc1.nix index 4ffed67..8bbdade 100644 --- a/modules/nixos/hardware/cc1.nix +++ b/modules/nixos/hardware/cc1.nix @@ -1,9 +1,16 @@ -{ pkgs, lib, config, username, ... }: +{ + pkgs, + lib, + config, + username, + ... +}: with lib; -let cfg = config.hardware.cc1; - -in { +let + cfg = config.hardware.cc1; +in +{ options.hardware.cc1 = { enable = mkEnableOption "Enable CC1 optimizations"; layout = mkOption { @@ -19,7 +26,10 @@ in { layout = cfg.layout; extraLayouts.cc1-thea = { description = "A CC1 optimized layout"; - languages = [ "eng" "ger" ]; + languages = [ + "eng" + "ger" + ]; symbolsFile = ./${cfg.layout}; }; }; diff --git a/modules/nixos/hardware/fv43u.nix b/modules/nixos/hardware/fv43u.nix index 3dda095..cf20789 100644 --- a/modules/nixos/hardware/fv43u.nix +++ b/modules/nixos/hardware/fv43u.nix @@ -1,12 +1,18 @@ -{ pkgs, lib, config, username, ... }: +{ + pkgs, + lib, + config, + username, + ... +}: with lib; -let cfg = config.hardware.fv43u; - -in { +let + cfg = config.hardware.fv43u; +in +{ options.hardware.fv43u = { - enable = - mkEnableOption "Enable optimisations for the Gigabyte FV43U monitor"; + enable = mkEnableOption "Enable optimisations for the Gigabyte FV43U monitor"; }; config = mkIf cfg.enable { diff --git a/modules/nixos/hardware/gbmonctl.nix b/modules/nixos/hardware/gbmonctl.nix index 0b9fc12..b7f91cf 100644 --- a/modules/nixos/hardware/gbmonctl.nix +++ b/modules/nixos/hardware/gbmonctl.nix @@ -1,9 +1,15 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.hardware.gbmonctl; - -in { +let + cfg = config.hardware.gbmonctl; +in +{ options.hardware.gbmonctl = { enable = mkOption { type = types.bool; diff --git a/modules/nixos/hardware/nvidia-nouveau.nix b/modules/nixos/hardware/nvidia-nouveau.nix index 2769fb2..c816e02 100644 --- a/modules/nixos/hardware/nvidia-nouveau.nix +++ b/modules/nixos/hardware/nvidia-nouveau.nix @@ -1,12 +1,17 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.hardware.nvidia.preset.nouveau; - -in { +let + cfg = config.hardware.nvidia.preset.nouveau; +in +{ options.hardware.nvidia.preset.nouveau = { - enable = mkEnableOption - "Enable the free Nouveau NVIDIA driver with some sane defaults"; + enable = mkEnableOption "Enable the free Nouveau NVIDIA driver with some sane defaults"; }; config = mkIf cfg.enable { diff --git a/modules/nixos/hardware/nvidia-proprietary.nix b/modules/nixos/hardware/nvidia-proprietary.nix index d1bf6db..66102d2 100644 --- a/modules/nixos/hardware/nvidia-proprietary.nix +++ b/modules/nixos/hardware/nvidia-proprietary.nix @@ -1,12 +1,17 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.hardware.nvidia.preset.proprietary; - -in { +let + cfg = config.hardware.nvidia.preset.proprietary; +in +{ options.hardware.nvidia.preset.proprietary = { - enable = mkEnableOption - "Enable proprietary NVIDIA driver support with some sane defaults"; + enable = mkEnableOption "Enable proprietary NVIDIA driver support with some sane defaults"; }; config = mkIf cfg.enable { @@ -14,16 +19,30 @@ in { enable = true; driSupport = true; driSupport32Bit = true; - extraPackages = with pkgs; [ libvdpau-va-gl nvidia-vaapi-driver ]; + extraPackages = with pkgs; [ + libvdpau-va-gl + nvidia-vaapi-driver + ]; }; services.xserver.videoDrivers = [ "nvidia" ]; - boot.kernelParams = [ "fbdev=1" "nvidia_drm.fbdev=1" ]; - boot.kernelModules = - [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; - boot.initrd.kernelModules = - [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; + boot.kernelParams = [ + "fbdev=1" + "nvidia_drm.fbdev=1" + ]; + boot.kernelModules = [ + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + ]; + boot.initrd.kernelModules = [ + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + ]; hardware.nvidia = { modesetting.enable = true; diff --git a/modules/nixos/hardware/virtual-camera.nix b/modules/nixos/hardware/virtual-camera.nix index 88561a1..629621d 100644 --- a/modules/nixos/hardware/virtual-camera.nix +++ b/modules/nixos/hardware/virtual-camera.nix @@ -1,9 +1,15 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.hardware.virtual-camera; - -in { +let + cfg = config.hardware.virtual-camera; +in +{ options.hardware.virtual-camera = { enable = mkEnableOption "Enable the virtual camera"; }; @@ -11,9 +17,12 @@ in { config = mkIf cfg.enable { boot = { # Virtual Camera/Mic - kernelModules = [ "v4l2loopback" "snd-aloop" "sg" ]; - extraModulePackages = with config.boot.kernelPackages; - [ v4l2loopback.out ]; + kernelModules = [ + "v4l2loopback" + "snd-aloop" + "sg" + ]; + extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback.out ]; extraModprobeConfig = '' options v4l2loopback exclusive_caps=1 card_label="Virtual Camera" ''; diff --git a/modules/nixos/locales/theaninova.nix b/modules/nixos/locales/theaninova.nix index 83b689a..2bab4b1 100644 --- a/modules/nixos/locales/theaninova.nix +++ b/modules/nixos/locales/theaninova.nix @@ -1,9 +1,15 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; -let cfg = config.locale.preset.theaninova; - -in { +let + cfg = config.locale.preset.theaninova; +in +{ options.locale.preset.theaninova = { enable = mkEnableOption "Enable the locale preset for Theaninova"; }; diff --git a/modules/nixos/services/airprint.nix b/modules/nixos/services/airprint.nix index bbf5564..9e5c9ad 100644 --- a/modules/nixos/services/airprint.nix +++ b/modules/nixos/services/airprint.nix @@ -1,9 +1,16 @@ -{ pkgs, lib, config, username, ... }: +{ + pkgs, + lib, + config, + username, + ... +}: with lib; -let cfg = config.services.airprint; - -in { +let + cfg = config.services.airprint; +in +{ options.services.airprint = { enable = mkEnableOption "Enable printing over the air using sane and avahi"; }; @@ -19,6 +26,9 @@ in { nssmdns4 = true; openFirewall = true; }; - users.users.${username}.extraGroups = [ "lp" "scanner" ]; + users.users.${username}.extraGroups = [ + "lp" + "scanner" + ]; }; } diff --git a/overlays/cura/default.nix b/overlays/cura/default.nix index 742a92b..bcdbb5f 100644 --- a/overlays/cura/default.nix +++ b/overlays/cura/default.nix @@ -1,10 +1,13 @@ -{ lib, appimageTools, fetchurl }: +{ + lib, + appimageTools, + fetchurl, +}: appimageTools.wrapType2 rec { name = "cura"; version = "5.6.0"; src = fetchurl { - url = - "https://github.com/Ultimaker/Cura/releases/download/${version}/UltiMaker-Cura-${version}-linux-X64.AppImage"; + url = "https://github.com/Ultimaker/Cura/releases/download/${version}/UltiMaker-Cura-${version}-linux-X64.AppImage"; hash = "sha256-EHiWoNpLKHPzv6rZrtNgEr7y//iVcRYeV/TaCn8QpEA="; }; } diff --git a/overlays/darkman/default.nix b/overlays/darkman/default.nix index fa5cb26..4a00317 100644 --- a/overlays/darkman/default.nix +++ b/overlays/darkman/default.nix @@ -1,4 +1,11 @@ -{ lib, scdoc, buildGoModule, fetchFromGitLab, hidapi, udev, }: +{ + lib, + scdoc, + buildGoModule, + fetchFromGitLab, + hidapi, + udev, +}: buildGoModule rec { pname = "darkman"; version = "1.5.4"; @@ -36,8 +43,7 @@ buildGoModule rec { ''; meta = with lib; { - description = - "Framework for dark-mode and light-mode transitions on Linux desktop"; + description = "Framework for dark-mode and light-mode transitions on Linux desktop"; homepage = "https://gitlab.com/WhyNotHugo/darkman"; license = licenses.isc; maintainers = [ maintainers.ajgrf ]; diff --git a/overlays/gbmonctl/default.nix b/overlays/gbmonctl/default.nix index 765bc5e..91a5645 100644 --- a/overlays/gbmonctl/default.nix +++ b/overlays/gbmonctl/default.nix @@ -1,4 +1,11 @@ -{ lib, pkgs, buildGoModule, fetchFromGitHub, hidapi, udev, }: +{ + lib, + pkgs, + buildGoModule, + fetchFromGitHub, + hidapi, + udev, +}: buildGoModule rec { pname = "gbmonctl"; version = "1d01a090"; @@ -9,15 +16,17 @@ buildGoModule rec { hash = "sha256-KeBdGtQWz9TBmk1HdXlkIs2r2aZ+EO8WhNaGbsFBBR8="; }; vendorHash = "sha256-cEqpEaX4eJ/6um9qbw/kzg9/vesOWmdiHzZ7IodVV9c="; - buildInputs = [ hidapi udev ]; + buildInputs = [ + hidapi + udev + ]; postInstall = '' mkdir -p $out/bin $out/lib/udev/rules.d echo 'KERNEL=="hidraw*", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="1100", MODE="0666", TAG+="uaccess"' \ > $out/lib/udev/rules.d/99-gigabyte-monitor.rules ''; meta = with lib; { - description = - "A CLI tool to change monitor settings over USB to the Gigabyte M32U"; + description = "A CLI tool to change monitor settings over USB to the Gigabyte M32U"; homepage = "https://github.com/kelvie/gbmonctl"; }; } diff --git a/overlays/lpc21isp/default.nix b/overlays/lpc21isp/default.nix index cffd3ee..a348b4b 100644 --- a/overlays/lpc21isp/default.nix +++ b/overlays/lpc21isp/default.nix @@ -1,4 +1,9 @@ -{ stdenv, fetchFromGitHub, glibc, lib, }: +{ + stdenv, + fetchFromGitHub, + glibc, + lib, +}: stdenv.mkDerivation { name = "lpc21isp"; src = fetchFromGitHub { @@ -13,8 +18,7 @@ stdenv.mkDerivation { cp lpc21isp $out/bin ''; meta = with lib; { - description = - "Portable command line ISP for NXP LPC family and Analog Devices ADUC70xx"; + description = "Portable command line ISP for NXP LPC family and Analog Devices ADUC70xx"; homepage = "https://github.com/capiman/lpc21isp"; license = licenses.lgpl3Plus; maintainers = [ maintainers.theaninova ];