Browse Source

Add a default.nix for building

master
Peter J. Jones 4 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 @@
1 1
 ################################################################################
2 2
 PREFIX ?= $(HOME)
3
+DOT    ?= .
3 4
 
4 5
 ################################################################################
5 6
 LIBS = $(shell find func lib os wids -type f)
@@ -20,9 +21,9 @@ $(PREFIX)/$(2): $(1)
20 21
 endef
21 22
 
22 23
 ################################################################################
23
-$(foreach f,$(LIBS),$(eval $(call INSTALL_FILE,$(f),.zsh/$(f))))
24
-$(foreach f,$(DOTS),$(eval $(call INSTALL_FILE,$(f),.$(notdir $(f)))))
24
+$(foreach f,$(LIBS),$(eval $(call INSTALL_FILE,$(f),$(DOT)zsh/$(f))))
25
+$(foreach f,$(DOTS),$(eval $(call INSTALL_FILE,$(f),$(DOT)$(notdir $(f)))))
25 26
 
26 27
 ################################################################################
27 28
 uninstall:
28
-	rm -rf $(PREFIX)/.zsh $(PREFIX)/.zshenv $(PREFIX)/.zshrc
29
+	rm -rf $(PREFIX)/$(DOT)zsh $(PREFIX)/$(DOT)zshenv $(PREFIX)/$(DOT)zshrc

+ 13
- 0
default.nix View File

@@ -0,0 +1,13 @@
1
+{ pkgs ? import <nixpkgs> { }
2
+}:
3
+
4
+pkgs.stdenvNoCC.mkDerivation {
5
+  name = "zshrc";
6
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
7
+  src = ./.;
8
+
9
+  installPhase = ''
10
+    mkdir -p $out/share/zshrc
11
+    make PREFIX=$out/share/zshrc DOT= install
12
+  '';
13
+}

Loading…
Cancel
Save