diff --git a/flake/builders/mkHome.nix b/flake/builders/mkHome.nix index 01a480dc..133c9346 100644 --- a/flake/builders/mkHome.nix +++ b/flake/builders/mkHome.nix @@ -17,11 +17,16 @@ inputs.home-manager.lib.homeManagerConfiguration { pkgs = pkgsFor.${system}; /** as in ./../../lib/common-config.nix `homeManager.baseConfig.extraSpecialArgs` + These herein are needed for ./../../home/ modules' parameters */ extraSpecialArgs = { 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; diff --git a/flake/builders/mkNixOnDroid.nix b/flake/builders/mkNixOnDroid.nix index 41e0c2d2..0df9e2ad 100644 --- a/flake/builders/mkNixOnDroid.nix +++ b/flake/builders/mkNixOnDroid.nix @@ -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; diff --git a/flake/builders/mkNixos.nix b/flake/builders/mkNixos.nix index 3729f042..6836854e 100644 --- a/flake/builders/mkNixos.nix +++ b/flake/builders/mkNixos.nix @@ -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 diff --git a/home/base/general.nix b/home/base/general.nix index 5066887f..4332188e 100644 --- a/home/base/general.nix +++ b/home/base/general.nix @@ -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 @@ -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"; @@ -31,7 +31,7 @@ in enable = mkEnableOption "basic config" // { default = true; }; lightWeight = - mkEnableOption "light weight config for low performance hosts"; + mkEnableOption "light weight config for low performance hosts" // { default = false; }; wsl = mkEnableOption "config for NixOS-WSL instances"; @@ -49,7 +49,7 @@ in ###### implementation config = mkIf cfg.enable (mkMerge [ - (mkIf (!cfg.termux) { + { custom.programs = { emacs-novelist.enable = true; emacs-nano.enable = true; @@ -58,7 +58,8 @@ in nix-index.enable = true; neovim = { enable = true; - lightWeight = false; # FIXME Remove this line, only for testing if build works on nix-on-droid + # not inherit not same attr + lightWeight = cfg.lightWeight; }; }; @@ -143,7 +144,7 @@ in ; inherit - (inputs.unstable.legacyPackages.${system}) + (unstable) eza yazi ; @@ -159,6 +160,7 @@ in ]; PAGER = "${pkgs.less}/bin/less"; SHELL = "bash"; + # TODO how does that interfere with same attr in neovim.nix EDITOR = "vi"; VISUAL = "vi"; # (ft-man-plugin), @@ -169,13 +171,37 @@ in # export MANPAGER='nvim -u NONE -i NONE "+runtime plugin/man.lua" -c "Man"''!'' -o -' #working#MANPAGER = "${config.custom.programs.neovim.finalPackage}/bin/nvim -u NONE -i NONE '+runtime plugin/man.lua' -c Man! -o -"; }; - }; + } + { + home.stateVersion = "24.05"; + } + + { programs.fzf.enable = true; # FIXME: set to sd-switch once it works for krypton, https://home-manager-options.extranix.com/?query=systemd.user.startServices&release=release-24.05 systemd.user.startServices = "legacy"; + } + + (mkIf (!cfg.minimal) { + custom = { + misc.util-bins.enable = true; + + # see ./home/programs + programs = { + git.enable = true; + nnn.enable = true; + rsync.enable = true; + ssh = { + enable = true; + # modules = [ "vcs" ]; + }; + }; + }; + + programs.home-manager.enable = true; }) (mkIf cfg.wsl { @@ -187,30 +213,10 @@ in # programs.starship.enable = true; # long lines are distorted }) - { - home.stateVersion = "24.05"; - } - - (mkIf cfg.termux { - custom = { - base.general = { - lightWeight = true; - minimal = true; - }; - programs.emacs-novelist.enable = true; - }; - }) - (mkIf (!cfg.lightWeight) { custom.programs = { tmux.enable = true; emacs.enable = true; - # emacs-novelist.enable = true; - #emacs-nano.enable = true; - neovim = { - enable = true; - lightWeight = false; - }; }; home.packages = attrValues { @@ -228,26 +234,5 @@ in ; }; }) - - (mkIf (!cfg.minimal) { - custom = { - misc.util-bins.enable = true; - - # see ./home/programs - programs = { - git.enable = true; - nnn.enable = true; - rsync.enable = true; - ssh = { - enable = true; - # modules = [ "vcs" ]; - }; - }; - }; - - programs = { - home-manager.enable = true; - }; - }) ]); } diff --git a/home/programs/arbtt.nix b/home/programs/arbtt.nix index 88585c43..fa4ce314 100644 --- a/home/programs/arbtt.nix +++ b/home/programs/arbtt.nix @@ -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) @@ -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 ; }; @@ -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 diff --git a/home/programs/hledger.nix b/home/programs/hledger.nix index 7f53fb82..000b7ffc 100644 --- a/home/programs/hledger.nix +++ b/home/programs/hledger.nix @@ -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) @@ -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 @@ -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 diff --git a/home/programs/neovim.nix b/home/programs/neovim.nix index ab3e6814..934f1c0d 100644 --- a/home/programs/neovim.nix +++ b/home/programs/neovim.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, rootPath, inputs, ... }: +{ config, lib, pkgs, rootPath, inputs, unstable, makeNixvim, ... }: let inherit (lib) @@ -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 @@ -354,7 +354,7 @@ in enable = mkEnableOption "neovim config"; lightWeight = - mkEnableOption "light weight config for low performance hosts" // { default = true; }; + mkEnableOption "light weight neovim (vi) config for low performance hosts" // { default = true; }; #lightweight = mkEnableOption "light weight config for low performance hosts"; minimalPackage = mkOption { @@ -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 { @@ -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 diff --git a/lib/common-config.nix b/lib/common-config.nix index b4ab9dd1..257e90d2 100644 --- a/lib/common-config.nix +++ b/lib/common-config.nix @@ -2,7 +2,8 @@ _: { lib, pkgs, homeModules ? [ ], inputs, rootPath, ... }: let - inherit (pkgs.stdenv) isLinux isAarch64 + inherit (pkgs.stdenv) isLinux isAarch64; + inherit (inputs.unstable.legacyPackages.${pkgs.system}.pkgs.nixVersions) nix_2_20 ; in { /** @@ -16,13 +17,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.* @@ -78,7 +83,7 @@ see also ./../flake/builders/mkHome.nix `homeManagerConfiguration.extraSpecialAr }; - package = pkgs.nixVersions.nix_2_20; + package = nix_2_20; # until fixed: https://discourse.nixos.org/t/need-help-with-this-git-related-flake-update-error/50538/7 # https://discourse.nixos.org/t/flake-registry-set-to-a-store-path-keeps-copying/44613 diff --git a/nixos/wsl/usbip.nix b/nixos/wsl/usbip.nix index 6afd2f64..4aae8e44 100644 --- a/nixos/wsl/usbip.nix +++ b/nixos/wsl/usbip.nix @@ -43,10 +43,16 @@ in config = mkIf (cfg.enable) { - environment.systemPackages = [ - pkgs.linuxPackages.usbip - pkgs.usbutils.out - ]; + environment.systemPackages = builtins.attrValues { + inherit + (pkgs.linuxPackages) + usbip + ; + inherit + (pkgs.usbutils) + out + ; + }; services.udev.enable = true; @@ -60,10 +66,16 @@ in after = [ "wsl-vpnkit.target" ]; scriptArgs = "%i"; - path = with pkgs; [ - iproute2 - linuxPackages.usbip - ]; + path = builtins.attrValues { + inherit + (pkgs) + iproute2 + ; + inherit + (pkgs.linuxPackages) + usbip + ; + }; script = '' busid="$1" diff --git a/nixos/wsl/wsl-vpnkit.nix b/nixos/wsl/wsl-vpnkit.nix index b6efc16d..04305969 100644 --- a/nixos/wsl/wsl-vpnkit.nix +++ b/nixos/wsl/wsl-vpnkit.nix @@ -5,7 +5,7 @@ see ./../programs/docker.nix for similar issue , lib , pkgs , inputs -/*, unstable*/ +, unstable , ... }: let @@ -20,13 +20,12 @@ 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; # FIXME FIXME https://github.com/NixOS/nixpkgs/issues/5725#issuecomment-72851235 # FIXME is workaround until upstream has the PR accepted, see https://github.com/nix-community/NixOS-WSL/issues/262#issuecomment-1825648537 wsl-vpnkit = - let inherit (inputs.unstable.legacyPackages.${system}) + let inherit (unstable) lib findutils pstree