no more rootless docker
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
{ pkgs, lib, modulesPath, ... }:
|
{ pkgs, lib, modulesPath, ... }:
|
||||||
let
|
let
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.05";
|
||||||
|
userName = "myuser";
|
||||||
|
repoPath = "/srv/nix-docker";
|
||||||
unstable = import <nixos-unstable> {};
|
unstable = import <nixos-unstable> {};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -9,7 +11,11 @@ in
|
|||||||
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
||||||
(import "${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz}/nixos")
|
(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")
|
(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")
|
||||||
./users.nix
|
(import ./users.nix {
|
||||||
|
inherit stateVersion;
|
||||||
|
inherit userName;
|
||||||
|
inherit repoPath;
|
||||||
|
})
|
||||||
# ./mounts.nix
|
# ./mounts.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -33,10 +39,10 @@ in
|
|||||||
virtualisation.docker = {
|
virtualisation.docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# https://docs.docker.com/engine/security/rootless/
|
# https://docs.docker.com/engine/security/rootless/
|
||||||
rootless = {
|
# rootless = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
setSocketVariable = true;
|
# setSocketVariable = true;
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
services.vscode-server.enable = true;
|
services.vscode-server.enable = true;
|
||||||
|
|
||||||
|
|||||||
14
users.nix
14
users.nix
@@ -1,13 +1,21 @@
|
|||||||
{ ... }:
|
{ stateVersion, userName, repoPath, ... }:
|
||||||
{
|
{
|
||||||
users.users.myuser = {
|
users.users.${userName} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"wheel" # needed for sudo without password
|
"wheel" # needed for sudo without password
|
||||||
# "docker" # needed for docker without sudo
|
"docker" # needed for docker without sudo
|
||||||
];
|
];
|
||||||
openssh.authorizedKeys.keyFiles = [
|
openssh.authorizedKeys.keyFiles = [
|
||||||
"/root/.ssh/authorized_keys" # should already have your public SSH key inside
|
"/root/.ssh/authorized_keys" # should already have your public SSH key inside
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
users.${userName} = {
|
||||||
|
home.stateVersion = stateVersion;
|
||||||
|
imports = [ (import ./git.nix { inherit repoPath; }) ];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user