Introduce more options to configure individual modules

This commit is contained in:
DashieTM 2024-08-25 23:47:33 +02:00
parent 351584ecb4
commit e3619d6c94
13 changed files with 668 additions and 531 deletions

View file

@ -32,20 +32,358 @@
Enables jetbrains toolbox. Enables jetbrains toolbox.
''; '';
}; };
useDefaultPackages = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Use default base packages (only additionalPackages are installed if false)";
};
additionalPackages = lib.mkOption {
default = [ ];
example = [ ];
type = with lib.types; listOf package;
description = "Additional packages to be installed";
};
languages = {
haskell = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables haskell.
'';
};
packages = lib.mkOption {
default = with pkgs; [
haskellPackages.cabal-install
ghc
haskellPackages.haskell-language-server
];
example = [ ];
type = with lib.types; listOf package;
description = ''
haskell packages
'';
};
};
typst = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables typst.
'';
};
packages = lib.mkOption {
default = with pkgs; [
typst
tinymist
ltex-ls
];
example = [ ];
type = with lib.types; listOf package;
description = ''
typst packages
'';
};
};
go = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables go.
'';
};
packages = lib.mkOption {
default = with pkgs; [
go
gopls
];
example = [ ];
type = with lib.types; listOf package;
description = ''
Go packages
'';
};
};
rust = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables rust.
'';
};
packages = lib.mkOption {
default = with pkgs; [ rustup ];
example = [ ];
type = with lib.types; listOf package;
description = ''
Rust packages
'';
};
};
ts-js = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables TS/JS.
'';
};
packages = lib.mkOption {
default = with pkgs; [
nodejs_20
deno
typescript
nodePackages.typescript-language-server
nodePackages.prettier
];
example = [ ];
type = with lib.types; listOf package;
description = ''
TS/JS packages
'';
};
};
zig = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables zig.
'';
};
packages = lib.mkOption {
default = with pkgs; [
zig
zls
];
example = [ ];
type = with lib.types; listOf package;
description = ''
zig packages
'';
};
};
java = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables java.
'';
};
packages = lib.mkOption {
default = with pkgs; [
gradle
maven
jdt-language-server
temurin-jre-bin
];
example = [ ];
type = with lib.types; listOf package;
description = ''
Java packages
'';
};
};
dotnet = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables C#/F#.
'';
};
packages = lib.mkOption {
default = with pkgs; [
#.!
dotnet-sdk_8
omnisharp-roslyn
csharpier
netcoredbg
#fsharp
fsharp
fsautocomplete
];
example = [ ];
type = with lib.types; listOf package;
description = ''
C#/F# packages
'';
};
};
C-CPP = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables C/C++.
'';
};
packages = lib.mkOption {
default = with pkgs; [
bear
gcc
clang-tools
];
example = [ ];
type = with lib.types; listOf package;
description = ''
C/C++ packages
'';
};
};
python = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables python.
'';
};
packages = lib.mkOption {
default = with pkgs; [
python3
python312Packages.python-lsp-server
python312Packages.python-lsp-ruff
python312Packages.python-lsp-black
];
example = [ ];
type = with lib.types; listOf package;
description = ''
python packages
'';
};
};
configFiles = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables Json/toml/yaml etc.
'';
};
packages = lib.mkOption {
default = with pkgs; [
#yaml
yamlfmt
yamllint
yaml-language-server
#json
jq
];
example = [ ];
type = with lib.types; listOf package;
description = ''
packages for said filetypes
'';
};
};
bash = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables bash.
'';
};
packages = lib.mkOption {
default = with pkgs; [
bash-language-server
shfmt
];
example = [ ];
type = with lib.types; listOf package;
description = ''
bash packages
'';
};
};
html-css = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables html/css.
'';
};
packages = lib.mkOption {
default = with pkgs; [
tailwindcss
tailwindcss-language-server
# html-tidy
];
example = [ ];
type = with lib.types; listOf package;
description = ''
html/css packages
'';
};
};
sql = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables sql.
'';
};
packages = lib.mkOption {
default = with pkgs; [
nodePackages.sql-formatter
sqls
];
example = [ ];
type = with lib.types; listOf package;
description = ''
sql packages
'';
};
};
asm = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables assembly.
'';
};
packages = lib.mkOption {
default = with pkgs; [ asm-lsp ];
example = [ ];
type = with lib.types; listOf package;
description = ''
assembly packages
'';
};
};
};
}; };
}; };
config = lib.mkIf config.mods.coding.enable ( config =
lib.optionalAttrs (options ? home.packages) { let
programs.dashvim = lib.mkIf config.mods.coding.dashvim { basePackages = with pkgs; [
enable = true;
colorscheme = config.mods.stylix.colorscheme;
};
home.packages = with pkgs; [
(lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox)
#basics
gitui gitui
gcc
meson meson
ninja ninja
tree-sitter tree-sitter
@ -54,100 +392,39 @@
sqlite sqlite
plantuml plantuml
d-spy d-spy
# cpp
bear
clang-tools
#sql
nodePackages.sql-formatter
sqls
#assembly
asm-lsp
#yaml
yamlfmt
yamllint
yaml-language-server
#markdown
marksman
mdformat
#bash
bash-language-server
shfmt
#fsharp
fsharp
fsautocomplete
#haskell
haskellPackages.cabal-install
ghc
haskellPackages.haskell-language-server
#html
# html-tidy
#json
jq
#css
tailwindcss
tailwindcss-language-server
#editors
neovide
##fallback
vscodium
#rust
rustup
#python
python3
python312Packages.python-lsp-server
python312Packages.python-lsp-ruff
python312Packages.python-lsp-black
#ts/js
nodejs_20
deno
typescript
nodePackages.typescript-language-server
nodePackages.prettier
#go
go
gopls
#typst
typst
tinymist
ltex-ls
#java
gradle
maven
jdt-language-server
temurin-jre-bin
#.!
dotnet-sdk_8
omnisharp-roslyn
csharpier
netcoredbg
#zig
zig
zls
tmux tmux
tmate tmate
#editors
neovide
#fallback
vscodium
]; ];
in
} lib.mkIf config.mods.coding.enable (
); lib.optionalAttrs (options ? home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true;
colorscheme = config.mods.stylix.colorscheme;
};
home.packages =
with pkgs;
[ (lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox) ]
++ config.mods.coding.additionalPackages
++ (lib.lists.optionals config.mods.coding.useDefaultPackages basePackages)
++ (lib.lists.optionals config.mods.coding.languages.haskell.enable config.mods.coding.languages.haskell.packages)
++ (lib.lists.optionals config.mods.coding.languages.rust.enable config.mods.coding.languages.rust.packages)
++ (lib.lists.optionals config.mods.coding.languages.go.enable config.mods.coding.languages.go.packages)
++ (lib.lists.optionals config.mods.coding.languages.java.enable config.mods.coding.languages.java.packages)
++ (lib.lists.optionals config.mods.coding.languages.dotnet.enable config.mods.coding.languages.dotnet.packages)
++ (lib.lists.optionals config.mods.coding.languages.bash.enable config.mods.coding.languages.bash.packages)
++ (lib.lists.optionals config.mods.coding.languages.C-CPP.enable config.mods.coding.languages.C-CPP.packages)
++ (lib.lists.optionals config.mods.coding.languages.asm.enable config.mods.coding.languages.asm.packages)
++ (lib.lists.optionals config.mods.coding.languages.sql.enable config.mods.coding.languages.sql.packages)
++ (lib.lists.optionals config.mods.coding.languages.html-css.enable config.mods.coding.languages.html-css.packages)
++ (lib.lists.optionals config.mods.coding.languages.configFiles.enable config.mods.coding.languages.configFiles.packages)
++ (lib.lists.optionals config.mods.coding.languages.ts-js.enable config.mods.coding.languages.ts-js.packages)
++ (lib.lists.optionals config.mods.coding.languages.typst.enable config.mods.coding.languages.typst.packages)
++ (lib.lists.optionals config.mods.coding.languages.zig.enable config.mods.coding.languages.zig.packages);
}
);
} }

