Skip to content

Commit

Permalink
✨ (module): Init
Browse files Browse the repository at this point in the history
  • Loading branch information
theobori committed Nov 7, 2024
1 parent aacab79 commit ce0fb63
Show file tree
Hide file tree
Showing 8 changed files with 963 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
15 changes: 15 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Nix Flake Check

on:
push:
pull_request:
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix flake check
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# direnv
.direnv
.env

# pre-commit
.pre-commit-config.yaml

result
47 changes: 47 additions & 0 deletions checks/pre-commit-hooks/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
inputs,
lib,
pkgs,
...
}:
let
inherit (inputs) pre-commit-hooks-nix;
in
pre-commit-hooks-nix.lib.${pkgs.system}.run {
src = ./.;
hooks =
let
excludes = [
"flake.lock"
"CHANGELOG.md"
];
fail_fast = true;
verbose = true;
in
{
actionlint.enable = true;

deadnix = {
enable = true;

settings = {
edit = true;
};
};

git-cliff = {
enable = false;
inherit excludes fail_fast verbose;

always_run = true;
description = "pre-push hook for git-cliff";
entry = "${lib.getExe pkgs.git-cliff}";
language = "system";
stages = [ "pre-push" ];
};

nixfmt-rfc-style.enable = true;

pre-commit-hook-ensure-sops.enable = true;
};
}
208 changes: 208 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
description = "theobori's Nix/NixOS Config";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs";

snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};

pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
};

outputs =
inputs:
let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;

snowfall = {
metadata = "nix-teeworlds";
namespace = "nix-teeworlds";
meta = {
name = "nix-teeworlds";
title = "Nix Teeworlds";
};
};
};
in
lib.mkFlake { outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; }; };
}
Loading

0 comments on commit ce0fb63

Please sign in to comment.