Skip to content

Commit 88940da

Browse files
hp5 flake
1 parent bd14f8e commit 88940da

File tree

107 files changed

+468
-3979
lines changed

Some content is hidden

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

107 files changed

+468
-3979
lines changed

hp/hp1/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# nixos/hp1/Makefile
2+
# nixos/hp/hp1/Makefile
33
#
44
EXPECTED_HOSTNAME := hp1
55

@@ -25,8 +25,8 @@ rebuild:
2525
sudo nixos-rebuild switch --flake .
2626

2727
sync:
28-
rsync -av /home/das/nixos/hp/hp1/ hp1:/home/das/nixos/hp1/
29-
rsync -av /home/das/nixos/modules/ hp1:/home/das/nixos/modules/
28+
rsync -av /home/das/nixos/hp/hp1/ hp1:/home/das/nixos/hp/hp1/
29+
#rsync -av /home/das/nixos/modules/ hp1:/home/das/nixos/modules/
3030

3131
# https://nixos.wiki/wiki/Kubernetes#reset_to_a_clean_state
3232
nuke_k8s: check_hostname delete_k8s

hp/hp1/configuration.nix

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
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
3-
# and in the NixOS manual (accessible by running ‘nixos-help’).
4-
5-
# sudo nixos-rebuild switch
6-
# sudo nix-channel --update
7-
# nix-shell -p vim
8-
# nmcli device wifi connect MYSSID password PWORD
9-
# systemctl restart display-manager.service
10-
111
{ config, pkgs, ... }:
122

133
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
@@ -31,12 +21,14 @@
3121
./il8n.nix
3222
#./systemdSystem.nix
3323
./systemPackages.nix
24+
# home manager is imported by the flake
3425
#./home.nix
3526
./nodeExporter.nix
3627
./prometheus.nix
3728
./grafana.nix
3829
./docker-daemon.nix
3930
#./k8s_master.nix
31+
#./k8s_node.nix
4032
./k3s_master.nix
4133
#./k3s_node.nix
4234
./systemd.services.ethtool-enp3s0f0.nix
@@ -71,6 +63,7 @@
7163
settings = {
7264
auto-optimise-store = true;
7365
experimental-features = [ "nix-command" "flakes" ];
66+
download-buffer-size = "100000000";
7467
};
7568
};
7669

@@ -102,7 +95,7 @@
10295
users.users.das = {
10396
isNormalUser = true;
10497
description = "das";
105-
extraGroups = [ "wheel" "networkmanager" "libvirtd" "docker" "kubernetes" ];
98+
extraGroups = [ "wheel" "libvirtd" "docker" "kubernetes" ];
10699
packages = with pkgs; [
107100
];
108101
# https://nixos.wiki/wiki/SSH_public_key_authentication
@@ -135,7 +128,7 @@
135128
# this value at the release version of the first install of this system.
136129
# Before changing this value read the documentation for this option
137130
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
138-
system.stateVersion = "24.05"; # Did you read the comment?
131+
system.stateVersion = "24.11"; # Did you read the comment?
139132

140133
# virtualisation.libvirtd.enable = true;
141134
# programs.virt-manager.enable = true;

hp/hp5/Makefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# nixos/hp5/Makefile
2+
# nixos/hp/hp5/Makefile
33
#
44
EXPECTED_HOSTNAME := hp5
55

@@ -16,14 +16,17 @@ else
1616
endif
1717

1818
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
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-channel --update;
25+
sudo nixos-rebuild switch --flake .
2326

2427
sync:
25-
rsync -av /home/das/nixos/hp/hp5/ hp5:/home/das/nixos/hp5/
26-
rsync -av /home/das/nixos/modules/ hp5:/home/das/nixos/modules/
28+
rsync -av /home/das/nixos/hp/hp5/ hp5:/home/das/nixos/hp/hp5/
29+
#rsync -av /home/das/nixos/modules/ hp5:/home/das/nixos/modules/
2730

2831
nuke_k3s: check_hostname delete_k3s
2932

@@ -35,4 +38,4 @@ systemd:
3538
sudo systemctl daemon-reload
3639
sudo systemctl stop k3s.service
3740

38-
# end
41+
# end

hp/hp5/configuration.nix

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
imports =
1919
[ # Include the results of the hardware scan.
2020
./hardware-configuration.nix
21-
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
21+
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager
2222
# sudo nix-channel --update
23-
<home-manager/nixos>
23+
# tutorial
24+
# https://nixos-and-flakes.thiscute.world/nixos-with-flakes/start-using-home-manager
25+
#<home-manager/nixos>
2426
#
2527
./sysctl.nix
2628
# ./wireless.nix
@@ -29,19 +31,27 @@
2931
./il8n.nix
3032
#./systemdSystem.nix
3133
./systemPackages.nix
32-
./home-manager.nix
34+
# home manager is imported by the flake
35+
#./home.nix
3336
./nodeExporter.nix
3437
./prometheus.nix
3538
./grafana.nix
3639
./docker-daemon.nix
40+
#./k8s_master.nix
3741
#./k8s_node.nix
42+
#./k3s_master.nix
3843
./k3s_node.nix
3944
./systemd.services.ethtool-enp3s0f0.nix
4045
./systemd.services.ethtool-enp3s0f1.nix
4146
];
4247

4348
# Bootloader.
44-
boot.loader.systemd-boot.enable = true;
49+
boot.loader.systemd-boot = {
50+
enable = true;
51+
#consoleMode = "max"; # Sets the console mode to the highest resolution supported by the firmware.
52+
memtest86.enable = true;
53+
};
54+
4555
boot.loader.efi.canTouchEfiVariables = true;
4656

4757
# https://nixos.wiki/wiki/Linux_kernel
@@ -58,13 +68,16 @@
5868
settings = {
5969
auto-optimise-store = true;
6070
experimental-features = [ "nix-command" "flakes" ];
71+
download-buffer-size = "100000000";
6172
};
6273
};
6374

