Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2024-11-19 10:31:29 +01:00
parent a3187e163d
commit 900f95169f
83 changed files with 1134 additions and 705 deletions

View file

@ -1,17 +1,18 @@
{ lib
, stdenv
, fetchurl
, makeWrapper
, cups
, dpkg
, a2ps
, ghostscript
, gnugrep
, gnused
, coreutils
, file
, perl
, which
{
lib,
stdenv,
fetchurl,
makeWrapper,
cups,
dpkg,
a2ps,
ghostscript,
gnugrep,
gnused,
coreutils,
file,
perl,
which,
}:
stdenv.mkDerivation rec {
@ -27,7 +28,12 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ cups ghostscript dpkg a2ps ];
buildInputs = [
cups
ghostscript
dpkg
a2ps
];
dontUnpack = true;
@ -55,9 +61,14 @@ stdenv.mkDerivation rec {
; do
#substituteInPlace $f \
wrapProgram $f \
--prefix PATH : ${lib.makeBinPath [
coreutils ghostscript gnugrep gnused
]}
--prefix PATH : ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
]
}
done
mkdir -p $out/lib/cups/filter/
@ -67,7 +78,17 @@ stdenv.mkDerivation rec {
ln -s $out/opt/brother/Printers/DCPL2530DW/cupswrapper/brother-DCPL2530DW-cups-en.ppd $out/share/cups/model/
wrapProgram $out/opt/brother/Printers/DCPL2530DW/lpd/lpdfilter \
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused gnugrep coreutils which ] }
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
a2ps
file
gnused
gnugrep
coreutils
which
]
}
'';
meta = with lib; {
@ -79,4 +100,3 @@ stdenv.mkDerivation rec {
downloadPage = "https://www.brother.de/support/dcp-l2530dw/downloads";
};
}

View file

@ -1,11 +1,12 @@
{ lib
, writeText
, writeShellApplication
, substituteAll
, gum
, inputs
, hosts ? { }
, ...
{
lib,
writeText,
writeShellApplication,
substituteAll,
gum,
inputs,
hosts ? { },
...
}:
let
@ -14,9 +15,7 @@ let
substitute = args: builtins.readFile (substituteAll args);
formatted-hosts = mapAttrsToList
(name: host: "${name},${host.pkgs.system}")
hosts;
formatted-hosts = mapAttrsToList (name: host: "${name},${host.pkgs.system}") hosts;
hosts-csv = writeText "hosts.csv" ''
Name,System
@ -35,9 +34,7 @@ let
checkPhase = "";
runtimeInputs = [
gum
];
runtimeInputs = [ gum ];
};
new-meta = with lib; {

View file

@ -1,7 +1,8 @@
{ pkgs
, lib
, gitHostCommitUrl ? "https://git.hoyer.xyz/harald/nixcfg/commit"
, ...
{
pkgs,
lib,
gitHostCommitUrl ? "https://git.hoyer.xyz/harald/nixcfg/commit",
...
}:
let
@ -13,61 +14,60 @@ let
maintainers = with maintainers; [ jakehamilton ];
};
package =
pkgs.writeShellScriptBin "nixos-revision" ''
HAS_HELP=false
HAS_OPEN=false
package = pkgs.writeShellScriptBin "nixos-revision" ''
HAS_HELP=false
HAS_OPEN=false
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
HAS_HELP=true
shift
;;
-o|--open)
HAS_OPEN=true
shift
;;
*)
shift
;;
esac
done
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
HAS_HELP=true
shift
;;
-o|--open)
HAS_OPEN=true
shift
;;
*)
shift
;;
esac
done
if [ $HAS_HELP == true ]; then
HELP_MSG="
nixos-revision
if [ $HAS_HELP == true ]; then
HELP_MSG="
nixos-revision
USAGE
USAGE
nixos-revision [options]
nixos-revision [options]
OPTIONS
OPTIONS
-h, --help Show this help message
-o, --open Open the revision on GitHub
-h, --help Show this help message
-o, --open Open the revision on GitHub
EXAMPLES
EXAMPLES
$ # Print the current revision
$ nixos-revision
$ # Print the current revision
$ nixos-revision
$ # Open the current revision on GitHub
$ nixos-revision --open
"
echo "$HELP_MSG"
exit 0
fi
$ # Open the current revision on GitHub
$ nixos-revision --open
"
echo "$HELP_MSG"
exit 0
fi
REVISION=$(nixos-version --json | ${pkgs.jq}/bin/jq -r .configurationRevision)
REVISION=$(nixos-version --json | ${pkgs.jq}/bin/jq -r .configurationRevision)
if [ $HAS_OPEN == true ]; then
GITHUB_URL="${gitHostCommitUrl}/$REVISION"
echo "Opening URL: $GITHUB_URL"
${pkgs.xdg-utils}/bin/xdg-open $GITHUB_URL
else
echo $REVISION
fi
'';
if [ $HAS_OPEN == true ]; then
GITHUB_URL="${gitHostCommitUrl}/$REVISION"
echo "Opening URL: $GITHUB_URL"
${pkgs.xdg-utils}/bin/xdg-open $GITHUB_URL
else
echo $REVISION
fi
'';
in
override-meta new-meta package

View file

@ -1,8 +1,9 @@
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, ...
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
...
}:
rustPlatform.buildRustPackage rec {
pname = "rot8000";