View file

@ -12,146 +12,163 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables fish"; description = "Enables fish";
}; };
additionalConfig = lib.mkOption {
default = '''';
example = '''';
type = lib.types.lines;
description = "Additional fish config";
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Use default fish config";
};
}; };
config = lib.mkIf config.mods.fish.enable ( config = lib.mkIf config.mods.fish.enable (
lib.optionalAttrs (options ? programs.fish) { lib.optionalAttrs (options ? programs.fish) {
programs.fish = { programs.fish = {
enable = true; enable = true;
shellInit = '' shellInit =
if status is-interactive if config.mods.fish.useDefaultConfig then
# Commands to run in interactive sessions can go here ''
end if status is-interactive
# Commands to run in interactive sessions can go here
# =============================================================================
#
# Utility functions for zoxide.
#
export NIX_PATH="$NIX_PATH:${config.conf.nixos-config-path}"
set EDITOR "neovide --no-fork"
alias rebuild='sudo nixos-rebuild switch --flake ${config.conf.nixos-config-path}'
abbr --add ls 'lsd'
abbr --add :q 'exit'
abbr --add gh 'git push origin'
abbr --add gl 'git pull origin'
abbr --add gm 'git commit -m'
abbr --add ga "git add -A"
abbr --add g+ 'bear -- g++ -Wextra -Werror -std=c++20'
abbr --add s "kitty +kitten ssh"
abbr --add zl 'z "" '
abbr --add nv 'neovide'
abbr --add cr 'cargo run'
abbr --add grep 'rg'
abbr --add cat 'bat'
abbr --add find 'fd'
abbr --add rm 'rip'
set fish_greeting
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
function __zoxide_pwd
builtin pwd -L
end
# A copy of fish's internal cd function. This makes it possible to use
# `alias cd=z` without causing an infinite loop.
if ! builtin functions --query __zoxide_cd_internal
if builtin functions --query cd
builtin functions --copy cd __zoxide_cd_internal
else
alias __zoxide_cd_internal='builtin cd'
end end
end
# cd + custom logic based on the value of _ZO_ECHO. # =============================================================================
function __zoxide_cd #
__zoxide_cd_internal $argv # Utility functions for zoxide.
end #
# ============================================================================= export NIX_PATH="$NIX_PATH:${config.conf.nixos-config-path}"
#
# Hook configuration for zoxide.
#
# Initialize hook to add new entries to the database. set EDITOR "neovide --no-fork"
function __zoxide_hook --on-variable PWD
test -z "$fish_private_mode"
and command zoxide add -- (__zoxide_pwd)
end
# ============================================================================= alias rebuild='sudo nixos-rebuild switch --flake ${config.conf.nixos-config-path}'
# abbr --add ls 'lsd'
# When using zoxide with --no-cmd, alias these internal functions as desired. abbr --add :q 'exit'
# abbr --add gh 'git push origin'
abbr --add gl 'git pull origin'
abbr --add gm 'git commit -m'
abbr --add ga "git add -A"
abbr --add g+ 'bear -- g++ -Wextra -Werror -std=c++20'
abbr --add s "kitty +kitten ssh"
abbr --add zl 'z "" '
abbr --add nv 'neovide'
abbr --add cr 'cargo run'
abbr --add grep 'rg'
abbr --add cat 'bat'
abbr --add find 'fd'
abbr --add rm 'rip'
if test -z $__zoxide_z_prefix set fish_greeting
set __zoxide_z_prefix 'z!' # pwd based on the value of _ZO_RESOLVE_SYMLINKS.
end function __zoxide_pwd
set __zoxide_z_prefix_regex ^(string escape --style=regex $__zoxide_z_prefix) builtin pwd -L
end
# Jump to a directory using only keywords. # A copy of fish's internal cd function. This makes it possible to use
function __zoxide_z # `alias cd=z` without causing an infinite loop.
set -l argc (count $argv) if ! builtin functions --query __zoxide_cd_internal
if test $argc -eq 0 if builtin functions --query cd
__zoxide_cd $HOME builtin functions --copy cd __zoxide_cd_internal
else if test "$argv" = - else
__zoxide_cd - alias __zoxide_cd_internal='builtin cd'
else if test $argc -eq 1 -a -d $argv[1] end
__zoxide_cd $argv[1] end
else if set -l result (string replace --regex $__zoxide_z_prefix_regex \'\' $argv[-1]); and test -n $result
__zoxide_cd $result # cd + custom logic based on the value of _ZO_ECHO.
else function __zoxide_cd
set -l result (command zoxide query --exclude (__zoxide_pwd) -- $argv) __zoxide_cd_internal $argv
end
# =============================================================================
#
# Hook configuration for zoxide.
#
# Initialize hook to add new entries to the database.
function __zoxide_hook --on-variable PWD
test -z "$fish_private_mode"
and command zoxide add -- (__zoxide_pwd)
end
# =============================================================================
#
# When using zoxide with --no-cmd, alias these internal functions as desired.
#
if test -z $__zoxide_z_prefix
set __zoxide_z_prefix 'z!'
end
set __zoxide_z_prefix_regex ^(string escape --style=regex $__zoxide_z_prefix)
# Jump to a directory using only keywords.
function __zoxide_z
set -l argc (count $argv)
if test $argc -eq 0
__zoxide_cd $HOME
else if test "$argv" = -
__zoxide_cd -
else if test $argc -eq 1 -a -d $argv[1]
__zoxide_cd $argv[1]
else if set -l result (string replace --regex $__zoxide_z_prefix_regex \'\' $argv[-1]); and test -n $result
__zoxide_cd $result
else
set -l result (command zoxide query --exclude (__zoxide_pwd) -- $argv)
and __zoxide_cd $result
end
end
# Completions.
function __zoxide_z_complete
set -l tokens (commandline --current-process --tokenize)
set -l curr_tokens (commandline --cut-at-cursor --current-process --tokenize)
if test (count $tokens) -le 2 -a (count $curr_tokens) -eq 1
# If there are < 2 arguments, use `cd` completions.
complete --do-complete "\'\' "(commandline --cut-at-cursor --current-token) | string match --regex '.*/$'
else if test (count $tokens) -eq (count $curr_tokens); and ! string match --quiet --regex $__zoxide_z_prefix_regex. $tokens[-1]
# If the last argument is empty and the one before doesn't start with
# $__zoxide_z_prefix, use interactive selection.
set -l query $tokens[2..-1]
set -l result (zoxide query --exclude (__zoxide_pwd) --interactive -- $query)
and echo $__zoxide_z_prefix$result
commandline --function repaint
end
end
complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'
# Jump to a directory using interactive search.
function __zoxide_zi
set -l result (command zoxide query --interactive -- $argv)
and __zoxide_cd $result and __zoxide_cd $result
end end
end
# Completions. # =============================================================================
function __zoxide_z_complete #
set -l tokens (commandline --current-process --tokenize) # Commands for zoxide. Disable these using --no-cmd.
set -l curr_tokens (commandline --cut-at-cursor --current-process --tokenize) #
if test (count $tokens) -le 2 -a (count $curr_tokens) -eq 1 abbr --erase z &>/dev/null
# If there are < 2 arguments, use `cd` completions. alias z=__zoxide_z
complete --do-complete "\'\' "(commandline --cut-at-cursor --current-token) | string match --regex '.*/$'
else if test (count $tokens) -eq (count $curr_tokens); and ! string match --quiet --regex $__zoxide_z_prefix_regex. $tokens[-1]
# If the last argument is empty and the one before doesn't start with
# $__zoxide_z_prefix, use interactive selection.
set -l query $tokens[2..-1]
set -l result (zoxide query --exclude (__zoxide_pwd) --interactive -- $query)
and echo $__zoxide_z_prefix$result
commandline --function repaint
end
end
complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'
# Jump to a directory using interactive search. abbr --erase zi &>/dev/null
function __zoxide_zi alias zi=__zoxide_zi
set -l result (command zoxide query --interactive -- $argv)
and __zoxide_cd $result
end
# ============================================================================= # =============================================================================
# #
# Commands for zoxide. Disable these using --no-cmd. # To initialize zoxide, add this to your configuration (usually
# # ~/.config/fish/config.fish):
#
# zoxide init fish | source
abbr --erase z &>/dev/null direnv hook fish | source
alias z=__zoxide_z ''
+ config.mods.fish.additionalConfig
abbr --erase zi &>/dev/null else
alias zi=__zoxide_zi config.mods.fish.additionalPackages;
# =============================================================================
#
# To initialize zoxide, add this to your configuration (usually
# ~/.config/fish/config.fish):
#
# zoxide init fish | source
direnv hook fish | source
'';
}; };
} }
); );

View file

@ -61,23 +61,25 @@
lib.optionalAttrs (options ? environment.systemPackages) { lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages = config.mods.gaming.tools; environment.systemPackages = config.mods.gaming.tools;
programs.steam.enable = config.mods.gaming.steam; programs = {
programs.gamemode.enable = true; steam.enable = config.mods.gaming.steam;
programs.gamemode = { gamemode.enable = true;
enableRenice = true; gamemode = {
settings = { enableRenice = true;
general = { settings = {
governor = "performance"; general = {
}; governor = "performance";
gpu = lib.mkIf config.mods.gaming.gpu_optimization { };
apply_gpu_optimisations = "accept-responsibility"; gpu = lib.mkIf config.mods.gaming.gpu_optimization {
gpu_device = config.mods.gaming.gpu_device; apply_gpu_optimisations = "accept-responsibility";
amd_performance_level = "high"; gpu_device = config.mods.gaming.gpu_device;
nv_powermizer_mode = 1; amd_performance_level = "high";
}; nv_powermizer_mode = 1;
custom = { };
start = "notify-send -a 'Gamemode' 'Optimizations activated'"; custom = {
end = "notify-send -a 'Gamemode' 'Optimizations deactivated'"; start = "notify-send -a 'Gamemode' 'Optimizations activated'";
end = "notify-send -a 'Gamemode' 'Optimizations deactivated'";
};
}; };
}; };
}; };

View file

@ -9,35 +9,47 @@
options.mods = { options.mods = {
gnome_services.enable = lib.mkOption { gnome_services.enable = lib.mkOption {
default = true; default = true;
type = lib.types.bool;
example = false; example = false;
type = lib.types.bool;
description = '' description = ''
Enables gnome services: keyring and settings daemon. Enables gnome services: keyring and settings daemon.
Note: Do not use these for environments which ship these functionalities by default: GNOME, KDE Note: Do not use these for environments which ship these functionalities by default: GNOME, KDE
''; '';
}; };
nautilus.enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables and configures Nautilus
'';
};
}; };
config = lib.mkIf config.mods.gnome_services.enable ( config =
lib.optionalAttrs (options ? services.gnome.gnome-keyring) { lib.mkIf config.mods.gnome_services.enable (
programs.dconf.enable = true; lib.optionalAttrs (options ? services.gnome.gnome-keyring) {
services = { programs.dconf.enable = true;
# needed for GNOME services outside of GNOME Desktop services = {
dbus.packages = with pkgs; [ # needed for GNOME services outside of GNOME Desktop
gcr dbus.packages = with pkgs; [
gnome.gnome-settings-daemon gcr
]; gnome.gnome-settings-daemon
];
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
gvfs.enable = true; gvfs.enable = true;
}; };
} }
)
// lib.optionalAttrs (options ? home.packages) { // lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ home.packages = lib.mkIf config.mods.gnome_services.nautilus.enable (
nautilus with pkgs;
sushi [
nautilus-python nautilus
]; sushi
} nautilus-python
); ]
);
};
} }

