From df7fdb5bc098ebf2220235b2337a1517267ef04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 16 Mar 2023 12:27:42 +0100 Subject: Rework the whole NixOS and packages This uses now primarilly overlays and also variable NIX_PROFILES to chain-load shellrc from bashrc.d and zshrc.d. --- flake.lock | 12 +++--- flake.nix | 136 ++++++++++--------------------------------------------------- nixos.nix | 54 ++++++++++++++++++++++++ pkgs.nix | 61 +++++++++++++++++++++++++++ 4 files changed, 143 insertions(+), 120 deletions(-) create mode 100644 nixos.nix create mode 100644 pkgs.nix diff --git a/flake.lock b/flake.lock index e6da384..1b37211 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "type": "github" }, "original": { @@ -16,11 +16,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1654875595, - "narHash": "sha256-Vairke3ryPSFpgQdaYicPPhPWMGhtzm6V+1uF2Tefbk=", + "lastModified": 1678875422, + "narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3f909fb574d9b9d7294e544981c62a4a5e4599fc", + "rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 35c0231..013277b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,120 +1,28 @@ { description = "Cynerd's shell configuration"; - outputs = { self, flake-utils, nixpkgs }: - let - - loadrc = dir: '' - for sh in ${dir}/*; do - [ -r "$sh" ] && . "$sh" - done - ''; - commonrc = loadrc ./shellrc.d; - desktoprc = loadrc ./shellrc-desktop.d; - bashrc = loadrc ./bashrc.d; - zshrc = loadrc ./zshrc.d; - - packages = pkgs: rec { - shellrc-generic = pkgs.stdenvNoCC.mkDerivation { - name = "shellrc-profile"; - src = ./.; - installPhase = '' - mkdir -p "$out/etc/shellrc" - cp -r ./shellrc.d/. "$out/etc/shellrc/" - ''; - }; - shellrc-bashrc = pkgs.stdenvNoCC.mkDerivation { - name = "shellrc-profile-bash"; - src = ./.; - shellrc = shellrc-generic; - installPhase = '' - mkdir -p "$out/etc/bashrc.d" - cp -r ./bashrc.d/. "$out/etc/bashrc.d/" - cat >"$out/etc/bashrc.d/shellrc" <"$out/etc/zshrc.d/shellrc" <"$out/etc/bashrc.d/shellrc" <"$out/etc/zshrc.d/shellrc" <