commit 002c7152653b652e9143aa9479752061809d1e69
parent c41167f181d0d4c5d9f8a8d902d62d15b2a09480
Author: Vincent Demeester <vincent@sbr.pm>
Date: Sun, 6 Dec 2020 13:08:57 +0100
flake: add nixosconfigurations
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/flake.nix b/flake.nix
@@ -77,6 +77,8 @@
with inputs.nixpkgs.lib;
let
forEachSystem = genAttrs [ "x86_64-linux" "aarch64-linux" ];
+
+ # Packages
mkPkgs = pkgs: system: import pkgs {
inherit system;
config = import ./nix/config.nix;
@@ -85,6 +87,12 @@
unstablePkgsBySystem = forEachSystem (mkPkgs inputs.nixos-unstable);
stablePkgsBySystem = forEachSystem (mkPkgs inputs.nixos);
pkgsBySystem = forEachSystem (mkPkgs inputs.nixpkgs);
+
+ # NixOS configurations
+ mkNixOsConfiguration = name: { pkgs, system, config }:
+ nameValuePair name (nixoSystem {
+ inherit system;
+ });
in
{
# `internal` isn't a known output attribute for flakes. It is used here to contain
@@ -100,9 +108,14 @@
# Attribute set of hostnames to be evaluated as NixOS configurations. Consumed by
# `nixos-rebuild` on those hosts.
- # TODO naruhodo (hokkaido?) wakasu okinama sakhalin kerkouane
- # TODO raspberry pi 8G x 3 (name them too)
- nixosConfigurations = { };
+ nixosConfigurations = mapAttrs' mkNixOsConfiguration {
+ naruhodo = { pkgs = inputs.nixos-unstable; system = "x86_64-linux"; config = ./systems/naruhodo.nix; };
+ wakasu = { pkgs = inputs.nixos-unstable; system = "x86_64-linux"; config = ./systems/naruhodo.nix; };
+ okinawa = { pkgs = inputs.nixos; system = "x86_64-linux"; config = ./systems/okinawa.nix; };
+ sakhalin = { pkgs = inputs.nixos; system = "x86_64-linux"; config = ./systems/sakhalin.nix; };
+ kerkouane = { pkgs = inputs.nixos; system = "x86_64-linux"; config = ./systems/kerkouane.nix; };
+ # TODO raspberry pi 8G x 3 (name them too)
+ };
# Import the modules exported by this flake.
# containerd, buildkit are interesting module to export from here