Base scaffold
This commit is contained in:
@@ -1,78 +1,107 @@
|
||||
# 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";
|
||||
devshell.url = "github:numtide/devshell";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-root.url = "github:srid/flake-root";
|
||||
naersk.url = "github:nix-community/naersk";
|
||||
#process-compose.url = "github:Platonic-Systems/process-compose-flake";
|
||||
#services-flake.url = "github:juspay/services-flake";
|
||||
};
|
||||
description = "Greg's homepage";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
devshell.url = "github:numtide/devshell";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-root.url = "github:srid/flake-root";
|
||||
hooks.url = "github:cachix/git-hooks.nix";
|
||||
naersk.url = "github:nix-community/naersk";
|
||||
};
|
||||
|
||||
outputs = { flake-parts, ... }@inputs:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [
|
||||
inputs.devshell.flakeModule
|
||||
inputs.flake-root.flakeModule
|
||||
#inputs.process-compose.flakeModule
|
||||
];
|
||||
flake = {
|
||||
# Universal things
|
||||
overlays.default = final: prev: {};
|
||||
};
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
perSystem = { pkgs, ... }@inputs': let
|
||||
naersk-lib = pkgs.callPackage inputs.naersk { };
|
||||
in {
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit (inputs') system;
|
||||
overlays = [];
|
||||
};
|
||||
# https://numtide.github.io/devshell/intro.html
|
||||
devshells.default = {
|
||||
env = [{
|
||||
name = "RUST_SRC_PATH";
|
||||
value = pkgs.rustPlatform.rustLibSrc;
|
||||
}];
|
||||
# These commands will be shown in the motd that users read
|
||||
# upon entering the shell
|
||||
commands = [{
|
||||
package = pkgs.cargo;
|
||||
category = "languages";
|
||||
help = "The Cargo tool";
|
||||
} {
|
||||
package = pkgs.rustc;
|
||||
category = "languages";
|
||||
help = "The rust compiler";
|
||||
} {
|
||||
package = pkgs.rustfmt;
|
||||
category = "tools";
|
||||
help = "Formatting tool for Rust";
|
||||
} {
|
||||
package = pkgs.pre-commit;
|
||||
category = "tools";
|
||||
help = "Helps run certain checks";
|
||||
} {
|
||||
package = pkgs.rustPackages.clippy;
|
||||
category = "tools";
|
||||
help = "Standard Rust clippy tool";
|
||||
} {
|
||||
package = pkgs.stdenv.cc;
|
||||
category = "languages";
|
||||
help = "The C compiler, to help things out";
|
||||
}];
|
||||
};
|
||||
outputs =
|
||||
{ flake-parts, ... }@inputs:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [
|
||||
inputs.devshell.flakeModule
|
||||
inputs.flake-root.flakeModule
|
||||
#inputs.process-compose.flakeModule
|
||||
];
|
||||
flake = {
|
||||
# Universal things
|
||||
# final: prev:
|
||||
overlays.default = _: _: { };
|
||||
};
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
perSystem =
|
||||
{ pkgs, ... }@inputs':
|
||||
let
|
||||
naersk-lib = pkgs.callPackage inputs.naersk { };
|
||||
in
|
||||
{
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit (inputs') system;
|
||||
overlays = [ ];
|
||||
};
|
||||
# https://numtide.github.io/devshell/intro.html
|
||||
devshells.default = {
|
||||
# These commands will be shown in the motd that users read
|
||||
# upon entering the shell
|
||||
commands = [
|
||||
{
|
||||
package = pkgs.cargo;
|
||||
category = "tools";
|
||||
help = "Rust build and package tool";
|
||||
}
|
||||
{
|
||||
package = pkgs.rustc;
|
||||
category = "languages";
|
||||
help = "Rust compiler";
|
||||
}
|
||||
{
|
||||
package = pkgs.rustfmt;
|
||||
category = "tools";
|
||||
help = "Standard Rust formatting tool";
|
||||
}
|
||||
{
|
||||
package = pkgs.clippy;
|
||||
category = "tools";
|
||||
help = "Rust linter";
|
||||
}
|
||||
{
|
||||
package = pkgs.stdenv.cc;
|
||||
category = "languages";
|
||||
help = "C compiler to help with building native code";
|
||||
}
|
||||
{
|
||||
package = pkgs.pre-commit;
|
||||
category = "tools";
|
||||
help = "Tool to help enforce commits make sense";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# This is not special, this is just flakes
|
||||
packages = {
|
||||
default = naersk-lib.buildPackage ./.;
|
||||
};
|
||||
};
|
||||
};
|
||||
checks = {
|
||||
pre-commit-check = 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;
|
||||
# Rust hooks
|
||||
cargo-check.enable = true;
|
||||
clippy.enable = true;
|
||||
rustfmt.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# This is not special, this is just flakes
|
||||
packages = {
|
||||
rustpkg = naersk-lib.buildPackage ./.;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user