diff --git a/nixos/configs/default.nix b/nixos/configs/default.nix index f2e4a7a..b271e6a 100644 --- a/nixos/configs/default.nix +++ b/nixos/configs/default.nix @@ -1,7 +1,7 @@ toplevel@{ inputs, withSystem, ... }: let system = "x86_64-linux"; - nixosModules = toplevel.config.flake.nixosModules; + mods = toplevel.config.flake.nixosModules; hardwareConfigurations = { nova = { lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -24,37 +24,20 @@ let hardware.cpu.intel.updateMicrocode = lib.mkForce false; }; }; - essential = [ hardwareConfigurations.nova inputs.hosts.nixosModule ] ++ (with nixosModules; [ grub base sound wayland security ivand wireless wireguard ]); + essential = [ hardwareConfigurations.nova inputs.hosts.nixosModule ] ++ (with mods; [ grub base sound wayland security ivand wireless wireguard ]); + systemWithModules = modules: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs inputs' pkgs; + packages = config.packages; + }; + modules = modules; + }); in { flake.nixosConfigurations = { - nixos = withSystem system (ctx@{ config, inputs', ... }: inputs.nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs inputs'; - packages = config.packages; - }; - modules = essential; - }); - music = withSystem system (ctx@{ config, inputs', ... }: inputs.nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs inputs'; - packages = config.packages; - }; - modules = essential ++ [ inputs.musnix.nixosModules.musnix nixosModules.music ]; - }); - nonya = withSystem system (ctx@{ config, inputs', ... }: inputs.nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs inputs'; - packages = config.packages; - }; - modules = essential ++ (with nixosModules; [ anon cryptocurrency ]); - }); - ai = withSystem system (ctx@{ config, inputs', ... }: inputs.nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs inputs'; - packages = config.packages; - }; - modules = essential ++ [ nixosModules.ai ]; - }); + nixos = systemWithModules essential; + music = systemWithModules (essential ++ [ inputs.musnix.nixosModules.musnix mods.music ]); + nonya = systemWithModules (essential ++ (with mods; [ anon cryptocurrency ])); + ai = systemWithModules (essential ++ (with mods; [ ai ])); }; } diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 3b8c9df..e064c93 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -18,7 +18,7 @@ top@{ moduleWithSystem, ... }: { i18n.supportedLocales = [ "all" ]; time.timeZone = "Europe/Prague"; environment = { - systemPackages = with pkgs; [ wpd cmatrix uutils-coreutils-noprefix cryptsetup fd file git glibc gnumake mlocate openssh openssl procs ripgrep srm unzip vim zip just ]; + systemPackages = with pkgs; [ cmatrix uutils-coreutils-noprefix cryptsetup fd file git glibc gnumake mlocate openssh openssl procs ripgrep srm unzip vim zip just ]; sessionVariables = { MAKEFLAGS = "-j 4"; }; shells = with pkgs; [ bash zsh nushell ]; };