Skip to content

Commit

Permalink
Update from deprecated nix binary cache settings
Browse files Browse the repository at this point in the history
  • Loading branch information
icetan committed Apr 6, 2024
1 parent 6fcfc59 commit 8482f14
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
12 changes: 4 additions & 8 deletions bin/nixiform
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,10 @@ export -f _output

_caches() {
local name="$1"
_output "$name" "with builtins;
if (nix?binaryCaches && nix?binaryCachePublicKeys)
then [
(concatStringsSep \" \" nix.binaryCaches)
(concatStringsSep \" \" nix.binaryCachePublicKeys)
]
else []
"
_output "$name" 'with builtins; map (concatStringsSep " ") [
(nix.settings.substituters or nix.binaryCaches or [])
(nix.settings.trusted-public-keys or nix.binaryCachePublicKeys or [])
]'
}
export -f _caches

Expand Down
16 changes: 7 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
nixiform = import ./. { inherit pkgs; };
in {
devShell = nixiform;
defaultPackage = nixiform;
packages.nixiform = nixiform;
defaultApp = {
type = "app";
program = "nixiform";
};
in
{
packages.nixiform = import ./. { inherit pkgs; };
packages.default = self.outputs.packages.${system}.nixiform;
devShells.default = self.outputs.packages.${system}.nixiform;
apps.nixiform = { type = "app"; program = "nixiform"; };
apps.default = self.outputs.apps.${system}.nixiform;
}
);
}
4 changes: 2 additions & 2 deletions lib/configurators/digitalocean
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ makeNetworkingConf() {
local IFS=$'\n'
eth0_name=$(ip address show | grep '^2:' | awk -F': ' '{print $2}')
eth0_ip4s=$(ip address show dev "$eth0_name" | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')
eth0_ip6s=$(ip address show dev "$eth0_name" | grep 'inet6 ' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|' || '')
eth0_ip6s=$(ip address show dev "$eth0_name" | grep 'inet6 ' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|' || true)
gateway=$(ip route show dev "$eth0_name" | grep default | sed -r 's|default via ([0-9.]+).*|\1|')
gateway6=$(ip -6 route show dev "$eth0_name" | grep default | sed -r 's|default via ([0-9a-f:]+).*|\1|' || true)
ether0=$(ip address show dev "$eth0_name" | grep link/ether | sed -r 's|.*link/ether ([0-9a-f:]+) .*|\1|')

eth1_name=$(ip address show | grep '^3:' | awk -F': ' '{print $2}')||true
if [ -n "$eth1_name" ];then
eth1_ip4s=$(ip address show dev "$eth1_name" | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')
eth1_ip6s=$(ip address show dev "$eth1_name" | grep 'inet6 ' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|' || '')
eth1_ip6s=$(ip address show dev "$eth1_name" | grep 'inet6 ' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|' || true)
ether1=$(ip address show dev "$eth1_name" | grep link/ether | sed -r 's|.*link/ether ([0-9a-f:]+) .*|\1|')
interfaces1="
$eth1_name = {
Expand Down
2 changes: 1 addition & 1 deletion lib/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.0
4.4.1

0 comments on commit 8482f14

Please sign in to comment.