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 = [
#################### Required Configs ####################
common/core # required
@@ -7,9 +6,7 @@
#################### Host-specific Optional Configs ####################
];
home.packages = builtins.attrValues {
inherit (pkgs)
vlc
;
};
home.packages = with pkgs; [
vlc
];
}

View File

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

View File

@@ -43,21 +43,18 @@ in {
};
};
home.packages = builtins.attrValues {
inherit
(pkgs)
# FIXME(starter): add/edit as desired
# Packages that don't have custom configs go here
curl
pciutils
pfetch # system info
pre-commit # git hooks
p7zip # compression & encryption
usbutils
unzip # zip extraction
unrar # rar extraction
;
};
home.packages = with pkgs; [
# FIXME(starter): add/edit as desired
# Packages that don't have custom configs go here
curl
pciutils
pfetch # system info
pre-commit # git hooks
p7zip # compression & encryption
usbutils
unzip # zip extraction
unrar # rar extraction
];
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, ...}: {
home.packages = builtins.attrValues {
inherit
(pkgs)
oterm
;
};
home.packages = with pkgs; [
oterm
];
}

View File

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

View File

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

View File

@@ -4,10 +4,7 @@
./zed.nix
];
home.packages = builtins.attrValues {
inherit
(pkgs)
hoppscotch
;
};
home.packages = with pkgs; [
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,
...
}: {
imports = [
./javascript.nix
./latex.nix
./markdown.nix
./nix.nix
./rust.nix
];
imports = lib.custom.scanPaths ./languages ++ [./completion/copilot.nix];
home.packages = with pkgs; [
];
home.packages = with pkgs; [];
programs.vscode = {
enable = true;
package = pkgs.vscode;
enableUpdateCheck = false; # Disable VSCode self-update and let Home Manager to manage VSCode versions instead.
enableExtensionUpdateCheck = false; # Disable extensions auto-update and let nix4vscode manage updates and extensions
enableUpdateCheck = false; # Let Home Manager manage VSCode versions
enableExtensionUpdateCheck = false; # Let nix4vscode manage extensions
mutableExtensionsDir = false;
# Extensions
extensions = pkgs.nix4vscode.forVscode [
# General extensions
## 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
# --- General ---
"britesnow.vscode-toggle-quotes"
"mrmlnc.vscode-duplicate"
"qcz.text-power-tools"
# Language extensions
## CSV
# --- Development ---
"ms-toolsai.jupyter"
"ms-vscode-remote.remote-containers"
# --- Error Checking ---
"usernamehw.errorlens"
# --- Output & Visualization ---
"ibm.output-colorizer"
"nobuhito.printcode"
"pnp.polacode"
# --- Git ---
"lamartire.git-indicators"
"mhutchie.git-graph"
# --- Languages ---
"mechatroner.rainbow-csv"
## Golang
"golang.go"
## Python
"ms-python.python"
## SVG
"jock.svg"
## YAML
"redhat.vscode-yaml"
];
# Settings
userSettings = {
# --- Privacy & Telemetry ---
"telemetry.feedback.enabled" = 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.inlineSuggest.enabled" = true;
"continue.enableTabAutocomplete" = true;
"window.menuBarVisibility" = "toggle";
"window.commandCenter" = false;
"window.titleBarStyle" = "native";
"workbench.navigationControl.enabled" = false;
"workbench.layoutControl.enabled" = false;
# 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
# --- Extension-specific telemetry opt-outs ---
"code-runner.enableAppInsights" = false;
"docker-explorer.enableTelemetry" = 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; [
deno
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, ...}: {
home.packages = with pkgs; [
nil
alejandra
deadnix
];
programs.vscode = {
extensions = pkgs.nix4vscode.forVscode [
# Nix language support
"jnoortheen.nix-ide"
"kamadorueda.alejandra"
];
@@ -15,4 +10,11 @@
"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, ...}: {
#imports = [ ./foo.nix ];
home.packages = builtins.attrValues {
inherit
(pkgs)
teams-for-linux
signal-desktop
discord
;
};
home.packages = with pkgs; [
teams-for-linux
signal-desktop
discord
];
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,8 +4,7 @@
lib,
pkgs,
...
}:
{
}: {
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"modules/common/host-spec.nix"
@@ -23,7 +22,7 @@
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.systemd-boot = {
enable = true;
@@ -44,14 +43,12 @@
"systemd.journald.forward_to_console=1"
];
environment.systemPackages = builtins.attrValues {
inherit (pkgs)
wget
curl
rsync
git
;
};
environment.systemPackages = with pkgs; [
wget
curl
rsync
git
];
networking = {
networkmanager.enable = true;
@@ -61,15 +58,15 @@
qemuGuest.enable = true;
openssh = {
enable = true;
ports = [ 22 ];
ports = [22];
settings.PermitRootLogin = "yes";
authorizedKeysFiles = lib.mkForce [ "/etc/ssh/authorized_keys.d/%u" ];
authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
};
};
nix = {
# 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;
settings = {

View File

@@ -18,26 +18,23 @@
BOOTSTRAP_SSH_PORT = "22";
BOOTSTRAP_SSH_KEY = "~/.ssh/id_manu";
nativeBuildInputs = builtins.attrValues {
inherit
(pkgs)
# 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
nix
home-manager
nil
alejandra
nh
git
just
pre-commit
deadnix
sops
yq-go # jq for yaml, used for build scripts
bats # for bash testing
age # for bootstrap script
ssh-to-age # for bootstrap script
;
};
nativeBuildInputs = with pkgs; [
# 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
nix
home-manager
nil
alejandra
nh
git
just
pre-commit
deadnix
sops
yq-go # jq for yaml, used for build scripts
bats # for bash testing
age # for bootstrap script
ssh-to-age # for bootstrap script
];
};
}