feat: more modules

This commit is contained in:
Artur Manuel 2024-10-18 00:00:48 +01:00
commit 8e23015029
5 changed files with 104 additions and 6 deletions

View file

@ -5,5 +5,7 @@
./git.nix ./git.nix
./qutebrowser.nix ./qutebrowser.nix
./pipewire.nix ./pipewire.nix
./mpd.nix
./fonts.nix
]; ];
} }

View file

@ -0,0 +1,60 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.alqueva.fonts;
inherit (lib) types mkOption;
fontSubmodule = fontPackages: fontNames: {
options = {
packages = mkOption {
type = types.listOf types.package;
default = fontPackages;
description = "Package of the font used.";
};
names = mkOption {
type = types.listOf types.str;
default = fontNames;
description = "Name of the default font you will be using.";
};
};
};
mkFontOption = fontType: fontPackages: fontNames:
mkOption {
type = types.submodule (fontSubmodule fontPackages fontNames);
description = "Options for the ${fontType} letterform.";
};
in {
options.alqueva.fonts = {
sansSerif = mkFontOption "sans-serif" [pkgs.roboto] ["Roboto"];
monospace = mkFontOption "monospace" [pkgs.roboto-mono] ["Roboto Mono"];
serif = mkFontOption "serif" [pkgs.roboto-serif] ["Roboto Serif"];
emoji = mkFontOption "emoji" [pkgs.noto-fonts-color-emoji] ["Noto Color Emoji"];
extraPackages = mkOption {
type = types.listOf types.package;
default = [];
description = "Extra font packages to be installed.";
};
};
config = {
fonts = {
packages = builtins.concatLists [
cfg.extraPackages
cfg.sansSerif.packages
cfg.monospace.packages
cfg.serif.packages
cfg.emoji.packages
];
fontconfig = {
defaultFonts = {
sansSerif = cfg.sansSerif.names;
monospace = cfg.monospace.names;
serif = cfg.serif.names;
emoji = cfg.emoji.names;
};
enable = true;
};
};
};
}

23
computers/shared/mpd.nix Normal file
View file

@ -0,0 +1,23 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.alqueva.mpd;
in {
options.alqueva.mpd = {
enable = lib.mkEnableOption "mpd";
ncmpcpp = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable ncmpcpp alongside mpd.";
};
};
config = lib.mkIf cfg.enable {
services.mpd.enable = true;
environment.systemPackages =
lib.optional cfg.ncmpcpp pkgs.ncmpcpp;
};
}

View file

@ -52,6 +52,19 @@
git.enable = true; git.enable = true;
qutebrowser.enable = true; qutebrowser.enable = true;
pipewire.enable = true; pipewire.enable = true;
mpd = {
enable = true;
ncmpcpp = true;
};
fonts = {
sansSerif = {};
monospace = {};
serif = {};
emoji = {};
extraPackages = [
pkgs.nerdfonts
];
};
}; };
programs.neovim.enable = true; programs.neovim.enable = true;

12
flake.lock generated
View file

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1729070567, "lastModified": 1729099656,
"narHash": "sha256-r3KMTeBLioUtRPRFjdWbpZqfMmQHr6Dj9vjGaj4OhP8=", "narHash": "sha256-VftVIg7UXTy1bq+tzi1aVYOWl7PQ35IpjW88yMYjjpc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "c8760cee70cf166ad6bcee0bd9f0bba934a3a651", "rev": "d7d57edb72e54891fa67a6f058a46b2bb405663b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -62,11 +62,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1728778939, "lastModified": 1729104314,
"narHash": "sha256-WybK5E3hpGxtCYtBwpRj1E9JoiVxe+8kX83snTNaFHE=", "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "ff68f91754be6f3427e4986d7949e6273659be1d", "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
"type": "github" "type": "github"
}, },
"original": { "original": {