View file

@ -10,25 +10,33 @@
options.mods = { options.mods = {
nvidia.enable = lib.mkOption { nvidia.enable = lib.mkOption {
default = false; default = false;
type = lib.types.bool;
example = true; example = true;
type = lib.types.bool;
description = '' description = ''
Enables nvidia support. Enables nvidia support.
''; '';
}; };
amdgpu.enable = lib.mkOption { amdgpu.enable = lib.mkOption {
default = false; default = false;
type = lib.types.bool;
example = true; example = true;
type = lib.types.bool;
description = '' description = ''
Enables amdgpu support. Enables amdgpu support.
''; '';
}; };
intelgpu.enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Enables intel support.
'';
};
vapi = { vapi = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = true;
example = false;
type = lib.types.bool; type = lib.types.bool;
example = true;
description = '' description = ''
Enables vapi. Enables vapi.
''; '';
@ -44,8 +52,8 @@
}; };
}; };
config = lib.mkIf config.mods.vapi.enable ( config =
lib.optionalAttrs (options ? hardware.graphics) { (lib.optionalAttrs (options ? hardware.graphics) {
boot = lib.mkIf config.mods.amdgpu.enable { boot = lib.mkIf config.mods.amdgpu.enable {
kernelModules = [ "kvm-amd" ]; kernelModules = [ "kvm-amd" ];
initrd.kernelModules = [ "amdgpu" ]; initrd.kernelModules = [ "amdgpu" ];
@ -55,12 +63,14 @@
hardware = { hardware = {
graphics = graphics =
let let
base_packages = [ amdPackages = [
pkgs.libvdpau-va-gl (lib.mkIf (config.mods.intelgpu && lib.mkIf config.mods.vapi.enable) pkgs.vpl-gpu-rt)
pkgs.vaapiVdpau (lib.mkIf (config.mods.intelgpu && lib.mkIf config.mods.vapi.enable) pkgs.intel-media-driver)
pkgs.mesa.drivers (lib.mkIf config.mods.vapi.enable pkgs.libvdpau-va-gl)
(lib.mkIf config.mods.vapi.enable pkgs.vaapiVdpau)
(lib.mkIf (config.mods.intelgpu || config.mods.amdgpu) pkgs.mesa.drivers)
]; ];
rocm_packages = [ rocmPackages = [
pkgs.rocmPackages.clr.icd pkgs.rocmPackages.clr.icd
pkgs.rocm-opencl-runtime pkgs.rocm-opencl-runtime
]; ];
@ -68,10 +78,12 @@
{ {
enable = true; enable = true;
enable32Bit = lib.mkDefault true; enable32Bit = lib.mkDefault true;
extraPackages = base_packages ++ (lib.lists.optionals config.mods.vapi.rocm.enable rocm_packages); extraPackages =
amdPackages
++ (lib.lists.optionals (config.mods.vapi.rocm.enable && config.mods.gpu.amdgpu) rocmPackages);
}; };
}; };
} })
// lib.optionalAttrs (options ? hardware.graphics) ( // lib.optionalAttrs (options ? hardware.graphics) (
lib.mkIf config.mods.nvidia.enable { lib.mkIf config.mods.nvidia.enable {
hardware.nvidia = { hardware.nvidia = {
@ -84,6 +96,5 @@
}; };
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
} }
) );
);
} }

