From d5dbab8d5b59c4a6866952f0fa87e281ff49be38 Mon Sep 17 00:00:00 2001 From: Paul-Henri Froidmont Date: Thu, 15 Sep 2022 22:01:56 +0200 Subject: [PATCH] wip --- flake.nix | 23 ++++++++++++++++++++++- modules/system.nix | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index cbebfe8..bb1a54a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,11 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.05"; home-manager.url = "github:nix-community/home-manager"; }; - outputs = { self, home-manager, nixpkgs }: { + outputs = { self, home-manager, nixpkgs, nixpkgs-stable }: { nixosConfigurations.nixos-desktop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -155,5 +156,25 @@ ) ]; }; + + nixosConfigurations.rpi2 = nixpkgs-stable.lib.nixosSystem { + system = "armv7l-linux"; + modules = [ + "${nixpkgs-stable}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix" + { + networking.hostName = "rpi2"; + nixpkgs.config.allowUnsupportedSystem = true; + nixpkgs.crossSystem.system = "armv7l-linux"; + + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keyFiles = [ + ./ssh_keys/phfroidmont-desktop.pub + ./ssh_keys/phfroidmont-laptop.pub + ]; + system.stateVersion = "22.05"; + } + ]; + }; + images.rpi2 = self.nixosConfigurations.rpi2.config.system.build.sdImage; }; } diff --git a/modules/system.nix b/modules/system.nix index 17a1271..16fac3a 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -87,5 +87,5 @@ # Required for custom GTK themes services.dbus.packages = with pkgs; [ dconf ]; - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv7l-linux" ]; }