diff options
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | default.nix | 2 | ||||
-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-x | nixops/scripts/nixops_wrap | 2 | ||||
-rwxr-xr-x | nixops/scripts/pull_deployment | 2 | ||||
-rwxr-xr-x | nixops/scripts/push_deployment | 2 | ||||
-rwxr-xr-x | nixops/scripts/setup | 6 | ||||
-rw-r--r-- | overlays/default.nix | 2 | ||||
-rw-r--r-- | pkgs/default.nix | 2 | ||||
-rw-r--r-- | pkgs/private/default.nix | 2 | ||||
-rwxr-xr-x | scripts/fetch_version (renamed from fetch_version) | 0 | ||||
-rwxr-xr-x | scripts/make-env | 7 | ||||
-rw-r--r-- | scripts/nix_env (renamed from nix_path_env) | 2 | ||||
-rwxr-xr-x | scripts/nix_infos | 2 |
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 @@ | |||
1 | subrecipes = 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 | |||
5 | env: | ||
6 | ./scripts/make-env | ||
7 | |||
8 | env-dry-run: | ||
9 | ./scripts/make-env --dry-run | ||
10 | |||
11 | nix-info: | ||
12 | NIXOPS_DEPLOYMENT="" ./scripts/nix_infos | ||
13 | |||
14 | nix-info-nixops: | ||
15 | NIXOPS_DEPLOYMENT="n" ./scripts/nix_infos | ||
16 | |||
17 | nur: | ||
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_; }; |
5 | in | 5 | in |
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 | |||
8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | 11 | source $(dirname $(dirname $DIR))/scripts/nix_env |
12 | 12 | ||
13 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) | 13 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
14 | chmod go-rwx $TEMP | 14 | chmod 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 | |||
8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | 11 | source $(dirname $(dirname $DIR))/scripts/nix_env |
12 | 12 | ||
13 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 13 | export 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 | |||
8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | 11 | source $(dirname $(dirname $DIR))/scripts/nix_env |
12 | 12 | ||
13 | nixops_custom export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment | 13 | nixops_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 | |||
94 | fi | 94 | fi |
95 | 95 | ||
96 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 96 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
97 | source $(dirname $(dirname $DIR))/nix_path_env | 97 | source $(dirname $(dirname $DIR))/scripts/nix_env |
98 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 98 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
99 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 99 | export 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 |
116 | fi | 114 | fi |
117 | 115 | ||
116 | nixops_custom modify "$(dirname $DIR)/default.nix" | ||
117 | |||
118 | cat <<-EOF | 118 | cat <<-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 }: |
2 | with pkgs; | 2 | with pkgs; |
3 | let | 3 | let |
4 | mylibs = import ../libs.nix { inherit pkgs; }; | 4 | mylibs = import ../lib { inherit pkgs; }; |
5 | in | 5 | in |
6 | rec { | 6 | rec { |
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 }: |
2 | with pkgs; | 2 | with pkgs; |
3 | let | 3 | let |
4 | mylibs = import ../../libs.nix { inherit pkgs; }; | 4 | mylibs = import ../../lib { inherit pkgs; }; |
5 | in | 5 | in |
6 | rec { | 6 | rec { |
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 | ||
3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
4 | 4 | ||
5 | source $(dirname $DIR)/nix_path_env | 5 | source $DIR/nix_env |
6 | nix-env -r -i -A myEnvironments.immae-eu -f "<nixpkgs>" "$@" | 6 | nix-env -r -i -A myEnvironments.immae-eu -f "<nixpkgs>" "$@" |
7 | result=$? | ||
7 | 8 | ||
8 | cat >> $(dirname $DIR)/versions_log <<EOF | 9 | cat >> $(dirname $DIR)/versions_log <<EOF |
9 | # Ran $(date) with args "$@" | 10 | Ran $(date) with args "$@" and returned "$result" |
10 | $($DIR/nix_infos | sed -e "s/^/# /") | 11 | $($DIR/nix_infos | sed -e "s/^/ /") |
11 | EOF | 12 | EOF |
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 | ||
13 | nixops_custom () { | 13 | nixops_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 | ||
3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
4 | 4 | ||
5 | source $(dirname $DIR)/nix_path_env | 5 | source $DIR/nix_env |
6 | version=$(nix eval --raw nixpkgs.lib.version) | 6 | version=$(nix eval --raw nixpkgs.lib.version) |
7 | mainversion=$(echo $version | cut -d"." -f -2) | 7 | mainversion=$(echo $version | cut -d"." -f -2) |
8 | 8 | ||