Skip to content

Commit 0d70bda

Browse files
2025_01_26
1 parent 91a12b9 commit 0d70bda

File tree

183 files changed

+9552
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+9552
-10
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
result
2+
./result
3+
*.qcow2
4+

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,29 @@
33
#
44
.PHONY: all
55

6-
all: hp0 hp1 hp2 hp3 hp4 hp5
6+
all: hosts
7+
8+
hosts:
9+
# [das@t:~/nixos]$ find ./ -name 'hosts.nix'
10+
# ./hp/hp1/hosts.nix
11+
# ./hp/hp0/hosts.nix
12+
# ./hp/hp2/hosts.nix
13+
# ./hp/hp5/hosts.nix
14+
# ./modules/hosts.nix
15+
# ./laptops/t/hosts.nix
16+
cp ./modules/hosts.nix ./hp/hp0/hosts.nix
17+
cp ./modules/hosts.nix ./hp/hp1/hosts.nix
18+
cp ./modules/hosts.nix ./hp/hp2/hosts.nix
19+
cp ./modules/hosts.nix ./hp/hp3/hosts.nix
20+
cp ./modules/hosts.nix ./hp/hp4/hosts.nix
21+
cp ./modules/hosts.nix ./hp/hp5/hosts.nix
22+
23+
cp ./modules/hosts.nix ./laptops/t/hosts.nix
24+
cp ./modules/hosts.nix ./laptops/t14/hosts.nix
25+
26+
cp ./modules/hosts.nix ./arm/pi5-1-os/hosts.nix
27+
28+
#all: hp0 hp1 hp2 hp3 hp4 hp5
729

