nichts/default.nix
Bloxx12 3a9e31cc88
nixpkgs: switch to read-only packages
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641b8369b151024324d8d06f2acb790c15
2025-07-21 00:26:12 +02:00

34 lines
990 B
Nix

let
inherit (builtins) filter mapAttrs;
# https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers
src = import ./npins;
pkgs = import src.nixpkgs { };
sources = mapAttrs (k: v: v { inherit pkgs; }) src;
inherit (pkgs) lib;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
mkSystem =
system: hostname:
import (src.nixpkgs + "/nixos/lib/eval-config.nix") {
specialArgs = {
inherit sources;
self = ./.;
};
modules = [
# This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here.
{ networking.hostName = hostname; }
./hosts/common.nix
./hosts/${hostname}
]
++ ((listFilesRecursive ./modules) |> filter (hasSuffix ".mod.nix"));
};
in
{
temperance = mkSystem "x86_64-linux" "temperance";
hermit = mkSystem "x86_64-linux" "hermit";
tower = mkSystem "aarch64-linux" "tower";
}