chore: Update fleka inputs
This commit is contained in:
parent
908829263c
commit
e5d94609bc
10 changed files with 271 additions and 333 deletions
|
|
@ -22,6 +22,7 @@
|
|||
++ (lib.youthlic.loadImports ./.);
|
||||
|
||||
youthlic = {
|
||||
lix.enable = true;
|
||||
home-manager = {
|
||||
enable = true;
|
||||
unixName = "david";
|
||||
|
|
|
|||
|
|
@ -1,129 +1,21 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
man-pages
|
||||
man-pages-posix
|
||||
];
|
||||
documentation = {
|
||||
info.enable = true;
|
||||
nixos.enable = true;
|
||||
dev.enable = true;
|
||||
};
|
||||
}
|
||||
(
|
||||
let
|
||||
inherit (pkgs.writers) writeFish;
|
||||
cfg = config.documentation.man.man-db;
|
||||
cachePath = "/var/cache/man/nixos";
|
||||
in {
|
||||
documentation.man.generateCaches = false;
|
||||
|
||||
systemd.services."man-db" = {
|
||||
requires = ["sysinit-reactivation.target"];
|
||||
after = ["sysinit-reactivation.target"];
|
||||
partOf = ["sysinit-reactivation.target"];
|
||||
wantedBy = ["default.target"];
|
||||
path = [
|
||||
cfg.package
|
||||
pkgs.gawk
|
||||
];
|
||||
|
||||
serviceConfig = {
|
||||
Nice = 19;
|
||||
IOSchedulingClass = "idle";
|
||||
IOSchedulingPrioriry = 7;
|
||||
ExecStart =
|
||||
writeFish "mandbsvc" # fish
|
||||
|
||||
''
|
||||
set -l SystemManLoc "/run/current-system/sw/share/man"
|
||||
set -l ContentRecord "${cachePath}/man-db-state"
|
||||
|
||||
if [ ! -d "${cachePath}" ]
|
||||
mkdir -pv "${cachePath}" || exit 1
|
||||
end
|
||||
|
||||
if [ ! -f "$ContentRecord" ]
|
||||
touch "$ContentRecord" || exit 1
|
||||
end
|
||||
# 1) Collect list of all manpage files and calculate hashes
|
||||
# of them
|
||||
#
|
||||
# man1/ls.1.gz
|
||||
# man3/func.3.gz
|
||||
#
|
||||
# hash ->
|
||||
#
|
||||
# bbbbbbbbbbbb (man1/ls.1.gz)
|
||||
# aaaaaaaaaaaa (man3/func.3.gz)
|
||||
set -l hashes "$(
|
||||
find -L "$SystemManLoc" -type f -iname "*.gz" \
|
||||
-exec sha256sum "{}" "+" \
|
||||
| awk '{ print $1 }'
|
||||
or exit 1
|
||||
)"
|
||||
|
||||
# 2) Sort the hashes to make them "stable",
|
||||
# and then join them toghther into a big long string,
|
||||
# and then hash this big string to get the hash of the directory
|
||||
#
|
||||
# bbbbbbbbbbbb
|
||||
# aaaaaaaaaaaa
|
||||
#
|
||||
# sort ->
|
||||
#
|
||||
# aaaaaaaaaaaa
|
||||
# bbbbbbbbbbbb
|
||||
#
|
||||
# join ->
|
||||
#
|
||||
# aaaaaaaaaaaabbbbbbbbbbbb
|
||||
#
|
||||
# hash ->
|
||||
#
|
||||
# cccccccccccc
|
||||
set -l ultimate_hash (
|
||||
echo $hashes \
|
||||
| sort \
|
||||
| string join "" \
|
||||
| sha256sum - \
|
||||
| awk '{ print $1 }'
|
||||
or exit 1
|
||||
)
|
||||
|
||||
set -l old_hash "$( string collect < "$ContentRecord" )"
|
||||
|
||||
echo "Old hash: $old_hash"
|
||||
echo "New hash: $ultimate_hash"
|
||||
|
||||
if [ "$old_hash" != "$ultimate_hash" ]
|
||||
echo "Hash changed, do a full man-db rebuild"
|
||||
mandb -psc || exit 1
|
||||
echo "Write new hash"
|
||||
echo "$ultimate_hash" > "$ContentRecord"
|
||||
else
|
||||
echo "Hash not changed, skip"
|
||||
end
|
||||
'';
|
||||
};
|
||||
;
|
||||
};
|
||||
documentation = {
|
||||
info.enable = true;
|
||||
nixos.enable = true;
|
||||
dev.enable = true;
|
||||
man = {
|
||||
enable = true;
|
||||
cache = {
|
||||
enable = true;
|
||||
generateAtRuntime = true;
|
||||
};
|
||||
|
||||
environment.extraSetup =
|
||||
# bash
|
||||
''
|
||||
find "$out/share/man" \
|
||||
-mindepth 1 -maxdepth 1 \
|
||||
-not -name "man[1-8]" \
|
||||
-exec rm -r "{}" ";"
|
||||
|
||||
rm -r "$out/share/man/man3"
|
||||
'';
|
||||
}
|
||||
)
|
||||
]
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
31
nixos/modules/lix.nix
Normal file
31
nixos/modules/lix.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.lix;
|
||||
in {
|
||||
options = {
|
||||
youthlic.lix = {
|
||||
enable = lib.mkEnableOption "lix";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
nixpkgs.overlays = [
|
||||
(lib.mkBefore (final: _prev: {
|
||||
inherit
|
||||
(final.lixPackageSets.latest)
|
||||
nixpkgs-review
|
||||
nixpkgs-reviewFull
|
||||
nurl
|
||||
nix-update
|
||||
nix-eval-jobs
|
||||
nix-fast-build
|
||||
colmena
|
||||
;
|
||||
}))
|
||||
];
|
||||
nix.package = pkgs.lixPackageSets.latest.lix;
|
||||
};
|
||||
}
|
||||
|
|
@ -62,7 +62,6 @@
|
|||
use-xdg-base-directories = true;
|
||||
builders-use-substitutes = true;
|
||||
};
|
||||
package = pkgs.nix;
|
||||
registry = with lib;
|
||||
pipe inputs [
|
||||
(filterAttrs (name: _value: name != "nixpkgs"))
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ in {
|
|||
config = lib.mkIf cfg.enable {
|
||||
services.asusd = {
|
||||
enable = true;
|
||||
enableUserService = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
sops-nix.nixosModules.sops
|
||||
stylix.nixosModules.stylix
|
||||
disko.nixosModules.disko
|
||||
lix-module.nixosModules.default
|
||||
nixvim.nixosModules.nixvim
|
||||
|
||||
./..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue