nixos/flake.nix

122 lines
3.4 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgsUnstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
caddy.url = "path:pkgs/caddy";
};
outputs =
inputs@{
nixpkgs,
nixpkgsUnstable,
home-manager,
nixos-hardware,
agenix,
simple-nixos-mailserver,
...
}:
let
system = "x86_64-linux";
overlayUnstable = final: prev: {
unstable = import nixpkgsUnstable {
inherit system;
config.allowUnfree = true;
};
};
in
{
nixosConfigurations = {
nixbox = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
agenix.nixosModules.default
{
environment.systemPackages = [ agenix.packages.${system}.default ];
}
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlayUnstable ];
}
)
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
./hosts/nixbox
];
};
flynode = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
agenix.nixosModules.default
{
environment.systemPackages = [ agenix.packages.${system}.default ];
}
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlayUnstable ];
}
)
nixos-hardware.nixosModules.lenovo-thinkpad-z13-gen1
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
./hosts/flynode
];
};
thewordnerd = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
agenix.nixosModules.default
{
environment.systemPackages = [ agenix.packages.${system}.default ];
}
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlayUnstable ];
}
)
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
simple-nixos-mailserver.nixosModule
./hosts/hub
];
};
garden = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
agenix.nixosModules.default
{
environment.systemPackages = [ agenix.packages.${system}.default ];
}
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ overlayUnstable ];
}
)
./hosts/garden
];
};
};
};
}