From 7360237ab85a5b8596823d804fe7613066655ec9 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 24 May 2023 20:23:33 +0300 Subject: [PATCH] Use recursive update instead of // --- flake.nix | 4 ++- machines/asus/bat/default.nix | 8 +++--- machines/asus/default.nix | 6 +---- machines/asus/fonts.nix | 4 +-- machines/asus/helix/default.nix | 33 ++++++++++++++++++++----- machines/asus/helix/languageServers.nix | 30 ---------------------- machines/asus/nushell/default.nix | 4 +-- machines/asus/packages.nix | 4 +-- machines/asus/python/default.nix | 4 +-- 9 files changed, 38 insertions(+), 59 deletions(-) delete mode 100644 machines/asus/helix/languageServers.nix diff --git a/flake.nix b/flake.nix index ff2c651..3a079fe 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,9 @@ hostPlatform = import (configurationDirectory + "/platform.nix"); in { nixosConfigurations.${hostName} = nixosSystem { - lib = nixpkgs.lib; + lib = nixpkgs.lib // { + recursiveUpdate3 = x: y: z: nixpkgs.lib.recursiveUpdate x (nixpkgs.lib.recursiveUpdate y z); + }; pkgs = import nixpkgs { system = hostPlatform; diff --git a/machines/asus/bat/default.nix b/machines/asus/bat/default.nix index 2df1f6d..154539e 100644 --- a/machines/asus/bat/default.nix +++ b/machines/asus/bat/default.nix @@ -1,14 +1,12 @@ -{ pkgs, systemConfiguration, systemPackages, ... }: +{ lib, pkgs, systemConfiguration, systemPackages, ... }: lib.recursiveUpdate (with pkgs; systemPackages [ bat ]) -// - (systemConfiguration { - environment.variables = { + environment.sessionVariables = { PAGER = "bat --plain"; - MANPAGER = "col --spaces --no-backspaces | bat --plain --language man"; + MANPAGER = "sh -c 'col --spaces --no-backspaces | bat --plain --language man'"; }; }) diff --git a/machines/asus/default.nix b/machines/asus/default.nix index 81ac36d..cfbbdae 100644 --- a/machines/asus/default.nix +++ b/machines/asus/default.nix @@ -1,17 +1,13 @@ -{ systemConfiguration, homeConfiguration, imports, ... }: +{ lib, systemConfiguration, homeConfiguration, imports, ... }: lib.recursiveUpdate3 (systemConfiguration { system.stateVersion = "22.11"; }) -// - (homeConfiguration "nixos" { home.stateVersion = "22.11"; }) -// - (imports [ ./bat ./discord diff --git a/machines/asus/fonts.nix b/machines/asus/fonts.nix index 4554493..9298879 100644 --- a/machines/asus/fonts.nix +++ b/machines/asus/fonts.nix @@ -1,4 +1,4 @@ -{ pkgs, systemConfiguration, systemFonts, ... }: +{ lib, pkgs, systemConfiguration, systemFonts, ... }: lib.recursiveUpdate (systemConfiguration { console = { @@ -10,8 +10,6 @@ }; }) -// - (with pkgs; systemFonts [ (nerdfonts.override { fonts = [ diff --git a/machines/asus/helix/default.nix b/machines/asus/helix/default.nix index 5e482a2..f7987fb 100644 --- a/machines/asus/helix/default.nix +++ b/machines/asus/helix/default.nix @@ -1,11 +1,9 @@ -{ pkgs, systemPackages, homeConfiguration, imports, enabled, ... }: +{ lib, pkgs, systemPackages, homeConfiguration, homePackages, enabled, ... }: lib.recursiveUpdate3 (with pkgs; systemPackages [ xclip ]) -// - (homeConfiguration "nixos" { programs.nushell.environmentVariables = { EDITOR = "hx"; @@ -50,8 +48,31 @@ }; }) -// +(with pkgs; homePackages "nixos" [ + # CMAKE + cmake-language-server -(imports [ - ./languageServers.nix + # GO + gopls + + # KOTLIN + kotlin-language-server + + # LATEX + texlab + + # LUA + lua-language-server + + # MARKDOWN + marksman + + # NIX + nil + + # RUST + rust-analyzer + + # ZIG + zls ]) diff --git a/machines/asus/helix/languageServers.nix b/machines/asus/helix/languageServers.nix deleted file mode 100644 index 951e136..0000000 --- a/machines/asus/helix/languageServers.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ pkgs, homePackages, ... }: - -with pkgs; homePackages "nixos" [ - # CMAKE - cmake-language-server - - # GO - gopls - - # KOTLIN - kotlin-language-server - - # LATEX - texlab - - # LUA - lua-language-server - - # MARKDOWN - marksman - - # NIX - nil - - # RUST - rust-analyzer - - # ZIG - zls -] diff --git a/machines/asus/nushell/default.nix b/machines/asus/nushell/default.nix index 73c45c6..79238fd 100644 --- a/machines/asus/nushell/default.nix +++ b/machines/asus/nushell/default.nix @@ -1,11 +1,9 @@ -{ pkgs, systemConfiguration, homeConfiguration, enabled, ... }: +{ lib, pkgs, systemConfiguration, homeConfiguration, enabled, ... }: lib.recursiveUpdate (systemConfiguration { users.users.nixos.shell = pkgs.nushell; }) -// - (homeConfiguration "nixos" { programs.starship = enabled { settings.character = { diff --git a/machines/asus/packages.nix b/machines/asus/packages.nix index e0f6813..103d6f7 100644 --- a/machines/asus/packages.nix +++ b/machines/asus/packages.nix @@ -1,4 +1,4 @@ -{ pkgs, systemPackages, homePackages, ... }: +{ lib, pkgs, systemPackages, homePackages, ... }: lib.recursiveUpdate (with pkgs; systemPackages [ fd @@ -29,8 +29,6 @@ lightly-qt ]) -// - (with pkgs; homePackages "nixos" [ heroic jetbrains.idea-ultimate diff --git a/machines/asus/python/default.nix b/machines/asus/python/default.nix index 6902074..ef23c3f 100644 --- a/machines/asus/python/default.nix +++ b/machines/asus/python/default.nix @@ -1,4 +1,4 @@ -{ pkgs, systemPackages, homeConfiguration, enabled, ... }: +{ lib, pkgs, systemPackages, homeConfiguration, enabled, ... }: lib.recursiveUpdate (with pkgs; systemPackages [ (python311.withPackages (pkgs: with pkgs; [ @@ -9,8 +9,6 @@ poetry ]) -// - (homeConfiguration "nixos" { programs.nushell.shellAliases = { venv = "virtualenv venv";