- Add `checks.${system}` block to `flake.nix` executing Ruff (linting and formatting checks), Pyright (static type analysis), and ShellCheck (shell script analysis across all `.sh` scripts).
- Add `shellcheck` package to `home/dev.nix`.
- Resolve linting and formatting issues across Python and Bash scripts (`bundle_project.py`, `git.sh`, `jump.sh`, `pdf.sh`, `todo.sh`, etc.) to ensure clean check evaluations.
Rationale: Automates quality control and code health standards directly inside the Nix flake ecosystem via `nix flake check`.
128 lines
3.8 KiB
Nix
128 lines
3.8 KiB
Nix
{
|
|
description = "Kiskaadee's Declarative NixOS Laptop Workstation";
|
|
|
|
# --- External Repositories & Flake Inputs ---
|
|
inputs = {
|
|
# NixOS Unstable channel - official project-hosted zstd tarball
|
|
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
|
|
|
|
# Home Manager - manages user-space configurations, dotfiles, and shell environments
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# DankMaterialShell (DMS) - core custom desktop shell environment and panel
|
|
dms = {
|
|
url = "github:AvengeMedia/DankMaterialShell";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# dgop - companion system monitoring / daemon utility for DankMaterialShell
|
|
dgop = {
|
|
url = "github:AvengeMedia/dgop";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# dank-greeter - greetd login screen with Dank Material aesthetic
|
|
dank-greeter = {
|
|
url = "github:AvengeMedia/dank-greeter";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# DankCalendar - calendar daemon and UI for DMS
|
|
dankcalendar = {
|
|
url = "github:AvengeMedia/dankcalendar";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# DankSearch - fast indexed filesystem search for DMS
|
|
danksearch = {
|
|
url = "github:AvengeMedia/danksearch";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# Zen Browser - modern, lightweight, community-maintained browser
|
|
zen-browser = {
|
|
url = "github:0xc000022070/zen-browser-flake";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# Antigravity CLI - coding companion and local AI agent helper
|
|
antigravity = {
|
|
url = "github:jacopone/antigravity-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
# --- System Outputs ---
|
|
outputs = { self, nixpkgs, home-manager, dms, dgop, dank-greeter, dankcalendar, danksearch, zen-browser, antigravity, ... }@inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
# --- Linting, Formatting & Static Analysis Checks ---
|
|
# Executed via `nix flake check` or `nix build .#checks.<system>.<check>`
|
|
checks.${system} = {
|
|
# Python linting via ruff
|
|
ruff-lint = pkgs.runCommand "check-ruff-lint" {
|
|
nativeBuildInputs = [ pkgs.ruff ];
|
|
} ''
|
|
ruff check --no-cache ${self}
|
|
touch $out
|
|
'';
|
|
|
|
# Python formatting check via ruff
|
|
ruff-format = pkgs.runCommand "check-ruff-format" {
|
|
nativeBuildInputs = [ pkgs.ruff ];
|
|
} ''
|
|
ruff format --check ${self}
|
|
touch $out
|
|
'';
|
|
|
|
# Python static type analysis via pyright
|
|
pyright = pkgs.runCommand "check-pyright" {
|
|
nativeBuildInputs = [ pkgs.pyright ];
|
|
} ''
|
|
pyright ${self}
|
|
touch $out
|
|
'';
|
|
|
|
# Shell script linting via ShellCheck
|
|
shellcheck = pkgs.runCommand "check-shellcheck" {
|
|
nativeBuildInputs = [ pkgs.shellcheck ];
|
|
} ''
|
|
find ${self} -type f -name "*.sh" -exec shellcheck -s bash {} +
|
|
touch $out
|
|
'';
|
|
};
|
|
|
|
nixosConfigurations = {
|
|
# 💻 LAPTOP HOST (Mobile Workstation)
|
|
laptop = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = { inherit inputs; };
|
|
modules = [
|
|
./system
|
|
inputs.dank-greeter.nixosModules.default
|
|
inputs.dankcalendar.nixosModules.default
|
|
|
|
home-manager.nixosModules.home-manager {
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.backupFileExtension = "backup";
|
|
home-manager.extraSpecialArgs = { inherit inputs; };
|
|
home-manager.users.kiskaadee = {
|
|
imports = [
|
|
./home
|
|
inputs.danksearch.homeModules.default
|
|
];
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|