change to focus repo on games packages

This commit is contained in:
Katherina Walshe-Grey 2024-12-27 12:16:03 +00:00
parent 6d9b5080a2
commit 625756711e
13 changed files with 24 additions and 150 deletions

View file

@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View file

@ -1,58 +0,0 @@
name: "Build and populate cache"
on:
pull_request:
push:
branches:
- main
- master
schedule:
# rebuild everyday at 1:15
- cron: '05 1 * * *'
jobs:
tests:
strategy:
matrix:
nurRepo:
- qenya
cachixName:
- qenya
nixPath:
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-24.05.tar.gz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@V27
with:
nix_path: "${{ matrix.nixPath }}"
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Setup cachix
uses: cachix/cachix-action@v15
# Don't replace <YOUR_CACHIX_NAME> here!
if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
with:
name: ${{ matrix.cachixName }}
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Check evaluation
run: |
nix-env -f . -qa \* --meta --xml \
--allowed-uris https://static.rust-lang.org \
--option restrict-eval true \
--option allow-import-from-derivation true \
--drv-path --show-trace \
-I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
-I $PWD
- name: Build nix packages
run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs
- name: Trigger NUR update
# Don't replace <YOUR_REPO_NAME> here!
if: ${{ matrix.nurRepo != '<YOUR_REPO_NAME>' }}
run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}"

53
ci.nix
View file

@ -1,53 +0,0 @@
# This file provides all the buildable and cacheable packages and
# package outputs in your package set. These are what gets built by CI,
# so if you correctly mark packages as
#
# - broken (using `meta.broken`),
# - unfree (using `meta.license.free`), and
# - locally built (using `preferLocalBuild`)
#
# then your CI will be able to build and cache only those packages for
# which this is possible.
{ pkgs ? import <nixpkgs> { } }:
with builtins;
let
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
isDerivation = p: isAttrs p && p ? type && p.type == "derivation";
isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true;
isCacheable = p: !(p.preferLocalBuild or false);
shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false;
nameValuePair = n: v: { name = n; value = v; };
concatMap = builtins.concatMap or (f: xs: concatLists (map f xs));
flattenPkgs = s:
let
f = p:
if shouldRecurseForDerivations p then flattenPkgs p
else if isDerivation p then [ p ]
else [ ];
in
concatMap f (attrValues s);
outputsOf = p: map (o: p.${o}) p.outputs;
nurAttrs = import ./default.nix { inherit pkgs; };
nurPkgs =
flattenPkgs
(listToAttrs
(map (n: nameValuePair n nurAttrs.${n})
(filter (n: !isReserved n)
(attrNames nurAttrs))));
in
rec {
buildPkgs = filter isBuildable nurPkgs;
cachePkgs = filter isCacheable buildPkgs;
buildOutputs = concatMap outputsOf buildPkgs;
cacheOutputs = concatMap outputsOf cachePkgs;
}

View file

@ -1,6 +1,6 @@
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
{ {
digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./pkgs/digital-a-love-story { }; digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./packages/digital-a-love-story { };
dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./pkgs/dont-take-it-personally-babe { }; dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./packages/dont-take-it-personally-babe { };
} }

View file

@ -2,16 +2,16 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1712449641, "lastModified": 1734649271,
"narHash": "sha256-U9DDWMexN6o5Td2DznEgguh8TRIUnIl9levmit43GcI=", "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "600b15aea1b36eeb43833a50b0e96579147099ff", "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -1,22 +1,26 @@
{ {
description = "My personal NUR repository"; description = "Freeware games by Christine Love";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
systems = [ systems = [ "x86_64-linux" "i686-linux" ];
"x86_64-linux" forAllSystems = nixpkgs.lib.genAttrs systems;
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"armv6l-linux"
"armv7l-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in in
{ {
packages = forAllSystems (system: import ./default.nix {
pkgs = nixpkgs.legacyPackages."${system}";
});
legacyPackages = forAllSystems (system: import ./default.nix { legacyPackages = forAllSystems (system: import ./default.nix {
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
}); });
packages = forAllSystems (system: nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) self.legacyPackages.${system});
overlays.default = final: prev: {
scoutshonour = import ./default.nix { pkgs = final; };
};
}; };
} }

View file

@ -1,15 +0,0 @@
# You can use this file as a nixpkgs overlay. This is useful in the
# case where you don't want to add the whole NUR namespace to your
# configuration.
self: super:
let
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
nameValuePair = n: v: { name = n; value = v; };
nurAttrs = import ./default.nix { pkgs = super; };
in
builtins.listToAttrs
(map (n: nameValuePair n nurAttrs.${n})
(builtins.filter (n: !isReserved n)
(builtins.attrNames nurAttrs)))

View file

@ -64,5 +64,6 @@ stdenv.mkDerivation rec {
description = "Digital: A Love Story, a freeware game by Christine Love"; description = "Digital: A Love Story, a freeware game by Christine Love";
license = licenses.cc-by-nc-sa-30; license = licenses.cc-by-nc-sa-30;
platforms = lists.intersectLists platforms.x86 platforms.linux; platforms = lists.intersectLists platforms.x86 platforms.linux;
mainProgram = "digital";
}; };
} }

View file

@ -71,5 +71,6 @@ stdenv.mkDerivation rec {
description = "don't take it personally, babe, it just ain't your story: a freeware game by Christine Love"; description = "don't take it personally, babe, it just ain't your story: a freeware game by Christine Love";
license = licenses.cc-by-nc-sa-30; license = licenses.cc-by-nc-sa-30;
platforms = lists.intersectLists platforms.x86 platforms.linux; platforms = lists.intersectLists platforms.x86 platforms.linux;
mainProgram = "donttakeitpersonallybabeitjustaintyourstory";
}; };
} }