Files
nixos-config/flake.nix
T
jory ff31b21a74
CI / Flake check (aarch64-linux) (push) Successful in 32s
CI / Flake check (x86_64-linux) (push) Successful in 32s
CI / Pre-commit checks (x86_64-linux) (push) Successful in 10s
Harden server and add Nix-native CI + self-hosted Gitea Actions
- Add self-hosted Gitea Actions runner module (servers/hetzner/modules/services/gitea.nix)
- Add CI workflow (.gitea/workflows/ci.yml):
  - Flake check (x86_64-linux + aarch64-linux, eval-only)
  - Pre-commit checks (x86_64-linux only)
  - Gitea-native runner (no Docker); Nix from host PATH
  - NIX_CONFIG enables flakes + extra-platforms
- Remove redundant .github/workflows/ci.yml (shadows .gitea)
- Enable deadnix in pre-commit hooks (flake.nix), fix 38 files
- Add statix.toml disabling empty_pattern lint (nixpkgs standard)
- Format whole repo with alejandra (27 files)
- Fix CI nix-not-found: export /run/current-system/sw/bin in PATH
- Remove aarch64 from pre-commit matrix (no QEMU binfmt deployed yet)
2026-07-12 08:24:14 +02:00

131 lines
3.8 KiB
Nix

{
description = "someone flake configuration based on hjem";
outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux"];
imports = [./hosts ./pkgs inputs.git-hooks-nix.flakeModule];
perSystem = {
config,
pkgs,
...
}: {
devShells = {
default = pkgs.mkShell {
packages = [pkgs.alejandra pkgs.git config.packages.repl];
name = "someone";
DIRENV_LOG_FORMAT = "";
};
};
# Nix Formatter
formatter = pkgs.alejandra;
# Pre-commit hooks (flake-parts module from cachix/git-hooks.nix).
# `nix build .#checks.<system>.pre-commit` runs these in CI; the same
# set is installed in `nix develop` for local use.
# alejandra.settings.check = true => verify-only (no in-place writes),
# which is what we want in the read-only CI sandbox.
pre-commit.settings.hooks = {
alejandra = {
enable = true;
settings.check = true;
};
statix = {
enable = true;
# hardware-configuration.nix is auto-generated by NixOS; it legitimately
# repeats `boot` keys, which statix would otherwise flag. Exclude it here.
settings.ignore = ["hardware-configuration.nix"];
# Lint config (statix.toml at repo root). Disables `empty_pattern`, which
# flags the standard NixOS `{ ... }:` module pattern that nixpkgs likewise
# permits.
settings.config = "./statix.toml";
};
deadnix.enable = true;
actionlint.enable = true;
trim-trailing-whitespace.enable = true;
end-of-file-fixer.enable = true;
check-yaml.enable = true;
check-toml.enable = true;
check-added-large-files.enable = true;
check-merge-conflicts.enable = true;
detect-private-keys.enable = true;
};
};
};
inputs = {
# global, so they can be `.follow`ed
systems.url = "github:nix-systems/default-linux";
flake-compat.url = "github:edolstra/flake-compat";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# Nix-native pre-commit framework (maintained successor to
# pre-commit-hooks.nix). Follows our nixpkgs to avoid version skew
# with the rest of the flake.
git-hooks-nix = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# rest of inputs, alphabetical order
agenix = {
url = "github:ryantm/agenix";
inputs = {
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
};
};
import-tree.url = "github:vic/import-tree";
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
helium = {
url = "github:schembriaiden/helium-browser-nix-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-db = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
# --- Server (hetzner) inputs ---
# Pinned to 24.05 to match the deployed Hetzner server exactly.
nixos-24-05 = {
url = "github:NixOS/nixpkgs/nixos-24.05";
};
nixpkgs-unstable = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixos-24-05";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixos-24-05";
};
};
}