2023-10-09 10:44:07 -07:00
|
|
|
{
|
|
|
|
|
description = "Entrypoint of all nix configurations";
|
|
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
disko.url = "github:nix-community/disko";
|
|
|
|
|
hardware.url = "github:nixos/nixos-hardware";
|
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
2024-03-02 15:10:23 -08:00
|
|
|
jovian.url = "github:Jovian-Experiments/Jovian-NixOS";
|
2023-10-09 10:44:07 -07:00
|
|
|
mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-06-15 17:37:25 -07:00
|
|
|
nix-custom.url = "git+https://forgejo.invariantspace.com/macronova/nix-custom";
|
|
|
|
|
plasma-manager.url = "github:pjones/plasma-manager";
|
2023-10-09 10:44:07 -07:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-14 11:14:20 -07:00
|
|
|
outputs = inputs @ {
|
|
|
|
|
self,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
nix-custom,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
linuxCfgDir = ./linux;
|
|
|
|
|
templateDir = ./template;
|
|
|
|
|
in {
|
|
|
|
|
nixosConfigurations =
|
|
|
|
|
builtins.mapAttrs
|
|
|
|
|
(instance: _:
|
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
|
modules = [
|
|
|
|
|
# Import config from folder
|
|
|
|
|
(linuxCfgDir + "/${instance}")
|
|
|
|
|
# Setup Nix
|
|
|
|
|
({pkgs, ...}: {
|
|
|
|
|
networking.hostName = instance;
|
|
|
|
|
nix = {
|
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
|
|
|
|
options = "--delete-older-than 30d";
|
2023-12-06 21:46:16 -08:00
|
|
|
};
|
2024-08-14 11:14:20 -07:00
|
|
|
settings = {
|
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
experimental-features = ["nix-command" "flakes"];
|
|
|
|
|
trusted-substituters = ["https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"];
|
2023-12-06 21:46:16 -08:00
|
|
|
};
|
2024-08-14 11:14:20 -07:00
|
|
|
};
|
|
|
|
|
nixpkgs = {
|
|
|
|
|
config.allowUnfree = true;
|
|
|
|
|
overlays = [nix-custom.overlays.default];
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
specialArgs = {inherit inputs;};
|
2023-10-09 10:44:07 -07:00
|
|
|
})
|
2024-08-14 11:14:20 -07:00
|
|
|
(builtins.readDir linuxCfgDir);
|
|
|
|
|
templates =
|
|
|
|
|
builtins.mapAttrs
|
|
|
|
|
(template: _: {
|
|
|
|
|
path = templateDir + "/${template}";
|
|
|
|
|
description = "Template flake setup: ${template}";
|
|
|
|
|
})
|
|
|
|
|
(builtins.readDir templateDir);
|
|
|
|
|
};
|
2023-10-09 10:44:07 -07:00
|
|
|
}
|