View file

@ -43,6 +43,20 @@
Resolution/refreshrate used by the monitor in the login screen. Resolution/refreshrate used by the monitor in the login screen.
''; '';
}; };
environments = lib.mkOption {
default = ''
Hyprland
'';
# no idea if these are written correctly
example = ''
Niri
River
'';
type = lib.types.lines;
description = ''
List of environments that should be available in the login prompt.
'';
};
}; };
}; };
@ -78,9 +92,7 @@
}; };
}; };
environment.etc."greetd/environments".text = '' environment.etc."greetd/environments".text = config.mods.greetd.environments;
Hyprland
'';
# should technically be the same, but this is configured instead in order to provide a decent out of the box login experience. # should technically be the same, but this is configured instead in order to provide a decent out of the box login experience.
environment.etc."greetd/hyprgreet.conf".text = '' environment.etc."greetd/hyprgreet.conf".text = ''

View file

@ -52,6 +52,12 @@
type = with lib.types; nullOr package; type = with lib.types; nullOr package;
description = "The email client"; description = "The email client";
}; };
additionalBrowser = lib.mkOption {
default = pkgs.brave;
example = null;
type = with lib.types; nullOr package;
description = "Additional browser -> second to firefox, the only installed browser if firefox is disabled";
};
}; };
config = config =
(lib.optionalAttrs (options ? home.packages) { (lib.optionalAttrs (options ? home.packages) {
@ -68,9 +74,11 @@
(lib.mkIf config.mods.home_packages.nextcloudClient nextcloud-client) (lib.mkIf config.mods.home_packages.nextcloudClient nextcloud-client)
(lib.mkIf (!isNull config.mods.home_packages.matrixClient) config.mods.home_packages.matrixClient) (lib.mkIf (!isNull config.mods.home_packages.matrixClient) config.mods.home_packages.matrixClient)
(lib.mkIf (!isNull config.mods.home_packages.mailClient) config.mods.home_packages.mailClient) (lib.mkIf (!isNull config.mods.home_packages.mailClient) config.mods.home_packages.mailClient)
(lib.mkIf (
!isNull config.mods.home_packages.additionalBrowser
) config.mods.home_packages.additionalBrowser)
adw-gtk3 adw-gtk3
bat bat
brave
brightnessctl brightnessctl
dbus dbus
fastfetch fastfetch

View file

@ -22,9 +22,9 @@
cache_config = lib.mkOption { cache_config = lib.mkOption {
default = '' default = ''
[General] [General]
LastDatabases=/home/dashie/Music/Passwords.kdbx LastDatabases=/home/${config.conf.username}/Music/Passwords.kdbx
LastActiveDatabase=/home/dashie/Music/Passwords.kdbx LastActiveDatabase=/home/${config.conf.username}/Music/Passwords.kdbx
LastOpenedDatabases=/home/dashie/Music/Passwords.kdbx LastOpenedDatabases=/home/${config.conf.username}/Music/Passwords.kdbx
LastKeyFiles=@Variant(\0\0\0\x1c\0\0\0\x1\0\0\0\x42\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0M\0u\0s\0i\0\x63\0/\0P\0\x61\0s\0s\0w\0o\0r\0\x64\0s\0.\0k\0\x64\0\x62\0x\0\0\0\n\0\0\0\x42\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0M\0u\0s\0i\0\x63\0/\0l\0o\0g\0i\0n\0_\0k\0\x65\0y\0.\0k\0\x65\0y\0x) LastKeyFiles=@Variant(\0\0\0\x1c\0\0\0\x1\0\0\0\x42\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0M\0u\0s\0i\0\x63\0/\0P\0\x61\0s\0s\0w\0o\0r\0\x64\0s\0.\0k\0\x64\0\x62\0x\0\0\0\n\0\0\0\x42\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0M\0u\0s\0i\0\x63\0/\0l\0o\0g\0i\0n\0_\0k\0\x65\0y\0.\0k\0\x65\0y\0x)
''; '';
example = ""; example = "";

View file

@ -69,10 +69,10 @@ in
sync_with_monitor = "no"; sync_with_monitor = "no";
background_opacity = "0.8"; background_opacity = "0.8";
font_family = "${config.mods.stylix.monospace.name}"; font_family = "${config.mods.stylix.fonts.monospace.name}";
bold_font = "${config.mods.stylix.monospace.name} Extra Bold"; bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold";
italic_font = "${config.mods.stylix.monospace.name} Extra Italic"; italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic";
bold_italic_font = "${config.mods.stylix.monospace.name} Extra Bold Italic"; bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic";
background = base; background = base;
foreground = "#" + scheme.base05; foreground = "#" + scheme.base05;

View file

@ -7,27 +7,26 @@
}: }:
{ {
options.mods.media_packages = { options.mods.media_packages = {
enable = lib.mkOption { useBasePackages = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "Default media packages"; description = "Default media packages (If disabled, only the additional packages will be installed)";
}; };
additional_packages = lib.mkOption { additionalPackages = lib.mkOption {
default = [ ]; default = [ ];
example = [ pkgs.flatpak ]; example = [ pkgs.flatpak ];
type = lib.types.str; type = with lib.types; listOf package;
description = '' description = ''
Additional media packages. Additional media packages.
Will be installed regardless of default media packages are installed.
''; '';
}; };
}; };
config = ( config = (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = config.mods.media_packages.additional_packages; home.packages = config.mods.media_packages.additionalPackages;
} }
// (lib.mkIf config.mods.media_packages.enable ( // (lib.mkIf config.mods.media_packages.useBasePackages (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ home.packages = with pkgs; [
# base audio # base audio

View file

@ -85,8 +85,8 @@
description = "font config"; description = "font config";
}; };
}; };
config = ( config =
lib.optionalAttrs (options ? stylix) { (lib.optionalAttrs (options ? stylix) {
stylix = { stylix = {
enable = true; enable = true;
image = ../../base/black.jpg; image = ../../base/black.jpg;
@ -104,7 +104,7 @@
"${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml" "${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml"
); );
}; };
} })
// lib.optionalAttrs (options ? environment.systemPackages) { // lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages = [ environment.systemPackages = [
config.mods.stylix.fonts.serif.package config.mods.stylix.fonts.serif.package
@ -112,6 +112,5 @@
config.mods.stylix.fonts.monospace.package config.mods.stylix.fonts.monospace.package
config.mods.stylix.fonts.emoji.package config.mods.stylix.fonts.emoji.package
]; ];
} };
);
} }

