formatted

This commit is contained in:
Deepak Mallubhotla 2025-03-18 03:33:27 -05:00
parent 9c2e5587cf
commit e9c321b8e2
Signed by: deepak
GPG Key ID: 47831B15427F5A55
15 changed files with 885 additions and 699 deletions

50
flake.lock generated
View File

@ -315,6 +315,22 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1735554305,
"narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nomodoro": {
"flake": false,
"locked": {
@ -416,6 +432,8 @@
"parrot-nvim": "parrot-nvim",
"sops-nix": "sops-nix",
"spaceport-nvim": "spaceport-nvim",
"systems": "systems_3",
"treefmt-nix": "treefmt-nix",
"zsh-completions": "zsh-completions"
}
},
@ -484,6 +502,38 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1739829690,
"narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "3d0579f5cc93436052d94b73925b48973a104204",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"uv2nix": {
"inputs": {
"nixpkgs": [

View File

@ -5,8 +5,9 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix.url = "github:Mic92/sops-nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
sops-nix.url = "github:Mic92/sops-nix";
nixpkgs-24-05.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11";
@ -32,7 +33,6 @@
inputs.nixpkgs.follows = "nixpkgs-24-11";
};
NixOS-WSL-2405 = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs-24-05";
@ -74,9 +74,35 @@
};
outputs = { self, nixpkgs, homeManager, NixOS-WSL, NixOS-WSL-2405, nixpkgs-24-05, nixpkgs-24-11, homeManager-24-05, homeManager-24-11, cmp-vimtex, spaceport-nvim, nomodoro, ...}@inputs:
outputs =
{
self,
systems,
nixpkgs,
homeManager,
NixOS-WSL,
NixOS-WSL-2405,
nixpkgs-24-05,
homeManager-24-05,
cmp-vimtex,
spaceport-nvim,
nomodoro,
...
}@inputs:
let
customPackageOverlay = (import ./overlays/default.nix { inherit cmp-vimtex; inherit spaceport-nvim; inherit inputs; inherit nomodoro; parrot-nvim = inputs.parrot-nvim; }).overlay;
customPackageOverlay =
(import ./overlays/default.nix {
inherit cmp-vimtex;
inherit spaceport-nvim;
inherit inputs;
inherit nomodoro;
parrot-nvim = inputs.parrot-nvim;
}).overlay;
# Small tool to iterate over each systems
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
# Eval the treefmt modules from ./treefmt.nix
treefmtEval = eachSystem (pkgs: inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
nixosConfigurations = (
@ -94,5 +120,11 @@
}
);
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
# for `nix flake check`
checks = eachSystem (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
};
}

View File