830
hp0:
931
scp -C ./modules/* hp0:

arm/pi5-1-os/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
result
2+
./result

arm/pi5-1-os/Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# nixos/arm/pi5-1/Makefile
3+
#
4+
EXPECTED_HOSTNAME := pi5-1
5+
6+
ACTUAL_HOSTNAME := $(shell hostname)
7+
8+
all: check_hostname rebuild
9+
10+
check_hostname:
11+
ifeq ($(ACTUAL_HOSTNAME),$(EXPECTED_HOSTNAME))
12+
@echo "Hostnames match: $(ACTUAL_HOSTNAME)"
13+
else
14+
@echo "Error: Hostname does not match. Expected: $(EXPECTED_HOSTNAME), Got: $(ACTUAL_HOSTNAME)"
15+
@exit 1
16+
endif
17+
18+
rebuild:
19+
#sudo cp /home/das/nixos/modules/* /etc/nixos/
20+
# sudo cp ./*.nix /etc/nixos/
21+
# sudo nix-channel --update
22+
# sudo nixos-rebuild switch
23+
#sudo nix flake update;
24+
sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes flake update;
25+
#sudo nix-channel --update;
26+
sudo nixos-rebuild switch --flake .#pi5-1
27+
28+
sync:
29+
rsync -av /home/das/nixos/arm/pi5-1-os/ pi5-1:/home/das/nixos/arm/pi5-1-os/
30+
#rsync -av /home/das/nixos/modules/ hp2:/home/das/nixos/modules/
31+
32+
syncIP:
33+
rsync -av /home/das/nixos/arm/pi5-1-os/ 172.16.40.122:/home/das/nixos/arm/pi5-1-os/
34+
#rsync -av /home/das/nixos/modules/ hp2:/home/das/nixos/modules/
35+
36+
# end

arm/pi5-1-os/configuration.nix

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
#
2+
# nixos/arm/pi5-1-os
3+
#
4+
5+
#{ config, lib, pkgs, ... }:
6+
{ inputs, config, lib, pkgs, ... }:
7+
8+
{
9+
imports = [
10+
#./hardware-configuration.nix
11+
./il8n.nix
12+
./nodeExporter.nix
13+
./hosts.nix
14+
./docker-daemon.nix
15+
];
16+
17+
# Use the GRUB 2 boot loader.
18+
#boot.loader.grub.enable = false;
19+
# boot.loader.grub.efiSupport = true;
20+
# boot.loader.grub.efiInstallAsRemovable = true;
21+
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
22+
# Define on which hard drive you want to install Grub.
23+
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
24+
# Enables the generation of /boot/extlinux/extlinux.conf
25+
#boot.loader.generic-extlinux-compatible.enable = true;
26+
27+
#boot.loader.efi.canTouchEfiVariables = false;
28+
29+
# kernel comes from the community package
30+
# https://nixos.wiki/wiki/Linux_kernel
31+
#boot.kernelPackages = pkgs.linuxPackages;
32+
#boot.kernelPackages = pkgs.linuxPackages_latest;
33+
#boot.kernelPackages = pkgs.linuxPackages_rpi5;
34+
#boot.kernelPackages = (import (builtins.fetchTarball https://gitlab.com/vriska/nix-rpi5/-/archive/main.tar.gz)).legacyPackages.aarch64-linux.linuxPackages_rpi5;
35+
36+
nix = {
37+
gc = {
38+
automatic = true; # Enable automatic execution of the task
39+
dates = "weekly"; # Schedule the task to run weekly
40+
options = "--delete-older-than 10d"; # Specify options for the task: delete files older than 10 days
41+
randomizedDelaySec = "14m"; # Introduce a randomized delay of up to 14 minutes before executing the task
42+
};
43+
settings = {
44+
auto-optimise-store = true;
45+
experimental-features = [ "nix-command" "flakes" ];
46+
# https://gitlab.com/engmark/root/-/merge_requests/785/diffs
47+
download-buffer-size = "500000000";
48+
};
49+
};
50+
51+
networking.hostName = "pi5-1";
52+
53+
networking.networkmanager.enable = false;
54+
55+
services.lldpd.enable = true;
56+
services.avahi = {
57+
enable = true;
58+
nssmdns4 = true;
59+
ipv4 = true;
60+
ipv6 = true;
61+
openFirewall = true;
62+
};
63+
# Pick only one of the below networking options.
64+
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
65+
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
66+
67+
time.timeZone = "America/Los_Angeles";
68+
69+
# Configure network proxy if necessary
70+
# networking.proxy.default = "http://user:password@proxy:port/";
71+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
72+
73+
# Select internationalisation properties.
74+
i18n.defaultLocale = "en_US.UTF-8";
75+
# console = {
76+
# font = "Lat2-Terminus16";
77+
# keyMap = "us";
78+
# useXkbConfig = true; # use xkb.options in tty.
79+
# };
80+
81+
# Enable the X11 windowing system.
82+
# services.xserver.enable = true;
83+
84+
# Configure keymap in X11
85+
# services.xserver.xkb.layout = "us";
86+
# services.xserver.xkb.options = "eurosign:e,caps:escape";
87+
88+
# Enable CUPS to print documents.
89+
# services.printing.enable = true;
90+
91+
users.users.das = {
92+
isNormalUser = true;
93+
description = "das";
94+
extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "docker" "video" ];
95+
# users.extraGroups.docker.members = [ "das" ];
96+
packages = with pkgs; [
97+
];
98+
# https://nixos.wiki/wiki/SSH_public_key_authentication
99+
openssh.authorizedKeys.keys = [
100+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMCFUMSCFJX95eLfm7P9r72NBp9I1FiXwNwJ+x/HGPV das@t"
101+
];
102+
};
103+
104+
environment.sessionVariables = {
105+
TERM = "xterm-256color";
106+
#MY_VARIABLE = "my-value";
107+
#ANOTHER_VARIABLE = "another-value";
108+
};
109+
110+
# List packages installed in system profile. To search, run:
111+
# $ nix search wget
112+
environment.systemPackages = with pkgs; [
113+
vim
114+
wget
115+
htop
116+
btop
117+
neofetch
118+
tcpdump
119+
iproute2
120+
hw-probe
121+
lshw
122+
gnumake
123+
];
124+
125+
# Some programs need SUID wrappers, can be configured further or are
126+
# started in user sessions.
127+
# programs.mtr.enable = true;
128+
# programs.gnupg.agent = {
129+
# enable = true;
130+
# enableSSHSupport = true;
131+
# };
132+
133+
# List services that you want to enable:
134+
135+
# Enable the OpenSSH daemon.
136+
services.openssh.enable = true;
137+
138+
services.timesyncd.enable = true;
139+
140+
services.fstrim.enable = true;
141+
142+
# Open ports in the firewall.
143+
# networking.firewall.allowedTCPPorts = [ ... ];
144+
# networking.firewall.allowedUDPPorts = [ ... ];
145+
# Or disable the firewall altogether.
146+
# networking.firewall.enable = false;
147+
148+
# Copy the NixOS configuration file and link it from the resulting system
149+
# (/run/current-system/configuration.nix). This is useful in case you
150+
# accidentally delete configuration.nix.
151+
# system.copySystemConfiguration = true;
152+
153+
# This option defines the first version of NixOS you have installed on this particular machine,
154+
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
155+
#
156+
# Most users should NEVER change this value after the initial install, for any reason,
157+
# even if you've upgraded your system to a new NixOS release.
158+
#
159+
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
160+
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
161+
# to actually do that.
162+
#
163+
# This value being lower than the current NixOS release does NOT mean your system is
164+
# out of date, out of support, or vulnerable.
165+
#
166+
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
167+
# and migrated your data accordingly.
168+
#
169+
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
170+
nixpkgs.config.allowUnfree = true;
171+
system.stateVersion = "24.11"; # Did you read the comment?
172+
173+
}
174+
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Edit this configuration file to define what should be installed on
2+
# your system. Help is available in the configuration.nix(5) man page, on
3+
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
4+
5+
{ config, lib, pkgs, ... }:
6+
7+
{
8+
imports =
9+
[ # Include the results of the hardware scan.
10+
./hardware-configuration.nix
11+
];
12+
13+
# Use the GRUB 2 boot loader.
14+
boot.loader.grub.enable = true;
15+
# boot.loader.grub.efiSupport = true;
16+
# boot.loader.grub.efiInstallAsRemovable = true;
17+
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
18+
# Define on which hard drive you want to install Grub.
19+
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
20+
21+
# networking.hostName = "nixos"; # Define your hostname.
22+
# Pick only one of the below networking options.
23+
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
24+
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
25+
26+
# Set your time zone.
27+
# time.timeZone = "Europe/Amsterdam";
28+
29+
# Configure network proxy if necessary
30+
# networking.proxy.default = "http://user:password@proxy:port/";
31+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
32+
33+
# Select internationalisation properties.
34+
# i18n.defaultLocale = "en_US.UTF-8";
35+
# console = {
36+
# font = "Lat2-Terminus16";
37+
# keyMap = "us";
38+
# useXkbConfig = true; # use xkb.options in tty.
39+
# };
40+
41+
# Enable the X11 windowing system.
42+
# services.xserver.enable = true;
43+
44+
45+
46+
47+
# Configure keymap in X11
48+
# services.xserver.xkb.layout = "us";
49+
# services.xserver.xkb.options = "eurosign:e,caps:escape";
50+
51+
# Enable CUPS to print documents.
52+
# services.printing.enable = true;
53+
54+
# Enable sound.
55+
# hardware.pulseaudio.enable = true;
56+
# OR
57+
# services.pipewire = {
58+
# enable = true;
59+
# pulse.enable = true;
60+
# };
61+
62+
# Enable touchpad support (enabled default in most desktopManager).
63+
# services.libinput.enable = true;
64+
65+
# Define a user account. Don't forget to set a password with ‘passwd’.
66+
# users.users.alice = {
67+
# isNormalUser = true;
68+
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
69+
# packages = with pkgs; [
70+
# tree
71+
# ];
72+
# };
73+
74+
# programs.firefox.enable = true;
75+
76+
# List packages installed in system profile. To search, run:
77+
# $ nix search wget
78+
# environment.systemPackages = with pkgs; [
79+
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
80+
# wget
81+
# ];
82+
83+
# Some programs need SUID wrappers, can be configured further or are
84+
# started in user sessions.
85+
# programs.mtr.enable = true;
86+
# programs.gnupg.agent = {
87+
# enable = true;
88+
# enableSSHSupport = true;
89+
# };
90+
91+
# List services that you want to enable:
92+
93+
# Enable the OpenSSH daemon.
94+
# services.openssh.enable = true;
95+
96+
# Open ports in the firewall.
97+
# networking.firewall.allowedTCPPorts = [ ... ];
98+
# networking.firewall.allowedUDPPorts = [ ... ];
99+
# Or disable the firewall altogether.
100+
# networking.firewall.enable = false;
101+
102+
# Copy the NixOS configuration file and link it from the resulting system
103+
# (/run/current-system/configuration.nix). This is useful in case you
104+
# accidentally delete configuration.nix.
105+
# system.copySystemConfiguration = true;
106+
107+
# This option defines the first version of NixOS you have installed on this particular machine,
108+
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
109+
#
110+
# Most users should NEVER change this value after the initial install, for any reason,
111+
# even if you've upgraded your system to a new NixOS release.
112+
#
113+
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
114+
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
115+
# to actually do that.
116+
#
117+
# This value being lower than the current NixOS release does NOT mean your system is
118+
# out of date, out of support, or vulnerable.
119+
#
120+
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
121+
# and migrated your data accordingly.
122+
#
123+
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
124+
system.stateVersion = "24.11"; # Did you read the comment?
125+
126+
}
127+

0 commit comments

Comments
 (0)