Format using nixfmt rfc style

This commit is contained in:
Paul-Henri Froidmont 2024-08-20 22:58:24 +02:00
parent d07a224bbc
commit f6be5f8b80
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
37 changed files with 934 additions and 612 deletions

View file

@ -1,12 +1,19 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.apps.rofi;
in {
options.modules.apps.rofi = { enable = mkBoolOpt false; };
let
cfg = config.modules.apps.rofi;
in
{
options.modules.apps.rofi = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
programs.rofi = {
@ -31,7 +38,10 @@ in {
};
theme = ./theme.rasi;
};
home.packages = with pkgs.unstable; [ paper-icon-theme rofi-power-menu ];
home.packages = with pkgs.unstable; [
paper-icon-theme
rofi-power-menu
];
};
};
}

View file

@ -1,9 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
wallpaper = pkgs.fetchurl {
url =
"https://raw.githubusercontent.com/AngelJumbo/gruvbox-wallpapers/main/wallpapers/irl/houseonthesideofalake.jpg";
url = "https://raw.githubusercontent.com/AngelJumbo/gruvbox-wallpapers/main/wallpapers/irl/houseonthesideofalake.jpg";
sha256 = "sha256-obKI4qZvucogqRCl51lwV9X8SRaMqcbBwWMfc9TupIo=";
};
in
@ -23,9 +27,16 @@ in
corefonts # Microsoft free fonts
noto-fonts-emoji
meslo-lg
(nerdfonts.override { fonts = [ "Meslo" "NerdFontsSymbolsOnly" ]; })
(nerdfonts.override {
fonts = [
"Meslo"
"NerdFontsSymbolsOnly"
];
})
];
fontconfig.defaultFonts = { monospace = [ "MesloLGS Nerd Font Mono" ]; };
fontconfig.defaultFonts = {
monospace = [ "MesloLGS Nerd Font Mono" ];
};
};
programs.adb.enable = true;
@ -57,7 +68,9 @@ in
key = lib.mkDefault "3AC6F170F01133CE393BCD94BE948AFD7E7873BE";
signByDefault = true;
};
extraConfig = { init.defaultBranch = "master"; };
extraConfig = {
init.defaultBranch = "master";
};
};
ssh = {
enable = true;
@ -121,10 +134,8 @@ in
"application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
"application/msword" = "onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument.presentationml.presentation" =
"onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument*" =
"onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = "onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument*" = "onlyoffice-desktopeditors.desktop";
"text/*" = "nvim.desktop";
};
@ -139,37 +150,37 @@ in
sessionVariables.EDITOR = "vim";
packages = (with pkgs.unstable; [
brave
ungoogled-chromium
mullvad-browser
keepassxc
krita
element-desktop
swayimg
mpv
mumble
libreoffice-fresh
onlyoffice-bin
thunderbird
portfolio
gnucash
transmission-remote-gtk
monero-gui
packages =
(with pkgs.unstable; [
brave
ungoogled-chromium
mullvad-browser
keepassxc
krita
element-desktop
swayimg
mpv
mumble
libreoffice-fresh
onlyoffice-bin
thunderbird
portfolio
gnucash
transmission-remote-gtk
monero-gui
scala-cli
jdk
jetbrains.idea-community
httpie
scala-cli
jdk
jetbrains.idea-community
httpie
zsh-syntax-highlighting
R
tldr
ark
linuxPackages.perf
]) ++ [
pkgs.jellyfin-mpv-shim
];
zsh-syntax-highlighting
R
tldr
ark
linuxPackages.perf
])
++ [ pkgs.jellyfin-mpv-shim ];
};
};

View file