@ -1,4 +1,6 @@
{ pkgs ? import <nixpkgs> {} }:
{
pkgs ? import <nixpkgs> { },
}:
let
custom-fonts = pkgs.stdenvNoCC.mkDerivation {

View File

@ -1,12 +1,19 @@
{ pkgs, config, specialArgs, lib, ...}:
{
pkgs,
config,
specialArgs,
lib,
...
}:
let
pkgs-unstable = specialArgs.nixpkgs-unstable;
# default_python = pkgs-unstable.python313;
in
# default_python = pkgs-unstable.python313;
{
programs.home-manager.enable = true;
home.packages = [
home.packages =
[
pkgs.hello
# (pkgs.writeScriptBin "nixFlakes" ''
# exec ${pkgs.nixVersions.git}/bin/nix --experimental-features "nix-command flakes" "$@"
@ -19,6 +26,9 @@ in
pkgs.ripgrep
pkgs.just
# cli markdown tool
pkgs.glow
# lsps
pkgs.nil
# pkgs.nodePackages.pyright
@ -41,7 +51,8 @@ in
pkgs.custom-servers.basic-memory-server
pkgs.custom-servers.mcp-text-editor
] ++ pkgs.lib.optionals specialArgs.withGUI [
]
++ pkgs.lib.optionals specialArgs.withGUI [
pkgs.discord
pkgs.obsidian
pkgs.audacity
@ -59,7 +70,20 @@ in
"$HOME/.local/bin"
];
home.sessionVariables = {
home.sessionVariables =
let
win_home_dir = specialArgs.win_home_dir or "/mnt/c/Users/Deepak";
in
{
# Namespace our own nixconf variables with DPK
# Set a common directory for Windows for WSL installs
#
# Different per host
#
DPK_WIN_HOME_DIR = "${win_home_dir}";
DPK_OBSIDIAN_DIR = "/mnt/c/Users/Deepak/Documents/vault01";
# UV_PYTHON = "${default_python}";
};
@ -94,7 +118,6 @@ in
];
};
programs.neovim = {
enable = true;
package = pkgs-unstable.neovim-unwrapped;
@ -108,7 +131,9 @@ in
}
vim-nix
# plenary and stuff for telescope
plenary-nvim telescope-nvim telescope-file-browser-nvim
plenary-nvim
telescope-nvim
telescope-file-browser-nvim
# need fzf for parrot
fzf-lua
ctrlp-vim

View File

@ -1,4 +1,11 @@
{ pkgs, customPackageOverlay, stateVersion, modulesPath, hostname, ... }:
{
pkgs,
customPackageOverlay,
stateVersion,
modulesPath,
hostname,
...
}:
let
custom-fonts = import ../fonts { inherit pkgs; };
@ -34,7 +41,6 @@ in
experimental-features = nix-command flakes
'';
nixpkgs.overlays = [
customPackageOverlay
];
@ -46,7 +52,10 @@ in
isNormalUser = true;
home = "/home/deepak";
description = "Deepak Mallubhotla";
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
extraGroups = [
"wheel"
"networkmanager"
]; # Enable sudo for the user.
shell = pkgs.zsh;
};
@ -73,7 +82,6 @@ in
custom-fonts.custom-fonts
];
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-qt;

View File

