chore: make namespace generic so people can copy easier

This commit is contained in:
Christoph Hollizeck 2024-10-11 00:17:03 +02:00
parent 12d58b9636
commit 0b694ff210
45 changed files with 249 additions and 217 deletions

View file

@ -1,17 +1,19 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
pkgs, pkgs,
... ...
}: }:
with lib; with lib.${namespace};
with lib.wyrdgard;
let let
cfg = config.wyrdgard.apps.cli-apps.fish; inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps.cli-apps.fish;
in in
{ {
options.wyrdgard.apps.cli-apps.fish = with types; { options.${namespace}.apps.cli-apps.fish = {
enable = mkBoolOpt true "Whether or not to enable the fish shell"; enable = mkBoolOpt true "Whether or not to enable the fish shell";
}; };

View file

@ -1,11 +1,16 @@
{ lib, config, ... }: {
with lib; config,
with lib.wyrdgard; lib,
namespace,
...
}:
let let
cfg = config.wyrdgard.apps.cli-apps.home-manager; inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt enabled;
cfg = config.${namespace}.apps.cli-apps.home-manager;
in in
{ {
options.wyrdgard.apps.cli-apps.home-manager = { options.${namespace}.apps.cli-apps.home-manager = {
enable = mkBoolOpt true "Enable home-manager"; enable = mkBoolOpt true "Enable home-manager";
}; };

View file

@ -1,17 +1,17 @@
{ {
options,
config, config,
lib, lib,
pkgs, namespace,
options,
... ...
}: }:
with lib;
with lib.wyrdgard;
let let
cfg = config.wyrdgard.apps.cli-apps.starship; inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps.cli-apps.starship;
in in
{ {
options.wyrdgard.apps.cli-apps.starship = with types; { options.${namespace}.apps.cli-apps.starship = {
enable = mkBoolOpt true "Whether or not to enable starship shell"; enable = mkBoolOpt true "Whether or not to enable starship shell";
}; };

View file

@ -1,16 +1,17 @@
{ {
lib,
config, config,
lib,
namespace,
pkgs, pkgs,
... ...
}: }:
with lib;
with lib.wyrdgard;
let let
cfg = config.wyrdgard.apps.graphviz; inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps.graphviz;
in in
{ {
options.wyrdgard.apps.graphviz = { options.${namespace}.apps.graphviz = {
enable = mkBoolOpt true "Whether or not you want to install graphviz"; enable = mkBoolOpt true "Whether or not you want to install graphviz";
}; };

View file

@ -1,17 +1,17 @@
{ {
options,
config, config,
lib, lib,
pkgs, namespace,
options,
... ...
}: }:
with lib;
with lib.wyrdgard;
let let
cfg = config.wyrdgard.tools.direnv; inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt enabled;
cfg = config.${namespace}.tools.direnv;
in in
{ {
options.wyrdgard.tools.direnv = with types; { options.${namespace}.tools.direnv = {
enable = mkBoolOpt false "Whether or not to enable direnv."; enable = mkBoolOpt false "Whether or not to enable direnv.";
}; };

View file

@ -1,18 +1,18 @@
{ {
options,
lib,
config, config,
pkgs, lib,
namespace,
options,
... ...
}: }:
with lib; with lib.${namespace};
with lib.wyrdgard;
let let
cfg = config.wyrdgard.tools.git; inherit (lib) mkIf types;
user = config.wyrdgard.user; cfg = config.${namespace}.tools.git;
user = config.${namespace}.user;
in in
{ {
options.wyrdgard.tools.git = { options.${namespace}.tools.git = {
enable = mkBoolOpt true "Enable Git (Default true)"; enable = mkBoolOpt true "Enable Git (Default true)";
userName = mkOpt types.str user.fullName "The name to configure git with."; userName = mkOpt types.str user.fullName "The name to configure git with.";
userEmail = mkOpt types.str user.email "The email to configure git with."; userEmail = mkOpt types.str user.email "The email to configure git with.";

View file

@ -1,8 +1,7 @@
{ {
lib, lib,
config, config,
pkgs, namespace,
osConfig ? { },
... ...
}: }:
let let
@ -12,23 +11,14 @@ let
mkDefault mkDefault
mkMerge mkMerge
; ;
inherit (lib.wyrdgard) mkOpt; inherit (lib.${namespace}) mkOpt;
cfg = config.wyrdgard.user; cfg = config.${namespace}.user;
is-linux = pkgs.stdenv.isLinux; home-directory = if cfg.name == null then null else "/home/${cfg.name}";
is-darwin = pkgs.stdenv.isDarwin;
home-directory =
if cfg.name == null then
null
else if is-darwin then
"/Users/${cfg.name}"
else
"/home/${cfg.name}";
in in
{ {
options.wyrdgard.user = { options.${namespace}.user = {
enable = mkOpt types.bool true "Whether to configure the user account."; enable = mkOpt types.bool true "Whether to configure the user account.";
name = mkOpt (types.nullOr types.str) (config.snowfallorg.user.name or "cholli" name = mkOpt (types.nullOr types.str) (config.snowfallorg.user.name or "cholli"
) "The user account."; ) "The user account.";
@ -44,11 +34,11 @@ in
assertions = [ assertions = [
{ {
assertion = cfg.name != null; assertion = cfg.name != null;
message = "wyrdgard.user.name must be set"; message = "${namespace}.user.name must be set";
} }
{ {
assertion = cfg.home != null; assertion = cfg.home != null;
message = "wyrdgard.user.home must be set"; message = "${namespace}.user.home must be set";
} }
]; ];

View file

@ -1,17 +1,19 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
pkgs, pkgs,
... ...
}: }:
with lib;
with lib.wyrdgard;
let let
cfg = config.wyrdgard.apps._1password; inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps._1password;
in in
{ {
options.wyrdgard.apps._1password = with types; { options.${namespace}.apps._1password = {
enable = mkBoolOpt true "Enable 1Password"; enable = mkBoolOpt true "Enable 1Password";
}; };
@ -20,7 +22,7 @@ in
_1password.enable = true; _1password.enable = true;
_1password-gui = { _1password-gui = {
enable = true; enable = true;
polkitPolicyOwners = [ config.wyrdgard.user.name ]; polkitPolicyOwners = [ config.${namespace}.user.name ];
}; };
}; };
}; };

View file

@ -2,13 +2,14 @@
config, config,
inputs, inputs,
lib, lib,
namespace,
pkgs, pkgs,
system, system,
... ...
}: }:
let let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.wyrdgard.apps.cli-apps.helix; cfg = config.${namespace}.apps.cli-apps.helix;
cachix-url = "https://helix.cachix.org"; cachix-url = "https://helix.cachix.org";
cachix-key = "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="; cachix-key = "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=";
@ -16,7 +17,7 @@ let
helix-pkg = inputs.helix.packages.${system}.default; helix-pkg = inputs.helix.packages.${system}.default;
in in
{ {
options.wyrdgard.apps.cli-apps.helix = { options.${namespace}.apps.cli-apps.helix = {
enable = mkEnableOption "Whether to enable nixvim or not"; enable = mkEnableOption "Whether to enable nixvim or not";
}; };
@ -25,7 +26,7 @@ in
systemPackages = [ helix-pkg ]; systemPackages = [ helix-pkg ];
}; };
wyrdgard = { ${namespace} = {
home = { home = {
extraOptions = { extraOptions = {
programs.helix = { programs.helix = {

View file

@ -1,16 +1,17 @@
{ {
config, config,
lib, lib,
namespace,
pkgs, pkgs,
... ...
}: }:
let let
inherit (lib) mkIf; inherit (lib) mkIf;
inherit (lib.wyrdgard) mkBoolOpt; inherit (lib.${namespace}) mkBoolOpt;
cfg = config.wyrdgard.apps.cli-apps.nixvim; cfg = config.${namespace}.apps.cli-apps.nixvim;
in in
{ {
options.wyrdgard.apps.cli-apps.nixvim = { options.${namespace}.apps.cli-apps.nixvim = {
enable = mkBoolOpt false "Whether to enable nixvim or not (Default true)"; enable = mkBoolOpt false "Whether to enable nixvim or not (Default true)";
}; };
@ -28,7 +29,7 @@ in
}; };
}; };
wyrdgard.home = { ${namespace}.home = {
extraOptions = { extraOptions = {
# Use Neovim for Git diffs. # Use Neovim for Git diffs.
programs.fish.shellAliases.vimdiff = "nvim -d"; programs.fish.shellAliases.vimdiff = "nvim -d";

View file

@ -1,17 +1,18 @@
{ {
options,
config, config,
lib, lib,
namespace,
pkgs, pkgs,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.apps.discord; cfg = config.${namespace}.apps.discord;
in in
{ {
options.wyrdgard.apps.discord = with types; { options.${namespace}.apps.discord = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration"; enable = mkBoolOpt false "Whether or not to enable basic configuration";
}; };

View file

@ -1,16 +1,17 @@
{ {
config, config,
lib, lib,
namespace,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.apps.obs-studio; cfg = config.${namespace}.apps.obs-studio;
in in
{ {
options.wyrdgard.apps.obs-studio = with types; { options.${namespace}.apps.obs-studio = with types; {
enable = mkBoolOpt false "Whether or not to enable obs-studio"; enable = mkBoolOpt false "Whether or not to enable obs-studio";
}; };

View file

@ -1,16 +1,17 @@
{ {
config, config,
lib, lib,
namespace,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.apps.teamspeak; cfg = config.${namespace}.apps.teamspeak;
in in
{ {
options.wyrdgard.apps.teamspeak = with types; { options.${namespace}.apps.teamspeak = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration"; enable = mkBoolOpt false "Whether or not to enable basic configuration";
}; };

View file

@ -1,17 +1,18 @@
{ {
options,
config, config,
lib, lib,
namespace,
pkgs, pkgs,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.apps.vivaldi; cfg = config.${namespace}.apps.vivaldi;
in in
{ {
options.wyrdgard.apps.vivaldi = with types; { options.${namespace}.apps.vivaldi = with types; {
enable = mkBoolOpt false "Whether or not to enable vivaldi browser"; enable = mkBoolOpt false "Whether or not to enable vivaldi browser";
}; };

View file

@ -1,20 +1,20 @@
{ {
config, config,
lib,
pkgs,
system,
inputs, inputs,
lib,
namespace,
system,
... ...
}: }:
let let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.wyrdgard.apps.zen-browser; cfg = config.${namespace}.apps.zen-browser;
zenbrowser = inputs.zen-browser.packages."${system}".default; zenbrowser = inputs.zen-browser.packages."${system}".default;
in in
{ {
options.wyrdgard.apps.zen-browser = { options.${namespace}.apps.zen-browser = {
enable = mkEnableOption "Whether or not to enable zen browser"; enable = mkEnableOption "Whether or not to enable zen browser";
}; };

View file

@ -1,22 +1,23 @@
{ {
options,
config, config,
lib, lib,
namespace,
pkgs, pkgs,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.archetypes.gaming; cfg = config.${namespace}.archetypes.gaming;
in in
{ {
options.wyrdgard.archetypes.gaming = with types; { options.${namespace}.archetypes.gaming = with types; {
enable = mkBoolOpt false "Whether or not to enable the gaming archetype."; enable = mkBoolOpt false "Whether or not to enable the gaming archetype.";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
wyrdgard = { ${namespace} = {
submodules = { submodules = {
basics = enabled; basics = enabled;
games = enabled; games = enabled;

View file

@ -28,7 +28,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ]; environment.systemPackages = [ cfg.package ];
wyrdgard.home.file = { ${namespace}.home.file = {
".config/rofi/config.rasi".source = ./config.rasi; ".config/rofi/config.rasi".source = ./config.rasi;
}; };
}; };

View file

@ -15,7 +15,7 @@ let
mkIf mkIf
types types
; ;
inherit (lib.wyrdgard) enabled; inherit (lib.${namespace}) enabled;
in in
{ {
options.${namespace}.desktop.addons.waybar = { options.${namespace}.desktop.addons.waybar = {
@ -39,7 +39,7 @@ in
noto-fonts-cjk-sans noto-fonts-cjk-sans
]; ];
wyrdgard.home.file = { ${namespace}.home.file = {
".config/waybar/config.jsonc".source = ./config.jsonc; ".config/waybar/config.jsonc".source = ./config.jsonc;
".config/waybar/style.css".source = ./style.css; ".config/waybar/style.css".source = ./style.css;
}; };

View file

@ -1,15 +1,16 @@
{ {
lib,
config, config,
lib,
namespace,
pkgs, pkgs,
... ...
}: }:
let let
user = config.wyrdgard.user.name; user = config.${namespace}.user.name;
in in
{ {
config = { config = {
wyrdgard.home.extraOptions = { ${namespace}.home.extraOptions = {
dconf.settings = { dconf.settings = {
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
color-scheme = "prefer-dark"; color-scheme = "prefer-dark";

View file

@ -7,7 +7,7 @@
namespace, namespace,
... ...
}: }:
with lib.wyrdgard; with lib.${namespace};
let let
inherit (lib) inherit (lib)
mkIf mkIf
@ -29,7 +29,7 @@ let
if [[ $running != "" ]]; then if [[ $running != "" ]]; then
hyprctl dispatch workspace $running hyprctl dispatch workspace $running
else else
# always open on w/space 4 # always open on w/space 4
hyprctl dispatch workspace 4 hyprctl dispatch workspace 4
1password& 1password&
fi fi
@ -79,7 +79,7 @@ in
}; };
}; };
wyrdgard = { ${namespace} = {
desktop.addons = { desktop.addons = {
waybar = enabled; waybar = enabled;
rofi = { rofi = {

View file

@ -6,7 +6,7 @@
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.${namespace}.desktop.kde; cfg = config.${namespace}.desktop.kde;
in in

View file

@ -1,16 +1,17 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.home; cfg = config.${namespace}.home;
in in
{ {
options.wyrdgard.home = with types; { options.${namespace}.home = with types; {
file = mkOpt attrs { } (mdDoc "A set of files to be managed by home-manager's `home.file`."); file = mkOpt attrs { } (mdDoc "A set of files to be managed by home-manager's `home.file`.");
configFile = mkOpt attrs { } ( configFile = mkOpt attrs { } (
mdDoc "A set of files to be managed by home-manager's `xdg.configFile`." mdDoc "A set of files to be managed by home-manager's `xdg.configFile`."
@ -19,14 +20,15 @@ in
}; };
config = { config = {
wyrdgard.home.extraOptions = { ${namespace}.home.extraOptions = {
home.stateVersion = config.system.stateVersion; home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.wyrdgard.home.file; home.file = mkAliasDefinitions options.${namespace}.home.file;
xdg.enable = true; xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.wyrdgard.home.configFile; xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile;
}; };
snowfallorg.users.${config.wyrdgard.user.name}.home.config = config.wyrdgard.home.extraOptions; snowfallorg.users.${config.${namespace}.user.name}.home.config =
config.${namespace}.home.extraOptions;
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;

View file

@ -1,13 +1,14 @@
{ {
config, config,
pkgs,
lib, lib,
namespace,
pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.nix; cfg = config.${namespace}.nix;
substituters-submodule = types.submodule ( substituters-submodule = types.submodule (
{ name, ... }: { name, ... }:
@ -19,7 +20,7 @@ let
); );
in in
{ {
options.wyrdgard.nix = with types; { options.${namespace}.nix = with types; {
enable = mkBoolOpt true "Whether or not to manage nix configuration."; enable = mkBoolOpt true "Whether or not to manage nix configuration.";
package = mkOpt package pkgs.lix "Which nix package to use."; package = mkOpt package pkgs.lix "Which nix package to use.";
@ -50,7 +51,7 @@ in
let let
users = [ users = [
"root" "root"
config.wyrdgard.user.name config.${namespace}.user.name
]; ];
in in
{ {
@ -73,7 +74,7 @@ in
cfg.default-substituter.key cfg.default-substituter.key
] ++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters); ] ++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters);
} }
// (lib.optionalAttrs config.wyrdgard.tools.direnv.enable { // (lib.optionalAttrs config.${namespace}.tools.direnv.enable {
keep-outputs = true; keep-outputs = true;
keep-derivations = true; keep-derivations = true;
}); });

View file

@ -1,15 +1,16 @@
{ {
options,
config, config,
pkgs,
lib,
inputs, inputs,
lib,
namespace,
options,
pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.security.gpg; cfg = config.${namespace}.security.gpg;
gpgConf = "${inputs.gpg-base-conf}/gpg.conf"; gpgConf = "${inputs.gpg-base-conf}/gpg.conf";
@ -25,7 +26,7 @@ let
''; '';
in in
{ {
options.wyrdgard.security.gpg = with types; { options.${namespace}.security.gpg = with types; {
enable = mkBoolOpt false "Wether or not to enable GPG."; enable = mkBoolOpt false "Wether or not to enable GPG.";
agentTimeout = mkOpt int 5 "The amount of time to wait before continuing with shell init."; agentTimeout = mkOpt int 5 "The amount of time to wait before continuing with shell init.";
}; };
@ -56,7 +57,7 @@ in
}; };
}; };
wyrdgard = { ${namespace} = {
home.file = { home.file = {
".gnupg/.keep".text = ""; ".gnupg/.keep".text = "";

View file

@ -7,7 +7,7 @@
}: }:
let let
inherit (lib) mkIf; inherit (lib) mkIf;
inherit (lib.wyrdgard) mkBoolOpt; inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.security.keyring; cfg = config.${namespace}.security.keyring;
in in
{ {

View file

@ -1,16 +1,17 @@
{ {
config, config,
pkgs,
lib, lib,
namespace,
pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.security.sops; cfg = config.${namespace}.security.sops;
in in
{ {
options.wyrdgard.security.sops = with types; { options.${namespace}.security.sops = with types; {
enable = mkBoolOpt true "Enable sops (Default true)"; enable = mkBoolOpt true "Enable sops (Default true)";
}; };

View file

@ -1,12 +1,17 @@
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.security.syncthing; cfg = config.${namespace}.security.syncthing;
user = config.wyrdgard.user; user = config.${namespace}.user;
in in
{ {
options.wyrdgard.security.syncthing = with types; { options.${namespace}.security.syncthing = with types; {
enable = mkEnableOption "Enable Syncthing"; enable = mkEnableOption "Enable Syncthing";
}; };

View file

@ -1,16 +1,17 @@
{ {
lib, lib,
config, config,
namespace,
pkgs, pkgs,
... ...
}: }:
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.services.factorio-server; cfg = config.${namespace}.services.factorio-server;
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
in in
{ {
options.wyrdgard.services.factorio-server = { options.${namespace}.services.factorio-server = {
enable = mkEnableOption "Enable Factorio Headless Server"; enable = mkEnableOption "Enable Factorio Headless Server";
}; };

View file

@ -1,16 +1,17 @@
{ {
config, config,
lib, lib,
namespace,
pkgs, pkgs,
... ...
}: }:
let let
inherit (lib) mkIf; inherit (lib) mkIf;
inherit (lib.wyrdgard) mkBoolOpt enabled; inherit (lib.${namespace}) mkBoolOpt enabled;
cfg = config.wyrdgard.submodules.basics-wsl; cfg = config.${namespace}.submodules.basics-wsl;
in in
{ {
options.wyrdgard.submodules.basics-wsl = { options.${namespace}.submodules.basics-wsl = {
enable = mkBoolOpt false "Whether or not to enable basic configuration."; enable = mkBoolOpt false "Whether or not to enable basic configuration.";
}; };
@ -28,7 +29,7 @@ in
wsl-open wsl-open
]; ];
wyrdgard = { ${namespace} = {
nix = enabled; nix = enabled;
apps.cli-apps.helix = enabled; apps.cli-apps.helix = enabled;

View file

@ -1,17 +1,18 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.submodules.basics; cfg = config.${namespace}.submodules.basics;
in in
{ {
options.wyrdgard.submodules.basics = with types; { options.${namespace}.submodules.basics = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration."; enable = mkBoolOpt false "Whether or not to enable basic configuration.";
}; };
@ -31,7 +32,7 @@ in
htop htop
]; ];
wyrdgard = { ${namespace} = {
nix = enabled; nix = enabled;
apps.cli-apps.helix = enabled; apps.cli-apps.helix = enabled;

View file

@ -1,24 +1,25 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.submodules.games; cfg = config.${namespace}.submodules.games;
in in
{ {
options.wyrdgard.submodules.games = with types; { options.${namespace}.submodules.games = with types; {
enable = mkBoolOpt false "Whether or not you want to enable steam and other games"; enable = mkBoolOpt false "Whether or not you want to enable steam and other games";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ prismlauncher ]; environment.systemPackages = with pkgs; [ prismlauncher ];
wyrdgard = { ${namespace} = {
apps = { apps = {
steam = enabled; steam = enabled;
}; };

View file

@ -1,20 +1,21 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.submodules.socials; cfg = config.${namespace}.submodules.socials;
in in
{ {
options.wyrdgard.submodules.socials = with types; { options.${namespace}.submodules.socials = with types; {
enable = mkBoolOpt false "Whether to enable social apps"; enable = mkBoolOpt false "Whether to enable social apps";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
wyrdgard = { ${namespace} = {
apps = { apps = {
discord = enabled; discord = enabled;
teamspeak = enabled; teamspeak = enabled;

View file

@ -1,18 +1,18 @@
{ {
options,
config, config,
pkgs,
lib,
inputs, inputs,
lib,
namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.autoUpgrade; cfg = config.${namespace}.system.autoUpgrade;
in in
{ {
options.wyrdgard.system.autoUpgrade = with types; { options.${namespace}.system.autoUpgrade = with types; {
enable = mkEnableOption "Enable auto-upgrade"; enable = mkEnableOption "Enable auto-upgrade";
time = mkOpt str "02:00" "Time to run auto-upgrade"; time = mkOpt str "02:00" "Time to run auto-upgrade";
}; };

View file

@ -1,16 +1,17 @@
{ {
config, config,
pkgs,
lib, lib,
namespace,
pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.boot; cfg = config.${namespace}.system.boot;
in in
{ {
options.wyrdgard.system.boot = with types; { options.${namespace}.system.boot = with types; {
enable = mkBoolOpt false "Whether or not to enable booting."; enable = mkBoolOpt false "Whether or not to enable booting.";
}; };

View file

@ -1,17 +1,18 @@
{ {
options,
config, config,
pkgs,
lib, lib,
namespace,
options,
pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.fonts; cfg = config.${namespace}.system.fonts;
in in
{ {
options.wyrdgard.system.fonts = with types; { options.${namespace}.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts."; enable = mkBoolOpt false "Whether or not to manage fonts.";
fonts = mkOpt (listOf package) [ ] "Custom font packages to install."; fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
}; };

View file

@ -1,17 +1,18 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.hardware.audio; cfg = config.${namespace}.system.hardware.audio;
in in
{ {
options.wyrdgard.system.hardware.audio = with types; { options.${namespace}.system.hardware.audio = with types; {
enable = mkBoolOpt false "Whether or not to enable audio"; enable = mkBoolOpt false "Whether or not to enable audio";
}; };
@ -34,8 +35,8 @@ in
wireplumber.configPackages = [ wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" ''
wireplumber.settings = { wireplumber.settings = {
bluetooth.autoswitch-to-headset-profile = false bluetooth.autoswitch-to-headset-profile = false
} }
'') '')
(pkgs.writeTextDir "share/wireplumber/policy.lua.d/11-bluetooth-policy.conf" '' (pkgs.writeTextDir "share/wireplumber/policy.lua.d/11-bluetooth-policy.conf" ''

View file

@ -1,17 +1,18 @@
{ {
options,
config, config,
lib, lib,
namespace,
pkgs, pkgs,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.hardware.bluetooth; cfg = config.${namespace}.system.hardware.bluetooth;
in in
{ {
options.wyrdgard.system.hardware.bluetooth = with types; { options.${namespace}.system.hardware.bluetooth = with types; {
enable = mkBoolOpt false "Whether or not to enable bluetooth"; enable = mkBoolOpt false "Whether or not to enable bluetooth";
}; };

View file

@ -1,17 +1,17 @@
{ {
options,
config, config,
lib, lib,
pkgs, namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.hardware.networking; cfg = config.${namespace}.system.hardware.networking;
in in
{ {
options.wyrdgard.system.hardware.networking = with types; { options.${namespace}.system.hardware.networking = with types; {
enable = mkBoolOpt false "Whether or not to enable networking"; enable = mkBoolOpt false "Whether or not to enable networking";
}; };

View file

@ -1,17 +1,17 @@
{ {
options,
config, config,
pkgs,
lib, lib,
namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.locale; cfg = config.${namespace}.system.locale;
in in
{ {
options.wyrdgard.system.locale = with types; { options.${namespace}.system.locale = with types; {
enable = mkBoolOpt false "Whether or not to manage locale settings."; enable = mkBoolOpt false "Whether or not to manage locale settings.";
}; };

View file

@ -1,17 +1,17 @@
{ {
options,
config, config,
pkgs,
lib, lib,
namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.time; cfg = config.${namespace}.system.time;
in in
{ {
options.wyrdgard.system.time = with types; { options.${namespace}.system.time = with types; {
enable = mkBoolOpt false "Whether or not to configure timezone information."; enable = mkBoolOpt false "Whether or not to configure timezone information.";
}; };

View file

@ -1,16 +1,17 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.system.xkb; cfg = config.${namespace}.system.xkb;
in in
{ {
options.wyrdgard.system.xkb = with types; { options.${namespace}.system.xkb = with types; {
enable = mkBoolOpt false "Whether or not to configure xkb."; enable = mkBoolOpt false "Whether or not to configure xkb.";
}; };

View file

@ -1,22 +1,22 @@
{ {
options,
config, config,
lib, lib,
pkgs, namespace,
options,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.tools.direnv; cfg = config.${namespace}.tools.direnv;
in in
{ {
options.wyrdgard.tools.direnv = with types; { options.${namespace}.tools.direnv = with types; {
enable = mkBoolOpt false "Whether or not to enable direnv."; enable = mkBoolOpt false "Whether or not to enable direnv.";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
wyrdgard.home.extraOptions = { ${namespace}.home.extraOptions = {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv = enabled; nix-direnv = enabled;

View file

@ -1,18 +1,19 @@
{ {
options,
config, config,
lib, lib,
namespace,
options,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.tools.git; cfg = config.${namespace}.tools.git;
user = config.wyrdgard.user; user = config.${namespace}.user;
in in
{ {
options.wyrdgard.tools.git = with types; { options.${namespace}.tools.git = with types; {
enable = mkBoolOpt true "Wether or not to enable git (Default enabled)"; enable = mkBoolOpt true "Wether or not to enable git (Default enabled)";
userName = mkOpt types.str user.fullName "The name to use git with"; userName = mkOpt types.str user.fullName "The name to use git with";
userEmail = mkOpt types.str user.email "The email to use git with"; userEmail = mkOpt types.str user.email "The email to use git with";
@ -26,7 +27,7 @@ in
gitbutler gitbutler
]; ];
wyrdgard.home.extraOptions = { ${namespace}.home.extraOptions = {
programs.git = { programs.git = {
enable = true; enable = true;
inherit (cfg) userName userEmail; inherit (cfg) userName userEmail;

View file

@ -1,14 +1,15 @@
{ {
options,
config, config,
pkgs,
lib, lib,
namespace,
options,
pkgs,
... ...
}: }:
with lib; with lib;
with lib.wyrdgard; with lib.${namespace};
let let
cfg = config.wyrdgard.user; cfg = config.${namespace}.user;
defaultIconFileName = "profile.png"; defaultIconFileName = "profile.png";
defaultIcon = pkgs.stdenvNoCC.mkDerivation { defaultIcon = pkgs.stdenvNoCC.mkDerivation {
name = "default-icon"; name = "default-icon";
@ -32,14 +33,14 @@ let
}; };
} }
'' ''
local target="$out/share/wyrdgard-icons/user/${cfg.name}" local target="$out/share/${namespace}-icons/user/${cfg.name}"
mkdir -p "$target" mkdir -p "$target"
cp ${cfg.icon} "$target/${cfg.icon.fileName}" cp ${cfg.icon} "$target/${cfg.icon.fileName}"
''; '';
in in
{ {
options.wyrdgard.user = with types; { options.${namespace}.user = with types; {
name = mkOpt str "cholli" "The name to use for the user account."; name = mkOpt str "cholli" "The name to use for the user account.";
fullName = mkOpt str "Christoph Hollizeck" "The full name of the user."; fullName = mkOpt str "Christoph Hollizeck" "The full name of the user.";
email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user."; email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user.";
@ -55,7 +56,7 @@ in
programs.fish = enabled; programs.fish = enabled;
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
wyrdgard.home = { ${namespace}.home = {
file = { file = {
"Desktop/.keep".text = ""; "Desktop/.keep".text = "";
"Documents/.keep".text = ""; "Documents/.keep".text = "";

View file

@ -1,10 +1,11 @@
{ {
pkgs,
lib, lib,
namespace,
pkgs,
... ...
}: }:
let let
inherit (lib.wyrdgard) enabled; inherit (lib.${namespace}) enabled;
in in
{ {
imports = [ ./hardware.nix ]; imports = [ ./hardware.nix ];
@ -13,13 +14,14 @@ in
path-of-building path-of-building
teams-for-linux teams-for-linux
obsidian obsidian
zed-editor
]; ];
environment.pathsToLink = [ "/libexec" ]; environment.pathsToLink = [ "/libexec" ];
virtualisation.waydroid = enabled; virtualisation.waydroid = enabled;
wyrdgard = { ${namespace} = {
archetypes = { archetypes = {
gaming.enable = true; gaming.enable = true;
}; };