Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
result
./result
*.qcow2

24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,29 @@
#
.PHONY: all

all: hp0 hp1 hp2 hp3 hp4 hp5
all: hosts

hosts:
# [das@t:~/nixos]$ find ./ -name 'hosts.nix'
# ./hp/hp1/hosts.nix
# ./hp/hp0/hosts.nix
# ./hp/hp2/hosts.nix
# ./hp/hp5/hosts.nix
# ./modules/hosts.nix
# ./laptops/t/hosts.nix
cp ./modules/hosts.nix ./hp/hp0/hosts.nix
cp ./modules/hosts.nix ./hp/hp1/hosts.nix
cp ./modules/hosts.nix ./hp/hp2/hosts.nix
cp ./modules/hosts.nix ./hp/hp3/hosts.nix
cp ./modules/hosts.nix ./hp/hp4/hosts.nix
cp ./modules/hosts.nix ./hp/hp5/hosts.nix

cp ./modules/hosts.nix ./laptops/t/hosts.nix
cp ./modules/hosts.nix ./laptops/t14/hosts.nix

cp ./modules/hosts.nix ./arm/pi5-1-os/hosts.nix

#all: hp0 hp1 hp2 hp3 hp4 hp5

hp0:
scp -C ./modules/* hp0:
Expand Down
2 changes: 2 additions & 0 deletions arm/pi5-1-os/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
result
./result
36 changes: 36 additions & 0 deletions arm/pi5-1-os/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# nixos/arm/pi5-1/Makefile
#
EXPECTED_HOSTNAME := pi5-1

ACTUAL_HOSTNAME := $(shell hostname)

all: check_hostname rebuild

check_hostname:
ifeq ($(ACTUAL_HOSTNAME),$(EXPECTED_HOSTNAME))
@echo "Hostnames match: $(ACTUAL_HOSTNAME)"
else
@echo "Error: Hostname does not match. Expected: $(EXPECTED_HOSTNAME), Got: $(ACTUAL_HOSTNAME)"
@exit 1
endif

rebuild:
#sudo cp /home/das/nixos/modules/* /etc/nixos/
# sudo cp ./*.nix /etc/nixos/
# sudo nix-channel --update
# sudo nixos-rebuild switch
#sudo nix flake update;
sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes flake update;
#sudo nix-channel --update;
sudo nixos-rebuild switch --flake .#pi5-1

sync:
rsync -av /home/das/nixos/arm/pi5-1-os/ pi5-1:/home/das/nixos/arm/pi5-1-os/
#rsync -av /home/das/nixos/modules/ hp2:/home/das/nixos/modules/

syncIP:
rsync -av /home/das/nixos/arm/pi5-1-os/ 172.16.40.122:/home/das/nixos/arm/pi5-1-os/
#rsync -av /home/das/nixos/modules/ hp2:/home/das/nixos/modules/

# end
174 changes: 174 additions & 0 deletions arm/pi5-1-os/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#
# nixos/arm/pi5-1-os
#

#{ config, lib, pkgs, ... }:
{ inputs, config, lib, pkgs, ... }:

{
imports = [
#./hardware-configuration.nix
./il8n.nix
./nodeExporter.nix
./hosts.nix
./docker-daemon.nix
];

# Use the GRUB 2 boot loader.
#boot.loader.grub.enable = false;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
# Enables the generation of /boot/extlinux/extlinux.conf
#boot.loader.generic-extlinux-compatible.enable = true;

#boot.loader.efi.canTouchEfiVariables = false;

# kernel comes from the community package
# https://nixos.wiki/wiki/Linux_kernel
#boot.kernelPackages = pkgs.linuxPackages;
#boot.kernelPackages = pkgs.linuxPackages_latest;
#boot.kernelPackages = pkgs.linuxPackages_rpi5;
#boot.kernelPackages = (import (builtins.fetchTarball https://gitlab.com/vriska/nix-rpi5/-/archive/main.tar.gz)).legacyPackages.aarch64-linux.linuxPackages_rpi5;

nix = {
gc = {
automatic = true; # Enable automatic execution of the task
dates = "weekly"; # Schedule the task to run weekly
options = "--delete-older-than 10d"; # Specify options for the task: delete files older than 10 days
randomizedDelaySec = "14m"; # Introduce a randomized delay of up to 14 minutes before executing the task
};
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
# https://gitlab.com/engmark/root/-/merge_requests/785/diffs
download-buffer-size = "500000000";
};
};

networking.hostName = "pi5-1";

networking.networkmanager.enable = false;

services.lldpd.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
ipv4 = true;
ipv6 = true;
openFirewall = true;
};
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.

time.timeZone = "America/Los_Angeles";

# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };

# Enable the X11 windowing system.
# services.xserver.enable = true;

# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";

# Enable CUPS to print documents.
# services.printing.enable = true;

users.users.das = {
isNormalUser = true;
description = "das";
extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "docker" "video" ];
# users.extraGroups.docker.members = [ "das" ];
packages = with pkgs; [
];
# https://nixos.wiki/wiki/SSH_public_key_authentication
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMCFUMSCFJX95eLfm7P9r72NBp9I1FiXwNwJ+x/HGPV das@t"
];
};

environment.sessionVariables = {
TERM = "xterm-256color";
#MY_VARIABLE = "my-value";
#ANOTHER_VARIABLE = "another-value";
};

# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
wget
htop
btop
neofetch
tcpdump
iproute2
hw-probe
lshw
gnumake
];

# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };

# List services that you want to enable:

# Enable the OpenSSH daemon.
services.openssh.enable = true;

services.timesyncd.enable = true;

services.fstrim.enable = true;

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;

# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
nixpkgs.config.allowUnfree = true;
system.stateVersion = "24.11"; # Did you read the comment?

}

127 changes: 127 additions & 0 deletions arm/pi5-1-os/configuration.nix.nixos-generate-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).

{ config, lib, pkgs, ... }:

{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];

# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only

# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.

# Set your time zone.
# time.timeZone = "Europe/Amsterdam";

# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };

# Enable the X11 windowing system.
# services.xserver.enable = true;




# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";

# Enable CUPS to print documents.
# services.printing.enable = true;

# Enable sound.
# hardware.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };

# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;

# Define a user account. Don't forget to set a password with ‘passwd’.
# users.users.alice = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
# packages = with pkgs; [
# tree
# ];
# };

# programs.firefox.enable = true;

# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];

# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };

# List services that you want to enable:

# Enable the OpenSSH daemon.
# services.openssh.enable = true;

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;

# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.11"; # Did you read the comment?

}

Loading