use modulesPath

This commit is contained in:
Travis Staton 2022-08-24 09:54:42 -04:00
parent c82e21e828
commit b6066e9ccd
5 changed files with 8 additions and 14 deletions

View file

@ -32,7 +32,6 @@ mostly wrappers that set common device tree settings for you.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
raspberry-pi-nix = { raspberry-pi-nix = {
url = "github:tstat/raspberry-pi-nix"; url = "github:tstat/raspberry-pi-nix";
inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };

View file

@ -1,14 +1,11 @@
{ {
description = "raspberry-pi nixos configuration"; description = "raspberry-pi nixos configuration";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; }; inputs = { };
outputs = { self, nixpkgs }: { outputs = { self }: {
overlay = import ./overlay; overlay = import ./overlay;
rpi = import ./rpi { rpi = import ./rpi { overlay = self.overlay; };
nixpkgs = nixpkgs;
overlay = self.overlay;
};
rpi-3b-plus = import ./rpi-3b-plus self.rpi; rpi-3b-plus = import ./rpi-3b-plus self.rpi;
rpi-4b = import ./rpi-4b self.rpi; rpi-4b = import ./rpi-4b self.rpi;
rpi-zero-2-w = import ./rpi-zero-2-w self.rpi; rpi-zero-2-w = import ./rpi-zero-2-w self.rpi;

View file

@ -1,9 +1,9 @@
{ overlay, nixpkgs }: { overlay }:
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
{ {
imports = [ imports = [
(import ../sd-image nixpkgs) ../sd-image
./device-tree.nix ./device-tree.nix
./audio.nix ./audio.nix
./i2c.nix ./i2c.nix

View file

@ -1,8 +1,7 @@
stable:
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports = [ (import ./sd-image.nix stable) ]; imports = [ ./sd-image.nix ];
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true; boot.loader.generic-extlinux-compatible.enable = true;

View file

@ -1,4 +1,3 @@
nixpkgs:
# This module was lifted from nixpkgs installer code. It is modified # This module was lifted from nixpkgs installer code. It is modified
# so as to not import all-hardware. The goal here is to write the # so as to not import all-hardware. The goal here is to write the
# nixos image for a raspberry pi to an sd-card in a way so that we can # nixos image for a raspberry pi to an sd-card in a way so that we can
@ -18,12 +17,12 @@ nixpkgs:
# The derivation for the SD image will be placed in # The derivation for the SD image will be placed in
# config.system.build.sdImage # config.system.build.sdImage
{ config, lib, pkgs, ... }: { modulesPath, config, lib, pkgs, ... }:
with lib; with lib;
let let
rootfsImage = pkgs.callPackage "${nixpkgs}/nixos/lib/make-ext4-fs.nix" ({ rootfsImage = pkgs.callPackage "${modulesPath}/../lib/make-ext4-fs.nix" ({
inherit (config.sdImage) storePaths; inherit (config.sdImage) storePaths;
compressImage = true; compressImage = true;
populateImageCommands = config.sdImage.populateRootCommands; populateImageCommands = config.sdImage.populateRootCommands;