mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-11 20:43:00 +01:00
nix refators and additions
This commit is contained in:
parent
e4a38ac2e5
commit
cf913c62a0
13 changed files with 127 additions and 18 deletions
|
@ -1,5 +1,7 @@
|
|||
;<! tmpl:setPostProcessor(opt.fennelToJSON) !>
|
||||
;; vim: ft=fennel
|
||||
(local format-icons ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"])
|
||||
|
||||
{:spacing 4
|
||||
:layer :top
|
||||
;<! if opt.wayland_compositor == "river" then !>
|
||||
|
@ -8,6 +10,7 @@
|
|||
:modules-left [:hyprland/workspaces :hyprland/window]
|
||||
;<! end !>
|
||||
:modules-right [:mpris
|
||||
:cava
|
||||
:cpu
|
||||
:memory
|
||||
:pulseaudio
|
||||
|
@ -16,6 +19,11 @@
|
|||
:battery
|
||||
:clock
|
||||
:tray]
|
||||
:cava {:hide_on_silence true
|
||||
:bars 16
|
||||
:bar_delimiter 0
|
||||
:method :pipewire
|
||||
: format-icons}
|
||||
:mpris {:format "{status_icon} {dynamic}"
|
||||
:interval 5
|
||||
:dynamic-order [:title :artist :position :length]
|
||||
|
@ -29,8 +37,8 @@
|
|||
:format-alt "{:%Y-%m-%d}"}
|
||||
:cpu {:format (.. (faccumulate [s "" i 0 (- (cg.opt.system :nproc) 1)]
|
||||
(.. s "{icon" i "}")) " {usage}% ")
|
||||
:format-icons ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]
|
||||
:interval 2}
|
||||
:interval 2
|
||||
: format-icons}
|
||||
:memory {:format "{}% "}
|
||||
:temperature {:hwmon-path "<% opt.cpu_temp_hwmon %>"
|
||||
:critical-threshold 80
|
||||
|
|
|
@ -77,6 +77,17 @@ window#waybar.PCSX2 #window {
|
|||
background: @teal;
|
||||
}
|
||||
|
||||
#cava {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
transition: none;
|
||||
color: @sapphire;
|
||||
background: @surface0;
|
||||
}
|
||||
|
||||
#mpris {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
|
|
|
@ -5,6 +5,9 @@ Host aur.archlinux.org
|
|||
Host github.com
|
||||
UpdateHostKeys yes
|
||||
|
||||
Host mzte.de
|
||||
Port 22004
|
||||
|
||||
Host *
|
||||
HostKeyAlgorithms=+ssh-rsa
|
||||
PubkeyAcceptedKeyTypes +ssh-rsa
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1718160348,
|
||||
"narHash": "sha256-9YrUjdztqi4Gz8n3mBuqvCkMo4ojrA6nASwyIKWMpus=",
|
||||
"lastModified": 1718318537,
|
||||
"narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "57d6973abba7ea108bac64ae7629e7431e0199b6",
|
||||
"rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
19
flake.nix
19
flake.nix
|
@ -16,9 +16,11 @@
|
|||
common = base-pkgs.callPackage ./lib/common-nix { };
|
||||
|
||||
root-mod = { config, pkgs, ... }: {
|
||||
options.packages = nixpkgs.lib.mkOption { };
|
||||
options.dev-shells = nixpkgs.lib.mkOption { };
|
||||
options.nixpkgs.overlays = nixpkgs.lib.mkOption { default = []; };
|
||||
options.nixpkgs.overlays = nixpkgs.lib.mkOption { default = [ ]; };
|
||||
options.output = nixpkgs.lib.mkOption {
|
||||
default = { };
|
||||
type = with nixpkgs.lib.types; attrsOf anything;
|
||||
};
|
||||
|
||||
config._module.args = rec {
|
||||
pkgs = base-pkgs.appendOverlays config.nixpkgs.overlays;
|
||||
|
@ -28,7 +30,7 @@
|
|||
};
|
||||
|
||||
# devshell for the dotfiles
|
||||
config.dev-shells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||
config.output.devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
# packages required to build scripts
|
||||
|
@ -57,6 +59,10 @@
|
|||
"run-confgen"
|
||||
];
|
||||
};
|
||||
|
||||
config.output.mzteinit = base-pkgs.callPackage ./scripts/mzteinit/package.nix { };
|
||||
|
||||
config.output.overlay = final: prev: config.output.packages;
|
||||
};
|
||||
|
||||
modopt = nixpkgs.lib.evalModules {
|
||||
|
@ -64,10 +70,7 @@
|
|||
specialArgs = { inherit common; };
|
||||
};
|
||||
in
|
||||
{
|
||||
modopt.config.output // {
|
||||
config = modopt;
|
||||
mzteinit = base-pkgs.callPackage ./scripts/mzteinit/package.nix { };
|
||||
packages = modopt.config.packages;
|
||||
devShells = modopt.config.dev-shells;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ in
|
|||
|
||||
config.cgnix.entries."fennel.lua" = "${pkgs.luajitPackages.fennel}/share/lua/5.1/fennel.lua";
|
||||
|
||||
config.packages.cgnix = pkgs.writeTextFile {
|
||||
config.output.packages.cgnix = pkgs.writeTextFile {
|
||||
name = "nix.lua";
|
||||
text = ''
|
||||
return {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
imports = [
|
||||
./cgnix
|
||||
./pkgs
|
||||
./jdtls-bundles.nix
|
||||
./mcdev.nix
|
||||
./mzte-nix.nix
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config.packages.jdtls-bundles = pkgs.linkFarm "jdtls-bundles" [
|
||||
output.packages.jdtls-bundles = pkgs.linkFarm "jdtls-bundles" [
|
||||
{
|
||||
name = "java-debug.jar";
|
||||
path = pkgs.fetchurl {
|
||||
|
|
|
@ -19,7 +19,7 @@ let
|
|||
];
|
||||
in
|
||||
{
|
||||
dev-shells = builtins.mapAttrs
|
||||
output.devShells = builtins.mapAttrs
|
||||
(_: extra-pkgs:
|
||||
let
|
||||
shpgks = libs ++ xorg-libs ++ extra-pkgs;
|
||||
|
|
|
@ -45,7 +45,7 @@ in
|
|||
(flakePkg "github:zhaofengli/attic")
|
||||
];
|
||||
|
||||
config.packages.mzte-nix = pkgs.symlinkJoin {
|
||||
config.output.packages.mzte-nix = pkgs.symlinkJoin {
|
||||
name = "mzte-nix";
|
||||
paths = lib.concatMap (p: map (o: p.${o}) p.outputs) config.mzte-nix-packages;
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
})
|
||||
];
|
||||
|
||||
config.packages.nushell-plugins =
|
||||
config.output.packages.nushell-plugins =
|
||||
let
|
||||
pluginName = d: lib.removePrefix "nu-plugin-" d.name;
|
||||
in
|
||||
|
|
6
nix/pkgs/default.nix
Normal file
6
nix/pkgs/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./thumbnailers.nix
|
||||
];
|
||||
}
|
77
nix/pkgs/thumbnailers.nix
Normal file
77
nix/pkgs/thumbnailers.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
# A collection of tumbler-compatible thumbnailer scripts for:
|
||||
# - Text
|
||||
# - OpenSCAD and STL models
|
||||
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
mkThumbnailerEntry = { name, mime, exec }: pkgs.writeTextDir
|
||||
"share/thumbnailers/${name}.thumbnailer"
|
||||
''
|
||||
[Thumbnailer Entry]
|
||||
Version=1.0
|
||||
Encoding=UTF-8
|
||||
Type=X-Thumbnailer
|
||||
Name=${name}
|
||||
MimeType=${mime}
|
||||
Exec=${exec}
|
||||
'';
|
||||
in
|
||||
{
|
||||
# See https://docs.xfce.org/xfce/tumbler/available_plugins#customized_thumbnailer_for_text-based_documents
|
||||
output.packages.mzte-thumbnailer-text =
|
||||
let
|
||||
textthumb = pkgs.writeShellScript "textthumb" ''
|
||||
iFile=$(<"$1")
|
||||
tempFile=$(mktemp) && {
|
||||
echo "''${iFile:0:1600}" > "$tempFile"
|
||||
|
||||
${pkgs.imagemagick}/bin/convert \
|
||||
-size 210x290 \
|
||||
-background white \
|
||||
-pointsize 5 \
|
||||
-border 10x10 \
|
||||
-bordercolor "#CCC" \
|
||||
-font ${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf \
|
||||
caption:@"$tempFile" \
|
||||
"$2"
|
||||
|
||||
rm "$tempFile"
|
||||
}
|
||||
'';
|
||||
in
|
||||
mkThumbnailerEntry {
|
||||
name = "mzte-thumbnailer-text";
|
||||
mime = "text/plain;text/x-log;text/html;text/css;";
|
||||
exec = "${textthumb} %i %o";
|
||||
};
|
||||
|
||||
output.packages.mzte-thumbnailer-openscad =
|
||||
let
|
||||
scadthumb = pkgs.writeShellScript "scadthumb" ''
|
||||
${pkgs.openscad-unstable}/bin/openscad --imgsize "500,500" -o "$2" "$1" 2>/dev/null
|
||||
'';
|
||||
in
|
||||
mkThumbnailerEntry {
|
||||
name = "mzte-thumbnailer-openscad";
|
||||
mime = "application/x-openscad;";
|
||||
exec = "${scadthumb} %i %o";
|
||||
};
|
||||
|
||||
# See: https://docs.xfce.org/xfce/tumbler/available_plugins#customized_thumbnailer_for_stl_content
|
||||
output.packages.mzte-thumbnailer-stl =
|
||||
let
|
||||
stlthumb = pkgs.writeShellScript "stlthumb" ''
|
||||
if TEMP=$(mktemp --directory --tmpdir tumbler-stl-XXXXXX); then
|
||||
cp "$1" "$TEMP/source.stl"
|
||||
echo 'import("source.stl", convexity=10);' > "$TEMP/thumbnail.scad"
|
||||
${pkgs.openscad-unstable}/bin/openscad --imgsize "500,500" -o "$2" "$TEMP/thumbnail.scad" 2>/dev/null
|
||||
rm -rf $TEMP
|
||||
fi
|
||||
'';
|
||||
in
|
||||
mkThumbnailerEntry {
|
||||
name = "mzte-thumbnailer-stl";
|
||||
mime = "model/stl;";
|
||||
exec = "${stlthumb} %i %o";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue