machines/flake.nix

145 lines
3.8 KiB
Nix
Raw Normal View History

2025-07-05 15:35:58 +02:00
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
flake-base = {
url = "git+https://khs.codes/nix/flake-base";
inputs = {
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs = {
systems.follows = "systems";
};
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
2025-07-05 15:35:58 +02:00
};
disko = {
url = "github:nix-community/disko";
inputs = {
nixpkgs.follows = "nixpkgs";
};
2025-07-05 15:35:58 +02:00
};
2025-07-05 23:33:29 +02:00
terranix = {
url = "github:terranix/terranix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-parts.follows = "flake-parts";
};
2025-07-05 23:33:29 +02:00
};
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
2025-07-05 23:33:29 +02:00
terranix-hcloud = {
url = "github:terranix/terranix-hcloud";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
terranix.follows = "terranix";
};
};
systems = {
url = "github:nix-systems/default";
2025-07-05 23:33:29 +02:00
};
crane.url = "github:ipetkov/crane";
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
nixos-anywhere = {
url = "github:nix-community/nixos-anywhere/1.11.0";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-parts.follows = "flake-parts";
treefmt-nix.follows = "treefmt-nix";
disko.follows = "disko";
};
};
stylix = {
url = "github:nix-community/stylix/release-25.05";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-parts.follows = "flake-parts";
systems.follows = "systems";
};
};
cosmic-manager = {
url = "github:HeitorAugustoLN/cosmic-manager";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
flake-parts.follows = "flake-parts";
};
};
2025-07-18 22:58:35 +02:00
simple-nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.05";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
2025-07-05 15:35:58 +02:00
};
outputs =
2025-07-18 22:58:35 +02:00
inputs:
2025-07-05 16:23:36 +02:00
let
inputNixosModules = [
inputs.disko.nixosModules.disko
inputs.stylix.nixosModules.stylix
];
inputHomeModules = [
inputs.cosmic-manager.homeManagerModules.cosmic-manager
];
allowUnfreePackages = [
"spotify"
"google-chrome"
"terraform"
];
2025-07-05 16:23:36 +02:00
in
2025-07-05 23:33:29 +02:00
(inputs.flake-base.lib.mkFlake {
2025-07-05 15:35:58 +02:00
inherit inputs;
src = ./.;
channels-config = {
allowUnfreePredicate = pkg: builtins.elem (inputs.nixpkgs.lib.getName pkg) allowUnfreePackages;
};
systems.modules.nixos = inputNixosModules;
homes.modules = inputHomeModules;
2025-07-05 15:35:58 +02:00
snowfall = {
root = ./nix;
namespace = "khscodes";
meta = {
title = "Nix machines for KHS";
name = "Machines";
};
};
overlays = [ inputs.rust-overlay.overlays.default ];
2025-07-05 23:33:29 +02:00
})
// {
terranixModules.cloudflare = import ./nix/modules/terranix/cloudflare;
terranixModules.hcloud = import ./nix/modules/terranix/hcloud;
terranixModules.vault = import ./nix/modules/terranix/vault;
terranixModules.s3 = import ./nix/modules/terranix/s3;
terranixModules.openstack = import ./nix/modules/terranix/openstack;
terranixModules.unifi = import ./nix/modules/terranix/unifi;
2025-07-05 15:35:58 +02:00
};
}