Skip to content

Commit

Permalink
Make use of specialArgs WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
573 committed Sep 17, 2024
1 parent 5eb475e commit 37ded2a
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 19 deletions.
4 changes: 4 additions & 0 deletions flake/builders/mkHome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ inputs.home-manager.lib.homeManagerConfiguration {
inherit inputs rootPath;
libreoffice-postscript = inputs.libreoffice-postscript.legacyPackages.${system};

inherit (inputs.nixvim.legacyPackages.${system}) makeNixvim;
haskellPackages = inputs.ghc-nixpkgs-unstable.legacyPackages.${system}.haskell.packages.ghc965;
ghc-nixpkgs-unstable = inputs.ghc-nixpkgs-unstable.legacyPackages.${system};
unstable = inputs.unstable.legacyPackages.${system};
emacs = if isLinux && isAarch64
then inputs.emacs-overlay-cached.packages.${system}.emacs-unstable-nox
else inputs.emacs-overlay.packages.${system}.emacs-unstable;
Expand Down
1 change: 1 addition & 0 deletions flake/builders/mkNixOnDroid.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ inputs.nix-on-droid.lib.nixOnDroidConfiguration {
extraSpecialArgs = {
inherit inputs rootPath;
unstable = inputs.unstable.legacyPackages.${system};
inherit (inputs.nixvim.legacyPackages.${system}) makeNixvim;
emacs = if isLinux && isAarch64
then inputs.emacs-overlay-cached.packages.${system}.emacs-unstable-nox
else inputs.emacs-overlay.packages.${system}.emacs-unstable;
Expand Down
1 change: 1 addition & 0 deletions flake/builders/mkNixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ inputs.nixpkgs.lib.nixosSystem {
*/
specialArgs = {
inherit inputs rootPath;
inherit (inputs.nixvim.legacyPackages.${system}) makeNixvim;
# NOTE one can alternatively also just (with only inherit inputs;) use in the downstream nix file then: inputs.unstable.legacyPackages.${pkgs.system};
unstable = inputs.unstable.legacyPackages.${system};
emacs = if isLinux && isAarch64
Expand Down
6 changes: 3 additions & 3 deletions home/base/general.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Original author's home'nix files are always prefixed with `{ config, lib, pkgs,
Parameter `[inputs]` here is a deviation from the orinal author's intent (doing that via overlay) and should maybe be fixed
For `[inputs]` parameter determine a solution (./../../nixos/programs/docker.nix also has the issue yet)
*/
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, inputs, unstable, ... }:
let
inherit (lib)
attrValues
Expand All @@ -18,7 +18,7 @@ Attribute `system` here is determined that way (`inherit (pkgs.stdenv.hostPlatfo
If I want to rid overlays I might have to find a way with less potentially bad implications, IDK are there any ?
*/
inherit (pkgs.stdenv.hostPlatform) system;
#inherit (pkgs.stdenv.hostPlatform) system;
cfg = config.custom.base.general;
localeGerman = "de_DE.UTF-8";
localeEnglish = "en_US.UTF-8";
Expand Down Expand Up @@ -143,7 +143,7 @@ in
;

inherit
(inputs.unstable.legacyPackages.${system})
(unstable)
eza
yazi
;
Expand Down
6 changes: 3 additions & 3 deletions home/programs/arbtt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Original author's home'nix files are always prefixed with `{ config, lib, pkgs,
For `[haskellPackages]` parameter determine a solution (./../../nixos/programs/docker.nix also has the issue yet)
*/
{ config, lib, pkgs, /*haskellPackages,*/ inputs, ... }:
{ config, lib, pkgs, haskellPackages, inputs, ... }:

let
inherit (lib)
Expand Down Expand Up @@ -37,7 +37,7 @@ in
config = mkIf cfg.enable {
# FIXME https://github.com/toonn/nix-config/blob/master/home/home.nix
home.packages = attrValues {
inherit (inputs.ghc-nixpkgs-unstable.legacyPackages.${system}.haskell.packages.ghc965)
inherit (haskellPackages)
arbtt
;
};
Expand All @@ -51,7 +51,7 @@ in
let
path = builtins.concatStringsSep ":"
(map (p: "${lib.getBin p}/bin")
(attrValues { inherit (inputs.ghc-nixpkgs-unstable.legacyPackages.${system}.haskell.packages.ghc965) arbtt; inherit (pkgs) coreutils; } # with pkgs; []
(attrValues { inherit (haskellPackages) arbtt; inherit (pkgs) coreutils; } # with pkgs; []
)
);
in
Expand Down
7 changes: 4 additions & 3 deletions home/programs/hledger.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
Original author's home'nix files are always prefixed with `{ config, lib, pkgs, ... }:` header
For `[haskellPackages]` parameter determine a solution (./../../nixos/programs/docker.nix also has the issue yet)
*/
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, inputs, ghc-nixpkgs-unstable, ... }:

let
inherit (lib)
Expand All @@ -17,7 +18,7 @@ let
inherit (pkgs.stdenv) isLinux isx86_64;

inherit
(inputs.ghc-nixpkgs-unstable.legacyPackages.${system})
(ghc-nixpkgs-unstable)
hledger
hledger-utils
hledger-interest
Expand All @@ -30,7 +31,7 @@ Attribute `system` here is determined that way (`inherit (pkgs.stdenv.hostPlatfo
If I want to rid overlays I might have to find a way with less potentially bad implications, IDK are there any ?
*/
inherit (pkgs.stdenv.hostPlatform) system;
# inherit (pkgs.stdenv.hostPlatform) system;

cfg = config.custom.programs.hledger;
in
Expand Down
8 changes: 4 additions & 4 deletions home/programs/neovim.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, rootPath, inputs, ... }:
{ config, lib, pkgs, rootPath, inputs, unstable, makeNixvim, ... }:

let
inherit (lib)
Expand All @@ -19,7 +19,7 @@ let
# version = "2023-20-10";
# };

pluggo = pname: inputs.unstable.legacyPackages.${system}.vimUtils.buildVimPlugin { inherit pname; src = inputs."${pname}"; version = "0.1"; };
pluggo = pname: unstable.vimUtils.buildVimPlugin { inherit pname; src = inputs."${pname}"; version = "0.1"; };
/*extraConfig = ''
if filereadable($HOME . "/.vimrc")
source ~/.vimrc
Expand Down Expand Up @@ -385,7 +385,7 @@ in
config = mkIf cfg.enable (mkMerge [
{
# FIXME add nvim-lsp as in https://github.com/nix-community/nixd/blob/main/nixd/docs/editors/nvim-lsp.nix
custom.programs.neovim.minimalPackage = inputs.nixvim.legacyPackages."${system}".makeNixvim {
custom.programs.neovim.minimalPackage = makeNixvim {
enableMan = false;
colorschemes.gruvbox.enable = true;
extraPlugins = builtins.attrValues {
Expand Down Expand Up @@ -800,7 +800,7 @@ in

(mkIf (!cfg.lightWeight) {
# inputs.nixvim.legacyPackages."${system}".makeNixvim configuration;
custom.programs.neovim.finalPackage = inputs.nixvim.legacyPackages."${system}".makeNixvim configuration;
custom.programs.neovim.finalPackage = makeNixvim configuration;

home.packages = let inherit (config.custom.programs.neovim) finalPackage; in [
finalPackage
Expand Down
16 changes: 10 additions & 6 deletions lib/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ see also ./../flake/builders/mkHome.nix `homeManagerConfiguration.extraSpecialAr
*/
extraSpecialArgs = {
inherit inputs rootPath;
emacs = if isLinux && isAarch64
then inputs.emacs-overlay-cached.packages.${pkgs.system}.emacs-unstable-nox
else inputs.emacs-overlay.packages.${pkgs.system}.emacs-unstable;
inherit (inputs.nixvim.legacyPackages.${pkgs.system}) makeNixvim;
unstable = inputs.unstable.legacyPackages.${pkgs.system};
haskellPackages = inputs.ghc-nixpkgs-unstable.legacyPackages.${pkgs.system}.haskell.packages.ghc965;
ghc-nixpkgs-unstable = inputs.ghc-nixpkgs-unstable.legacyPackages.${pkgs.system};
emacs = if isLinux && isAarch64
then inputs.emacs-overlay-cached.packages.${pkgs.system}.emacs-unstable-nox
else inputs.emacs-overlay.packages.${pkgs.system}.emacs-unstable;

emacsWithPackagesFromUsePackage = if isLinux && isAarch64
then inputs.emacs-overlay-cached.lib.${pkgs.system}.emacsWithPackagesFromUsePackage
else inputs.emacs-overlay.lib.${pkgs.system}.emacsWithPackagesFromUsePackage;
emacsWithPackagesFromUsePackage = if isLinux && isAarch64
then inputs.emacs-overlay-cached.lib.${pkgs.system}.emacsWithPackagesFromUsePackage
else inputs.emacs-overlay.lib.${pkgs.system}.emacsWithPackagesFromUsePackage;
};
sharedModules = homeModules;
useGlobalPkgs = true; # disables options nixpkgs.*
Expand Down

0 comments on commit 37ded2a

Please sign in to comment.