Refactor Nix configurations for improved readability and organization; update package declarations to use 'with pkgs;' syntax and remove unnecessary builtins.attrValues.

This commit is contained in:
2025-07-23 14:18:20 -03:00
parent 5c62858c37
commit 6268fe3b00
29 changed files with 256 additions and 233 deletions

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
imports = [ imports = [
#################### Required Configs #################### #################### Required Configs ####################
common/core # required common/core # required
@@ -7,9 +6,7 @@
#################### Host-specific Optional Configs #################### #################### Host-specific Optional Configs ####################
]; ];
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
vlc vlc
; ];
};
} }

View File

@@ -3,8 +3,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: {
{
imports = lib.flatten [ imports = lib.flatten [
(lib.custom.scanPaths ./.) (lib.custom.scanPaths ./.)
(map lib.custom.relativeToRoot [ (map lib.custom.relativeToRoot [
@@ -16,16 +15,13 @@
username = lib.mkDefault "exampleSecondUser"; username = lib.mkDefault "exampleSecondUser";
homeDirectory = lib.mkDefault "/home/${config.home.username}"; homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "24.11"; stateVersion = lib.mkDefault "24.11";
sessionPath = [ "$HOME/.local/bin" ]; sessionPath = ["$HOME/.local/bin"];
}; };
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
# Packages that don't have custom configs go here # Packages that don't have custom configs go here
nix-tree nix-tree
; ];
};
nix = { nix = {
package = lib.mkDefault pkgs.nix; package = lib.mkDefault pkgs.nix;

View File

@@ -43,9 +43,7 @@ in {
}; };
}; };
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
# FIXME(starter): add/edit as desired # FIXME(starter): add/edit as desired
# Packages that don't have custom configs go here # Packages that don't have custom configs go here
curl curl
@@ -56,8 +54,7 @@ in {
usbutils usbutils
unzip # zip extraction unzip # zip extraction
unrar # rar extraction unrar # rar extraction
; ];
};
nix = { nix = {
package = lib.mkDefault pkgs.nix; package = lib.mkDefault pkgs.nix;

View File

@@ -1,5 +0,0 @@
{pkgs, ...}: {
home.packages = with pkgs; [
aider-chat-full
];
}

View File

@@ -1,8 +1,5 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
oterm oterm
; ];
};
} }

View File

@@ -1,7 +1,6 @@
# FIXME(starter): customize your bash preferences here # FIXME(starter): customize your bash preferences here
{ {
imports = [ imports = [
./aider.nix
./atuin.nix ./atuin.nix
./autojump.nix ./autojump.nix
./bash.nix ./bash.nix

View File

@@ -1,10 +1,7 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
grc grc
; ];
};
programs.fish = { programs.fish = {
enable = true; enable = true;

View File

@@ -4,10 +4,7 @@
./zed.nix ./zed.nix
]; ];
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
hoppscotch hoppscotch
; ];
};
} }

View File

@@ -0,0 +1,20 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
"GitHub.copilot"
"GitHub.copilot-chat"
];
userSettings = {
# Enable Copilot Next Edit Suggestions
"github.copilot.nextEditSuggestions.enabled" = true;
# Other useful Copilot settings
"github.copilot.enable" = true;
"github.copilot.inlineSuggest.enable" = true;
"github.copilot.advanced" = {
"inlineSuggest.enableAutoTrigger" = true;
"inlineSuggest.showEditorCompletions" = true;
};
# Add more Copilot-specific settings as needed
};
};
}

View File

