commit d110558bee92e24a36ce80ce96e2a1f228660eac Author: Madeleine Sydney Ĺšlaga Date: Thu Jun 5 01:24:33 2025 -0600 init diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..dd8a0a9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,76 @@ +name: "Build and populate cache" +on: + pull_request: + push: + branches: + - main + - master + schedule: + # rebuild everyday at 2:51 + # TIP: Choose a random time here so not all repositories are build at once: + # https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new + - cron: '51 2 * * *' + workflow_dispatch: +jobs: + tests: + strategy: + matrix: + # Set this to notify the global nur package registry that changes are + # available. + # + # The repo name as used in + # https://github.com/nix-community/NUR/blob/master/repos.json + nurRepo: + - sydpkgs + # Set this to cache your build results in cachix for faster builds + # in CI and for everyone who uses your cache. + # + # Format: Your cachix cache host name without the ".cachix.org" suffix. + # Example: mycache (for mycache.cachix.org) + # + # For this to work, you also need to set the CACHIX_SIGNING_KEY or + # CACHIX_AUTH_TOKEN secret in your repository secrets settings in + # Github found at + # https://github.com//nur-packages/settings/secrets + cachixName: + - sydpkgs + 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@v30 + 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 {}).lib.version' + - name: Setup cachix + uses: cachix/cachix-action@v15 + # Don't replace here! + if: ${{ matrix.cachixName != '' }} + 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 '' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs + - name: Trigger NUR update + # Don't replace here! + if: ${{ matrix.nurRepo != '' }} + run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dc3520 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +result +result-* + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..212cbf2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2018 Francesco Gazzetta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..2fe9dc6 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# sydpkgs + +![Build and populate cache](https://github.com/msyds/sydpkgs/workflows/Build%20and%20populate%20cache/badge.svg) + +[![Cachix Cache](https://img.shields.io/badge/cachix-sydpkgs-blue.svg)](https://sydpkgs.cachix.org) + diff --git a/ci.nix b/ci.nix new file mode 100644 index 0000000..f84dd96 --- /dev/null +++ b/ci.nix @@ -0,0 +1,56 @@ +# 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 { } }: + +with builtins; +let + isReserved = n: n == "lib" || n == "overlays" || n == "modules"; + isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; + isBuildable = p: let + licenseFromMeta = p.meta.license or []; + licenseList = if builtins.isList licenseFromMeta then licenseFromMeta else [licenseFromMeta]; + in !(p.meta.broken or false) && builtins.all (license: license.free or true) licenseList; + 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; +} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..fda835c --- /dev/null +++ b/default.nix @@ -0,0 +1,25 @@ +# This file describes your repository contents. +# It should return a set of nix derivations +# and optionally the special attributes `lib`, `modules` and `overlays`. +# It should NOT import . Instead, you should take pkgs as an argument. +# Having pkgs default to is fine though, and it lets you use short +# commands such as: +# nix-build -A mypackage + +{ pkgs ? import { } }: + +let + callPackage = pkgs.lib.callPackageWith (pkgs // sydpkgs); + sydpkgs = + pkgs.lib.mapAttrs + (pkg: _: + callPackage ./pkgs/${pkg} {}) + (builtins.readDir ./pkgs); +in sydpkgs // { + # The `lib`, `modules`, and `overlays` names are special + lib = import ./lib { inherit pkgs; }; + + modules = import ./modules; + + overlays = import ./overlays; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..78cf35d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1712449641, + "narHash": "sha256-U9DDWMexN6o5Td2DznEgguh8TRIUnIl9levmit43GcI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "600b15aea1b36eeb43833a50b0e96579147099ff", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..08786d0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "My niche packages."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { self, nixpkgs }: + let + forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; + in + { + legacyPackages = forAllSystems (system: import ./default.nix { + pkgs = import nixpkgs { inherit system; }; + }); + + packages = + forAllSystems (system: + nixpkgs.lib.filterAttrs + (_: v: nixpkgs.lib.isDerivation v) + self.legacyPackages.${system}); + }; +} diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..a7fab1d --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,7 @@ +{ pkgs }: + +with pkgs.lib; { + # Add your library functions here + # + # hexint = x: hexvals.${toLower x}; +} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..ff6c7c0 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,5 @@ +{ + # Add your NixOS modules here + # + # my-module = ./my-module; +} diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..bff7396 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,15 @@ +# 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))) diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1 @@ +{} diff --git a/pkgs/ansilove/default.nix b/pkgs/ansilove/default.nix new file mode 100644 index 0000000..36da131 --- /dev/null +++ b/pkgs/ansilove/default.nix @@ -0,0 +1,25 @@ +{ stdenv +, cmake +, fetchFromGitHub +, libansilove +}: + +stdenv.mkDerivation (final: { + pname = "ansilove"; + version = "4.2.1"; + + src = fetchFromGitHub { + owner = "ansilove"; + repo = "ansilove"; + rev = final.version; + hash = "sha256-13v2NLVJt11muwocBiQYz/rxQkte/W6LXwB/H/E9Nvk="; + }; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + libansilove + ]; +}) diff --git a/pkgs/asciiville-aewan/default.nix b/pkgs/asciiville-aewan/default.nix new file mode 100644 index 0000000..d2f3e85 --- /dev/null +++ b/pkgs/asciiville-aewan/default.nix @@ -0,0 +1,49 @@ +{ lib +, python3Packages +, fetchFromGitHub +, makeWrapper +, withGifExport ? true +, ansilove +}: + +python3Packages.buildPythonApplication rec { + pname = "asciiville-aewan"; + version = "1.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "cmang"; + repo = "durdraw"; + rev = version; + hash = "sha256-a+4DGWBD5XLaNAfTN/fmI/gALe76SCoWrnjyglNhVPY="; + }; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = [ + ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + postInstall = lib.optionalString withGifExport '' + wrapProgram $out/bin/durdraw \ + --prefix PATH : "${lib.makeBinPath [ansilove]}" + ''; + + meta = { + changelog = "https://github.com/cmang/durdraw/releases/tag/${version}"; + description = '' + Versatile ASCII and ANSI Art text editor for drawing in the + Linux/Unix/macOS terminal, with animation, 256 and 16 colors, Unicode and + CP437, and customizable themes. + ''; + homepage = "https://github.com/cmang/durdraw/"; + license = lib.licenses.bsd3; + # maintainers = [ + # ]; + }; +} diff --git a/pkgs/durdraw/default.nix b/pkgs/durdraw/default.nix new file mode 100644 index 0000000..e3bf2de --- /dev/null +++ b/pkgs/durdraw/default.nix @@ -0,0 +1,46 @@ +{ lib +, python3Packages +, fetchFromGitHub +, makeWrapper +, withGifExport ? true +, ansilove +}: + +python3Packages.buildPythonApplication rec { + pname = "durdraw"; + version = "0.29.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "cmang"; + repo = "durdraw"; + rev = version; + hash = "sha256-a+4DGWBD5XLaNAfTN/fmI/gALe76SCoWrnjyglNhVPY="; + }; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = []; + + nativeBuildInputs = [ + makeWrapper + ]; + + postInstall = lib.optionalString withGifExport '' + wrapProgram $out/bin/durdraw \ + --prefix PATH : "${lib.makeBinPath [ansilove]}" + ''; + + meta = { + changelog = "https://github.com/cmang/durdraw/releases/tag/${version}"; + description = '' + Versatile ASCII and ANSI Art text editor for drawing in the + Linux/Unix/macOS terminal, with animation, 256 and 16 colors, Unicode and + CP437, and customizable themes. + ''; + homepage = "https://github.com/cmang/durdraw/"; + license = lib.licenses.bsd3; + }; +} diff --git a/pkgs/libansilove/default.nix b/pkgs/libansilove/default.nix new file mode 100644 index 0000000..2558f71 --- /dev/null +++ b/pkgs/libansilove/default.nix @@ -0,0 +1,25 @@ +{ stdenv +, cmake +, fetchFromGitHub +, gd +}: + +stdenv.mkDerivation (final: { + pname = "libansilove"; + version = "1.4.2"; + + src = fetchFromGitHub { + owner = "ansilove"; + repo = "libansilove"; + rev = final.version; + hash = "sha256-kbQ7tbQbJ8zYhdbfiVZY26woyR4NNzqjCJ/5nrunlWs="; + }; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + gd + ]; +}) diff --git a/pkgs/nbb/default.nix b/pkgs/nbb/default.nix new file mode 100644 index 0000000..fc50091 --- /dev/null +++ b/pkgs/nbb/default.nix @@ -0,0 +1,21 @@ +{ bun +, nodejs +, stdenv +}: + +stdenv.mkDerivation (final: { + pname = "nbb"; + version = "1.3.200"; + + src = ./nbb-${final.version}.tar.gz; + + buildInputs = [ + bun + nodejs + ]; + + installPhase = '' + mkdir -p $out + cp -r lib bin $out + ''; +}) diff --git a/pkgs/nbb/nbb-1.3.200.tar.gz b/pkgs/nbb/nbb-1.3.200.tar.gz new file mode 100644 index 0000000..adab7ce Binary files /dev/null and b/pkgs/nbb/nbb-1.3.200.tar.gz differ diff --git a/pkgs/vtf2png/default.nix b/pkgs/vtf2png/default.nix new file mode 100644 index 0000000..9614bff --- /dev/null +++ b/pkgs/vtf2png/default.nix @@ -0,0 +1,19 @@ +{ stdenv, libpng, fetchFromGitHub }: + +stdenv.mkDerivation { + pname = "vtf2png"; + version = "e74a1f"; + src = fetchFromGitHub { + owner = "eXeC64"; + repo = "vtf2png"; + rev = "e74a1fd24b760a0339ec4d498d0b9fef75d847ff"; + hash = "sha256-/tfhTMQNBh6RVe55QyYjG3ns0w0/E/afF7aB2lAp/f4="; + }; + buildInputs = [ + libpng + ]; + installPhase = '' + mkdir -p $out/bin + mv vtf2png $out/bin + ''; +}