Browse Source

Add a default.nix for building

master
Peter J. Jones 6 months ago
parent
commit
f26f4944dc
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
2 changed files with 17 additions and 3 deletions
  1. 4
    3
      GNUmakefile
  2. 13
    0
      default.nix

+ 4
- 3
GNUmakefile View File

@@ -1,5 +1,6 @@
################################################################################
PREFIX ?= $(HOME)
DOT ?= .

################################################################################
LIBS = $(shell find func lib os wids -type f)
@@ -20,9 +21,9 @@ $(PREFIX)/$(2): $(1)
endef

################################################################################
$(foreach f,$(LIBS),$(eval $(call INSTALL_FILE,$(f),.zsh/$(f))))
$(foreach f,$(DOTS),$(eval $(call INSTALL_FILE,$(f),.$(notdir $(f)))))
$(foreach f,$(LIBS),$(eval $(call INSTALL_FILE,$(f),$(DOT)zsh/$(f))))
$(foreach f,$(DOTS),$(eval $(call INSTALL_FILE,$(f),$(DOT)$(notdir $(f)))))

################################################################################
uninstall:
rm -rf $(PREFIX)/.zsh $(PREFIX)/.zshenv $(PREFIX)/.zshrc
rm -rf $(PREFIX)/$(DOT)zsh $(PREFIX)/$(DOT)zshenv $(PREFIX)/$(DOT)zshrc

+ 13
- 0
default.nix View File

@@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> { }
}:

pkgs.stdenvNoCC.mkDerivation {
name = "zshrc";
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
src = ./.;

installPhase = ''
mkdir -p $out/share/zshrc
make PREFIX=$out/share/zshrc DOT= install
'';
}

Loading…
Cancel
Save