95 lines
2.6 KiB
Nix
95 lines
2.6 KiB
Nix
{
|
|
description = "Entrypoint of all nix configurations";
|
|
|
|
inputs = {
|
|
disko = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "github:nix-community/disko";
|
|
};
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
hardware.url = "github:nixos/nixos-hardware";
|
|
home-manager = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "github:nix-community/home-manager";
|
|
};
|
|
jovian = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "github:Jovian-Experiments/Jovian-NixOS";
|
|
};
|
|
mailserver = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
|
};
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
nix-custom = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "git+https://forgejo.invariantspace.com/macronova/nix-custom";
|
|
};
|
|
plasma-manager = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "github:pjones/plasma-manager";
|
|
};
|
|
pre-commit-hooks = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
};
|
|
sops-nix = {
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
url = "github:Mic92/sops-nix";
|
|
};
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
self,
|
|
flake-utils,
|
|
nixpkgs,
|
|
nix-custom,
|
|
pre-commit-hooks,
|
|
...
|
|
}: let
|
|
linuxCfgDir = ./linux;
|
|
templateDir = ./template;
|
|
in
|
|
{
|
|
nixosConfigurations =
|
|
builtins.mapAttrs
|
|
(instance: _:
|
|
nixpkgs.lib.nixosSystem {
|
|
modules = [
|
|
# Import config from folder
|
|
(linuxCfgDir + "/${instance}")
|
|
# Common setups
|
|
({pkgs, ...}: {
|
|
networking.hostName = instance;
|
|
nixpkgs.overlays = [nix-custom.overlays.default];
|
|
})
|
|
];
|
|
specialArgs = {inherit inputs;};
|
|
})
|
|
(builtins.readDir linuxCfgDir);
|
|
templates =
|
|
builtins.mapAttrs
|
|
(template: _: {
|
|
path = templateDir + "/${template}";
|
|
description = "Template flake setup: ${template}";
|
|
})
|
|
(builtins.readDir templateDir);
|
|
}
|
|
// (
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in {
|
|
checks.pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks.alejandra.enable = true;
|
|
};
|
|
devShells.default = let
|
|
pre-commit = self.checks.${system}.pre-commit-check;
|
|
in
|
|
pkgs.mkShell {
|
|
inherit (pre-commit) shellHook;
|
|
buildInputs = pre-commit.enabledPackages;
|
|
};
|
|
})
|
|
);
|
|
}
|