nixfiles/flake.nix
2024-08-13 20:41:55 +02:00

145 lines
4.3 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";
attic = {
url = "github:zhaofengli/attic";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "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";
};
iceshrimp = {
url = "git+https://iceshrimp.dev/iceshrimp/packaging";
inputs.nixpkgs.follows = "nixpkgs";
};
kyouma-www = {
url = "git+https://woof.rip/emily/kyouma-net.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nixos-needsreboot = {
url = "github:thefossguy/nixos-needsreboot";
inputs.nixpkgs.follows = "nixpkgs";
};
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 = {
extra-substituters = [
"https://cache.kyouma.net"
];
extra-trusted-public-keys = [
"cache.kyouma.net:Frjwu4q1rnwE/MnSTmX9yx86GNA/z3p/oElGvucLiZg="
];
builders-use-substitutes = true;
builders = ''
ssh://build@seras.kyouma.net x86_64-linux - 40 40 nixos-test,benchmark,big-parallel,kvm
ssh://build@integra.kyouma.net aarch64-linux - 4 8 nixos-test,benchmark,big-parallel,kvm
'';
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs: let
shinyflakes = import ./lib/shinyflakes inputs;
in {
hosts = shinyflakes.mapHosts {
integra = { system = "aarch64-linux"; };
lain = { system = "aarch64-linux"; };
};
colmena = shinyflakes.mapColmenaCfg {
meta = {
allowApplyAll = false;
machinesFile = ./config/files/builders;
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
specialArgs = { inherit inputs; };
};
};
nixosConfigurations = shinyflakes.mapNixosCfg {
ryuuko-minimal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/hosts/_minimal/configuration.nix
./config/hosts/ryuuko/disko.nix
];
};
lain-minimal = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/hosts/lain/iso.nix
({ ... }: {
nixpkgs.overlays = [ self.overlays.kyouma self.overlays.otherPkgs ];
})
];
};
};
images.lain = self.nixosConfigurations.lain-minimal.config.system.build.sdImage;
overlays = {
kyouma = import ./pkgs/overlay.nix;
otherPkgs = final: prev: {
nixos-needsreboot = (inputs.nixos-needsreboot.packages.${final.system}.default);
};
default = self.overlays.kyouma;
};
hydraJobs = {
inherit (self) packages images;
nixosConfigurations = shinyflakes.mapHydraHosts self.nixosConfigurations;
};
} // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.kyouma
self.overlays.otherPkgs
];
};
in {
packages = shinyflakes.mapPackages (pkgs) {
# newhost = pkgs.stdenv.mkDerivation {
# name = "newhost";
# };
};
# apps = rec {
# newhost = self.packages.${system}.newhost;
# default = newhost;
# };
devShells.default = pkgs.mkShell {
packages = [ pkgs.colmena pkgs.sops ];
};
});
}