mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-09 12:20:04 +00:00
🚧 Finish user configuration loading and implement working workstation setup
This commit is contained in:
parent
54edba0070
commit
09c06d34e5
8 changed files with 137 additions and 16 deletions
32
modules/nixos/archetypes/workstation/default.nix
Normal file
32
modules/nixos/archetypes/workstation/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkDefault;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.archetypes.workstation;
|
||||
in {
|
||||
options.${namespace}.archetypes.workstation = {
|
||||
enable = mkEnableOption "the workstation archetype.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
${namespace} = {
|
||||
# Basic system functionality
|
||||
system.grub.enable = true;
|
||||
system.networking.enable = true;
|
||||
system.kernel.enable = true;
|
||||
|
||||
# Services
|
||||
services.docker.enable = true;
|
||||
|
||||
# Desktop environment
|
||||
desktop.gnome.enable = true;
|
||||
};
|
||||
|
||||
time.timeZone = mkDefault "Europe/Berlin";
|
||||
};
|
||||
}
|
20
modules/nixos/services/docker/default.nix
Normal file
20
modules/nixos/services/docker/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.services.docker;
|
||||
in {
|
||||
options.${namespace}.services.docker = {
|
||||
enable = mkEnableOption "the docker service.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable docker
|
||||
virtualisation.docker.enable = true;
|
||||
};
|
||||
}
|
22
modules/nixos/system/kernel/default.nix
Normal file
22
modules/nixos/system/kernel/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
inherit (self.lib) mkOpt;
|
||||
|
||||
cfg = config.${namespace}.system.kernel;
|
||||
in {
|
||||
options.${namespace}.system.kernel = {
|
||||
enable = mkEnableOption "Modify the standard kernel settings";
|
||||
version = mkOpt lib.types.str "linuxPackages_latest" "Set the kernel version to be used by your system";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelPackages = pkgs.${cfg.version};
|
||||
};
|
||||
}
|
19
modules/nixos/system/networking/default.nix
Normal file
19
modules/nixos/system/networking/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.networking;
|
||||
in {
|
||||
options.${namespace}.system.networking = {
|
||||
enable = mkEnableOption "networking.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking.networkmanager.enable = true;
|
||||
};
|
||||
}
|
|
@ -39,6 +39,9 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
# TODO: fix this
|
||||
#nix.settings.trusted-users = ["root" (lib.forEach cfg (username: toString username))];
|
||||
|
||||
# Manage users declaratively and map userConfig to users.users by name;
|
||||
users.mutableUsers = false;
|
||||
users.users = lib.mapAttrs (username: userConfig:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue