Custom packages

This commit is contained in:
Filippo Berto 2024-10-21 15:57:23 +02:00
parent 1096479c4a
commit 3286c02857
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
8 changed files with 122 additions and 229 deletions

173
flake.lock generated
View file

@ -116,27 +116,11 @@
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
@ -163,6 +147,24 @@
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1727826117,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_3"
@ -181,24 +183,6 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat_3",
@ -220,6 +204,27 @@
"type": "github"
}
},
"git-hooks-nix_2": {
"inputs": {
"flake-compat": "flake-compat_4",
"gitignore": "gitignore_2",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1729104314,
"narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@ -245,16 +250,16 @@
"inputs": {
"nixpkgs": [
"nix-rice",
"pre-commit-hooks",
"git-hooks-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
@ -343,22 +348,24 @@
},
"nix-rice": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_2",
"flake-parts": "flake-parts_2",
"git-hooks-nix": "git-hooks-nix_2",
"kitty-themes-src": "kitty-themes-src",
"nixpkgs-lib": "nixpkgs-lib_2",
"pre-commit-hooks": "pre-commit-hooks"
"nixpkgs": "nixpkgs_3",
"nixpkgs-lib": "nixpkgs-lib_3",
"systems": "systems_4"
},
"locked": {
"lastModified": 1682952592,
"narHash": "sha256-1qXvqCxnWpk0ELdpmS2OMDu047gvl166CGBm+sfi8oo=",
"lastModified": 1729514200,
"narHash": "sha256-rrzFumYWlFwjUs1uSmsOgBzqWxDysaRbFj4Wh9paVLc=",
"owner": "bertof",
"repo": "nix-rice",
"rev": "dddd03ed3c5e05c728b0df985f7af905b002f588",
"rev": "9e5da4fa06a0c9a7300d70266660136cc08b81bf",
"type": "github"
},
"original": {
"owner": "bertof",
"ref": "modules",
"repo": "nix-rice",
"type": "github"
}
@ -443,6 +450,18 @@
}
},
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1727825735,
"narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
}
},
"nixpkgs-lib_3": {
"locked": {
"lastModified": 1681001314,
"narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=",
@ -475,16 +494,16 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1678872516,
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
@ -507,21 +526,36 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1681303793,
"narHash": "sha256-JEdQHsYuCfRL2PICHlOiH/2ue3DwoxUX7DJ6zZxZXFk=",
"lastModified": 1719082008,
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fe2ecaf706a5907b5e54d979fbde4924d84b65fc",
"rev": "9693852a2070b398ee123a329e68f0dab5526681",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1729513907,
"narHash": "sha256-8GPcBG0bgfyzJbZUg/lsrDnQQxUzIaFlmDYs91RoliU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "100330689f72eaebdc8f9596f380e4fa6224e298",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1729357638,
"narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
@ -537,31 +571,6 @@
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_5",
"flake-utils": [
"nix-rice",
"flake-utils"
],
"gitignore": "gitignore_2",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1682596858,
"narHash": "sha256-Hf9XVpqaGqe/4oDGr30W8HlsWvJXtMsEPHDqHZA6dDg=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "fb58866e20af98779017134319b5663b8215d912",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@ -575,7 +584,7 @@
"nix-rice": "nix-rice",
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"nixpkgs-u": "nixpkgs-u",
"systems": "systems_5"
}

View file

@ -26,7 +26,7 @@
};
};
flake-utils.url = "github:numtide/flake-utils";
nix-rice.url = "github:bertof/nix-rice";
nix-rice.url = "github:bertof/nix-rice/modules";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs = {
@ -55,7 +55,7 @@
overlays = [
inputs.nix-rice.overlays.default
# inputs.self.overlays.rice.default
# inputs.self.overlays.packages
inputs.self.overlays.packages
];
};
@ -76,15 +76,12 @@
packages = {
inherit
(pkgs)
clipedit
keyboard-switch
# lockscreen
# ssdm-sugar-dark
# ssdm-theme-clairvoyance
# update-background
# wl-clipedit
# wl-lockscreen
# wl-update-background
sddm-sugar-dark
sddm-theme-clairvoyance
wl-clipedit
wl-lockscreen
wl-update-background
;
};
};
@ -96,12 +93,9 @@
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 { };
sddm-sugar-dark = self.callPackage ./pkgs/sddm-sugar-dark { };
sddm-theme-clairvoyance = self.callPackage ./pkgs/sddm-theme-clairvoyance { };
wl-clipedit = self.callPackage ./pkgs/wl-clipedit { };
wl-lockscreen = self.callPackage ./pkgs/wl-lockscreen { };
wl-update-background = self.callPackage ./pkgs/wl-update-background { };

View file

@ -1,22 +0,0 @@
{ writeShellScriptBin
, lib
, xclip
, coreutils
, terminal-command ? "kitty -e"
,
}:
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
writeShellScriptBin "clipedit" ''
PATH=$PATH:"${
lib.makeBinPath [
coreutils
xclip
]
}"
tmp_file=$(mktemp)
xclip -out -selection -clipboard > $tmp_file
${terminal-command} $VISUAL $tmp_file || ${terminal-command} $EDITOR $tmp_file
xclip -in -selection clipboard < $tmp_file
rm $tmp_file
''

View file

@ -1,57 +0,0 @@
{ lib
, rice
, roboto
, i3lock-color
, writeScriptBin
, font ? {
package = roboto;
name = "Roboto";
}
, palette ? rice.palette.palette { }
, ...
}:
let
strPalette = lib.nix-rice.palette.toRGBAHex palette;
in
writeScriptBin "lockscreen" ''
# Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \
--insidever-color="${strPalette.normal.green}" \
--insidewrong-color="${strPalette.normal.red}" \
--inside-color="${strPalette.normal.black}" \
--ringver-color="${strPalette.bright.green}" \
--ringwrong-color="${strPalette.bright.red}" \
--ringver-color="${strPalette.bright.green}" \
--ringwrong-color="${strPalette.bright.red}" \
--ring-color="${strPalette.bright.blue}" \
--line-uses-ring \
--keyhl-color="${strPalette.bright.red}" \
--bshl-color="${strPalette.bright.red}" \
--separator-color="${strPalette.normal.black}" \
--verif-color="${strPalette.normal.green}" \
--wrong-color="${strPalette.normal.red}" \
--layout-color="${strPalette.normal.blue}" \
--date-color="${strPalette.normal.blue}" \
--time-color="${strPalette.normal.blue}" \
--blur 10 \
--clock \
--indicator \
--time-str="%H:%M:%S" \
--date-str="%a %e %b %Y" \
--verif-text="Verifying..." \
--wrong-text="Auth Failed" \
--noinput="No Input" \
--lock-text="Locking..." \
--lockfailed="Lock Failed" \
--time-font="${font.name}" \
--date-font="${font.name}" \
--layout-font="${font.name}" \
--verif-font="${font.name}" \
--wrong-font="${font.name}" \
--radius=120 \
--ring-width=20 \
--pass-media-keys \
--pass-screen-keys \
--pass-volume-keys \
--nofork
''

View file

@ -3,7 +3,6 @@
, fetchFromGitHub
, sddm
, qt5
,
}:
stdenv.mkDerivation {
pname = "sddm-sugar-dark";

View file

@ -3,7 +3,6 @@
, fetchFromGitHub
, fira-mono
, wallpaper ? null
,
}:
with lib;
stdenv.mkDerivation {

View file

@ -1,26 +0,0 @@
{ feh
, glib
, findutils
, gnugrep
, coreutils
, writeScriptBin
, backgrounds_directory ? "$HOME/Immagini/Sfondi"
,
}:
let
find = "${findutils}/bin/find";
grep = "${gnugrep}/bin/grep";
shuf = "${coreutils}/bin/shuf";
in
writeScriptBin "update-background" ''
#!/bin/sh
if [ $# -eq 0 ]; then
image=`${find} ${backgrounds_directory} -type f | ${grep} -v "/\." | ${shuf} -n 1`
else
image="$1"
fi
echo "image: $image"
${feh}/bin/feh --bg-fill --no-fehbg "$image"
${glib}/bin/gsettings set org.gnome.desktop.background picture-uri "file://$image"
true
''

View file

@ -1,35 +1,32 @@
{ lib
, rice
, roboto
{ roboto
, swaylock
, writeScriptBin
, font ? {
package = roboto;
name = "Roboto";
, font ? { package = roboto; name = "Roboto"; size = 10; }
, colors ? {
base = "000000ff";
inside = { ver = "00ff00ff"; wrong = "ff0000ff"; base = "000000ff"; };
ring = { ver = "10ff10ff"; wrong = "ff1010ff"; base = "1010ffff"; };
key.hl = "ff1010ff";
bs.hl = "ff1010ff";
separator = "000000ff";
}
, wallpaper ? ../../wallpapers/n8ca4obsys991.png
, palette ? rice.palette.palette { }
, ...
}:
let
strPalette = lib.nix-rice.palette.toRgbaShortHex palette;
in
writeScriptBin "wl-lockscreen" ''
}: writeScriptBin "wl-lockscreen" ''
# Using font package ${font.package}
${swaylock}/bin/swaylock \
--color "${strPalette.primary.background}" \
--inside-ver-color "${strPalette.normal.green}" \
--inside-wrong-color "${strPalette.normal.red}" \
--inside-color "${strPalette.normal.black}" \
--ring-ver-color "${strPalette.bright.green}" \
--ring-wrong-color "${strPalette.bright.red}" \
--ring-ver-color "${strPalette.bright.green}" \
--ring-wrong-color "${strPalette.bright.red}" \
--ring-color "${strPalette.bright.blue}" \
--color "${colors.base}" \
--inside-ver-color "${colors.inside.ver}" \
--inside-wrong-color "${colors.inside.wrong}" \
--inside-color "${colors.inside.base}" \
--ring-ver-color "${colors.ring.ver}" \
--ring-wrong-color "${colors.ring.wrong}" \
--ring-ver-color "${colors.ring.ver}" \
--ring-wrong-color "${colors.ring.wrong}" \
--ring-color "${colors.ring.base}" \
--line-uses-ring \
--key-hl-color "${strPalette.bright.red}" \
--bs-hl-color "${strPalette.bright.red}" \
--separator-color "${strPalette.normal.black}" \
--key-hl-color "${colors.key.hl}" \
--bs-hl-color "${colors.bs.hl}" \
--separator-color "${colors.separator}" \
--font "${font.name}" \
--font-size "${toString font.size}" \
--image "${toString wallpaper}" \