Compare commits
No commits in common. "37a93b29ee7d210d7843b330f288bf99098b6698" and "d6ad8105680fe53708e1705d61a412c4a40b6b7a" have entirely different histories.
37a93b29ee
...
d6ad810568
|
@ -95,6 +95,7 @@
|
||||||
|
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.hypr-contrib.overlays.default
|
inputs.hypr-contrib.overlays.default
|
||||||
|
inputs.hyprland.overlays.default
|
||||||
inputs.neovim-nightly-overlay.overlay
|
inputs.neovim-nightly-overlay.overlay
|
||||||
overlay
|
overlay
|
||||||
];
|
];
|
||||||
|
|
|
@ -34,54 +34,42 @@ let
|
||||||
|
|
||||||
which-nix = pkgs.writeFishApplication {
|
which-nix = pkgs.writeFishApplication {
|
||||||
name = "which-nix";
|
name = "which-nix";
|
||||||
runtimeInputs = with pkgs; [ which coreutils-full procps ];
|
runtimeInputs = with pkgs; [ which coreutils-full ];
|
||||||
text = /* fish */ ''
|
text = /* fish */ ''
|
||||||
function recurse -a path;
|
readlink -f (which $argv)
|
||||||
if not test -f "$path"
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
echo $path
|
|
||||||
if test -L $path
|
|
||||||
recurse (readlink $path)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for arg in $argv
|
|
||||||
recurse (which $arg)
|
|
||||||
end
|
|
||||||
'';
|
'';
|
||||||
completions = /* fish */ ''
|
completions = /* fish */ ''
|
||||||
complete -c which-nix -fa '(__fish_complete_command)'
|
complete -c which-nix -fa '(__fish_complete_command)'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
gi = pkgs.writeFishApplication {
|
gi = pkgs.writeFishApplication
|
||||||
name = "gi";
|
{
|
||||||
runtimeInputs = with pkgs; [ fzf gum curl ];
|
name = "gi";
|
||||||
text = /* fish */ ''
|
runtimeInputs = with pkgs; [ fzf gum curl ];
|
||||||
set url https://www.gitignore.io/api
|
text = /* fish */ ''
|
||||||
|
set url https://www.gitignore.io/api
|
||||||
|
|
||||||
if test (count $argv) -eq 0
|
if test (count $argv) -eq 0
|
||||||
set choice ( curl -sL $url/list \
|
set choice ( curl -sL $url/list \
|
||||||
| string split "," \
|
| string split "," \
|
||||||
| fzf -m \
|
| fzf -m \
|
||||||
| string join "," )
|
| string join "," )
|
||||||
else
|
else
|
||||||
set choice (string join "," $argv[1..])
|
set choice (string join "," $argv[1..])
|
||||||
end
|
end
|
||||||
|
|
||||||
if gum confirm "Overwrite current .gitignore?"
|
if gum confirm "Overwrite current .gitignore?"
|
||||||
curl -sL $url/$choice > .gitignore
|
curl -sL $url/$choice > .gitignore
|
||||||
else
|
else
|
||||||
curl -sL $url/$choice >> .gitignore
|
curl -sL $url/$choice >> .gitignore
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
completions = /* fish */ ''
|
completions = /* fish */ ''
|
||||||
set args (curl -sL https://www.gitignore.io/api/list | string split ",")
|
set args (curl -sL https://www.gitignore.io/api/list | string split ",")
|
||||||
complete -c gi -fa "$args"
|
complete -c gi -fa "$args"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
users.users.moritz = {
|
users.users.moritz = {
|
||||||
|
|
|
@ -8,12 +8,9 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.my.programs.fish;
|
cfg = config.my.programs.fish;
|
||||||
shellConfig = config.my.shell;
|
shellConfig = config.my.shell;
|
||||||
exportedVariables =
|
exportVariables =
|
||||||
let
|
lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables;
|
||||||
exportVariables =
|
exportedVariables = lib.concatStringsSep "\n" exportVariables;
|
||||||
lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables;
|
|
||||||
in
|
|
||||||
lib.concatStringsSep "\n" exportVariables;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.fish.enable = mkEnableOption "fish";
|
options.my.programs.fish.enable = mkEnableOption "fish";
|
||||||
|
|
|
@ -9,8 +9,7 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.my.programs.hyprland;
|
cfg = config.my.programs.hyprland;
|
||||||
|
|
||||||
hyprland-nvidia = pkgs.hyprland.override { enableNvidiaPatches = true; };
|
hyprland = pkgs.hyprland.override { enableNvidiaPatches = cfg.nvidiaSupport; };
|
||||||
hyprland = if cfg.nvidiaSupport then hyprland-nvidia else pkgs.hyprland;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.hyprland = {
|
options.my.programs.hyprland = {
|
||||||
|
|
|
@ -17,7 +17,7 @@ in
|
||||||
gateway = "vpn.uni-leipzig.de";
|
gateway = "vpn.uni-leipzig.de";
|
||||||
protocol = "anyconnect";
|
protocol = "anyconnect";
|
||||||
user = "mb18cele@uni-leipzig.de";
|
user = "mb18cele@uni-leipzig.de";
|
||||||
# NOTE: file content as follows:
|
# NOTE file content as follows:
|
||||||
# <my_password>
|
# <my_password>
|
||||||
# "1-Standard-Uni" or "2-Spezial-Alles"
|
# "1-Standard-Uni" or "2-Spezial-Alles"
|
||||||
# Explanation:
|
# Explanation:
|
||||||
|
|
|
@ -2,33 +2,7 @@ _:
|
||||||
|
|
||||||
final: _:
|
final: _:
|
||||||
with final.lib;
|
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 =
|
writeFishApplication =
|
||||||
{ name
|
{ name
|
||||||
, text
|
, text
|
||||||
|
@ -37,21 +11,30 @@ rec {
|
||||||
, checkPhase ? null
|
, checkPhase ? null
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
runtimeHeader = optionalString (runtimeInputs != [ ])
|
fishFile = destination: content: final.writeTextFile {
|
||||||
''export PATH="${makeBinPath runtimeInputs}:$PATH"'';
|
inherit name destination;
|
||||||
|
executable = true;
|
||||||
|
allowSubstitutes = true;
|
||||||
|
preferLocalBuild = false;
|
||||||
|
text = ''
|
||||||
|
#!${getExe final.fish}
|
||||||
|
|
||||||
script = fishFile {
|
${optionalString (runtimeInputs != [ ]) ''export PATH="${makeBinPath runtimeInputs}:$PATH"''}
|
||||||
inherit checkPhase;
|
|
||||||
name = "${name}_script";
|
${content}
|
||||||
destination = "/bin/${name}";
|
'';
|
||||||
content = concatLines [ runtimeHeader text ];
|
|
||||||
};
|
checkPhase =
|
||||||
completions_file = fishFile {
|
if checkPhase == null then ''
|
||||||
inherit checkPhase;
|
runHook preCheck
|
||||||
name = "${name}_completions";
|
${getExe final.fish} -n "$target"
|
||||||
destination = "/share/fish/vendor_completions.d/${name}.fish";
|
runHook postCheck
|
||||||
content = concatLines [ runtimeHeader completions ];
|
''
|
||||||
|
else checkPhase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
script = fishFile "/bin/${name}" text;
|
||||||
|
completions_file = fishFile "/share/fish/vendor_completions.d/${name}.fish" completions;
|
||||||
in
|
in
|
||||||
final.symlinkJoin {
|
final.symlinkJoin {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
|
@ -11,7 +11,6 @@ final: prev:
|
||||||
version = lib.my.mkVersionInput inputs.rofi-wayland;
|
version = lib.my.mkVersionInput inputs.rofi-wayland;
|
||||||
});
|
});
|
||||||
timers = inputs.timers.packages.${prev.system}.default;
|
timers = inputs.timers.packages.${prev.system}.default;
|
||||||
hyprland = inputs.hyprland.packages.${prev.system}.default;
|
|
||||||
|
|
||||||
fzf1 = final.writeShellApplication {
|
fzf1 = final.writeShellApplication {
|
||||||
name = "fzf1";
|
name = "fzf1";
|
||||||
|
|
Loading…
Reference in New Issue