WIP: rice

This commit is contained in:
Filippo Berto 2024-10-21 12:27:32 +02:00
parent f842c92339
commit 1096479c4a
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
14 changed files with 81 additions and 32 deletions

View file

@ -1,9 +0,0 @@
{ stdenv, autoPatchelfHook, ... }:
stdenv.mkDerivation rec {
name = "cocktail-bar-cli";
version = "1.0";
src = /home/bertof/Documenti/Security/NPI/cli/cocktail-bar-cli;
dontUnpack = true;
nativeBuildInputs = [ autoPatchelfHook ];
installPhase = "install -m755 -D ${src} $out/bin/cocktail-bar-cli";
}

View file

@ -52,6 +52,11 @@
_module.args.pkgs = import inputs.nixpkgs { _module.args.pkgs = import inputs.nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
overlays = [
inputs.nix-rice.overlays.default
# inputs.self.overlays.rice.default
# inputs.self.overlays.packages
];
}; };
pre-commit.settings.hooks = { pre-commit.settings.hooks = {
@ -67,9 +72,61 @@
}; };
formatter = pkgs.nixpkgs-fmt; formatter = pkgs.nixpkgs-fmt;
packages = {
inherit
(pkgs)
clipedit
keyboard-switch
# lockscreen
# ssdm-sugar-dark
# ssdm-theme-clairvoyance
# update-background
# wl-clipedit
# wl-lockscreen
# wl-update-background
;
};
}; };
flake = { }; flake = {
overlays = {
default = inputs.self.overlays.packages;
rice = import ./rice.nix;
packages = self: _super: {
clipedit = self.callPackage ./pkgs/clipedit { };
keyboard-switch = self.callPackage ./pkgs/keyboard-switch { };
lockscreen = self.callPackage ./pkgs/lockscreen { };
ssdm-sugar-dark = self.callPackage ./pkgs/ssdm-sugar-dark { };
ssdm-theme-clairvoyance = self.callPackage ./pkgs/ssdm-theme-clairvoyance { };
update-background = self.callPackage ./pkgs/update-background { };
wl-clipedit = self.callPackage ./pkgs/wl-clipedit { };
wl-lockscreen = self.callPackage ./pkgs/wl-lockscreen { };
wl-update-background = self.callPackage ./pkgs/wl-update-background { };
};
overrides = self: super: {
google-chrome = super.google-chrome.override { commandLineArgs = [ "--password-store=gnome" "--force-dark-mode" ]; };
sddm-theme-clairvoyance = self.callPackage ./custom/sddm-theme-clairvoyance { wallpaper = ./wallpapers/background.jpg; };
way-lockscreen = self.callPackage ./custom/way-lockscreen { palette = self.rice.colorPalette; font = self.rice.font.normal; };
};
# two-channels = (self: _: {
# stable_pkgs = import inputs.nixpkgs {
# inherit config overlays;
# inherit (self) system;
# };
# unstable_pkgs = import inputs.nixpkgs-u {
# inherit config overlays;
# inherit (self) system;
# };
# });
};
};
}; };
} }

View file

@ -26,7 +26,7 @@
swaylock swaylock
swww swww
# walker # walker
way-lockscreen wl-lockscreen
waybar waybar
wl-clipboard wl-clipboard
wl-clipedit wl-clipedit
@ -211,7 +211,7 @@
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = SUPER, RETURN, exec, kitty bind = SUPER, RETURN, exec, kitty
bind = SUPER, W, killactive, bind = SUPER, W, killactive,
bind = SUPER, M, exec, way-lockscreen bind = SUPER, M, exec, wl-lockscreen
bind = SUPER_ALT_L, Q, exit, bind = SUPER_ALT_L, Q, exit,
bind = SUPER, E, exec, nautilus bind = SUPER, E, exec, nautilus
bind = SUPER, L, exec, env -u WAYLAND_DISPLAY logseq bind = SUPER, L, exec, env -u WAYLAND_DISPLAY logseq

View file

@ -1,20 +1,5 @@
{ pkgs, ... }: { pkgs, ... }: {
let home.packages = [ pkgs.wl-update-background ];
update_time = "10m";
backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+";
update_script = pkgs.writeShellScriptBin "wl-update-background" ''
set -e
if [ $# -eq 0 ]; then
image=`${pkgs.findutils}/bin/find ${backgrounds_directory} -type f | ${pkgs.gnugrep}/bin/grep -v "/\." | ${pkgs.coreutils}/bin/shuf -n 1`
else
image="$1"
fi
echo "image: $image"
${pkgs.swww}/bin/swww img "$image"
'';
in
{
home.packages = [ update_script ];
systemd.user.services."wl-update-background" = { systemd.user.services."wl-update-background" = {
Unit = { Unit = {
@ -29,7 +14,7 @@ in
Service = { Service = {
Type = "oneshot"; Type = "oneshot";
IOSchedulingClass = "idle"; IOSchedulingClass = "idle";
ExecStart = "${update_script}/bin/wl-update-background"; ExecStart = "${pkgs.wl-update-background}/bin/wl-update-background";
}; };
}; };
@ -38,7 +23,7 @@ in
Description = "Set random desktop background using swww"; Description = "Set random desktop background using swww";
}; };
Timer = { Timer = {
OnUnitActiveSec = update_time; OnUnitActiveSec = "10m";
}; };
Install = { Install = {
WantedBy = [ "timers.target" ]; WantedBy = [ "timers.target" ];

View file

@ -14,7 +14,7 @@
let let
strPalette = lib.nix-rice.palette.toRgbaShortHex palette; strPalette = lib.nix-rice.palette.toRgbaShortHex palette;
in in
writeScriptBin "way-lockscreen" '' writeScriptBin "wl-lockscreen" ''
# Using font package ${font.package} # Using font package ${font.package}
${swaylock}/bin/swaylock \ ${swaylock}/bin/swaylock \
--color "${strPalette.primary.background}" \ --color "${strPalette.primary.background}" \

View file

@ -0,0 +1,16 @@
{ findutils
, gnugrep
, coreutils
, writeShellScriptBin
, swww
, backgrounds_directory ? "$HOME/Immagini/Sfondi/1080+/1440+"
}: writeShellScriptBin "wl-update-background" ''
set -e
if [ $# -eq 0 ]; then
image=`${findutils}/bin/find ${backgrounds_directory} -type f | ${gnugrep}/bin/grep -v "/\." | ${coreutils}/bin/shuf -n 1`
else
image="$1"
fi
echo "image: $image"
${swww}/bin/swww img "$image"
''