@ -1,9 +1,20 @@
{ lib, inputs, nixpkgs-24-05, homeManager, homeManager-24-05, NixOS-WSL-2405, customPackageOverlay, ... }:
{
lib,
inputs,
nixpkgs-24-05,
homeManager,
homeManager-24-05,
NixOS-WSL-2405,
customPackageOverlay,
...
}:
let
linuxSystem = "x86_64-linux";
nixpkgs-unstable = import inputs.nixpkgs {
system = linuxSystem;
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"claude-code"
];
};
@ -17,7 +28,8 @@ in
};
modules = [
./maxos/configuration.nix
homeManager.nixosModules.home-manager {
homeManager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
withGUI = true;
gitSigningKey = "976F3357369149AB";
@ -41,7 +53,8 @@ in
modules = [
./commonWSL-configuration.nix
inputs.sops-nix.nixosModules.sops
inputs.homeManager-24-11.nixosModules.home-manager {
inputs.homeManager-24-11.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
withGUI = false;
gitSigningKey = "8F904A3FC7021497";
@ -73,7 +86,8 @@ in
modules = [
./commonWSL-configuration.nix
inputs.sops-nix.nixosModules.sops
homeManager-24-05.nixosModules.home-manager {
homeManager-24-05.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
withGUI = false;
gitSigningKey = "8F904A3FC7021497";
@ -105,7 +119,8 @@ in
modules = [
./commonWSL-configuration.nix
inputs.sops-nix.nixosModules.sops
inputs.homeManager-24-11.nixosModules.home-manager {
inputs.homeManager-24-11.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
withGUI = false;
gitSigningKey = "47831B15427F5A55";

View File

@ -8,8 +8,8 @@ let
custom-fonts = import ../../fonts { inherit pkgs; };
in
{
imports =
[ # Include the results of the hardware scan.
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
@ -97,14 +97,19 @@ in
isNormalUser = true;
home = "/home/deepak";
description = "Deepak Mallubhotla";
extraGroups = [ "wheel" "networkmanager" "docker" ]; # Enable sudo for the user.
extraGroups = [
"wheel"
"networkmanager"
"docker"
]; # Enable sudo for the user.
shell = pkgs.zsh;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget vim
wget
vim
firefox
git
pinentry
@ -135,7 +140,6 @@ in
# Optional (default: 41641):
services.tailscale.port = 62532;
# List services that you want to enable:
# Enable the OpenSSH daemon.

View File

@ -1,32 +1,47 @@
# 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,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "wl" ];
boot.kernelModules = [
"kvm-intel"
"wl"
];
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6d9433c6-2dab-4936-a924-d0a205381189";
fileSystems."/" = {
device = "/dev/disk/by-uuid/6d9433c6-2dab-4936-a924-d0a205381189";
fsType = "ext4";
};
boot.initrd.luks.devices."nixosroot".device = "/dev/disk/by-uuid/3b0d4c02-d9e5-44ab-8461-30797547ed70";
boot.initrd.luks.devices."nixosroot".device =
"/dev/disk/by-uuid/3b0d4c02-d9e5-44ab-8461-30797547ed70";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/67E3-17ED";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/67E3-17ED";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/1e0f60e9-cf43-451d-8466-81887f27c7cf"; }
swapDevices = [
{ device = "/dev/disk/by-uuid/1e0f60e9-cf43-451d-8466-81887f27c7cf"; }
];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

View File

@ -1,4 +1,9 @@
{ pkgs, customPackageOverlay, modulesPath, ... }:
{
pkgs,
customPackageOverlay,
modulesPath,
...
}:
let
custom-fonts = import ../../fonts { inherit pkgs; };
@ -34,7 +39,6 @@ in
experimental-features = nix-command flakes
'';
nixpkgs.overlays = [
customPackageOverlay
];
@ -46,7 +50,10 @@ in
isNormalUser = true;
home = "/home/deepak";
description = "Deepak Mallubhotla";
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
extraGroups = [
"wheel"
"networkmanager"
]; # Enable sudo for the user.
shell = pkgs.zsh;
};
@ -73,7 +80,6 @@ in
custom-fonts.custom-fonts
];
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-qt;
@ -85,5 +91,4 @@ in
# Optional (default: 41641):
services.tailscale.port = 62532;
}

View File

@ -1,4 +1,9 @@
{ pkgs, customPackageOverlay, modulesPath, ... }:
{
pkgs,
customPackageOverlay,
modulesPath,
...
}:
let
custom-fonts = import ../../fonts { inherit pkgs; };
@ -34,7 +39,6 @@ in
experimental-features = nix-command flakes
'';
nixpkgs.overlays = [
customPackageOverlay
];
@ -46,7 +50,10 @@ in
isNormalUser = true;
home = "/home/deepak";
description = "Deepak Mallubhotla";
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
extraGroups = [
"wheel"
"networkmanager"
]; # Enable sudo for the user.
shell = pkgs.zsh;
};
@ -73,7 +80,6 @@ in
custom-fonts.custom-fonts
];
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-qt;
@ -85,5 +91,4 @@ in
# Optional (default: 41641):
services.tailscale.port = 62532;
}

View File

@ -1,6 +1,13 @@
{ cmp-vimtex, spaceport-nvim, nomodoro, parrot-nvim, inputs }:
{
cmp-vimtex,
spaceport-nvim,
nomodoro,
parrot-nvim,
inputs,
}:
let
pluginoverlay= final: prev:
pluginoverlay =
_final: prev:
let
cmpVimtexPlugin = prev.vimUtils.buildVimPlugin {
src = cmp-vimtex;
@ -38,7 +45,8 @@ let
};
};
in {
in
{
overlay = inputs.nixpkgs.lib.composeManyExtensions [
pluginoverlay
inputs.claude-mcp-bundle.overlays.default

17
treefmt.nix Normal file
View File

@ -0,0 +1,17 @@
# treefmt.nix
{ ... }:
{
projectRootFile = "treefmt.nix";
settings.global.excludes = [
"*.toml"
"*.ttf"
"*.txt"
];
programs.deadnix.enable = true;
programs.mdsh.enable = true;
programs.nixfmt.enable = true;
programs.shellcheck.enable = true;
programs.shfmt.enable = true;
programs.yamlfmt.enable = true;
}