2025-05-21 19:47:51 +01:00
|
|
|
{
|
|
|
|
|
description = "NixOS configuration";
|
|
|
|
|
|
|
|
|
|
inputs = {
|
2026-06-02 07:40:25 -07:00
|
|
|
# Pinned stable channel; the single source of truth for every host.
|
2026-06-04 13:34:44 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
2026-06-02 07:40:25 -07:00
|
|
|
# Bleeding-edge channel, used only to pull individual packages via overlay.
|
|
|
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
|
# Home-manager release matched to the stable nixpkgs; `follows` keeps a single nixpkgs eval.
|
|
|
|
|
home-manager.url = "github:nix-community/home-manager/release-26.05";
|
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
# WSL module for the EDaaS host; flake input avoids the impure <nixos-wsl> NIX_PATH lookup.
|
|
|
|
|
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
|
|
|
|
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
# Apple Silicon (Asahi) support for the MacBook host.
|
|
|
|
|
nixos-apple-silicon.url = "github:nix-community/nixos-apple-silicon";
|
|
|
|
|
nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs";
|
2026-06-02 15:46:19 +00:00
|
|
|
# nix-darwin: manage macOS hosts from this same flake.
|
|
|
|
|
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
|
|
|
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
2026-06-02 15:56:37 +00:00
|
|
|
# nix-homebrew: declaratively own and install the Homebrew prefix on macOS.
|
|
|
|
|
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
2026-06-02 07:40:25 -07:00
|
|
|
# Provides mkFlake: the systems/perSystem scaffolding used below.
|
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
2026-06-09 21:14:00 +01:00
|
|
|
# Declarative Firefox add-ons (e.g. the Catppuccin theme); see lyrathorpe/user.nix.
|
|
|
|
|
firefox-addons = {
|
|
|
|
|
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
2026-06-10 11:08:49 +01:00
|
|
|
# Prebuilt nix-index database so "command not found -> which package
|
|
|
|
|
# provides it" works immediately (no manual `nix-index` run). See shell.nix.
|
|
|
|
|
nix-index-database = {
|
|
|
|
|
url = "github:nix-community/nix-index-database";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
2026-06-10 14:56:58 +01:00
|
|
|
# treefmt-nix: one multi-language formatter driving `nix fmt` and the
|
|
|
|
|
# formatting flake check (nixfmt + shfmt + prettier).
|
|
|
|
|
treefmt-nix = {
|
|
|
|
|
url = "github:numtide/treefmt-nix";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
# git-hooks.nix: declarative pre-commit hooks (nixfmt/deadnix/statix),
|
|
|
|
|
# installed into the repo via the devShell.
|
|
|
|
|
git-hooks = {
|
|
|
|
|
url = "github:cachix/git-hooks.nix";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
2026-06-10 15:31:29 +01:00
|
|
|
# Declarative Neovim (the editor; see lyrathorpe/home/editor.nix). Release
|
|
|
|
|
# branch matched to the pinned nixpkgs (26.05); follows our nixpkgs to keep a
|
|
|
|
|
# single nixpkgs in the closure. editor.nix sets programs.nixvim.nixpkgs.source
|
|
|
|
|
# to this same input so the home module doesn't warn about the pin.
|
|
|
|
|
nixvim = {
|
|
|
|
|
url = "github:nix-community/nixvim/nixos-26.05";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
2026-06-10 16:19:33 +01:00
|
|
|
# Curated per-hardware profiles (microcode, SSD, platform quirks) for the
|
|
|
|
|
# physical x86 hosts.
|
|
|
|
|
nixos-hardware = {
|
|
|
|
|
url = "github:NixOS/nixos-hardware";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
2025-05-21 19:47:51 +01:00
|
|
|
};
|
|
|
|
|
|
2026-06-02 07:40:25 -07:00
|
|
|
outputs =
|
|
|
|
|
inputs@{
|
|
|
|
|
flake-parts,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
nixpkgs-unstable,
|
|
|
|
|
home-manager,
|
|
|
|
|
nixos-wsl,
|
|
|
|
|
nixos-apple-silicon,
|
2026-06-02 15:46:19 +00:00
|
|
|
nix-darwin,
|
2026-06-02 15:56:37 +00:00
|
|
|
nix-homebrew,
|
2026-06-02 07:40:25 -07:00
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } (
|
|
|
|
|
{ lib, ... }:
|
|
|
|
|
let
|
|
|
|
|
# claude-code tracks nixpkgs-unstable regardless of the pinned nixpkgs.
|
|
|
|
|
overlays = [
|
2026-06-10 14:56:58 +01:00
|
|
|
(_final: prev: {
|
2026-06-10 14:57:21 +01:00
|
|
|
inherit
|
2026-06-02 07:40:25 -07:00
|
|
|
(import nixpkgs-unstable {
|
|
|
|
|
inherit (prev.stdenv.hostPlatform) system;
|
|
|
|
|
config.allowUnfree = true;
|
2026-06-10 14:57:21 +01:00
|
|
|
})
|
|
|
|
|
claude-code
|
|
|
|
|
;
|
2026-06-02 07:40:25 -07:00
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Unfree packages permitted to be built (replaces blanket allowUnfree).
|
|
|
|
|
unfreePackages = [
|
|
|
|
|
"claude-code"
|
|
|
|
|
"lens"
|
|
|
|
|
"lens-desktop"
|
|
|
|
|
];
|
|
|
|
|
|
2026-06-02 15:46:19 +00:00
|
|
|
# nixpkgs + nix-daemon settings shared by NixOS and Darwin hosts.
|
|
|
|
|
commonModule = {
|
|
|
|
|
nixpkgs.overlays = overlays;
|
|
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) unfreePackages;
|
|
|
|
|
nix.settings.experimental-features = [
|
|
|
|
|
"nix-command"
|
|
|
|
|
"flakes"
|
|
|
|
|
];
|
|
|
|
|
# Make `nix shell nixpkgs#...` and <nixpkgs> use the pinned nixpkgs.
|
|
|
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
|
|
|
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Shared scaffolding for every NixOS host: common user, settings, home-manager.
|
2026-06-02 07:40:25 -07:00
|
|
|
baseModules = [
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/user.nix
|
2026-06-04 13:34:44 +00:00
|
|
|
./system/modules/common-nixos.nix
|
2026-06-02 15:46:19 +00:00
|
|
|
commonModule
|
2026-06-02 07:40:25 -07:00
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
|
{
|
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
|
home-manager.useUserPackages = true;
|
2026-06-02 16:28:28 +00:00
|
|
|
# Back up pre-existing dotfiles (e.g. .zshrc) instead of aborting
|
|
|
|
|
# activation when home-manager would overwrite them.
|
|
|
|
|
home-manager.backupFileExtension = "backup";
|
2026-06-02 07:40:25 -07:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
2026-06-02 14:58:26 +00:00
|
|
|
# mkHost :: { system, username, fullName, modules, homeModules } -> nixosSystem
|
2026-06-02 07:40:25 -07:00
|
|
|
# Builds one machine by appending its host-specific modules to the shared
|
2026-06-02 14:58:26 +00:00
|
|
|
# baseModules. The user identity (username/fullName) is threaded through
|
|
|
|
|
# specialArgs so user.nix and the home modules stay host-agnostic, and the
|
|
|
|
|
# home-manager profile is keyed by the host's username.
|
2026-06-02 07:40:25 -07:00
|
|
|
mkHost =
|
2026-06-02 14:58:26 +00:00
|
|
|
{
|
|
|
|
|
system,
|
|
|
|
|
username,
|
|
|
|
|
fullName,
|
|
|
|
|
modules,
|
|
|
|
|
homeModules,
|
2026-06-04 13:57:44 +00:00
|
|
|
# Host form factor. Laptops inherit the default; a desktop host sets
|
|
|
|
|
# `portable = false` to drop mobile components (battery block,
|
|
|
|
|
# brightness keys) from the home-manager Sway config.
|
|
|
|
|
portable ? true,
|
2026-06-02 14:58:26 +00:00
|
|
|
}:
|
2026-06-02 07:40:25 -07:00
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
|
inherit system;
|
2026-06-04 13:57:44 +00:00
|
|
|
specialArgs = {
|
|
|
|
|
inherit
|
|
|
|
|
inputs
|
|
|
|
|
username
|
|
|
|
|
fullName
|
|
|
|
|
portable
|
|
|
|
|
;
|
|
|
|
|
};
|
2026-06-02 14:58:26 +00:00
|
|
|
modules =
|
|
|
|
|
baseModules
|
|
|
|
|
++ modules
|
|
|
|
|
++ [
|
|
|
|
|
{
|
2026-06-04 13:57:44 +00:00
|
|
|
home-manager.extraSpecialArgs = {
|
|
|
|
|
inherit
|
|
|
|
|
inputs
|
|
|
|
|
username
|
|
|
|
|
fullName
|
|
|
|
|
portable
|
|
|
|
|
;
|
|
|
|
|
};
|
2026-06-02 14:58:26 +00:00
|
|
|
home-manager.users.${username}.imports = homeModules;
|
|
|
|
|
}
|
|
|
|
|
];
|
2026-06-02 07:40:25 -07:00
|
|
|
};
|
|
|
|
|
|
2026-06-02 15:46:19 +00:00
|
|
|
# Shared scaffolding for every Darwin (macOS) host.
|
|
|
|
|
darwinBaseModules = [
|
|
|
|
|
commonModule
|
2026-06-02 15:56:37 +00:00
|
|
|
nix-homebrew.darwinModules.nix-homebrew
|
2026-06-02 15:46:19 +00:00
|
|
|
home-manager.darwinModules.home-manager
|
|
|
|
|
{
|
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
|
home-manager.useUserPackages = true;
|
2026-06-02 16:28:28 +00:00
|
|
|
# Back up pre-existing dotfiles (e.g. .zshrc) instead of aborting
|
|
|
|
|
# activation when home-manager would overwrite them.
|
|
|
|
|
home-manager.backupFileExtension = "backup";
|
2026-06-02 15:46:19 +00:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# mkDarwinHost :: { system, username, fullName, modules, homeModules } -> darwinSystem
|
|
|
|
|
# Darwin counterpart of mkHost. macOS already owns the login user, so we
|
|
|
|
|
# only attach the platform and home-manager; no NixOS user module here.
|
|
|
|
|
mkDarwinHost =
|
|
|
|
|
{
|
|
|
|
|
system,
|
|
|
|
|
username,
|
|
|
|
|
fullName,
|
|
|
|
|
modules,
|
|
|
|
|
homeModules,
|
|
|
|
|
}:
|
|
|
|
|
nix-darwin.lib.darwinSystem {
|
|
|
|
|
specialArgs = { inherit inputs username fullName; };
|
|
|
|
|
modules =
|
|
|
|
|
darwinBaseModules
|
|
|
|
|
++ modules
|
|
|
|
|
++ [
|
|
|
|
|
{
|
|
|
|
|
nixpkgs.hostPlatform = system;
|
|
|
|
|
# macOS owns the account; point home-manager at its home dir.
|
|
|
|
|
users.users.${username}.home = "/Users/${username}";
|
|
|
|
|
home-manager.extraSpecialArgs = { inherit inputs username fullName; };
|
|
|
|
|
home-manager.users.${username}.imports = homeModules;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-02 07:40:25 -07:00
|
|
|
# Host table — declarative registry of every machine. To add a host:
|
2026-06-02 14:58:26 +00:00
|
|
|
# give it a name, its `system`, the owning user, and the module lists.
|
2026-06-02 07:40:25 -07:00
|
|
|
# mapAttrs below turns each entry into a nixosConfiguration of the same name.
|
|
|
|
|
hosts = {
|
2026-06-02 15:06:10 +00:00
|
|
|
lyrathorpe-mbp = {
|
2026-06-02 07:40:25 -07:00
|
|
|
system = "aarch64-linux";
|
2026-06-02 14:58:26 +00:00
|
|
|
username = "lyrathorpe";
|
|
|
|
|
fullName = "Lyra Thorpe";
|
2026-06-02 07:40:25 -07:00
|
|
|
modules = [
|
|
|
|
|
./system/machine/MBP-Asahi/configuration.nix
|
2026-06-04 13:34:44 +00:00
|
|
|
./system/modules/laptop.nix
|
2026-06-02 07:40:25 -07:00
|
|
|
nixos-apple-silicon.nixosModules.default
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/swaywm.nix
|
2026-06-02 14:58:26 +00:00
|
|
|
];
|
|
|
|
|
homeModules = [
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/home
|
|
|
|
|
./lyrathorpe/home/desktop.nix
|
2026-06-02 07:40:25 -07:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-04 15:22:07 +01:00
|
|
|
lyrathorpe-t400 = {
|
2026-06-02 07:40:25 -07:00
|
|
|
system = "x86_64-linux";
|
2026-06-02 14:58:26 +00:00
|
|
|
username = "lyrathorpe";
|
|
|
|
|
fullName = "Lyra Thorpe";
|
2026-06-02 07:40:25 -07:00
|
|
|
modules = [
|
2026-06-04 15:22:07 +01:00
|
|
|
./system/machine/T400/configuration.nix
|
2026-06-04 13:34:44 +00:00
|
|
|
./system/modules/laptop.nix
|
2026-06-10 16:22:12 +01:00
|
|
|
./system/modules/ssh.nix
|
2026-06-10 16:19:33 +01:00
|
|
|
# No t400-specific profile exists; compose the generic ThinkPad +
|
|
|
|
|
# laptop/SSD/Intel building blocks (tp_smapi/acpi_call for battery
|
|
|
|
|
# thresholds, SSD + microcode defaults).
|
|
|
|
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad
|
|
|
|
|
inputs.nixos-hardware.nixosModules.common-pc-laptop
|
|
|
|
|
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
|
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/swaywm.nix
|
2026-06-02 14:58:26 +00:00
|
|
|
];
|
|
|
|
|
homeModules = [
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/home
|
|
|
|
|
./lyrathorpe/home/desktop.nix
|
2026-06-02 07:40:25 -07:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-04 15:22:07 +01:00
|
|
|
lyrathorpe-macpro31 = {
|
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
username = "lyrathorpe";
|
|
|
|
|
fullName = "Lyra Thorpe";
|
|
|
|
|
portable = false;
|
|
|
|
|
modules = [
|
|
|
|
|
./system/machine/MacPro31/configuration.nix
|
|
|
|
|
./system/modules/desktop.nix
|
2026-06-10 16:22:12 +01:00
|
|
|
./system/modules/ssh.nix
|
2026-06-10 16:19:33 +01:00
|
|
|
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
2026-06-04 15:22:07 +01:00
|
|
|
./lyrathorpe/swaywm.nix
|
|
|
|
|
];
|
|
|
|
|
homeModules = [
|
|
|
|
|
./lyrathorpe/home
|
|
|
|
|
./lyrathorpe/home/desktop.nix
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-02 07:40:25 -07:00
|
|
|
emmathorpe-edaas = {
|
|
|
|
|
system = "x86_64-linux";
|
2026-06-02 14:58:26 +00:00
|
|
|
username = "emmathorpe";
|
|
|
|
|
fullName = "Emma Thorpe";
|
2026-06-02 07:40:25 -07:00
|
|
|
modules = [
|
2025-06-16 14:44:08 +00:00
|
|
|
./system/machine/EDaaS/configuration.nix
|
2026-06-02 07:40:25 -07:00
|
|
|
nixos-wsl.nixosModules.default
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/swaywm.nix
|
2026-06-02 14:58:26 +00:00
|
|
|
];
|
|
|
|
|
homeModules = [
|
2026-06-02 15:06:10 +00:00
|
|
|
./lyrathorpe/home
|
2026-06-10 14:56:58 +01:00
|
|
|
./lyrathorpe/home/work.nix
|
2026-06-02 07:40:25 -07:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
2026-06-02 15:46:19 +00:00
|
|
|
|
|
|
|
|
# Darwin host table — macOS machines built via mkDarwinHost. The shared
|
|
|
|
|
# ./lyrathorpe/home modules (shell, git, editor) are reused; the Linux-only
|
|
|
|
|
# desktop/sway modules are intentionally left out.
|
|
|
|
|
darwinHosts = {
|
|
|
|
|
lyrathorpe-mac = {
|
|
|
|
|
system = "aarch64-darwin";
|
|
|
|
|
username = "lyrathorpe";
|
|
|
|
|
fullName = "Lyra Thorpe";
|
|
|
|
|
modules = [
|
|
|
|
|
./system/machine/Darwin/configuration.nix
|
|
|
|
|
];
|
|
|
|
|
homeModules = [
|
|
|
|
|
./lyrathorpe/home
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
2026-06-02 07:40:25 -07:00
|
|
|
in
|
|
|
|
|
{
|
2026-06-10 14:56:58 +01:00
|
|
|
# flake-parts modules: treefmt-nix wires `nix fmt` + a formatting check;
|
|
|
|
|
# git-hooks.nix wires the pre-commit check + devShell installation script.
|
|
|
|
|
imports = [
|
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
|
inputs.git-hooks.flakeModule
|
|
|
|
|
];
|
|
|
|
|
|
2026-06-02 07:40:25 -07:00
|
|
|
systems = [
|
|
|
|
|
"x86_64-linux"
|
|
|
|
|
"aarch64-linux"
|
2026-06-02 15:46:19 +00:00
|
|
|
"aarch64-darwin"
|
|
|
|
|
"x86_64-darwin"
|
2026-06-02 07:40:25 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# perSystem is evaluated once per entry in `systems`; `pkgs` is the
|
|
|
|
|
# nixpkgs instance for that system. Outputs here become per-system
|
|
|
|
|
# attrsets automatically (e.g. devShells.<system>.default).
|
|
|
|
|
perSystem =
|
2026-06-10 14:56:58 +01:00
|
|
|
{ config, pkgs, ... }:
|
2026-06-02 07:40:25 -07:00
|
|
|
{
|
2026-06-10 14:56:58 +01:00
|
|
|
# treefmt drives `nix fmt` and the formatting check below. nixfmt
|
|
|
|
|
# stays the .nix formatter (the tree is already nixfmt-formatted);
|
|
|
|
|
# shfmt covers shell and prettier covers markdown/yaml/json.
|
|
|
|
|
treefmt = {
|
|
|
|
|
projectRootFile = "flake.nix";
|
|
|
|
|
programs.nixfmt.enable = true;
|
|
|
|
|
programs.shfmt.enable = true;
|
|
|
|
|
programs.prettier.enable = true;
|
|
|
|
|
# Generated hardware-configuration.nix files are not hand-edited.
|
2026-06-10 14:57:21 +01:00
|
|
|
settings.global.excludes = [
|
|
|
|
|
"*/hardware-configuration.nix" # generated by nixos-generate-config
|
|
|
|
|
"flake.lock" # generated by `nix flake lock`
|
|
|
|
|
];
|
2026-06-10 14:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Pre-commit hooks: format + lint gate run on commit. The same hooks
|
|
|
|
|
# are exposed as a flake check (pre-commit.check.enable defaults true).
|
2026-06-10 14:57:21 +01:00
|
|
|
pre-commit.settings = {
|
|
|
|
|
# Generated by nixos-generate-config; don't lint/reformat (treefmt
|
|
|
|
|
# excludes them too).
|
|
|
|
|
excludes = [ "hardware-configuration\\.nix$" ];
|
|
|
|
|
hooks = {
|
|
|
|
|
nixfmt-rfc-style.enable = true;
|
|
|
|
|
deadnix = {
|
|
|
|
|
enable = true;
|
|
|
|
|
# Unused module args ({config,lib,pkgs,...}) are normal; only
|
|
|
|
|
# flag genuinely dead bindings.
|
|
|
|
|
settings.noLambdaPatternNames = true;
|
|
|
|
|
};
|
|
|
|
|
statix.enable = true; # reads statix.toml (repeated_keys/empty_pattern disabled)
|
2026-06-10 14:56:58 +01:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# treefmt-nix exposes its own `checks.treefmt`; alias it to
|
|
|
|
|
# `formatting` so the existing CI gate (.#checks.*.formatting) keeps
|
|
|
|
|
# working without churn.
|
|
|
|
|
checks.formatting = config.treefmt.build.check inputs.self;
|
|
|
|
|
|
|
|
|
|
# deadnix / statix lints as standalone flake checks so `nix flake
|
|
|
|
|
# check` flags dead code and antipatterns independently of pre-commit.
|
|
|
|
|
checks.deadnix = pkgs.runCommandLocal "check-deadnix" { nativeBuildInputs = [ pkgs.deadnix ]; } ''
|
|
|
|
|
deadnix --fail --no-lambda-pattern-names ${./.} && touch $out
|
|
|
|
|
'';
|
|
|
|
|
checks.statix = pkgs.runCommandLocal "check-statix" { nativeBuildInputs = [ pkgs.statix ]; } ''
|
2026-06-10 14:57:21 +01:00
|
|
|
statix check -c ${./.} ${./.} && touch $out
|
2026-06-10 14:56:58 +01:00
|
|
|
'';
|
2026-06-02 07:40:25 -07:00
|
|
|
|
|
|
|
|
# `nix develop` shell with the tooling needed to hack on this flake.
|
2026-06-10 14:56:58 +01:00
|
|
|
# shellHook installs the git pre-commit hooks into the working tree.
|
2026-06-02 07:40:25 -07:00
|
|
|
devShells.default = pkgs.mkShellNoCC {
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
|
nixfmt
|
|
|
|
|
nil
|
|
|
|
|
git
|
2026-06-10 14:56:58 +01:00
|
|
|
deadnix
|
|
|
|
|
statix
|
|
|
|
|
treefmt
|
2026-06-02 07:40:25 -07:00
|
|
|
];
|
2026-06-10 14:56:58 +01:00
|
|
|
shellHook = config.pre-commit.installationScript;
|
2026-06-02 07:40:25 -07:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-02 15:46:19 +00:00
|
|
|
# Realise the host tables: each entry becomes a {nixos,darwin}Configuration.
|
2026-06-02 07:40:25 -07:00
|
|
|
flake.nixosConfigurations = lib.mapAttrs (_name: mkHost) hosts;
|
2026-06-02 15:46:19 +00:00
|
|
|
flake.darwinConfigurations = lib.mapAttrs (_name: mkDarwinHost) darwinHosts;
|
2026-06-02 07:40:25 -07:00
|
|
|
}
|
|
|
|
|
);
|
2025-05-21 19:47:51 +01:00
|
|
|
}
|