Compare commits
2 commits
7417d91809
...
b23046ea5d
Author | SHA1 | Date | |
---|---|---|---|
b23046ea5d | |||
ecbddad7a7 |
5 changed files with 105 additions and 91 deletions
|
@ -103,5 +103,10 @@
|
||||||
(mkHost "nextcloud" {
|
(mkHost "nextcloud" {
|
||||||
suite = "server/lxc";
|
suite = "server/lxc";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Container for managing server flock.
|
||||||
|
(mkHost "ornithologist" {
|
||||||
|
suite = "server/lxc";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
52
helpers.nix
52
helpers.nix
|
@ -12,13 +12,14 @@ with inputs.nixpkgs.lib; {
|
||||||
suite ? "",
|
suite ? "",
|
||||||
docker ? false,
|
docker ? false,
|
||||||
hostModules ? [],
|
hostModules ? [],
|
||||||
}:
|
}: let
|
||||||
{
|
# Secrets directory.
|
||||||
nixosConfigurations.${hostname} = nixosSystem rec {
|
secrets = builtins.toString inputs.secrets;
|
||||||
|
|
||||||
# Architecture.
|
# Architecture.
|
||||||
system = platform;
|
system = platform;
|
||||||
|
|
||||||
# nixpkgs config.
|
# Stable nixpkgs with overlay.
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
|
@ -38,12 +39,27 @@ with inputs.nixpkgs.lib; {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
specialArgs = {
|
# deploy-rs.
|
||||||
# Pass hostname & inputs to config.
|
deployPkgs = import nixpkgs {
|
||||||
inherit inputs hostname;
|
inherit system;
|
||||||
|
|
||||||
# Secrets directory.
|
overlays = [
|
||||||
secrets = builtins.toString inputs.secrets;
|
deploy-rs.overlays.default
|
||||||
|
(self: super: {
|
||||||
|
deploy-rs = {
|
||||||
|
inherit (pkgs) deploy-rs;
|
||||||
|
lib = super.deploy-rs.lib;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
nixosConfigurations.${hostname} = nixosSystem {
|
||||||
|
inherit system pkgs;
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
# Pass variables to config.
|
||||||
|
inherit inputs secrets hostname;
|
||||||
};
|
};
|
||||||
|
|
||||||
modules =
|
modules =
|
||||||
|
@ -83,22 +99,8 @@ with inputs.nixpkgs.lib; {
|
||||||
++ optionals (docker == true) [./suites/server/docker] # Enable docker if required.
|
++ optionals (docker == true) [./suites/server/docker] # Enable docker if required.
|
||||||
++ (filesystem.listFilesRecursive ./modules); # Custom modules.
|
++ (filesystem.listFilesRecursive ./modules); # Custom modules.
|
||||||
};
|
};
|
||||||
}
|
|
||||||
// optionalAttrs (strings.hasPrefix "server" suite) {
|
deploy.nodes.${hostname} = mkIf (strings.hasPrefix "server" suite) {
|
||||||
deploy.nodes.${hostname} = let
|
|
||||||
deployPkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [
|
|
||||||
deploy-rs.overlays.default
|
|
||||||
(self: super: {
|
|
||||||
deploy-rs = {
|
|
||||||
inherit (pkgs) deploy-rs;
|
|
||||||
lib = super.deploy-rs.lib;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
hostname = "${hostname}.local";
|
hostname = "${hostname}.local";
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
user = "root";
|
user = "root";
|
||||||
|
|
|
@ -39,6 +39,9 @@ with lib; {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Allow emulating aarch64 to build for Raspberry Pi.
|
||||||
|
boot.binfmt.emulatedSystems = ["aarch64-linux"];
|
||||||
|
|
||||||
# Share Music dir.
|
# Share Music dir.
|
||||||
services.samba = {
|
services.samba = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
7
hosts/ornithologist/default.nix
Normal file
7
hosts/ornithologist/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
# Allow emulating aarch64 to build for Raspberry Pi.
|
||||||
|
boot.binfmt.emulatedSystems = ["aarch64-linux"];
|
||||||
|
|
||||||
|
# Install some packages.
|
||||||
|
environment.systemPackages = with pkgs; [deploy-rs];
|
||||||
|
}
|
|
@ -26,9 +26,6 @@ with lib; {
|
||||||
"udev.log_priority=3"
|
"udev.log_priority=3"
|
||||||
"rd.systemd.show_status=auto"
|
"rd.systemd.show_status=auto"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Allow emulating aarch64 to build for Raspberry Pi.
|
|
||||||
binfmt.emulatedSystems = ["aarch64-linux"];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable smart card support (for YubiKey).
|
# Enable smart card support (for YubiKey).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue