ref(nix): mkOptions

This commit is contained in:
Léana 江 2024-02-27 01:23:20 +01:00 committed by Léana 江
parent d98d30916b
commit 989d025f56
42 changed files with 80 additions and 78 deletions

View file

@ -0,0 +1,23 @@
{
pkgs,
lib,
config,
...
}: {
home = lib.optionalAttrs config.cmus.enable {
packages = with pkgs; [
cmus
cmusfm
];
file.cmus = {
recursive = true;
source = let
inherit (pkgs.stdenv) isLinux;
in
if isLinux
then ./cmus-linux
else ./cmus-darwin;
target = ".config/cmus";
};
};
}

View file

@ -2,12 +2,28 @@
pkgs,
unstable,
mypkgs,
settings,
config,
lib,
...
}: let
inherit (settings) extraUtils enableCmus universityTools;
inherit (pkgs) lib;
in {
}: {
imports = [
./fish
./direnv
./atuin
./starship
./fzf
./git
./btop
./tmux
./neovim
./vim
./cmus
];
programs.home-manager.enable = true;
home = {
username = lib.mkDefault "leana";
@ -15,24 +31,6 @@ in {
stateVersion = "23.11";
};
imports =
[
./fish
./direnv
./atuin
./starship
./fzf
./git
./btop
./tmux
./neovim
./vim
]
++ lib.lists.optional enableCmus ./cmus;
programs = {
ripgrep.enable = true;
gpg.enable = true;
@ -60,8 +58,7 @@ in {
tldr
irssi
]
++ lib.lists.optionals extraUtils
[
++ lib.lists.optionals config.extraUtils.enable [
unstable.opam
unstable.cargo
hyperfine
@ -71,7 +68,7 @@ in {
gnumake
sd
]
++ lib.lists.optionals universityTools [
++ lib.lists.optionals config.universityTools.enable [
mypkgs.logisim-evolution
mypkgs.necrolib
pkgs.rars

View file

@ -1,12 +1,9 @@
{
config,
pkgs,
settings,
lib,
...
}: let
inherit (settings) extraLanguageServers;
inherit (pkgs) lib;
in {
}: {
programs.neovim = {
enable = true;
defaultEditor = true;
@ -18,7 +15,7 @@ in {
shellcheck
nil
]
++ lib.lists.optionals extraLanguageServers [
++ lib.lists.optionals config.extraLanguageServers.enable [
nodePackages.vim-language-server
vscode-langservers-extracted # HTML/CSS/JSON/ESLint
marksman

View file

@ -1,17 +0,0 @@
{pkgs, ...}: {
home.packages = with pkgs; [
cmus
cmusfm
];
home.file.cmus = {
recursive = true;
source = let
inherit (pkgs.stdenv) isLinux;
in
if isLinux
then ./cmus-linux
else ./cmus-darwin;
target = ".config/cmus";
};
}