1
0
Fork 0

modules(neovim): add formatter-nvim

This commit is contained in:
Antoine Langlois 2024-05-05 20:35:34 +02:00
parent 18cf42afc6
commit d460a40e0a
Signed by: DataHearth
GPG Key ID: ABF6737C63396D35
31 changed files with 289 additions and 345 deletions

View File

@ -1,22 +1,17 @@
{ inputs, pkgs, lib, hyprlock, hypridle, mac-app-util, ... }: {
imports = [
./services.nix
../../modules/neovim
];
imports = [ ./services.nix ../../modules/neovim ];
# Nix
nix.settings.experimental-features = "nix-command flakes";
nixpkgs.hostPlatform = "x86_64-darwin";
nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [
"nix-2.16.2"
];
nixpkgs.config.permittedInsecurePackages = [ "nix-2.16.2" ];
# System
system.stateVersion = 4;
system.configurationRevision = inputs.rev or inputs.dirtyRev or null;
environment.systemPackages = with pkgs; [];
environment.systemPackages = with pkgs; [ ];
environment.shells = with pkgs; [ zsh ];
users.users.antoine = {
@ -28,14 +23,10 @@
extraSpecialArgs = { inherit inputs hyprlock hypridle mac-app-util; };
useGlobalPkgs = true;
useUserPackages = true;
users = {
"antoine" = import ./home-manager/home.nix;
};
users = { "antoine" = import ./home-manager/home.nix; };
};
custom = {
neovim.enable = true;
};
custom = { neovim.enable = true; };
programs = {
zsh.enable = true;
@ -44,9 +35,7 @@
};
fonts.fonts = with pkgs; [
(nerdfonts.override {
fonts = ["FiraCode" "Mononoki"];
})
(nerdfonts.override { fonts = [ "FiraCode" "Mononoki" ]; })
corefonts
];
}

View File

@ -1,5 +1,4 @@
{ pkgs, hyprlock, hypridle, mac-app-util, ... }:
{
{ pkgs, hyprlock, hypridle, mac-app-util, ... }: {
imports = [
../../shared/hm.nix
@ -8,9 +7,7 @@
mac-app-util.homeManagerModules.default
] ++ (import ../../../modules/home-manager);
home.packages = with pkgs; [
pinentry_mac
];
home.packages = with pkgs; [ pinentry_mac ];
hm = {
ssh.enable = true;
@ -21,9 +18,7 @@
};
};
programs = {
bash.enable = true;
};
programs = { bash.enable = true; };
home.stateVersion = "24.05";
}

View File

@ -1,4 +1 @@
{ ... }:
{
services.nix-daemon.enable = true;
}
{ ... }: { services.nix-daemon.enable = true; }

View File