@@ -3,105 +3,63 @@
lib, lib,
... ...
}: { }: {
imports = [ imports = lib.custom.scanPaths ./languages ++ [./completion/copilot.nix];
./javascript.nix
./latex.nix
./markdown.nix
./nix.nix
./rust.nix
];
home.packages = with pkgs; [ home.packages = with pkgs; [];
];
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscode; package = pkgs.vscode;
enableUpdateCheck = false; # Disable VSCode self-update and let Home Manager to manage VSCode versions instead. enableUpdateCheck = false; # Let Home Manager manage VSCode versions
enableExtensionUpdateCheck = false; # Disable extensions auto-update and let nix4vscode manage updates and extensions enableExtensionUpdateCheck = false; # Let nix4vscode manage extensions
mutableExtensionsDir = false; mutableExtensionsDir = false;
# Extensions
extensions = pkgs.nix4vscode.forVscode [ extensions = pkgs.nix4vscode.forVscode [
# General extensions # --- General ---
## Code Completion
"GitHub.copilot"
"GitHub.copilot-chat"
#"continue.continue"
#"rooveterinaryinc.roo-cline"
#"saoudrizwan.claude-dev"
## Development Environment
"ms-toolsai.jupyter"
"ms-vscode-remote.remote-containers"
## Error Checking
"usernamehw.errorlens"
## Export and Visualisation
"ibm.output-colorizer"
"nobuhito.printcode"
"pnp.polacode"
## Git
"lamartire.git-indicators"
"mhutchie.git-graph"
## Miscelaneous
"britesnow.vscode-toggle-quotes" "britesnow.vscode-toggle-quotes"
"mrmlnc.vscode-duplicate" "mrmlnc.vscode-duplicate"
"qcz.text-power-tools" "qcz.text-power-tools"
# --- Development ---
# Language extensions "ms-toolsai.jupyter"
"ms-vscode-remote.remote-containers"
## CSV # --- Error Checking ---
"usernamehw.errorlens"
# --- Output & Visualization ---
"ibm.output-colorizer"
"nobuhito.printcode"
"pnp.polacode"
# --- Git ---
"lamartire.git-indicators"
"mhutchie.git-graph"
# --- Languages ---
"mechatroner.rainbow-csv" "mechatroner.rainbow-csv"
## Golang
"golang.go" "golang.go"
## Python
"ms-python.python" "ms-python.python"
## SVG
"jock.svg" "jock.svg"
## YAML
"redhat.vscode-yaml" "redhat.vscode-yaml"
]; ];
# Settings
userSettings = { userSettings = {
# --- Privacy & Telemetry ---
"telemetry.feedback.enabled" = false; "telemetry.feedback.enabled" = false;
"github.copilot.enableTelemetry" = false; "github.copilot.enableTelemetry" = false;
"telemetry.telemetryLevel" = "off";
"telemetry.enableTelemetry" = false;
"telemetry.enableCrashReporter" = false;
"telemetry.disableFeedback" = true;
"workbench.enableExperiments" = false;
"workbench.settings.enableNaturalLanguageSearch" = false;
# --- Updates & Recommendations ---
"extensions.autoUpdate" = false;
"extensions.ignoreRecommendations" = true;
# --- UI ---
"editor.linkedEditing" = true; "editor.linkedEditing" = true;
"editor.inlineSuggest.enabled" = true; "editor.inlineSuggest.enabled" = true;
"continue.enableTabAutocomplete" = true; "continue.enableTabAutocomplete" = true;
"window.menuBarVisibility" = "toggle"; "window.menuBarVisibility" = "toggle";
"window.commandCenter" = false; "window.commandCenter" = false;
"window.titleBarStyle" = "native"; "window.titleBarStyle" = "native";
"workbench.navigationControl.enabled" = false; "workbench.navigationControl.enabled" = false;
"workbench.layoutControl.enabled" = false; "workbench.layoutControl.enabled" = false;
# --- Extension-specific telemetry opt-outs ---
# Privacy and Security
# 🛑 Core telemetry & crash reporting
"telemetry.telemetryLevel" = "off";
"telemetry.enableTelemetry" = false;
"telemetry.enableCrashReporter" = false;
# 🚫 Disable feedback prompts
"telemetry.disableFeedback" = true;
# 🔬 Turn off experiments and naturallanguage features
"workbench.enableExperiments" = false;
"workbench.settings.enableNaturalLanguageSearch" = false;
# 🔄 Prevent autoupdates & recommendations
"extensions.autoUpdate" = false;
"extensions.ignoreRecommendations" = true;
# 🧩 Popular extensionspecific telemetry optouts
"code-runner.enableAppInsights" = false; "code-runner.enableAppInsights" = false;
"docker-explorer.enableTelemetry" = false; "docker-explorer.enableTelemetry" = false;
"gitlens.showWelcomeOnInstall" = false; "gitlens.showWelcomeOnInstall" = false;

View File

@@ -0,0 +1,16 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# CSV language support
"mechatroner.rainbow-csv"
];
userSettings = {
# Add CSV-specific settings here
};
};
# Additional packages for CSV development
home.packages = with pkgs; [
# Add CSV-related CLI tools here
];
}

