From 3ca8c5e218a05df15e07adf05904bf67642e6f5a Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Fri, 18 Apr 2025 09:37:57 +0200 Subject: [PATCH] Formatting --- modules/fcitx5.nix | 13 +++-- modules/graphics.nix | 10 ++-- modules/kernel.nix | 6 ++- modules/nix-settings.nix | 11 ++-- modules/prometheus.nix | 11 ++-- modules/services.nix | 108 +++++++++++++++++++++------------------ modules/vim.nix | 77 +++++++++++++++------------- modules/xconfig.nix | 20 +++++--- modules/zsh.nix | 8 +-- 9 files changed, 156 insertions(+), 108 deletions(-) diff --git a/modules/fcitx5.nix b/modules/fcitx5.nix index c57cfe5..f62f1bf 100644 --- a/modules/fcitx5.nix +++ b/modules/fcitx5.nix @@ -1,7 +1,14 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; -let cfg = config.voidconf.fcitx5; -in { +let + cfg = config.voidconf.fcitx5; +in +{ options.voidconf.fcitx5 = { enable = mkEnableOption "Enables fcitx5 input method engine and mozc en anthy methods"; }; diff --git a/modules/graphics.nix b/modules/graphics.nix index 2e93111..27e3e9c 100644 --- a/modules/graphics.nix +++ b/modules/graphics.nix @@ -1,8 +1,10 @@ { lib, config, ... }: with lib; -let cfg = config.voidconf.graphics; -in { - options.voidconf.graphics ={ +let + cfg = config.voidconf.graphics; +in +{ + options.voidconf.graphics = { defaultSettings.enable = mkEnableOption "Enables some basic graphical settings"; nvidia = { enable = mkEnableOption "Enables Nvidia settings"; @@ -25,6 +27,6 @@ in { nvidiaSettings = cfg.nvidia.proprietaryDrivers; }; }; - services.xserver.videoDrivers = mkIf cfg.nvidia.proprietaryDrivers ["nvidia"]; + services.xserver.videoDrivers = mkIf cfg.nvidia.proprietaryDrivers [ "nvidia" ]; }; } diff --git a/modules/kernel.nix b/modules/kernel.nix index dbd81b5..24c97ec 100644 --- a/modules/kernel.nix +++ b/modules/kernel.nix @@ -1,7 +1,9 @@ { lib, config, ... }: with lib; -let cfg = config.voidconf.kernelTweaks; -in { +let + cfg = config.voidconf.kernelTweaks; +in +{ options.voidconf.kernelTweaks = { enable = mkEnableOption "Enables kernel tweaks"; }; diff --git a/modules/nix-settings.nix b/modules/nix-settings.nix index e58f5c7..3e8f3a9 100644 --- a/modules/nix-settings.nix +++ b/modules/nix-settings.nix @@ -1,7 +1,9 @@ { lib, config, ... }: with lib; -let cfg = config.voidconf.nixSettings; -in { +let + cfg = config.voidconf.nixSettings; +in +{ options.voidconf.nixSettings = { gc = { automatic = mkOption { @@ -36,7 +38,10 @@ in { automatic = cfg.gc.automatic; dates = cfg.gc.dates; }; - settings.experimental-features = [ "flakes" "nix-command" ]; + settings.experimental-features = [ + "flakes" + "nix-command" + ]; }; }; } diff --git a/modules/prometheus.nix b/modules/prometheus.nix index d748a4f..00e000b 100644 --- a/modules/prometheus.nix +++ b/modules/prometheus.nix @@ -1,7 +1,9 @@ { lib, config, ... }: with lib; -let cfg = config.voidconf.prometheus; -in { +let + cfg = config.voidconf.prometheus; +in +{ options.voidconf.prometheus = { enable = mkEnableOption "Enable prometheus node"; }; @@ -10,7 +12,10 @@ in { exporters = { node = { enable = true; - enabledCollectors = [ "systemd" "cpu" ]; + enabledCollectors = [ + "systemd" + "cpu" + ]; port = 9002; }; }; diff --git a/modules/services.nix b/modules/services.nix index 7d65185..8be763f 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -1,7 +1,14 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; -let cfg = config.voidconf.services; -in { +let + cfg = config.voidconf.services; +in +{ options.voidconf.services = { flatpak = { @@ -26,7 +33,7 @@ in { }; config = { -# flatpak + # flatpak xdg.portal = mkIf cfg.flatpak.enable { enable = true; @@ -35,66 +42,69 @@ in { config.common.default = "*"; }; -# ssh + # ssh agent - programs.ssh = mkIf cfg.ssh.enable { - startAgent = true; - }; + programs.ssh = mkIf cfg.ssh.enable { + startAgent = true; + }; - services = { + services = { -# flatpak + # flatpak - flatpak.enable = cfg.flatpak.enable; + flatpak.enable = cfg.flatpak.enable; -# yggdrasil + # yggdrasil - yggdrasil = mkIf cfg.yggdrasil.enable { - enable = true; - persistentKeys = cfg.yggdrasil.persistentKeys; - settings = { - Peers = [ - "tls://109.107.173.235:9111" - "tls://94.103.82.150:8080" - "tcp://vpn.itrus.su:7991" - "tls://45.147.198.155:6010" - "tcp://ygg-nl.incognet.io:8883" - "tls://ygg-nl.incognet.io:8884" - "tls://23.137.249.65:443" - "tls://aaoth.xyz:25565" - "tcp://aaoth.xyz:7777" - "tls://23.137.251.45:5222" - "tls://x-ams-0.sergeysedoy97.ru:65535" - "tls://s-ams-0.sergeysedoy97.ru:65535" - "tls://89.22.237.91:65535" - "tls://[2a0d:8480:1:f9::]:65535" - "tls://x-ams-1.sergeysedoy97.ru:65535" - "tls://s-ams-1.sergeysedoy97.ru:65535" - "tls://79.137.194.94:65535" - ]; - }; - }; - openssh = mkIf cfg.ssh.enable { - enable = true; - settings = { - PasswordAuthentication = cfg.ssh.passwordLogin; - }; + yggdrasil = mkIf cfg.yggdrasil.enable { + enable = true; + persistentKeys = cfg.yggdrasil.persistentKeys; + settings = { + Peers = [ + "tls://109.107.173.235:9111" + "tls://94.103.82.150:8080" + "tcp://vpn.itrus.su:7991" + "tls://45.147.198.155:6010" + "tcp://ygg-nl.incognet.io:8883" + "tls://ygg-nl.incognet.io:8884" + "tls://23.137.249.65:443" + "tls://aaoth.xyz:25565" + "tcp://aaoth.xyz:7777" + "tls://23.137.251.45:5222" + "tls://x-ams-0.sergeysedoy97.ru:65535" + "tls://s-ams-0.sergeysedoy97.ru:65535" + "tls://89.22.237.91:65535" + "tls://[2a0d:8480:1:f9::]:65535" + "tls://x-ams-1.sergeysedoy97.ru:65535" + "tls://s-ams-1.sergeysedoy97.ru:65535" + "tls://79.137.194.94:65535" + ]; }; }; -# i2p container + # ssh daemon + + openssh = mkIf cfg.ssh.enable { + enable = true; + settings = { + PasswordAuthentication = cfg.ssh.passwordLogin; + }; + }; + }; + + # i2p container containers.i2pd-container = mkIf cfg.i2p.enable { autoStart = cfg.i2p.autoStart; config = { system.stateVersion = "23.11"; # Did you read the comment? - networking.firewall.allowedTCPPorts = [ - 7656 - 7070 - 4447 - 4444 - ]; + networking.firewall.allowedTCPPorts = [ + 7656 + 7070 + 4447 + 4444 + ]; services.i2pd = { enable = true; diff --git a/modules/vim.nix b/modules/vim.nix index b01de61..8095ade 100644 --- a/modules/vim.nix +++ b/modules/vim.nix @@ -1,7 +1,14 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; -let cfg = config.voidconf.vim; -in { +let + cfg = config.voidconf.vim; +in +{ options.voidconf.vim = { enable = mkEnableOption "Enables opinionated vim configuration"; enableNvim = mkEnableOption "Enables neovim and alias"; @@ -9,7 +16,7 @@ in { type = types.bool; default = true; description = '' - Set 'vim' as $EDITOR + Set 'vim' as $EDITOR ''; }; }; @@ -26,37 +33,37 @@ in { (mkIf cfg.enableNvim (neovim.override { vimAlias = true; })) - ((vim_configurable.override { }).customize { - name = "vim"; - vimrcConfig = { - packages.myplugs = with pkgs.vimPlugins; { - start = [ vim-nix ]; - opt = []; - }; - customRC = '' - syntax on - set nocompatible - set ignorecase - set hlsearch - set incsearch - set autoindent - set smartindent - set wildmenu - set expandtab - set shiftwidth=4 - set tabstop=4 - set number - set relativenumber - set mouse= - set listchars=tab:│\ ,trail:· - set list - set scrolloff=3 - set notimeout - set backspace=2 - au FileType nix setlocal shiftwidth=2 tabstop=2 expandtab - au FileType haskell,tex setlocal shiftwidth=4 tabstop=4 expandtab - ''; - }; + ((vim_configurable.override { }).customize { + name = "vim"; + vimrcConfig = { + packages.myplugs = with pkgs.vimPlugins; { + start = [ vim-nix ]; + opt = [ ]; + }; + customRC = '' + syntax on + set nocompatible + set ignorecase + set hlsearch + set incsearch + set autoindent + set smartindent + set wildmenu + set expandtab + set shiftwidth=4 + set tabstop=4 + set number + set relativenumber + set mouse= + set listchars=tab:│\ ,trail:· + set list + set scrolloff=3 + set notimeout + set backspace=2 + au FileType nix setlocal shiftwidth=2 tabstop=2 expandtab + au FileType haskell,tex setlocal shiftwidth=4 tabstop=4 expandtab + ''; + }; }) ]; }; diff --git a/modules/xconfig.nix b/modules/xconfig.nix index fcf880c..2ddcfba 100644 --- a/modules/xconfig.nix +++ b/modules/xconfig.nix @@ -1,7 +1,9 @@ { config, lib, ... }: with lib; -let cfg = config.voidconf.xconfig; -in { +let + cfg = config.voidconf.xconfig; +in +{ options.voidconf.xconfig = { enable = mkEnableOption "Enables opinionated xorg config"; @@ -12,7 +14,10 @@ in { enableProperConfig = mkEnableOption "Enable the touchpad settings"; accelProfile = mkOption { - type = types.enum [ "flat" "adaptive" ]; + type = types.enum [ + "flat" + "adaptive" + ]; default = "adaptive"; example = "flat"; description = '' @@ -23,11 +28,14 @@ in { }; mouse.accelProfile = mkOption { - type = types.enum [ "flat" "adaptive" ]; + type = types.enum [ + "flat" + "adaptive" + ]; default = "flat"; example = "adaptive"; description = '' - Use addaptive on trackball and touchpad; and flat on any normal mouse. + Use addaptive on trackball and touchpad; and flat on any normal mouse. ''; }; @@ -36,7 +44,7 @@ in { default = ./images/city.png; type = types.path; description = '' - Display manager background. + Display manager background. ''; }; diff --git a/modules/zsh.nix b/modules/zsh.nix index 4706e8f..f30097e 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -1,7 +1,9 @@ { config, lib, ... }: with lib; -let cfg = config.voidconf.zsh; -in { +let + cfg = config.voidconf.zsh; +in +{ options.voidconf.zsh = { enable = mkEnableOption "Enables opinionated zsh configuration"; skim.enable = mkEnableOption "Enables skim support for shell history"; @@ -10,7 +12,7 @@ in { default = "fg=magenta,bg=black,bold,underline"; description = '' Colors for zsh autosuggestions. Check the documentation for more info. - ''; + ''; }; }; config = mkIf cfg.enable {