diff --git a/flake.nix b/flake.nix index da68564..1a77024 100644 --- a/flake.nix +++ b/flake.nix @@ -17,8 +17,6 @@ ./modules/prometheus.nix ./modules/kernel.nix ./modules/fcitx5.nix - ./modules/programs.nix - ./modules/bluetooth.nix ]; }; diff --git a/modules/audio.nix b/modules/audio.nix index 2d190c1..376af77 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,13 +1,12 @@ { lib, config, ... }: with lib; -let - cfg = config.voidconf.audio; -in -{ +let cfg = config.voidconf.audio; +in { options.voidconf.audio = { enable = mkEnableOption "Enable all the audio daemons"; }; config = mkIf cfg.enable { + sound.enable = true; hardware.pulseaudio.enable = false; services.pipewire = { enable = true; diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix deleted file mode 100644 index 8e940f0..0000000 --- a/modules/bluetooth.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -with lib; -let - cfg = config.voidconf.bluetooth; -in -{ - options.voidconf.bluetooth = { - enable = mkEnableOption "Enables bluetooth tools"; - }; - config = mkIf cfg.enable { - - hardware.bluetooth = { - enable = true; - }; - - services.blueman = { - enable = true; - }; - environment.systemPackages = with pkgs; [ - bluez - ]; - }; -} diff --git a/modules/fcitx5.nix b/modules/fcitx5.nix index f62f1bf..bb1c4c0 100644 --- a/modules/fcitx5.nix +++ b/modules/fcitx5.nix @@ -1,25 +1,21 @@ -{ - 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"; }; config = mkIf cfg.enable { - i18n.inputMethod = { - enable = true; - type = "fcitx5"; - fcitx5.addons = with pkgs; [ - fcitx5-mozc - fcitx5-anthy - ]; + i18n = { + inputMethod = { + enabled = "fcitx5"; + fcitx5 = { + addons = with pkgs; [ + fcitx5-mozc + fcitx5-anthy + ]; + }; + }; }; }; } diff --git a/modules/font.nix b/modules/font.nix index 02b62bb..b06190b 100644 --- a/modules/font.nix +++ b/modules/font.nix @@ -1,14 +1,7 @@ -{ - pkgs, - config, - lib, - ... -}: +{ pkgs, config, lib, ... }: with lib; -let - cfg = config.voidconf.fontConfig; -in -{ +let cfg = config.voidconf.fontConfig; +in { options.voidconf.fontConfig = { enable = mkEnableOption "Enable opinionated font configuration"; joyPixels = mkEnableOption "Enables the JoyPixels font"; @@ -17,8 +10,7 @@ in fonts = { fontDir.enable = true; packages = with pkgs; [ - # nerdfonts.iosevka - # nerdfonts.fira-code + (nerdfonts.override { fonts = [ "FiraCode" "Iosevka" ]; }) baekmuk-ttf blackout bqn386 @@ -37,13 +29,10 @@ in noto-fonts-emoji noto-fonts-cjk-sans noto-fonts-cjk-serif - orbitron prociono ubuntu_font_family uiua386 vollkorn - work-sans - the-neue-black ]; fontconfig = { enable = true; @@ -67,17 +56,14 @@ in "Noto Color Emoji" ]; monospace = [ - "JetBrains Mono" "Fira Code" + "JetBrains Mono" "Iosevka" "IPAGothic" "Baekmuk Dotum" "Noto Color Emoji" ]; - emoji = [ - "Noto Color Emoji" - (mkIf cfg.joyPixels "JoyPixels") - ]; + emoji = [ "Noto Color Emoji" (mkIf cfg.joyPixels "JoyPixels") ]; }; localConf = '' diff --git a/modules/graphics.nix b/modules/graphics.nix index 27e3e9c..1c5c6e9 100644 --- a/modules/graphics.nix +++ b/modules/graphics.nix @@ -1,10 +1,8 @@ { 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"; @@ -13,9 +11,10 @@ in }; config = { hardware = { - graphics = { + opengl = { enable = true; - enable32Bit = true; + driSupport = true; + driSupport32Bit = true; }; nvidia = mkIf cfg.nvidia.enable { package = config.boot.kernelPackages.nvidiaPackages.stable; @@ -27,6 +26,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 24c97ec..dbd81b5 100644 --- a/modules/kernel.nix +++ b/modules/kernel.nix @@ -1,9 +1,7 @@ { 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 3e8f3a9..e58f5c7 100644 --- a/modules/nix-settings.nix +++ b/modules/nix-settings.nix @@ -1,9 +1,7 @@ { lib, config, ... }: with lib; -let - cfg = config.voidconf.nixSettings; -in -{ +let cfg = config.voidconf.nixSettings; +in { options.voidconf.nixSettings = { gc = { automatic = mkOption { @@ -38,10 +36,7 @@ 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/programs.nix b/modules/programs.nix deleted file mode 100644 index a17c7e7..0000000 --- a/modules/programs.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.voidconf.programs; -in -{ - options.voidconf.programs = { - gnupg = { - enable = mkEnableOption "Enables basic GnuPG configuration"; - pinentryPackage = mkOption { - default = pkgs.pinentry-qt; - }; - }; - }; - config = { - programs = { - - # gpg - gnupg.agent = mkIf cfg.gnupg.enable { - enable = true; - pinentryPackage = pkgs.pinentry-qt; - }; - - }; - }; -} diff --git a/modules/prometheus.nix b/modules/prometheus.nix index 00e000b..d748a4f 100644 --- a/modules/prometheus.nix +++ b/modules/prometheus.nix @@ -1,9 +1,7 @@ { lib, config, ... }: with lib; -let - cfg = config.voidconf.prometheus; -in -{ +let cfg = config.voidconf.prometheus; +in { options.voidconf.prometheus = { enable = mkEnableOption "Enable prometheus node"; }; @@ -12,10 +10,7 @@ in exporters = { node = { enable = true; - enabledCollectors = [ - "systemd" - "cpu" - ]; + enabledCollectors = [ "systemd" "cpu" ]; port = 9002; }; }; diff --git a/modules/services.nix b/modules/services.nix index 8be763f..7d65185 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -1,14 +1,7 @@ -{ - config, - lib, - pkgs, - ... -}: +{ config, lib, pkgs, ... }: with lib; -let - cfg = config.voidconf.services; -in -{ +let cfg = config.voidconf.services; +in { options.voidconf.services = { flatpak = { @@ -33,7 +26,7 @@ in }; config = { - # flatpak +# flatpak xdg.portal = mkIf cfg.flatpak.enable { enable = true; @@ -42,69 +35,66 @@ in config.common.default = "*"; }; - # ssh agent +# ssh - 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" - ]; + 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; + }; }; }; - # ssh daemon - - openssh = mkIf cfg.ssh.enable { - enable = true; - settings = { - PasswordAuthentication = cfg.ssh.passwordLogin; - }; - }; - }; - - # i2p container +# 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 8095ade..b01de61 100644 --- a/modules/vim.nix +++ b/modules/vim.nix @@ -1,14 +1,7 @@ -{ - 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"; @@ -16,7 +9,7 @@ in type = types.bool; default = true; description = '' - Set 'vim' as $EDITOR + Set 'vim' as $EDITOR ''; }; }; @@ -33,37 +26,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 2ddcfba..ea080b4 100644 --- a/modules/xconfig.nix +++ b/modules/xconfig.nix @@ -1,9 +1,7 @@ { 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"; @@ -14,10 +12,7 @@ in enableProperConfig = mkEnableOption "Enable the touchpad settings"; accelProfile = mkOption { - type = types.enum [ - "flat" - "adaptive" - ]; + type = types.enum [ "flat" "adaptive" ]; default = "adaptive"; example = "flat"; description = '' @@ -28,14 +23,11 @@ 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. ''; }; @@ -44,7 +36,7 @@ in default = ./images/city.png; type = types.path; description = '' - Display manager background. + Display manager background. ''; }; @@ -81,10 +73,7 @@ in autoRepeatInterval = 16; windowManager = { windowmaker.enable = true; - xmonad = { - enable = true; - extraPackages = h: with h; [ xmonad-contrib ]; - }; + xmonad.enable = true; }; displayManager.lightdm = { enable = cfg.lightdm.enable; diff --git a/modules/zsh.nix b/modules/zsh.nix index f30097e..4706e8f 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -1,9 +1,7 @@ { 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"; @@ -12,7 +10,7 @@ in default = "fg=magenta,bg=black,bold,underline"; description = '' Colors for zsh autosuggestions. Check the documentation for more info. - ''; + ''; }; }; config = mkIf cfg.enable {