hosts = builtins.mapAttrs (hostName: hostConfig:
let cfg = import hostConfig { inherit inputs hostName; }; in
import (nixpkgs + "/nixos/lib/eval-config.nix") (cfg // {
- extraArgs = {
+ specialArgs = {
inherit hostName inputs;
+ private = "/root/private"; # Kept out of /nix/store
+ };
+ extraArgs = {
hosts = inputs.self.nixosConfigurations;
host = inputs.self.nixosConfigurations.${hostName}.extraArgs;
- private = "/root/private"; # Kept out of /nix/store
} // (cfg.extraArgs or {});
modules = cfg.modules ++ [
inputs.home-manager.nixosModules.home-manager
inherit hostName;
};
}
- ({pkgs, ...}: {
- nix.registry.nixpkgs.flake = nixpkgs;
+ ({ pkgs, ... }: {
nix.package = pkgs.nixUnstable;
- nix.extraOptions = "experimental-features = nix-command flakes";
nixpkgs.overlays =
import nixpkgs/overlays.nix ++
import (inputs.julm-nix + "/nixpkgs/overlays.nix");
};
modules = [
../nixos/defaults.nix
+ ../nixos/profiles/systems/builder.nix
losurdo/acme.nix
losurdo/apc.nix
losurdo/debug.nix
-{ pkgs, lib, config, hosts, inputs, ... }:
+{ pkgs, lib, config, inputs, ... }:
let
inherit (config.security) gnupg;
inherit (config.boot) initrd;
-{ inputs, pkgs, lib, config, ... }:
+{ pkgs, lib, config, ... }:
let inherit (lib) types;
inherit (config.networking) hostName domain;
in
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 30d";
};
- nixPath = [
- "nixpkgs=/etc/nixpkgs:nixpkgs-overlays=/etc/nixpkgs-overlays/overlays.nix"
- ];
};
-# WARNING: this is a hack to avoid copying Nixpkgs
-# a second time into the Nix store.
-# It makes only sense when Nixpkgs is already in the Nix store,
-# and is registered.
-environment.etc."nixpkgs".source = pkgs.path;
-environment.etc."nixpkgs-overlays".source =
- pkgs.writeTextDir "overlays.nix" ''
- import ${inputs.self + "/nixpkgs/overlays.nix"} ++
- import ${inputs.julm-nix + "/nixpkgs/overlays.nix"}
- '';
documentation.nixos = {
enable = false; # NOTE: useless on a server, and CPU intensive.
# sets this up as soon as the initrd.
boot.kernelParams = [ "panic=10" ];
-boot.cleanTmpDir = true;
-boot.tmpOnTmpfs = true;
+boot.cleanTmpDir = lib.mkDefault true;
+boot.tmpOnTmpfs = lib.mkDefault true;
networking = {
# Fix hostname --fqdn
--- /dev/null
+{ inputs, pkgs, lib, config, ... }:
+{
+nix.nixPath = [
+ "nixpkgs=/etc/nixpkgs:nixpkgs-overlays=/etc/nixpkgs-overlays/overlays.nix"
+];
+nix.extraOptions = "experimental-features = nix-command flakes";
+# Note that this will make the target system download Nixpkgs.
+nix.registry.nixpkgs.flake = pkgs.path;
+# WARNING: this is a hack to avoid copying Nixpkgs
+# a second time into the Nix store.
+# It makes only sense when Nixpkgs is already in the Nix store,
+# and is registered.
+environment.etc."nixpkgs".source = pkgs.path;
+environment.etc."nixpkgs-overlays".source =
+ pkgs.writeTextDir "overlays.nix" ''
+ import ${inputs.self + "/nixpkgs/overlays.nix"} ++
+ import ${inputs.julm-nix + "/nixpkgs/overlays.nix"}
+ '';
+}