@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.dunst;
in {
options.modules.desktop.dunst = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
let
cfg = config.modules.desktop.dunst;
in
{
options.modules.desktop.dunst = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
services.dunst = {
enable = true;

View file

@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.file-manager;
in {
options.modules.desktop.file-manager = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
let
cfg = config.modules.desktop.file-manager;
in
{
options.modules.desktop.file-manager = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
programs.yazi = {
@ -39,11 +46,13 @@ in {
desc = "Copy files to clipboard";
}
];
input.prepend_keymap = [{
on = [ "<Esc>" ];
run = "close";
desc = "Cancel input";
}];
input.prepend_keymap = [
{
on = [ "<Esc>" ];
run = "close";
desc = "Cancel input";
}
];
};
theme = {
status = {

View file

@ -1,34 +1,44 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.flameshot;
in {
options.modules.desktop.flameshot = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
services.flameshot = {
enable = true;
package = pkgs.flameshot.overrideAttrs (old: {
src = inputs.flameshot-git;
cmakeFlags = [ "-DUSE_WAYLAND_GRIM=1" ];
});
settings = {
General = {
showStartupLaunchMessage = false;
disabledTrayIcon = true;
showHelp = false;
showDesktopNotification = false;
filenamePattern = "%F_%T";
savePath = "${config.home.homeDirectory}/Pictures/Screenshots";
savePathFixed = true;
saveAfterCopy = true;
uiColor = "#83A598";
let
cfg = config.modules.desktop.flameshot;
in
{
options.modules.desktop.flameshot = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
services.flameshot = {
enable = true;
package = pkgs.flameshot.overrideAttrs (old: {
src = inputs.flameshot-git;
cmakeFlags = [ "-DUSE_WAYLAND_GRIM=1" ];
});
settings = {
General = {
showStartupLaunchMessage = false;
disabledTrayIcon = true;
showHelp = false;
showDesktopNotification = false;
filenamePattern = "%F_%T";
savePath = "${config.home.homeDirectory}/Pictures/Screenshots";
savePathFixed = true;
saveAfterCopy = true;
uiColor = "#83A598";
};
};
};
};
home.packages = with pkgs.unstable; [ grim ];
home.packages = with pkgs.unstable; [ grim ];
};
};
};
}

View file

@ -1,45 +1,61 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.htop;
in {
options.modules.desktop.htop = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
programs.htop = {
enable = true;
package = pkgs.htop-vim;
settings = {
hide_userland_threads = true;
highlight_base_name = true;
vim_mode = true;
fields = with config.lib.htop.fields; [
PID
USER
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
IO_RATE
TIME
COMM
];
} // (with config.lib.htop;
leftMeters [
(bar "LeftCPUs2")
(bar "CPU")
(bar "Memory")
(bar "Swap")
]) // (with config.lib.htop;
rightMeters [
(bar "RightCPUs2")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
]);
let
cfg = config.modules.desktop.htop;
in
{
options.modules.desktop.htop = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
programs.htop = {
enable = true;
package = pkgs.htop-vim;
settings =
{
hide_userland_threads = true;
highlight_base_name = true;
vim_mode = true;
fields = with config.lib.htop.fields; [
PID
USER
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
IO_RATE
TIME
COMM
];
}
// (
with config.lib.htop;
leftMeters [
(bar "LeftCPUs2")
(bar "CPU")
(bar "Memory")
(bar "Swap")
]
)
// (
with config.lib.htop;
rightMeters [
(bar "RightCPUs2")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
]
);
};
};
};
};
}

View file

@ -1,7 +1,10 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.desktop.themes.gtk;
@ -9,8 +12,7 @@ let
name = "gruvbox-plus";
version = "5.1";
src = pkgs.fetchurl {
url =
"https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v${version}/gruvbox-plus-icon-pack-${version}.zip";
url = "https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v${version}/gruvbox-plus-icon-pack-${version}.zip";
sha256 = "1n3hqwk1mqaj8vbmy0pqbiq6v5jqrhmhin506xbpnccl28f907j0";
};
dontUnpack = true;
@ -20,10 +22,13 @@ let
'';
};
in {
options.modules.desktop.themes.gtk = { enable = mkBoolOpt false; };
in
{
options.modules.desktop.themes.gtk = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.packages = [ pkgs.dconf ];
@ -48,8 +53,12 @@ in {
};
xdg.configFile = {
"gtk-3.0/gtk.css" = { source = ./gtk.css; };
"gtk-4.0/gtk.css" = { source = ./gtk.css; };
"gtk-3.0/gtk.css" = {
source = ./gtk.css;
};
"gtk-4.0/gtk.css" = {
source = ./gtk.css;
};
};
home = {

View file

@ -1,13 +1,20 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.themes.qt;
let
cfg = config.modules.desktop.themes.qt;
in {
options.modules.desktop.themes.qt = { enable = mkBoolOpt false; };
in
{
options.modules.desktop.themes.qt = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
libsForQt5.qt5.qtquickcontrols2

View file

@ -1,29 +1,32 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.vscode;
in {
let
cfg = config.modules.desktop.vscode;
in
{
options.modules.desktop.vscode = {
enable = mkBoolOpt false;
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = (
with pkgs.vscode-extensions; [
pkief.material-icon-theme
jnoortheen.nix-ide
arrterian.nix-env-selector
scala-lang.scala
scalameta.metals
hashicorp.terraform
bradlc.vscode-tailwindcss
asciidoctor.asciidoctor-vscode
]
);
extensions = with pkgs.vscode-extensions; [
pkief.material-icon-theme
jnoortheen.nix-ide
arrterian.nix-env-selector
scala-lang.scala
scalameta.metals
hashicorp.terraform
bradlc.vscode-tailwindcss
asciidoctor.asciidoctor-vscode
];
userSettings = {
"editor.formatOnSave" = true;
"editor.quickSuggestions" = {
@ -33,8 +36,14 @@ in {
"scala" = "html";
};
"tailwindCSS.experimental.classRegex" = [
[ "cls\\(([^)]*)\\)" "\"([^']*)\"" ]
[ "cls\\s*:=\\s*\\(?([^,^\\n^\\)]*)" "\"([^']*)\"" ]
[
"cls\\(([^)]*)\\)"
"\"([^']*)\""
]
[
"cls\\s*:=\\s*\\(?([^,^\\n^\\)]*)"
"\"([^']*)\""
]
];
"files.autoSave" = "onFocusChange";
@ -50,9 +59,7 @@ in {
"terraform.languageServer" = {
"external" = true;
"pathToBinary" = "";
"args" = [
"serve"
];
"args" = [ "serve" ];
"maxNumberOfProblems" = 100;
"trace.server" = "off";
};

View file

@ -1,18 +1,20 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.my;
{
config,
lib,
pkgs,
...
}:
let
cfg = config.modules.desktop.wm;
term = "${
config.home-manager.users.${config.user.name}.programs.kitty.package
}/bin/kitty";
term = "${config.home-manager.users.${config.user.name}.programs.kitty.package}/bin/kitty";
in
{
options.modules.desktop.wm = { enable = mkBoolOpt false; };
options.modules.desktop.wm = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
modules = {
desktop = {
@ -28,7 +30,9 @@ in
htop.enable = true;
flameshot.enable = true;
};
hardware = { audio.enable = true; };
hardware = {
audio.enable = true;
};
apps.rofi.enable = true;
};
@ -113,14 +117,20 @@ in
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
systemd.enable = true;
xwayland.enable = true;
settings = {
"$mod" = "SUPER";
env = [ "XCURSOR_SIZE,24" "WLR_NO_HARDWARE_CURSORS,1" ];
env = [
"XCURSOR_SIZE,24"
"WLR_NO_HARDWARE_CURSORS,1"
];
xwayland = { force_zero_scaling = true; };
xwayland = {
force_zero_scaling = true;
};
general = {
layout = "dwindle";
@ -134,7 +144,9 @@ in
hover_icon_on_border = false;
};
dwindle = { preserve_split = true; };
dwindle = {
preserve_split = true;
};
input = {
kb_layout = "fr";
@ -294,9 +306,19 @@ in
height = 25;
spacing = 2;
reload-style-on-change = true;
modules-left = [ "cpu" "memory" "disk" "hyprland/window" ];
modules-left = [
"cpu"
"memory"
"disk"
"hyprland/window"
];
modules-center = [ "hyprland/workspaces" ];
modules-right = [ "mpd" "battery" "clock" "tray" ];
modules-right = [
"mpd"
"battery"
"clock"
"tray"
];
tray = {
icon-size = 14;
@ -391,7 +413,11 @@ in
};
home = {
packages = with pkgs.unstable; [ wlr-randr wl-clipboard wdisplays ];
packages = with pkgs.unstable; [
wlr-randr
wl-clipboard
wdisplays
];
};
programs.swaylock = {

View file

@ -1,67 +1,95 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let cfg = config.modules.desktop.zsh;
in {
options.modules.desktop.zsh = { enable = lib.my.mkBoolOpt false; };
let
cfg = config.modules.desktop.zsh;
in
{
options.modules.desktop.zsh = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
environment.pathsToLink = [ "/share/zsh" ];
programs.zsh.enable = true;
users.users.${config.user.name} = { shell = pkgs.zsh; };
users.users.${config.user.name} = {
shell = pkgs.zsh;
};
home-manager.users.${config.user.name} = {
programs.zsh = {
enable = true;
history = {
save = 50000;
size = 50000;
};
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtra = /*bash*/''
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
'';
oh-my-zsh = {
programs = {
zsh = {
enable = true;
plugins = [ "git" "terraform" "systemd" ];
};
plugins = [
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
];
};
programs.thefuck = {
enable = true;
enableZshIntegration = true;
};
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
cmd_duration = {
min_time = 0;
show_milliseconds = true;
history = {
save = 50000;
size = 50000;
};
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtra = # bash
''
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
'';
oh-my-zsh = {
enable = true;
plugins = [
"git"
"terraform"
"systemd"
];
};
plugins = [
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
];
};
thefuck = {
enable = true;
enableZshIntegration = true;
};
starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
cmd_duration = {
min_time = 0;
show_milliseconds = true;
};
scala = {
symbol = " ";
};
terraform = {
symbol = "󱁢 ";
};
nix_shell = {
symbol = "󱄅 ";
};
nodejs = {
symbol = " ";
};
php = {
symbol = " ";
};
};
scala = { symbol = " "; };
terraform = { symbol = "󱁢 "; };
nix_shell = { symbol = "󱄅 "; };
nodejs = { symbol = " "; };
php = { symbol = " "; };
};
};
};

View file

@ -1,73 +1,93 @@
{ inputs, config, lib, pkgs, ... }:
{
inputs,
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.editor.emacs;
in {
options.modules.editor.emacs = { enable = mkBoolOpt false; };
let
cfg = config.modules.editor.emacs;
in
{
options.modules.editor.emacs = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
home.packages = with pkgs.unstable; [
binutils
ripgrep
fd
findutils.locate
python311
libsecret
gcc
gnumake
cmake
nodejs
home = {
packages = [
pkgs.unstable.binutils
pkgs.unstable.ripgrep
pkgs.unstable.fd
pkgs.unstable.findutils.locate
pkgs.unstable.python311
pkgs.unstable.libsecret
pkgs.unstable.gcc
pkgs.unstable.gnumake
pkgs.unstable.cmake
pkgs.unstable.nodejs
opentofu
pandoc
pkgs.unstable.opentofu
pkgs.unstable.pandoc
# Formatters and linters
nixfmt-rfc-style # nix formatter
nixpkgs-fmt
shfmt # sh formatter
shellcheck # sh linter
html-tidy # HTML formatter
nodePackages.stylelint # CSS linter
nodePackages.js-beautify # JS/CSS/HTML formatter
# Formatters and linters
pkgs.unstable.nixfmt-rfc-style # nix formatter
pkgs.unstable.nixpkgs-fmt
pkgs.unstable.shfmt # sh formatter
pkgs.unstable.shellcheck # sh linter
pkgs.unstable.html-tidy # HTML formatter
pkgs.unstable.nodePackages.stylelint # CSS linter
pkgs.unstable.nodePackages.js-beautify # JS/CSS/HTML formatter
# LSPs
coursier
# metals # Scala
# LSPs
pkgs.unstable.coursier
# metals # Scala
# Nix
nil
# Nix
pkgs.unstable.nil
pkgs.phpactor # PHP
#OCaml
ocaml
dune_3
ocamlPackages.ocaml-lsp
ocamlPackages.ocamlformat
ocamlPackages.utop
ocamlPackages.ocp-indent
ocamlPackages.merlin
pkgs.phpactor # PHP
#OCaml
pkgs.unstable.ocaml
pkgs.unstable.dune_3
pkgs.unstable.ocamlPackages.ocaml-lsp
pkgs.unstable.ocamlPackages.ocamlformat
pkgs.unstable.ocamlPackages.utop
pkgs.unstable.ocamlPackages.ocp-indent
pkgs.unstable.ocamlPackages.merlin
# Used by org-roam
sqlite
graphviz
# Used by org-roam
pkgs.unstable.sqlite
pkgs.unstable.graphviz
# Used by elfeed-tube
yt-dlp
mpv
# Used by elfeed-tube
pkgs.unstable.yt-dlp
pkgs.unstable.mpv
# Used by dirvish
imagemagick
ffmpegthumbnailer
mediainfo
poppler
gnutar
unzip
];
# Used by dirvish
pkgs.unstable.imagemagick
pkgs.unstable.ffmpegthumbnailer
pkgs.unstable.mediainfo
pkgs.unstable.poppler
pkgs.unstable.gnutar
pkgs.unstable.unzip
];
sessionPath = [ "${config.home-manager.users.${config.user.name}.xdg.configHome}/emacs/bin" ];
activation = {
installDoomEmacs = ''
if [ ! -d "${config.home-manager.users.${config.user.name}.xdg.configHome}/emacs" ]; then
git clone --depth=1 --single-branch https://github.com/doomemacs/doomemacs "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs"
fi
'';
};
};
services.emacs = {
enable = true;
@ -83,29 +103,17 @@ in {
withTreeSitter = true;
withWebP = true;
};
extraPackages = epkgs:
with epkgs; [
extraPackages =
epkgs: with epkgs; [
vterm
pdf-tools
treesit-grammars.with-all-grammars
];
};
xdg.configFile = { "doom" = { source = ./doom.d; }; };
home.sessionPath = [
"${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs/bin"
];
home.activation = {
installDoomEmacs = ''
if [ ! -d "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs" ]; then
git clone --depth=1 --single-branch https://github.com/doomemacs/doomemacs "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs"
fi
'';
xdg.configFile = {
"doom" = {
source = ./doom.d;
};
};
};
};

View file

@ -1,12 +1,19 @@
{ options, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.hardware.audio;
in {
options.modules.hardware.audio = { enable = mkBoolOpt false; };
let
cfg = config.modules.hardware.audio;
in
{
options.modules.hardware.audio = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
sound.enable = true;
security.rtkit.enable = true;

View file

@ -1,24 +1,29 @@
{ options, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.media.emulators;
in {
let
cfg = config.modules.media.emulators;
in
{
options.modules.media.emulators = {
psx.enable = mkBoolOpt false; # Playstation
ds.enable = mkBoolOpt false; # Nintendo DS
gc.enable = mkBoolOpt false; # GameCube
gb.enable = mkBoolOpt false; # GameBoy + GameBoy Color
gba.enable = mkBoolOpt false; # GameBoy Advance
snes.enable = mkBoolOpt false; # Super Nintendo
psx.enable = lib.my.mkBoolOpt false; # Playstation
ds.enable = lib.my.mkBoolOpt false; # Nintendo DS
gc.enable = lib.my.mkBoolOpt false; # GameCube
gb.enable = lib.my.mkBoolOpt false; # GameBoy + GameBoy Color
gba.enable = lib.my.mkBoolOpt false; # GameBoy Advance
snes.enable = lib.my.mkBoolOpt false; # Super Nintendo
};
config = {
user.packages = with pkgs; [
(mkIf cfg.psx.enable duckstation)
(mkIf cfg.ds.enable desmume)
(mkIf cfg.gc.enable dolphinEmu)
(mkIf (cfg.gba.enable || cfg.gb.enable || cfg.snes.enable) higan)
user.packages = [
(lib.mkIf cfg.psx.enable pkgs.duckstation)
(lib.mkIf cfg.ds.enable pkgs.desmume)
(lib.mkIf cfg.gc.enable pkgs.dolphinEmu)
(lib.mkIf (cfg.gba.enable || cfg.gb.enable || cfg.snes.enable) pkgs.higan)
];
};
}

View file

@ -1,20 +1,25 @@
{ options, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.media;
in {
let
cfg = config.modules.media;
in
{
options.modules.media = {
steam.enable = mkBoolOpt false;
lutris.enable = mkBoolOpt false;
steam.enable = lib.my.mkBoolOpt false;
lutris.enable = lib.my.mkBoolOpt false;
};
config = {
user.packages = with pkgs; [
(mkIf cfg.steam.enable steam)
(mkIf cfg.lutris.enable lutris)
(mkIf cfg.lutris.enable wine)
(mkIf (cfg.steam.enable || cfg.lutris.enable) protontricks)
user.packages = [
(lib.mkIf cfg.steam.enable pkgs.steam)
(lib.mkIf cfg.lutris.enable pkgs.lutris)
(lib.mkIf cfg.lutris.enable pkgs.wine)
(lib.mkIf (cfg.steam.enable || cfg.lutris.enable) pkgs.protontricks)
];
};
}

View file

@ -1,34 +1,38 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
with lib;
with lib.my;
let cfg = config.modules.media.mpd;
in {
options.modules.media.mpd = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
services.mpd = {
enable = true;
network.listenAddress = "any";
musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music";
playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists";
extraConfig = ''
max_output_buffer_size "16384"
auto_update "yes"
audio_output {
type "pulse"
name "pulse audio"
device "pulse"
mixer_type "hardware"
}
audio_output {
type "fifo"
name "toggle_visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
'';
let
cfg = config.modules.media.mpd;
in
{
options.modules.media.mpd = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
services.mpd = {
enable = true;
network.listenAddress = "any";
musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music";
playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists";
extraConfig = ''
max_output_buffer_size "16384"
auto_update "yes"
audio_output {
type "pulse"
name "pulse audio"
device "pulse"
mixer_type "hardware"
}
audio_output {
type "fifo"
name "toggle_visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
'';
};
};
};
};
}

View file

@ -1,12 +1,19 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.media.ncmpcpp;
in {
options.modules.media.ncmpcpp = { enable = mkBoolOpt false; };
let
cfg = config.modules.media.ncmpcpp;
in
{
options.modules.media.ncmpcpp = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
home = {

View file

@ -1,19 +1,28 @@
{ config, options, lib, home-manager, ... }:
{
config,
options,
lib,
...
}:
with lib;
with lib.my; {
options = with types; { user = mkOpt attrs { }; };
{
options = {
user = lib.my.mkOpt lib.types.attrs { };
};
config = {
user = {
name = "froidmpa";
description = "The primary user account";
extraGroups = [ "wheel" "adbusers" ];
extraGroups = [
"wheel"
"adbusers"
];
isNormalUser = true;
};
users.users.${config.user.name} = mkAliasDefinitions options.user;
users.users.${config.user.name} = lib.mkAliasDefinitions options.user;
home-manager = {
useUserPackages = true;
@ -21,7 +30,7 @@ with lib.my; {
users.${config.user.name} = {
home = {
enableNixpkgsReleaseCheck = true;
stateVersion = config.system.stateVersion;
inherit (config.system) stateVersion;
};
};
};

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.belgian-eid;
in
{
options.modules.services.belgian-eid = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.belgian-eid;
in {
options.modules.services.belgian-eid = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.pcscd.enable = true;

View file

@ -1,19 +1,25 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.docker;
in
{
options.modules.services.docker = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.docker;
in {
options.modules.services.docker = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
virtualisation = {
docker = {
enable = true;
autoPrune.enable = true;
enableOnBoot = mkDefault false;
enableOnBoot = lib.mkDefault false;
};
};

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.flatpak;
in
{
options.modules.services.flatpak = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.flatpak;
in {
options.modules.services.flatpak = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.flatpak.enable = true;
xdg.portal = {

View file

@ -1,13 +1,14 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
with lib;
with lib.my;
let
cfg = config.modules.services.languagetool;
in
{
options.modules.services.languagetool = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.languagetool;
in {
options.modules.services.languagetool = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.languagetool = {
enable = true;
allowOrigin = "*";

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.libvirt;
in
{
options.modules.services.libvirt = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.libvirt;
in {
options.modules.services.libvirt = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
virtualisation = {
libvirtd.enable = true;