code: nixpkgs-fmt to format code

This commit is contained in:
2024-03-11 16:19:31 +01:00
parent 8ecb892244
commit 04ad6ac1cd
46 changed files with 544 additions and 524 deletions
+10 -10
View File
@@ -1,21 +1,21 @@
{ config, lib, pkgs, materusArg, ... }:
let
cfg = config.materus.profile.browser;
let
cfg = config.materus.profile.browser;
in
{
options= let mkBoolOpt = materusArg.pkgs.lib.mkBoolOpt; in{
options = let mkBoolOpt = materusArg.pkgs.lib.mkBoolOpt; in {
materus.profile.browser.firefox.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Firefox with materus cfg";
materus.profile.browser.vivaldi.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Vivaldi with materus cfg";
materus.profile.browser.brave.enable = mkBoolOpt false "Enable Brave with materus cfg";
materus.profile.browser.brave.enable = mkBoolOpt false "Enable Brave with materus cfg";
};
#TODO: Make some config
config.home.packages = [
(lib.mkIf cfg.firefox.enable config.materus.profile.packages.firefox)
(lib.mkIf cfg.vivaldi.enable pkgs.vivaldi)
(lib.mkIf cfg.brave.enable pkgs.brave)
(lib.mkIf cfg.firefox.enable config.materus.profile.packages.firefox)
(lib.mkIf cfg.vivaldi.enable pkgs.vivaldi)
(lib.mkIf cfg.brave.enable pkgs.brave)
];
}
}
+3 -3
View File
@@ -20,9 +20,9 @@ in
config =
{
home.packages = (if cfg.enableDesktop then packages.list.desktopApps else []) ++
(if cfg.enableNixDevel then packages.list.nixRelated else []) ++
(if cfg.enableTerminal then packages.list.terminalApps else []);
home.packages = (if cfg.enableDesktop then packages.list.desktopApps else [ ]) ++
(if cfg.enableNixDevel then packages.list.nixRelated else [ ]) ++
(if cfg.enableTerminal then packages.list.terminalApps else [ ]);
#Desktop
programs.feh.enable = lib.mkDefault cfg.enableDesktop;
+2 -2
View File
@@ -5,11 +5,11 @@ in
{
options.materus.profile.editor.code.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable VSCodium with materus cfg";
options.materus.profile.editor.code.fhs.enable = materusArg.pkgs.lib.mkBoolOpt false "Use fhs vscodium";
options.materus.profile.editor.code.fhs.packages = lib.mkOption { default = (ps: []);};
options.materus.profile.editor.code.fhs.packages = lib.mkOption { default = (ps: [ ]); };
config = lib.mkIf cfg.enable {
programs.vscode = {
enable = lib.mkDefault true;
package = lib.mkDefault (if (cfg.fhs.enable) then (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) else pkgs.vscodium);
package = lib.mkDefault (if (cfg.fhs.enable) then (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) else pkgs.vscodium);
mutableExtensionsDir = lib.mkDefault true;
};
materus.profile.fonts.enable = lib.mkDefault true;
@@ -5,4 +5,4 @@
./neovim.nix
./emacs
];
}
}
@@ -1,74 +1,74 @@
{ config, lib, pkgs, materusArg, ... }:
let
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
inits = import ./init.nix {path = configPath; inherit pkgs;};
packages = epkgs: with epkgs; [
load-relative
elcord
persp-mode
dashboard
magit
helm
avy
corfu
vterm
centaur-tabs
projectile
company
clipetty
inits = import ./init.nix { path = configPath; inherit pkgs; };
packages = epkgs: with epkgs; [
load-relative
elcord
persp-mode
dashboard
magit
helm
avy
corfu
vterm
centaur-tabs
projectile
company
clipetty
treemacs
treemacs-nerd-icons
treemacs-perspective
treemacs-icons-dired
treemacs-magit
treemacs-projectile
tree-edit
vertico
nerd-icons
nerd-icons-completion
perspective
minions
telephone-line
rainbow-delimiters
use-package
treemacs
treemacs-nerd-icons
treemacs-perspective
treemacs-icons-dired
treemacs-magit
treemacs-projectile
tree-edit
vertico
nerd-icons
nerd-icons-completion
perspective
minions
telephone-line
rainbow-delimiters
use-package
cmake-mode
lsp-mode
lsp-java
lsp-jedi
lsp-haskell
lsp-ui
lsp-treemacs
dap-mode
d-mode
multiple-cursors
org
org-rainbow-tags
org-roam
org-roam-ui
org-review
markdown-mode
json-mode
nix-mode
minimap
cmake-mode
lsp-mode
lsp-java
lsp-jedi
lsp-haskell
lsp-ui
lsp-treemacs
dap-mode
d-mode
multiple-cursors
org
org-rainbow-tags
org-roam
org-roam-ui
org-review
markdown-mode
json-mode
nix-mode
moe-theme
doom-themes
];
minimap
moe-theme
doom-themes
];
default-config = ''
(defvar materus/nix-packages t)
(defvar materus/init-from-home nil)
(unless materus/init-from-home
(message "Config loading not from homeDir, need \"materus/init-from-home\" variable in init.el")
${setNixInit}
${inits.initText}
)
(defvar materus/nix-packages t)
(defvar materus/init-from-home nil)
(unless materus/init-from-home
(message "Config loading not from homeDir, need \"materus/init-from-home\" variable in init.el")
${setNixInit}
${inits.initText}
)
'';
emacsPkgs = with pkgs;[
@@ -93,29 +93,29 @@ in
config = lib.mkIf cfg.enable {
home.activation.emacsCompile = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
${config.programs.emacs.finalPackage}/bin/emacs --batch \
--eval '(setq warning-minimum-log-level :error)' \
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")'
${config.programs.emacs.finalPackage}/bin/emacs --batch \
--eval '(setq warning-minimum-log-level :error)' \
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")'
'';
xdg.configFile."emacs/init.el".text = ''
(defvar materus/nix-packages nil)
(defvar materus/init-from-home t)
(setq-default materus/init-from-home t)
(defvar materus/nix-packages nil)
(defvar materus/init-from-home t)
(setq-default materus/init-from-home t)
${setNixInit}
${inits.initText}
${setNixInit}
${inits.initText}
'';
xdg.configFile."emacs/early-init.el".text = ''
${inits.earlyInitText}
${inits.earlyInitText}
'';
programs.emacs = {
enable = true;
package = with pkgs; lib.mkDefault (emacs29.override { withX = true; withGTK3 = true; withAlsaLib = true; withGconf = true; withImageMagick = true; withXwidgets = true; });
extraPackages = epkgs: ((packages epkgs));
extraConfig = default-config;
extraConfig = default-config;
};
};
@@ -1,8 +1,8 @@
{path, pkgs}:
{ path, pkgs }:
{
earlyInitText = ''
${builtins.readFile (path + "early-init.el")}
${builtins.readFile (path + "early-init.el")}
'';
initText = ''
(defvar materus/init-from-home nil)
@@ -13,5 +13,5 @@
${builtins.readFile (path + "packages.el")}
${builtins.readFile (path + "init.el")}
'';
}
+12 -12
View File
@@ -1,6 +1,6 @@
{ config, lib, pkgs, materusArg, ... }:
let
cfg = config.materus.profile.editor.neovim;
cfg = config.materus.profile.editor.neovim;
in
{
options.materus.profile.editor.neovim.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable neovim with materus cfg";
@@ -14,21 +14,21 @@ in
extraConfig = ''
set number
set number
'';
plugins = with pkgs.vimPlugins;[
syntastic
vim-fugitive
vim-airline
vim-nix
plugins = with pkgs.vimPlugins;[
syntastic
nvim-fzf
nvim-treesitter.withAllGrammars
];
vim-fugitive
vim-airline
vim-nix
nvim-fzf
nvim-treesitter.withAllGrammars
];
};
};
+2 -2
View File
@@ -5,9 +5,9 @@ let
in
{
options.materus.profile.fonts.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus font settings";
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = lib.mkDefault true;
home.packages = packages.list.fonts;
};
}
}
+11 -11
View File
@@ -1,20 +1,20 @@
{ config, pkgs, lib, materusArg, ... }:
let
cfg = config.materus.profile.bash;
let
cfg = config.materus.profile.bash;
in
{
options.materus.profile.bash.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminal "Enable materus bash config";
options.materus.profile.bash.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminal "Enable materus bash config";
config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable {
programs.bash = {
enable = lib.mkDefault true;
enableCompletion = lib.mkDefault true;
enableVteIntegration = lib.mkDefault true;
historyControl = lib.mkDefault ["erasedups" "ignorespace"];
shellOptions = lib.mkDefault [ "autocd" "checkwinsize" "cmdhist" "expand_aliases" "extglob" "globstar" "checkjobs" "nocaseglob" ];
};
programs.bash = {
enable = lib.mkDefault true;
enableCompletion = lib.mkDefault true;
enableVteIntegration = lib.mkDefault true;
historyControl = lib.mkDefault [ "erasedups" "ignorespace" ];
shellOptions = lib.mkDefault [ "autocd" "checkwinsize" "cmdhist" "expand_aliases" "extglob" "globstar" "checkjobs" "nocaseglob" ];
};
};
}
@@ -1,9 +1,9 @@
{
imports = [
imports = [
./zsh.nix
./bash.nix
./fish.nix
./starship.nix
];
}
];
}
+3 -3
View File
@@ -1,6 +1,6 @@
{ config, pkgs, lib, materusArg, ... }:
let
cfg = config.materus.profile.fish;
let
cfg = config.materus.profile.fish;
in
{
options.materus.profile.fish.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus fish config";
@@ -9,4 +9,4 @@ in
enable = lib.mkDefault true;
};
};
}
}
@@ -17,7 +17,7 @@ in
format = "$username@$hostname$all";
right_format = "$cmd_duration $time";
time = {
disabled = false;
style = "bold bright-black";
@@ -28,8 +28,8 @@ in
shell = {
disabled = false;
fish_indicator = "fish";
bash_indicator= "bash";
zsh_indicator= "zsh";
bash_indicator = "bash";
zsh_indicator = "zsh";
style = "blue bold";
};
+23 -22
View File
@@ -2,8 +2,9 @@
let
relToDotDir = file: (lib.optionalString (config.programs.zsh.dotDir != null) (config.programs.zsh.dotDir + "/")) + file;
pluginsDir = if config.programs.zsh.dotDir != null then
relToDotDir "plugins" else ".zsh/plugins";
pluginsDir =
if config.programs.zsh.dotDir != null then
relToDotDir "plugins" else ".zsh/plugins";
@@ -14,16 +15,16 @@ let
makeEnv = name: val: ''${name}=''${${name}:-"${val}"}'';
makeIfVar = var: val: ret: ''
if [ ''$${var} = "${val}" ]; then
${ret}
fi'';
if [ ''$${var} = "${val}" ]; then
${ret}
fi'';
makePlugin = nameArg: fileArg: srcArg: rec {
makePlugin = nameArg: fileArg: srcArg: rec {
name = nameArg;
src = srcArg;
path = pluginsDir + "/" + name;
@@ -33,20 +34,20 @@ let
extraPlugins = {
powerlevel10k = makePlugin "powerlevel10k" "powerlevel10k.zsh-theme" (pkgs.fetchFromGitHub {
owner = "romkatv";
repo = "powerlevel10k";
rev = "v1.20.0";
sha256 = "sha256-ES5vJXHjAKw/VHjWs8Au/3R+/aotSbY7PWnWAMzCR8E=";
});
owner = "romkatv";
repo = "powerlevel10k";
rev = "v1.20.0";
sha256 = "sha256-ES5vJXHjAKw/VHjWs8Au/3R+/aotSbY7PWnWAMzCR8E=";
});
};
in
{
options.materus.profile.zsh.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus zsh config";
options.materus.profile.zsh.prompt = lib.mkOption {
type = lib.types.enum ["p10k" "starship"];
example = "p10k";
default = "p10k";
type = lib.types.enum [ "p10k" "starship" ];
example = "p10k";
default = "p10k";
};
@@ -54,8 +55,8 @@ in
home.packages = [
pkgs.ripgrep
];
home.file = builtins.foldl' (a: b: a // b) {} (builtins.map (plugin: {${plugin.path}.source = plugin.src;})(builtins.attrValues extraPlugins));
home.file = builtins.foldl' (a: b: a // b) { } (builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins));
programs.zsh = {
enable = true;
@@ -68,8 +69,8 @@ in
envExtra = ''
${makeEnv "__MATERUS_HM_ZSH" "1"}
${makeEnv "__MATERUS_HM_ZSH_PROMPT" cfg.prompt}
${makeEnv "__MATERUS_HM_ZSH" "1"}
${makeEnv "__MATERUS_HM_ZSH_PROMPT" cfg.prompt}
'';
@@ -88,7 +89,7 @@ in
plugins = [
];
history = {
extended = true;
save = 100000;
@@ -106,8 +107,8 @@ in
bindkey -r "^["
bindkey ";5C" forward-word
bindkey ";5D" backward-word
'' +
makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" ''
'' +
makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" ''
if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then
[[ ! -f ${p10kcfg}/fullcolor.zsh ]] || source ${p10kcfg}/fullcolor.zsh
else
@@ -117,7 +118,7 @@ in
};
programs.starship.enableZshIntegration = lib.mkForce false;
programs.starship.enableZshIntegration = lib.mkForce false;
};