aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-24 14:43:09 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-24 14:45:37 +0200
commitdbcba2ea2b7301aaa7e6487c2589b09ef09ba066 (patch)
treeb4cd4b064468840e96757a55adbe9fd57a9d7904
parentdb4f87d640a090c4b469595737503f4189923c45 (diff)
downloadNix-dbcba2ea2b7301aaa7e6487c2589b09ef09ba066.tar.gz
Nix-dbcba2ea2b7301aaa7e6487c2589b09ef09ba066.tar.zst
Nix-dbcba2ea2b7301aaa7e6487c2589b09ef09ba066.zip
Reorganize files
-rw-r--r--Makefile20
-rw-r--r--default.nix2
-rw-r--r--lib/default.nix (renamed from libs.nix)2
-rw-r--r--nixops/default.nix (renamed from nixops/eldiron.nix)0
-rwxr-xr-xnixops/scripts/nixops_wrap2
-rwxr-xr-xnixops/scripts/pull_deployment2
-rwxr-xr-xnixops/scripts/push_deployment2
-rwxr-xr-xnixops/scripts/setup6
-rw-r--r--overlays/default.nix2
-rw-r--r--pkgs/default.nix2
-rw-r--r--pkgs/private/default.nix2
-rwxr-xr-xscripts/fetch_version (renamed from fetch_version)0
-rwxr-xr-xscripts/make-env7
-rw-r--r--scripts/nix_env (renamed from nix_path_env)2
-rwxr-xr-xscripts/nix_infos2
15 files changed, 37 insertions, 16 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f4bb3f5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
1subrecipes = setup ssh-eldiron info debug dry-run build upload deploy reboot push pull pull-deployment list-generations delete-generations cleanup
2${subrecipes}:
3 @$(MAKE) --no-print-directory -C nixops/ $@
4
5env:
6 ./scripts/make-env
7
8env-dry-run:
9 ./scripts/make-env --dry-run
10
11nix-info:
12 NIXOPS_DEPLOYMENT="" ./scripts/nix_infos
13
14nix-info-nixops:
15 NIXOPS_DEPLOYMENT="n" ./scripts/nix_infos
16
17nur:
18 ./scripts/make-nur
19
20.PHONY: env env-dry-run nix-info nix-info-nixops
diff --git a/default.nix b/default.nix
index c7f515b..ae27e32 100644
--- a/default.nix
+++ b/default.nix
@@ -4,7 +4,7 @@ let
4 mypkgs = import ./pkgs { pkgs = pkgs_; }; 4 mypkgs = import ./pkgs { pkgs = pkgs_; };
5in 5in
6{ 6{
7 lib = import ./libs.nix { pkgs = pkgs_; }; 7 lib = import ./lib { pkgs = pkgs_; };
8 modules = import ./modules; 8 modules = import ./modules;
9 overlays = import ./overlays; 9 overlays = import ./overlays;
10 pkgs = mypkgs; 10 pkgs = mypkgs;
diff --git a/libs.nix b/lib/default.nix
index 48787af..1baee1f 100644
--- a/libs.nix
+++ b/lib/default.nix
@@ -10,7 +10,7 @@ rec {
10 in 10 in
11 (callPackage src {}) // { inherit src; }; 11 (callPackage src {}) // { inherit src; };
12 12
13 nodeEnv = import ./lib/node-env.nix; 13 nodeEnv = import ./node-env.nix;
14 14
15 fetchedGithub = path: 15 fetchedGithub = path:
16 let 16 let
diff --git a/nixops/eldiron.nix b/nixops/default.nix
index 649e431..649e431 100644
--- a/nixops/eldiron.nix
+++ b/nixops/default.nix
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap
index e75fa2f..28aa917 100755
--- a/nixops/scripts/nixops_wrap
+++ b/nixops/scripts/nixops_wrap
@@ -8,7 +8,7 @@ fi
8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
10export NIXOPS_DEPLOYMENT="$DeploymentUuid" 10export NIXOPS_DEPLOYMENT="$DeploymentUuid"
11source $(dirname $(dirname $DIR))/nix_path_env 11source $(dirname $(dirname $DIR))/scripts/nix_env
12 12
13TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) 13TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
14chmod go-rwx $TEMP 14chmod go-rwx $TEMP
diff --git a/nixops/scripts/pull_deployment b/nixops/scripts/pull_deployment
index ef0f221..2f50875 100755
--- a/nixops/scripts/pull_deployment
+++ b/nixops/scripts/pull_deployment
@@ -8,7 +8,7 @@ fi
8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
10export NIXOPS_DEPLOYMENT="$DeploymentUuid" 10export NIXOPS_DEPLOYMENT="$DeploymentUuid"
11source $(dirname $(dirname $DIR))/nix_path_env 11source $(dirname $(dirname $DIR))/scripts/nix_env
12 12
13export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 13export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
14 14
diff --git a/nixops/scripts/push_deployment b/nixops/scripts/push_deployment
index 26f8cd2..f2d25f9 100755
--- a/nixops/scripts/push_deployment
+++ b/nixops/scripts/push_deployment
@@ -8,6 +8,6 @@ fi
8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
10export NIXOPS_DEPLOYMENT="$DeploymentUuid" 10export NIXOPS_DEPLOYMENT="$DeploymentUuid"
11source $(dirname $(dirname $DIR))/nix_path_env 11source $(dirname $(dirname $DIR))/scripts/nix_env
12 12
13nixops_custom export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment 13nixops_custom export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment
diff --git a/nixops/scripts/setup b/nixops/scripts/setup
index 72b19c0..cc03482 100755
--- a/nixops/scripts/setup
+++ b/nixops/scripts/setup
@@ -94,7 +94,7 @@ if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then
94fi 94fi
95 95
96DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 96DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
97source $(dirname $(dirname $DIR))/nix_path_env 97source $(dirname $(dirname $DIR))/scripts/nix_env
98export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 98export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
99export NIXOPS_DEPLOYMENT="$DeploymentUuid" 99export NIXOPS_DEPLOYMENT="$DeploymentUuid"
100 100
@@ -107,14 +107,14 @@ if ! nixops_custom info 2>/dev/null >/dev/null; then
107 if [ "$y" = "y" -o "$y" = "Y" ]; then 107 if [ "$y" = "y" -o "$y" = "Y" ]; then
108 deployment=$(pass show $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment) 108 deployment=$(pass show $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment)
109 echo "$deployment" | nixops_custom import 109 echo "$deployment" | nixops_custom import
110
111 nixops_custom modify "$(dirname $DIR)/eldiron.nix"
112 else 110 else
113 echo "Aborting" 111 echo "Aborting"
114 exit 1 112 exit 1
115 fi 113 fi
116fi 114fi
117 115
116nixops_custom modify "$(dirname $DIR)/default.nix"
117
118cat <<-EOF 118cat <<-EOF
119 All set up. 119 All set up.
120 Please make sure you’re using scripts/nixops_wrap when deploying 120 Please make sure you’re using scripts/nixops_wrap when deploying
diff --git a/overlays/default.nix b/overlays/default.nix
index 408515e..42c0386 100644
--- a/overlays/default.nix
+++ b/overlays/default.nix
@@ -1,5 +1,5 @@
1{ 1{
2 mylibs = self: super: { mylibs = import ../libs.nix { pkgs = self; }; }; 2 mylibs = self: super: { mylibs = import ../lib { pkgs = self; }; };
3 mypkgs = self: super: import ../pkgs { pkgs = self; }; 3 mypkgs = self: super: import ../pkgs { pkgs = self; };
4 4
5 bitlbee = import ./bitlbee; 5 bitlbee = import ./bitlbee;
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 8ea65a5..297f524 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -1,7 +1,7 @@
1{ pkgs }: 1{ pkgs }:
2with pkgs; 2with pkgs;
3let 3let
4 mylibs = import ../libs.nix { inherit pkgs; }; 4 mylibs = import ../lib { inherit pkgs; };
5in 5in
6rec { 6rec {
7 boinctui = callPackage ../pkgs/boinctui {}; 7 boinctui = callPackage ../pkgs/boinctui {};
diff --git a/pkgs/private/default.nix b/pkgs/private/default.nix
index 60fabad..1abdd29 100644
--- a/pkgs/private/default.nix
+++ b/pkgs/private/default.nix
@@ -1,7 +1,7 @@
1{ pkgs }: 1{ pkgs }:
2with pkgs; 2with pkgs;
3let 3let
4 mylibs = import ../../libs.nix { inherit pkgs; }; 4 mylibs = import ../../lib { inherit pkgs; };
5in 5in
6rec { 6rec {
7 webapps = callPackage ./webapps { 7 webapps = callPackage ./webapps {
diff --git a/fetch_version b/scripts/fetch_version
index a0325f6..a0325f6 100755
--- a/fetch_version
+++ b/scripts/fetch_version
diff --git a/scripts/make-env b/scripts/make-env
index ebb1eed..983a359 100755
--- a/scripts/make-env
+++ b/scripts/make-env
@@ -2,10 +2,11 @@
2 2
3DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4 4
5source $(dirname $DIR)/nix_path_env 5source $DIR/nix_env
6nix-env -r -i -A myEnvironments.immae-eu -f "<nixpkgs>" "$@" 6nix-env -r -i -A myEnvironments.immae-eu -f "<nixpkgs>" "$@"
7result=$?
7 8
8cat >> $(dirname $DIR)/versions_log <<EOF 9cat >> $(dirname $DIR)/versions_log <<EOF
9# Ran $(date) with args "$@" 10Ran $(date) with args "$@" and returned "$result"
10$($DIR/nix_infos | sed -e "s/^/# /") 11$($DIR/nix_infos | sed -e "s/^/ /")
11EOF 12EOF
diff --git a/nix_path_env b/scripts/nix_env
index 19f7cca..6326243 100644
--- a/nix_path_env
+++ b/scripts/nix_env
@@ -12,6 +12,6 @@ export NIX_PATH="nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext:nixpkgsPrevious=$nixp
12 12
13nixops_custom () { 13nixops_custom () {
14 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 14 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
15 d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $DIR/overlays); }; nixops") 15 d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $(dirname $DIR)/overlays); }; nixops")
16 ${d}/bin/nixops "$@" 16 ${d}/bin/nixops "$@"
17} 17}
diff --git a/scripts/nix_infos b/scripts/nix_infos
index f824305..56e5b19 100755
--- a/scripts/nix_infos
+++ b/scripts/nix_infos
@@ -2,7 +2,7 @@
2 2
3DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4 4
5source $(dirname $DIR)/nix_path_env 5source $DIR/nix_env
6version=$(nix eval --raw nixpkgs.lib.version) 6version=$(nix eval --raw nixpkgs.lib.version)
7mainversion=$(echo $version | cut -d"." -f -2) 7mainversion=$(echo $version | cut -d"." -f -2)
8 8