feat(flake): add module for overlays
This commit is contained in:
parent
59c843d452
commit
9e4fdb00e3
15 changed files with 201 additions and 246 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
|
|
@ -88,6 +89,95 @@ in
|
|||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
my = {
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
(_: prev:
|
||||
{
|
||||
nur = import inputs.nur {
|
||||
pkgs = prev;
|
||||
nurpkgs = prev;
|
||||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
final: _:
|
||||
|
||||
with final.lib;
|
||||
rec {
|
||||
fishFile =
|
||||
{ name
|
||||
, destination
|
||||
, content
|
||||
, checkPhase ? null
|
||||
}:
|
||||
final.writeTextFile {
|
||||
inherit name destination;
|
||||
executable = true;
|
||||
allowSubstitutes = true;
|
||||
preferLocalBuild = false;
|
||||
text = ''
|
||||
#!${getExe final.fish}
|
||||
|
||||
${content}
|
||||
'';
|
||||
|
||||
checkPhase =
|
||||
if checkPhase == null then ''
|
||||
runHook preCheck
|
||||
${getExe final.fish} -n "$target"
|
||||
runHook postCheck
|
||||
''
|
||||
else checkPhase;
|
||||
};
|
||||
|
||||
writeFishApplication =
|
||||
{ name
|
||||
, text
|
||||
, completions ? null
|
||||
, runtimeInputs ? [ ]
|
||||
, checkPhase ? null
|
||||
}:
|
||||
let
|
||||
runtimeHeader = optionalString (runtimeInputs != [ ])
|
||||
''export PATH="${makeBinPath runtimeInputs}:$PATH"'';
|
||||
|
||||
script = fishFile {
|
||||
inherit checkPhase;
|
||||
name = "${name}_script";
|
||||
destination = "/bin/${name}";
|
||||
content = concatLines [ runtimeHeader text ];
|
||||
};
|
||||
completions_file = fishFile {
|
||||
inherit checkPhase;
|
||||
name = "${name}_completions";
|
||||
destination = "/share/fish/vendor_completions.d/${name}.fish";
|
||||
content = concatLines [ runtimeHeader completions ];
|
||||
};
|
||||
in
|
||||
final.symlinkJoin {
|
||||
inherit name;
|
||||
paths = [
|
||||
script
|
||||
] ++ optional (completions != null) completions_file;
|
||||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
_: prev: {
|
||||
xorg = prev.xorg // {
|
||||
lndir = prev.xorg.lndir.overrideAttrs (_: {
|
||||
meta.mainProgram = "lndir";
|
||||
});
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
channels = {
|
||||
master = inputs.master;
|
||||
stable = inputs.stable;
|
||||
};
|
||||
};
|
||||
|
||||
bin.enable = true;
|
||||
shell = {
|
||||
abbreviations = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue