refactor: move flake-parts modules to nix/modules/flake
This commit is contained in:
parent
2fe89b9e00
commit
53fe600399
7 changed files with 0 additions and 0 deletions
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
inputs,
|
||||
withSystem,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (builtins) map head;
|
||||
inherit (lib) concatStringsSep;
|
||||
mkListEntry = x: "- [" + x.path_ + "](" + x.path_ + ")";
|
||||
listOfGeneratedFiles = withSystem (head config.systems) (psArgs: psArgs.config.files.files);
|
||||
in
|
||||
{
|
||||
imports = [ inputs.files.flakeModules.default ];
|
||||
perSystem = psArgs: {
|
||||
make-shells.default.packages = [ psArgs.config.files.writer.drv ];
|
||||
};
|
||||
text.readme.parts."Generated Files" = concatStringsSep "\n" (
|
||||
[
|
||||
"This flake uses the [files flake-parts module](https://flake.parts/options/files.html) to generate documentation."
|
||||
|
||||
"The list of generated files are:"
|
||||
|
||||
]
|
||||
++ (map mkListEntry listOfGeneratedFiles)
|
||||
);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) concatStringsSep singleton;
|
||||
in
|
||||
{
|
||||
text.cheatsheet = concatStringsSep "\n" [
|
||||
"`__curPos.file` will give the full evaluated path of the nix file it is called in. See [this issue](https://github.com/NixOS/nix/issues/5897#issuecomment-1012165198) for more information."
|
||||
];
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
files.files = singleton {
|
||||
path_ = "docs/cheatsheet.md";
|
||||
drv = pkgs.writeText "cheatsheet.md" config.text.cheatsheet;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
text.readme = {
|
||||
heading = "Pantheon";
|
||||
description = # markdown
|
||||
''
|
||||
This flake serves as a monorepo for my systems (using IaC), dotfiles, and scripts.
|
||||
'';
|
||||
parts."Structure" = # markdown
|
||||
''
|
||||
The system configurations are defined in [`flake.manifest`](nix/manifest.nix).
|
||||
'';
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
files.files = [
|
||||
{
|
||||
path_ = "README.md";
|
||||
drv = pkgs.writeText "README.md" config.text.readme;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ inputs.git-hooks.flakeModule ];
|
||||
perSystem = psArgs: {
|
||||
pre-commit.settings.hooks = {
|
||||
# Nix Linters
|
||||
deadnix.enable = true;
|
||||
statix.enable = true;
|
||||
nil.enable = true;
|
||||
nixfmt-rfc-style.enable = true;
|
||||
# Flake Health Checks
|
||||
flake-checker.enable = true;
|
||||
# Misc
|
||||
mixed-line-endings.enable = true;
|
||||
trim-trailing-whitespace.enable = true;
|
||||
#TODO: figure out vale
|
||||
#TODO: make nix develop work
|
||||
#TODO: add nix flake check
|
||||
#TODO: add write-files
|
||||
};
|
||||
make-shells.default.shellHook = psArgs.config.pre-commit.installationScript;
|
||||
};
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
#TODO: add to readme
|
||||
imports = [ inputs.make-shell.flakeModules.default ];
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ inputs.flake-parts.flakeModules.modules ];
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ inputs.text.flakeModules.default ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue