Compare commits
2 Commits
579cd749a9
...
fc32cf76ea
| Author | SHA1 | Date | |
|---|---|---|---|
| fc32cf76ea | |||
| b5b05ac620 |
@@ -72,7 +72,7 @@ in
|
||||
enable = true;
|
||||
|
||||
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
||||
dockerCompat = true;
|
||||
dockerCompat = false;
|
||||
|
||||
# Required for containers under podman-compose to be able to talk to each other.
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
@@ -82,6 +82,8 @@ in
|
||||
# Configure console keymap
|
||||
console.keyMap = "de-latin1";
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
strongswan
|
||||
@@ -89,6 +91,7 @@ in
|
||||
dive
|
||||
podman-tui
|
||||
podman-compose
|
||||
docker-compose
|
||||
gmp
|
||||
gmp.dev
|
||||
pkg-config
|
||||
@@ -109,6 +112,7 @@ in
|
||||
appimage-run
|
||||
libgcrypt
|
||||
libxcrypt
|
||||
rclone
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,46 +1,48 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
profile = import ../profile.nix;
|
||||
profile = import ../profile.nix;
|
||||
in
|
||||
{
|
||||
|
||||
imports = [
|
||||
./file-system.nix
|
||||
./media.nix
|
||||
./security/keyring.nix
|
||||
];
|
||||
imports = [
|
||||
./file-system.nix
|
||||
./media.nix
|
||||
./security/keyring.nix
|
||||
./printer.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnumake
|
||||
python3
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
[
|
||||
gnumake
|
||||
python3
|
||||
]
|
||||
++ lib.optionals profile.modules.development [
|
||||
cmake
|
||||
cmakeCurses
|
||||
cmake
|
||||
cmakeCurses
|
||||
|
||||
# C/C++/Fortran tools
|
||||
gcc
|
||||
clang
|
||||
# C/C++/Fortran tools
|
||||
gcc
|
||||
clang
|
||||
|
||||
# Common C based dependencies
|
||||
eigen
|
||||
# Common C based dependencies
|
||||
eigen
|
||||
|
||||
# Ada/+Spark & Rust tools
|
||||
alire
|
||||
gnat15
|
||||
gnat15Packages.gprbuild
|
||||
gnat15Packages.gpr2
|
||||
gnat15Packages.gnatprove
|
||||
gnat15Packages.gnatcoll-core
|
||||
gnat15Packages.gnatcoll-readline
|
||||
gnat15Packages.gnatcoll-python3
|
||||
gnat15Packages.gnatcoll-gmp
|
||||
rustc
|
||||
cargo
|
||||
# Ada/+Spark & Rust tools
|
||||
alire
|
||||
gnat15
|
||||
gnat15Packages.gprbuild
|
||||
gnat15Packages.gpr2
|
||||
gnat15Packages.gnatprove
|
||||
gnat15Packages.gnatcoll-core
|
||||
gnat15Packages.gnatcoll-readline
|
||||
gnat15Packages.gnatcoll-python3
|
||||
gnat15Packages.gnatcoll-gmp
|
||||
rustc
|
||||
cargo
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
};
|
||||
|
||||
environment.variables = {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
185
system-environment/printer.nix
Normal file
185
system-environment/printer.nix
Normal file
@@ -0,0 +1,185 @@
|
||||
# Optional stuff to add to profile:
|
||||
# add your user to scanner/lp groups if needed:
|
||||
# users.users.<name>.extraGroups = [ "scanner" "lp" ];
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
##########################################################################
|
||||
# Printing
|
||||
##########################################################################
|
||||
|
||||
services.printing = {
|
||||
enable = true;
|
||||
|
||||
# Driver collection
|
||||
drivers = with pkgs; [
|
||||
gutenprint
|
||||
hplip
|
||||
brlaser
|
||||
|
||||
# Canon inkjet support
|
||||
cnijfilter2
|
||||
|
||||
# Generic IPP/AirPrint support
|
||||
cups-filters
|
||||
];
|
||||
|
||||
# Network printer discovery
|
||||
browsing = true;
|
||||
defaultShared = false;
|
||||
|
||||
listenAddresses = [ "*:631" ];
|
||||
allowFrom = [ "all" ];
|
||||
};
|
||||
|
||||
# Avahi/mDNS for automatic printer discovery
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
|
||||
publish = {
|
||||
enable = true;
|
||||
userServices = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Scanner discovery over network
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
|
||||
extraBackends = with pkgs; [
|
||||
sane-airscan
|
||||
brscan4
|
||||
epson-escpr
|
||||
];
|
||||
};
|
||||
|
||||
# Enable sane daemon
|
||||
services.saned.enable = true;
|
||||
|
||||
# Some Brother scanners need this
|
||||
environment.etc."sane.d/dll.d/brother".text = ''
|
||||
brother4
|
||||
'';
|
||||
|
||||
##########################################################################
|
||||
# OCR / PDF / Document Processing
|
||||
##########################################################################
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
######################################################################
|
||||
# Printing / scanning GUI tools
|
||||
######################################################################
|
||||
|
||||
system-config-printer
|
||||
simple-scan
|
||||
xsane
|
||||
sane-airscan
|
||||
|
||||
######################################################################
|
||||
# OCR
|
||||
######################################################################
|
||||
|
||||
tesseract
|
||||
tesseract4
|
||||
ocrmypdf
|
||||
|
||||
######################################################################
|
||||
# PDF tools
|
||||
######################################################################
|
||||
|
||||
poppler-utils
|
||||
pdftk
|
||||
qpdf
|
||||
pdfcpu
|
||||
mupdf
|
||||
|
||||
######################################################################
|
||||
# Image processing
|
||||
######################################################################
|
||||
|
||||
graphicsmagick
|
||||
|
||||
######################################################################
|
||||
# EPUB / HTML / Markdown / TeX conversions
|
||||
######################################################################
|
||||
|
||||
pandoc
|
||||
|
||||
######################################################################
|
||||
# Extra document tooling
|
||||
######################################################################
|
||||
|
||||
ghostscript
|
||||
djvulibre
|
||||
unoconv
|
||||
|
||||
######################################################################
|
||||
# CLI helpers
|
||||
######################################################################
|
||||
|
||||
file
|
||||
ripgrep
|
||||
fd
|
||||
jq
|
||||
];
|
||||
|
||||
##########################################################################
|
||||
# Firewall
|
||||
##########################################################################
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
631 # CUPS / IPP
|
||||
];
|
||||
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
5353 # mDNS / Avahi
|
||||
];
|
||||
|
||||
##########################################################################
|
||||
# Helpful shell aliases
|
||||
##########################################################################
|
||||
|
||||
environment.shellAliases = {
|
||||
|
||||
# Find printers/scanners
|
||||
printers = "lpstat -e";
|
||||
scanner-find = "scanimage -L";
|
||||
|
||||
# OCR examples
|
||||
ocr-pdf = "ocrmypdf";
|
||||
ocr-img = "tesseract";
|
||||
|
||||
# Convert markdown -> pdf
|
||||
md2pdf = "pandoc -o output.pdf";
|
||||
|
||||
# Convert epub -> pdf
|
||||
epub2pdf = "ebook-convert";
|
||||
|
||||
# Convert pdf -> text
|
||||
pdf2txt = "pdftotext";
|
||||
|
||||
# Scan one page
|
||||
scan-one = ''
|
||||
scanimage --format=png > scan.png
|
||||
'';
|
||||
|
||||
# Continuous scans until CTRL+C
|
||||
scan-loop = ''
|
||||
while true; do
|
||||
TS=$(date +%s)
|
||||
scanimage --format=png > scan-$TS.png
|
||||
echo "scanned: scan-$TS.png"
|
||||
sleep 1
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user