From 564e6d8b1340d15e1305a072f63eec0378bd7076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 9 Aug 2022 09:21:28 +0200 Subject: Some initial work for Raspberry pi --- flake.lock | 21 ++++++++++++++++++--- flake.nix | 19 ++++++++++++++----- nixos/modules/generic.nix | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index c3ee35f..158df2e 100644 --- a/flake.lock +++ b/flake.lock @@ -42,13 +42,27 @@ "type": "indirect" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1659356074, + "narHash": "sha256-UwV6hZZEtchvtiTCCD/ODEv1226eam8kEgEyQb7xB0E=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "ea3efc80f8ab83cb73aec39f4e76fe87afb15a08", + "type": "github" + }, + "original": { + "id": "nixos-hardware", + "type": "indirect" + } + }, "nixpkgs": { "locked": { - "lastModified": 1659868656, - "narHash": "sha256-LINDS957FYzOb412t/Zha44LQqGniMpUIUz4Pi+fvSs=", + "lastModified": 1659987637, + "narHash": "sha256-8l+5QiCkackVPu/F3vX7RCKHyYKxEsq/TKMuaG6UX5k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "80fc83ad314fe701766ee66ac8286307d65b39e3", + "rev": "a47896bf817e7324471e687fc2bb2312fff682ce", "type": "github" }, "original": { @@ -124,6 +138,7 @@ "root": { "inputs": { "flake-utils": "flake-utils", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixturris": "nixturris", "personal-secret": "personal-secret", diff --git a/flake.nix b/flake.nix index f4652d2..7af2bb5 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ }; outputs = { self - , nixpkgs, flake-utils + , nixpkgs, flake-utils, nixos-hardware , shellrc, nixturris, personal-secret , sterm }: @@ -45,11 +45,20 @@ }; }; amd64System = genericSystem {system = "x86_64-linux";}; - armv7lSystem = genericSystem {system = "armv7l-linux"; extra_modules = [ + raspi2System = genericSystem {system = "armv7l-linux"; extra_modules = [ + nixos-hardware.nixosModules.raspberry-pi-2 nixturris.nixosModules.turris-crossbuild nixturris.nixosModules.armv7l-overlay + { boot.loader.systemd-boot.enable = false; } + ];}; + raspi3System = genericSystem {system = "aarch64-linux"; extra_modules = [ + ({pkgs, ...}: { + boot.loader.systemd-boot.enable = false; + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + #boot.kernelPackages = pkgs.linuxKernel.packages.linux_rpi3; + }) ];}; - aarch64System = genericSystem {system = "aarch64-linux";}; turrisSystem = board: hostname: { ${hostname} = nixturris.lib.nixturrisSystem { @@ -68,8 +77,8 @@ amd64System "lipwig" // amd64System "ridcully" // amd64System "susan" // - armv7lSystem "spt-mpd" // - aarch64System "adm-mpd" // + raspi2System "spt-mpd" // + raspi3System "adm-mpd" // turrisMoxSystem "dean" // turrisOmniaSystem "spt-omnia" // turrisMoxSystem "spt-mox" // diff --git a/nixos/modules/generic.nix b/nixos/modules/generic.nix index 57c5d82..74bc314 100644 --- a/nixos/modules/generic.nix +++ b/nixos/modules/generic.nix @@ -33,7 +33,7 @@ in { }; boot.loader.systemd-boot.enable = mkOverride 1100 true; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.canTouchEfiVariables = mkDefault true; boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelParams = ["boot.shell_on_fail"]; hardware.enableAllFirmware = true; -- cgit v1.2.3