Compare commits

..

7 Commits

Author SHA1 Message Date
bced319f32
ci: fix dependabot config 2023-03-07 10:08:01 +11:00
github-actions[bot]
a798e65465
flake: update inputs (#27)
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/9952d6bc395f5841262b006fbace8dd7e143b634' (2023-02-26)
  → 'github:NixOS/nixpkgs/a1240f6b4a0bcc84fc48008b396a140d9f3638f6' (2023-03-05)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-07 10:07:32 +11:00
d36de346ad
packages: convert path interpolation to concat
I have no idea what the fuck is happening here but interpolating the
path leads to the whole result being converted to a (-n invalid) store
path, but concat doesn't. The former results in realisation failing
running under `nix-build`, i.e., NUR updates.
2023-03-06 12:08:33 +11:00
b7f88d78b5
flake: add check for NUR reproducibility 2023-03-06 12:02:00 +11:00
71f6ac0f46
atlauncher: add compat for sourceProvenance
Occasionally gets evaluated with nixpkgs-22.05 which doesn't have these
definitions.
2023-03-06 11:55:56 +11:00
561afaf18c
default: refactor 2023-03-06 10:30:13 +11:00
f0dc2d521d
all: format 2023-03-06 10:13:37 +11:00
8 changed files with 41 additions and 19 deletions

View File

@ -4,5 +4,5 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
- commit-message: commit-message:
prefix: "ci" prefix: "ci"

View File

@ -10,6 +10,7 @@ jobs:
check: check:
- nixpkgs-fmt - nixpkgs-fmt
- deadnix - deadnix
- nur
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository

View File

@ -1,10 +1,15 @@
{ pkgs, lib ? pkgs.lib, unitDir ? "unit", packageFun ? "package.nix", root ? "${./pkgs}/${unitDir}" }: { pkgs
, lib ? pkgs.lib
, unitDir ? "unit"
, packageFun ? "package.nix"
, root ? "${./pkgs}/${unitDir}"
}:
let let
shards = lib.attrNames (builtins.readDir root); shards = lib.attrNames (builtins.readDir root);
namesForShard = shard: lib.mapAttrs' namesForShard = shard: lib.mapAttrs'
(name: _: { inherit name; value = "${root}/${shard}/${name}"; }) (name: _: { inherit name; value = root + "/${shard}/${name}"; })
(builtins.readDir "${root}/${shard}"); (builtins.readDir (root + "/${shard}"));
namesToPath = lib.foldl' lib.recursiveUpdate { } (map namesForShard shards); namesToPath = lib.foldl' lib.recursiveUpdate { } (map namesForShard shards);
units = lib.mapAttrs (_: path: pkgs.callPackage "${path}/${packageFun}" { }) namesToPath; units = lib.mapAttrs (_: path: pkgs.callPackage (path + "/${packageFun}") { }) namesToPath;
in in
units units

View File

@ -7,11 +7,13 @@
# nix-build -A mypackage # nix-build -A mypackage
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
let
import ./pkgs/top-level/all-packages.nix { inherit pkgs; } legacy = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
// { units = import ./callUnitRoot.nix { inherit pkgs; root = ./pkgs/unit; };
in
legacy // units // {
# The `lib`, `modules`, and `overlay` names are special # The `lib`, `modules`, and `overlay` names are special
lib = import ./lib { inherit pkgs; }; # functions lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays overlays = import ./overlays; # nixpkgs overlays
} // import ./callUnitRoot.nix { inherit pkgs; } }

6
flake.lock generated
View File

@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1677383253, "lastModified": 1677995890,
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", "narHash": "sha256-eOnCn0o3I6LP48fAi8xWFcn49V2rL7oX5jCtJTeN1LI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634", "rev": "a1240f6b4a0bcc84fc48008b396a140d9f3638f6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -20,11 +20,11 @@
# Unstable names are variables. # Unstable names are variables.
packages = packages =
let let
legacyPackages = import ./pkgs/top-level/all-packages.nix { inherit pkgs; }; legacyPackages = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
unitPackages = import ./callUnitRoot.nix { inherit pkgs; };
onlyAvailable = lib.filterAttrs (_: drv: builtins.elem system (drv.meta.platforms or [ ])); onlyAvailable = lib.filterAttrs (_: drv: builtins.elem system (drv.meta.platforms or [ ]));
in in
onlyAvailable (legacyPackages // import ./callUnitRoot.nix { inherit pkgs; }); onlyAvailable (legacyPackages // unitPackages);
checks = { checks = {
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" '' nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
@ -33,6 +33,18 @@
deadnix = pkgs.writeShellScriptBin "deadnix-check" '' deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
${pkgs.deadnix}/bin/deadnix --fail . ${pkgs.deadnix}/bin/deadnix --fail .
''; '';
# Ensures that the NUR bot can evaluate and find all our packages.
# Normally we'd also run with `--option restrict-eval true`, but
# this is incompatible with flakes because reasons.
nur = pkgs.writeShellScriptBin "nur-check" ''
nix-env -f . -qa \* --meta \
--allowed-uris https://static.rust-lang.org \
--option allow-import-from-derivation true \
--drv-path --show-trace \
-I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
-I ./ \
--json | ${pkgs.jq}/bin/jq -r 'values | .[].name'
'';
}; };
devShells.ci = pkgs.mkShellNoCC { devShells.ci = pkgs.mkShellNoCC {

View File

@ -29,15 +29,17 @@ stdenv.mkDerivation rec {
--add-flags "--working-dir \''${XDG_DATA_HOME:-\$HOME/.local/share}/ATLauncher" --add-flags "--working-dir \''${XDG_DATA_HOME:-\$HOME/.local/share}/ATLauncher"
''; '';
meta = with lib; { meta = {
description = "Minecraft launcher"; description = "Minecraft launcher";
longDescription = '' longDescription = ''
ATLauncher is a Launcher for Minecraft which integrates multiple different ATLauncher is a Launcher for Minecraft which integrates multiple different
ModPacks to allow you to download and install ModPacks easily and quickly. ModPacks to allow you to download and install ModPacks easily and quickly.
''; '';
sourceProvenance = with sourceTypes; [ binaryBytecode ]; sourceProvenance = [
license = licenses.gpl3Only; (lib.sourceTypes.binaryBytecode or { shortName = "binaryBytecode"; isSource = false; })
platforms = platforms.all; ];
license = lib.licenses.gpl3Only;
platforms = lib.platforms.all;
homepage = "https://atlauncher.com/"; homepage = "https://atlauncher.com/";
}; };
} }