summaryrefslogtreecommitdiff
path: root/parts
diff options
context:
space:
mode:
authorseth <[email protected]>2023-07-19 16:36:06 -0400
committerseth <[email protected]>2023-07-19 16:36:06 -0400
commit0cbc3f025cf5aad554b1c4294e98409748c1fe07 (patch)
tree38df7c2ba86fbf203571139c71cb8d04a0447d8c /parts
parenta7143110416ba9b5b41b2863fdf165895f4dfb78 (diff)
move flake parts folder
Diffstat (limited to 'parts')
-rw-r--r--parts/ci.nix23
-rw-r--r--parts/default.nix16
-rw-r--r--parts/dev.nix45
3 files changed, 84 insertions, 0 deletions
diff --git a/parts/ci.nix b/parts/ci.nix
new file mode 100644
index 0000000..c958ed3
--- /dev/null
+++ b/parts/ci.nix
@@ -0,0 +1,23 @@
+{
+ inputs,
+ myLib,
+ self,
+ ...
+}: let
+ ciSystems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ ];
+
+ ci = sys: myLib.ci ["${sys}"];
+ hm = sys: (ci sys).mkCompatibleHM self.homeConfigurations;
+ hosts = sys: (ci sys).mkCompatibleCfg self.nixosConfigurations;
+in {
+ flake = {
+ checks = inputs.nixpkgs.lib.genAttrs ciSystems hosts;
+ };
+
+ perSystem = {system, ...}: {
+ checks = (hm system).${system};
+ };
+}
diff --git a/parts/default.nix b/parts/default.nix
new file mode 100644
index 0000000..a95d7f0
--- /dev/null
+++ b/parts/default.nix
@@ -0,0 +1,16 @@
+{inputs, ...}: {
+ imports = [
+ ./ci.nix
+ ./dev.nix
+ ./overlays
+ ];
+
+ _module.args.myLib = inputs.getchoo.lib;
+
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
+}
diff --git a/parts/dev.nix b/parts/dev.nix
new file mode 100644
index 0000000..5453286
--- /dev/null
+++ b/parts/dev.nix
@@ -0,0 +1,45 @@
+{
+ inputs,
+ self,
+ ...
+}: {
+ perSystem = {
+ pkgs,
+ system,
+ ...
+ }: {
+ checks = {
+ pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
+ src = self;
+ hooks = {
+ actionlint.enable = true;
+ alejandra.enable = true;
+ deadnix.enable = true;
+ nil.enable = true;
+ statix.enable = true;
+ stylua.enable = true;
+ };
+ };
+ };
+
+ devShells = let
+ inherit (pkgs) mkShell;
+ in {
+ default = mkShell {
+ inherit (self.checks.${system}.pre-commit-check) shellHook;
+ packages = with pkgs;
+ with inputs; [
+ actionlint
+ alejandra
+ deadnix
+ just
+ ragenix.packages.${system}.ragenix
+ statix
+ stylua
+ ];
+ };
+ };
+
+ formatter = pkgs.alejandra;
+ };
+}