6475
# https://nixos.wiki/wiki/Networking
6576
# https://nlewo.github.io/nixos-manual-sphinx/configuration/ipv4-config.xml.html
6677
networking.hostName = "hp5";
6778

79+
services.lldpd.enable = true;
80+
6881
# Configure network proxy if necessary
6982
# networking.proxy.default = "http://user:password@proxy:port/";
7083
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
@@ -87,7 +100,7 @@
87100
users.users.das = {
88101
isNormalUser = true;
89102
description = "das";
90-
extraGroups = [ "wheel" "networkmanager" "libvirtd" "docker" "kubernetes" ];
103+
extraGroups = [ "wheel" "libvirtd" "docker" "kubernetes" ];
91104
packages = with pkgs; [
92105
];
93106
# https://nixos.wiki/wiki/SSH_public_key_authentication
@@ -110,13 +123,17 @@
110123

111124
services.openssh.enable = true;
112125

126+
services.timesyncd.enable = true;
127+
128+
services.fstrim.enable = true;
129+
113130
# This value determines the NixOS release from which the default
114131
# settings for stateful data, like file locations and database versions
115132
# on your system were taken. It‘s perfectly fine and recommended to leave
116133
# this value at the release version of the first install of this system.
117134
# Before changing this value read the documentation for this option
118135
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
119-
system.stateVersion = "24.05"; # Did you read the comment?
136+
system.stateVersion = "24.11"; # Did you read the comment?
120137

121138
# virtualisation.libvirtd.enable = true;
122139
# programs.virt-manager.enable = true;

hp/hp5/docker-daemon.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
{ config, pkgs, ... }:
3+
4+
{
5+
# https://nixos.wiki/wiki/Docker
6+
# https://search.nixos.org/options?from=0&size=50&sort=alpha_asc&query=virtualisation.docker
7+
# https://search.nixos.org/options?channel=24.05&show=virtualisation.docker.extraOptions&from=0&size=50&sort=alpha_asc&type=packages&query=virtualisation.docker
8+
# https://github.com/NixOS/nixpkgs/issues/68349
9+
virtualisation.docker.enable = true;
10+
virtualisation.docker.daemon.settings = {
11+
data-root = "/home/das/docker/";
12+
userland-proxy = false;
13+
experimental = true;
14+
ipv6 = true;
15+
fixed-cidr-v6 = "fd00::/80";
16+
metrics-addr = "0.0.0.0:9323";
17+
# log-driver = "json-file";
18+
# log-opts.max-size = "10m";
19+
# log-opts.max-file = "10";
20+
};
21+
#this doesn't work
22+
#virtualisation.docker.daemon.settings.log-opts.max-size = "10m";
23+
# https://docs.docker.com/reference/cli/dockerd/
24+
#virtualisation.docker.extraOptions = "--userland-proxy=false";
25+
#virtualisation.docker.extraOptions = "--log-opt=max-size=10m";
26+
#virtualisation.docker.extraOptions = "--ipv6";
27+
}

hp/hp5/flake.nix

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
description = "HP5 Flake";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
6+
# https://nixos-and-flakes.thiscute.world/nixos-with-flakes/start-using-home-manager
7+
home-manager = {
8+
url = "github:nix-community/home-manager/release-24.11";
9+
# The `follows` keyword in inputs is used for inheritance.
10+
# Here, `inputs.nixpkgs` of home-manager is kept consistent with
11+
# the `inputs.nixpkgs` of the current flake,
12+
# to avoid problems caused by different versions of nixpkgs.
13+
inputs.nixpkgs.follows = "nixpkgs";
14+
};
15+
};
16+
17+
outputs = inputs@{ nixpkgs, home-manager, ... }:
18+
let
19+
system = "x86_64-linux";
20+
pkgs = import nixpkgs {
21+
inherit system;
22+
config = { allowUnfree = true; };
23+
};
24+
lib = nixpkgs.lib;
25+
in {
26+
nixosConfigurations = {
27+
hp5 = lib.nixosSystem {
28+
#system ="x86_64-linux";
29+
inherit system;
30+
modules = [
31+
./configuration.nix
32+
home-manager.nixosModules.home-manager
33+
{
34+
home-manager.useGlobalPkgs = true;
35+
home-manager.useUserPackages = true;
36+
home-manager.users.das = import ./home.nix;
37+
38+
# Optionally, use home-manager.extraSpecialArgs to pass
39+
# arguments to home.nix
40+
}
41+
];
42+
};
43+
};
44+
};
45+
}

0 commit comments

Comments
 (0)