add pre-commit to separate module && init topology

This commit is contained in:
notohh 2025-02-08 13:30:25 -05:00
parent 932df2571a
commit 1a5d835d47
Signed by: notohh
GPG key ID: BD47506D475EE86D
4 changed files with 216 additions and 47 deletions

191
flake.lock generated
View file

@ -515,6 +515,27 @@
"type": "github" "type": "github"
} }
}, },
"devshell": {
"inputs": {
"nixpkgs": [
"nix-topology",
"nixpkgs"
]
},
"locked": {
"lastModified": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"eww": { "eww": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_7", "flake-compat": "flake-compat_7",
@ -649,20 +670,6 @@
} }
}, },
"flake-compat_12": { "flake-compat_12": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"revCount": 69,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_13": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -678,7 +685,37 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_13": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"revCount": 69,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_14": { "flake-compat_14": {
"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-compat_15": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1733328505, "lastModified": 1733328505,
@ -1119,11 +1156,11 @@
"systems": "systems_22" "systems": "systems_22"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1726560853,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1168,6 +1205,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_9": {
"inputs": {
"systems": "systems_25"
},
"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"
}
},
"flocon": { "flocon": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -1322,6 +1377,28 @@
} }
}, },
"gitignore_5": { "gitignore_5": {
"inputs": {
"nixpkgs": [
"nix-topology",
"pre-commit-hooks",
"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"
}
},
"gitignore_6": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"pre-commit-hooks", "pre-commit-hooks",
@ -3119,6 +3196,29 @@
"type": "github" "type": "github"
} }
}, },
"nix-topology": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils_6",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks_4"
},
"locked": {
"lastModified": 1738246091,
"narHash": "sha256-2+KkZsRO+XlOFbXbRgMZbRtlqn5MBNYj4HNmZ/2Tojg=",
"owner": "oddlama",
"repo": "nix-topology",
"rev": "5526269fa3eedf4f4bc00c0bf7a03db31d24b029",
"type": "github"
},
"original": {
"owner": "oddlama",
"repo": "nix-topology",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1738816619, "lastModified": 1738816619,
@ -3276,8 +3376,8 @@
}, },
"nixpkgs-xr": { "nixpkgs-xr": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_12", "flake-compat": "flake-compat_13",
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_7",
"nixpkgs": "nixpkgs_19", "nixpkgs": "nixpkgs_19",
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
@ -6604,8 +6704,35 @@
}, },
"pre-commit-hooks_4": { "pre-commit-hooks_4": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_13", "flake-compat": "flake-compat_12",
"gitignore": "gitignore_5", "gitignore": "gitignore_5",
"nixpkgs": [
"nix-topology",
"nixpkgs"
],
"nixpkgs-stable": [
"nix-topology",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730797577,
"narHash": "sha256-SrID5yVpyUfknUTGWgYkTyvdr9J1LxUym4om3SVGPkg=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "1864030ed24a2b8b4e4d386a5eeaf0c5369e50a9",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"pre-commit-hooks_5": {
"inputs": {
"flake-compat": "flake-compat_14",
"gitignore": "gitignore_6",
"nixpkgs": "nixpkgs_21" "nixpkgs": "nixpkgs_21"
}, },
"locked": { "locked": {
@ -6624,7 +6751,7 @@
}, },
"prismlauncher": { "prismlauncher": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_14", "flake-compat": "flake-compat_15",
"libnbtplusplus": "libnbtplusplus", "libnbtplusplus": "libnbtplusplus",
"nix-filter": "nix-filter_2", "nix-filter": "nix-filter_2",
"nixpkgs": "nixpkgs_22" "nixpkgs": "nixpkgs_22"
@ -6706,11 +6833,12 @@
"hyprwayland-scanner": "hyprwayland-scanner_11", "hyprwayland-scanner": "hyprwayland-scanner_11",
"manga-tui": "manga-tui", "manga-tui": "manga-tui",
"nix-gaming": "nix-gaming_2", "nix-gaming": "nix-gaming_2",
"nix-topology": "nix-topology",
"nixos-hardware": "nixos-hardware_2", "nixos-hardware": "nixos-hardware_2",
"nixpkgs": "nixpkgs_18", "nixpkgs": "nixpkgs_18",
"nixpkgs-xr": "nixpkgs-xr", "nixpkgs-xr": "nixpkgs-xr",
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks_4", "pre-commit-hooks": "pre-commit-hooks_5",
"prismlauncher": "prismlauncher", "prismlauncher": "prismlauncher",
"scls": "scls", "scls": "scls",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
@ -6878,7 +7006,7 @@
}, },
"scls": { "scls": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_7", "flake-utils": "flake-utils_8",
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -7173,6 +7301,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_25": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": { "systems_3": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
@ -7483,7 +7626,7 @@
}, },
"yazi": { "yazi": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_8", "flake-utils": "flake-utils_9",
"nixpkgs": "nixpkgs_23", "nixpkgs": "nixpkgs_23",
"rust-overlay": "rust-overlay_5" "rust-overlay": "rust-overlay_5"
}, },

View file

@ -4,11 +4,12 @@
outputs = inputs: outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} { inputs.flake-parts.lib.mkFlake {inherit inputs;} {
imports = [ imports = [
inputs.pre-commit-hooks.flakeModule
./hosts ./hosts
./overlays ./overlays
./hosts/deploy.nix ./hosts/deploy.nix
./home/profiles ./home/profiles
./modules/pre-commit.nix
./modules/topology.nix
]; ];
systems = ["x86_64-linux"]; systems = ["x86_64-linux"];
perSystem = { perSystem = {
@ -16,28 +17,6 @@
pkgs, pkgs,
... ...
}: { }: {
pre-commit = {
check.enable = true;
settings = {
excludes = ["flake.lock"];
hooks = {
stylua.enable = true;
statix.enable = true;
alejandra.enable = true;
deadnix = {
enable = true;
excludes = ["technorino.nix"];
};
prettier = {
enable = true;
files = "\\.(js|ts|md|json)$";
settings = {
trailing-comma = "none";
};
};
};
};
};
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
name = "snowflake"; name = "snowflake";
shellHook = config.pre-commit.installationScript; shellHook = config.pre-commit.installationScript;
@ -137,5 +116,9 @@
url = "github:youwen5/zen-browser-flake"; url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-topology = {
url = "github:oddlama/nix-topology";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
} }

27
modules/pre-commit.nix Normal file
View file

@ -0,0 +1,27 @@
{inputs, ...}: {
imports = [
inputs.pre-commit-hooks.flakeModule
];
perSystem.pre-commit = {
check.enable = true;
settings = {
excludes = ["flake.lock"];
hooks = {
stylua.enable = true;
statix.enable = true;
alejandra.enable = true;
deadnix = {
enable = true;
excludes = ["technorino.nix"];
};
prettier = {
enable = true;
files = "\\.(js|ts|md|json)$";
settings = {
trailing-comma = "none";
};
};
};
};
};
}

16
modules/topology.nix Normal file
View file

@ -0,0 +1,16 @@
{
inputs,
self,
...
}: {
imports = [
inputs.nix-topology.flakeModule
];
perSystem = _: {
topology.modules = [
{
inherit (self) nixosConfigurations;
}
];
};
}