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,14 +1,17 @@
{ pkgs, enabled, ... }: { enableAttrs, ... }:
{ {
oizys = { oizys =
desktop = enabled; (enableAttrs [
hyprland = enabled; "vpn"
chrome = enabled; "desktop"
docker = enabled; "hyprland"
nix-ld = enabled; "chrome"
vbox = enabled; "docker"
vpn = enabled; "nix-ld"
backups = enabled; "vbox"
"backups"
])
// {
languages = [ languages = [
"misc" "misc"
"nim" "nim"
@ -21,12 +24,6 @@
]; ];
}; };
environment.systemPackages = with pkgs; [
zk
quarto
cachix
];
services.restic.backups.gdrive = { services.restic.backups.gdrive = {
user = "daylin"; user = "daylin";
repository = "rclone:g:archives/othalan"; repository = "rclone:g:archives/othalan";
@ -37,8 +34,5 @@
]; ];
}; };
users.users.daylin.extraGroups = [ users.users.daylin.extraGroups = [ "audio" ];
"docker"
"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 mkDefaultOizysModule
mkOizysModule mkOizysModule
enabled enabled
enableAttrs
; ;
inherit (lib.filesystem) listFilesRecursive; inherit (lib.filesystem) listFilesRecursive;
@ -43,6 +44,7 @@ let
mkDefaultOizysModule mkDefaultOizysModule
mkOizysModule mkOizysModule
enabled enabled
enableAttrs
hostName hostName
; ;
}; };

View file

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

View file

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

View file

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

View file

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