Skip to content

Commit

Permalink
home: remove duplicated ict proxy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Apr 21, 2024
1 parent 1eead08 commit d459889
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 46 deletions.
6 changes: 1 addition & 5 deletions home/lyc/configurations/amalthea/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{ pkgs, lib, config, ... }:
{

imports = [
./ssh-proxy.nix
];

home.packages = with pkgs; [
pinentry_mac
clash-meta
Expand All @@ -14,6 +9,7 @@
home.homeDirectory = "/Users/${config.home.username}";

inclyc.tex.enable = false;
inclyc.ssh.ICTProxy = true;

programs.vscode = {
enable = true;
Expand Down
8 changes: 0 additions & 8 deletions home/lyc/configurations/amalthea/ssh-proxy.nix

This file was deleted.

7 changes: 2 additions & 5 deletions home/lyc/configurations/aplax/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{ pkgs, config, lib, ... }:
{

imports = [
./ssh-proxy.nix
];

programs.vscode.enable = true;

home.homeDirectory = "/Users/${config.home.username}";
Expand All @@ -13,6 +8,8 @@
flakes = "${config.home.homeDirectory}/flakes";
};

inclyc.ssh.ICTProxy = true;

home.packages = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" ]; })
(lib.hiPrio clang-tools_16)
Expand Down
8 changes: 0 additions & 8 deletions home/lyc/configurations/aplax/ssh-proxy.nix

This file was deleted.

7 changes: 2 additions & 5 deletions home/lyc/configurations/aplaz/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{ pkgs, config, lib, ... }:
{

imports = [
./ssh-proxy.nix
];

services.kdeconnect.enable = true;

programs.vscode = {
Expand All @@ -16,6 +11,8 @@
flakes = "${config.home.homeDirectory}/workspace/flakes";
};

inclyc.ssh.ICTProxy = true;

services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
Expand Down
15 changes: 0 additions & 15 deletions home/lyc/configurations/aplaz/ssh-proxy.nix

This file was deleted.

2 changes: 2 additions & 0 deletions home/lyc/configurations/metis/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
enable = true;
pinentryPackage = pkgs.pinentry-curses;
};

inclyc.ssh.ICTProxy = true;
}
31 changes: 31 additions & 0 deletions home/lyc/modules/programs/ssh-jump.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Declares jump hosts for different network profile.
{ config, lib, ... }:
let
cfg = config.inclyc.ssh;
ict-machines = [ "ict-sw" "ict-sw-git" "ict-repo" "ict-altric" ];
ict-portal = "ict-malcon-pub";
in
{
options = {
inclyc.ssh.ICTProxy = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Add ICT proxy for machines outside of ICT networks";
example = true;
};
};

config = lib.mkIf cfg.ICTProxy (
let
settings = builtins.listToAttrs (builtins.map
(name: {
name = "${name}";
value = { proxyJump = ict-portal; };
})
ict-machines);
in
{
programs.ssh.matchBlocks = settings;
}
);
}
4 changes: 4 additions & 0 deletions home/lyc/modules/programs/ssh.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{ lib, ... }:
{
imports = [
./ssh-jump.nix
];

programs.ssh = {
enable = lib.mkDefault true;
serverAliveInterval = 3;
Expand Down

0 comments on commit d459889

Please sign in to comment.