diff --git a/flake.nix b/flake.nix index fa19ef7..b293d2c 100644 --- a/flake.nix +++ b/flake.nix @@ -36,27 +36,25 @@ }; }; - outputs = inputs: - let - lib = inputs.snowfall-lib.mkLib { - inherit inputs; - src = ./.; + outputs = inputs: let + lib = inputs.snowfall-lib.mkLib { + inherit inputs; + src = ./.; - snowfall = { - meta = { - name = "wyrdgard"; - title = "Wyrdgard"; - }; - - namespace = "wyrdgard"; + snowfall = { + meta = { + name = "wyrdgard"; + title = "Wyrdgard"; }; + + namespace = "wyrdgard"; }; - in + }; + in lib.mkFlake { + channels-config = {allowUnfree = true;}; - channels-config = { allowUnfree = true; }; - - outputs-builder = channels: { formatter = channels.nixpkgs.nixpkgs-fmt; }; + outputs-builder = channels: {formatter = channels.nixpkgs.alejandra;}; overlays = with inputs; [ snowfall-flake.overlays.default diff --git a/homes/x86_64-linux/cholli@workvm/default.nix b/homes/x86_64-linux/cholli@workvm/default.nix index 2456be8..f353ce6 100644 --- a/homes/x86_64-linux/cholli@workvm/default.nix +++ b/homes/x86_64-linux/cholli@workvm/default.nix @@ -1,18 +1,18 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: # User information gathered by Snowfall Lib is available. let name = config.snowfallorg.user.name; home = config.snowfallorg.user.home.directory; -in -{ +in { home = { - packages = with pkgs; [ neovim ]; + packages = with pkgs; [neovim]; - sessionVariables = { EDITOR = "nvim"; }; + sessionVariables = {EDITOR = "nvim";}; shellAliases = { vim = "nvim"; diff --git a/homes/x86_64-linux/cholli@yggdrasil/default.nix b/homes/x86_64-linux/cholli@yggdrasil/default.nix index a5ff062..82708cc 100644 --- a/homes/x86_64-linux/cholli@yggdrasil/default.nix +++ b/homes/x86_64-linux/cholli@yggdrasil/default.nix @@ -1,21 +1,21 @@ -{ lib -, pkgs -, config -, ... -}: -# User information gathered by Snowfall Lib is available. -let - name = config.snowfallorg.user.name; - home = config.snowfallorg.user.home.directory; -in { - home = { - packages = with pkgs; [ neovim firefox ]; + lib, + pkgs, + config, + osConfig ? {}, + format ? "unknown", + ... +}: +with lib.wyrdgard; { + wyrdgard = { + apps.cli-apps = { + fish = enabled; + home-manager = enabled; + }; - sessionVariables = { EDITOR = "nvim"; }; - - shellAliases = { vimdiff = "nvim -d"; }; - - stateVersion = "23.11"; + tools = { + git = enabled; + direnv = enabled; + }; }; } diff --git a/lib/module/default.nix b/lib/module/default.nix index 48e53c6..489ef91 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -1,5 +1,4 @@ -{ lib, ... }: - +{lib, ...}: with lib; rec { ## Create a NixOS module option. ## @@ -9,7 +8,7 @@ with lib; rec { ## #@ Type -> Any -> String mkOpt = type: default: description: - mkOption { inherit type default description; }; + mkOption {inherit type default description;}; ## Create a NixOS module option without a description. ## diff --git a/modules/nixos/apps/cli-apps/fish/default.nix b/modules/home/apps/cli-apps/fish/default.nix similarity index 79% rename from modules/nixos/apps/cli-apps/fish/default.nix rename to modules/home/apps/cli-apps/fish/default.nix index 8ef1d89..a5b391b 100644 --- a/modules/nixos/apps/cli-apps/fish/default.nix +++ b/modules/home/apps/cli-apps/fish/default.nix @@ -1,9 +1,14 @@ -{ options, config, lib, pkgs, ... }: +{ + options, + config, + lib, + pkgs, + ... +}: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.apps.cli-apps.fish; -in -{ +in { options.wyrdgard.apps.cli-apps.fish = with types; { enable = mkBoolOpt false "Whether or not to enable the fish shell"; }; @@ -11,7 +16,8 @@ in config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ fish - fishPlugins.tide + starship + colorls ]; }; } diff --git a/modules/home/apps/cli-apps/home-manager/default.nix b/modules/home/apps/cli-apps/home-manager/default.nix new file mode 100644 index 0000000..091627c --- /dev/null +++ b/modules/home/apps/cli-apps/home-manager/default.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption mkIf; + inherit (lib.wyrdgard) enabled; + + cfg = config.wyrdgard.apps.cli-apps.home-manager; +in { + options.wyrdgard.apps.cli-apps.home-manager = { + enable = mkEnableOption "home-manager"; + }; + + config = mkIf cfg.enable { + programs.home-manager = enabled; + }; +} diff --git a/modules/home/tools/direnv/default.nix b/modules/home/tools/direnv/default.nix new file mode 100644 index 0000000..8c8e061 --- /dev/null +++ b/modules/home/tools/direnv/default.nix @@ -0,0 +1,24 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.tools.direnv; +in { + options.wyrdgard.tools.direnv = with types; { + enable = mkBoolOpt false "Whether or not to enable direnv."; + }; + + config = mkIf cfg.enable { + wyrdgard.home.extraOptions = { + programs.direnv = { + enable = true; + nix-direnv = enabled; + }; + }; + }; +} diff --git a/modules/home/tools/git/default.nix b/modules/home/tools/git/default.nix new file mode 100644 index 0000000..a8088db --- /dev/null +++ b/modules/home/tools/git/default.nix @@ -0,0 +1,34 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.tools.git; + user = config.wyrdgard.user; +in { + options.wyrdgard.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"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + git + gitAndTools.gh + ]; + + programs.git = { + enable = true; + lfs.enable = true; + config = { + init = {defaultBranch = "main";}; + push = {autoSetupRemote = true;}; + }; + }; + }; +} diff --git a/modules/home/tools/nix-ld/default.nix b/modules/home/tools/nix-ld/default.nix new file mode 100644 index 0000000..70fbb41 --- /dev/null +++ b/modules/home/tools/nix-ld/default.nix @@ -0,0 +1,19 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.tools.nix-ld; +in { + options.wyrdgard.tools.nix-ld = with types; { + enable = mkBoolOpt false "Wether or not to enable nix-ld"; + }; + + config = mkIf cfg.enable { + programs.nix-ld.enable = true; + }; +} diff --git a/modules/nixos/apps/_1password/default.nix b/modules/nixos/apps/_1password/default.nix index e1d6b21..8c3faf4 100644 --- a/modules/nixos/apps/_1password/default.nix +++ b/modules/nixos/apps/_1password/default.nix @@ -1,9 +1,14 @@ -{ options, config, lib, pkgs, ... }: +{ + options, + config, + lib, + pkgs, + ... +}: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.apps._1password; -in -{ +in { options.wyrdgard.apps._1password = with types; { enable = mkBoolOpt false "Enable 1Password"; }; @@ -13,7 +18,7 @@ in _1password.enable = true; _1password-gui = { enable = true; - polkitPolicyOwners = [ config.wyrdgard.user.name ]; + polkitPolicyOwners = [config.wyrdgard.user.name]; }; }; }; diff --git a/modules/nixos/apps/discord/default.nix b/modules/nixos/apps/discord/default.nix index a168876..9936fcb 100644 --- a/modules/nixos/apps/discord/default.nix +++ b/modules/nixos/apps/discord/default.nix @@ -1,9 +1,14 @@ -{ options, config, lib, pkgs, ... }: +{ + options, + config, + lib, + pkgs, + ... +}: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.apps.discord; -in -{ +in { options.wyrdgard.apps.discord = with types; { enable = mkBoolOpt false "Whether or not to enable basic configuration"; }; diff --git a/modules/nixos/apps/steam/default.nix b/modules/nixos/apps/steam/default.nix index d65e06d..f9580f4 100644 --- a/modules/nixos/apps/steam/default.nix +++ b/modules/nixos/apps/steam/default.nix @@ -1,11 +1,14 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.apps.steam; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.apps.steam; +in { options.wyrdgard.apps.steam = with types; { enable = mkBoolOpt false "Whether or not to enable support for Steam."; }; diff --git a/modules/nixos/apps/vivaldi/default.nix b/modules/nixos/apps/vivaldi/default.nix index 076e474..5045df4 100644 --- a/modules/nixos/apps/vivaldi/default.nix +++ b/modules/nixos/apps/vivaldi/default.nix @@ -1,9 +1,14 @@ -{ options, config, lib, pkgs, ... }: +{ + options, + config, + lib, + pkgs, + ... +}: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.apps.vivaldi; -in -{ +in { options.wyrdgard.apps.vivaldi = with types; { enable = mkBoolOpt false "Whether or not to enable vivaldi browser"; }; diff --git a/modules/nixos/archetypes/gaming/default.nix b/modules/nixos/archetypes/gaming/default.nix index 372d67b..c9d0d1c 100644 --- a/modules/nixos/archetypes/gaming/default.nix +++ b/modules/nixos/archetypes/gaming/default.nix @@ -1,11 +1,14 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.archetypes.gaming; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.archetypes.gaming; +in { options.wyrdgard.archetypes.gaming = with types; { enable = mkBoolOpt false "Whether or not to enable the gaming archetype."; }; diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix index cf13789..c79a4d4 100644 --- a/modules/nixos/home/default.nix +++ b/modules/nixos/home/default.nix @@ -1,23 +1,23 @@ -{ options -, config -, pkgs -, lib -, inputs -, ... +{ + options, + config, + pkgs, + lib, + inputs, + ... }: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.home; -in -{ +in { options.wyrdgard.home = with types; { file = - mkOpt attrs { } - (mdDoc "A set of files to be managed by home-manager's `home.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`."); - extraOptions = mkOpt attrs { } "Options to pass directly to home-manager."; + mkOpt attrs {} + (mdDoc "A set of files to be managed by home-manager's `xdg.configFile`."); + extraOptions = mkOpt attrs {} "Options to pass directly to home-manager."; }; config = { diff --git a/modules/nixos/nix/default.nix b/modules/nixos/nix/default.nix index a4f5bfe..e273003 100644 --- a/modules/nixos/nix/default.nix +++ b/modules/nixos/nix/default.nix @@ -1,21 +1,21 @@ -{ options -, config -, pkgs -, lib -, inputs -, ... +{ + options, + config, + pkgs, + lib, + inputs, + ... }: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.nix; - substituters-submodule = types.submodule ({ name, ... }: { + substituters-submodule = types.submodule ({name, ...}: { options = with types; { key = mkOpt (nullOr str) null "The trusted public key for this substituter."; }; }); -in -{ +in { options.wyrdgard.nix = with types; { enable = mkBoolOpt true "Whether or not to manage nix configuration."; package = mkOpt package pkgs.nixUnstable "Which nix package to use."; @@ -25,65 +25,63 @@ in key = mkOpt str "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "The trusted public key for the substituter."; }; - extra-substituters = mkOpt (attrsOf substituters-submodule) { } "Extra substituters to configure."; + extra-substituters = mkOpt (attrsOf substituters-submodule) {} "Extra substituters to configure."; }; config = mkIf cfg.enable { assertions = mapAttrsToList - (name: value: { - assertion = value.key != null; - message = "wyrdgard.nix.extra-substituters.${name}.key must be set"; - }) - cfg.extra-substituters; + (name: value: { + assertion = value.key != null; + message = "wyrdgard.nix.extra-substituters.${name}.key must be set"; + }) + cfg.extra-substituters; environment.systemPackages = with pkgs; [ nixfmt nix-prefetch-git ]; - nix = - let - users = - [ "root" config.wyrdgard.user.name ] - ++ optional config.services.hydra.enable "hydra"; - in - { - package = cfg.package; + nix = let + users = + ["root" config.wyrdgard.user.name] + ++ optional config.services.hydra.enable "hydra"; + in { + package = cfg.package; - settings = - { - experimental-features = "nix-command flakes"; - http-connections = 50; - warn-dirty = false; - log-lines = 50; - sandbox = "relaxed"; - auto-optimise-store = true; - trusted-users = users; - allowed-users = users; + settings = + { + experimental-features = "nix-command flakes"; + http-connections = 50; + warn-dirty = false; + log-lines = 50; + sandbox = "relaxed"; + auto-optimise-store = true; + trusted-users = users; + allowed-users = users; - substituters = - [ cfg.default-substituter.url ] - ++ (mapAttrsToList (name: value: name) cfg.extra-substituters); - trusted-public-keys = - [ cfg.default-substituter.key ] - ++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters); - } - // (lib.optionalAttrs config.wyrdgard.tools.direnv.enable { - keep-outputs = true; - keep-derivations = true; - }); + substituters = + [cfg.default-substituter.url] + ++ (mapAttrsToList (name: value: name) cfg.extra-substituters); + trusted-public-keys = + [cfg.default-substituter.key] + ++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters); + } + // (lib.optionalAttrs config.wyrdgard.tools.direnv.enable { + keep-outputs = true; + keep-derivations = true; + }); - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - - # flake-utils-plus - generateRegistryFromInputs = true; - generateNixPathFromInputs = true; - linkInputs = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; }; + + # flake-utils-plus + generateRegistryFromInputs = true; + generateNixPathFromInputs = true; + linkInputs = true; + }; }; } diff --git a/modules/nixos/submodules/basics/default.nix b/modules/nixos/submodules/basics/default.nix index fb5a36e..4bb1809 100644 --- a/modules/nixos/submodules/basics/default.nix +++ b/modules/nixos/submodules/basics/default.nix @@ -1,10 +1,14 @@ -{ options, config, lib, pkgs, ... }: -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.submodules.basics; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.submodules.basics; +in { options.wyrdgard.submodules.basics = with types; { enable = mkBoolOpt false "Whether or not to enable basic configuration."; }; diff --git a/modules/nixos/submodules/games/default.nix b/modules/nixos/submodules/games/default.nix index ffe1d03..1a423d2 100644 --- a/modules/nixos/submodules/games/default.nix +++ b/modules/nixos/submodules/games/default.nix @@ -1,10 +1,14 @@ -{ options, config, lib, pkgs, ... }: -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.submodules.games; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.submodules.games; +in { options.wyrdgard.submodules.games = with types; { enable = mkBoolOpt false "Whether or not you want to enable steam and other games"; }; @@ -19,7 +23,5 @@ in steam = enabled; }; }; - }; - } diff --git a/modules/nixos/submodules/graphical-interface/default.nix b/modules/nixos/submodules/graphical-interface/default.nix index ae58556..80e2879 100644 --- a/modules/nixos/submodules/graphical-interface/default.nix +++ b/modules/nixos/submodules/graphical-interface/default.nix @@ -1,11 +1,14 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.submodules.graphical-interface; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.submodules.graphical-interface; +in { options.wyrdgard.submodules.graphical-interface = with types; { enable = mkBoolOpt false "Whether to enable a graphical interface"; }; @@ -20,5 +23,4 @@ in desktopManager.plasma5.enable = true; }; }; - } diff --git a/modules/nixos/submodules/socials/default.nix b/modules/nixos/submodules/socials/default.nix index f31e110..f3ecbef 100644 --- a/modules/nixos/submodules/socials/default.nix +++ b/modules/nixos/submodules/socials/default.nix @@ -1,11 +1,14 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.submodules.socials; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.submodules.socials; +in { options.wyrdgard.submodules.socials = with types; { enable = mkBoolOpt false "Whether to enable social apps"; }; diff --git a/modules/nixos/system/boot/default.nix b/modules/nixos/system/boot/default.nix index ddbecf5..f526f0c 100644 --- a/modules/nixos/system/boot/default.nix +++ b/modules/nixos/system/boot/default.nix @@ -1,14 +1,14 @@ -{ options -, config -, pkgs -, lib -, ... +{ + options, + config, + pkgs, + lib, + ... }: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.system.boot; -in -{ +in { options.wyrdgard.system.boot = with types; { enable = mkBoolOpt false "Whether or not to enable booting."; }; diff --git a/modules/nixos/system/fonts/default.nix b/modules/nixos/system/fonts/default.nix index 3bb6b17..b0629da 100644 --- a/modules/nixos/system/fonts/default.nix +++ b/modules/nixos/system/fonts/default.nix @@ -1,17 +1,17 @@ -{ options -, config -, pkgs -, lib -, ... +{ + options, + config, + pkgs, + lib, + ... }: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.system.fonts; -in -{ +in { options.wyrdgard.system.fonts = with types; { 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."; }; config = mkIf cfg.enable { @@ -26,7 +26,7 @@ in fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "Jetbrains Mono" "CodeNewRoman" "NerdFontsSymbolsOnly" ]; }) + (nerdfonts.override {fonts = ["CodeNewRoman" "NerdFontsSymbolsOnly"];}) font-awesome powerline-fonts powerline-symbols diff --git a/modules/nixos/system/hardware/audio/default.nix b/modules/nixos/system/hardware/audio/default.nix index 3f8410b..66c78a7 100644 --- a/modules/nixos/system/hardware/audio/default.nix +++ b/modules/nixos/system/hardware/audio/default.nix @@ -1,10 +1,14 @@ -{ options, config, lib, pkgs, ... }: -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.system.hardware.audio; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.system.hardware.audio; +in { options.wyrdgard.system.hardware.audio = with types; { enable = mkBoolOpt false "Whether or not to enable audio"; }; @@ -26,7 +30,5 @@ in alsa.support32Bit = true; pulse.enable = true; }; - - }; } diff --git a/modules/nixos/system/hardware/bluetooth/default.nix b/modules/nixos/system/hardware/bluetooth/default.nix index ad13fbe..95d1daf 100644 --- a/modules/nixos/system/hardware/bluetooth/default.nix +++ b/modules/nixos/system/hardware/bluetooth/default.nix @@ -1,17 +1,19 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.system.hardware.bluetooth; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.system.hardware.bluetooth; +in { options.wyrdgard.system.hardware.bluetooth = with types; { enable = mkBoolOpt false "Whether or not to enable bluetooth"; }; config = mkIf cfg.enable { - hardware.bluetooth = { enable = true; powerOnBoot = true; diff --git a/modules/nixos/system/hardware/networking/default.nix b/modules/nixos/system/hardware/networking/default.nix index 875a80c..e1fce84 100644 --- a/modules/nixos/system/hardware/networking/default.nix +++ b/modules/nixos/system/hardware/networking/default.nix @@ -1,17 +1,19 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.system.hardware.networking; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.system.hardware.networking; +in { options.wyrdgard.system.hardware.networking = with types; { enable = mkBoolOpt false "Whether or not to enable networking"; }; config = mkIf cfg.enable { - networking.networkmanager.enable = true; }; } diff --git a/modules/nixos/system/locale/default.nix b/modules/nixos/system/locale/default.nix index def4ebc..23e6e06 100644 --- a/modules/nixos/system/locale/default.nix +++ b/modules/nixos/system/locale/default.nix @@ -1,10 +1,14 @@ -{ options, config, pkgs, lib, ... }: -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.system.locale; -in { + options, + config, + pkgs, + lib, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.system.locale; +in { options.wyrdgard.system.locale = with types; { enable = mkBoolOpt false "Whether or not to manage locale settings."; }; diff --git a/modules/nixos/system/time/default.nix b/modules/nixos/system/time/default.nix index 9d3f378..b139bd2 100644 --- a/modules/nixos/system/time/default.nix +++ b/modules/nixos/system/time/default.nix @@ -1,14 +1,14 @@ -{ options -, config -, pkgs -, lib -, ... +{ + options, + config, + pkgs, + lib, + ... }: with lib; with lib.wyrdgard; let cfg = config.wyrdgard.system.time; -in -{ +in { options.wyrdgard.system.time = with types; { enable = mkBoolOpt false "Whether or not to configure timezone information."; diff --git a/modules/nixos/system/xkb/default.nix b/modules/nixos/system/xkb/default.nix index 91efcc1..c560e45 100644 --- a/modules/nixos/system/xkb/default.nix +++ b/modules/nixos/system/xkb/default.nix @@ -1,10 +1,13 @@ -{ options, config, lib, ... }: -with lib; -with lib.wyrdgard; -let - cfg = config.wyrdgard.system.xkb; -in { + options, + config, + lib, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.system.xkb; +in { options.wyrdgard.system.xkb = with types; { enable = mkBoolOpt false "Whether or not to configure xkb."; }; diff --git a/modules/nixos/tools/direnv/default.nix b/modules/nixos/tools/direnv/default.nix index 1ed39f5..8c8e061 100644 --- a/modules/nixos/tools/direnv/default.nix +++ b/modules/nixos/tools/direnv/default.nix @@ -1,10 +1,14 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; -let cfg = config.wyrdgard.tools.direnv; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.tools.direnv; +in { options.wyrdgard.tools.direnv = with types; { enable = mkBoolOpt false "Whether or not to enable direnv."; }; diff --git a/modules/nixos/tools/git/default.nix b/modules/nixos/tools/git/default.nix index fa5f435..a8088db 100644 --- a/modules/nixos/tools/git/default.nix +++ b/modules/nixos/tools/git/default.nix @@ -1,13 +1,15 @@ -{ options, config, lib, pkgs, ... }: - +{ + options, + config, + lib, + pkgs, + ... +}: with lib; -with lib.wyrdgard; - -let +with lib.wyrdgard; let cfg = config.wyrdgard.tools.git; user = config.wyrdgard.user; -in -{ +in { options.wyrdgard.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"; @@ -24,8 +26,8 @@ in enable = true; lfs.enable = true; config = { - init = { defaultBranch = "main"; }; - push = { autoSetupRemote = true; }; + init = {defaultBranch = "main";}; + push = {autoSetupRemote = true;}; }; }; }; diff --git a/modules/nixos/tools/nix-ld/default.nix b/modules/nixos/tools/nix-ld/default.nix index 9cd6947..70fbb41 100644 --- a/modules/nixos/tools/nix-ld/default.nix +++ b/modules/nixos/tools/nix-ld/default.nix @@ -1,12 +1,14 @@ -{ options, config, lib, pkgs, ... }: - -with lib; -with lib.wyrdgard; - -let - cfg = config.wyrdgard.tools.nix-ld; -in { + options, + config, + lib, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.tools.nix-ld; +in { options.wyrdgard.tools.nix-ld = with types; { enable = mkBoolOpt false "Wether or not to enable nix-ld"; }; diff --git a/modules/nixos/user/default.nix b/modules/nixos/user/default.nix index 97f7074..34b0efc 100644 --- a/modules/nixos/user/default.nix +++ b/modules/nixos/user/default.nix @@ -1,8 +1,9 @@ -{ options -, config -, pkgs -, lib -, ... +{ + options, + config, + pkgs, + lib, + ... }: with lib; with lib.wyrdgard; let @@ -18,38 +19,36 @@ with lib.wyrdgard; let cp $src $out ''; - passthru = { fileName = defaultIconFileName; }; + passthru = {fileName = defaultIconFileName;}; }; propagatedIcon = pkgs.runCommandNoCC "propagated-icon" - { passthru = { fileName = cfg.icon.fileName; }; } - '' - local target="$out/share/wyrdgard-icons/user/${cfg.name}" - mkdir -p "$target" + {passthru = {fileName = cfg.icon.fileName;};} + '' + local target="$out/share/wyrdgard-icons/user/${cfg.name}" + mkdir -p "$target" - cp ${cfg.icon} "$target/${cfg.icon.fileName}" - ''; -in -{ + cp ${cfg.icon} "$target/${cfg.icon.fileName}" + ''; +in { options.wyrdgard.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."; initialPassword = mkOpt str "asdf" - "The initial password to use when the user is first created."; + "The initial password to use when the user is first created."; icon = mkOpt (nullOr package) defaultIcon - "The profile picture to use for the user."; - extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned."; + "The profile picture to use for the user."; + extraGroups = mkOpt (listOf str) [] "Groups for the user to be assigned."; extraOptions = - mkOpt attrs { } - (mdDoc "Extra options passed to `users.users.`."); + mkOpt attrs {} + (mdDoc "Extra options passed to `users.users.`."); }; config = { environment.systemPackages = with pkgs; [ - ]; programs.zsh = { @@ -83,7 +82,6 @@ in lcu = "${pkgs.colorls}/bin/colorls -U"; lclu = "${pkgs.colorls}/bin/colorls -U -1"; }; - }; }; @@ -105,7 +103,7 @@ in # system to select). uid = 1000; - extraGroups = [ "steamcmd" ] ++ cfg.extraGroups; + extraGroups = ["steamcmd"] ++ cfg.extraGroups; } // cfg.extraOptions; }; diff --git a/systems/x86_64-linux/workvm/default.nix b/systems/x86_64-linux/workvm/default.nix index a77a6a5..f8ecba5 100644 --- a/systems/x86_64-linux/workvm/default.nix +++ b/systems/x86_64-linux/workvm/default.nix @@ -1,33 +1,20 @@ -{ pkgs, config, lib, ... }: -with lib; -with lib.wyrdgard; { - imports = [ ./hardware.nix ]; + pkgs, + config, + lib, + ... +}: +with lib; +with lib.wyrdgard; { + imports = [./hardware.nix]; - boot.blacklistedKernelModules = [ "hyperv-fb" ]; + boot.blacklistedKernelModules = ["hyperv-fb"]; virtualisation.hypervGuest.videoMode = "1920x1080"; environment.systemPackages = with pkgs; [ - kitty - fish - fishPlugins.tide - fd - tree - ripgrep ]; - services.xserver = { - enable = true; - displayManager.sddm = { - enable = true; - wayland.enable = true; - }; - desktopManager.plasma5.enable = true; - layout = "us"; - xkbVariant = ""; - }; - environment.variables.EDITOR = "nvim"; environment.variables.SUDOEDITOR = "nvim"; @@ -41,12 +28,13 @@ with lib.wyrdgard; wyrdgard = { apps = { - discord = enabled; vivaldi = enabled; }; submodules = { basics = enabled; + graphical-interface = enabled; + socials = enabled; }; }; diff --git a/systems/x86_64-linux/workvm/hardware.nix b/systems/x86_64-linux/workvm/hardware.nix index 7a4edd8..e6feba0 100644 --- a/systems/x86_64-linux/workvm/hardware.nix +++ b/systems/x86_64-linux/workvm/hardware.nix @@ -1,18 +1,19 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config -, lib -, pkgs -, modulesPath -, ... +{ + config, + lib, + pkgs, + modulesPath, + ... }: { - imports = [ ]; + imports = []; - boot.initrd.availableKernelModules = [ "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; fileSystems."/" = { device = "/dev/disk/by-uuid/c58c66b3-4e0f-4393-8d7b-871d934856e3"; @@ -24,7 +25,7 @@ fsType = "vfat"; }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/systems/x86_64-linux/yggdrasil/default.nix b/systems/x86_64-linux/yggdrasil/default.nix index 8c848c7..03ca2de 100644 --- a/systems/x86_64-linux/yggdrasil/default.nix +++ b/systems/x86_64-linux/yggdrasil/default.nix @@ -1,13 +1,15 @@ -{ pkgs, config, lib, ... }: -with lib; -with lib.wyrdgard; { - imports = [ ./hardware.nix ]; + pkgs, + config, + lib, + ... +}: +with lib; +with lib.wyrdgard; { + imports = [./hardware.nix]; environment.systemPackages = with pkgs; [ - fd - tree - ripgrep + filelight ]; # nvidia @@ -26,9 +28,7 @@ with lib.wyrdgard; package = config.boot.kernelPackages.nvidiaPackages.beta; }; - environment.pathsToLink = [ "/libexec" ]; - - services.xserver.videoDrivers = [ "nvidia" ]; + environment.pathsToLink = ["/libexec"]; wyrdgard = { archetypes = { @@ -45,6 +45,9 @@ with lib.wyrdgard; }; }; + services.xserver.videoDrivers = ["nvidia"]; + services.xserver.displayManager.sddm.wayland.enable = lib.mkForce false; + # Configure Home-Manager options from NixOS. snowfallorg.user.cholli.home.config = { programs.kitty = { diff --git a/systems/x86_64-linux/yggdrasil/hardware.nix b/systems/x86_64-linux/yggdrasil/hardware.nix index 26eb08f..98f60d7 100644 --- a/systems/x86_64-linux/yggdrasil/hardware.nix +++ b/systems/x86_64-linux/yggdrasil/hardware.nix @@ -1,20 +1,21 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config -, lib -, pkgs -, modulesPath -, ... +{ + config, + lib, + pkgs, + modulesPath, + ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; fileSystems."/" = { device = "/dev/disk/by-uuid/444a9216-59d1-46e0-9643-0b716a42ba0b"; @@ -26,7 +27,7 @@ fsType = "vfat"; }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's