fix: move to nixfmt-rfc-style instead of nixpkgs-fmt

This commit is contained in:
Alexandre Cavalheiro 2024-06-24 03:20:30 -03:00
parent 5ad03ee2e8
commit ecbe0c069c
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
14 changed files with 184 additions and 83 deletions

View file

@ -10,9 +10,17 @@
};
};
outputs = { self, home-manager, nixpkgs, ... }@inputs:
let system = "x86_64-linux";
in {
outputs =
{
self,
home-manager,
nixpkgs,
...
}@inputs:
let
system = "x86_64-linux";
in
{
nixosConfigurations."nixos" =
let
specialArgs = inputs;
@ -31,6 +39,6 @@
in
nixpkgs.lib.nixosSystem { inherit system specialArgs modules; };
formatter."${system}" = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
formatter."${system}" = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
};
}

View file

@ -1,13 +1,25 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
@ -25,19 +37,29 @@
fileSystems."/mnt/ssd" = {
device = "/dev/disk/by-uuid/f27f2224-d351-46fd-89f5-991de36166ad";
fsType = "ext4";
options = [ "defaults" "nofail" ];
options = [
"defaults"
"nofail"
];
};
fileSystems."/mnt/internal" = {
device = "/dev/disk/by-uuid/b8541c0d-9146-4388-b217-431f196957cc";
fsType = "ext4";
options = [ "defaults" "nofail" ];
options = [
"defaults"
"nofail"
];
};
fileSystems."/mnt/media" = {
device = "/dev/disk/by-uuid/52c17b8b-46c1-4870-b86c-c3b9f4bd4434";
fsType = "ext4";
options = [ "defaults" "nofail" ];
options = [
"defaults"
"nofail"
];
};
};
swapDevices = [ ];
@ -51,6 +73,5 @@
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -125,22 +125,28 @@
# Create an FHS environment using the command `fhs`, enabling the execution of non-NixOS packages in NixOS!
(
let base = pkgs.appimageTools.defaultFhsEnvArgs;
in pkgs.buildFHSUserEnv (base // {
name = "fhs";
targetPkgs = pkgs:
(
# pkgs.buildFHSUserEnv provides only a minimal FHS environment,
# lacking many basic packages needed by most software.
# Therefore, we need to add them manually.
#
# pkgs.appimageTools provides basic packages required by most software.
(base.targetPkgs pkgs) ++ (with pkgs; [ nodejs ])
);
profile = "export FHS=1";
runScript = "bash";
extraOutputsToInstall = [ "dev" ];
})
let
base = pkgs.appimageTools.defaultFhsEnvArgs;
in
pkgs.buildFHSUserEnv (
base
// {
name = "fhs";
targetPkgs =
pkgs:
(
# pkgs.buildFHSUserEnv provides only a minimal FHS environment,
# lacking many basic packages needed by most software.
# Therefore, we need to add them manually.
#
# pkgs.appimageTools provides basic packages required by most software.
(base.targetPkgs pkgs) ++ (with pkgs; [ nodejs ])
);
profile = "export FHS=1";
runScript = "bash";
extraOutputsToInstall = [ "dev" ];
}
)
)
];
@ -152,8 +158,7 @@
# plain files is through 'home.file'.
home.file = {
# Cattpuccin theme for fish shell.
".config/fish/themes/Catppuccin-Frappe.theme".source =
./programs/fish/Catppuccin-Frappe.theme;
".config/fish/themes/Catppuccin-Frappe.theme".source = ./programs/fish/Catppuccin-Frappe.theme;
# Configuration for gamemode, for running games with optimizations.
".config/gamemode.ini".source = ./programs/gamemode.ini;
@ -164,11 +169,11 @@
## Kvantum's theme configuration.
".config/Kvantum/Catppuccin-Frappe-Lavender" = {
source = "${
pkgs.catppuccin-kvantum.override {
accent = "Lavender";
variant = "Frappe";
}
}/share/Kvantum/Catppuccin-Frappe-Lavender";
pkgs.catppuccin-kvantum.override {
accent = "Lavender";
variant = "Frappe";
}
}/share/Kvantum/Catppuccin-Frappe-Lavender";
};
".config/Kvantum/kvantum.kvconfig".text = ''
@ -180,8 +185,7 @@
## Themeing configuration for qt5 and qt6
".config/qt5ct/colors".source = ./theming/qt5ct;
".config/qt6ct/colors".source =
./theming/qt5ct; # We use the qt5ct because it's the SAME spec
".config/qt6ct/colors".source = ./theming/qt5ct; # We use the qt5ct because it's the SAME spec
##
# Configure pipewire for microphone noise supression.

View file

