mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-24 18:19:11 +00:00
Update modules
- Add `modules.desktop.cleanup` for the usual cleanup activties in NixOS. - Update to proper descriptions for module options added with `lib.mkEnableOption`. - Additional packages for various modules. - Deleted `modules/home-manager/alacritty`. It is pretty useless though. :(
This commit is contained in:
parent
09f8a1f763
commit
efc578e961
@ -64,12 +64,6 @@
|
|||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
# Sane config for the package manager.
|
# 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.
|
# TODO: Remove this after nix-command and flakes has been considered stable.
|
||||||
#
|
#
|
||||||
# Since we're using flakes to make this possible, we need it.
|
# Since we're using flakes to make this possible, we need it.
|
||||||
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,14 +1,13 @@
|
|||||||
# Enables all of my usual setup for desktop-oriented stuff.
|
# Enables all of my usual setup for desktop-oriented stuff.
|
||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let cfg = config.modules.desktop;
|
||||||
cfg = config.modules.desktop;
|
in {
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.desktop = {
|
options.modules.desktop = {
|
||||||
enable = lib.mkEnableOption "Enable installations of desktop apps.";
|
enable = lib.mkEnableOption "installations of desktop apps";
|
||||||
graphics.enable = lib.mkEnableOption "Install graphics-related apps.";
|
graphics.enable =
|
||||||
audio.enable = lib.mkEnableOption "Install audio-related apps.";
|
lib.mkEnableOption "installations of graphics-related apps";
|
||||||
|
audio.enable = lib.mkEnableOption "installations of audio-related apps";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
@ -39,7 +38,7 @@ in
|
|||||||
services.easyeffects.enable = true;
|
services.easyeffects.enable = true;
|
||||||
services.fluidsynth = {
|
services.fluidsynth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
soundServices = "pipewire-pulse";
|
soundService = "pipewire-pulse";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let cfg = config.modules.dev;
|
||||||
cfg = config.modules.dev;
|
in {
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.dev = {
|
options.modules.dev = {
|
||||||
enable = lib.mkEnableOption "Enable my user-specific development setup.";
|
enable = lib.mkEnableOption "myy user-specific development setup";
|
||||||
shell.enable = lib.mkEnableOption "Configures my shell of choice.";
|
shell.enable =
|
||||||
|
lib.mkEnableOption "configuration of foo-dogsquared's shell of choice";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
@ -36,9 +35,7 @@ in
|
|||||||
programs.zoxide.enable = true;
|
programs.zoxide.enable = true;
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = { add_newline = false; };
|
||||||
add_newline = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
@ -1,12 +1,21 @@
|
|||||||
|
# Instant setup for using internationalized languages.
|
||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let cfg = config.modules.i18n;
|
||||||
cfg = config.modules.i18n;
|
in {
|
||||||
in
|
options.modules.i18n.enable =
|
||||||
{
|
lib.mkEnableOption "fcitx5 as input method engine";
|
||||||
options.modules.i18n.enable = lib.mkEnableOption "Enable fcitx5 as input method engine.";
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
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 = {
|
i18n.inputMethod = {
|
||||||
enabled = "fcitx5";
|
enabled = "fcitx5";
|
||||||
fcitx5.addons = with pkgs; [
|
fcitx5.addons = with pkgs; [
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let cfg = config.modules.research;
|
||||||
cfg = config.modules.research;
|
|
||||||
in {
|
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 {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
archivebox # The ultimate archiving solution!
|
archivebox # The ultimate archiving solution created by a pirate!
|
||||||
curl # The general purpose downloader.
|
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?
|
newsboat # Reading news easily on the command line?
|
||||||
qbittorrent # The pirate's toolkit for downloading Linux ISOs.
|
qbittorrent # The pirate's toolkit for downloading Linux ISOs.
|
||||||
zotero # It's actually good at archiving despite not being a researcher myself.
|
zotero # It's actually good at archiving despite not being a researcher myself.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# A module that automates setting up agenix for your system.
|
# A module that automates setting up agenix for your system.
|
||||||
{ inputs, lib, options, config, ... }:
|
{ inputs, lib, options, config, system, ... }:
|
||||||
|
|
||||||
let cfg = config.modules.agenix;
|
let cfg = config.modules.agenix;
|
||||||
in {
|
in {
|
||||||
options.modules.agenix.enable =
|
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 ];
|
imports = [ inputs.agenix.nixosModules.age ];
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
let cfg = config.modules.archiving;
|
let cfg = config.modules.archiving;
|
||||||
in {
|
in {
|
||||||
options.modules.archiving.enable =
|
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.
|
# This is not going to set BorgBackup NixOS services for you.
|
||||||
# Please do it for host-specific configs instead.
|
# Please do it for host-specific configs instead.
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
let cfg = config.modules.desktop;
|
let cfg = config.modules.desktop;
|
||||||
in {
|
in {
|
||||||
options.modules.desktop = {
|
options.modules.desktop = {
|
||||||
enable = lib.mkEnableOption
|
enable =
|
||||||
"Enables all desktop-related services and default programs.";
|
lib.mkEnableOption "all desktop-related services and default programs";
|
||||||
audio.enable = lib.mkEnableOption
|
audio.enable =
|
||||||
"Enables all desktop audio-related services such as Pipewire.";
|
lib.mkEnableOption "all desktop audio-related services such as Pipewire";
|
||||||
fonts.enable = lib.mkEnableOption "Enables font-related config.";
|
fonts.enable = lib.mkEnableOption "font-related configuration";
|
||||||
hardware.enable = lib.mkEnableOption
|
hardware.enable =
|
||||||
"Enables the common hardware-related configuration.";
|
lib.mkEnableOption "the common hardware-related configuration";
|
||||||
|
cleanup.enable = lib.mkEnableOption "activation of cleanup services";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
@ -100,5 +101,36 @@ in {
|
|||||||
# Welp, this is surprising...
|
# Welp, this is surprising...
|
||||||
services.printing.enable = true;
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,11 @@ let cfg = config.modules.dev;
|
|||||||
in {
|
in {
|
||||||
options.modules.dev = {
|
options.modules.dev = {
|
||||||
enable = lib.mkEnableOption
|
enable = lib.mkEnableOption
|
||||||
"Configures my barebones requirement for a development environment.";
|
"configurations of foo-dogsquared's barebones requirement for a development environment.";
|
||||||
shell.enable =
|
shell.enable = lib.mkEnableOption
|
||||||
lib.mkEnableOption "Installs of the shell utilities I rely on.";
|
"installation of the shell utilities foo-dogsquared rely on";
|
||||||
virtualization.enable = lib.mkEnableOption
|
virtualization.enable =
|
||||||
"Configures my virtualization-related stuff for my development. (I sometimes have to use these.)";
|
lib.mkEnableOption "virtualization-related stuff for development";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
let cfg = config.modules.editors;
|
let cfg = config.modules.editors;
|
||||||
in {
|
in {
|
||||||
options.modules.editors = {
|
options.modules.editors = {
|
||||||
neovim.enable = lib.mkEnableOption "Enable Neovim and its components";
|
neovim.enable = lib.mkEnableOption "Neovim and its components";
|
||||||
vscode.enable = lib.mkEnableOption "Enable Visual Studio Code";
|
vscode.enable = lib.mkEnableOption "Visual Studio Code";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
@ -15,6 +15,9 @@ in {
|
|||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
withNodeJs = true;
|
withNodeJs = true;
|
||||||
withRuby = true;
|
withRuby = true;
|
||||||
|
|
||||||
|
# I want the BLEEDING EDGE!
|
||||||
|
package = pkgs.neovim-nightly;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ editorconfig-core-c ];
|
environment.systemPackages = with pkgs; [ editorconfig-core-c ];
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ 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
|
let
|
||||||
name = "a-happy-gnome";
|
name = "a-happy-gnome";
|
||||||
cfg = config.modules.themes.a-happy-gnome;
|
cfg = config.modules.themes.a-happy-gnome;
|
||||||
@ -10,7 +12,7 @@ let
|
|||||||
};
|
};
|
||||||
in
|
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 {
|
config = lib.mkIf cfg.enable {
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user