nixfiles/flake.nix
2024-11-21 20:05:40 +01:00

171 lines
5 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";
};
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.flake-utils.follows = "flake-utils";
};
firefox = {
url = "git+https://woof.rip/mikael/firefox.git";
inputs.nixpkgs.follows = "nixpkgs";
};
florp-about = {
url = "git+https://woof.rip/florp/about.git";
inputs.nixpkgs.follows = "nixpkgs";
};
florp-branding = {
url = "git+https://woof.rip/florp/branding.git";
inputs.nixpkgs.follows = "nixpkgs";
};
florp-moderation = {
url = "git+https://woof.rip/florp/moderation.git";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hydra = {
url = "git+https://git.lix.systems/lix-project/hydra?ref=main&rev=799441dcf6d595efb0def686ca0815aef398627b";
inputs.lix.follows = "lix";
};
kyouma-www = {
url = "git+https://woof.rip/emily/kyouma-net.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
lix.url = "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
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";
};
oth = {
url = "git+ssh://forgejo@woof.rip/emily/oth.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
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;
};
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.writeShellApplication {
# name = "update-flyio";
# text = ''
# '';
# };
};
apps = {
update-build-worker = {
type = "app";
program = ./pkgs/build-worker-oci/update.sh;
};
};
devShells.default = pkgs.mkShell {
packages = [ pkgs.colmena pkgs.sops ];
};
});
}