View File

@@ -0,0 +1,16 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# Go language support
"golang.go"
];
userSettings = {
# Add Go-specific settings here
};
};
# Additional packages for Go development
home.packages = with pkgs; [
# Add Go-related CLI tools here
];
}

View File

@@ -47,6 +47,7 @@
}; };
}; };
# Additional packages for JavaScript development
home.packages = with pkgs; [ home.packages = with pkgs; [
deno deno
pnpm pnpm

View File

@@ -25,4 +25,9 @@
]; ];
}; };
}; };
# Additional packages for LaTeX development
home.packages = with pkgs; [
# Add LaTeX-related CLI tools here
];
} }

View File

@@ -12,4 +12,9 @@
}; };
}; };
}; };
# Additional packages for Markdown development
home.packages = with pkgs; [
# Add Markdown-related CLI tools here
];
} }

View File

@@ -1,12 +1,7 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = with pkgs; [
nil
alejandra
deadnix
];
programs.vscode = { programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [ extensions = pkgs.nix4vscode.forVscode [
# Nix language support
"jnoortheen.nix-ide" "jnoortheen.nix-ide"
"kamadorueda.alejandra" "kamadorueda.alejandra"
]; ];
@@ -15,4 +10,11 @@
"nix.serverPath" = "nil"; "nix.serverPath" = "nil";
}; };
}; };
# Additional packages for Nix development
home.packages = with pkgs; [
nil
alejandra
deadnix
];
} }

View File

@@ -0,0 +1,16 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# Python language support
"ms-python.python"
];
userSettings = {
# Add Python-specific settings here
};
};
# Additional packages for Python development
home.packages = with pkgs; [
# Add Python-related CLI tools here
];
}

View File

@@ -0,0 +1,19 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# Rust language support
"barbosshack.crates-io"
"tamasfe.even-better-toml"
"rust-lang.rust-analyzer"
];
userSettings = {
# Add Rust-specific settings here
};
};
# Additional packages for Rust development
home.packages = with pkgs; [
cargo
rustc
];
}

View File

@@ -0,0 +1,16 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# SVG language support
"jock.svg"
];
userSettings = {
# Add SVG-specific settings here
};
};
# Additional packages for SVG development
home.packages = with pkgs; [
# Add SVG-related CLI tools here
];
}

View File

@@ -0,0 +1,16 @@
{pkgs, ...}: {
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# YAML language support
"redhat.vscode-yaml"
];
userSettings = {
# Add YAML-specific settings here
};
};
# Additional packages for YAML development
home.packages = with pkgs; [
# Add YAML-related CLI tools here
];
}

View File

@@ -1,19 +0,0 @@
{pkgs, ...}: {
programs.vscode = {
extensions =
pkgs.nix4vscode.forVscode
[
# General
"serayuzgur.crates"
"tamasfe.even-better-toml"
"rust-lang.rust-analyzer"
];
userSettings = {
};
};
home.packages = with pkgs; [
cargo
rustc
];
}

View File

@@ -2,12 +2,9 @@
{pkgs, ...}: { {pkgs, ...}: {
#imports = [ ./foo.nix ]; #imports = [ ./foo.nix ];
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
teams-for-linux teams-for-linux
signal-desktop signal-desktop
discord discord
; ];
};
} }

