Restructures for nix packaging.

This commit is contained in:
Bailey Stevens 2023-10-04 06:43:37 -04:00
parent f29fc5acc1
commit 2097785400
13 changed files with 96 additions and 17 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
result

19
default.nix Normal file
View File

@ -0,0 +1,19 @@
{writeShellApplication, stdenv, puredata, xset}:
let
runsh = writeShellApplication {
name = "phyzzy";
runtimeInputs = [ puredata ];
text = (builtins.readFile ./scripts/run.sh);
};
in
stdenv.mkDerivation {
pname = "phyzzy";
version = "2023.0";
src = ./pd;
installPhase = ''
mkdir $out
cp -r . $out/pd
cp -r ${runsh}/bin $out
'';
}

61
flake.lock Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1696325386,
"narHash": "sha256-ogs73SJAIePd7bljq1i1vKEOPn23Xe8aumMJKZjV45c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e2b8feae8470705c3f331901ae057da3095cea10",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

12
flake.nix Normal file
View File

@ -0,0 +1,12 @@
{
description = "A basic flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
packages.default = (pkgs.callPackage ./default.nix {});
});
}

View File

View File

17
run.sh
View File

@ -1,17 +0,0 @@
#!/bin/sh
HERE=$(realpath $(dirname $0))
PIDFILE=$(mktemp -p /tmp --suffix .pdrun)
xset -dpms
xset s off
pd -midiindev 1 $@ -open $HERE/funsy.pd & echo $! > $PIDFILE
trap "{ EXITCODE=$?; rm -f $PIDFILE ; exit $EXITCODE; }" EXIT
sleep 1
#aconnect 'Keyboard' 'Pure Data'
aconnect 'MPKmini2' 'Pure Data'
wait $(<$PIDFILE)
xset s on
xset +dpms

3
scripts/run.sh Executable file
View File

@ -0,0 +1,3 @@
# Launch script.
PDPATH=${PDPATH:-"$(dirname "$0")/../pd"}
pd -noprefs -midiindev 1 "$@" -open "$PDPATH/0.main.pd"