mirror of
https://github.com/sstent/nixos-on-odroid-m1.git
synced 2026-01-26 15:12:44 +00:00
Compare commits
11 Commits
Latest_ARM
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f892b7f5c2 | |||
| a69dff19ed | |||
| f2c0a60d37 | |||
| 4ef3780f8f | |||
| 0de8dcae98 | |||
| 5922983c2e | |||
| c339512db3 | |||
| dd95c4577f | |||
| 66bf68b45d | |||
| 51a8845ae4 | |||
| 456d717d57 |
20
.github/workflows/BuildSDImage.yml
vendored
20
.github/workflows/BuildSDImage.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build SD Image
|
- name: Build SD Image
|
||||||
run: |
|
run: |
|
||||||
nix build --show-trace --option system aarch64-linux --option sandbox false .#images.m1
|
nix build --option system aarch64-linux --option sandbox false --impure .#images.m1
|
||||||
ls -lah ./result/sd-image
|
ls -lah ./result/sd-image
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
@@ -40,15 +40,15 @@ jobs:
|
|||||||
name: sd-image-ARM64_img
|
name: sd-image-ARM64_img
|
||||||
path: ./result/sd-image/*.img*
|
path: ./result/sd-image/*.img*
|
||||||
|
|
||||||
- name: Download artifact # yes, this is really necessary
|
# - name: Download artifact # yes, this is really necessary
|
||||||
uses: actions/download-artifact@v2
|
# uses: actions/download-artifact@v2
|
||||||
with:
|
# with:
|
||||||
name: sd-image-ARM64_img
|
# name: sd-image-ARM64_img
|
||||||
path: release-files
|
# path: release-files
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
# - name: Display structure of downloaded files
|
||||||
run: ls -lah
|
# run: ls -lah
|
||||||
working-directory: release-files
|
# working-directory: release-files
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
tag_name: Latest_ARM64
|
tag_name: Latest_ARM64
|
||||||
body: Auto-generated image build
|
body: Auto-generated image build
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: ./release-files/*
|
files: ./result/sd-image/*.img*
|
||||||
|
|
||||||
|
|
||||||
# - uses: "marvinpinto/action-automatic-releases@latest"
|
# - uses: "marvinpinto/action-automatic-releases@latest"
|
||||||
|
|||||||
52
flake.nix
52
flake.nix
@@ -4,44 +4,44 @@
|
|||||||
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
|
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
|
||||||
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, ... }: let
|
outputs = {nixpkgs, ...}: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
in rec {
|
in rec {
|
||||||
devShell.${system} = pkgs.mkShell {
|
devShell.${system} = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
rsync
|
rsync
|
||||||
zstd
|
zstd
|
||||||
|
git
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||||
|
|
||||||
nixosConfigurations.m1 = lib.nixosSystem {
|
nixosConfigurations.m1 = lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
({ pkgs, config, ... }: {
|
({
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./kboot-conf
|
./kboot-conf
|
||||||
# "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
|
# "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
|
||||||
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
sdImage = {
|
sdImage = {
|
||||||
#compressImage = false;
|
#compressImage = false;
|
||||||
populateFirmwareCommands = let
|
populateFirmwareCommands = let
|
||||||
configTxt = pkgs.writeText "README" ''
|
configTxt = pkgs.writeText "README" ''
|
||||||
Nothing to see here. This empty partition is here because I don't know how to turn its creation off.
|
Nothing to see here. This empty partition is here because I don't know how to turn its creation off.
|
||||||
'';
|
'';
|
||||||
in ''
|
in ''
|
||||||
cp ${configTxt} firmware/README
|
cp ${configTxt} firmware/README
|
||||||
@@ -49,14 +49,14 @@
|
|||||||
populateRootCommands = ''
|
populateRootCommands = ''
|
||||||
${config.boot.loader.kboot-conf.populateCmd} -c ${config.system.build.toplevel} -d ./files/kboot.conf
|
${config.boot.loader.kboot-conf.populateCmd} -c ${config.system.build.toplevel} -d ./files/kboot.conf
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
#boot.loader.grub.enable = false;
|
#boot.loader.grub.enable = false;
|
||||||
boot.loader.kboot-conf.enable = true;
|
boot.loader.kboot-conf.enable = true;
|
||||||
# Use kernel >6.6
|
# Use kernel >6.6
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
# Stop ZFS breasking the build
|
# Stop ZFS breasking the build
|
||||||
boot.supportedFilesystems = lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" ];
|
boot.supportedFilesystems = lib.mkForce ["btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs"];
|
||||||
|
|
||||||
# I'm not completely sure if some of these could be omitted,
|
# I'm not completely sure if some of these could be omitted,
|
||||||
# but want to make sure disk access works
|
# but want to make sure disk access works
|
||||||
@@ -69,13 +69,37 @@
|
|||||||
# Petitboot uses this port and baud rate on the boards serial port,
|
# Petitboot uses this port and baud rate on the boards serial port,
|
||||||
# it's probably good to keep the options same for the running
|
# it's probably good to keep the options same for the running
|
||||||
# kernel for serial console access to work well
|
# kernel for serial console access to work well
|
||||||
boot.kernelParams = [ "console=ttyS2,1500000" ];
|
boot.kernelParams = ["console=ttyS2,1500000"];
|
||||||
hardware.deviceTree.name = "rockchip/rk3568-odroid-m1.dtb";
|
hardware.deviceTree.name = "rockchip/rk3568-odroid-m1.dtb";
|
||||||
|
|
||||||
|
# Enable nix flakes
|
||||||
|
nix.package = pkgs.nixFlakes;
|
||||||
|
nix.extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
nix.nixPath = ["nixpkgs=${nixpkgs}"];
|
||||||
|
|
||||||
|
# includes this flake in the live iso : "/etc/nixcfg"
|
||||||
|
environment.etc.nixcfg.source =
|
||||||
|
builtins.filterSource
|
||||||
|
(path: type:
|
||||||
|
baseNameOf path
|
||||||
|
!= ".git"
|
||||||
|
&& type != "symlink"
|
||||||
|
&& !(pkgs.lib.hasSuffix ".qcow2" path)
|
||||||
|
&& baseNameOf path != "secrets")
|
||||||
|
../.;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.git #gotta have git
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.PermitRootLogin = "yes";
|
settings.PermitRootLogin = "yes";
|
||||||
};
|
};
|
||||||
users.extraUsers.root.initialPassword = lib.mkForce "test123";
|
users.extraUsers.root.initialPassword = lib.mkForce "odroid";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
with lib;
|
lib,
|
||||||
|
pkgs,
|
||||||
let
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
cfg = config.boot.loader.kboot-conf;
|
cfg = config.boot.loader.kboot-conf;
|
||||||
|
|
||||||
# The builder used to write during system activation
|
# The builder used to write during system activation
|
||||||
@@ -19,8 +21,7 @@ let
|
|||||||
path = with pkgs.buildPackages; [coreutils gnused gnugrep];
|
path = with pkgs.buildPackages; [coreutils gnused gnugrep];
|
||||||
inherit (pkgs.buildPackages) bash;
|
inherit (pkgs.buildPackages) bash;
|
||||||
};
|
};
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options = {
|
options = {
|
||||||
boot.loader.kboot-conf = {
|
boot.loader.kboot-conf = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@@ -52,9 +53,10 @@ in
|
|||||||
};
|
};
|
||||||
config = let
|
config = let
|
||||||
args = "-g ${toString cfg.configurationLimit} -n ${config.hardware.deviceTree.name}";
|
args = "-g ${toString cfg.configurationLimit} -n ${config.hardware.deviceTree.name}";
|
||||||
in mkIf cfg.enable {
|
in
|
||||||
system.build.installBootLoader = lib.mkForce "${builder} ${args} -c";
|
mkIf cfg.enable {
|
||||||
system.boot.loader.id = "kboot-conf";
|
system.build.installBootLoader = lib.mkForce "${builder} ${args} -c";
|
||||||
boot.loader.kboot-conf.populateCmd = "${populateBuilder} ${args}";
|
system.boot.loader.id = "kboot-conf";
|
||||||
};
|
boot.loader.kboot-conf.populateCmd = "${populateBuilder} ${args}";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user