From 001462e8c3a7809bf0865977aa8c087f8ffa099d Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 23 Jun 2024 16:18:10 +0100 Subject: [PATCH 01/21] Initial commit --- .github/dependabot.yml | 6 +++ .github/workflows/build.yml | 75 ++++++++++++++++++++++++++++++++ .gitignore | 3 ++ LICENSE | 22 ++++++++++ README.md | 37 ++++++++++++++++ ci.nix | 53 ++++++++++++++++++++++ default.nix | 20 +++++++++ flake.lock | 27 ++++++++++++ flake.nix | 22 ++++++++++ lib/default.nix | 7 +++ modules/default.nix | 5 +++ overlay.nix | 15 +++++++ overlays/default.nix | 5 +++ pkgs/example-package/default.nix | 9 ++++ 14 files changed, 306 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 ci.nix create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 lib/default.nix create mode 100644 modules/default.nix create mode 100644 overlay.nix create mode 100644 overlays/default.nix create mode 100644 pkgs/example-package/default.nix 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..920a040 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +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 * * *' +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: + - + # 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: + - + 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 {}).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..077cfbc --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# nur-packages-template + +**A template for [NUR](https://github.com/nix-community/NUR) repositories** + +## Setup + +1. Click on [Use this template](https://github.com/nix-community/nur-packages-template/generate) to start a repo based on this template. (Do _not_ fork it.) +2. Add your packages to the [pkgs](./pkgs) directory and to + [default.nix](./default.nix) + * Remember to mark the broken packages as `broken = true;` in the `meta` + attribute, or travis (and consequently caching) will fail! + * Library functions, modules and overlays go in the respective directories +3. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com). + - Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer + to a random value as described in the file + - Travis ci: Change your NUR repo name and optionally your cachix repo name in + [.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh +5. Change your travis and cachix names on the README template section and delete + the rest +6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository) + +## README template + +# nur-packages + +**My personal [NUR](https://github.com/nix-community/NUR) repository** + + +![Build and populate cache](https://github.com//nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) + + +[![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) + diff --git a/ci.nix b/ci.nix new file mode 100644 index 0000000..22b1352 --- /dev/null +++ b/ci.nix @@ -0,0 +1,53 @@ +# 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: !(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; +} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..3846c24 --- /dev/null +++ b/default.nix @@ -0,0 +1,20 @@ +# 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 { } }: + +{ + # The `lib`, `modules`, and `overlays` names are special + lib = import ./lib { inherit pkgs; }; # functions + modules = import ./modules; # NixOS modules + overlays = import ./overlays; # nixpkgs overlays + + example-package = pkgs.callPackage ./pkgs/example-package { }; + # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; + # ... +} 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..81a143f --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "My personal NUR repository"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + outputs = { self, nixpkgs }: + let + systems = [ + "x86_64-linux" + "i686-linux" + "x86_64-darwin" + "aarch64-linux" + "armv6l-linux" + "armv7l-linux" + ]; + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + 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..0c2d870 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,5 @@ +{ + # Add your overlays here + # + # my-overlay = import ./my-overlay; +} diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix new file mode 100644 index 0000000..41e22df --- /dev/null +++ b/pkgs/example-package/default.nix @@ -0,0 +1,9 @@ +{ stdenv }: + +stdenv.mkDerivation rec { + name = "example-package-${version}"; + version = "1.0"; + src = ./.; + buildPhase = "echo echo Hello World > example"; + installPhase = "install -Dm755 example $out"; +} From 5d897adb87a01a5ef8528f04f6aff1fe5e6fc13c Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 23 Jun 2024 16:34:42 +0100 Subject: [PATCH 02/21] Initial setup --- .github/workflows/build.yml | 25 ++++--------------------- README.md | 33 ++------------------------------- 2 files changed, 6 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 920a040..082873a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,33 +6,16 @@ on: - 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 * * *' + # rebuild everyday at 1:15 + - cron: '05 1 * * *' 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: - - - # 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 + - 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 diff --git a/README.md b/README.md index 077cfbc..c1f3c12 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,8 @@ -# nur-packages-template - -**A template for [NUR](https://github.com/nix-community/NUR) repositories** - -## Setup - -1. Click on [Use this template](https://github.com/nix-community/nur-packages-template/generate) to start a repo based on this template. (Do _not_ fork it.) -2. Add your packages to the [pkgs](./pkgs) directory and to - [default.nix](./default.nix) - * Remember to mark the broken packages as `broken = true;` in the `meta` - attribute, or travis (and consequently caching) will fail! - * Library functions, modules and overlays go in the respective directories -3. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com). - - Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer - to a random value as described in the file - - Travis ci: Change your NUR repo name and optionally your cachix repo name in - [.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh -5. Change your travis and cachix names on the README template section and delete - the rest -6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository) - -## README template - # nur-packages **My personal [NUR](https://github.com/nix-community/NUR) repository** - -![Build and populate cache](https://github.com//nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) +![Build and populate cache](https://github.com/qenya/nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) - -[![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) +[![Cachix Cache](https://img.shields.io/badge/cachix-qenya-blue.svg)](https://qenya.cachix.org) From 05005f4702bfb2493478ee9c82740e96ea6329d6 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 23 Jun 2024 16:59:06 +0100 Subject: [PATCH 03/21] Update author name in license --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 212cbf2..10733bb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ MIT License +Copyright (c) 2024 Katherina Walshe-Grey Copyright (c) 2018 Francesco Gazzetta Permission is hereby granted, free of charge, to any person obtaining a copy From e1db10bcf32993d123750fc81ed115b75bb034ff Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 23 Jun 2024 17:36:52 +0100 Subject: [PATCH 04/21] Remove example package --- default.nix | 19 +++---------------- pkgs/example-package/default.nix | 9 --------- 2 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 pkgs/example-package/default.nix diff --git a/default.nix b/default.nix index 3846c24..afbeb02 100644 --- a/default.nix +++ b/default.nix @@ -1,20 +1,7 @@ -# 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 { } }: { - # The `lib`, `modules`, and `overlays` names are special - lib = import ./lib { inherit pkgs; }; # functions - modules = import ./modules; # NixOS modules - overlays = import ./overlays; # nixpkgs overlays - - example-package = pkgs.callPackage ./pkgs/example-package { }; - # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; - # ... + lib = import ./lib { inherit pkgs; }; + modules = import ./modules; + overlays = import ./overlays; } diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix deleted file mode 100644 index 41e22df..0000000 --- a/pkgs/example-package/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ stdenv }: - -stdenv.mkDerivation rec { - name = "example-package-${version}"; - version = "1.0"; - src = ./.; - buildPhase = "echo echo Hello World > example"; - installPhase = "install -Dm755 example $out"; -} From 97ddcbcaa13e0e04b2e2fe540a1c4a86ccae077d Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Sun, 23 Jun 2024 21:07:29 +0100 Subject: [PATCH 05/21] digitalalovestory-bin: init --- default.nix | 2 + pkgs/digitalalovestory-bin/default.nix | 66 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 pkgs/digitalalovestory-bin/default.nix diff --git a/default.nix b/default.nix index afbeb02..e2245b7 100644 --- a/default.nix +++ b/default.nix @@ -4,4 +4,6 @@ lib = import ./lib { inherit pkgs; }; modules = import ./modules; overlays = import ./overlays; + + digitalalovestory-bin = pkgs.callPackage ./pkgs/digitalalovestory-bin { }; } diff --git a/pkgs/digitalalovestory-bin/default.nix b/pkgs/digitalalovestory-bin/default.nix new file mode 100644 index 0000000..a9dfd56 --- /dev/null +++ b/pkgs/digitalalovestory-bin/default.nix @@ -0,0 +1,66 @@ +{ stdenv +, lib +, fetchzip +, steam-run +# , zlib +# , autoPatchelfHook +}: + +# TODO: Shouldn't need the whole steam-run FHS env. +# Adding autoPatchelfHook and zlib lets it build and run, +# but pygame errors out with "error: No available video device". +# It may be more practical to just create a version built from source. + +stdenv.mkDerivation rec { + pname = "digitalalovestory-bin"; + version = "1.1"; + + src = fetchzip { + url = "https://www.scoutshonour.com/lilyofthevalley/digital-1.1.tar.bz2"; + sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; + }; + + # nativeBuildInputs = [ + # autoPatchelfHook + # ]; + + buildInputs = [ + steam-run + # zlib + ]; + + sourceRoot = "."; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + # copy distributed files + mkdir -p $out/opt/Digital-linux-x86 + cp -R source/* $out/opt/Digital-linux-x86 + + # patch paths in entrypoint + sed -i "s#\`dirname \\\\\\\"\$0\\\\\\\"\`#$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh + sed -i "s#\''${0%\\.sh}#$out/opt/Digital-linux-x86/Digital#g" $out/opt/Digital-linux-x86/Digital.sh + sed -i "s#dir=.*#dir=$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh + sed -i 's/base=.*/base=Digital.sh/g' $out/opt/Digital-linux-x86/Digital.sh + + # wrap in steam-run + sed -i 's#exec#exec "${steam-run}/bin/steam-run"#g' $out/opt/Digital-linux-x86/Digital.sh + + # link entrypoint to bin directory + mkdir -p $out/bin + ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://scoutshonour.com/digital/"; + description = "Digital: A Love Story, a freeware game by Christine Love"; + license = licenses.cc-by-nc-sa-30; + platforms = lists.intersectLists platforms.x86 platforms.linux; + }; +} From 21965c39712f11c6ab67d178bcdab6323c827d2d Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 12:22:36 +0100 Subject: [PATCH 06/21] digitalalovestory-bin: don't hardcode version number in source URL --- pkgs/digitalalovestory-bin/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/digitalalovestory-bin/default.nix b/pkgs/digitalalovestory-bin/default.nix index a9dfd56..3908319 100644 --- a/pkgs/digitalalovestory-bin/default.nix +++ b/pkgs/digitalalovestory-bin/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { version = "1.1"; src = fetchzip { - url = "https://www.scoutshonour.com/lilyofthevalley/digital-1.1.tar.bz2"; + url = "https://www.scoutshonour.com/lilyofthevalley/digital-${version}.tar.bz2"; sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; }; From 20c6d8bc138ee0c87231f4c1afc9b0dc03caf31d Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 13:13:24 +0100 Subject: [PATCH 07/21] digitalalovestory: init just an outline, not building yet --- default.nix | 1 + pkgs/digitalalovestory/default.nix | 53 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 pkgs/digitalalovestory/default.nix diff --git a/default.nix b/default.nix index e2245b7..be35eb4 100644 --- a/default.nix +++ b/default.nix @@ -5,5 +5,6 @@ modules = import ./modules; overlays = import ./overlays; + digitalalovestory = pkgs.pkgsi686Linux.callPackage ./pkgs/digitalalovestory { }; digitalalovestory-bin = pkgs.callPackage ./pkgs/digitalalovestory-bin { }; } diff --git a/pkgs/digitalalovestory/default.nix b/pkgs/digitalalovestory/default.nix new file mode 100644 index 0000000..fe599c6 --- /dev/null +++ b/pkgs/digitalalovestory/default.nix @@ -0,0 +1,53 @@ +{ stdenv +, lib +, fetchzip +, python +}: + +stdenv.mkDerivation rec { + pname = "digitalalovestory"; + version = "1.1"; + + broken = true; # haven't got around to figuring out what python modules are needed + + src = fetchzip { + url = "https://www.scoutshonour.com/lilyofthevalley/digital-${version}.tar.bz2"; + sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; + }; + + buildInputs = [ + python + ]; + + sourceRoot = "."; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + # copy distributed files + mkdir -p $out/opt/Digital-linux-x86 + cp -R source/* $out/opt/Digital-linux-x86 + + # patch paths in entrypoint + sed -i 's#exec "`dirname \\"$0\\"`/lib/python"#exec "${python}/bin/python"#g' $out/opt/Digital-linux-x86/Digital.sh + sed -i "s#\''${0%\\.sh}#$out/opt/Digital-linux-x86/Digital#g" $out/opt/Digital-linux-x86/Digital.sh + sed -i "s#dir=.*#dir=$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh + sed -i 's/base=.*/base=Digital.sh/g' $out/opt/Digital-linux-x86/Digital.sh + + # link entrypoint to bin directory + mkdir -p $out/bin + ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://scoutshonour.com/digital/"; + description = "Digital: A Love Story, a freeware game by Christine Love"; + license = licenses.cc-by-nc-sa-30; + platforms = lists.intersectLists platforms.x86 platforms.linux; + }; +} From d841c56b8f63e0e8a7af3616c0c75d1a1a8ef063 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 13:16:41 +0100 Subject: [PATCH 08/21] digitalalovestory-bin: build as 32-bit --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index be35eb4..5214163 100644 --- a/default.nix +++ b/default.nix @@ -6,5 +6,5 @@ overlays = import ./overlays; digitalalovestory = pkgs.pkgsi686Linux.callPackage ./pkgs/digitalalovestory { }; - digitalalovestory-bin = pkgs.callPackage ./pkgs/digitalalovestory-bin { }; + digitalalovestory-bin = pkgs.pkgsi686Linux.callPackage ./pkgs/digitalalovestory-bin { }; } From ab1dd67e728006fe199b6cd2bd1b659a25f61c25 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 16:52:06 +0100 Subject: [PATCH 09/21] digitalalovestory-bin: link missing libraries & excise steam-run --- pkgs/digitalalovestory-bin/default.nix | 35 ++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/pkgs/digitalalovestory-bin/default.nix b/pkgs/digitalalovestory-bin/default.nix index 3908319..d8bbe83 100644 --- a/pkgs/digitalalovestory-bin/default.nix +++ b/pkgs/digitalalovestory-bin/default.nix @@ -1,16 +1,13 @@ { stdenv , lib , fetchzip -, steam-run -# , zlib -# , autoPatchelfHook +, zlib +, autoPatchelfHook +, xorg +, libpulseaudio +, alsa-lib }: -# TODO: Shouldn't need the whole steam-run FHS env. -# Adding autoPatchelfHook and zlib lets it build and run, -# but pygame errors out with "error: No available video device". -# It may be more practical to just create a version built from source. - stdenv.mkDerivation rec { pname = "digitalalovestory-bin"; version = "1.1"; @@ -20,13 +17,22 @@ stdenv.mkDerivation rec { sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; }; - # nativeBuildInputs = [ - # autoPatchelfHook - # ]; + nativeBuildInputs = [ + autoPatchelfHook + ]; buildInputs = [ - steam-run - # zlib + zlib + ]; + + appendRunpaths = [ + "${xorg.libX11}/lib" + "${xorg.libXext}/lib" + "${xorg.libXrender}/lib" + "${xorg.libXrandr}/lib" + "${xorg.libXcursor}/lib" + "${libpulseaudio}/lib" + "${alsa-lib}/lib" ]; sourceRoot = "."; @@ -47,9 +53,6 @@ stdenv.mkDerivation rec { sed -i "s#dir=.*#dir=$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh sed -i 's/base=.*/base=Digital.sh/g' $out/opt/Digital-linux-x86/Digital.sh - # wrap in steam-run - sed -i 's#exec#exec "${steam-run}/bin/steam-run"#g' $out/opt/Digital-linux-x86/Digital.sh - # link entrypoint to bin directory mkdir -p $out/bin ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital From 21eb3ca4119e22428fee4420910dd704a25ca8f9 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 16:52:50 +0100 Subject: [PATCH 10/21] Revert "digitalalovestory: init" This reverts commit 20c6d8bc138ee0c87231f4c1afc9b0dc03caf31d. fix --- default.nix | 1 - pkgs/digitalalovestory/default.nix | 53 ------------------------------ 2 files changed, 54 deletions(-) delete mode 100644 pkgs/digitalalovestory/default.nix diff --git a/default.nix b/default.nix index 5214163..1f3f2be 100644 --- a/default.nix +++ b/default.nix @@ -5,6 +5,5 @@ modules = import ./modules; overlays = import ./overlays; - digitalalovestory = pkgs.pkgsi686Linux.callPackage ./pkgs/digitalalovestory { }; digitalalovestory-bin = pkgs.pkgsi686Linux.callPackage ./pkgs/digitalalovestory-bin { }; } diff --git a/pkgs/digitalalovestory/default.nix b/pkgs/digitalalovestory/default.nix deleted file mode 100644 index fe599c6..0000000 --- a/pkgs/digitalalovestory/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ stdenv -, lib -, fetchzip -, python -}: - -stdenv.mkDerivation rec { - pname = "digitalalovestory"; - version = "1.1"; - - broken = true; # haven't got around to figuring out what python modules are needed - - src = fetchzip { - url = "https://www.scoutshonour.com/lilyofthevalley/digital-${version}.tar.bz2"; - sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; - }; - - buildInputs = [ - python - ]; - - sourceRoot = "."; - - dontConfigure = true; - dontBuild = true; - - installPhase = '' - runHook preInstall - - # copy distributed files - mkdir -p $out/opt/Digital-linux-x86 - cp -R source/* $out/opt/Digital-linux-x86 - - # patch paths in entrypoint - sed -i 's#exec "`dirname \\"$0\\"`/lib/python"#exec "${python}/bin/python"#g' $out/opt/Digital-linux-x86/Digital.sh - sed -i "s#\''${0%\\.sh}#$out/opt/Digital-linux-x86/Digital#g" $out/opt/Digital-linux-x86/Digital.sh - sed -i "s#dir=.*#dir=$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh - sed -i 's/base=.*/base=Digital.sh/g' $out/opt/Digital-linux-x86/Digital.sh - - # link entrypoint to bin directory - mkdir -p $out/bin - ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital - - runHook postInstall - ''; - - meta = with lib; { - homepage = "https://scoutshonour.com/digital/"; - description = "Digital: A Love Story, a freeware game by Christine Love"; - license = licenses.cc-by-nc-sa-30; - platforms = lists.intersectLists platforms.x86 platforms.linux; - }; -} From c08f8899889b62ac6005d20ace79d453659324ce Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 16:54:20 +0100 Subject: [PATCH 11/21] digitalalovestory-bin: rename to digital-a-love-story --- default.nix | 2 +- .../{digitalalovestory-bin => digital-a-love-story}/default.nix | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/{digitalalovestory-bin => digital-a-love-story}/default.nix (100%) diff --git a/default.nix b/default.nix index 1f3f2be..75db9a6 100644 --- a/default.nix +++ b/default.nix @@ -5,5 +5,5 @@ modules = import ./modules; overlays = import ./overlays; - digitalalovestory-bin = pkgs.pkgsi686Linux.callPackage ./pkgs/digitalalovestory-bin { }; + digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./pkgs/digital-a-love-story { }; } diff --git a/pkgs/digitalalovestory-bin/default.nix b/pkgs/digital-a-love-story/default.nix similarity index 100% rename from pkgs/digitalalovestory-bin/default.nix rename to pkgs/digital-a-love-story/default.nix From 25cfce2f7e9ec36f266c56e233ffbf3e97bf646d Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 17:30:05 +0100 Subject: [PATCH 12/21] digital-a-love-story: use substituteInPlace instead of sed to rewrite paths --- pkgs/digital-a-love-story/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/digital-a-love-story/default.nix b/pkgs/digital-a-love-story/default.nix index d8bbe83..c42b89d 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/pkgs/digital-a-love-story/default.nix @@ -48,10 +48,11 @@ stdenv.mkDerivation rec { cp -R source/* $out/opt/Digital-linux-x86 # patch paths in entrypoint - sed -i "s#\`dirname \\\\\\\"\$0\\\\\\\"\`#$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh - sed -i "s#\''${0%\\.sh}#$out/opt/Digital-linux-x86/Digital#g" $out/opt/Digital-linux-x86/Digital.sh - sed -i "s#dir=.*#dir=$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh - sed -i 's/base=.*/base=Digital.sh/g' $out/opt/Digital-linux-x86/Digital.sh + substituteInPlace $out/opt/Digital-linux-x86/Digital.sh \ + --replace '${"\${0%.sh}"}' "$out/opt/Digital-linux-x86/Digital" \ + --replace '`dirname \"$0\"`' "$out/opt/Digital-linux-x86" \ + --replace '`dirname "$0"`' "$out/opt/Digital-linux-x86" \ + --replace '`basename "$0"`' 'Digital.sh' # link entrypoint to bin directory mkdir -p $out/bin From 19db1d33d48ce6eef0d42fa0c8dc1c9ca4c3dec6 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 18:12:43 +0100 Subject: [PATCH 13/21] digital-a-love-story: add desktop file --- pkgs/digital-a-love-story/Digital.desktop | 6 ++++++ pkgs/digital-a-love-story/default.nix | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 pkgs/digital-a-love-story/Digital.desktop diff --git a/pkgs/digital-a-love-story/Digital.desktop b/pkgs/digital-a-love-story/Digital.desktop new file mode 100644 index 0000000..cefdff0 --- /dev/null +++ b/pkgs/digital-a-love-story/Digital.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Digital: A Love Story +Exec=@out@/bin/Digital +Icon=@out@/opt/game/icon.png +Type=Application +Categories=Game; \ No newline at end of file diff --git a/pkgs/digital-a-love-story/default.nix b/pkgs/digital-a-love-story/default.nix index c42b89d..79ebab3 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/pkgs/digital-a-love-story/default.nix @@ -58,6 +58,10 @@ stdenv.mkDerivation rec { mkdir -p $out/bin ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital + # add desktop file + mkdir -p $out/share/applications + substituteAll ${./Digital.desktop} $out/share/applications/Digital.desktop + runHook postInstall ''; From 0db7b07361c3b1e818a6d33c5fd365394d31d67a Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 18:47:29 +0100 Subject: [PATCH 14/21] digital-a-love-story: correct path to icon --- pkgs/digital-a-love-story/Digital.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/digital-a-love-story/Digital.desktop b/pkgs/digital-a-love-story/Digital.desktop index cefdff0..051fc64 100644 --- a/pkgs/digital-a-love-story/Digital.desktop +++ b/pkgs/digital-a-love-story/Digital.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Digital: A Love Story Exec=@out@/bin/Digital -Icon=@out@/opt/game/icon.png +Icon=@out@/opt/Digital-linux-x86/game/icon.png Type=Application Categories=Game; \ No newline at end of file From 698d6e72262eb33f9f871232680c1aeba570fed7 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 27 Jun 2024 10:59:55 +0100 Subject: [PATCH 15/21] digital-a-love-story: completely replace packaged launcher --- pkgs/digital-a-love-story/default.nix | 12 +++--------- pkgs/digital-a-love-story/launcher.sh | 3 +++ 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 pkgs/digital-a-love-story/launcher.sh diff --git a/pkgs/digital-a-love-story/default.nix b/pkgs/digital-a-love-story/default.nix index 79ebab3..3e8fd9e 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/pkgs/digital-a-love-story/default.nix @@ -47,16 +47,10 @@ stdenv.mkDerivation rec { mkdir -p $out/opt/Digital-linux-x86 cp -R source/* $out/opt/Digital-linux-x86 - # patch paths in entrypoint - substituteInPlace $out/opt/Digital-linux-x86/Digital.sh \ - --replace '${"\${0%.sh}"}' "$out/opt/Digital-linux-x86/Digital" \ - --replace '`dirname \"$0\"`' "$out/opt/Digital-linux-x86" \ - --replace '`dirname "$0"`' "$out/opt/Digital-linux-x86" \ - --replace '`basename "$0"`' 'Digital.sh' - - # link entrypoint to bin directory + # add launcher mkdir -p $out/bin - ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital + substituteAll ${./launcher.sh} $out/bin/Digital + chmod +x $out/bin/Digital # add desktop file mkdir -p $out/share/applications diff --git a/pkgs/digital-a-love-story/launcher.sh b/pkgs/digital-a-love-story/launcher.sh new file mode 100644 index 0000000..9727e6f --- /dev/null +++ b/pkgs/digital-a-love-story/launcher.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "@out@/opt/Digital-linux-x86/lib/python" "-OO" "@out@/opt/Digital-linux-x86/Digital.py" "$@" \ No newline at end of file From b8d7c17dc6b1127634e45100ce56c08360eb280a Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 27 Jun 2024 11:00:19 +0100 Subject: [PATCH 16/21] digital-a-love-story: correct package name --- pkgs/digital-a-love-story/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/digital-a-love-story/default.nix b/pkgs/digital-a-love-story/default.nix index 3e8fd9e..aeadbdc 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/pkgs/digital-a-love-story/default.nix @@ -9,7 +9,7 @@ }: stdenv.mkDerivation rec { - pname = "digitalalovestory-bin"; + pname = "digital-a-love-story"; version = "1.1"; src = fetchzip { From a27f7fb0c5879c5b85986f31e3a37e8585d28d3a Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 27 Jun 2024 11:29:04 +0100 Subject: [PATCH 17/21] dont-take-it-personally-babe: init at 1.1 --- default.nix | 1 + pkgs/dont-take-it-personally-babe/default.nix | 75 +++++++++++++++++++ .../donttakeitpersonallybabe.desktop | 6 ++ pkgs/dont-take-it-personally-babe/launcher.sh | 3 + 4 files changed, 85 insertions(+) create mode 100644 pkgs/dont-take-it-personally-babe/default.nix create mode 100644 pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop create mode 100644 pkgs/dont-take-it-personally-babe/launcher.sh diff --git a/default.nix b/default.nix index 75db9a6..02aee87 100644 --- a/default.nix +++ b/default.nix @@ -6,4 +6,5 @@ overlays = import ./overlays; digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./pkgs/digital-a-love-story { }; + dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./pkgs/dont-take-it-personally-babe { }; } diff --git a/pkgs/dont-take-it-personally-babe/default.nix b/pkgs/dont-take-it-personally-babe/default.nix new file mode 100644 index 0000000..1238936 --- /dev/null +++ b/pkgs/dont-take-it-personally-babe/default.nix @@ -0,0 +1,75 @@ +{ stdenv +, lib +, fetchzip +, zlib +, xorg +, libglvnd +, libGLU +, autoPatchelfHook +, libpulseaudio +, alsa-lib +}: + +stdenv.mkDerivation rec { + pname = "dont-take-it-personally-babe"; + version = "1.1"; + + src = fetchzip { + url = "https://scoutshonour.com/donttakeitpersonallybabeitjustaintyourstory/don't%20take%20it%20personally,%20babe-${version}-linux-x86.tar.bz2"; + sha256 = "X1xAJS8SrsQ5yrValrlfmeRLtSiH94EUw++GWjstwdc="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + zlib + xorg.libX11 + xorg.libXext + libglvnd + libGLU + xorg.libXi + xorg.libXmu + ]; + + appendRunpaths = [ + "${xorg.libX11}/lib" + "${xorg.libXext}/lib" + "${xorg.libXrender}/lib" + "${xorg.libXrandr}/lib" + "${libpulseaudio}/lib" + "${alsa-lib}/lib" + ]; + + sourceRoot = "."; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + # copy distributed files + mkdir -p $out/opt/donttakeitpersonallybabeitjustaintyourstory + cp -R source/* $out/opt/donttakeitpersonallybabeitjustaintyourstory + + # add launcher + mkdir -p $out/bin + substituteAll ${./launcher.sh} $out/bin/donttakeitpersonallybabe + chmod +x $out/bin/donttakeitpersonallybabe + + # add desktop file + mkdir -p $out/share/applications + substituteAll ${./donttakeitpersonallybabe.desktop} $out/share/applications/donttakeitpersonallybabe.desktop + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://scoutshonour.com/donttakeitpersonallybabeitjustaintyourstory/"; + 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; + platforms = lists.intersectLists platforms.x86 platforms.linux; + }; +} diff --git a/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop b/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop new file mode 100644 index 0000000..05c07c0 --- /dev/null +++ b/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=don't take it personally, babe, it just ain't your story +Exec=@out@/bin/donttakeitpersonallybabe +Icon=@out@/opt/donttakeitpersonallybabeitjustaintyourstory/game/icon256x256.png +Type=Application +Categories=Game; \ No newline at end of file diff --git a/pkgs/dont-take-it-personally-babe/launcher.sh b/pkgs/dont-take-it-personally-babe/launcher.sh new file mode 100644 index 0000000..77c91f5 --- /dev/null +++ b/pkgs/dont-take-it-personally-babe/launcher.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "@out@/opt/donttakeitpersonallybabeitjustaintyourstory/lib/python" "-OO" "@out@/opt/donttakeitpersonallybabeitjustaintyourstory/don't take it personally, babe.py" "$@" \ No newline at end of file From 27d9a986d9986ebbc65645b09a213521ed659691 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 27 Jun 2024 11:35:47 +0100 Subject: [PATCH 18/21] digital-a-love-story: lowercase binary name --- pkgs/digital-a-love-story/default.nix | 10 +++++----- .../{Digital.desktop => digital.desktop} | 4 ++-- pkgs/digital-a-love-story/launcher.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) rename pkgs/digital-a-love-story/{Digital.desktop => digital.desktop} (52%) diff --git a/pkgs/digital-a-love-story/default.nix b/pkgs/digital-a-love-story/default.nix index aeadbdc..bf7e06b 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/pkgs/digital-a-love-story/default.nix @@ -44,17 +44,17 @@ stdenv.mkDerivation rec { runHook preInstall # copy distributed files - mkdir -p $out/opt/Digital-linux-x86 - cp -R source/* $out/opt/Digital-linux-x86 + mkdir -p $out/opt/digital + cp -R source/* $out/opt/digital # add launcher mkdir -p $out/bin - substituteAll ${./launcher.sh} $out/bin/Digital - chmod +x $out/bin/Digital + substituteAll ${./launcher.sh} $out/bin/digital + chmod +x $out/bin/digital # add desktop file mkdir -p $out/share/applications - substituteAll ${./Digital.desktop} $out/share/applications/Digital.desktop + substituteAll ${./digital.desktop} $out/share/applications/digital.desktop runHook postInstall ''; diff --git a/pkgs/digital-a-love-story/Digital.desktop b/pkgs/digital-a-love-story/digital.desktop similarity index 52% rename from pkgs/digital-a-love-story/Digital.desktop rename to pkgs/digital-a-love-story/digital.desktop index 051fc64..c540fe5 100644 --- a/pkgs/digital-a-love-story/Digital.desktop +++ b/pkgs/digital-a-love-story/digital.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Digital: A Love Story -Exec=@out@/bin/Digital -Icon=@out@/opt/Digital-linux-x86/game/icon.png +Exec=@out@/bin/digital +Icon=@out@/opt/digital/game/icon.png Type=Application Categories=Game; \ No newline at end of file diff --git a/pkgs/digital-a-love-story/launcher.sh b/pkgs/digital-a-love-story/launcher.sh index 9727e6f..5216916 100644 --- a/pkgs/digital-a-love-story/launcher.sh +++ b/pkgs/digital-a-love-story/launcher.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec "@out@/opt/Digital-linux-x86/lib/python" "-OO" "@out@/opt/Digital-linux-x86/Digital.py" "$@" \ No newline at end of file +exec "@out@/opt/digital/lib/python" "-OO" "@out@/opt/digital/Digital.py" "$@" \ No newline at end of file From 27d7167292a31a23f88036fcd7730a60829f0921 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 27 Jun 2024 11:36:00 +0100 Subject: [PATCH 19/21] dont-take-it-personally-babe: consistent binary name --- pkgs/dont-take-it-personally-babe/default.nix | 6 +++--- ... => donttakeitpersonallybabeitjustaintyourstory.desktop} | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename pkgs/dont-take-it-personally-babe/{donttakeitpersonallybabe.desktop => donttakeitpersonallybabeitjustaintyourstory.desktop} (76%) diff --git a/pkgs/dont-take-it-personally-babe/default.nix b/pkgs/dont-take-it-personally-babe/default.nix index 1238936..570ebe0 100644 --- a/pkgs/dont-take-it-personally-babe/default.nix +++ b/pkgs/dont-take-it-personally-babe/default.nix @@ -56,12 +56,12 @@ stdenv.mkDerivation rec { # add launcher mkdir -p $out/bin - substituteAll ${./launcher.sh} $out/bin/donttakeitpersonallybabe - chmod +x $out/bin/donttakeitpersonallybabe + substituteAll ${./launcher.sh} $out/bin/donttakeitpersonallybabeitjustaintyourstory + chmod +x $out/bin/donttakeitpersonallybabeitjustaintyourstory # add desktop file mkdir -p $out/share/applications - substituteAll ${./donttakeitpersonallybabe.desktop} $out/share/applications/donttakeitpersonallybabe.desktop + substituteAll ${./donttakeitpersonallybabeitjustaintyourstory.desktop} $out/share/applications/donttakeitpersonallybabeitjustaintyourstory.desktop runHook postInstall ''; diff --git a/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop b/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop similarity index 76% rename from pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop rename to pkgs/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop index 05c07c0..879b8ca 100644 --- a/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabe.desktop +++ b/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=don't take it personally, babe, it just ain't your story -Exec=@out@/bin/donttakeitpersonallybabe +Exec=@out@/bin/donttakeitpersonallybabeitjustaintyourstory Icon=@out@/opt/donttakeitpersonallybabeitjustaintyourstory/game/icon256x256.png Type=Application Categories=Game; \ No newline at end of file From 6d9b5080a24d69b246b719d72d5b3c895f34e48d Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 22 Aug 2024 11:44:14 +0100 Subject: [PATCH 20/21] remove redundant boilerplate --- default.nix | 4 ---- lib/default.nix | 7 ------- modules/default.nix | 5 ----- overlays/default.nix | 5 ----- 4 files changed, 21 deletions(-) delete mode 100644 lib/default.nix delete mode 100644 modules/default.nix delete mode 100644 overlays/default.nix diff --git a/default.nix b/default.nix index 02aee87..c47929a 100644 --- a/default.nix +++ b/default.nix @@ -1,10 +1,6 @@ { pkgs ? import { } }: { - lib = import ./lib { inherit pkgs; }; - modules = import ./modules; - overlays = import ./overlays; - digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./pkgs/digital-a-love-story { }; dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./pkgs/dont-take-it-personally-babe { }; } diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index a7fab1d..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs }: - -with pkgs.lib; { - # Add your library functions here - # - # hexint = x: hexvals.${toLower x}; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index ff6c7c0..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - # Add your NixOS modules here - # - # my-module = ./my-module; -} diff --git a/overlays/default.nix b/overlays/default.nix deleted file mode 100644 index 0c2d870..0000000 --- a/overlays/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - # Add your overlays here - # - # my-overlay = import ./my-overlay; -} From 625756711e4c322d1fab7d8e9abaec532a8e67b5 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Fri, 27 Dec 2024 12:16:03 +0000 Subject: [PATCH 21/21] change to focus repo on games packages --- .github/dependabot.yml | 6 -- .github/workflows/build.yml | 58 ------------------- ci.nix | 53 ----------------- default.nix | 4 +- flake.lock | 8 +-- flake.nix | 28 +++++---- overlay.nix | 15 ----- .../digital-a-love-story/default.nix | 1 + .../digital-a-love-story/digital.desktop | 0 .../digital-a-love-story/launcher.sh | 0 .../dont-take-it-personally-babe/default.nix | 1 + ...tpersonallybabeitjustaintyourstory.desktop | 0 .../dont-take-it-personally-babe/launcher.sh | 0 13 files changed, 24 insertions(+), 150 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 ci.nix delete mode 100644 overlay.nix rename {pkgs => packages}/digital-a-love-story/default.nix (97%) rename {pkgs => packages}/digital-a-love-story/digital.desktop (100%) rename {pkgs => packages}/digital-a-love-story/launcher.sh (100%) rename {pkgs => packages}/dont-take-it-personally-babe/default.nix (96%) rename {pkgs => packages}/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop (100%) rename {pkgs => packages}/dont-take-it-personally-babe/launcher.sh (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 5ace460..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 082873a..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -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 {}).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/ci.nix b/ci.nix deleted file mode 100644 index 22b1352..0000000 --- a/ci.nix +++ /dev/null @@ -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 { } }: - -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; -} diff --git a/default.nix b/default.nix index c47929a..e287af0 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,6 @@ { pkgs ? import { } }: { - digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./pkgs/digital-a-love-story { }; - dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./pkgs/dont-take-it-personally-babe { }; + digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./packages/digital-a-love-story { }; + dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./packages/dont-take-it-personally-babe { }; } diff --git a/flake.lock b/flake.lock index 78cf35d..ad56595 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1712449641, - "narHash": "sha256-U9DDWMexN6o5Td2DznEgguh8TRIUnIl9levmit43GcI=", + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "600b15aea1b36eeb43833a50b0e96579147099ff", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 81a143f..f3bb530 100644 --- a/flake.nix +++ b/flake.nix @@ -1,22 +1,26 @@ { - description = "My personal NUR repository"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + description = "Freeware games by Christine Love"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + outputs = { self, nixpkgs }: let - systems = [ - "x86_64-linux" - "i686-linux" - "x86_64-darwin" - "aarch64-linux" - "armv6l-linux" - "armv7l-linux" - ]; - forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + systems = [ "x86_64-linux" "i686-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs systems; in { + packages = forAllSystems (system: import ./default.nix { + pkgs = nixpkgs.legacyPackages."${system}"; + }); + 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}); + + overlays.default = final: prev: { + scoutshonour = import ./default.nix { pkgs = final; }; + }; }; } diff --git a/overlay.nix b/overlay.nix deleted file mode 100644 index bff7396..0000000 --- a/overlay.nix +++ /dev/null @@ -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))) diff --git a/pkgs/digital-a-love-story/default.nix b/packages/digital-a-love-story/default.nix similarity index 97% rename from pkgs/digital-a-love-story/default.nix rename to packages/digital-a-love-story/default.nix index bf7e06b..657317e 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/packages/digital-a-love-story/default.nix @@ -64,5 +64,6 @@ stdenv.mkDerivation rec { description = "Digital: A Love Story, a freeware game by Christine Love"; license = licenses.cc-by-nc-sa-30; platforms = lists.intersectLists platforms.x86 platforms.linux; + mainProgram = "digital"; }; } diff --git a/pkgs/digital-a-love-story/digital.desktop b/packages/digital-a-love-story/digital.desktop similarity index 100% rename from pkgs/digital-a-love-story/digital.desktop rename to packages/digital-a-love-story/digital.desktop diff --git a/pkgs/digital-a-love-story/launcher.sh b/packages/digital-a-love-story/launcher.sh similarity index 100% rename from pkgs/digital-a-love-story/launcher.sh rename to packages/digital-a-love-story/launcher.sh diff --git a/pkgs/dont-take-it-personally-babe/default.nix b/packages/dont-take-it-personally-babe/default.nix similarity index 96% rename from pkgs/dont-take-it-personally-babe/default.nix rename to packages/dont-take-it-personally-babe/default.nix index 570ebe0..ad0d11b 100644 --- a/pkgs/dont-take-it-personally-babe/default.nix +++ b/packages/dont-take-it-personally-babe/default.nix @@ -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"; license = licenses.cc-by-nc-sa-30; platforms = lists.intersectLists platforms.x86 platforms.linux; + mainProgram = "donttakeitpersonallybabeitjustaintyourstory"; }; } diff --git a/pkgs/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop b/packages/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop similarity index 100% rename from pkgs/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop rename to packages/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop diff --git a/pkgs/dont-take-it-personally-babe/launcher.sh b/packages/dont-take-it-personally-babe/launcher.sh similarity index 100% rename from pkgs/dont-take-it-personally-babe/launcher.sh rename to packages/dont-take-it-personally-babe/launcher.sh