use flake as source of truth for NUR repo

This commit is contained in:
Charlotte 🦝 Delenk 2023-03-24 08:53:11 +01:00
parent 27ddb64632
commit eb119c2c60
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
3 changed files with 68 additions and 79 deletions

View file

@ -7,74 +7,10 @@
# nix-build -A mypackage
{pkgs ? import <nixpkgs> {}}: let
lib = import ./lib {inherit pkgs;}; # functions
attic' = lib.importFlake {
input = "attic";
inherit (pkgs) system;
};
mautrix-cleanup' = lib.importFlake {
input = "mautrix-cleanup";
inherit (pkgs) system;
};
flake = (lib.importFlake {inherit (pkgs) system;}).defaultNix;
in
rec {
{
# The `lib`, `modules`, and `overlay` names are special
inherit lib;
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays
akkoma = pkgs.callPackage ./akkoma {};
pleroma-fe = pkgs.callPackage ./akkoma/pleroma-fe {};
admin-fe = pkgs.callPackage ./akkoma/admin-fe {};
emoji-lotte = pkgs.callPackage ./art/emoji/lotte {};
emoji-volpeon-blobfox = pkgs.callPackage ./art/emoji/volpeon/blobfox.nix {};
emoji-volpeon-blobfox-flip = pkgs.callPackage ./art/emoji/volpeon/blobfox_flip.nix {};
emoji-volpeon-bunhd = pkgs.callPackage ./art/emoji/volpeon/bunhd.nix {};
emoji-volpeon-bunhd-flip = pkgs.callPackage ./art/emoji/volpeon/bunhd_flip.nix {};
emoji-volpeon-drgn = pkgs.callPackage ./art/emoji/volpeon/drgn.nix {};
emoji-volpeon-fox = pkgs.callPackage ./art/emoji/volpeon/fox.nix {};
emoji-volpeon-gphn = pkgs.callPackage ./art/emoji/volpeon/gphn.nix {};
emoji-volpeon-raccoon = pkgs.callPackage ./art/emoji/volpeon/raccoon.nix {};
emoji-volpeon-vlpn = pkgs.callPackage ./art/emoji/volpeon/vlpn.nix {};
emoji-caro = pkgs.callPackage ./art/emoji/caro {};
lotte-art = pkgs.callPackage ./art/lotte {};
drone-runner-docker = pkgs.callPackage ./ci/drone-runner-docker {};
alco-sans = pkgs.callPackage ./fonts/kreative/alco-sans.nix {};
constructium = pkgs.callPackage ./fonts/kreative/constructium.nix {};
fairfax = pkgs.callPackage ./fonts/kreative/fairfax.nix {};
fairfax-hd = pkgs.callPackage ./fonts/kreative/fairfax-hd.nix {};
kreative-square = pkgs.callPackage ./fonts/kreative/kreative-square.nix {};
nasin-nanpa = pkgs.callPackage ./fonts/nasin-nanpa {};
matrix-media-repo = pkgs.callPackage ./matrix/matrix-media-repo {};
mautrix-discord = pkgs.callPackage ./matrix/mautrix-discord {};
mautrix-whatsapp = pkgs.callPackage ./matrix/mautrix-whatsapp {};
mautrix-signal = pkgs.callPackage ./matrix/mautrix-signal {};
mautrix-telegram = pkgs.callPackage ./matrix/mautrix-telegram {};
python-mautrix = pkgs.python3Packages.callPackage ./python/mautrix.nix {};
python-tulir-telethon = pkgs.python3Packages.callPackage ./python/tulir-telethon.nix {};
papermc = pkgs.callPackage ./minecraft/papermc {};
python-plover-stroke = pkgs.python3Packages.callPackage ./plover/plover-stroke.nix {};
python-rtf-tokenize = pkgs.python3Packages.callPackage ./python/rtf-tokenize.nix {};
plover = pkgs.python3Packages.callPackage ./plover/plover {};
plover-plugins-manager = pkgs.python3Packages.callPackage ./plover/plover-plugins-manager.nix {};
python-simplefuzzyset = pkgs.python3Packages.callPackage ./python/simplefuzzyset.nix {};
plover-plugin-emoji = pkgs.python3Packages.callPackage ./plover/plover-emoji.nix {};
plover-plugin-tapey-tape = pkgs.python3Packages.callPackage ./plover/plover-tapey-tape.nix {};
plover-plugin-yaml-dictionary = pkgs.python3Packages.callPackage ./plover/plover-yaml-dictionary.nix {};
plover-plugin-machine-hid = pkgs.python3Packages.callPackage ./plover/plover-machine-hid.nix {};
plover-plugin-rkb1-hid = pkgs.python3Packages.callPackage ./plover/plover-rkb1-hid.nix {};
plover-dict-didoesdigital = pkgs.callPackage ./plover/didoesdigital-dictionary.nix {};
miifox-net = pkgs.python3Packages.callPackage ./web/miifox-net.nix {};
old-homepage = pkgs.callPackage ./web/old-homepage.nix {};
python-instagram = pkgs.python3Packages.callPackage ./python/instagram.nix {};
inherit (attic'.defaultNix.packages.${pkgs.system}) attic attic-client attic-server;
element-web = pkgs.callPackage ./matrix/element-web {};
mautrix-cleanup = mautrix-cleanup'.defaultNix.packages.${pkgs.system}.default;
inherit (flake) lib modules overlays;
}
// (
if pkgs.system == "riscv64-linux"
then rec {
vf2Kernel = pkgs.callPackage ./linux/vf2 {kernelPatches = [];};
vf2KernelPackages = pkgs.linuxPackagesFor vf2Kernel;
}
else {}
)
// (flake.packages.${pkgs.system})

View file

@ -46,8 +46,68 @@
];
};
inherit packages;
inherit (nur) overlays modules lib;
packages =
{
akkoma = pkgs.callPackage ./akkoma {};
pleroma-fe = pkgs.callPackage ./akkoma/pleroma-fe {};
admin-fe = pkgs.callPackage ./akkoma/admin-fe {};
emoji-lotte = pkgs.callPackage ./art/emoji/lotte {};
emoji-volpeon-blobfox = pkgs.callPackage ./art/emoji/volpeon/blobfox.nix {};
emoji-volpeon-blobfox-flip = pkgs.callPackage ./art/emoji/volpeon/blobfox_flip.nix {};
emoji-volpeon-bunhd = pkgs.callPackage ./art/emoji/volpeon/bunhd.nix {};
emoji-volpeon-bunhd-flip = pkgs.callPackage ./art/emoji/volpeon/bunhd_flip.nix {};
emoji-volpeon-drgn = pkgs.callPackage ./art/emoji/volpeon/drgn.nix {};
emoji-volpeon-fox = pkgs.callPackage ./art/emoji/volpeon/fox.nix {};
emoji-volpeon-gphn = pkgs.callPackage ./art/emoji/volpeon/gphn.nix {};
emoji-volpeon-raccoon = pkgs.callPackage ./art/emoji/volpeon/raccoon.nix {};
emoji-volpeon-vlpn = pkgs.callPackage ./art/emoji/volpeon/vlpn.nix {};
emoji-caro = pkgs.callPackage ./art/emoji/caro {};
lotte-art = pkgs.callPackage ./art/lotte {};
drone-runner-docker = pkgs.callPackage ./ci/drone-runner-docker {};
alco-sans = pkgs.callPackage ./fonts/kreative/alco-sans.nix {};
constructium = pkgs.callPackage ./fonts/kreative/constructium.nix {};
fairfax = pkgs.callPackage ./fonts/kreative/fairfax.nix {};
fairfax-hd = pkgs.callPackage ./fonts/kreative/fairfax-hd.nix {};
kreative-square = pkgs.callPackage ./fonts/kreative/kreative-square.nix {};
nasin-nanpa = pkgs.callPackage ./fonts/nasin-nanpa {};
matrix-media-repo = pkgs.callPackage ./matrix/matrix-media-repo {};
mautrix-discord = pkgs.callPackage ./matrix/mautrix-discord {};
mautrix-whatsapp = pkgs.callPackage ./matrix/mautrix-whatsapp {};
mautrix-signal = pkgs.callPackage ./matrix/mautrix-signal {};
mautrix-telegram = pkgs.callPackage ./matrix/mautrix-telegram {};
python-mautrix = pkgs.python3Packages.callPackage ./python/mautrix.nix {};
python-tulir-telethon = pkgs.python3Packages.callPackage ./python/tulir-telethon.nix {};
papermc = pkgs.callPackage ./minecraft/papermc {};
python-plover-stroke = pkgs.python3Packages.callPackage ./plover/plover-stroke.nix {};
python-rtf-tokenize = pkgs.python3Packages.callPackage ./python/rtf-tokenize.nix {};
plover = pkgs.python3Packages.callPackage ./plover/plover {};
plover-plugins-manager = pkgs.python3Packages.callPackage ./plover/plover-plugins-manager.nix {};
python-simplefuzzyset = pkgs.python3Packages.callPackage ./python/simplefuzzyset.nix {};
plover-plugin-emoji = pkgs.python3Packages.callPackage ./plover/plover-emoji.nix {};
plover-plugin-tapey-tape = pkgs.python3Packages.callPackage ./plover/plover-tapey-tape.nix {};
plover-plugin-yaml-dictionary = pkgs.python3Packages.callPackage ./plover/plover-yaml-dictionary.nix {};
plover-plugin-machine-hid = pkgs.python3Packages.callPackage ./plover/plover-machine-hid.nix {};
plover-plugin-rkb1-hid = pkgs.python3Packages.callPackage ./plover/plover-rkb1-hid.nix {};
plover-dict-didoesdigital = pkgs.callPackage ./plover/didoesdigital-dictionary.nix {};
miifox-net = pkgs.python3Packages.callPackage ./web/miifox-net.nix {};
old-homepage = pkgs.callPackage ./web/old-homepage.nix {};
python-instagram = pkgs.python3Packages.callPackage ./python/instagram.nix {};
inherit (inputs.attic.packages.${pkgs.system}) attic attic-client attic-server;
element-web = pkgs.callPackage ./matrix/element-web {};
mautrix-cleanup = inputs.mautrix-cleanup.packages.${pkgs.system}.default;
}
// (
if system == "riscv64-linux"
then rec {
vf2Kernel = pkgs.callPackage ./linux/vf2 {kernelPatches = [];};
vf2KernelPackages = pkgs.linuxPackagesFor vf2Kernel;
}
else {}
);
overlays = import ./overlays;
modules = import ./modules;
lib = import ./lib {inherit pkgs;};
hydraJobs =
if (system == "x86_64-linux") || (system == "aarch64-linux")

View file

@ -1,18 +1,11 @@
{
input,
system,
}: let
{system}: let
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
flake-compat = fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
};
input-src = fetchTarball {
url = "https://github.com/${lock.nodes.${input}.locked.owner}/${lock.nodes.${input}.locked.repo}/archive/${lock.nodes.${input}.locked.rev}.tar.gz";
sha256 = lock.nodes.${input}.locked.narHash;
};
in
(import flake-compat) {
src = input-src;
src = ../.;
inherit system;
}