nix_config/flake.nix

132 lines
3.1 KiB
Nix
Raw Normal View History

2024-09-05 20:28:09 +02:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/NUR";
impermanence.url = "github:nix-community/impermanence";
hm-isolation.url = "github:3442/hm-isolation";
nixGL.url = "github:guibou/nixGL";
flake-utils.url = "github:numtide/flake-utils";
2024-09-08 22:17:00 +02:00
vpsadminos.url = "github:vpsfreecz/vpsadminos";
homepage.url = "git+https://git.posixlycorrect.com/fabian/homepage.git?ref=master";
conduwuit = {
url = "github:girlbossceo/conduwuit?ref=v0.4.5";
#FIXME: Podrá volver a "nixpkgs" una vez que rocksdb.enableLiburing llegue a stable
inputs.nixpkgs.follows = "unstable";
};
authentik-nix = {
url = "github:nix-community/authentik-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
mediawikiSkinCitizen = {
url = "github:StarCitizenTools/mediawiki-skins-Citizen/v2.27.0";
flake = false;
};
2024-09-05 20:28:09 +02:00
};
2024-09-08 22:17:00 +02:00
outputs = flakes @ {
2024-09-05 20:28:09 +02:00
self,
nixpkgs,
unstable,
home-manager,
nur,
2024-09-08 22:17:00 +02:00
impermanence,
2024-09-05 20:28:09 +02:00
hm-isolation,
nixGL,
2024-09-08 22:17:00 +02:00
flake-utils,
vpsadminos,
homepage,
conduwuit,
mediawikiSkinCitizen,
authentik-nix,
2024-09-05 20:28:09 +02:00
}: let
system = "x86_64-linux";
2024-09-08 22:50:36 +02:00
importPkgs = flake:
import flake {
inherit system;
2024-09-08 22:17:00 +02:00
2024-09-08 22:50:36 +02:00
config = import ./pkgs/config nixpkgs.lib;
overlays = [nur.overlay self.overlays.default];
};
2024-09-05 20:28:09 +02:00
2024-09-08 22:17:00 +02:00
pkgs = importPkgs nixpkgs;
2024-09-05 20:28:09 +02:00
2024-09-08 22:17:00 +02:00
inherit (pkgs.local.lib) importAll;
2024-09-05 20:28:09 +02:00
2024-09-08 22:17:00 +02:00
local = import ./pkgs;
in
2024-09-08 22:50:36 +02:00
with pkgs.lib; {
formatter.${system} = pkgs.alejandra;
packages.${system} = pkgs.local;
2024-09-08 22:17:00 +02:00
2024-09-08 22:50:36 +02:00
overlays.default = final: prev: let
2024-09-08 22:17:00 +02:00
locals = local final prev;
in
2024-09-08 22:50:36 +02:00
locals.override
// {
local = locals;
unstable = importPkgs unstable;
2024-09-08 22:17:00 +02:00
};
2024-09-05 20:28:09 +02:00
2024-09-08 22:50:36 +02:00
nixosConfigurations = let
nixosSystem = {modules}:
makeOverridable nixpkgs.lib.nixosSystem {
inherit modules pkgs system;
specialArgs = {
inherit flakes;
};
};
hostConfig = host:
nixosSystem {
modules = [
./sys
host
];
};
in
mapAttrs (_: hostConfig) (importAll {root = ./sys/platforms;});
homeConfigurations = let
registry = {...}: {
config.nix.registry = mapAttrs (_:
value {
flake = value;
})
flakes;
};
2024-09-05 20:28:09 +02:00
2024-09-08 22:50:36 +02:00
home = platform:
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home
platforms
registry
hm-isolation.homeManagerModule
];
};
2024-09-08 23:20:09 +02:00
platformHome = name: platform: let
2024-09-08 22:50:36 +02:00
value = home platform;
in {
2024-09-08 23:20:09 +02:00
inherit name value;
2024-09-08 22:50:36 +02:00
};
in
2024-09-08 23:20:09 +02:00
mapAttrs' platformHome (importAll {root = ./home/platforms;});
2024-09-05 20:28:09 +02:00
};
}