feat: added images
This commit is contained in:
parent
36d225c0ea
commit
b237a21359
12
flake.lock
12
flake.lock
|
@ -36,12 +36,12 @@
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1695588239,
|
"dirtyRev": "da8fc11d2e83a7cdba24cfd43ca39bf866d0e56a-dirty",
|
||||||
"narHash": "sha256-FMeJBXADlrWqJlBCEkfsOz4b2yzjMUwAD0zYGkLhAXQ=",
|
"dirtyShortRev": "da8fc11-dirty",
|
||||||
"owner": "oddlama",
|
"lastModified": 1695737316,
|
||||||
"repo": "agenix-rekey",
|
"narHash": "sha256-WAZMw/HqNqaCRCx/DDPWzITDIV8ui9c3PaiTzxYPoTE=",
|
||||||
"rev": "e33d9479671a9e253790c8b2b09bbe3072ecf289",
|
"type": "git",
|
||||||
"type": "github"
|
"url": "file:///home/patrick/repos/nix/agenix-rekey"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "oddlama",
|
"owner": "oddlama",
|
||||||
|
|
BIN
img/mic.png.age
Normal file
BIN
img/mic.png.age
Normal file
Binary file not shown.
BIN
img/qr.png.age
Normal file
BIN
img/qr.png.age
Normal file
Binary file not shown.
|
@ -7,6 +7,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.stylix.nixosModules.stylix
|
inputs.stylix.nixosModules.stylix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
|
./images.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
stylix = {
|
stylix = {
|
||||||
|
|
65
modules/graphical/images.nix
Normal file
65
modules/graphical/images.nix
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit
|
||||||
|
(lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkMerge
|
||||||
|
attrNames
|
||||||
|
flip
|
||||||
|
filterAttrs
|
||||||
|
mkIf
|
||||||
|
mkOption
|
||||||
|
types
|
||||||
|
removeSuffix
|
||||||
|
hasPrefix
|
||||||
|
mapAttrs'
|
||||||
|
listToAttrs
|
||||||
|
;
|
||||||
|
in {
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{
|
||||||
|
options.images = {
|
||||||
|
enable = mkEnableOption "Enable images";
|
||||||
|
images = mkOption {
|
||||||
|
type = types.attrsOf types.path;
|
||||||
|
readOnly = true;
|
||||||
|
default = flip mapAttrs' (filterAttrs (n: _: hasPrefix "images-" n) config.age.secrets) (
|
||||||
|
name: value: {
|
||||||
|
inherit (value) name;
|
||||||
|
value = value.path;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
{
|
||||||
|
age.secrets = mkMerge (
|
||||||
|
flip map
|
||||||
|
(attrNames config.home-manager.users)
|
||||||
|
(
|
||||||
|
user:
|
||||||
|
mkIf config.home-manager.users.${user}.images.enable (
|
||||||
|
listToAttrs (flip map (attrNames (filterAttrs (_: type: type == "regular") (builtins.readDir ../../img)))
|
||||||
|
(
|
||||||
|
file: {
|
||||||
|
name = "images-${user}-${file}";
|
||||||
|
value = {
|
||||||
|
name = removeSuffix ".age" file;
|
||||||
|
rekeyFile = ../../img/${file};
|
||||||
|
owner = user;
|
||||||
|
group = user;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -16,9 +16,10 @@ lib.optionalAttrs (!minimal) {
|
||||||
age.secrets.secureboot.rekeyFile = ../../hosts/${config.node.name}/secrets/secureboot.tar.age;
|
age.secrets.secureboot.rekeyFile = ../../hosts/${config.node.name}/secrets/secureboot.tar.age;
|
||||||
system.activationScripts.securebootuntar = {
|
system.activationScripts.securebootuntar = {
|
||||||
text = ''
|
text = ''
|
||||||
rm -r /run/secureboot || true
|
rm -r /run/secureboot || true
|
||||||
mkdir -p /run/secureboot
|
mkdir -p /run/secureboot
|
||||||
${pkgs.gnutar}/bin/tar xf ${config.age.secrets.secureboot.path} -C /run/secureboot || true
|
chmod 700 /run/secureboot
|
||||||
|
${pkgs.gnutar}/bin/tar xf ${config.age.secrets.secureboot.path} -C /run/secureboot || true
|
||||||
'';
|
'';
|
||||||
deps = ["agenix"];
|
deps = ["agenix"];
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,7 +31,12 @@
|
||||||
${maim} | ${pkgs.xclip}/bin/xclip -selection clipboard -t image/png
|
${maim} | ${pkgs.xclip}/bin/xclip -selection clipboard -t image/png
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
"${cfg.modifier}+F10" =
|
"${cfg.modifier}+F10" = let
|
||||||
|
nsend = '' ${pkgs.libnotify}/bin/notify-send \
|
||||||
|
-h string:category:Screenshot\
|
||||||
|
-h string:image-path:"${config.images.images."qr.png"}" \
|
||||||
|
'';
|
||||||
|
in
|
||||||
"exec "
|
"exec "
|
||||||
+ toString (
|
+ toString (
|
||||||
pkgs.writeShellScript "clipboard-qr-screenshot" ''
|
pkgs.writeShellScript "clipboard-qr-screenshot" ''
|
||||||
|
@ -43,15 +48,15 @@
|
||||||
fi
|
fi
|
||||||
case "$return" in
|
case "$return" in
|
||||||
"0")
|
"0")
|
||||||
${pkgs.libnotify}/bin/notify-send -h string:category:"Screenshot" "Copied qr to clipboard"
|
${nsend} "Copied qr to clipboard"
|
||||||
${pkgs.xclip}/bin/xclip -selection clipboard -f <<< ''${qr%"''${qr##*[![:space:]]}"}
|
${pkgs.xclip}/bin/xclip -selection clipboard -f <<< ''${qr%"''${qr##*[![:space:]]}"}
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
"4")
|
"4")
|
||||||
${pkgs.libnotify}/bin/notify-send -h string:category:"Screenshot" "No qr found"
|
${nsend} "No qr found"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
${pkgs.libnotify}/bin/notify-send -h string:category:"Screenshot" "Failure scanning qr"
|
${nsend} "Failure scanning qr"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
''
|
''
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{config, ...}: {
|
||||||
programs.streamdeck-ui = {
|
programs.streamdeck-ui = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -12,7 +12,8 @@
|
||||||
# keyInput to press
|
# keyInput to press
|
||||||
keys = "F7";
|
keys = "F7";
|
||||||
# Text shown on button
|
# Text shown on button
|
||||||
text = "mute";
|
#text = "mute";
|
||||||
|
icon = config.images.images."mic.png";
|
||||||
# Text position
|
# Text position
|
||||||
text_vertical_align = "middle-bottom";
|
text_vertical_align = "middle-bottom";
|
||||||
};
|
};
|
||||||
|
@ -21,14 +22,6 @@
|
||||||
text = "deafen";
|
text = "deafen";
|
||||||
text_vertical_align = "middle-bottom";
|
text_vertical_align = "middle-bottom";
|
||||||
};
|
};
|
||||||
"7" = {
|
|
||||||
# background picture
|
|
||||||
icon = "/home/patrick/ms.jpg";
|
|
||||||
# command to execute on press
|
|
||||||
command = "echo lol";
|
|
||||||
# background fill colour
|
|
||||||
background_color = "#000000";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
brightness = 99; # brighness value between 0 and 99
|
brightness = 99; # brighness value between 0 and 99
|
||||||
|
|
|
@ -33,7 +33,12 @@ lib.optionalAttrs (!minimal) {
|
||||||
# xournalpp needs this or else it will crash
|
# xournalpp needs this or else it will crash
|
||||||
gnome3.adwaita-icon-theme
|
gnome3.adwaita-icon-theme
|
||||||
];
|
];
|
||||||
age.secrets.smb-creds.rekeyFile = ../../secrets/smb.cred.age;
|
age.secrets = {
|
||||||
|
smb-creds = {
|
||||||
|
owner = "patrick";
|
||||||
|
rekeyFile = ../../secrets/smb.cred.age;
|
||||||
|
};
|
||||||
|
};
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
home-manager.users.patrick = {
|
home-manager.users.patrick = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
|
images.enable = true;
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
nextcloud-client
|
nextcloud-client
|
||||||
|
|
Loading…
Reference in a new issue