diff --git a/flake.nix b/flake.nix index 5973f150..9f47caee 100644 --- a/flake.nix +++ b/flake.nix @@ -64,12 +64,6 @@ i18n.defaultLocale = "en_US.UTF-8"; # Sane config for the package manager. - nix.gc = { - automatic = true; - dates = "monthly"; - options = "--delete-older-than 2w"; - }; - # TODO: Remove this after nix-command and flakes has been considered stable. # # Since we're using flakes to make this possible, we need it. diff --git a/modules/home-manager/alacritty.nix b/modules/home-manager/alacritty.nix deleted file mode 100644 index b04e4ca0..00000000 --- a/modules/home-manager/alacritty.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, options, lib, pkgs, ... }: - -let - cfg = config.modules.alacritty; -in -{ - options.modules.alacritty.enable = lib.mkEnableOption "Enable Alacritty config"; - - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ alacritty ]; - xdg.configFile."alacritty" = { - source = ../config/alacritty; - recursive = true; - }; - }; -} diff --git a/modules/home-manager/desktop.nix b/modules/home-manager/desktop.nix index 6b2ae023..fcfda384 100644 --- a/modules/home-manager/desktop.nix +++ b/modules/home-manager/desktop.nix @@ -1,14 +1,13 @@ # Enables all of my usual setup for desktop-oriented stuff. { config, options, lib, pkgs, ... }: -let - cfg = config.modules.desktop; -in -{ +let cfg = config.modules.desktop; +in { options.modules.desktop = { - enable = lib.mkEnableOption "Enable installations of desktop apps."; - graphics.enable = lib.mkEnableOption "Install graphics-related apps."; - audio.enable = lib.mkEnableOption "Install audio-related apps."; + enable = lib.mkEnableOption "installations of desktop apps"; + graphics.enable = + lib.mkEnableOption "installations of graphics-related apps"; + audio.enable = lib.mkEnableOption "installations of audio-related apps"; }; config = lib.mkIf cfg.enable (lib.mkMerge [ @@ -39,7 +38,7 @@ in services.easyeffects.enable = true; services.fluidsynth = { enable = true; - soundServices = "pipewire-pulse"; + soundService = "pipewire-pulse"; }; }) ]); diff --git a/modules/home-manager/dev.nix b/modules/home-manager/dev.nix index f6cd45e6..02a526fc 100644 --- a/modules/home-manager/dev.nix +++ b/modules/home-manager/dev.nix @@ -1,45 +1,42 @@ { config, options, lib, pkgs, ... }: -let - cfg = config.modules.dev; -in - { - options.modules.dev = { - enable = lib.mkEnableOption "Enable my user-specific development setup."; - shell.enable = lib.mkEnableOption "Configures my shell of choice."; - }; +let cfg = config.modules.dev; +in { + options.modules.dev = { + enable = lib.mkEnableOption "myy user-specific development setup"; + shell.enable = + lib.mkEnableOption "configuration of foo-dogsquared's shell of choice"; + }; - config = lib.mkIf cfg.enable (lib.mkMerge [ - ({ - home.packages = with pkgs; [ - neovim # My text editor of choice. - lazygit # Git interface for the lazy. - fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception. - gopass # An improved version of the password manager for hipsters. - perl534Packages.vidir # Bulk rename for your organizing needs. - zellij # A modern tmux? - lf # File manager in the terminal, really. + config = lib.mkIf cfg.enable (lib.mkMerge [ + ({ + home.packages = with pkgs; [ + neovim # My text editor of choice. + lazygit # Git interface for the lazy. + fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception. + gopass # An improved version of the password manager for hipsters. + perl534Packages.vidir # Bulk rename for your organizing needs. + zellij # A modern tmux? + lf # File manager in the terminal, really. - # Coreutils replacement. - fd # Oh nice, a more reliable `find`. - ripgrep # On nice, a more reliable `grep`. - exa # Oh nice, a shinier `ls`. - bat # dog > bat > cat - ]; - }) + # Coreutils replacement. + fd # Oh nice, a more reliable `find`. + ripgrep # On nice, a more reliable `grep`. + exa # Oh nice, a shinier `ls`. + bat # dog > bat > cat + ]; + }) - (lib.mkIf cfg.shell.enable { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - programs.zoxide.enable = true; - programs.starship = { - enable = true; - settings = { - add_newline = false; - }; - }; - }) - ]); + (lib.mkIf cfg.shell.enable { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + programs.zoxide.enable = true; + programs.starship = { + enable = true; + settings = { add_newline = false; }; + }; + }) + ]); } diff --git a/modules/home-manager/i18n.nix b/modules/home-manager/i18n.nix index f90129e4..260532a3 100644 --- a/modules/home-manager/i18n.nix +++ b/modules/home-manager/i18n.nix @@ -1,21 +1,30 @@ +# Instant setup for using internationalized languages. { config, options, lib, pkgs, ... }: -let - cfg = config.modules.i18n; -in - { - options.modules.i18n.enable = lib.mkEnableOption "Enable fcitx5 as input method engine."; +let cfg = config.modules.i18n; +in { + options.modules.i18n.enable = + lib.mkEnableOption "fcitx5 as input method engine"; - config = lib.mkIf cfg.enable { - i18n.inputMethod = { - enabled = "fcitx5"; - fcitx5.addons = with pkgs; [ - fcitx5-gtk # Add support for GTK-based programs. - libsForQt5.fcitx5-qt # Add support for QT-based programs. - fcitx5-lua # Add Lua support. - fcitx5-rime # Chinese input addon. - fcitx5-mozc # Japanese input addon. - ]; - }; + config = lib.mkIf cfg.enable { + fonts.fontconfig.enable = true; + + home.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-extra + noto-fonts-emoji + ]; + + i18n.inputMethod = { + enabled = "fcitx5"; + fcitx5.addons = with pkgs; [ + fcitx5-gtk # Add support for GTK-based programs. + libsForQt5.fcitx5-qt # Add support for QT-based programs. + fcitx5-lua # Add Lua support. + fcitx5-rime # Chinese input addon. + fcitx5-mozc # Japanese input addon. + ]; }; - } + }; +} diff --git a/modules/home-manager/research.nix b/modules/home-manager/research.nix index 08793045..2c2017d9 100644 --- a/modules/home-manager/research.nix +++ b/modules/home-manager/research.nix @@ -1,14 +1,16 @@ { config, options, lib, pkgs, ... }: -let - cfg = config.modules.research; +let cfg = config.modules.research; in { - options.modules.tools.enable = lib.mkEnableOptions "Enable my usual toolbelt for research."; + options.modules.research.enable = + lib.mkEnableOption "my usual toolbelt for research"; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ - archivebox # The ultimate archiving solution! + archivebox # The ultimate archiving solution created by a pirate! curl # The general purpose downloader. + fanficfare # It's for the badly written fanfics. + internetarchive # All of the potential vintage collection of questionable materials at your fingertips. newsboat # Reading news easily on the command line? qbittorrent # The pirate's toolkit for downloading Linux ISOs. zotero # It's actually good at archiving despite not being a researcher myself. diff --git a/modules/nixos/agenix.nix b/modules/nixos/agenix.nix index ec37c1d2..6c52349f 100644 --- a/modules/nixos/agenix.nix +++ b/modules/nixos/agenix.nix @@ -1,10 +1,10 @@ # A module that automates setting up agenix for your system. -{ inputs, lib, options, config, ... }: +{ inputs, lib, options, config, system, ... }: let cfg = config.modules.agenix; in { options.modules.agenix.enable = - lib.mkEnableOption "Automate agenix-related config on your system"; + lib.mkEnableOption "agenix-related config on your system"; imports = [ inputs.agenix.nixosModules.age ]; config = lib.mkIf cfg.enable { diff --git a/modules/nixos/archiving.nix b/modules/nixos/archiving.nix index 99191a23..76fa8bb8 100644 --- a/modules/nixos/archiving.nix +++ b/modules/nixos/archiving.nix @@ -4,7 +4,7 @@ let cfg = config.modules.archiving; in { options.modules.archiving.enable = - lib.mkEnableOption "Install and configure archiving tools."; + lib.mkEnableOption "installation of various archiving tools"; # This is not going to set BorgBackup NixOS services for you. # Please do it for host-specific configs instead. diff --git a/modules/nixos/desktop.nix b/modules/nixos/desktop.nix index 081f9790..be2ff6f5 100644 --- a/modules/nixos/desktop.nix +++ b/modules/nixos/desktop.nix @@ -6,13 +6,14 @@ let cfg = config.modules.desktop; in { options.modules.desktop = { - enable = lib.mkEnableOption - "Enables all desktop-related services and default programs."; - audio.enable = lib.mkEnableOption - "Enables all desktop audio-related services such as Pipewire."; - fonts.enable = lib.mkEnableOption "Enables font-related config."; - hardware.enable = lib.mkEnableOption - "Enables the common hardware-related configuration."; + enable = + lib.mkEnableOption "all desktop-related services and default programs"; + audio.enable = + lib.mkEnableOption "all desktop audio-related services such as Pipewire"; + fonts.enable = lib.mkEnableOption "font-related configuration"; + hardware.enable = + lib.mkEnableOption "the common hardware-related configuration"; + cleanup.enable = lib.mkEnableOption "activation of cleanup services"; }; config = lib.mkIf cfg.enable (lib.mkMerge [ @@ -100,5 +101,36 @@ in { # Welp, this is surprising... services.printing.enable = true; }) + + (lib.mkIf cfg.cleanup.enable { + # Weekly garbage collection of Nix store. + nix.gc = { + automatic = true; + persistent = true; + dates = "weekly"; + options = "--delete-older-than 21d"; + }; + + # Clear logs that are more than a month old weekly. + systemd = { + services.clean-log = { + description = "Weekly log cleanup"; + documentation = [ "man:journalctl(1)" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.systemd}/bin/journalctl --vacuum-time=30d"; + }; + }; + + timers.clean-log = { + description = "Weekly log cleanup"; + documentation = [ "man:journalctl(1)" ]; + timerConfig = { + OnCalendar = "weekly"; + Persistent = true; + }; + }; + }; + }) ]); } diff --git a/modules/nixos/dev.nix b/modules/nixos/dev.nix index 18652f8f..37389652 100644 --- a/modules/nixos/dev.nix +++ b/modules/nixos/dev.nix @@ -6,11 +6,11 @@ let cfg = config.modules.dev; in { options.modules.dev = { enable = lib.mkEnableOption - "Configures my barebones requirement for a development environment."; - shell.enable = - lib.mkEnableOption "Installs of the shell utilities I rely on."; - virtualization.enable = lib.mkEnableOption - "Configures my virtualization-related stuff for my development. (I sometimes have to use these.)"; + "configurations of foo-dogsquared's barebones requirement for a development environment."; + shell.enable = lib.mkEnableOption + "installation of the shell utilities foo-dogsquared rely on"; + virtualization.enable = + lib.mkEnableOption "virtualization-related stuff for development"; }; config = lib.mkIf cfg.enable (lib.mkMerge [ diff --git a/modules/nixos/editors.nix b/modules/nixos/editors.nix index bae222ab..a19dbe4f 100644 --- a/modules/nixos/editors.nix +++ b/modules/nixos/editors.nix @@ -4,8 +4,8 @@ let cfg = config.modules.editors; in { options.modules.editors = { - neovim.enable = lib.mkEnableOption "Enable Neovim and its components"; - vscode.enable = lib.mkEnableOption "Enable Visual Studio Code"; + neovim.enable = lib.mkEnableOption "Neovim and its components"; + vscode.enable = lib.mkEnableOption "Visual Studio Code"; }; config = lib.mkMerge [ @@ -15,6 +15,9 @@ in { defaultEditor = true; withNodeJs = true; withRuby = true; + + # I want the BLEEDING EDGE! + package = pkgs.neovim-nightly; }; environment.systemPackages = with pkgs; [ editorconfig-core-c ]; diff --git a/modules/nixos/themes/a-happy-gnome/default.nix b/modules/nixos/themes/a-happy-gnome/default.nix index e28d3f5f..09fd2592 100644 --- a/modules/nixos/themes/a-happy-gnome/default.nix +++ b/modules/nixos/themes/a-happy-gnome/default.nix @@ -1,5 +1,7 @@ { config, options, lib, pkgs, ... }: +# TODO: Custom dconf database which is not yet possible. +# See https://github.com/NixOS/nixpkgs/issues/54150 for more details. let name = "a-happy-gnome"; cfg = config.modules.themes.a-happy-gnome; @@ -10,7 +12,7 @@ let }; in { - options.modules.themes.a-happy-gnome.enable = lib.mkEnableOption "Enables my configuration of GNOME Shell."; + options.modules.themes.a-happy-gnome.enable = lib.mkEnableOption "'A happy GNOME', foo-dogsquared's configuration of GNOME desktop environment"; config = lib.mkIf cfg.enable { services.xserver.enable = true;