View file

@ -12,8 +12,38 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables yazi"; description = "Enables yazi";
}; };
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Use default yazi config (if disabled only additionalConfig is used)";
};
additionalConfig = lib.mkOption {
default = { };
example = { };
type = with lib.types; attrsOf anything;
description = "Additional config for yazi";
};
useDefaultKeymap = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Use default yazi keymap (if disabled only additionalKeymap is used)";
};
additionalKeymap = lib.mkOption {
default = { };
example = { };
type = with lib.types; attrsOf anything;
description = "Additional keymap for yazi";
};
}; };
config = lib.mkIf config.mods.yazi.enable ( config = lib.mkIf config.mods.yazi.enable (
lib.optionalAttrs (options ? home.packages) { programs.yazi = import ./yazi.nix; } lib.optionalAttrs (options ? home.packages) { programs.yazi = import ./yazi.nix; }
// {
programs.yazi.settings = {
settings = config.mods.yazi.additionalKeymap;
keymap = config.mods.yazi.additionalConfig;
};
}
); );
} }

View file

@ -1,3 +1,4 @@
{ lib, config, ... }:
{ {
# don't ask.... # don't ask....
enable = true; enable = true;
@ -6,7 +7,6 @@
enabled = false; enabled = false;
}; };
opener = { opener = {
folder = [ folder = [
{ {
run = ''open - R "$@"''; run = ''open - R "$@"'';
@ -1000,234 +1000,4 @@
} }
]; ];
}; };
# theme = {
# manager = {
# cwd = {
# fg = "#94e2d5";
# };
#
# # Hovered
# hovered = {
# reversed = true;
# };
# preview_hovered = { underline = true; };
#
# # Find
# find_keyword = {
# fg = "#f9e2af";
# bold = true;
# italic = true;
# underline = true;
# };
# find_position = {
# fg = "#f5c2e7";
# bg = "reset";
# bold = true;
# italic = true;
# };
#
# # Marker
# marker_copied = {
# fg = "#a6e3a1";
# bg = "#a6e3a1";
# };
# marker_cut = {
# fg = "#f38ba8";
# bg = "#f38ba8";
# };
# marker_marked = {
# fg = "#f9e2af";
# bg = "#f9e2af";
# };
# marker_selected = {
# fg = "#779EF0";
# bg = "#89b4fa";
# };
#
# # Tab
# tab_active = {
# fg = "#1e1e2e";
# bg = "#cdd6f4";
# };
# tab_inactive = {
# fg = "#cdd6f4";
# bg = "#45475a";
# };
# tab_width = 1;
#
# # Count
# count_copied = {
# fg = "#1e1e2e";
# bg = "#a6e3a1";
# };
# count_cut = {
# fg = "#1e1e2e";
# bg = "#f38ba8";
# };
# count_selected = {
# fg = "#1e1e2e";
# bg = "#89b4fa";
# };
#
# # Border
# border_symbol = "│";
# border_style = { fg = "#7f849c"; };
#
# };
# status = {
# separator_open = "";
# separator_close = "";
# separator_style = {
# fg = "#45475a";
# bg = "#45475a";
# };
#
# # Mode
# mode_normal = {
# fg = "#1e1e2e";
# bg = "#89b4fa";
# bold = true;
# };
# mode_select = {
# fg = "#1e1e2e";
# bg = "#a6e3a1";
# bold = true;
# };
# mode_unset = {
# fg = "#1e1e2e";
# bg = "#f2cdcd";
# bold = true;
# };
#
# # Progress
# progress_label = {
# fg = "#ffffff";
# bold = true;
# };
# progress_normal = {
# fg = "#89b4fa";
# bg = "#45475a";
# };
# progress_error = {
# fg = "#f38ba8";
# bg = "#45475a";
# };
#
# # Permissions
# permissions_t = { fg = "#89b4fa"; };
# permissions_r = { fg = "#f9e2af"; };
# permissions_w = { fg = "#f38ba8"; };
# permissions_x = { fg = "#a6e3a1"; };
# permissions_s = { fg = "#7f849c"; };
# };
#
# input = {
# border = {
# fg = "#89b4fa";
# };
# title = { };
# value = { };
# selected = { reversed = true; };
# };
# select = {
# border = {
# fg = "#89b4fa";
# };
# active = { fg = "#f5c2e7"; };
# inactive = { };
# };
# tasks = {
# border = {
# fg = "#89b4fa";
# };
# title = { };
# hovered = {
# underline = true;
# };
# };
# which = {
# mask = {
# bg = "#313244";
# };
# cand = { fg = "#94e2d5"; };
# rest = { fg = "#9399b2"; };
# desc = { fg = "#f5c2e7"; };
# separator = "  ";
# separator_style = { fg = "#585b70"; };
# };
# help = {
# on = {
# fg = "#f5c2e7";
# };
# exec = { fg = "#94e2d5"; };
# desc = { fg = "#9399b2"; };
# hovered = {
# bg = "#585b70";
# bold = true;
# };
# footer = {
# fg = "#45475a";
# bg = "#cdd6f4";
# };
# };
# filetype = {
# rules = [
# # Images
# {
# mime = "image/*";
# fg = "#94e2d5";
# }
#
# # Videos
# {
# mime = "video/*";
# fg = "#f9e2af";
# }
# {
# mime = "audio/*";
# fg = "#f9e2af";
# }
#
# # Archives
# {
# mime = "application/zip";
# fg = "#f5c2e7";
# }
# {
# mime = "application/gzip";
# fg = "#f5c2e7";
# }
# {
# mime = "application/x-tar";
# fg = "#f5c2e7";
# }
# {
# mime = "application/x-bzip";
# fg = "#f5c2e7";
# }
# {
# mime = "application/x-bzip2";
# fg = "#f5c2e7";
# }
# {
# mime = "application/x-7z-compressed";
# fg = "#f5c2e7";
# }
# {
# mime = "application/x-rar";
# fg = "#f5c2e7";
# }
#
# # Fallback
# {
# name = "*";
# fg = "#cdd6f4";
# }
# {
# name = "*/";
# fg = "#89b4fa";
# }
# ];
# };
# };
} }