@ -1,5 +1,4 @@
{ pkgs, lib, hyprlock, hypridle, ... }:
{
{ pkgs, lib, hyprlock, hypridle, ... }: {
imports = [
# Modules
../../modules/linux/passthrough.nix
@ -48,7 +47,7 @@
driSupport = true;
};
};
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
@ -63,22 +62,18 @@
LC_TIME = "fr_FR.UTF-8";
};
};
security = {
rtkit.enable = true;
polkit.enable = true;
pam.services = {
swaylock = {};
hyprlock = {};
swaylock = { };
hyprlock = { };
};
};
xdg = {
portal = {
enable = true;
};
};
xdg = { portal = { enable = true; }; };
users = {
defaultUserShell = pkgs.zsh;
@ -111,9 +106,7 @@
};
fonts.packages = with pkgs; [
(nerdfonts.override {
fonts = ["FiraCode" "Mononoki"];
})
(nerdfonts.override { fonts = [ "FiraCode" "Mononoki" ]; })
corefonts
];
@ -121,31 +114,27 @@
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit hyprlock hypridle; };
users = {
"datahearth" = import ./home-manager/home.nix;
};
users = { "datahearth" = import ./home-manager/home.nix; };
};
programs = {
steam.enable = true;
hyprland.enable = true;
zsh.enable = true;
wireshark.enable = true;
};
custom = {
neovim.enable = true;
};
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 datahearth libvirtd -"
];
custom = { neovim.enable = true; };
systemd.tmpfiles.rules =
[ "f /dev/shm/looking-glass 0660 datahearth libvirtd -" ];
fileSystems = let
# this line prevents hanging on network split
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
smb_secrets = "/home/datahearth/.config/nix-config/smb-secrets";
in {
# this line prevents hanging on network split
automount_opts =
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
smb_secrets = "/home/datahearth/.config/nix-config/smb-secrets";
in {
"/mnt/cronos/medias" = lib.mkForce {
device = "//10.0.0.2/medias";
fsType = "cifs";

View File

@ -4,38 +4,36 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/db8a2e82-2dbe-40cb-9774-fd004bbf633e";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/db8a2e82-2dbe-40cb-9774-fd004bbf633e";
fsType = "ext4";
};
fileSystems."/mnt/cronos/isos" =
{ device = "systemd-1";
fsType = "autofs";
};
fileSystems."/mnt/cronos/isos" = {
device = "systemd-1";
fsType = "autofs";
};
fileSystems."/mnt/cronos/medias" =
{ device = "systemd-1";
fsType = "autofs";
};
fileSystems."/mnt/cronos/medias" = {
device = "systemd-1";
fsType = "autofs";
};
fileSystems."/mnt/linux-games" =
{ device = "/dev/disk/by-uuid/a0bd2373-edc1-4c95-aac1-85aa6c5bacc0";
fsType = "ext4";
};
fileSystems."/mnt/linux-games" = {
device = "/dev/disk/by-uuid/a0bd2373-edc1-4c95-aac1-85aa6c5bacc0";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/61135a24-abf9-4fe8-b224-75848e56efc4"; }
];
[{ device = "/dev/disk/by-uuid/61135a24-abf9-4fe8-b224-75848e56efc4"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
@ -47,5 +45,6 @@
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,8 +1,7 @@
{ pkgs, hyprlock, hypridle, ... }:
{
imports = let
{ pkgs, hyprlock, hypridle, ... }: {
imports = let
modules_base_path = ../../../modules;
modules_hm_path = modules_base_path + "/home-manager";
modules_hm_path = modules_base_path + "/home-manager";
in [
"${modules_hm_path}/looking-glass"
"${modules_hm_path}/vscode"
@ -88,12 +87,12 @@
lockBackgroundImage = "~/Pictures/wallpapers/lock2.png";
defaultDisplay = "DP-2";
};
git = {
enable = true;
signingKey = "A12925470298BFEE7EE092B3946E2D0C410C7B3D";
};
zellij = {
enable = false;
copy_command = "wl-copy";
@ -113,10 +112,8 @@
"8, monitor:HDMI-A-1"
"10, monitor:HDMI-A-1"
];
monitorSettings = [
"DP-2,preferred,0x0,2"
"HDMI-A-1,preferred,1920x0,1"
];
monitorSettings =
[ "DP-2,preferred,0x0,2" "HDMI-A-1,preferred,1920x0,1" ];
nvidia = true;
};
};

View File

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
services = {
playerctld.enable = true;
ssh-agent.enable = true;
@ -14,6 +13,6 @@
pinentryPackage = pkgs.pinentry-qt;
defaultCacheTtl = 86400;
maxCacheTtl = 86400;
};
};
};
}

View File

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
services = {
xserver = {
enable = true;
@ -31,7 +30,8 @@
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --user-menu --time --greeting \"Speak Friend and Enter\" --remember --remember-user-session --asterisks --cmd Hyprland";
command = ''
${pkgs.greetd.tuigreet}/bin/tuigreet --user-menu --time --greeting "Speak Friend and Enter" --remember --remember-user-session --asterisks --cmd Hyprland'';
user = "datahearth";
};
};

View File

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
home.packages = with pkgs; [
asciinema
awscli2
@ -36,10 +35,7 @@
zellij
zip
];
home.sessionPath = [
"$(go env GOBIN)"
"$HOME/.cargo/bin"
];
home.sessionPath = [ "$(go env GOBIN)" "$HOME/.cargo/bin" ];
programs = {
zoxide.enable = true;
@ -57,12 +53,10 @@
enableZshIntegration = true;
enableBashIntegration = true;
};
bat = {
enable = true;
config = {
theme = "catppuccin_macchiato";
};
config = { theme = "catppuccin_macchiato"; };
themes = {
catppuccin_macchiato = {
src = pkgs.fetchFromGitHub {
@ -86,16 +80,15 @@
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
};
syntaxHighlighting = { enable = true; };
oh-my-zsh = {
enable = true;
theme = "robbyrussell";
custom = "$HOME/.oh-my-zsh/custom";
plugins = ["git" "npm" "golang" "docker" "docker-compose" "python" "node"];
plugins =
[ "git" "npm" "golang" "docker" "docker-compose" "python" "node" ];
};
plugins = [];
plugins = [ ];
shellAliases = {
cat = "bat";
dc = "docker compose";

View File

@ -6,7 +6,7 @@ let
enable = mkEnableOption "alacritty";
themes = mkOption {
type = types.listOf types.path;
default = [];
default = [ ];
description = "List of themes to install";
example = [
(builtins.fetchurl {
@ -27,11 +27,8 @@ let
description = "Font size";
example = 14;
};
in
{
options.hm.alacritty = {
inherit enable themes opacity fontSize;
};
in {
options.hm.alacritty = { inherit enable themes opacity fontSize; };
config = mkIf cfg.enable {
programs.alacritty = {
@ -39,22 +36,19 @@ in
settings = {
import = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/alacritty/832787d6cc0796c9f0c2b03926f4a83ce4d4519b/catppuccin-macchiato.toml";
url =
"https://raw.githubusercontent.com/catppuccin/alacritty/832787d6cc0796c9f0c2b03926f4a83ce4d4519b/catppuccin-macchiato.toml";
sha256 = "1iq187vg64h4rd15b8fv210liqkbzkh8sw04ykq0hgpx20w3qilv";
})
] ++ cfg.themes;
env.TERM = "xterm-256color";
font = {
size = cfg.fontSize;
normal = {
family = "Mononoki Nerd Font";
};
normal = { family = "Mononoki Nerd Font"; };
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
window = {
opacity = cfg.opacity;
};
window = { opacity = cfg.opacity; };
};
};
};

View File

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
global = {
monitor = 0;
follow = "none";
@ -29,7 +28,10 @@
font = "Mononoki Nerd Font 8";
line_height = 3;
markup = "full";
format = "󰟪 %a\n<b>󰋑 %s</b>\n%b";
format = ''
󰟪 %a
<b>󰋑 %s</b>
%b'';
alignment = "left";
vertical_alignment = "center";
show_age_threshold = 60;
@ -56,9 +58,7 @@
mouse_middle_click = "do_action, close_current";
mouse_right_click = "close_all";
};
experimental = {
per_monitor_dpi = false;
};
experimental = { per_monitor_dpi = false; };
urgency_low = {
background = "#22232A";
foreground = "#E2DFD1";
@ -83,6 +83,8 @@
};
"Type-2" = {
summary = "t2";
format = "<span size=\"250%\">%a</span>\n%b";
format = ''
<span size="250%">%a</span>
%b'';
};
}

View File

@ -4,11 +4,8 @@ let
cfg = config.hm.dunst;
enable = mkEnableOption "dunst";
in
{
options.hm.dunst = {
inherit enable;
};
in {
options.hm.dunst = { inherit enable; };
config = mkIf cfg.enable {
services.dunst = {

View File

@ -20,18 +20,15 @@ let
extraConfig = mkOption {
type = types.attrs;
description = "Extra git configuration";
default = {};
default = { };
};
extraAliases = mkOption {
type = types.attrs;
description = "Extra git aliases";
default = {};
};
in
{
options.hm.git = {
inherit enable signingKey user extraConfig extraAliases;
default = { };
};
in {
options.hm.git = { inherit enable signingKey user extraConfig extraAliases; };
config = mkIf cfg.enable {
programs.git = {
@ -53,9 +50,7 @@ in
};
userName = cfg.user.name;
userEmail = cfg.user.email;
extraConfig = {
init.defaultBranch = "main";
} // cfg.extraConfig;
extraConfig = { init.defaultBranch = "main"; } // cfg.extraConfig;
};
};
}

View File

@ -1,4 +1,4 @@
{ config, options, lib, ...}:
{ config, options, lib, ... }:
with lib;
let
cfg = config.hm.hypridle;
@ -48,11 +48,8 @@ let
default = 300;
};
};
in
{
options.hm.hypridle = {
inherit enable timeouts enabledListeners;
};
in {
options.hm.hypridle = { inherit enable timeouts enabledListeners; };
config = mkIf cfg.enable {
services.hypridle = {

View File

@ -14,12 +14,12 @@ let
workspaceSettings = mkOption {
type = types.listOf types.nonEmptyStr;
description = "Workspace definition";
default = [];
default = [ ];
};
monitorSettings = mkOption {
type = types.listOf types.nonEmptyStr;
description = "Monitors definition";
default = [];
default = [ ];
};
envVariables = mkOption {
type = types.listOf types.nonEmptyStr;
@ -27,10 +27,10 @@ let
default = [ "XCURSOR_SIZER,24" ];
};
nvidia = mkEnableOption "nvidia";
in
{
in {
options.hm.hyprland = {
inherit enable enableXWayland workspaceSettings monitorSettings nvidia envVariables;
inherit enable enableXWayland workspaceSettings monitorSettings nvidia
envVariables;
};
config = mkIf cfg.enable {
@ -42,10 +42,13 @@ in
"WLR_NO_HARDWARE_CURSORS,1"
"LIBVA_DRIVER_NAME,nvidia"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
] else []) ++ cfg.envVariables;
exec-once = hyprlandSettings.exec-once ++ [ "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" ];
monitor = mkIf (cfg.monitorSettings != []) cfg.monitorSettings;
workspace = mkIf (cfg.workspaceSettings != []) cfg.workspaceSettings;
] else
[ ]) ++ cfg.envVariables;
exec-once = hyprlandSettings.exec-once ++ [
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
];
monitor = mkIf (cfg.monitorSettings != [ ]) cfg.monitorSettings;
workspace = mkIf (cfg.workspaceSettings != [ ]) cfg.workspaceSettings;
};
};
};

View File

@ -11,56 +11,51 @@ let
};
defaultDisplay = mkOption {
type = types.str;
description = "Default display will have all labels and input-labels written on.";
description =
"Default display will have all labels and input-labels written on.";
default = "";
};
in
{
options.hm.hyprlock = {
inherit enable lockBackgroundImage defaultDisplay;
};
in {
options.hm.hyprlock = { inherit enable lockBackgroundImage defaultDisplay; };
config = mkIf cfg.enable {
programs.hyprlock = {
enable = true;
general.disable_loading_bar = true;
backgrounds = [
{
path = mkIf (cfg.lockBackgroundImage != "") cfg.lockBackgroundImage;
blur_passes = 3;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
}
];
input-fields = [
{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
size = {
width = 250;
height = 60;
};
outline_thickness = 2;
dots_size = 0.2;
dots_spacing = 0.2;
outer_color = "rgba(0, 0, 0, 0)";
inner_color = "rgba(0, 0, 0, 0.5)";
font_color = "rgb(200, 200, 200)";
placeholder_text = "<i><span foreground=\"##cdd6f4\">Input Password...</span></i>";
position = {
x = 0;
y = -120;
};
}
];
backgrounds = [{
path = mkIf (cfg.lockBackgroundImage != "") cfg.lockBackgroundImage;
blur_passes = 3;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
}];
input-fields = [{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
size = {
width = 250;
height = 60;
};
outline_thickness = 2;
dots_size = 0.2;
dots_spacing = 0.2;
outer_color = "rgba(0, 0, 0, 0)";
inner_color = "rgba(0, 0, 0, 0.5)";
font_color = "rgb(200, 200, 200)";
placeholder_text =
''<i><span foreground="##cdd6f4">Input Password...</span></i>'';
position = {
x = 0;
y = -120;
};
}];
labels = [
{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
text = "cmd[update:1000] echo \"$TIME\"";
text = ''cmd[update:1000] echo "$TIME"'';
font_family = "Mononoki Nerd Font";
color = "rgba(255, 255, 255, 0.6)";
font_size = 120;
@ -83,7 +78,8 @@ in
}
{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
text = "cmd[update:1000] playerctl metadata --format \"{{ artist }} - {{ album }} - {{ title }}\"";
text = ''
cmd[update:1000] playerctl metadata --format "{{ artist }} - {{ album }} - {{ title }}"'';
color = "rgba(255, 255, 255, 0.6)";
font_size = 18;
font_family = "Mononoki Nerd Font";

View File

@ -1,6 +1,3 @@
{ ... }:
{
home.file = {
".config/looking-glass/client.ini".source = ./client.ini;
};
{ ... }: {
home.file = { ".config/looking-glass/client.ini".source = ./client.ini; };
}

View File

@ -1,30 +1,26 @@
{ config, lib, pkgs, ...}:
{ config, lib, pkgs, ... }:
with lib;
let
let
cfg = config.hm.rofi-wayland;
enable = mkEnableOption "rofi-wayland";
in {
options.hm.rofi-wayland = {
inherit enable;
};
options.hm.rofi-wayland = { inherit enable; };
config = mkIf cfg.enable {
home.packages = [
pkgs.rofi-wayland
];
home.packages = [ pkgs.rofi-wayland ];
home.file = {
".config/rofi/dmenu.rasi".source = ./dmenu.rasi;
".config/rofi/clipboard.rasi".source = ./clipboard.rasi;
".config/rofi/powermenu.rasi".source = ./powermenu.rasi;
".config/rofi/screenshot.rasi".source = ./screenshot.rasi;
".config/rofi/confirm.rasi".source = ./confirm.rasi;
".config/rofi/clipboard.rasi".source = ./clipboard.rasi;
".config/rofi/powermenu.rasi".source = ./powermenu.rasi;
".config/rofi/screenshot.rasi".source = ./screenshot.rasi;
".config/rofi/confirm.rasi".source = ./confirm.rasi;
".config/rofi/dmenu.sh".source = ./dmenu.sh;
".config/rofi/clipboard.sh".source = ./clipboard.sh;
".config/rofi/powermenu.sh".source = ./powermenu.sh;
".config/rofi/screenshot.sh".source = ./screenshot.sh;
".config/rofi/clipboard.sh".source = ./clipboard.sh;
".config/rofi/powermenu.sh".source = ./powermenu.sh;
".config/rofi/screenshot.sh".source = ./screenshot.sh;
};
};
}

View File

@ -11,11 +11,8 @@ let
default = "yes";
description = "Add automatically private SSH keys to ssh-agent";
};
in
{
options.hm.ssh = {
inherit enable addKeysToAgent;
};
in {
options.hm.ssh = { inherit enable addKeysToAgent; };
config = mkIf cfg.enable {
programs.ssh = {
@ -61,14 +58,14 @@ in
"bap-dev" = {
hostname = "dev.app.bienaporter.com";
user = "service_deploy";
identityFile = "~/.ssh/${keyNamePrefix}_bap-dev";
identityFile = "~/.ssh/${keyNamePrefix}_bap-dev";
identitiesOnly = true;
port = 5022;
};
"bap-prod" = {
hostname = "prod.app.bienaporter.com";
user = "service_deploy";
identityFile = "~/.ssh/${keyNamePrefix}_bap-prod";
identityFile = "~/.ssh/${keyNamePrefix}_bap-prod";
identitiesOnly = true;
port = 5022;
};

View File

@ -1,5 +1,4 @@
{ pkgs, lib, ... }:
{
{ pkgs, lib, ... }: {
programs.vscode = {
enable = true;
enableUpdateCheck = false;
@ -53,8 +52,6 @@
samuelcolvin.jinjahtml
];
userSettings = lib.importJSON ./settings.json;
languageSnippets = {
go = lib.importJSON ./snippets/go.json;
};
languageSnippets = { go = lib.importJSON ./snippets/go.json; };
};
}

View File

@ -4,11 +4,8 @@ let
cfg = config.hm.waybar;
enable = mkEnableOption "waybar";
in
{
options.hm.waybar = {
inherit enable;
};
in {
options.hm.waybar = { inherit enable; };
config = mkIf cfg.enable {
programs.waybar = {

View File

@ -1,4 +1,4 @@
{ lib, config, ...}:
{ lib, config, ... }:
with lib;
let
cfg = config.hm.zellij;
@ -10,9 +10,7 @@ let
example = "wl-copy";
};
in {
options.hm.zellij = {
inherit enable copy_command;
};
options.hm.zellij = { inherit enable copy_command; };
config = mkIf cfg.enable {
programs.zellij = {

View File

@ -1,17 +1,17 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.nvidia;
in
with lib;
{
let cfg = config.services.nvidia;
in with lib; {
options.services.nvidia = {
enable = mkEnableOption "nvidia";
sleepIssue = mkEnableOption "nvidia-sleep";
};
config = mkIf cfg.enable {
services.xserver.videoDrivers = ["nvidia"];
boot.kernelParams = [] ++ (if cfg.sleepIssue then ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"] else []);
services.xserver.videoDrivers = [ "nvidia" ];
boot.kernelParams = [ ] ++ (if cfg.sleepIssue then
[ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]
else
[ ]);
hardware = {
opengl = {
enable = true;

View File

@ -1,34 +1,32 @@
{ lib, config, pkgs, ... }:
let
cfg = config.services.passthrough;
in
{
let cfg = config.services.passthrough;
in {
options.services.passthrough = {
enable = lib.mkEnableOption "passthrough";
ids = lib.mkOption {
type = lib.types.listOf lib.types.str;
example = ["10de:1b81" "10de:10f0"];
example = [ "10de:1b81" "10de:10f0" ];
description = "GPU's PCI ids to isolate";
};
user = lib.mkOption {
type = lib.types.str;
example = "DataHearth";
description = "Username to add \"libvirtd\" group";
description = ''Username to add "libvirtd" group'';
};
};
config = lib.mkIf cfg.enable {
boot = {
kernelParams = ["intel_iommu=on" "iommu=pt"];
kernelModules = ["vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd"];
kernelParams = [ "intel_iommu=on" "iommu=pt" ];
kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
extraModprobeConfig = ''
options vfio-pci ids=${lib.concatStringsSep "," cfg.ids}
softdep drm pre: vfio-pci
'';
};
users.users.${cfg.user}.extraGroups = ["libvirtd"];
environment.systemPackages = [pkgs.OVMF pkgs.qemu];
users.users.${cfg.user}.extraGroups = [ "libvirtd" ];
environment.systemPackages = [ pkgs.OVMF pkgs.qemu ];
programs.virt-manager.enable = true;
virtualisation = {

View File

@ -1,4 +1,4 @@
{ lib, config, options, pkgs, ...}:
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.custom.neovim;
@ -14,14 +14,24 @@ let
description = "Neovim colorscheme";
default = "catppuccin";
};
in
{
options.custom.neovim = {
inherit enable colorscheme defaultEditor;
};
in {
options.custom.neovim = { inherit enable colorscheme defaultEditor; };
config = mkIf cfg.enable {
environment.variables.EDITOR = mkIf cfg.defaultEditor "nvim";
environment = {
variables.EDITOR = mkIf cfg.defaultEditor "nvim";
systemPackages = with pkgs; [
prettierd
eslint_d
gofumpt
golines
ruff
stylua
nixfmt-classic
taplo
rustfmt
];
};
programs.nixvim = {
enable = true;
@ -29,9 +39,7 @@ in
viAlias = true;
vimAlias = true;
colorscheme = cfg.colorscheme;
globals = {
mapleader = " ";
};
globals = { mapleader = " "; };
opts = {
tabstop = 2;
expandtab = true;
@ -72,11 +80,7 @@ in
lualine.enable = true;
luasnip = {
enable = true;
fromVscode = [
{
paths = ./snippets;
}
];
fromVscode = [{ paths = ./snippets; }];
};
nix.enable = true;
nvim-autopairs.enable = true;
@ -99,33 +103,54 @@ in
};
};
};
extraPlugins = [
{
config = ''
lua require("gotests").setup()
'';
plugin = pkgs.vimUtils.buildVimPlugin {
name = "gotests.nvim";
src = pkgs.fetchFromGitHub {
owner = "yanskun";
repo = "gotests.nvim";
rev = "2ddd2a3d43a7ab92cc14f6a2f84291d991a30c2d";
hash = "sha256-OHUK2pv9VHKzSuFRo3e1Y7Akjmjbs+jjxi6NaXHqeCk=";
};
};
extraConfigLua = ''
require("formatter").setup {
logging = true,
log_level = vim.log.levels.WARN,
filetype = {
css = {
require("formatter.filetypes.css").prettierd,
require("formatter.filetypes.css").eslint_d,
},
go = {
require("formatter.filetypes.go").gofumpt,
require("formatter.filetypes.go").golines,
},
html = {
require("formatter.filetypes.html").prettierd,
},
javascript = {
require("formatter.filetypes.javascript").prettierd,
require("formatter.filetypes.javascript").eslint_d,
},
json = {
require("formatter.filetypes.json").prettierd,
},
lua = {
require("formatter.filetypes.lua").stylua,
},
nix = {
require("formatter.filetypes.nix").nixfmt,
},
python = {
require("formatter.filetypes.python").ruff,
},
rust = {
require("formatter.filetypes.rust").rustfmt,
},
toml = {
require("formatter.filetypes.toml").taplo,
},
typescript = {
require("formatter.filetypes.typescript").prettierd,
},
["*"] = {
require("formatter.filetypes.any").remove_trailing_whitespace
}
}
}
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "vim-go-impl";
src = pkgs.fetchFromGitHub {
owner = "rhysd";
repo = "vim-go-impl";
rev = "74988dc3958f68355b9d4a3ffaa97a74d0006248";
hash = "sha256-oPjULtIQpIf5qrCbaiybOCaB4zJDmrBuCretyXPViCM=";
};
};
}
];
'';
extraPlugins = with pkgs.vimPlugins; [ formatter-nvim ];
};
};
}

View File

@ -7,4 +7,8 @@
action = "<cmd>TroubleToggle<cr>";
key = "<C-S-t>";
}
{
action = "<cmd>FormatWrite<CR>";
key = "<leader>f";
}
]

View File

@ -1 +1 @@
[] ++ (import ./cmd.nix) ++ (import ./harpoon.nix)
[ ] ++ (import ./cmd.nix) ++ (import ./harpoon.nix)

View File

@ -1,22 +1,22 @@
[
{
action = ''
function()
local conf = require("telescope.config").values
local file_paths = {}
for _, item in ipairs(require("harpoon"):list().items) do
table.insert(file_paths, item.value)
end
function()
local conf = require("telescope.config").values
local file_paths = {}
for _, item in ipairs(require("harpoon"):list().items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
'';
key = "<leader>e";
lua = true;

View File

@ -1,5 +1,4 @@
{ lib, ... }:
{
{ lib, ... }: {
enable = true;
settings = {
mapping = {
@ -9,24 +8,24 @@
"<Up>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<C-e>" = "cmp.mapping(cmp.mapping.abort(), {'i', 's'})";
"<Tab>" = ''
cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, {'i', 's'})
cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, {'i', 's'})
'';
"<S-Tab>" = ''
cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {'i', 's'})
cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {'i', 's'})
'';
};
sources = [
@ -38,9 +37,7 @@
{ name = "nvim_lua"; }
{ name = "path"; }
];
completion = {
keyword_length = 2;
};
completion = { keyword_length = 2; };
preselect = "cmp.PreselectMode.None";
snippet.expand = ''
function(args)

View File

@ -3,14 +3,13 @@
servers = {
bashls.enable = true;
dockerls.enable = true;
eslint.enable = true;
gopls = {
enable = true;
extraOptions = {
staticcheck = true;
gofumpt = true;
analyses = {
unusedvariable = true;
};
analyses = { unusedvariable = true; };
};
};
html.enable = true;
@ -34,7 +33,6 @@
keymaps = {
lspBuf = {
"<S-k>" = "hover";
"<leader>f" = "format";
"<leader>a" = "code_action";
"<leader>r" = "rename";
"<leader>gd" = "declaration";

View File

@ -1,6 +1,4 @@
{
enable = true;
settings = {
auto_close = true;
};
settings = { auto_close = true; };
}