Skip to content

Commit deae44a

Browse files
committed
Start of modernization of skyflake.
1 parent 40fb7a4 commit deae44a

11 files changed

Lines changed: 55 additions & 30 deletions

File tree

example-server.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
networking.hostName = "example${toString instance}";
3535
users.users.root.password = "";
3636

37-
# TODO:
37+
# TODO:? Shoulld firewall be fixed?
3838
networking.firewall.enable = false;
3939

4040
networking.useDHCP = false;
@@ -64,7 +64,9 @@
6464
IPv6AcceptRA = true;
6565
};
6666
addresses = [ {
67-
addressConfig.Address = "fec0::${toString instance}/64";
67+
# TODO: addressConfig needs to be removed.
68+
# trace: warning: Using 'addressConfig' is deprecated! Move all attributes inside one level up and remove it.
69+
addressConfig.Address = "fec0::${toString instance}/64"; #
6870
} ];
6971
};
7072
};
@@ -78,7 +80,7 @@
7880
}) [ 1 2 3 ]
7981
);
8082

81-
storage.ceph = rec {
83+
storage.ceph = {
8284
fsid = "8364da79-5e03-49ae-82ea-7d936278cb0f";
8385
monKeyring = example/ceph.mon.keyring;
8486
adminKeyring = example/ceph.client.admin.keyring;

flake.lock

Lines changed: 34 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
description = "Hyperconverged Infratructure for NixOS";
33

44
inputs = {
5-
microvm.url = "github:astro/microvm.nix";
6-
microvm.inputs.nixpkgs.follows = "nixpkgs";
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
microvm = {
7+
url = "github:astro/microvm.nix";
8+
inputs.nixpkgs.follows = "nixpkgs";
9+
};
10+
711
nix-cache-cut.url = "github:astro/nix-cache-cut";
812
};
913

nixos-modules/cache-cut.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ in
4141
systemd.services.skyflake-install-cache-gc = {
4242
wantedBy = [ "multi-user.target" ];
4343
requires = [ "nomad.service" ];
44-
path = with pkgs; [ nomad ];
44+
path = [ config.services.nomad.package ];
4545
script = ''
4646
nomad run -detach ${jobFile}
4747
'';

nixos-modules/nodes.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ in
99
description = ''
1010
All cluster nodes with their addresses, or at least those who
1111
run coordination servers (eg. nomad servers, ceph server,
12-
...).
12+
seaweedfs server ...).
1313
'';
1414
default = {};
1515
type = types.attrsOf (types.submodule {

nixos-modules/nomad.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ in
4242
config = {
4343
services.nomad = {
4444
enable = true;
45-
package = pkgs.nomad_1_4;
45+
package = pkgs.nomad_1_6; # nomad 1.6 is the newest version under an foss license.
4646
dropPrivileges = false;
4747
enableDocker = false;
4848

nixos-modules/ssh-deploy.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ let
143143
];
144144

145145
cfg = config.skyflake.deploy;
146-
gcCfg = config.skyflake.gc;
147-
148146
in {
149147
options.skyflake = with lib; {
150148
deploy = {

nixos-modules/storage/ceph/server.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ in {
146146
publicNetwork = clusterNetwork; #"0.0.0.0/0, ::/0";
147147
clusterNetwork = lib.concatStringsSep ", " (
148148
lib.concatMap ({ addresses ? [], ... }:
149-
lib.concatMap ({ addressConfig ? {}, ... }:
149+
# Needs to be changed because of
150+
# trace: warning: Using 'addressConfig' is deprecated! Move all attributes inside one level up and remove it.
151+
lib.concatMap ({ addressConfig ? {}, ... }:
150152
if addressConfig ? Address
151153
then [ addressConfig.Address ]
152154
else []

vm/build-vm.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
let
1212
nixpkgs = builtins.getFlake nixpkgsRef;
1313
pkgs = nixpkgs.legacyPackages.${system};
14-
inherit (pkgs) lib;
1514
microvm = builtins.getFlake microvmFlake;
1615
flake = builtins.getFlake flakeRef;
1716

@@ -46,7 +45,6 @@ let
4645
};
4746
}
4847
# From the host's skyflake.deploy.customizationModule
49-
@customizationModule@
5048
];
5149
};
5250

@@ -64,4 +62,4 @@ import ./nomad-job.nix {
6462

6563
inherit pkgs runner;
6664
inherit (extended) config;
67-
}
65+
}

vm/customization-options.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'';
2121
};
2222

23+
# TODO: rename it to something that allows more than ceph.
2324
deploy.rbds = mkOption {
2425
default = {};
2526
description = ''

0 commit comments

Comments
 (0)