Compare commits

...

6 commits

Author SHA1 Message Date
Christoph Heiss 17a05c88db
pkgs: neomutt-export-patches: convert to new buildPerlApplication helper
All checks were successful
flake / build (push) Successful in 3m1s
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-22 21:02:35 +02:00
Christoph Heiss d51b5ab8f9
pkgs: deploy-sink: convert to new buildPerlApplication helper
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-22 21:00:06 +02:00
Christoph Heiss fa12895af3
pkgs: automation-shell: convert to new buildPerlApplication helper
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-22 20:55:42 +02:00
Christoph Heiss ae13670a64
flake: add custom lib with initial perl application builder
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-22 20:49:43 +02:00
Christoph Heiss 8b45301ab9
secrets: tank: update something
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-22 20:10:31 +02:00
Christoph Heiss efef37f22f
home-manager: desktop: move fontconfig file into common attrset
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-22 20:10:03 +02:00
10 changed files with 74 additions and 93 deletions

View file

@ -1,8 +1,3 @@
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Interactive qw(is_interactive);
die "hi, no interactive shell allowed here :)\n" if is_interactive();

View file

@ -1,8 +1,3 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Archive::Tar;
use File::Find qw(finddepth);
use File::Temp;

View file

@ -1,8 +1,3 @@
#!/usr/bin/env perl
use strict;
use warnings;
use JSON qw(from_json);
use File::Temp;
use File::Path qw(make_path);

View file

@ -67,7 +67,10 @@
, sops-nix, lix-module, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs = import nixpkgs {
inherit system;
overlays = [ (import ./lib) ];
};
inherit (pkgs) lib;
inherit (flake-utils.lib) mkApp;
@ -145,6 +148,7 @@
packages = (import ./pkgs) null pkgs;
}) // (let
overlays = [
(nixpkgs.lib.composeManyExtensions [ (import ./lib) ])
(import ./pkgs)
(self: super: {
vimPlugins = super.vimPlugins

31
lib/default.nix Normal file
View file

@ -0,0 +1,31 @@
_:
{ lib, writeTextFile, perl, perlPackages, ... }:
{
c8h4.buildPerlApplication = { name, text, perlInputs ? (_: [ ])
, runtimeInputs ? [ ], derivationArgs ? { } }:
writeTextFile {
inherit name derivationArgs;
executable = true;
destination = "/bin/${name}";
checkPhase = ''
runHook preCheck
${lib.getExe perlPackages.PerlCritic} $target
runHook postCheck
'';
text = ''
#!${lib.getExe (perl.withPackages perlInputs)}
use strict;
use warnings;
$ENV{PATH} = "${lib.makeBinPath runtimeInputs}:$ENV{PATH}";
${text}
'';
meta.mainProgram = name;
};
}

View file

@ -1,23 +1,10 @@
{ stdenv, perl, sudo }:
{ c8h4, sudo }:
let src = ../extra/bin/automation-shell.pl;
in stdenv.mkDerivation {
pname = "automation-shell";
version = "0.1";
dontUnpack = true;
c8h4.buildPerlApplication {
name = "automation-shell";
runtimeInputs = [ sudo ];
perlInputs = p: with p; [ IOInteractive ];
text = builtins.readFile ../extra/bin/automation-shell.pl;
doCheck = true;
checkInputs = [ (perl.withPackages (p: with p; [ PerlCritic ])) ];
checkPhase = ''
perlcritic ${src}
'';
buildInputs = [ (perl.withPackages (p: with p; [ IOInteractive ])) sudo ];
postInstall = ''
mkdir -p $out/bin
install -Dm755 ${src} $out/bin/automation-shell
'';
passthru.shellPath = "/bin/automation-shell";
derivationArgs.passthru.shellPath = "/bin/automation-shell";
}

View file

@ -1,23 +1,10 @@
{ stdenv, perl, rsync }:
{ c8h4, rsync }:
let src = ../extra/bin/deploy-sink.pl;
in stdenv.mkDerivation {
pname = "deploy-sink";
version = "0.1";
dontUnpack = true;
c8h4.buildPerlApplication {
name = "deploy-sink";
runtimeInputs = [ rsync ];
perlInputs = p: with p; [ IOInteractive ];
text = builtins.readFile ../extra/bin/deploy-sink.pl;
doCheck = true;
checkInputs = [ (perl.withPackages (p: with p; [ PerlCritic ])) ];
checkPhase = ''
perlcritic ${src}
'';
buildInputs = [ (perl.withPackages (p: with p; [ IOInteractive ])) rsync ];
postInstall = ''
mkdir -p $out/bin
install -Dm755 ${src} $out/bin/deploy-sink
'';
passthru.shellPath = "/bin/deploy-sink";
derivationArgs.passthru.shellPath = "/bin/deploy-sink";
}

View file

@ -1,21 +1,8 @@
{ stdenv, perl, notmuch }:
{ c8h4, notmuch }:
let src = ../extra/bin/neomutt-export-patches.pl;
in stdenv.mkDerivation rec {
pname = "neomutt-export-patches";
version = "0.1";
dontUnpack = true;
doCheck = true;
checkInputs = [ (perl.withPackages (p: with p; [ PerlCritic ])) ];
checkPhase = ''
perlcritic ${src}
'';
buildInputs = [ (perl.withPackages (p: with p; [ IPCRun3 JSON ])) notmuch ];
postInstall = ''
mkdir -p $out/bin
install -Dm755 ${src} $out/bin/${pname}
'';
c8h4.buildPerlApplication {
name = "neomutt-export-patches";
runtimeInputs = [ notmuch ];
perlInputs = p: with p; [ IPCRun3 JSON ];
text = builtins.readFile ../extra/bin/neomutt-export-patches.pl;
}

Binary file not shown.

View file

@ -73,24 +73,6 @@ in {
};
};
xdg.configFile."fontconfig/no-ligatures.conf".text = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Disable ligatures for monospaced fonts</description>
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Jetbrains Mono</string>
</test>
<edit name="fontfeatures" mode="append">
<string>liga off</string>
<string>dlig off</string>
<string>calt off</string>
</edit>
</match>
</fontconfig>
'';
programs.git = {
enable = true;
package = pkgs.gitFull;
@ -339,6 +321,24 @@ in {
};
xdg.configFile = {
"fontconfig/no-ligatures.conf".text = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Disable ligatures for monospaced fonts</description>
<match target="font">
<test name="spacing" compare="eq" ignore-blanks="true">
<string>100</string>
</test>
<edit name="fontfeatures" mode="append">
<string>liga off</string>
<string>dlig off</string>
<string>calt off</string>
<string>clig off</string>
</edit>
</match>
</fontconfig>
'';
"latexmk/latexmkrc".text = ''
$pdf_previewer = '${pkgs.zathura}/bin/zathura';
$latex = 'latex -interaction=nonstopmode';