system: user groups are now only set if the corresponding module is enabled
This commit is contained in:
parent
2a3c822b56
commit
2c91ce9e07
|
@ -1,9 +1,11 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.profile.docker;
|
cfg = config.profile.docker;
|
||||||
|
username = config.profile.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
users.users.${username}.extraGroups = [ "docker" ];
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
virtualisation.docker.autoPrune.enable = true;
|
virtualisation.docker.autoPrune.enable = true;
|
||||||
virtualisation.oci-containers.backend = "docker";
|
virtualisation.oci-containers.backend = "docker";
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.profile.android;
|
cfg = config.profile.android;
|
||||||
|
username = config.profile.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
users.users.${username}.extraGroups = [ "adbusers" ];
|
||||||
programs.adb.enable = true;
|
programs.adb.enable = true;
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
androidenv.androidPkgs_9_0.platform-tools
|
androidenv.androidPkgs_9_0.platform-tools
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.profile.printing;
|
cfg = config.profile.printing;
|
||||||
|
username = config.profile.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
users.users.${username}.extraGroups = [ "lp" ];
|
||||||
services.printing = {
|
services.printing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
drivers = [ pkgs.brlaser ]; # Brother Laser Printer
|
drivers = [ pkgs.brlaser ]; # Brother Laser Printer
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.profile.scanner;
|
cfg = config.profile.scanner;
|
||||||
|
username = config.profile.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
users.users.${username}.extraGroups = [ "scanner" ];
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
skanlite
|
skanlite
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.profile.podman;
|
cfg = config.profile.podman;
|
||||||
|
username = config.profile.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
users.users.${username}.extraGroups = [ "podman" ];
|
||||||
# services.caddy.enable = true;
|
# services.caddy.enable = true;
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
dive # look into docker image layers
|
dive # look into docker image layers
|
||||||
|
@ -21,7 +23,7 @@ in
|
||||||
defaultNetwork.settings.dns_enabled = true;
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
};
|
};
|
||||||
# https://madison-technologies.com/take-your-nixos-container-config-and-shove-it/
|
# https://madison-technologies.com/take-your-nixos-container-config-and-shove-it/
|
||||||
networking.firewall.interfaces.podman1 = {
|
networking.firewall.interfaces."podman[0-9]+" = {
|
||||||
allowedUDPPorts = [ 53 ]; # this needs to be there so that containers can look eachother's names up over DNS
|
allowedUDPPorts = [ 53 ]; # this needs to be there so that containers can look eachother's names up over DNS
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
users.users.${user} = {
|
users.users.${user} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = fullName;
|
description = fullName;
|
||||||
extraGroups = [ "networkmanager" "wheel" "docker" "adbusers" "scanner" "lp" "podman" ];
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue