1
0
Fork 0
generated from me/nix-flake-template

Initial commit

This commit is contained in:
Ethan Reece 2025-07-19 23:47:51 +00:00
commit afe0fb41a3
7 changed files with 463 additions and 0 deletions

5
.envrc Normal file
View file

@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
#
# SPDX-License-Identifier: MIT
use flake

8
.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
#
# SPDX-License-Identifier: MIT
.direnv
.helix
.pre-commit-config.yaml
result

18
LICENSES/MIT.txt Normal file
View file

@ -0,0 +1,18 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.

34
README.md Normal file
View file

@ -0,0 +1,34 @@
<!--
SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
SPDX-License-Identifier: MIT
-->
# ❄️ Nix Flake template
Template that automatically configures settings for language checking,
formatting, and linting to integrate with enabled editors and the project
repository.
## ⭐ Features
- 🧩 **`flake-parts`**: Makes the Flake modular and reusable, enabling clean
separation of components.
- ✨ **`treefmt`** (with Helix integration): Automatically formats the code in
this repository when modifying it, with features to check the Flake for
formatting consistency.
- 🏭 **`direnv`**: Automatically loads project tools when navigating to the
project directory.
- 📑 **Jujutsu**: Modern version control system with an improved UX for commits
and merges.
- ⌨️ **Devshell**: Clean shell management, printing project-specific commands on
launch with icons using Nerd Fonts.
- 💬 **Language Server Protocol (LSP)**: Has language servers for file formats
used in this repository; integrates with Helix text editor and fully managed
by Nix with each language's configuration in its own file.
- 📝 **Language tools**: Checks for grammatical and styling issues using Vale,
Harper, LTeX (LanguageTool), and Typos, centralizing the custom dictionary for
these tools in the Nix configuration.
- ⚙️ **Git pre-commit hooks**: Lints the files before making a commit, both with
programming and natural languages.
- 🏛 **REUSE**: Simplifies software licensing and checks for errors.

313
flake.lock generated Normal file
View file

@ -0,0 +1,313 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1741473158,
"narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=",
"owner": "numtide",
"repo": "devshell",
"rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-lib": {
"inputs": {
"devshell": [
"devshell"
],
"flake-parts": [
"flake-parts"
],
"git-hooks-nix": [
"git-hooks-nix"
],
"lix-module": [
"lix-module"
],
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": [
"treefmt-nix"
]
},
"locked": {
"lastModified": 1752913092,
"narHash": "sha256-A7MEWj7yssLqBh9xd+YJa0o3/gKIefAhW3yM5FqBpbc=",
"ref": "main",
"rev": "76b61f33d847dbcf02f1b1f6cf12bc8b60ec70f3",
"revCount": 24,
"type": "git",
"url": "https://git.sudoer777.dev/me/nix-flake-base.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://git.sudoer777.dev/me/nix-flake-base.git"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakey-profile": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"git-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1750779888,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"lix": {
"flake": false,
"locked": {
"lastModified": 1751825501,
"narHash": "sha256-6Jve3xCvRJGkz0A9D8dXH/DMWYE8MkFt+KJWQs9cLkw=",
"rev": "378b360bf8e0d04e8dd3733acd20d7a9b70360f1",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/378b360bf8e0d04e8dd3733acd20d7a9b70360f1.tar.gz?rev=378b360bf8e0d04e8dd3733acd20d7a9b70360f1"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"
}
},
"lix-module": {
"inputs": {
"flake-utils": "flake-utils",
"flakey-profile": "flakey-profile",
"lix": "lix",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1751909859,
"narHash": "sha256-gbpuESxl/An4GTh7QEbQRYJozVIxWkwVGbWK0/0GoRc=",
"rev": "4d4c2b8f0a801c91ce5b717c77fe3a17efa1402f",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/4d4c2b8f0a801c91ce5b717c77fe3a17efa1402f.tar.gz?rev=4d4c2b8f0a801c91ce5b717c77fe3a17efa1402f"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1722073938,
"narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1730768919,
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1752900028,
"narHash": "sha256-dPALCtmik9Wr14MGqVXm+OQcv7vhPBXcWNIOThGnB/Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6b4955211758ba47fac850c040a27f23b9b4008f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1747958103,
"narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-lib": "flake-lib",
"flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"lix-module": "lix-module",
"nixpkgs": "nixpkgs_3",
"treefmt-nix": "treefmt-nix"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1752909129,
"narHash": "sha256-Eh8FkMvGRaY71BU/oyZTTzt9RsBIq2E6j0r3eLZ/2kY=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "0043b95d80b5bf6d61e84d237e2007727f4dd38d",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

3
flake.lock.license Normal file
View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
SPDX-License-Identifier: MIT

82
flake.nix Normal file
View file

@ -0,0 +1,82 @@
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
#
# SPDX-License-Identifier: MIT
{
description = "Nix Flake template";
inputs = {
flake-lib = {
url = "git+https://git.sudoer777.dev/me/nix-flake-base.git?ref=main";
flake = true;
inputs = {
devshell.follows = "devshell";
flake-parts.follows = "flake-parts";
git-hooks-nix.follows = "git-hooks-nix";
lix-module.follows = "lix-module";
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
devshell.url = "github:numtide/devshell";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
git-hooks-nix.url = "github:cachix/git-hooks.nix";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }:
{
systems = [ "aarch64-linux" ];
imports = [ inputs.flake-lib.flakeModule ];
perSystem =
{ pkgs, system, ... }:
{
editors.helix.enable = true;
languages = {
en-us = {
enable = true;
dictionary = [
"Asahi"
"Catppuccin"
"Devshell"
"Flake"
"Jujutsu"
"LanguageTool"
"LLMs"
"LTeX"
"NixOS"
"Nushell"
"SOPS"
"Stylix"
];
};
markdown.enable = true;
nix.enable = true;
toml.enable = true;
yaml.enable = true;
};
devshells.default = {
packages = [ pkgs.forgejo-cli ];
# reuse annotate -c "Ethan Reece <contact@ethanreece.com>" -l MIT -y 2025
devshell = {
motd = ''
{202}󱄅 Nix Flake template{reset}
$(type -p menu &>/dev/null && menu)
'';
name = "Nix Flake template";
};
};
};
}
);
}