diff options
author | Franck Cuny <franck@fcuny.net> | 2023-05-05 19:41:58 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2023-05-05 19:41:58 -0700 |
commit | 43da9edb4598eef509c481ae0b305384418c45de (patch) | |
tree | a0ad614c90102757143e026e4fe1806431a3dbf4 /home/shell/fish | |
parent | profiles/default: users are immutable (diff) | |
download | world-43da9edb4598eef509c481ae0b305384418c45de.tar.gz |
home/profiles: move (almost) all modules to profiles
This is a major refactor, similar to what was done for the hosts, but in a single commit.
Diffstat (limited to 'home/shell/fish')
-rw-r--r-- | home/shell/fish/default.nix | 20 | ||||
-rw-r--r-- | home/shell/fish/functions/find-ssh-agent.fish | 20 | ||||
-rw-r--r-- | home/shell/fish/functions/new-go-project.fish | 27 | ||||
-rw-r--r-- | home/shell/fish/functions/nix-rebuild-hm.fish | 4 | ||||
-rw-r--r-- | home/shell/fish/functions/nix-rebuild-host.fish | 4 | ||||
-rw-r--r-- | home/shell/fish/interactive.fish | 8 | ||||
-rw-r--r-- | home/shell/fish/login.fish | 10 |
7 files changed, 0 insertions, 93 deletions
diff --git a/home/shell/fish/default.nix b/home/shell/fish/default.nix deleted file mode 100644 index f3e41d9..0000000 --- a/home/shell/fish/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.my.home.shell; - aliases = config.my.home.shell.aliases; -in -{ - config = lib.mkIf (cfg.name == "fish") { - programs.fish = { - enable = true; - shellAliases = aliases; - interactiveShellInit = builtins.readFile ./interactive.fish; - loginShellInit = builtins.readFile ./login.fish; - }; - - xdg.configFile."fish/functions" = { - source = ./functions; - recursive = true; - }; - }; -} diff --git a/home/shell/fish/functions/find-ssh-agent.fish b/home/shell/fish/functions/find-ssh-agent.fish deleted file mode 100644 index 9e2de8d..0000000 --- a/home/shell/fish/functions/find-ssh-agent.fish +++ /dev/null @@ -1,20 +0,0 @@ -function find-ssh-agent --description "find or run ssh-agent" - # let's avoid storing the agent's socket under /tmp - set -l ssh_auth_sock $XDG_RUNTIME_DIR/ssh-agent.sock - - if set -q SSH_AGENT_PID; and set -q SSH_AUTH_SOCK - # if variables already defined, then try to connect to agent - ssh-add -l &>/dev/null - test $status -ne 2; and return - end - - set -l user_id (id -u) - set -l ssh_agent_pid (pgrep --exact --newest --uid $user_id ssh-agent) - - if test -S $ssh_auth_sock - set --global --export SSH_AUTH_SOCK $ssh_auth_sock - set --global --export SSH_AGENT_PID $ssh_agent_pid - else - eval (ssh-agent -c -a $ssh_auth_sock) - end -end diff --git a/home/shell/fish/functions/new-go-project.fish b/home/shell/fish/functions/new-go-project.fish deleted file mode 100644 index e00a036..0000000 --- a/home/shell/fish/functions/new-go-project.fish +++ /dev/null @@ -1,27 +0,0 @@ -function new-go-project --description "create a new go project" - set -l project_name $argv[1] - - echo "> creating $project_name" - cd ~/workspace/ - mkdir $project_name - cd $project_name - - echo "> running `git init'" - git init . - - echo "> setting the default template for go projects" - nix flake init -t ~/workspace/world/templates#go - direnv allow - - echo "> creating initial commit, touch your yubikey" - git add . - git commit -m 'initial commit' - - echo "> pushing to https://git.fcuny.net/fcuny/$project_name" - git remote add origin https://git.fcuny.net/fcuny/$project_name - git push origin --all - - echo "> enabling drone CI for the repository" - drone --token (pass credentials/ci.fcuny.net) repo sync - drone --token (pass credentials/ci.fcuny.net) repo enable fcuny/$project_name -end diff --git a/home/shell/fish/functions/nix-rebuild-hm.fish b/home/shell/fish/functions/nix-rebuild-hm.fish deleted file mode 100644 index 3101e51..0000000 --- a/home/shell/fish/functions/nix-rebuild-hm.fish +++ /dev/null @@ -1,4 +0,0 @@ -function nix-rebuild-hm --description "rebuild home manager" - cd ~/workspace/world - home-manager switch --flake . -end diff --git a/home/shell/fish/functions/nix-rebuild-host.fish b/home/shell/fish/functions/nix-rebuild-host.fish deleted file mode 100644 index 02c0050..0000000 --- a/home/shell/fish/functions/nix-rebuild-host.fish +++ /dev/null @@ -1,4 +0,0 @@ -function nix-rebuild-host --description "rebuild the current host" - cd ~/workspace/world - sudo nixos-rebuild switch --flake . -end diff --git a/home/shell/fish/interactive.fish b/home/shell/fish/interactive.fish deleted file mode 100644 index 4adcba8..0000000 --- a/home/shell/fish/interactive.fish +++ /dev/null @@ -1,8 +0,0 @@ -# Tmux on terminal start, unless we're in a SSH connection -if status is-interactive - if test -z "$SSH_CONNECTION" - if not tmux has-session 2>/dev/null; or test -z "$TMUX" - exec tmux new-session -A -s 0 - end - end -end diff --git a/home/shell/fish/login.fish b/home/shell/fish/login.fish deleted file mode 100644 index 8f29553..0000000 --- a/home/shell/fish/login.fish +++ /dev/null @@ -1,10 +0,0 @@ -# disable greeting -set -U fish_greeting '' - -# set up ssh-agent -find-ssh-agent - -# start sway -if test -z "$DISPLAY"; and test (tty) = "/dev/tty1" - exec sway -end |