1
0
Fork 0
forked from emily/nixfiles
nixfiles-emily/flake.nix
2024-04-05 16:25:59 +02:00

103 lines
3.1 KiB
Nix

{
description = "emilys config hell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
flake-utils.url = "github:numtide/flake-utils";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
dns = {
url = "github:kirelagin/dns.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
fernglas = {
url = "github:wobcom/fernglas";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
kyouma-www = {
url = "git+https://git.bsd.gay/snaki/kyouma-net.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
};
nixConfig = {
builders-use-substitutes = true;
builders = "ssh://build@seras.kyouma.net x86_64-linux,aarch64-linux - 40 5 nixos-test,benchmark,big-parallel,kvm";
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs: {
colmena = let
hosts = builtins.attrNames (nixpkgs.lib.filterAttrs (name: type: type == "directory") (builtins.readDir ./config/hosts));
hostCfg = hostname: {
imports = [ (./config/hosts/${hostname}/configuration.nix) ];
};
in {
meta = {
allowApplyAll = false;
machinesFile = ./config/files/builders;
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
nodeNixpkgs = {
lain = nixpkgs.legacyPackages.aarch64-linux;
};
specialArgs = { inherit inputs; };
};
} // nixpkgs.lib.attrsets.genAttrs hosts (hostCfg);
nixosConfigurations = {
ryuuko = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/hosts/base/configuration.nix
./config/hosts/ryuuko/disko.nix
];
};
lain = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/hosts/lain/iso.nix
];
};
};
images.lain = self.nixosConfigurations.lain.config.system.build.sdImage;
} // flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
# packages = rec {
# newhost = pkgs.stdenv.mkDerivation {
# name = "newhost";
# };
# };
# apps = rec {
# newhost = self.packages.${system}.newhost;
# default = newhost;
# };
devShells.default = pkgs.mkShell {
packages = [ pkgs.colmena pkgs.sops ];
};
});
}