@ -1,4 +1,10 @@
{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
{
lib,
stdenv,
fetchFromGitHub,
kernel,
kmod,
}:
let
kernelDirectory = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
@ -16,12 +22,13 @@ stdenv.mkDerivation {
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
hardeningDisable = [ "format" "pic" ];
makeFlags = kernel.makeFlags ++ [
"KDIR=${kernelDirectory}"
hardeningDisable = [
"format"
"pic"
];
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernelDirectory}" ];
makeTargets = [ "modules_install" ];
preBuild = ''

View file

@ -19,7 +19,10 @@
];
# Enable experimental features
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Enable automatic garbage collection.
nix.gc = {
@ -91,15 +94,17 @@
8211 # Palworld
];
allowedTCPPortRanges = [{
from = 1714;
to = 1764;
} # KDEConnect
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
} # KDEConnect
];
allowedUDPPortRanges = [{
from = 1714;
to = 1764;
} # KDEConnect
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
} # KDEConnect
];
};
# Or disable the firewall altogether.
@ -115,7 +120,13 @@
users.users.wizardlink = {
createHome = true;
description = "Alexandre Cavalheiro";
extraGroups = [ "networkmanager" "wheel" "postgresql" "docker" "openrazer" ];
extraGroups = [
"networkmanager"
"wheel"
"postgresql"
"docker"
"openrazer"
];
initialPassword = "wizardlink";
isNormalUser = true;
@ -214,15 +225,11 @@
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
];
extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ];
config = {
common = {
default = [
"hyprland"
];
default = [ "hyprland" ];
};
};
};

View file

@ -28,9 +28,13 @@
zoxide init --cmd cd fish | source
'';
shellAbbrs = { z = "zoxide"; };
shellAbbrs = {
z = "zoxide";
};
shellAliases = { del = "trash_file"; };
shellAliases = {
del = "trash_file";
};
functions = {
fish_prompt.body = ''

View file

@ -47,9 +47,13 @@
gpgsign = true;
};
tag = { gpgsign = true; };
tag = {
gpgsign = true;
};
difftool = { prompt = true; };
difftool = {
prompt = true;
};
mergetool = {
# https://www.git-scm.com/docs/git-mergetool#Documentation/git-mergetool.txt---no-prompt
@ -75,9 +79,13 @@
signingkey = "A1D3A2B4E14BD7C0445BB749A5767B54367CFBDF";
};
pull = { ff = "only"; };
pull = {
ff = "only";
};
init = { defaultBranch = "main"; };
init = {
defaultBranch = "main";
};
credential = {
helper = "/usr/libexec/git-core/git-credential-libsecret";

View file

@ -247,7 +247,7 @@
bind = $mainMod SHIFT, J, movewindow, d
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Volume changes
binde = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+
binde = , XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%-

View file

@ -15,8 +15,15 @@
gpu_fan = true;
gpu_junction_temp = true;
gpu_load_change = true;
gpu_load_color = [ "39F900" "FDFD09" "B22222" ];
gpu_load_value = [ 60 90 ];
gpu_load_color = [
"39F900"
"FDFD09"
"B22222"
];
gpu_load_value = [
60
90
];
gpu_mem_clock = true;
gpu_mem_temp = true;
gpu_power = true;
@ -26,8 +33,15 @@
# CPU Statistics
cpu_load_change = true;
cpu_load_color = [ "39F900" "FDFD09" "B22222" ];
cpu_load_value = [ 60 90 ];
cpu_load_color = [
"39F900"
"FDFD09"
"B22222"
];
cpu_load_value = [
60
90
];
cpu_mhz = true;
cpu_power = true;
cpu_stats = true;
@ -46,8 +60,15 @@
# FPS Statistics
fps = true;
fps_color_change = true;
fps_value = [ 60 90 ];
fps_color = [ "B22222" "FDFD09" "39F900" ];
fps_value = [
60
90
];
fps_color = [
"B22222"
"FDFD09"
"39F900"
];
frametime = true;
frame_timing = true; # Display graphs
histogram = true; # ^

View file

@ -34,7 +34,7 @@
# Nix
nil
nixpkgs-fmt
nixfmt-rfc-style
# TypeScript
(callPackage ../vtsls/package.nix { })

View file

@ -12,9 +12,7 @@ return {
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
config.sources = {
-- Set a formatter
-- null_ls.builtins.formatting.stylua,
-- null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.nixpkgs_fmt,
null_ls.builtins.formatting.nixfmt,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.stylua,
}

View file

@ -1,7 +1,8 @@
{ lib
, buildNpmPackage
, fetchFromGitHub
, importNpmLock
{
lib,
buildNpmPackage,
fetchFromGitHub,
importNpmLock,
}:
buildNpmPackage rec {
@ -28,4 +29,12 @@ buildNpmPackage rec {
npmConfigHook = importNpmLock.npmConfigHook;
dontNpmPrune = true;
meta = with lib; {
description = "LSP wrapper around TypeScript extension bundled with VSCode.";
homepage = "https://github.com/yioneko/vtsls";
license = licenses.mit;
maintainers = with maintainers; [ wizardlink ];
platforms = platforms.all;
};
}

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
programs.waybar = {
enable = true;
@ -92,7 +93,13 @@
critical-threshold = 90;
interval = 5;
format = "{icon} {temperatureC}°";
format-icons = [ "" "" "" "" "" ];
format-icons = [
""
""
""
""
""
];
tooltip = false;
};
@ -110,7 +117,13 @@
format-charging-full = " {capacity}%";
format-full = "{icon} {capacity}%";
format-alt = "{icon} {power}W";
format-icons = [ "" "" "" "" "" ];
format-icons = [
""
""
""
""
""
];
tooltip = false;
};

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
services.caddy = {
enable = true;