Skip to content

Commit

Permalink
fix for nixops
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Feb 25, 2018
1 parent f58ff35 commit 95f4a07
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
22 changes: 22 additions & 0 deletions bin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
with import ../nixpkgs {};

let
nixops = pkgs.nixops.overrideDerivation (
old: {
patchPhase = ''
substituteInPlace nix/eval-machine-info.nix \
--replace 'system.nixosVersion' 'system.nixos.version'
'';
}
);
in

runCommand "rb" {
buildInputs = [ makeWrapper ];
} ''
mkdir -p $out/bin
substitute ${./rb} $out/bin/rb \
--subst-var-by nixops ${nixops}/bin/nixops
chmod +x $out/bin/rb
''
7 changes: 3 additions & 4 deletions bin/rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nixops git
#!/usr/bin/env bash

set -e

Expand Down Expand Up @@ -29,5 +28,5 @@ else
dirty=false
fi

sudo nixops set-args -d infinisil --arg dirty "$dirty"
sudo nixops deploy -d infinisil $build $@
sudo @nixops@ set-args -d infinisil --arg dirty "$dirty"
sudo @nixops@ deploy -d infinisil $build $@
2 changes: 0 additions & 2 deletions profiles/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#]))
];

environment.variables.PATH = "/cfg/bin";

networking = {
nameservers = [
nodes.server.config.deployment.targetHost
Expand Down

0 comments on commit 95f4a07

Please sign in to comment.