From 465fa0e1276f8a6dd376670d67fda702fcb34cc4 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Sun, 29 Dec 2024 01:01:38 +0800 Subject: [PATCH] baryte: prepare initial sd image --- flake.lock | 22 ++++++++++++++++++++++ flake.nix | 14 ++++++++++++++ machines/baryte/default.nix | 22 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 machines/baryte/default.nix diff --git a/flake.lock b/flake.lock index 9c4020a..c8719e9 100644 --- a/flake.lock +++ b/flake.lock @@ -621,6 +621,27 @@ "type": "github" } }, + "nixos-sbc": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735186792, + "narHash": "sha256-XIIf8bU1khErw+dm66CdtHKQUGTMXuARWx08FtGNjqo=", + "owner": "nakato", + "repo": "nixos-sbc", + "rev": "0f6fe1d77b3fc2198aabf76453f0a5159c9835c5", + "type": "github" + }, + "original": { + "owner": "nakato", + "ref": "main", + "repo": "nixos-sbc", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1731139594, @@ -818,6 +839,7 @@ "nix-index-database": "nix-index-database", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-hardware": "nixos-hardware", + "nixos-sbc": "nixos-sbc", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable_2", "nur": "nur", diff --git a/flake.nix b/flake.nix index 27f8265..fa354c6 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,11 @@ url = "github:xinyangli/comin"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nixos-sbc = { + url = "github:nakato/nixos-sbc/main"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -80,6 +85,7 @@ nix-index-database, disko, comin, + nixos-sbc, ... }: let @@ -147,6 +153,11 @@ disko.nixosModules.disko ./machines/biotite ]; + baryte = [ + nixos-sbc.nixosModules.default + nixos-sbc.nixosModules.boards.bananapi.bpir4 + ./machines/baryte + ]; }; sharedColmenaModules = [ deploymentModule @@ -311,6 +322,9 @@ calcite = mkNixos { hostname = "calcite"; }; + baryte = mkNixos { + hostname = "baryte"; + }; } // self.colmenaHive.nodes; } diff --git a/machines/baryte/default.nix b/machines/baryte/default.nix new file mode 100644 index 0000000..e9cfdd6 --- /dev/null +++ b/machines/baryte/default.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: +{ + imports = [ + ]; + config = { + nixpkgs.hostPlatform = "aarch64-linux"; + system.stateVersion = "25.05"; + users.users.root.hashedPassword = "$y$j9T$NToEZWJBONjSgRnMd9Ur9/$o6n7a9b8eUILQz4d37oiHCCVnDJ8hZTZt.c.37zFfU."; + + commonSettings = { + auth.enable = true; + }; + + services.openssh.enable = true; + services.dae = { + enable = true; + configFile = "/var/lib/dae/config.dae"; + }; + services.tailscale.enable = true; + time.timeZone = "Asia/Shanghai"; + }; +}