2024-10-25 15:59:54 -05:00
|
|
|
# github.com/brianmcgee has lots of great ideas for going above and beyond for this
|
|
|
|
|
{
|
|
|
|
|
description = "Greg's homepage";
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
|
flake-root.url = "github:srid/flake-root";
|
|
|
|
|
hooks.url = "github:cachix/git-hooks.nix";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
|
{ flake-parts, ... }@inputs:
|
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
|
imports = [ inputs.flake-root.flakeModule ];
|
|
|
|
|
flake = {
|
|
|
|
|
# Universal things
|
|
|
|
|
overlays.default = _final: _prev: { };
|
|
|
|
|
};
|
|
|
|
|
systems = [
|
|
|
|
|
"x86_64-linux"
|
|
|
|
|
"aarch64-linux"
|
|
|
|
|
"aarch64-darwin"
|
|
|
|
|
];
|
|
|
|
|
perSystem =
|
|
|
|
|
{ pkgs, self', ... }@inputs':
|
|
|
|
|
let
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
_module.args.pkgs = import inputs.nixpkgs {
|
|
|
|
|
inherit (inputs') system;
|
|
|
|
|
overlays = [ ];
|
|
|
|
|
};
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
|
# These will just be available
|
|
|
|
|
packages = with pkgs; [ pre-commit ];
|
|
|
|
|
|
|
|
|
|
buildInputs = self'.checks.pre-commit.enabledPackages;
|
|
|
|
|
|
|
|
|
|
inherit (self'.checks.pre-commit) shellHook;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
checks = {
|
|
|
|
|
pre-commit = inputs.hooks.lib.${inputs'.system}.run {
|
|
|
|
|
src = ./.;
|
|
|
|
|
hooks = {
|
|
|
|
|
check-added-large-files.enable = true;
|
|
|
|
|
check-case-conflicts.enable = true;
|
|
|
|
|
check-merge-conflicts.enable = true;
|
|
|
|
|
check-symlinks.enable = true;
|
|
|
|
|
deadnix.enable = true;
|
|
|
|
|
end-of-file-fixer.enable = true;
|
|
|
|
|
fix-byte-order-marker.enable = true;
|
|
|
|
|
mixed-line-endings.enable = true;
|
|
|
|
|
nixfmt-rfc-style.enable = true;
|
|
|
|
|
trim-trailing-whitespace.enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# This is not special, this is just flakes
|
|
|
|
|
packages =
|
|
|
|
|
let
|
|
|
|
|
win = pkgs.pkgsCross.mingwW64;
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
default = pkgs.stdenv.mkDerivation {
|
|
|
|
|
name = "mingw-sword";
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
installPhase = ''
|
2024-11-15 09:44:18 -06:00
|
|
|
mkdir -p $out
|
|
|
|
|
pushd ${win.sword}
|
|
|
|
|
${pkgs.gnutar}/bin/tar cvhaf $out/sword.tar.xz .
|
2024-10-25 15:59:54 -05:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|