adds docker to dnsc-vps-sm

This commit is contained in:
Dennis 2025-07-07 09:09:28 +02:00
parent 1736bb1e6d
commit c93db5a8f0
3 changed files with 34 additions and 11 deletions

View file

@ -4,3 +4,4 @@
- [ ] Creation of SSH Keys - [ ] Creation of SSH Keys
- [ ] Restic root SSH config & keys (even better: do not run restic as root) - [ ] Restic root SSH config & keys (even better: do not run restic as root)
- [ ] Splitpro

View file

@ -5,7 +5,8 @@
config, config,
pkgs, pkgs,
... ...
}: { }:
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./networking.nix ./networking.nix
@ -14,6 +15,7 @@
../../modules/vaultwarden ../../modules/vaultwarden
../../modules/uptime-kuma ../../modules/uptime-kuma
../../modules/homepage ../../modules/homepage
../../modules/docker
]; ];
# Secrets # Secrets
@ -42,11 +44,11 @@
# Launch fish shell # Launch fish shell
programs.bash = { programs.bash = {
interactiveShellInit = '' interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi fi
''; '';
}; };
@ -84,7 +86,10 @@
description = "dennis"; description = "dennis";
initialPassword = "admin"; initialPassword = "admin";
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; extraGroups = [
"wheel"
"networkmanager"
];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
@ -101,7 +106,10 @@
}; };
# Enable new Nix CLI and flakes # Enable new Nix CLI and flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Install system wide packages # Install system wide packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -109,6 +117,7 @@
btop btop
neovim neovim
wget wget
docker-compose
]; ];
# Programs # Programs
@ -160,6 +169,9 @@
virtualHosts."home.dnsc.io".extraConfig = '' virtualHosts."home.dnsc.io".extraConfig = ''
reverse_proxy localhost:9001 reverse_proxy localhost:9001
''; '';
virtualHosts."split.dnsc.io".extraConfig = ''
reverse_proxy localhost:9002
'';
}; };
# Environment variables # Environment variables
@ -175,4 +187,3 @@
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; system.stateVersion = "23.11";
} }

View file

@ -0,0 +1,11 @@
{
virtualization.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.dennis.extraGroups = [ "docker" ];
}