diff --git a/flake.nix b/flake.nix index 2743a78..d4cd02a 100644 --- a/flake.nix +++ b/flake.nix @@ -37,25 +37,29 @@ }; }; - 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"; + snowfall = { + meta = { + name = "wyrdgard"; + title = "Wyrdgard"; + }; + + namespace = "wyrdgard"; }; - - namespace = "wyrdgard"; }; - }; - in + in lib.mkFlake { - channels-config = {allowUnfree = true;}; + channels-config = { + allowUnfree = true; + }; - outputs-builder = channels: {formatter = channels.nixpkgs.alejandra;}; + outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; }; 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 8a954b9..694b9c7 100644 --- a/homes/x86_64-linux/cholli@workvm/default.nix +++ b/homes/x86_64-linux/cholli@workvm/default.nix @@ -2,11 +2,12 @@ lib, pkgs, config, - osConfig ? {}, + osConfig ? { }, format ? "unknown", ... }: -with lib.wyrdgard; { +with lib.wyrdgard; +{ wyrdgard = { apps = { kitty = enabled; diff --git a/homes/x86_64-linux/cholli@yggdrasil/default.nix b/homes/x86_64-linux/cholli@yggdrasil/default.nix index 8a954b9..694b9c7 100644 --- a/homes/x86_64-linux/cholli@yggdrasil/default.nix +++ b/homes/x86_64-linux/cholli@yggdrasil/default.nix @@ -2,11 +2,12 @@ lib, pkgs, config, - osConfig ? {}, + osConfig ? { }, format ? "unknown", ... }: -with lib.wyrdgard; { +with lib.wyrdgard; +{ wyrdgard = { apps = { kitty = enabled; diff --git a/lib/module/default.nix b/lib/module/default.nix index 489ef91..14333a9 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; rec { +{ lib, ... }: +with lib; +rec { ## Create a NixOS module option. ## ## ```nix @@ -7,8 +8,9 @@ with lib; rec { ## ``` ## #@ Type -> Any -> String - mkOpt = type: default: description: - mkOption {inherit type default description;}; + mkOpt = + type: default: description: + mkOption { inherit type default description; }; ## Create a NixOS module option without a description. ## diff --git a/modules/home/apps/cli-apps/fish/default.nix b/modules/home/apps/cli-apps/fish/default.nix index 604a777..9c80178 100644 --- a/modules/home/apps/cli-apps/fish/default.nix +++ b/modules/home/apps/cli-apps/fish/default.nix @@ -6,44 +6,43 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.cli-apps.fish; -in { +in +{ options.wyrdgard.apps.cli-apps.fish = with types; { enable = mkBoolOpt true "Whether or not to enable the fish shell"; }; - config = - mkIf cfg.enable { - home.packages = with pkgs.fishPlugins; [ - forgit - sponge - ]; + config = mkIf cfg.enable { + home.packages = with pkgs.fishPlugins; [ + forgit + sponge + ]; - programs = { - fish = { - enable = true; - shellInit = " + programs = { + fish = { + enable = true; + shellInit = " zoxide init fish | source direnv hook fish | source source ~/.config/op/plugins.sh "; - shellAliases = { - vim = "nvim"; - ls = "colorls --gs"; - l = "ls -l"; - la = "ls -a"; - lla = "ls -la"; - lt = "ls --tree"; - }; - }; - - zoxide = { - enable = true; - options = [ - "--cmd cd" - ]; + shellAliases = { + vim = "nvim"; + ls = "colorls --gs"; + l = "ls -l"; + la = "ls -a"; + lla = "ls -la"; + lt = "ls --tree"; }; }; + + zoxide = { + enable = true; + options = [ "--cmd cd" ]; + }; }; + }; } diff --git a/modules/home/apps/cli-apps/home-manager/default.nix b/modules/home/apps/cli-apps/home-manager/default.nix index 05b98c6..ea63109 100644 --- a/modules/home/apps/cli-apps/home-manager/default.nix +++ b/modules/home/apps/cli-apps/home-manager/default.nix @@ -1,17 +1,13 @@ -{ - lib, - config, - ... -}: +{ lib, config, ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.cli-apps.home-manager; -in { +in +{ options.wyrdgard.apps.cli-apps.home-manager = { enable = mkBoolOpt true "Enable home-manager"; }; - config = mkIf cfg.enable { - programs.home-manager = enabled; - }; + config = mkIf cfg.enable { programs.home-manager = enabled; }; } diff --git a/modules/home/apps/cli-apps/starship/default.nix b/modules/home/apps/cli-apps/starship/default.nix index a5b1b33..56e0de1 100644 --- a/modules/home/apps/cli-apps/starship/default.nix +++ b/modules/home/apps/cli-apps/starship/default.nix @@ -6,69 +6,70 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.cli-apps.starship; -in { +in +{ options.wyrdgard.apps.cli-apps.starship = with types; { enable = mkBoolOpt true "Whether or not to enable starship shell"; }; - config = - mkIf cfg.enable { - programs = { - fish.shellInit = " + config = mkIf cfg.enable { + programs = { + fish.shellInit = " starship init fish | source "; - starship = { - enable = true; - enableTransience = true; - settings = { - character = { - error_symbol = "[ ](bold red)"; - }; - time = { - disabled = false; - time_format = "%T"; - utc_time_offset = "+1"; - }; - username = { - style_user = "#00de00"; - style_root = "red"; - format = "[$user]($style) "; - disabled = false; - show_always = true; - }; - hostname = { - ssh_only = false; - format = "@ [$hostname](bold yellow) "; - disabled = false; - }; - directory = { - home_symbol = "󰋞 ~"; - read_only_style = "197"; - read_only = "  "; - format = "at [$path]($style)[$read_only]($read_only_style) "; - }; - git_metrics = { - disabled = false; - added_style = "bold blue"; - format = "[+$added]($added_style)/[-$deleted]($deleted_style) "; - }; - git_status = { - format = "([$all_status$ahead_behind]($style) )"; - ahead = "[↑$count](bold green)"; - behind = "[↓$count](bold red)"; - diverged = "[↕↓$ahead_count↑$behind_count](red)"; - deleted = "[✘$count](red) "; - modified = "[!$count](yellow) "; - staged = "[+$count](green) "; - renamed = "[➜$count](green) "; - untracked = "[?$count](blue) "; - }; + starship = { + enable = true; + enableTransience = true; + settings = { + character = { + error_symbol = "[ ](bold red)"; + }; + time = { + disabled = false; + time_format = "%T"; + utc_time_offset = "+1"; + }; + username = { + style_user = "#00de00"; + style_root = "red"; + format = "[$user]($style) "; + disabled = false; + show_always = true; + }; + hostname = { + ssh_only = false; + format = "@ [$hostname](bold yellow) "; + disabled = false; + }; + directory = { + home_symbol = "󰋞 ~"; + read_only_style = "197"; + read_only = "  "; + format = "at [$path]($style)[$read_only]($read_only_style) "; + }; + git_metrics = { + disabled = false; + added_style = "bold blue"; + format = "[+$added]($added_style)/[-$deleted]($deleted_style) "; + }; + git_status = { + format = "([$all_status$ahead_behind]($style) )"; + ahead = "[↑$count](bold green)"; + behind = "[↓$count](bold red)"; + diverged = "[↕↓$ahead_count↑$behind_count](red)"; + deleted = "[✘$count](red) "; + modified = "[!$count](yellow) "; + staged = "[+$count](green) "; + renamed = "[➜$count](green) "; + untracked = "[?$count](blue) "; }; }; }; }; + }; } diff --git a/modules/home/apps/graphviz/default.nix b/modules/home/apps/graphviz/default.nix index ead61d7..d8fb477 100644 --- a/modules/home/apps/graphviz/default.nix +++ b/modules/home/apps/graphviz/default.nix @@ -5,17 +5,17 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.graphviz; -in { +in +{ options.wyrdgard.apps.graphviz = { enable = mkBoolOpt true "Whether or not you want to install graphviz"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - graphviz - ]; + home.packages = with pkgs; [ graphviz ]; home.shellAliases = { nixsize = "nix-du -n=50 | dot -Tsvg > ~/Pictures/store.svg"; diff --git a/modules/home/apps/kitty/default.nix b/modules/home/apps/kitty/default.nix index 0444067..5858e88 100644 --- a/modules/home/apps/kitty/default.nix +++ b/modules/home/apps/kitty/default.nix @@ -5,17 +5,17 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.kitty; -in { +in +{ options.wyrdgard.apps.kitty = { enable = mkEnableOption "Kity"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - kitty - ]; + home.packages = with pkgs; [ kitty ]; programs.kitty = { enable = true; diff --git a/modules/home/tools/direnv/default.nix b/modules/home/tools/direnv/default.nix index 89d78a4..f8c2802 100644 --- a/modules/home/tools/direnv/default.nix +++ b/modules/home/tools/direnv/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.tools.direnv; -in { +in +{ options.wyrdgard.tools.direnv = with types; { enable = mkBoolOpt false "Whether or not to enable direnv."; }; diff --git a/modules/home/tools/git/default.nix b/modules/home/tools/git/default.nix index a4194f5..231762f 100644 --- a/modules/home/tools/git/default.nix +++ b/modules/home/tools/git/default.nix @@ -6,10 +6,12 @@ ... }: 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 = { enable = mkBoolOpt true "Enable Git (Default true)"; userName = mkOpt types.str user.fullName "The name to configure git with."; @@ -22,9 +24,15 @@ in { inherit (cfg) userName userEmail; lfs = enabled; extraConfig = { - init = {defaultBranch = "main";}; - pull = {rebase = false;}; - push = {autoSetupRemote = true;}; + init = { + defaultBranch = "main"; + }; + pull = { + rebase = false; + }; + push = { + autoSetupRemote = true; + }; }; }; }; diff --git a/modules/home/user/default.nix b/modules/home/user/default.nix index 83bf76d..9f29055 100644 --- a/modules/home/user/default.nix +++ b/modules/home/user/default.nix @@ -2,10 +2,16 @@ lib, config, pkgs, - osConfig ? {}, + osConfig ? { }, ... -}: let - inherit (lib) types mkIf mkDefault mkMerge; +}: +let + inherit (lib) + types + mkIf + mkDefault + mkMerge + ; inherit (lib.wyrdgard) mkOpt; cfg = config.wyrdgard.user; @@ -14,15 +20,18 @@ 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 { + if cfg.name == null then + null + else if is-darwin then + "/Users/${cfg.name}" + else + "/home/${cfg.name}"; +in +{ options.wyrdgard.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."; + name = mkOpt (types.nullOr types.str) (config.snowfallorg.user.name or "cholli" + ) "The user account."; fullName = mkOpt types.str "Christoph Hollizeck" "The full name of the user."; email = mkOpt types.str "christoph.hollizeck@hey.com" "The email of the user."; diff --git a/modules/nixos/apps/_1password/default.nix b/modules/nixos/apps/_1password/default.nix index c1afc8a..d949400 100644 --- a/modules/nixos/apps/_1password/default.nix +++ b/modules/nixos/apps/_1password/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps._1password; -in { +in +{ options.wyrdgard.apps._1password = with types; { enable = mkBoolOpt true "Enable 1Password"; }; @@ -18,7 +20,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/cli-apps/nixvim/default.nix b/modules/nixos/apps/cli-apps/nixvim/default.nix index 57b5893..ccf0a91 100644 --- a/modules/nixos/apps/cli-apps/nixvim/default.nix +++ b/modules/nixos/apps/cli-apps/nixvim/default.nix @@ -6,14 +6,19 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.cli-apps.nixvim; -in { +in +{ options.wyrdgard.apps.cli-apps.nixvim = with types; { enable = mkBoolOpt true "Whether to enable nixvim or not (Default true)"; }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [less wyrdgard.neovim]; + environment.systemPackages = with pkgs; [ + less + wyrdgard.neovim + ]; }; } diff --git a/modules/nixos/apps/discord/default.nix b/modules/nixos/apps/discord/default.nix index 9936fcb..ade10ad 100644 --- a/modules/nixos/apps/discord/default.nix +++ b/modules/nixos/apps/discord/default.nix @@ -6,16 +6,14 @@ ... }: with lib; -with lib.wyrdgard; let +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"; }; - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - discord - ]; - }; + config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ discord ]; }; } diff --git a/modules/nixos/apps/steam/default.nix b/modules/nixos/apps/steam/default.nix index f9580f4..c367725 100644 --- a/modules/nixos/apps/steam/default.nix +++ b/modules/nixos/apps/steam/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.apps.steam; -in { +in +{ options.wyrdgard.apps.steam = with types; { enable = mkBoolOpt false "Whether or not to enable support for Steam."; }; @@ -17,8 +19,6 @@ in { programs.steam.enable = true; programs.steam.remotePlay.openFirewall = true; - environment.systemPackages = with pkgs; [ - steam - ]; + environment.systemPackages = with pkgs; [ steam ]; }; } diff --git a/modules/nixos/apps/vivaldi/default.nix b/modules/nixos/apps/vivaldi/default.nix index 5045df4..32a9faa 100644 --- a/modules/nixos/apps/vivaldi/default.nix +++ b/modules/nixos/apps/vivaldi/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +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 bb43d12..7a469d4 100644 --- a/modules/nixos/archetypes/gaming/default.nix +++ b/modules/nixos/archetypes/gaming/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.archetypes.gaming; -in { +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 c79a4d4..d6cf208 100644 --- a/modules/nixos/home/default.nix +++ b/modules/nixos/home/default.nix @@ -7,17 +7,17 @@ ... }: with lib; -with lib.wyrdgard; let +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`."); - 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."; + 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."; }; config = { diff --git a/modules/nixos/nix/default.nix b/modules/nixos/nix/default.nix index 17e26e5..3f1747f 100644 --- a/modules/nixos/nix/default.nix +++ b/modules/nixos/nix/default.nix @@ -7,35 +7,39 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.nix; - substituters-submodule = types.submodule ({name, ...}: { - options = with types; { - key = mkOpt (nullOr str) null "The trusted public key for this substituter."; - }; - }); -in { + substituters-submodule = types.submodule ( + { name, ... }: + { + options = with types; { + key = mkOpt (nullOr str) null "The trusted public key for this substituter."; + }; + } + ); +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."; default-substituter = { url = mkOpt str "https://cache.nixos.org" "The url for the substituter."; - key = mkOpt str "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "The trusted public key for the substituter."; + 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; + assertions = mapAttrsToList (name: value: { + assertion = value.key != null; + message = "wyrdgard.nix.extra-substituters.${name}.key must be set"; + }) cfg.extra-substituters; environment.systemPackages = with pkgs; [ snowfallorg.flake @@ -44,46 +48,49 @@ in { nix-du ]; - 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 = "daily"; - options = "--delete-older-than 7d"; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + + # flake-utils-plus + generateRegistryFromInputs = true; + generateNixPathFromInputs = true; + linkInputs = true; }; - - # 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 34cc8eb..a0ac111 100644 --- a/modules/nixos/submodules/basics/default.nix +++ b/modules/nixos/submodules/basics/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.submodules.basics; -in { +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 1a423d2..695b0bb 100644 --- a/modules/nixos/submodules/games/default.nix +++ b/modules/nixos/submodules/games/default.nix @@ -6,17 +6,17 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.submodules.games; -in { +in +{ options.wyrdgard.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 - ]; + environment.systemPackages = with pkgs; [ prismlauncher ]; wyrdgard = { apps = { diff --git a/modules/nixos/submodules/socials/default.nix b/modules/nixos/submodules/socials/default.nix index f3ecbef..4c92c3a 100644 --- a/modules/nixos/submodules/socials/default.nix +++ b/modules/nixos/submodules/socials/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.submodules.socials; -in { +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 f526f0c..d867148 100644 --- a/modules/nixos/system/boot/default.nix +++ b/modules/nixos/system/boot/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +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 b0629da..3239eba 100644 --- a/modules/nixos/system/fonts/default.nix +++ b/modules/nixos/system/fonts/default.nix @@ -6,12 +6,14 @@ ... }: with lib; -with lib.wyrdgard; let +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 { @@ -20,13 +22,17 @@ in { LOG_ICONS = "true"; }; - environment.systemPackages = with pkgs; [ - font-manager - ]; + environment.systemPackages = with pkgs; [ font-manager ]; - fonts.packages = with pkgs; + fonts.packages = + with pkgs; [ - (nerdfonts.override {fonts = ["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 66c78a7..4b07374 100644 --- a/modules/nixos/system/hardware/audio/default.nix +++ b/modules/nixos/system/hardware/audio/default.nix @@ -6,17 +6,17 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.system.hardware.audio; -in { +in +{ options.wyrdgard.system.hardware.audio = with types; { enable = mkBoolOpt false "Whether or not to enable audio"; }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - noisetorch - ]; + environment.systemPackages = with pkgs; [ noisetorch ]; programs.noisetorch.enable = true; diff --git a/modules/nixos/system/hardware/bluetooth/default.nix b/modules/nixos/system/hardware/bluetooth/default.nix index 708ac94..28254c8 100644 --- a/modules/nixos/system/hardware/bluetooth/default.nix +++ b/modules/nixos/system/hardware/bluetooth/default.nix @@ -6,17 +6,17 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.system.hardware.bluetooth; -in { +in +{ options.wyrdgard.system.hardware.bluetooth = with types; { enable = mkBoolOpt false "Whether or not to enable bluetooth"; }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - libsForQt5.bluez-qt - ]; + environment.systemPackages = with pkgs; [ libsForQt5.bluez-qt ]; hardware.bluetooth = { enable = true; @@ -31,7 +31,11 @@ in { fileSystems."/var/lib/bluetooth" = { device = "/persist/var/lib/bluetooth"; - options = ["bind" "noauto" "x-systemd.automount"]; + options = [ + "bind" + "noauto" + "x-systemd.automount" + ]; noCheck = true; }; diff --git a/modules/nixos/system/hardware/gpu/nvidia/default.nix b/modules/nixos/system/hardware/gpu/nvidia/default.nix index 21d9732..9dbe95e 100644 --- a/modules/nixos/system/hardware/gpu/nvidia/default.nix +++ b/modules/nixos/system/hardware/gpu/nvidia/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.system.hardware.gpu.nvidia; -in { +in +{ options.wyrdgard.system.hardware.gpu.nvidia = with types; { enable = mkEnableOption "Enable Nvidia GPU"; }; @@ -29,7 +31,7 @@ in { package = config.boot.kernelPackages.nvidiaPackages.beta; # stable, beta }; - services.xserver.videoDrivers = ["nvidia"]; + services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.displayManager.sddm.wayland.enable = lib.mkForce false; }; } diff --git a/modules/nixos/system/hardware/networking/default.nix b/modules/nixos/system/hardware/networking/default.nix index e1fce84..7e493c4 100644 --- a/modules/nixos/system/hardware/networking/default.nix +++ b/modules/nixos/system/hardware/networking/default.nix @@ -6,14 +6,14 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.system.hardware.networking; -in { +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; - }; + 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 fb6d206..22effda 100644 --- a/modules/nixos/system/locale/default.nix +++ b/modules/nixos/system/locale/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.system.locale; -in { +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 b139bd2..edaf4e9 100644 --- a/modules/nixos/system/time/default.nix +++ b/modules/nixos/system/time/default.nix @@ -6,15 +6,14 @@ ... }: with lib; -with lib.wyrdgard; let +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."; + enable = mkBoolOpt false "Whether or not to configure timezone information."; }; - config = mkIf cfg.enable { - time.timeZone = "Europe/Berlin"; - }; + config = mkIf cfg.enable { time.timeZone = "Europe/Berlin"; }; } diff --git a/modules/nixos/system/xkb/default.nix b/modules/nixos/system/xkb/default.nix index bbfa44b..210cd4f 100644 --- a/modules/nixos/system/xkb/default.nix +++ b/modules/nixos/system/xkb/default.nix @@ -5,9 +5,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.system.xkb; -in { +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 8c8e061..384b9a0 100644 --- a/modules/nixos/tools/direnv/default.nix +++ b/modules/nixos/tools/direnv/default.nix @@ -6,9 +6,11 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.tools.direnv; -in { +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 ebe2671..85c37bc 100644 --- a/modules/nixos/tools/git/default.nix +++ b/modules/nixos/tools/git/default.nix @@ -6,10 +6,12 @@ ... }: 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"; @@ -26,9 +28,15 @@ in { enable = true; lfs.enable = true; config = { - init = {defaultBranch = "main";}; - pull = {rebase = false;}; - push = {autoSetupRemote = true;}; + init = { + defaultBranch = "main"; + }; + pull = { + rebase = false; + }; + push = { + autoSetupRemote = true; + }; }; }; }; diff --git a/modules/nixos/tools/nix-ld/default.nix b/modules/nixos/tools/nix-ld/default.nix index 70fbb41..ea25b0d 100644 --- a/modules/nixos/tools/nix-ld/default.nix +++ b/modules/nixos/tools/nix-ld/default.nix @@ -6,14 +6,14 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.tools.nix-ld; -in { +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; - }; + config = mkIf cfg.enable { programs.nix-ld.enable = true; }; } diff --git a/modules/nixos/user/default.nix b/modules/nixos/user/default.nix index 5d2686f..206a1e9 100644 --- a/modules/nixos/user/default.nix +++ b/modules/nixos/user/default.nix @@ -6,7 +6,8 @@ ... }: with lib; -with lib.wyrdgard; let +with lib.wyrdgard; +let cfg = config.wyrdgard.user; defaultIconFileName = "profile.png"; defaultIcon = pkgs.stdenvNoCC.mkDerivation { @@ -19,37 +20,37 @@ 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."; - icon = - mkOpt (nullOr package) defaultIcon - "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.`."); + initialPassword = mkOpt str "asdf" "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."; + extraOptions = mkOpt attrs { } (mdDoc "Extra options passed to `users.users.`."); }; config = { - environment.systemPackages = with pkgs; [ - ]; + environment.systemPackages = with pkgs; [ ]; programs.zsh = { enable = true; @@ -67,33 +68,28 @@ in { "Videos/.keep".text = ""; "projects/.keep".text = ""; ".face".source = cfg.icon; - "Pictures/${ - cfg.icon.fileName or (builtins.baseNameOf cfg.icon) - }".source = - cfg.icon; + "Pictures/${cfg.icon.fileName or (builtins.baseNameOf cfg.icon)}".source = cfg.icon; }; }; - users.users.${cfg.name} = - { - isNormalUser = true; + users.users.${cfg.name} = { + isNormalUser = true; - inherit (cfg) name initialPassword; + inherit (cfg) name initialPassword; - home = "/home/${cfg.name}"; - group = "users"; + home = "/home/${cfg.name}"; + group = "users"; - shell = pkgs.zsh; + shell = pkgs.zsh; - # Arbitrary user ID to use for the user. Since I only - # have a single user on my machines this won't ever collide. - # However, if you add multiple users you'll need to change this - # so each user has their own unique uid (or leave it out for the - # system to select). - uid = 1000; + # Arbitrary user ID to use for the user. Since I only + # have a single user on my machines this won't ever collide. + # However, if you add multiple users you'll need to change this + # so each user has their own unique uid (or leave it out for the + # system to select). + uid = 1000; - extraGroups = ["steamcmd"] ++ cfg.extraGroups; - } - // cfg.extraOptions; + extraGroups = [ "steamcmd" ] ++ cfg.extraGroups; + } // cfg.extraOptions; }; } diff --git a/overlays/vivaldi/default.nix b/overlays/vivaldi/default.nix index 7dd347f..1756269 100644 --- a/overlays/vivaldi/default.nix +++ b/overlays/vivaldi/default.nix @@ -1,4 +1,4 @@ -{ channels, inputs, ... }: +{ channels, ... }: final: prev: { vivaldi = prev.vivaldi.override { commandLineArgs = "--disable-features=AllowQt"; }; diff --git a/systems/x86_64-linux/workvm/default.nix b/systems/x86_64-linux/workvm/default.nix index 01d1dd4..943f88e 100644 --- a/systems/x86_64-linux/workvm/default.nix +++ b/systems/x86_64-linux/workvm/default.nix @@ -5,14 +5,14 @@ ... }: with lib; -with lib.wyrdgard; { - imports = [./hardware.nix]; +with lib.wyrdgard; +{ + imports = [ ./hardware.nix ]; - boot.blacklistedKernelModules = ["hyperv-fb"]; + boot.blacklistedKernelModules = [ "hyperv-fb" ]; virtualisation.hypervGuest.videoMode = "1920x1080"; - environment.systemPackages = with pkgs; [ - ]; + environment.systemPackages = with pkgs; [ ]; environment.variables.EDITOR = "nvim"; environment.variables.SUDOEDITOR = "nvim"; diff --git a/systems/x86_64-linux/workvm/hardware.nix b/systems/x86_64-linux/workvm/hardware.nix index e6feba0..ec311d4 100644 --- a/systems/x86_64-linux/workvm/hardware.nix +++ b/systems/x86_64-linux/workvm/hardware.nix @@ -7,13 +7,17 @@ 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"; @@ -25,7 +29,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 069e34b..57aff4e 100644 --- a/systems/x86_64-linux/yggdrasil/default.nix +++ b/systems/x86_64-linux/yggdrasil/default.nix @@ -5,13 +5,13 @@ ... }: with lib; -with lib.wyrdgard; { - imports = [./hardware.nix]; +with lib.wyrdgard; +{ + imports = [ ./hardware.nix ]; - environment.systemPackages = with pkgs; [ - ]; + environment.systemPackages = with pkgs; [ ]; - environment.pathsToLink = ["/libexec"]; + environment.pathsToLink = [ "/libexec" ]; wyrdgard = { archetypes = { diff --git a/systems/x86_64-linux/yggdrasil/hardware.nix b/systems/x86_64-linux/yggdrasil/hardware.nix index 61ada1e..654c830 100644 --- a/systems/x86_64-linux/yggdrasil/hardware.nix +++ b/systems/x86_64-linux/yggdrasil/hardware.nix @@ -7,15 +7,24 @@ pkgs, modulesPath, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +}: +{ + 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" "btusb"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "btusb" + ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/444a9216-59d1-46e0-9643-0b716a42ba0b"; @@ -27,7 +36,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