Add raspberry pi machine

Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
Ivan Bushchik 2023-08-31 18:28:25 +03:00
parent b0db69a522
commit ab528c81b2
No known key found for this signature in database
GPG key ID: 2F16FBF3262E090C
8 changed files with 95 additions and 16 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
asahi*
.key

View file

@ -9,6 +9,13 @@
settings = {
auto-optimise-store = true;
trusted-users = [ "root" "@wheel" ];
substituters = [
"https://binarycache.ivabus.dev/public" # Yep, only public one here :)
"https://cache.nixos.org"
];
trusted-public-keys = [
"public:9k8+78y5+1rICy+9e4raIiLP/dKDEvm9dyjj27vPS04="
];
};
gc = {
automatic = true;

View file

@ -16,6 +16,7 @@ in rec {
cargo
rustc
neofetch # I use NixOS BTW
duf
htop
];
shell = pkgs.zsh;

View file

@ -7,11 +7,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1692423274,
"narHash": "sha256-r84qq3YWbDtISIFh9tfNtmqVfBUYrhvIgE/Ivk+1F6Y=",
"lastModified": 1693064156,
"narHash": "sha256-EnZntHnlPqWZIoa593zDV4GSkfbLLAL6VAreMvM6JN4=",
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"rev": "5e5a0933387f914f2ad7033f2afbc8a074b9480b",
"rev": "bef25f9cdfd8513a42c175b88a1cb619e3ef5951",
"type": "github"
},
"original": {
@ -42,11 +42,11 @@
]
},
"locked": {
"lastModified": 1692503956,
"narHash": "sha256-MOA6FKc1YgfGP3ESnjSYfsyJ1BXlwV5pGlY/u5XdJfY=",
"lastModified": 1693399033,
"narHash": "sha256-yXhiMo8MnE86sGtPIHAKaLHhmhe8v9tqGGotlUgKJvY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "958c06303f43cf0625694326b7f7e5475b1a2d5c",
"rev": "f5c15668f9842dd4d5430787d6aa8a28a07f7c10",
"type": "github"
},
"original": {
@ -57,27 +57,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1692264070,
"narHash": "sha256-WepAkIL2UcHOj7JJiaFS/vxrA9lklQHv8p+xGL+7oQ0=",
"lastModified": 1692913444,
"narHash": "sha256-1SvMQm2DwofNxXVtNWWtIcTh7GctEVrS/Xel/mdc6iY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "42c25608aa2ad4e5d3716d8d63c606063513ba33",
"rev": "18324978d632ffc55ef1d928e81630c620f4f447",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "42c25608aa2ad4e5d3716d8d63c606063513ba33",
"rev": "18324978d632ffc55ef1d928e81630c620f4f447",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1692447944,
"narHash": "sha256-fkJGNjEmTPvqBs215EQU4r9ivecV5Qge5cF/QDLVn3U=",
"lastModified": 1693377291,
"narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d680ded26da5cf104dd2735a51e88d2d8f487b4d",
"rev": "e7f38be3775bab9659575f192ece011c033655f0",
"type": "github"
},
"original": {

View file

@ -41,6 +41,16 @@
];
};
# Raspberry Pi 4B 2GB RAM
nixosConfigurations."rubusidaeus" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
home-manager.nixosModules.home-manager
./machines/rubusidaeus
];
};
/* These machines will be configured later. */
/*
# Effundam = MacBook Air M1 (server usage). Will not be added to flake.nix until thunderbolt and apfs proper support

View file

@ -0,0 +1,59 @@
{ config, pkgs, lib, ... }:
let
my = import ../..;
overlay = final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
};
in {
imports = [
# Not using ./hardware.nix as additional hardware file due to generation of images that doesn't change between installations. Maybe I should create dedicated raspberry.nix for all raspberry pies.
my.modules
];
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
sdImage.compressImage = false;
networking.hostName = "rubusidaeus";
my.laptop.enable = false;
my.roles = {
design.enable = false;
devel.enable = false;
gaming.enable = false;
graphical.enable = false;
latex.enable = false;
media-client.enable = false;
torrent.enable = false;
virtualisation.enable = false;
yggdrasil-client.enable = true;
};
# Augghhh
nixpkgs.overlays = [ overlay ];
networking.useDHCP = true;
hardware.enableRedistributableFirmware = true;
system.stateVersion = "23.05";
}

View file

@ -25,6 +25,7 @@ in {
}
# Architecture-specific packages and configuration
(lib.mkIf (!pkgs.stdenv.isAarch64) {boot.binfmt.emulatedSystems = [ "aarch64-linux" ];})
(lib.mkIf (!pkgs.stdenv.isAarch32) {boot.binfmt.emulatedSystems = [ "armv6l-linux" ];})
(lib.mkIf (!pkgs.stdenv.isx86_64) {boot.binfmt.emulatedSystems = [ "x86_64-linux" "i686-linux" ];})
# Remove CLion from builds while I'm semi-online
# Install CLion only if we are on x86_64