View File

@@ -1,11 +1,9 @@
# FIXME(starter): add/edit any optional, media related pkgs here # FIXME(starter): add/edit any optional, media related pkgs here
{ pkgs, ... }: {pkgs, ...}: {
{
#imports = [ ./foo.nix ]; #imports = [ ./foo.nix ];
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
vlc vlc
; # ...other packages
}; ];
} }

View File

@@ -8,12 +8,9 @@
#imports = [ ./foo.nix ]; #imports = [ ./foo.nix ];
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
blender blender
inkscape inkscape
libreoffice-qt libreoffice-qt
; ];
};
} }

View File

@@ -1,8 +1,5 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
lmstudio lmstudio
; ];
};
} }

View File

@@ -1,8 +1,5 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit
(pkgs)
obsidian obsidian
; ];
};
} }

View File

@@ -1,7 +1,6 @@
# NOTE(starter): configure your audio needs as required. # NOTE(starter): configure your audio needs as required.
{ pkgs, ... }: {pkgs, ...}: {
{ services.pulseaudio.enable = false;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
@@ -12,10 +11,8 @@
jack.enable = true; jack.enable = true;
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = with pkgs; [
inherit (pkgs)
playerctl # cli utility and lib for controlling media players playerctl # cli utility and lib for controlling media players
# pamixer # cli pulseaudio sound mixer # pamixer # cli pulseaudio sound mixer
; ];
};
} }

View File

@@ -4,8 +4,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: {
{
imports = lib.flatten [ imports = lib.flatten [
(map lib.custom.relativeToRoot [ (map lib.custom.relativeToRoot [
"modules/common/host-spec.nix" "modules/common/host-spec.nix"
@@ -23,7 +22,7 @@
username = "user"; username = "user";
}; };
fileSystems."/boot".options = [ "umask=0077" ]; # Removes permissions and security warnings. fileSystems."/boot".options = ["umask=0077"]; # Removes permissions and security warnings.
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot = { boot.loader.systemd-boot = {
enable = true; enable = true;
@@ -44,14 +43,12 @@
"systemd.journald.forward_to_console=1" "systemd.journald.forward_to_console=1"
]; ];
environment.systemPackages = builtins.attrValues { environment.systemPackages = with pkgs; [
inherit (pkgs)
wget wget
curl curl
rsync rsync
git git
; ];
};
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
@@ -61,15 +58,15 @@
qemuGuest.enable = true; qemuGuest.enable = true;
openssh = { openssh = {
enable = true; enable = true;
ports = [ 22 ]; ports = [22];
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
authorizedKeysFiles = lib.mkForce [ "/etc/ssh/authorized_keys.d/%u" ]; authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
}; };
}; };
nix = { nix = {
# registry and nixPath shouldn't be required here because flakes but removal results in warning spam on build # registry and nixPath shouldn't be required here because flakes but removal results in warning spam on build
registry = lib.mapAttrs (_: value: { flake = value; }) inputs; registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = { settings = {

View File

@@ -18,9 +18,7 @@
BOOTSTRAP_SSH_PORT = "22"; BOOTSTRAP_SSH_PORT = "22";
BOOTSTRAP_SSH_KEY = "~/.ssh/id_manu"; BOOTSTRAP_SSH_KEY = "~/.ssh/id_manu";
nativeBuildInputs = builtins.attrValues { nativeBuildInputs = with pkgs; [
inherit
(pkgs)
# NOTE(starter): add any packages you want available in the shell when accessing the parent directory. # NOTE(starter): add any packages you want available in the shell when accessing the parent directory.
# These will be installed regardless of what was installed specific for the host or home configs # These will be installed regardless of what was installed specific for the host or home configs
nix nix
@@ -37,7 +35,6 @@
bats # for bash testing bats # for bash testing
age # for bootstrap script age # for bootstrap script
ssh-to-age # for bootstrap script ssh-to-age # for bootstrap script
; ];
};
}; };
} }