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); 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,16 +29,14 @@ 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);
oizysPkg = forAllSystems ( oizysPkg = forAllSystems (
pkgs: let pkgs: rec {
pkg = pkgs.callPackage ../oizys {}; oizys = pkgs.callPackage ../oizys {};
in { default = oizys;
oizys = pkg;
default = pkg;
} }
); );
devShells = forAllSystems ( devShells = forAllSystems (

View file

@ -1,5 +1,5 @@
final: prev: let final: prev: let
inherit (final) hasSuffix mkEnableOption mkIf; inherit (final) hasSuffix mkEnableOption mkIf mkOption types;
runes = import ../modules/runes; runes = import ../modules/runes;
in rec { in rec {
enabled = {enable = true;}; enabled = {enable = true;};
@ -33,4 +33,12 @@ in rec {
options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support"; options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support";
config = mkIf config.oizys.${attr}.enable content; 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, 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,39 +1,29 @@
{ {
inputs, inputs,
lib,
pkgs, pkgs,
config, config,
mkDefaultOizysModule,
... ...
}: let }:
inherit (lib) mkOption mkIf types; mkDefaultOizysModule config "cli" {
cfg = config.oizys.cli; programs.direnv.enable = true;
in { environment.sessionVariables = {
options.oizys.cli.enable = mkOption { DIRENV_LOG_FORMAT = "direnv: %s";
default = true;
description = "Whether to enable cli.";
type = types.bool;
}; };
config = mkIf cfg.enable { environment.systemPackages = with pkgs; [
programs.direnv.enable = true; chezmoi
environment.sessionVariables = { zoxide
DIRENV_LOG_FORMAT = "direnv: %s"; lsd
}; fzf
environment.systemPackages = with pkgs; [ # utils
chezmoi fd
zoxide bat
lsd delta
fzf ripgrep
# utils btop
fd inputs.tsm.packages.${pkgs.system}.tsm
bat ];
delta
ripgrep
btop
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 environment.systemPackages = [pkgs.openconnect];
mkOizysModule config "vpn" { }
environment.systemPackages = [pkgs.openconnect];
}

View file

@ -1,30 +1,28 @@
{ {
pkgs, pkgs,
config, config,
lib, mkOizysModule,
... ...
}: let }:
inherit (lib) mkOizysModule; mkOizysModule config "chrome" {
in programs.chromium = {
mkOizysModule config "chrome" { enable = true;
programs.chromium = {
enable = true;
extensions = [ extensions = [
"nngceckbapebfimnlniiiahkandclblb" # bitwarden "nngceckbapebfimnlniiiahkandclblb" # bitwarden
"gfbliohnnapiefjpjlpjnehglfpaknnc" # surfingkeys "gfbliohnnapiefjpjlpjnehglfpaknnc" # surfingkeys
"pbmlfaiicoikhdbjagjbglnbfcbcojpj" # simplify gmail "pbmlfaiicoikhdbjagjbglnbfcbcojpj" # simplify gmail
"oemmndcbldboiebfnladdacbdfmadadm" # pdf viewer "oemmndcbldboiebfnladdacbdfmadadm" # pdf viewer
"clngdbkpkpeebahjckkjfobafhncgmne" # stylus "clngdbkpkpeebahjckkjfobafhncgmne" # stylus
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin "cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
];
};
environment.systemPackages = with pkgs; [
(google-chrome.override {
commandLineArgs = [
"--force-dark-mode"
];
})
]; ];
} };
environment.systemPackages = with pkgs; [
(google-chrome.override {
commandLineArgs = [
"--force-dark-mode"
];
})
];
}

View file

@ -1,37 +1,35 @@
{ {
config, config,
pkgs, pkgs,
lib, mkOizysModule,
... ...
}: let }:
inherit (lib) mkOizysModule; mkOizysModule config "backups" {
in environment.systemPackages = with pkgs; [rclone];
mkOizysModule config "backups" {
environment.systemPackages = with pkgs; [rclone];
services.restic.backups.gdrive = { services.restic.backups.gdrive = {
# BUG: if .conda/environments.txt doesn't exist then this won't work # BUG: if .conda/environments.txt doesn't exist then this won't work
# workaround for now `mkdir ~/.conda && touch ~/.conda/environments.txt` # workaround for now `mkdir ~/.conda && touch ~/.conda/environments.txt`
extraBackupArgs = [ extraBackupArgs = [
"--exclude-file /home/daylin/.config/restic/excludes.txt" "--exclude-file /home/daylin/.config/restic/excludes.txt"
"--exclude-file /home/daylin/.conda/environments.txt" "--exclude-file /home/daylin/.conda/environments.txt"
"--verbose" "--verbose"
"--one-file-system" "--one-file-system"
"--tag systemd.timer" "--tag systemd.timer"
]; ];
pruneOpts = [ pruneOpts = [
"--verbose" "--verbose"
"--tag systemd.timer" "--tag systemd.timer"
"--keep-daily 7" "--keep-daily 7"
"--keep-weekly 4" "--keep-weekly 4"
"--keep-monthly 12" "--keep-monthly 12"
"--keep-yearly 3" "--keep-yearly 3"
]; ];
timerConfig = { timerConfig = {
OnCalendar = "00:05"; OnCalendar = "00:05";
Persistent = true; Persistent = true;
RandomizedDelaySec = "5h"; RandomizedDelaySec = "5h";
};
}; };
} };
}

View file

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