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,
lib,
namespace,
options,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
with lib.${namespace};
let
cfg = config.wyrdgard.apps.cli-apps.fish;
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps.cli-apps.fish;
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";
};

View file

@ -1,11 +1,16 @@
{ lib, config, ... }:
with lib;
with lib.wyrdgard;
{
config,
lib,
namespace,
...
}:
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
{
options.wyrdgard.apps.cli-apps.home-manager = {
options.${namespace}.apps.cli-apps.home-manager = {
enable = mkBoolOpt true "Enable home-manager";
};

View file

@ -1,17 +1,17 @@
{
options,
config,
lib,
pkgs,
namespace,
options,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.apps.cli-apps.starship;
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps.cli-apps.starship;
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";
};

View file

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

View file

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

View file

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

View file

@ -1,8 +1,7 @@
{
lib,
config,
pkgs,
osConfig ? { },
namespace,
...
}:
let
@ -12,23 +11,14 @@ let
mkDefault
mkMerge
;
inherit (lib.wyrdgard) mkOpt;
inherit (lib.${namespace}) mkOpt;
cfg = config.wyrdgard.user;
cfg = config.${namespace}.user;
is-linux = pkgs.stdenv.isLinux;
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}";
home-directory = if cfg.name == null then null else "/home/${cfg.name}";
in
{
options.wyrdgard.user = {
options.${namespace}.user = {
enable = mkOpt types.bool true "Whether to configure the user account.";
name = mkOpt (types.nullOr types.str) (config.snowfallorg.user.name or "cholli"
) "The user account.";
@ -44,11 +34,11 @@ in
assertions = [
{
assertion = cfg.name != null;
message = "wyrdgard.user.name must be set";
message = "${namespace}.user.name must be set";
}
{
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,
lib,
namespace,
options,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.apps._1password;
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.apps._1password;
in
{
options.wyrdgard.apps._1password = with types; {
options.${namespace}.apps._1password = {
enable = mkBoolOpt true "Enable 1Password";
};
@ -20,7 +22,7 @@ in
_1password.enable = true;
_1password-gui = {
enable = true;
polkitPolicyOwners = [ config.wyrdgard.user.name ];
polkitPolicyOwners = [ config.${namespace}.user.name ];
};
};
};

View file

@ -2,13 +2,14 @@
config,
inputs,
lib,
namespace,
pkgs,
system,
...
}:
let
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-key = "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=";
@ -16,7 +17,7 @@ let
helix-pkg = inputs.helix.packages.${system}.default;
in
{
options.wyrdgard.apps.cli-apps.helix = {
options.${namespace}.apps.cli-apps.helix = {
enable = mkEnableOption "Whether to enable nixvim or not";
};
@ -25,7 +26,7 @@ in
systemPackages = [ helix-pkg ];
};
wyrdgard = {
${namespace} = {
home = {
extraOptions = {
programs.helix = {

View file

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

View file

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

View file

@ -1,16 +1,17 @@
{
config,
lib,
namespace,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
with lib.${namespace};
let
cfg = config.wyrdgard.apps.obs-studio;
cfg = config.${namespace}.apps.obs-studio;
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";
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -7,7 +7,7 @@
namespace,
...
}:
with lib.wyrdgard;
with lib.${namespace};
let
inherit (lib)
mkIf
@ -79,7 +79,7 @@ in
};
};
wyrdgard = {
${namespace} = {
desktop.addons = {
waybar = enabled;
rofi = {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,24 +1,25 @@
{
options,
config,
lib,
namespace,
options,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
with lib.${namespace};
let
cfg = config.wyrdgard.submodules.games;
cfg = config.${namespace}.submodules.games;
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";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ prismlauncher ];
wyrdgard = {
${namespace} = {
apps = {
steam = enabled;
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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