Compare commits

...

3 commits

9 changed files with 106 additions and 132 deletions

View file

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

View file

@ -1,5 +1,5 @@
final: prev: let
inherit (final) hasSuffix mkEnableOption mkIf;
inherit (final) hasSuffix mkEnableOption mkIf mkOption types;
runes = import ../modules/runes;
in rec {
enabled = {enable = true;};
@ -33,4 +33,12 @@ in rec {
options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support";
config = mkIf config.oizys.${attr}.enable content;
};
mkDefaultOizysModule = config: attr: content: {
options.oizys.${attr}.enable = mkOption {
default = true;
description = "enable ${attr} support";
type = types.bool;
};
config = mkIf config.oizys.${attr}.enable content;
};
}

View file

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

View file

@ -1,20 +1,11 @@
{
inputs,
lib,
pkgs,
config,
mkDefaultOizysModule,
...
}: let
inherit (lib) mkOption mkIf types;
cfg = config.oizys.cli;
in {
options.oizys.cli.enable = mkOption {
default = true;
description = "Whether to enable cli.";
type = types.bool;
};
config = mkIf cfg.enable {
}:
mkDefaultOizysModule config "cli" {
programs.direnv.enable = true;
environment.sessionVariables = {
DIRENV_LOG_FORMAT = "direnv: %s";
@ -35,5 +26,4 @@ in {
btop
inputs.tsm.packages.${pkgs.system}.tsm
];
};
}

View file

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

View file

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

View file

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

View file

@ -1,25 +1,12 @@
{
pkgs,
config,
lib,
mkOizysModule,
...
}: let
inherit (lib) mkOizysModule;
in
mkOizysModule config "docker" {
}:
mkOizysModule config "docker" {
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [
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,
lib,
mkOizysModule,
...
}: let
inherit (lib) mkOizysModule;
in
mkOizysModule config "vbox" {
}:
mkOizysModule config "vbox" {
virtualisation.virtualbox = {
host.enable = true;
};
users.extraGroups.vboxusers.members = ["daylin"];
}
}