From 44f1b67d11b88f71c1af18f70becce95ef7b719c Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sun, 17 Nov 2024 20:52:28 +0000 Subject: [PATCH] no more rootless docker --- configuration.nix | 16 +++++++++++----- users.nix | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index ddbc554..16e4b4f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,6 +1,8 @@ { pkgs, lib, modulesPath, ... }: let stateVersion = "24.05"; + userName = "myuser"; + repoPath = "/srv/nix-docker"; unstable = import {}; in { @@ -9,7 +11,11 @@ in (modulesPath + "/virtualisation/proxmox-lxc.nix") (import "${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz}/nixos") (fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master") - ./users.nix + (import ./users.nix { + inherit stateVersion; + inherit userName; + inherit repoPath; + }) # ./mounts.nix ]; @@ -33,10 +39,10 @@ in virtualisation.docker = { enable = true; # https://docs.docker.com/engine/security/rootless/ - rootless = { - enable = true; - setSocketVariable = true; - }; + # rootless = { + # enable = true; + # setSocketVariable = true; + # }; }; services.vscode-server.enable = true; diff --git a/users.nix b/users.nix index a0d36ff..b1edf33 100644 --- a/users.nix +++ b/users.nix @@ -1,13 +1,21 @@ -{ ... }: +{ stateVersion, userName, repoPath, ... }: { - users.users.myuser = { + users.users.${userName} = { isNormalUser = true; extraGroups = [ "wheel" # needed for sudo without password - # "docker" # needed for docker without sudo + "docker" # needed for docker without sudo ]; openssh.authorizedKeys.keyFiles = [ "/root/.ssh/authorized_keys" # should already have your public SSH key inside ]; }; -} \ No newline at end of file + + home-manager = { + useGlobalPkgs = true; + users.${userName} = { + home.stateVersion = stateVersion; + imports = [ (import ./git.nix { inherit repoPath; }) ]; + }; + }; +}