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* asahi*
.key

View file

@ -9,6 +9,13 @@
settings = { settings = {
auto-optimise-store = true; auto-optimise-store = true;
trusted-users = [ "root" "@wheel" ]; 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 = { gc = {
automatic = true; automatic = true;
@ -39,4 +46,4 @@
]; ];
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
} }

View file

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

View file

@ -7,11 +7,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1692423274, "lastModified": 1693064156,
"narHash": "sha256-r84qq3YWbDtISIFh9tfNtmqVfBUYrhvIgE/Ivk+1F6Y=", "narHash": "sha256-EnZntHnlPqWZIoa593zDV4GSkfbLLAL6VAreMvM6JN4=",
"owner": "tpwrules", "owner": "tpwrules",
"repo": "nixos-apple-silicon", "repo": "nixos-apple-silicon",
"rev": "5e5a0933387f914f2ad7033f2afbc8a074b9480b", "rev": "bef25f9cdfd8513a42c175b88a1cb619e3ef5951",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -42,11 +42,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1692503956, "lastModified": 1693399033,
"narHash": "sha256-MOA6FKc1YgfGP3ESnjSYfsyJ1BXlwV5pGlY/u5XdJfY=", "narHash": "sha256-yXhiMo8MnE86sGtPIHAKaLHhmhe8v9tqGGotlUgKJvY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "958c06303f43cf0625694326b7f7e5475b1a2d5c", "rev": "f5c15668f9842dd4d5430787d6aa8a28a07f7c10",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -57,27 +57,27 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1692264070, "lastModified": 1692913444,
"narHash": "sha256-WepAkIL2UcHOj7JJiaFS/vxrA9lklQHv8p+xGL+7oQ0=", "narHash": "sha256-1SvMQm2DwofNxXVtNWWtIcTh7GctEVrS/Xel/mdc6iY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "42c25608aa2ad4e5d3716d8d63c606063513ba33", "rev": "18324978d632ffc55ef1d928e81630c620f4f447",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "42c25608aa2ad4e5d3716d8d63c606063513ba33", "rev": "18324978d632ffc55ef1d928e81630c620f4f447",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1692447944, "lastModified": 1693377291,
"narHash": "sha256-fkJGNjEmTPvqBs215EQU4r9ivecV5Qge5cF/QDLVn3U=", "narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d680ded26da5cf104dd2735a51e88d2d8f487b4d", "rev": "e7f38be3775bab9659575f192ece011c033655f0",
"type": "github" "type": "github"
}, },
"original": { "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. */ /* 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 # Effundam = MacBook Air M1 (server usage). Will not be added to flake.nix until thunderbolt and apfs proper support

View file

@ -7,7 +7,7 @@ in {
./hardware.nix ./hardware.nix
my.modules my.modules
]; ];
networking.hostName = "celerrime"; networking.hostName = "celerrime";
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

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