90 lines
2.2 KiB
Nix
90 lines
2.2 KiB
Nix
|
{
|
||
|
description = "NixOS configuration for all the things (as many as we can get)";
|
||
|
|
||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
||
|
inputs.disko.url = "github:nix-community/disko";
|
||
|
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
|
||
|
inputs.agenix.url = "github:ryantm/agenix";
|
||
|
inputs.agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||
|
inputs.sops-nix.url = "github:Mic92/sops-nix";
|
||
|
inputs.attic.url = "github:zhaofengli/attic";
|
||
|
inputs.authentik-nix.url = "github:mayflower/authentik-nix";
|
||
|
|
||
|
outputs = {
|
||
|
self,
|
||
|
nixpkgs,
|
||
|
disko,
|
||
|
agenix,
|
||
|
sops-nix,
|
||
|
attic,
|
||
|
authentik-nix,
|
||
|
...
|
||
|
}: let
|
||
|
projname = "nix-infra";
|
||
|
system = "x86_64-linux";
|
||
|
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
||
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||
|
# Nixpkgs instantiated for supported system types.
|
||
|
nixpkgsFor = forAllSystems (system:
|
||
|
import nixpkgs {
|
||
|
inherit system;
|
||
|
overlays = [
|
||
|
# no overlay imports atm
|
||
|
];
|
||
|
});
|
||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||
|
# pkgs = nixpkgsFor.${system};
|
||
|
in {
|
||
|
formatter = forAllSystems (
|
||
|
system:
|
||
|
nixpkgsFor.${system}.alejandra
|
||
|
);
|
||
|
# formatter.${system} = pkgs.alejandra;
|
||
|
|
||
|
nixosConfigurations.loki = nixpkgs.lib.nixosSystem {
|
||
|
inherit pkgs system;
|
||
|
modules = [
|
||
|
disko.nixosModules.disko
|
||
|
agenix.nixosModules.default
|
||
|
sops-nix.nixosModules.sops
|
||
|
attic.nixosModules.atticd
|
||
|
authentik-nix.nixosModules.default
|
||
|
|
||
|
./hosts/loki/configuration.nix
|
||
|
];
|
||
|
};
|
||
|
|
||
|
devShells = forAllSystems (
|
||
|
system: let
|
||
|
pkgs = import nixpkgs {
|
||
|
inherit system;
|
||
|
overlays = [
|
||
|
];
|
||
|
};
|
||
|
in {
|
||
|
default = with pkgs;
|
||
|
mkShell
|
||
|
{
|
||
|
name = "${projname}";
|
||
|
|
||
|
shellHook = ''
|
||
|
echo " -- in ${projname} dev shell..."
|
||
|
'';
|
||
|
|
||
|
nativeBuildInputs = [
|
||
|
];
|
||
|
packages =
|
||
|
[cachix]
|
||
|
++ (
|
||
|
if stdenv.isLinux
|
||
|
then [
|
||
|
]
|
||
|
else []
|
||
|
);
|
||
|
};
|
||
|
}
|
||
|
);
|
||
|
};
|
||
|
}
|