diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-03-17 17:53:52 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-03-17 17:54:42 -0600 |
| commit | 7fd816ba89cb4d924d89b2f7e07028644dce0c7f (patch) | |
| tree | 46766472a6ea8ff381c45d77547b2ba54a8fb775 | |
| parent | 484b589512acde9442d93ac9b6f331d7cc2551e6 (diff) | |
home: add shenv gc root
Diffstat (limited to '')
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | home/default.nix | 4 | ||||
| -rw-r--r-- | pkgs/default.nix | 5 | ||||
| -rw-r--r-- | shenvs/android-dev.nix | 6 | ||||
| -rw-r--r-- | shenvs/config.nix | 8 | ||||
| -rw-r--r-- | shenvs/dsp.nix | 5 | ||||
| -rw-r--r-- | shenvs/el3310.nix | 6 | ||||
| -rw-r--r-- | shenvs/randall.nix | 8 | ||||
| -rw-r--r-- | util/importAll.nix | 6 |
9 files changed, 45 insertions, 5 deletions
@@ -1,3 +1 @@ !**/.keep - -shenvs/** diff --git a/home/default.nix b/home/default.nix index dcd7cb3..70bc03f 100644 --- a/home/default.nix +++ b/home/default.nix @@ -37,6 +37,10 @@ "vtmp" = symlink "/run/user/1000/vtmp"; ".calc_history" = devNull; ".units_history" = devNull; + + ".shenvs".text = let + keeps = { gcKeep ? [] }: map (p: "# ${p}\n") gcKeep; + in keeps (import ../shenvs/config.nix pkgs.local.shenvs); }; packages = import ./path.nix pkgs; diff --git a/pkgs/default.nix b/pkgs/default.nix index f8cda14..35cf2bf 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,7 +3,10 @@ in { shenvs = let env = name: env: pkgs.buildEnv (env pkgs // { name = "shenv-${name}"; }); - in pkgs.lib.mapAttrs env (util.importAll { root = ../shenvs; }); + in pkgs.lib.mapAttrs env (util.importAll { + root = ../shenvs; + exclude = [ "config" ]; + }); git-aliases = callPackage ./git-aliases.nix {}; scripts = callPackage ./scripts {}; diff --git a/shenvs/android-dev.nix b/shenvs/android-dev.nix new file mode 100644 index 0000000..5bf29eb --- /dev/null +++ b/shenvs/android-dev.nix @@ -0,0 +1,6 @@ +pkgs: { + paths = with pkgs; [ + android-tools + gradle + ]; +} diff --git a/shenvs/config.nix b/shenvs/config.nix new file mode 100644 index 0000000..caf4b18 --- /dev/null +++ b/shenvs/config.nix @@ -0,0 +1,8 @@ +shenvs: { + gcKeep = with shenvs; [ + android-dev + dsp + el3310 + randall + ]; +} diff --git a/shenvs/dsp.nix b/shenvs/dsp.nix new file mode 100644 index 0000000..d5828e3 --- /dev/null +++ b/shenvs/dsp.nix @@ -0,0 +1,5 @@ +pkgs: { + paths = with pkgs; [ + octave + ]; +} diff --git a/shenvs/el3310.nix b/shenvs/el3310.nix new file mode 100644 index 0000000..c680721 --- /dev/null +++ b/shenvs/el3310.nix @@ -0,0 +1,6 @@ +pkgs: { + paths = with pkgs; [ + gcc-arm-embedded + + ]; +} diff --git a/shenvs/randall.nix b/shenvs/randall.nix new file mode 100644 index 0000000..dd628bc --- /dev/null +++ b/shenvs/randall.nix @@ -0,0 +1,8 @@ +pkgs: { + paths = with pkgs; [ + ghostscript + imagemagick + paps + pdftk + ]; +} diff --git a/util/importAll.nix b/util/importAll.nix index c4a092e..678cf06 100644 --- a/util/importAll.nix +++ b/util/importAll.nix @@ -4,11 +4,13 @@ with builtins; with lib; # http://chriswarbo.net/projects/nixos/useful_hacks.html let + basename = removeSuffix ".nix"; + isMatch = name: type: (hasSuffix ".nix" name || type == "directory") - && ! elem name exclude; + && ! elem name (map basename exclude); entry = name: _: { - name = removeSuffix ".nix" name; + name = basename name; value = import (root + "/${name}"); }; in |
