Add raspberry image builder flake

This commit is contained in:
Cyryl Płotnicki 2021-12-04 10:43:02 +00:00
parent 92f1230a7e
commit 85d1ea4d4d
3 changed files with 28 additions and 6 deletions

View file

@ -38,6 +38,12 @@
{
nixosConfigurations = {
foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty";
skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky";
bolty = mkServer nixpkgs-stable "x86_64-linux" "bolty";
vultr1 = mkServer nixpkgs-stable "x86_64-linux" "vultr1";
bootstrap = nixpkgs-stable.lib.nixosSystem {
system = "x86_64-linux";
modules = [
@ -45,11 +51,25 @@
];
specialArgs = { inherit inputs; };
};
foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty";
skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky";
bolty = mkServer nixpkgs-stable "x86_64-linux" "bolty";
vultr1 = mkServer nixpkgs-stable "x86_64-linux" "vultr1";
# nix build .#nixosConfigurations.raspiimage.config.system.build.sdImage
raspiimage = nixpkgs-stable.lib.nixosSystem {
system = "aarch64-linux";
modules = [
(import "${inputs.nixpkgs-stable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
{
services.openssh = {
enable = true;
permitRootLogin = inputs.nixpkgs-stable.lib.mkForce "prohibit-password";
passwordAuthentication = false;
};
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE5Ejx5CAPUfHVXi4GL4WmnZaG8eiiOmsW/a0o1bs1GF cyryl@foureighty"
];
sdImage.compressImage = false;
}
];
specialArgs = { inherit inputs; };
};
};
};
inputs = {

View file

@ -24,6 +24,8 @@
options = [ "compress=zstd" ];
};
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
zramSwap = {
enable = true;
algorithm = "zstd";

View file

@ -16,7 +16,7 @@
../../backups.nix
];
boot.kernelPackages = pkgs.linuxPackages_latest_hardened;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "Europe/London";