let's do some inheritance shenanigans

This commit is contained in:
Daylin Morgan 2024-03-21 15:59:10 -05:00
parent 60a6311a0d
commit f3a5290a80
Signed by: daylin
GPG key ID: 950D13E9719334AD
8 changed files with 96 additions and 120 deletions

View file

@ -6,7 +6,7 @@
lib = nixpkgs.lib.extend (import ./extended.nix); lib = nixpkgs.lib.extend (import ./extended.nix);
inherit (builtins) mapAttrs readDir filter listToAttrs; inherit (builtins) mapAttrs readDir filter listToAttrs;
inherit (lib) nixosSystem genAttrs isNixFile; inherit (lib) nixosSystem genAttrs isNixFile mkDefaultOizysModule mkOizysModule;
inherit (lib.filesystem) listFilesRecursive; inherit (lib.filesystem) listFilesRecursive;
inherit (import ./find-modules.nix {inherit lib;}) findModulesList; inherit (import ./find-modules.nix {inherit lib;}) findModulesList;
@ -29,7 +29,7 @@ in rec {
isNixFile isNixFile
(listFilesRecursive (../. + "/hosts/${hostname}")); (listFilesRecursive (../. + "/hosts/${hostname}"));
specialArgs = {inherit inputs lib self;}; specialArgs = {inherit inputs lib self mkDefaultOizysModule mkOizysModule;};
}; };
oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts); oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts);

View file

@ -2,10 +2,9 @@
inputs, inputs,
pkgs, pkgs,
config, config,
lib, mkOizysModule,
... ...
}: let }: let
inherit (lib) mkOizysModule enabled;
lock = pkgs.writeShellApplication { lock = pkgs.writeShellApplication {
name = "lock"; name = "lock";
runtimeInputs = with pkgs; [swaylock]; runtimeInputs = with pkgs; [swaylock];
@ -15,7 +14,7 @@
}; };
in in
mkOizysModule config "hyprland" { mkOizysModule config "hyprland" {
programs.hyprland = enabled; programs.hyprland.enable = true;
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
# Optional, hint electron apps to use wayland: # Optional, hint electron apps to use wayland:
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";

View file

@ -1,13 +1,11 @@
{ {
inputs, inputs,
lib,
pkgs, pkgs,
config, config,
mkDefaultOizysModule,
... ...
}: let }:
inherit (lib) mkDefaultOizysModule; mkDefaultOizysModule config "cli" {
in
mkDefaultOizysModule config "cli" {
programs.direnv.enable = true; programs.direnv.enable = true;
environment.sessionVariables = { environment.sessionVariables = {
DIRENV_LOG_FORMAT = "direnv: %s"; DIRENV_LOG_FORMAT = "direnv: %s";
@ -28,4 +26,4 @@ in
btop btop
inputs.tsm.packages.${pkgs.system}.tsm inputs.tsm.packages.${pkgs.system}.tsm
]; ];
} }

View file

@ -1,11 +1,9 @@
{ {
config, config,
lib,
pkgs, pkgs,
mkOizysModule,
... ...
}: let }:
inherit (lib) mkOizysModule; mkOizysModule config "vpn" {
in
mkOizysModule config "vpn" {
environment.systemPackages = [pkgs.openconnect]; environment.systemPackages = [pkgs.openconnect];
} }

View file

@ -1,12 +1,10 @@
{ {
pkgs, pkgs,
config, config,
lib, mkOizysModule,
... ...
}: let }:
inherit (lib) mkOizysModule; mkOizysModule config "chrome" {
in
mkOizysModule config "chrome" {
programs.chromium = { programs.chromium = {
enable = true; enable = true;
@ -27,4 +25,4 @@ in
]; ];
}) })
]; ];
} }

View file

@ -1,12 +1,10 @@
{ {
config, config,
pkgs, pkgs,
lib, mkOizysModule,
... ...
}: let }:
inherit (lib) mkOizysModule; mkOizysModule config "backups" {
in
mkOizysModule config "backups" {
environment.systemPackages = with pkgs; [rclone]; environment.systemPackages = with pkgs; [rclone];
services.restic.backups.gdrive = { services.restic.backups.gdrive = {
@ -34,4 +32,4 @@ in
RandomizedDelaySec = "5h"; RandomizedDelaySec = "5h";
}; };
}; };
} }

View file

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

View file

@ -1,13 +1,11 @@
{ {
config, config,
lib, mkOizysModule,
... ...
}: let }:
inherit (lib) mkOizysModule; mkOizysModule config "vbox" {
in
mkOizysModule config "vbox" {
virtualisation.virtualbox = { virtualisation.virtualbox = {
host.enable = true; host.enable = true;
}; };
users.extraGroups.vboxusers.members = ["daylin"]; users.extraGroups.vboxusers.members = ["daylin"];
} }