Skip to content

Commit

Permalink
~~
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Oct 21, 2024
1 parent a5763c9 commit 62cbe41
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 159 deletions.
2 changes: 1 addition & 1 deletion age/cloud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# rrr,
...
}:
({ })
(hard [ "juic-san" ])
2 changes: 2 additions & 0 deletions age/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
data,
user,
self,
lib,
...
}:
{
Expand Down Expand Up @@ -41,6 +42,7 @@
rootRo
sdnetRo
rrr
lib
;
};
in
Expand Down
47 changes: 25 additions & 22 deletions age/trust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
hard,
userRo,
rootRo,
lib,
# sdnetRo,
# rrr,
...
Expand All @@ -11,7 +12,6 @@
"dae.sub"
"jc-do"
"ss-az"
"juic-san"
"naive"
])
// (userRo [
Expand Down Expand Up @@ -39,25 +39,28 @@
group = "users";
name = "d.dae";
};
hyst-us-cli = {
rekeyFile = ../sec/hyst-us-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-us-cli.yaml";
};
hyst-la-cli = {
rekeyFile = ../sec/hyst-la-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-la-cli.yaml";
};
hyst-hk-cli = {
rekeyFile = ../sec/hyst-hk-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-hk-cli.yaml";
};

}
// (
let
inherit (lib) listToAttrs nameValuePair;
in
listToAttrs (
map
(
n:
nameValuePair "hyst-${n}-cli" {
rekeyFile = ../sec/hyst-${n}-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-${n}-cli.yaml";
}
)
[
"la"
"us"
"hk"
]
)
)
2 changes: 1 addition & 1 deletion hosts/abhoth/spec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
openFirewall = 4432;
credentials = [
"key:${config.age.secrets."nyaw.key".path}"
"cert:${config.age.secrets."nyaw.cert".path}"
"crt:${config.age.secrets."nyaw.cert".path}"
];
configFile = config.age.secrets.hyst-us.path;
};
Expand Down
2 changes: 1 addition & 1 deletion hosts/azasos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ withSystem "x86_64-linux" (
./rekey.nix
./spec.nix
./caddy.nix
../../age
(lib.iage "cloud")
../../packages.nix
../../misc.nix
../../users.nix
Expand Down
69 changes: 60 additions & 9 deletions hosts/azasos/rekey.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ data, ... }:
{
data,
lib,
self,
...
}:
let
hostPrivKey = "/var/lib/ssh/ssh_host_ed25519_key";
in
Expand All @@ -12,13 +17,59 @@ in
age = {
identityPaths = [ hostPrivKey ];
rekey.hostPubkey = data.keys.azasosHostPubKey;
secrets = {
wga = {
rekeyFile = ../../sec/wga.age;
owner = "systemd-network";
group = "root";
mode = "400";
};
};
secrets =
{
wga = {
rekeyFile = ../../sec/wga.age;
owner = "systemd-network";
group = "root";
mode = "400";
};

hyst-us-cli = {
rekeyFile = ../sec/hyst-us-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-us-cli.yaml";
};
hyst-la-cli = {
rekeyFile = ../sec/hyst-la-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-la-cli.yaml";
};
hyst-hk-cli = {
rekeyFile = ../sec/hyst-hk-cli.age;
mode = "640";
owner = "root";
group = "users";
name = "hyst-hk-cli.yaml";
};
}
// (
let
inherit (lib) listToAttrs nameValuePair;
in
listToAttrs (
map
(
n:
nameValuePair "hyst-${n}-cli" {
rekeyFile = "${self}/sec/hyst-${n}-cli.age";
mode = "640";
owner = "root";
group = "users";
name = "hyst-${n}-cli.yaml";
}
)
[
"la"
"us"
"hk"
]
)
);
};
}
2 changes: 1 addition & 1 deletion hosts/colour/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ withSystem "x86_64-linux" (
./rekey.nix
./spec.nix
./caddy.nix
../../age
(lib.iage "cloud")
../../packages.nix
../../misc.nix
../../users.nix
Expand Down
9 changes: 7 additions & 2 deletions hosts/nodens/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ withSystem "x86_64-linux" (
"cinny-4.2.1"
"cinny-unwrapped-4.2.1"
];
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"factorio-headless"
];
};
overlays =
(import "${self}/overlays.nix" { inherit inputs' inputs; })
Expand All @@ -43,13 +48,13 @@ withSystem "x86_64-linux" (
user = "elen";
};
modules = lib.sharedModules ++ [
../sysvars.nix
# ../sysvars.nix
./hardware.nix
./network.nix
./rekey.nix
./spec.nix
./caddy.nix
../../age
(lib.iage "cloud")
../../packages.nix
../../misc.nix
../../users.nix
Expand Down
8 changes: 4 additions & 4 deletions hosts/nodens/spec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
juicity.instances = {
only = {
enable = true;
credentials = [
"key:${config.age.secrets."nyaw.key".path}"
"cert:${config.age.secrets."nyaw.cert".path}"
];
# credentials = [
# "key:${config.age.secrets."nyaw.key".path}"
# "cert:${config.age.secrets."nyaw.cert".path}"
# ];
serve = true;
openFirewall = 23180;
configFile = config.age.secrets.juic-san.path;
Expand Down
2 changes: 1 addition & 1 deletion hosts/yidhra/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ withSystem "x86_64-linux" (
./network.nix
./rekey.nix
./spec.nix
../../age
(lib.iage "cloud")
../../packages.nix
../../misc.nix
../../users.nix
Expand Down
55 changes: 0 additions & 55 deletions modules/smartdns.nix

This file was deleted.

44 changes: 0 additions & 44 deletions pkgs/smartdns-rs.nix

This file was deleted.

15 changes: 0 additions & 15 deletions repack/smartdns.nix

This file was deleted.

4 changes: 1 addition & 3 deletions util.nu
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export def b [

}

# /nix/store/6p33aybdjmhnilj7ymbfhgivl94bcg4y-system-path/bin/systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER= --collect --no-ask-password --pipe --quiet --same-dir --service-type=exec --unit=nixos-rebuild-switch-to-configuration --wait /nix/store/80p580pppp385sg8k1rq59088kfb3a2d-nixos-system-eihort-24.11.20241019.6125359/bin/switch-to-configuration switch

# deploy
# all op with hostname
export def d [
Expand Down Expand Up @@ -77,7 +75,7 @@ export def d [
| par-each {|| {name: $in.0, addr: $in.1, path: $in.2}}
| each {|i|
log info $'deploying ($i.path)(char newline)-> ($i.name) | ($i.addr)'
ssh -t $'ssh://($i.addr)' $'sudo ($i.path)/bin/switch-to-configuration ($mode)' | complete
ssh -t $'ssh://($i.addr)' $'sudo systemd-run -E LOCALE_ARCHIVE --collect --no-ask-password --pipe --quiet --same-dir --service-type=exec --unit=nixos-rebuild-switch-to-configuration --wait ($i.path)/bin/switch-to-configuration ($mode)' | complete
}
}
}
Expand Down

0 comments on commit 62cbe41

Please sign in to comment.