Reorganize files
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 May 2019 12:43:09 +0000 (14:43 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 27 May 2019 22:40:06 +0000 (00:40 +0200)
Makefile [new file with mode: 0644]
default.nix
lib/default.nix [moved from libs.nix with 98% similarity]
overlays/default.nix
pkgs/default.nix
scripts/fetch_version [moved from fetch_version with 100% similarity]
scripts/make-env
scripts/nix_env [moved from nix_path_env with 89% similarity]
scripts/nix_infos

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..f4bb3f5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+subrecipes = setup ssh-eldiron info debug dry-run build upload deploy reboot push pull pull-deployment list-generations delete-generations cleanup
+${subrecipes}:
+       @$(MAKE) --no-print-directory -C nixops/ $@
+
+env:
+       ./scripts/make-env
+
+env-dry-run:
+       ./scripts/make-env --dry-run
+
+nix-info:
+       NIXOPS_DEPLOYMENT="" ./scripts/nix_infos
+
+nix-info-nixops:
+       NIXOPS_DEPLOYMENT="n" ./scripts/nix_infos
+
+nur:
+       ./scripts/make-nur
+
+.PHONY: env env-dry-run nix-info nix-info-nixops
index c7f515b..ae27e32 100644 (file)
@@ -4,7 +4,7 @@ let
   mypkgs = import ./pkgs { pkgs = pkgs_; };
 in
 {
-  lib = import ./libs.nix { pkgs = pkgs_; };
+  lib = import ./lib { pkgs = pkgs_; };
   modules = import ./modules;
   overlays = import ./overlays;
   pkgs = mypkgs;
similarity index 98%
rename from libs.nix
rename to lib/default.nix
index 48787af..1baee1f 100644 (file)
--- a/libs.nix
@@ -10,7 +10,7 @@ rec {
   in
     (callPackage src {}) // { inherit src; };
 
-  nodeEnv = import ./lib/node-env.nix;
+  nodeEnv = import ./node-env.nix;
 
   fetchedGithub = path:
     let
index 408515e..42c0386 100644 (file)
@@ -1,5 +1,5 @@
 {
-  mylibs = self: super: { mylibs = import ../libs.nix { pkgs = self; }; };
+  mylibs = self: super: { mylibs = import ../lib { pkgs = self; }; };
   mypkgs = self: super: import ../pkgs { pkgs = self; };
 
   bitlbee = import ./bitlbee;
index 8ea65a5..297f524 100644 (file)
@@ -1,7 +1,7 @@
 { pkgs }:
 with pkgs;
 let
-  mylibs = import ../libs.nix { inherit pkgs; };
+  mylibs = import ../lib { inherit pkgs; };
 in
 rec {
   boinctui = callPackage ../pkgs/boinctui {};
similarity index 100%
rename from fetch_version
rename to scripts/fetch_version
index ebb1eed..983a359 100755 (executable)
@@ -2,10 +2,11 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 
-source $(dirname $DIR)/nix_path_env
+source $DIR/nix_env
 nix-env -r -i -A myEnvironments.immae-eu -f "<nixpkgs>" "$@"
+result=$?
 
 cat >> $(dirname $DIR)/versions_log <<EOF
-# Ran $(date) with args "$@"
-$($DIR/nix_infos | sed -e "s/^/#   /")
+Ran $(date) with args "$@" and returned "$result"
+$($DIR/nix_infos | sed -e "s/^/    /")
 EOF
similarity index 89%
rename from nix_path_env
rename to scripts/nix_env
index 19f7cca..6326243 100644 (file)
@@ -12,6 +12,6 @@ export NIX_PATH="nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext:nixpkgsPrevious=$nixp
 
 nixops_custom () {
   DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-  d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $DIR/overlays); }; nixops")
+  d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $(dirname $DIR)/overlays); }; nixops")
   ${d}/bin/nixops "$@"
 }
index f824305..56e5b19 100755 (executable)
@@ -2,7 +2,7 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 
-source $(dirname $DIR)/nix_path_env
+source $DIR/nix_env
 version=$(nix eval --raw nixpkgs.lib.version)
 mainversion=$(echo $version | cut -d"." -f -2)