diff options
| author | seth <[email protected]> | 2024-04-06 22:08:07 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-04-06 22:59:56 -0400 |
| commit | cdeb7d50f232103294a2bb36525a6d9f552fb4ed (patch) | |
| tree | 3fd24ce84ae35fe9282b93edcf5659c9ae01bf0a /flake.nix | |
| parent | 5d725b0db9a0e57533e67e299f6213fa5d90203a (diff) | |
separate everything from flake.nix again
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 95 |
1 files changed, 10 insertions, 85 deletions
@@ -9,15 +9,22 @@ outputs = inputs: let flakeModules = import ./modules/flake; in - inputs.flake-parts.lib.mkFlake {inherit inputs;} ({self, ...}: { + inputs.flake-parts.lib.mkFlake {inherit inputs;} { imports = [ + # primary outputs ./lib ./modules ./overlay ./systems ./users - ./ext # nix expressions for *external*, not so nix-y things + # some tools to help me out + ./pre-commit.nix + ./shell.nix + ./treefmt.nix + + ./ext # expressions for *external*, not so nix-y things + ./ci.nix # how i make sure my systems wont implode before i update inputs.pre-commit.flakeModule inputs.treefmt-nix.flakeModule @@ -34,89 +41,7 @@ "x86_64-darwin" "aarch64-darwin" ]; - - perSystem = { - config, - lib, - pkgs, - system, - inputs', - self', - ... - }: { - treefmt = { - projectRootFile = "flake.nix"; - - programs = { - alejandra.enable = true; - deadnix.enable = true; - prettier.enable = true; - }; - - settings.global = { - excludes = [ - "./flake.lock" - ]; - }; - }; - - pre-commit.settings.hooks = { - actionlint.enable = true; - - treefmt = { - enable = true; - package = config.treefmt.build.wrapper; - }; - - nil.enable = true; - statix.enable = true; - }; - - devShells.default = pkgs.mkShellNoCC { - shellHook = config.pre-commit.installationScript; - packages = with pkgs; - [ - nix - - # format + lint - actionlint - self'.formatter - deadnix - nil - statix - - # utils - deploy-rs - fzf - just - config.terranix.package - ] - ++ lib.optional stdenv.isDarwin [inputs'.darwin.packages.darwin-rebuild] - ++ lib.optionals stdenv.isLinux [nixos-rebuild inputs'.agenix.packages.agenix]; - }; - - packages.ciGate = let - ci = self.lib.ci [system]; - - configurations = map (type: ci.mapCfgsToDerivs (ci.getCompatibleCfgs self.${type})) [ - "nixosConfigurations" - "darwinConfigurations" - "homeConfigurations" - ]; - - required = lib.concatMap lib.attrValues ( - [ - self'.checks - self'.devShells - ] - ++ configurations - ); - in - pkgs.writeText "ci-gate" ( - lib.concatMapStringsSep "\n" toString required - ); - }; - }); + }; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; |
