86 lines
2.7 KiB
Nix
86 lines
2.7 KiB
Nix
{
|
|
description = "Declarative NixOS HomeLab";
|
|
|
|
inputs = {
|
|
# Nixpkgs
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
# You can access packages and modules from different nixpkgs revs
|
|
# at the same time. Here's an working example:
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
|
|
# systems.url = "github:nix-systems/default";
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
|
simple-nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs";
|
|
# home-manager = {
|
|
# url = "home-manager";
|
|
# inputs.nixpkgs.follows = "nixpkgs";
|
|
# };
|
|
colmena.url = "github:zhaofengli/colmena";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
# systems,
|
|
sops-nix,
|
|
# home-manager,
|
|
colmena,
|
|
simple-nixos-mailserver,
|
|
...
|
|
} @ inputs: let
|
|
inherit (self) outputs;
|
|
# Supported systems for your flake packages, shell, etc.
|
|
systems = [
|
|
"x86_64-linux"
|
|
];
|
|
# This is a function that generates an attribute by calling a function you
|
|
# pass to it, with each system as an argument
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
in {
|
|
# Custom packages
|
|
# Accessible through 'nix build', 'nix shell', etc
|
|
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
|
|
|
# Formatter for your nix files, available through 'nix fmt'
|
|
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
|
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
|
|
|
# Custom packages and modifications, exported as overlays
|
|
overlays = import ./overlays {inherit inputs;};
|
|
|
|
# Reusable nixos modules
|
|
nixosModules = import ./modules/nixos;
|
|
|
|
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
|
|
colmena = {
|
|
meta = {
|
|
nixpkgs = import nixpkgs {
|
|
system = "x86_64-linux";
|
|
overlays = [
|
|
outputs.overlays.additions
|
|
outputs.overlays.modifications
|
|
outputs.overlays.unstable-packages
|
|
|
|
colmena.overlays.default
|
|
];
|
|
config.allowUnfree = true;
|
|
};
|
|
|
|
specialArgs = {
|
|
inherit inputs outputs;
|
|
};
|
|
};
|
|
|
|
defaults = import ./machines/_default/configuration.nix;
|
|
|
|
sandbox = import ./machines/sandbox/configuration.nix;
|
|
auth = import ./machines/auth/configuration.nix;
|
|
mail = import ./machines/mail/configuration.nix;
|
|
monitor = import ./machines/monitor/configuration.nix;
|
|
photos = import ./machines/photos/configuration.nix;
|
|
};
|
|
};
|
|
}
|