summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix13
-rw-r--r--home/zshrc.nix8
-rw-r--r--nixpkgs.nix3
-rw-r--r--pkgs/default.nix13
4 files changed, 18 insertions, 19 deletions
diff --git a/flake.nix b/flake.nix
index bbac6ec..0f29de3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,27 +11,22 @@
nur.url = "github:nix-community/NUR";
};
- outputs = { self, nixpkgs, home-manager, nur, ... }: let
- pkgs = import nixpkgs {
- system = "x86_64-linux";
- config = import ./nixpkgs.nix;
- };
- in with pkgs.lib; let
+ outputs = { self, nixpkgs, home-manager, nur, ... }: with nixpkgs.lib; let
util = import ./util;
- inherit (util pkgs.lib) importAll;
+ inherit (util nixpkgs.lib) importAll;
pkgSet = pkgs: import ./pkgs {
inherit pkgs;
util = util pkgs.lib;
};
in {
- packages."x86_64-linux" = pkgSet pkgs;
+ packages."x86_64-linux" = pkgSet nixpkgs.legacyPackages."x86_64-linux";
overlay = self: super: {
local = pkgSet super;
};
- nixosConfigurations = with pkgs.lib; let
+ nixosConfigurations = let
hostConfig = host: (makeOverridable nixosSystem) {
system = "x86_64-linux";
modules = [ (import ./sys self) host ];
diff --git a/home/zshrc.nix b/home/zshrc.nix
index 39b34ff..85cdc95 100644
--- a/home/zshrc.nix
+++ b/home/zshrc.nix
@@ -43,8 +43,10 @@
INSTALLABLES=()
while read -d: PATH_ITEM; do
- if [[ "$PATH_ITEM" =~ "^/nix/store/[a-z0-9]+-([a-zA-Z][a-zA-Z0-9_]*(-[a-zA-Z][a-zA-Z0-9_]*)*)" ]]; then
- INSTALLABLES+=("''${match[1]}")
+ if [[ "$PATH_ITEM" =~ "^(/nix/store/[a-z0-9]+-([a-zA-Z][a-zA-Z0-9_]*(-[a-zA-Z][a-zA-Z0-9_]*)*)(-[^/]+)?)/" ]]; then
+ ENTER="''${match[1]}/lib/shenv/enter"
+ [[ "''${match[2]}" =~ '^shenv-' && -r "$ENTER" ]] && . "$ENTER"
+ INSTALLABLES+=("''${match[2]}")
fi
done <<<"$PATH"
@@ -52,7 +54,7 @@
_GRML_NIX_SHELL="{''${INSTALLABLES[@]}} "
fi
- unset INSTALLABLES PATH_ITEM
+ unset INSTALLABLES ENTER PATH_ITEM
function grml_nix_shell() {
REPLY="$_GRML_NIX_SHELL"
diff --git a/nixpkgs.nix b/nixpkgs.nix
deleted file mode 100644
index 8d78534..0000000
--- a/nixpkgs.nix
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- android_sdk.accept_license = true;
-}
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 35cf2bf..5ee0a63 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -1,9 +1,14 @@
-{ pkgs, util }: let
- inherit (pkgs) callPackage;
+{ pkgs, util }:
+with pkgs.lib; let
+ inherit (pkgs) buildEnv callPackage writeTextDir;
in {
shenvs = let
- env = name: env: pkgs.buildEnv (env pkgs // { name = "shenv-${name}"; });
- in pkgs.lib.mapAttrs env (util.importAll {
+ build = name: { paths, enter ? null }: buildEnv {
+ name = "shenv-${name}";
+ paths = (optional (enter != null) (writeTextDir "lib/shenv/enter" enter))
+ ++ paths;
+ };
+ in pkgs.lib.mapAttrs (name: shenv: build name (shenv pkgs)) (util.importAll {
root = ../shenvs;
exclude = [ "config" ];
});