forked from pub-solar/os
Compare commits
11 commits
149d0c34ab
...
6891f77bd2
Author | SHA1 | Date | |
---|---|---|---|
teutat3s | 6891f77bd2 | ||
teutat3s | 270ef4f452 | ||
teutat3s | b79ef12b4e | ||
teutat3s | c3094c4b76 | ||
teutat3s | f6c5fef2fe | ||
teutat3s | 97a05c4456 | ||
teutat3s | 9b48362f41 | ||
teutat3s | 82d88a3f23 | ||
teutat3s | fa7812b21f | ||
teutat3s | b0aa120073 | ||
teutat3s | 54ae646335 |
60
flake.lock
60
flake.lock
|
@ -14,11 +14,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703433843,
|
"lastModified": 1707830867,
|
||||||
"narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=",
|
"narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "417caa847f9383e111d1397039c9d4337d024bf0",
|
"rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -38,11 +38,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704875591,
|
"lastModified": 1708091384,
|
||||||
"narHash": "sha256-eWRLbqRcrILgztU/m/k7CYLzETKNbv0OsT2GjkaNm8A=",
|
"narHash": "sha256-dTGGw2y8wvfjr+J9CjQbfdulOq72hUG17HXVNxpH1yE=",
|
||||||
"owner": "serokell",
|
"owner": "serokell",
|
||||||
"repo": "deploy-rs",
|
"repo": "deploy-rs",
|
||||||
"rev": "1776009f1f3fb2b5d236b84d9815f2edee463a9b",
|
"rev": "0a0187794ac7f7a1e62cda3dabf8dc041f868790",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -97,11 +97,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1706830856,
|
"lastModified": 1709336216,
|
||||||
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
|
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
|
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -166,11 +166,11 @@
|
||||||
},
|
},
|
||||||
"master": {
|
"master": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707219153,
|
"lastModified": 1709741673,
|
||||||
"narHash": "sha256-eX89KCMTsy26GaHOxTqgj1ecdUYEhuOKrrVzKrLAbbQ=",
|
"narHash": "sha256-0NBKiVhTdJqMcrcMtVgPw5WcRdhvuk8zXeZeh8IQLeI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "919cb864b1d7a4bee3d88c801f71daede4be5aec",
|
"rev": "fc3cc21d2a4e708cd1974b2fa44b670f1fc3fdbd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -187,11 +187,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1706833576,
|
"lastModified": 1709554374,
|
||||||
"narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=",
|
"narHash": "sha256-1yYgwxBzia+QrOaQaZ6YKqGFfiQcSBwYLzd9XRsRLQY=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7",
|
"rev": "daa03606dfb5296a22e842acb02b46c1c4e9f5e7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -219,11 +219,11 @@
|
||||||
},
|
},
|
||||||
"nixos-flake": {
|
"nixos-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705990839,
|
"lastModified": 1708785992,
|
||||||
"narHash": "sha256-Gb0bvp7BiHBn2PkssT4CiBhD7lVWqSHEBfiai/RFfSQ=",
|
"narHash": "sha256-0gEsD/EpKrbLuLcYT9CXIVEY6ChmVvVTZJDAsqBXDhg=",
|
||||||
"owner": "srid",
|
"owner": "srid",
|
||||||
"repo": "nixos-flake",
|
"repo": "nixos-flake",
|
||||||
"rev": "244072b1f9088833627046d703d7973b90fe7843",
|
"rev": "50203d68b305abff2f29e555992eb55ddeffbcd5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -234,11 +234,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707211557,
|
"lastModified": 1709410583,
|
||||||
"narHash": "sha256-LTKTzZ6fM5j8XWXf51IMBzDaOaJg9kYWLUZxoIhzRN8=",
|
"narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "6e5cc385fc8cf5ca6495d70243074ccdea9f64c7",
|
"rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -249,11 +249,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707091808,
|
"lastModified": 1709569716,
|
||||||
"narHash": "sha256-LahKBAfGbY836gtpVNnWwBTIzN7yf/uYM/S0g393r0Y=",
|
"narHash": "sha256-iOR44RU4jQ+YPGrn+uQeYAp7Xo7Z/+gT+wXJoGxxLTY=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9f2ee8c91ac42da3ae6c6a1d21555f283458247e",
|
"rev": "617579a787259b9a6419492eaac670a5f7663917",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -266,11 +266,11 @@
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"lastModified": 1706550542,
|
"lastModified": 1709237383,
|
||||||
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
|
"narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
|
"rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -393,11 +393,11 @@
|
||||||
},
|
},
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707092692,
|
"lastModified": 1709479366,
|
||||||
"narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=",
|
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "faf912b086576fd1a15fca610166c98d47bc667e",
|
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
master.url = "github:nixos/nixpkgs/master";
|
master.url = "github:nixos/nixpkgs/master";
|
||||||
|
|
||||||
#fork.url = "github:teutat3s/nixpkgs/signal-desktop-6.42";
|
#fork.url = "github:teutat3s/nixpkgs/backport-droidcam";
|
||||||
|
|
||||||
flake-compat.url = "github:edolstra/flake-compat";
|
flake-compat.url = "github:edolstra/flake-compat";
|
||||||
flake-compat.flake = false;
|
flake-compat.flake = false;
|
||||||
|
|
|
@ -26,6 +26,7 @@ in {
|
||||||
nix-tree
|
nix-tree
|
||||||
nvd
|
nvd
|
||||||
nixpkgs-review
|
nixpkgs-review
|
||||||
|
nix-update
|
||||||
nix-search-cli
|
nix-search-cli
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ in {
|
||||||
gnome.yelp
|
gnome.yelp
|
||||||
hicolor-icon-theme
|
hicolor-icon-theme
|
||||||
keepassxc
|
keepassxc
|
||||||
qMasterPassword-wayland
|
qMasterPassword
|
||||||
libnotify
|
libnotify
|
||||||
vlc
|
vlc
|
||||||
];
|
];
|
||||||
|
|
|
@ -5,4 +5,5 @@
|
||||||
# https://github.com/swaywm/sway/wiki/Systemd-integration
|
# https://github.com/swaywm/sway/wiki/Systemd-integration
|
||||||
# Also, import the most important environment variables into the D-Bus and systemd
|
# Also, import the most important environment variables into the D-Bus and systemd
|
||||||
# user environments (e.g. required for screen sharing and Pinentry prompts):
|
# user environments (e.g. required for screen sharing and Pinentry prompts):
|
||||||
exec "systemctl --user import-environment; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway"
|
exec "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemctl --user start sway-session.target; dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"
|
||||||
|
exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target
|
||||||
|
|
|
@ -11,11 +11,23 @@
|
||||||
"brscan5"
|
"brscan5"
|
||||||
"brscan5-etc-files"
|
"brscan5-etc-files"
|
||||||
"facetimehd-firmware"
|
"facetimehd-firmware"
|
||||||
|
"nomad"
|
||||||
"slack"
|
"slack"
|
||||||
"veracrypt"
|
"veracrypt"
|
||||||
"zoom"
|
"zoom"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
system.activationScripts.diff-closures = {
|
||||||
|
text =''
|
||||||
|
if [[ -e /run/current-system ]]; then
|
||||||
|
${config.nix.package}/bin/nix store diff-closures \
|
||||||
|
/run/current-system "$systemConfig" \
|
||||||
|
--extra-experimental-features nix-command
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
supportsDryActivation = true;
|
||||||
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
# Use default version alias for nix package
|
# Use default version alias for nix package
|
||||||
package = pkgs.nix;
|
package = pkgs.nix;
|
||||||
|
|
|
@ -13,7 +13,7 @@ in {
|
||||||
|
|
||||||
# Run when initializing a login shell
|
# Run when initializing a login shell
|
||||||
profileExtra = ''
|
profileExtra = ''
|
||||||
[ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service
|
[ "$(tty)" = "/dev/tty1" ] && exec systemd-cat --identifier=sway ${pkgs.sway}/bin/sway
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Run when initializing an interactive shell
|
# Run when initializing an interactive shell
|
||||||
|
|
|
@ -47,6 +47,10 @@ in {
|
||||||
watson
|
watson
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Get completion for system packages
|
||||||
|
# https://nix-community.github.io/home-manager/options.xhtml#opt-programs.bash.enableCompletion
|
||||||
|
environment.pathsToLink = [ "/share/bash-completion" ];
|
||||||
|
|
||||||
home-manager.users."${psCfg.user.name}" = {
|
home-manager.users."${psCfg.user.name}" = {
|
||||||
xdg.dataFile."scripts/base16.sh".source = .local/share/scripts/base16.sh;
|
xdg.dataFile."scripts/base16.sh".source = .local/share/scripts/base16.sh;
|
||||||
|
|
||||||
|
|
|
@ -99,21 +99,11 @@
|
||||||
in
|
in
|
||||||
BLK + CHR + DIR + EXE + REG + HARDLINK + SYMLINK + MISSING + ORPHAN + FIFO + SOCK + OTHER;
|
BLK + CHR + DIR + EXE + REG + HARDLINK + SYMLINK + MISSING + ORPHAN + FIFO + SOCK + OTHER;
|
||||||
};
|
};
|
||||||
|
|
||||||
envListNames = lib.attrsets.mapAttrsToList (name: value: name) variables;
|
|
||||||
|
|
||||||
# Here we merge an extra variable into the attrset called FULL_ENV_LIST.
|
|
||||||
# It's a list of the variable names defined above.
|
|
||||||
# We can use this to tell `systemctl import-environment` to import the full list above.
|
|
||||||
variablesWithMeta = lib.attrsets.zipAttrsWith (name: values: builtins.head values) [
|
|
||||||
variables
|
|
||||||
{IMPORT_ENVIRONMENT_ENV_LIST = lib.lists.foldl (a: b: a + " " + b) "IMPORT_ENVIRONMENT_ENV_LIST" envListNames;}
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
home-manager.users."${psCfg.user.name}" = {
|
environment.variables = variables;
|
||||||
home.sessionVariables = variablesWithMeta;
|
|
||||||
systemd.user.sessionVariables = variablesWithMeta;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.variables = variablesWithMeta;
|
home-manager.users."${psCfg.user.name}" = {
|
||||||
|
home.sessionVariables = variables;
|
||||||
|
systemd.user.sessionVariables = variables;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,17 +3,33 @@ final: prev: {
|
||||||
inherit (prev.sources.blesh-nvfetcher) version src;
|
inherit (prev.sources.blesh-nvfetcher) version src;
|
||||||
|
|
||||||
dontBuild = false;
|
dontBuild = false;
|
||||||
buildInputs = [prev.git];
|
buildInputs = [
|
||||||
|
prev.gitMinimal
|
||||||
|
];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace GNUmakefile \
|
substituteInPlace GNUmakefile \
|
||||||
--replace "git submodule update --init --recursive" ""
|
--replace "git submodule update --init --recursive" ""
|
||||||
'';
|
'';
|
||||||
nativeCheckInputs = oldAttrs.nativeCheckInputs ++ [prev.busybox];
|
|
||||||
|
installFlags = [
|
||||||
|
"PREFIX=$(out)"
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
source $stdenv/setup
|
||||||
|
installPhase
|
||||||
|
'';
|
||||||
|
|
||||||
mkdir -p "$out/share/blesh/lib"
|
postInstall = ''
|
||||||
|
mkdir -p "$out/bin"
|
||||||
|
cat <<EOF >"$out/bin/blesh-share"
|
||||||
|
#!${prev.runtimeShell}
|
||||||
|
# Run this script to find the ble.sh shared folder
|
||||||
|
# where all the shell scripts are living.
|
||||||
|
echo "$out/share/blesh"
|
||||||
|
EOF
|
||||||
|
chmod +x "$out/bin/blesh-share"
|
||||||
|
|
||||||
cat <<EOF >"$out/share/blesh/lib/_package.sh"
|
cat <<EOF >"$out/share/blesh/lib/_package.sh"
|
||||||
_ble_base_package_type=nix
|
_ble_base_package_type=nix
|
||||||
|
@ -23,10 +39,6 @@ final: prev: {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
make install INSDIR=$out/share/blesh
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
{
|
{
|
||||||
direnv = unstable.direnv;
|
direnv = unstable.direnv;
|
||||||
nix-direnv = unstable.nix-direnv;
|
nix-direnv = unstable.nix-direnv;
|
||||||
qMasterPassword-wayland = unstable.qMasterPassword-wayland;
|
|
||||||
slack = unstable.slack;
|
|
||||||
_1password = unstable._1password;
|
_1password = unstable._1password;
|
||||||
_1password-cli = unstable._1password-cli;
|
_1password-cli = unstable._1password-cli;
|
||||||
wlvncc = unstable.wlvncc;
|
wlvncc = unstable.wlvncc;
|
||||||
|
|
|
@ -14,7 +14,6 @@ with prev; {
|
||||||
psos-docs = import ./psos-docs.nix final;
|
psos-docs = import ./psos-docs.nix final;
|
||||||
s = writeShellScriptBin "s" (import ./s.nix final);
|
s = writeShellScriptBin "s" (import ./s.nix final);
|
||||||
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
|
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
|
||||||
sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final);
|
|
||||||
swaylock-bg = writeShellScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
|
swaylock-bg = writeShellScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
|
||||||
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
|
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
|
||||||
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
|
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
self:
|
|
||||||
with self; ''
|
|
||||||
# first import environment variables from the login manager
|
|
||||||
systemctl --user import-environment;
|
|
||||||
# then start the service
|
|
||||||
exec systemctl --wait --user start sway.service
|
|
||||||
''
|
|
|
@ -72,7 +72,7 @@ in {
|
||||||
ifmetric
|
ifmetric
|
||||||
ipmitool
|
ipmitool
|
||||||
#keybase-gui
|
#keybase-gui
|
||||||
nomad_1_4
|
nomad
|
||||||
thunderbird
|
thunderbird
|
||||||
vault
|
vault
|
||||||
veracrypt
|
veracrypt
|
||||||
|
@ -86,8 +86,49 @@ in {
|
||||||
source ${config.age.secrets.environment-secrets.path}
|
source ${config.age.secrets.environment-secrets.path}
|
||||||
source ${flake.inputs.tritonshell.packages.${pkgs.system}.triton-utils}/bin/ttp.sh
|
source ${flake.inputs.tritonshell.packages.${pkgs.system}.triton-utils}/bin/ttp.sh
|
||||||
|
|
||||||
|
_tailscale()
|
||||||
|
{
|
||||||
|
local cur prev words cword
|
||||||
|
_init_completion -n = || return
|
||||||
|
|
||||||
|
if [[ $cword -eq 1 ]]; then
|
||||||
|
SUBCOMMANDS=$(tailscale --help 2>&1 | awk '/SUBCOMMANDS/{ f = 1; next } /FLAGS/{ f = 0 } f{print $1}')
|
||||||
|
SUBCOMMANDS="$SUBCOMMANDS debug"
|
||||||
|
FLAGS="-h --help --socket"
|
||||||
|
COMPREPLY=( $(compgen -W "$SUBCOMMANDS $FLAGS" -- "$cur" ))
|
||||||
|
return
|
||||||
|
else
|
||||||
|
subcmd="''${COMP_WORDS[1]}"
|
||||||
|
if [[ "$cur" = *=* ]]; then
|
||||||
|
COMPREPLY=( $(compgen -W 'false' -- "''${cur#*=}") )
|
||||||
|
return
|
||||||
|
elif [[ "$cur" = -* ]]; then
|
||||||
|
FLAGS=$(tailscale "$subcmd" --help 2>&1 | awk '/FLAGS/{ f = 1; next } f' | grep -oE -- '--[^ ]+[=]?' | tr -d ',')
|
||||||
|
FLAGS="$FLAGS --help"
|
||||||
|
COMPREPLY=( $(compgen -W "$FLAGS" -- "$cur" ))
|
||||||
|
return
|
||||||
|
else
|
||||||
|
case "$subcmd" in
|
||||||
|
"ping"|"ssh")
|
||||||
|
IP_AND_HOSTNAME=$(tailscale status 2>&1 | awk '{print $1"\n"$2}')
|
||||||
|
COMPREPLY=( $(compgen -W "$IP_AND_HOSTNAME" -- "$cur" ))
|
||||||
|
;;
|
||||||
|
"debug")
|
||||||
|
SUBCOMMANDS=""
|
||||||
|
if [[ $cword -eq 2 ]]; then
|
||||||
|
SUBCOMMANDS=$(tailscale "$subcmd" --help 2>&1 | awk '/SUBCOMMANDS/{ f = 1; next } /FLAGS/{ f = 0 } f{print $1}')
|
||||||
|
fi
|
||||||
|
FLAGS=$(tailscale "$subcmd" --help 2>&1 | awk '/FLAGS/{ f = 1; next } f' | grep -oE -- '--[^ ]+[=]?' | tr -d ',')
|
||||||
|
COMPREPLY=( $(compgen -W "$SUBCOMMANDS $FLAGS" -- "$cur" ))
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
complete -F _tailscale tailscale
|
||||||
complete -C ${pkgs.consul}/bin/consul consul
|
complete -C ${pkgs.consul}/bin/consul consul
|
||||||
complete -C ${pkgs.nomad_1_4}/bin/nomad nomad
|
complete -C ${pkgs.nomad}/bin/nomad nomad
|
||||||
complete -C ${pkgs.vault}/bin/vault vault
|
complete -C ${pkgs.vault}/bin/vault vault
|
||||||
complete -C ${flake.inputs.nixos-22-05.legacyPackages.${pkgs.system}.terraform}/bin/terraform terraform
|
complete -C ${flake.inputs.nixos-22-05.legacyPackages.${pkgs.system}.terraform}/bin/terraform terraform
|
||||||
complete -C ${pkgs.waypoint}/bin/waypoint waypoint
|
complete -C ${pkgs.waypoint}/bin/waypoint waypoint
|
||||||
|
|
Loading…
Reference in a new issue