more refactoring

This commit is contained in:
Daylin Morgan 2024-07-03 10:52:28 -05:00
parent bfd738d942
commit 0704db6405
Signed by: daylin
GPG key ID: 950D13E9719334AD
7 changed files with 54 additions and 41 deletions

View file

@ -1,31 +1,28 @@
{ pkgs, enabled, ... }:
{ enableAttrs, ... }:
{
oizys = {
desktop = enabled;
hyprland = enabled;
chrome = enabled;
docker = enabled;
nix-ld = enabled;
vbox = enabled;
vpn = enabled;
backups = enabled;
languages = [
"misc"
"nim"
"node"
"nushell"
"python"
"roc"
"tex"
"zig"
];
};
environment.systemPackages = with pkgs; [
zk
quarto
cachix
];
oizys =
(enableAttrs [
"vpn"
"desktop"
"hyprland"
"chrome"
"docker"
"nix-ld"
"vbox"
"backups"
])
// {
languages = [
"misc"
"nim"
"node"
"nushell"
"python"
"roc"
"tex"
"zig"
];
};
services.restic.backups.gdrive = {
user = "daylin";
@ -37,8 +34,5 @@
];
};
users.users.daylin.extraGroups = [
"docker"
"audio"
];
users.users.daylin.extraGroups = [ "audio" ];
}

10
hosts/othalan/pkgs.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
zk
quarto
cachix
graphviz
nix-du
];
}

View file

@ -16,6 +16,7 @@ let
mkDefaultOizysModule
mkOizysModule
enabled
enableAttrs
;
inherit (lib.filesystem) listFilesRecursive;
@ -43,6 +44,7 @@ let
mkDefaultOizysModule
mkOizysModule
enabled
enableAttrs
hostName
;
};

View file

@ -10,7 +10,7 @@ let
cfg = config.oizys.languages;
zig = inputs.zig2nix.outputs.packages.${pkgs.system}.zig.default.bin;
zls = inputs.zls.outputs.packages.${pkgs.system}.default.overrideAttrs {
nativeBuildInputs = [zig];
nativeBuildInputs = [ zig ];
};
in
{

View file

@ -40,6 +40,7 @@ in
];
options.oizys.desktop.enable = mkEnableOption "is desktop";
options.oizys.docker.enable = mkEnableOption "enable docker support";
config = {
networking.hostName = hostName;
time.timeZone = "US/Central";

View file

@ -5,8 +5,10 @@
...
}:
let
inherit (lib) mkOption mkIf types;
inherit (lib) mkOption mkIf types optional;
cfg = config.users.defaultUser;
isDocker = config.oizys.docker.enable;
isDesktop = config.oizys.desktop.enable;
in
{
options.users.defaultUser = mkOption {
@ -22,10 +24,8 @@ in
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"wheel" # sudo
"docker"
];
extraGroups = [ "wheel" ] ++ optional isDesktop "audio" ++ optional isDocker "docker";
initialHashedPassword = "$2b$05$mGMrDFzf2cXLaoOlVQbGvOBV7UZlDt9dLg9Xqxutb/uHpjF5VrTBO";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkezPIhB+QW37G15ZV3bewydpyEcNlYxfHLlzuk3PH9"

View file

@ -1,10 +1,16 @@
{
pkgs,
config,
mkOizysModule,
lib,
...
}:
mkOizysModule config "docker" {
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [ lazydocker ];
let
inherit (lib) mkIf;
cfg = config.oizys.docker;
in
{
config = mkIf cfg.enable {
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [ lazydocker ];
};
}