summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-11-01 12:16:34 -0600
committerBen Sima <ben@bsima.me>2021-11-01 12:16:34 -0600
commit22950ff17da1d197f55f1e73783da9077c2e3cdb (patch)
tree7736a93fb99ebc3103429958ae6dd9cab7950721 /lib
parente71cabacfd3af0e4426d7cfd1edbabf564b8fd4d (diff)
extract programs.{ssh,emacs}
Diffstat (limited to 'lib')
-rw-r--r--lib/common.nix78
-rw-r--r--lib/emacs.nix9
-rw-r--r--lib/packages.nix125
-rw-r--r--lib/ssh.nix76
4 files changed, 153 insertions, 135 deletions
diff --git a/lib/common.nix b/lib/common.nix
index b51d3fe..011e7e7 100644
--- a/lib/common.nix
+++ b/lib/common.nix
@@ -7,7 +7,6 @@ let
in
{
home = {
- packages = import ./packages.nix { inherit pkgs; };
sessionVariables = {
GPGID = gpgid;
EDITOR = "vim";
@@ -148,7 +147,11 @@ in
for f in extrakto.sh open.sh tmux-extrakto.sh; do
wrapProgram $target/scripts/$f \
--prefix PATH : ${with pkgs; lib.makeBinPath (
- [pkgs.fzf pkgs.python3 pkgs.xclip]
+ [
+ pkgs.fzf
+ pkgs.python3
+ pkgs.xclip
+ ]
)}
done
'';
@@ -202,72 +205,6 @@ in
#shading = 10;
};
- ssh = {
- enable = true;
- forwardAgent = true;
- extraConfig = ''
- StrictHostKeyChecking=accept-new
-
- # sft ssh-config
- Match exec "/usr/local/bin/sft resolve -q %h"
- ProxyCommand "/usr/local/bin/sft" proxycommand %h
- UserKnownHostsFile "/Users/bsima/Library/Application Support/ScaleFT/proxycommand_known_hosts"
- '';
- matchBlocks = {
- "github.com" = {
- hostname = "github.com";
- user = "git";
- identityFile = [ "${homedir}/.ssh/id_rsa" ];
- identitiesOnly = true;
- };
-
- # groq
- "groq" = {
- hostname = "bsima"; # must be on vpn
- user = "bsima";
- identityFile = [ "${homedir}/.ssh/groq" ];
- identitiesOnly = true;
- };
-
- # simatime
- "sabten" = {
- hostname = "142.93.81.26";
- user = "root";
- identityFile = [ "${homedir}/.ssh/id_rsa" ];
- identitiesOnly = true;
- };
- "serval.simatime.com" = {
- hostname = "serval.simatime.com";
- user = "ben";
- identityFile = [ "${homedir}/.ssh/id_rsa" ];
- identitiesOnly = true;
- };
- "simatime.com" = {
- hostname = "simatime.com";
- user = "git";
- identityFile = [ "${homedir}/.ssh/id_rsa" ];
- identitiesOnly = true;
- };
- "lithium" = {
- hostname = "192.168.1.9";
- user = "ben";
- identityFile = [ "${homedir}/.ssh/id_rsa" ];
- identitiesOnly = true;
- };
- "dev.simatime.com" = {
- user = "ben";
- identityFile = [ "${homedir}/.ssh/id_rsa" ];
- identitiesOnly = true;
- };
- "git.platonic.systems" = {
- hostname = "git.platonic.systems";
- user = "git";
- identityFile = [ "${homedir}/.ssh/platonic.systems" ];
- identitiesOnly = true;
- };
- };
- };
-
direnv = {
enable = true;
};
@@ -420,10 +357,5 @@ in
"v." = "vim .";
};
};
-
- emacs = {
- enable = true;
- extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; };
- };
};
}
diff --git a/lib/emacs.nix b/lib/emacs.nix
new file mode 100644
index 0000000..df7b036
--- /dev/null
+++ b/lib/emacs.nix
@@ -0,0 +1,9 @@
+{ ... }:
+
+{
+ programs.emacs = {
+ enable = true;
+ extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; };
+ };
+}
+
diff --git a/lib/packages.nix b/lib/packages.nix
index 41acbef..e73eafc 100644
--- a/lib/packages.nix
+++ b/lib/packages.nix
@@ -1,4 +1,4 @@
-{ pkgs }:
+{ pkgs, ... }:
# All common packages go here. Linux-specific should go in `linux.nix'
@@ -19,64 +19,65 @@ let
cp ./zebra $out/bin
'';
};
-in [
-asciinema
-ag
-amfora
-aspellDicts.en
-bat
-bc
-cabal2nix
-cloc
-cmatrix
-ctags
-dhall
-direnv
-entr
-eternal-terminal
-expect
-fd
-figlet
-file
-font-awesome_5
-gitAndTools.stgit
-git-lfs
-git-revise
-github-cli
-hashcash
-htop
-httpstat
-ispell
-jq
-lsof
-material-icons
-mononoki
-mpc_cli
-ncdu
-ncmpc
-nix-prefetch-scripts
-nixos-generators
-noto-fonts-emoji
-opentimestamps-client
-ormolu
-paperkey
-pass
-perlPackages.GitAutofixup
-pianobar
-pup
-pwgen
-python37Packages.black
-ranger
-ripgrep
-shellcheck
-tmux
-tree
-unrar
-unzip
-urlscan
-vimpager
-w3m
-whois
-zebra
-zip
-]
+in {
+ home.packages = [
+ asciinema
+ ag
+ amfora
+ aspellDicts.en
+ bat
+ bc
+ cabal2nix
+ cloc
+ cmatrix
+ ctags
+ dhall
+ direnv
+ entr
+ eternal-terminal
+ expect
+ fd
+ figlet
+ file
+ font-awesome_5
+ gitAndTools.stgit
+ git-lfs
+ git-revise
+ github-cli
+ hashcash
+ htop
+ httpstat
+ ispell
+ jq
+ lsof
+ material-icons
+ mononoki
+ mpc_cli
+ ncdu
+ ncmpc
+ nix-prefetch-scripts
+ nixos-generators
+ noto-fonts-emoji
+ opentimestamps-client
+ ormolu
+ paperkey
+ pass
+ perlPackages.GitAutofixup
+ pianobar
+ pup
+ pwgen
+ ranger
+ ripgrep
+ shellcheck
+ tmux
+ tree
+ unrar
+ unzip
+ urlscan
+ vimpager
+ w3m
+ whois
+ zebra
+ zip
+ ];
+}
diff --git a/lib/ssh.nix b/lib/ssh.nix
new file mode 100644
index 0000000..9cbb05b
--- /dev/null
+++ b/lib/ssh.nix
@@ -0,0 +1,76 @@
+{ ... }:
+
+let
+ homedir = builtins.getEnv "HOME";
+in {
+ programs.ssh = {
+ enable = true;
+ forwardAgent = true;
+ extraConfig = ''
+ StrictHostKeyChecking=accept-new
+
+ # sft ssh-config
+ Match exec "/usr/local/bin/sft resolve -q %h"
+ ProxyCommand "/usr/local/bin/sft" proxycommand %h
+ UserKnownHostsFile "/Users/bsima/Library/Application Support/ScaleFT/proxycommand_known_hosts"
+ '';
+ matchBlocks = {
+ "github.com" = {
+ hostname = "github.com";
+ user = "git";
+ identityFile = [ "${homedir}/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+
+ # groq
+ "groq" = {
+ hostname = "bsima"; # must be on vpn
+ user = "bsima";
+ identityFile = [ "${homedir}/.ssh/groq" ];
+ identitiesOnly = true;
+ forwardAgent = true;
+ extraOptions = {
+ #"RemoteCommand" = "tmux -CC new -As0";
+ "RequestTTY" = "force";
+ };
+ };
+
+ # simatime
+ "sabten" = {
+ hostname = "142.93.81.26";
+ user = "root";
+ identityFile = [ "${homedir}/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ "serval.simatime.com" = {
+ hostname = "serval.simatime.com";
+ user = "ben";
+ identityFile = [ "${homedir}/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ "simatime.com" = {
+ hostname = "simatime.com";
+ user = "git";
+ identityFile = [ "${homedir}/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ "lithium" = {
+ hostname = "192.168.1.9";
+ user = "ben";
+ identityFile = [ "${homedir}/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ "dev.simatime.com" = {
+ user = "ben";
+ identityFile = [ "${homedir}/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ "git.platonic.systems" = {
+ hostname = "git.platonic.systems";
+ user = "git";
+ identityFile = [ "${homedir}/.ssh/platonic.systems" ];
+ identitiesOnly = true;
+ };
+ };
+ };
+}