Refactor some modules
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
23
hosts/common/configs/user/console/dive/default.nix
Normal file
23
hosts/common/configs/user/console/dive/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ dive ];
|
||||
|
||||
xdg.configFile."dive/config.yaml" = lib.mkIf (
|
||||
(config.virtualisation.podman.enable || hmConfig.services.podman.enable)
|
||||
&& !(config.virtualisation.docker.enable || config.virtualisation.docker.rootless.enable)
|
||||
) { source = (pkgs.formats.yaml { }).generate "config.yaml" { container-engine = "podman"; }; };
|
||||
};
|
||||
}
|
@@ -31,11 +31,7 @@ lib.mkMerge [
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
docker-compose
|
||||
dive
|
||||
];
|
||||
|
||||
packages = with pkgs; [ docker-compose ];
|
||||
sessionVariables.DOCKER_CONFIG = "${home}/.config/docker";
|
||||
};
|
||||
};
|
||||
|
@@ -23,14 +23,9 @@
|
||||
packages = with pkgs; [
|
||||
podman-compose
|
||||
kompose
|
||||
dive
|
||||
];
|
||||
|
||||
sessionVariables.REGISTRY_AUTH_FILE = "${home}/.config/containers/auth.json";
|
||||
};
|
||||
|
||||
xdg.configFile."dive/config.yaml".source = (pkgs.formats.yaml { }).generate "config.yaml" {
|
||||
container-engine = "podman";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
11
hosts/common/configs/user/console/ssh-agent/default.nix
Normal file
11
hosts/common/configs/user/console/ssh-agent/default.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ ... }:
|
||||
{
|
||||
home-manager.users.${user} = {
|
||||
services.ssh-agent.enable = true;
|
||||
programs.ssh.addKeysToAgent = "yes";
|
||||
};
|
||||
}
|
@@ -2,26 +2,16 @@
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{ ... }:
|
||||
{
|
||||
environment.persistence."/persist"."${home}/.ssh/known_hosts" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
userKnownHostsFile = "${home}/.ssh/known_hosts/default";
|
||||
};
|
||||
|
||||
services.ssh-agent.enable = true;
|
||||
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d ${home}/.ssh/known_hosts 0755 ${user} users"
|
||||
];
|
||||
systemd.user.tmpfiles.rules = [ "d ${home}/.ssh/known_hosts 0755 ${user} users" ];
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user