Skip to content

Commit 2773263

Browse files
2024 05 29
1 parent b5f9840 commit 2773263

File tree

5 files changed

+410
-6
lines changed

5 files changed

+410
-6
lines changed

hp0/configuration.nix

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
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+
# nix-shell -p vimo
7+
# nmcli device wifi connect MYSSID password PWORD
8+
# systemctl restart display-manager.service
9+
10+
{ config, pkgs, ... }:
11+
12+
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
13+
14+
{
15+
imports =
16+
[ # Include the results of the hardware scan.
17+
./hardware-configuration.nix
18+
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
19+
# sudo nix-channel --update
20+
<home-manager/nixos>
21+
];
22+
23+
# Bootloader.
24+
boot.loader.systemd-boot.enable = true;
25+
boot.loader.efi.canTouchEfiVariables = true;
26+
27+
# https://nixos.wiki/wiki/Networking
28+
networking.hostName = "hp0"; # Define your hostname.
29+
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
30+
networking.wireless = {
31+
enable = true; # Enables wireless support via wpa_supplicant.
32+
environmentFile = "/home/das/wireless.env";
33+
networks."devices".psk = "performance";
34+
#networks."devices".psk = "@PSK_DEVICES@";
35+
extraConfig = "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel";
36+
# output ends up in /run/wpa_supplicant/wpa_supplicant.conf
37+
};
38+
# https://linux.die.net/man/5/wpa_supplicant.conf
39+
# https://nixos.wiki/wiki/Wpa_supplicant
40+
# https://nixos.org/manual/nixos/stable/options#opt-networking.wireless.environmentFile
41+
# https://blog.stigok.com/2021/05/04/getting-wpa-cli-to-work-in-nixos.html
42+
43+
# Configure network proxy if necessary
44+
# networking.proxy.default = "http://user:password@proxy:port/";
45+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
46+
47+
# Enable networking
48+
networking.networkmanager.enable = false;
49+
#networking.networkmanager.enable = true;
50+
51+
# networking.hosts = {
52+
# "172.16.50.216" = ["hp0"];
53+
# "172.16.40.35" = ["hp1"];
54+
# "172.16.40.71" = ["hp2"];
55+
# };
56+
57+
# Set your time zone.
58+
time.timeZone = "America/Los_Angeles";
59+
60+
# Select internationalisation properties.
61+
i18n.defaultLocale = "en_US.UTF-8";
62+
63+
i18n.extraLocaleSettings = {
64+
LC_ADDRESS = "en_US.UTF-8";
65+
LC_IDENTIFICATION = "en_US.UTF-8";
66+
LC_MEASUREMENT = "en_US.UTF-8";
67+
LC_MONETARY = "en_US.UTF-8";
68+
LC_NAME = "en_US.UTF-8";
69+
LC_NUMERIC = "en_US.UTF-8";
70+
LC_PAPER = "en_US.UTF-8";
71+
LC_TELEPHONE = "en_US.UTF-8";
72+
LC_TIME = "en_US.UTF-8";
73+
};
74+
75+
# Enable touchpad support (enabled default in most desktopManager).
76+
# services.xserver.libinput.enable = true;
77+
78+
# Define a user account. Don't forget to set a password with ‘passwd’.
79+
users.users.das = {
80+
isNormalUser = true;
81+
description = "das";
82+
extraGroups = [ "wheel" "networkmanager" "libvirtd" ];
83+
packages = with pkgs; [
84+
];
85+
# https://nixos.wiki/wiki/SSH_public_key_authentication
86+
openssh.authorizedKeys.keys = [
87+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMCFUMSCFJX95eLfm7P9r72NBp9I1FiXwNwJ+x/HGPV das@t"
88+
];
89+
};
90+
91+
# https://nix-community.github.io/home-manager/index.xhtml#ch-installation
92+
users.users.eve.isNormalUser = true;
93+
home-manager.users.das = { pkgs, ... }: {
94+
home.packages = with pkgs; [
95+
#
96+
tmux
97+
screen
98+
#
99+
perl
100+
python3
101+
#
102+
gawk
103+
jq
104+
git
105+
htop
106+
minicom
107+
#
108+
iproute2
109+
vlan
110+
tcpdump
111+
wireshark
112+
flent
113+
iperf2
114+
bpftools
115+
iw
116+
wirelesstools
117+
wpa_supplicant_ro_ssids
118+
# go
119+
# https://nixos.wiki/wiki/Go
120+
# https://nixos.org/manual/nixpkgs/stable/#sec-language-go
121+
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
122+
libcap
123+
gcc
124+
# thunderbird
125+
go
126+
# rust
127+
# https://nixos.wiki/wiki/Rust
128+
pkgs.cargo
129+
pkgs.rustc
130+
];
131+
132+
programs.bash.enable = true;
133+
home.stateVersion = "23.11";
134+
135+
programs.vim = {
136+
enable = true;
137+
plugins = with pkgs.vimPlugins; [ vim-airline ];
138+
settings = { ignorecase = true; };
139+
extraConfig = ''
140+
set mouse=a
141+
'';
142+
};
143+
#ldflags = [
144+
# "-X main.Version=${version}"
145+
# "-X main.Commit=${version}"
146+
#];
147+
148+
programs.git = {
149+
enable = true;
150+
userEmail = "dave.seddon.ca@gmail.com";
151+
userName = "randomizedcoder ";
152+
#signing.key = "GPG-KEY-ID";
153+
#signing.signByDefault = true;
154+
};
155+
nixpkgs.config.allowUnfree = true;
156+
};
157+
158+
# Allow unfree packages
159+
nixpkgs.config.allowUnfree = true;
160+
161+
# List packages installed in system profile. To search, run:
162+
# $ nix search wget
163+
environment.systemPackages = with pkgs; [
164+
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
165+
# wget
166+
vim
167+
curl
168+
wget
169+
tcpdump
170+
iproute2
171+
pciutils
172+
usbutils
173+
iw
174+
wirelesstools
175+
wpa_supplicant_ro_ssids
176+
];
177+
178+
# Some programs need SUID wrappers, can be configured further or are
179+
# started in user sessions.
180+
# programs.mtr.enable = true;
181+
# programs.gnupg.agent = {
182+
# enable = true;
183+
# enableSSHSupport = true;
184+
# };
185+
programs.gnupg.agent = {
186+
enable = true;
187+
enableSSHSupport = true;
188+
};
189+
190+
# List services that you want to enable:
191+
192+
# Enable the OpenSSH daemon.
193+
# services.openssh.enable = true;
194+
services.openssh.enable = true;
195+
196+
197+
# Open ports in the firewall.
198+
# networking.firewall.allowedTCPPorts = [ ... ];
199+
# networking.firewall.allowedUDPPorts = [ ... ];
200+
# Or disable the firewall altogether.
201+
# networking.firewall.enable = false;
202+
203+
# This value determines the NixOS release from which the default
204+
# settings for stateful data, like file locations and database versions
205+
# on your system were taken. It‘s perfectly fine and recommended to leave
206+
# this value at the release version of the first install of this system.
207+
# Before changing this value read the documentation for this option
208+
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
209+
system.stateVersion = "23.11"; # Did you read the comment?
210+
211+
# virtualisation.libvirtd.enable = true;
212+
# programs.virt-manager.enable = true;
213+
# services.qemuGuest.enable = true;
214+
215+
# https://wiki.nixos.org/wiki/Laptop
216+
217+
}

hp0/hardware-configuration.nix

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Do not modify this file! It was generated by ‘nixos-generate-config’
2+
# and may be overwritten by future invocations. Please make changes
3+
# to /etc/nixos/configuration.nix instead.
4+
{ config, lib, pkgs, modulesPath, ... }:
5+
6+
{
7+
imports =
8+
[ (modulesPath + "/installer/scan/not-detected.nix")
9+
];
10+
11+
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
12+
boot.initrd.kernelModules = [ ];
13+
boot.kernelModules = [ "kvm-amd" ];
14+
boot.extraModulePackages = [ ];
15+
16+
fileSystems."/" =
17+
{ device = "/dev/disk/by-uuid/2d466236-2a60-448a-8d1f-eb6f06f9a3fb";
18+
fsType = "ext4";
19+
};
20+
21+
fileSystems."/boot" =
22+
{ device = "/dev/disk/by-uuid/0126-0D03";
23+
fsType = "vfat";
24+
options = [ "fmask=0022" "dmask=0022" ];
25+
};
26+
27+
swapDevices =
28+
[ { device = "/dev/disk/by-uuid/8b35fd91-a490-42f3-845b-27f2856c175e"; }
29+
];
30+
31+
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
32+
# (the default) this is the recommended approach. When using systemd-networkd it's
33+
# still possible to use this option, but it's recommended to use it in conjunction
34+
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
35+
networking.useDHCP = lib.mkDefault true;
36+
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
37+
# networking.interfaces.wlp2s0f0u10.useDHCP = lib.mkDefault true;
38+
39+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
40+
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
41+
}

hp3/configuration.nix

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+
{ config, pkgs, ... }:
6+
7+
{
8+
imports =
9+
[ # Include the results of the hardware scan.
10+
./hardware-configuration.nix
11+
];
12+
13+
# Bootloader.
14+
boot.loader.systemd-boot.enable = true;
15+
boot.loader.efi.canTouchEfiVariables = true;
16+
17+
networking.hostName = "hp3"; # Define your hostname.
18+
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
19+
20+
# Configure network proxy if necessary
21+
# networking.proxy.default = "http://user:password@proxy:port/";
22+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
23+
24+
# Enable networking
25+
networking.networkmanager.enable = true;
26+
27+
# Set your time zone.
28+
time.timeZone = "America/Los_Angeles";
29+
30+
# Select internationalisation properties.
31+
i18n.defaultLocale = "en_US.UTF-8";
32+
33+
i18n.extraLocaleSettings = {
34+
LC_ADDRESS = "en_US.UTF-8";
35+
LC_IDENTIFICATION = "en_US.UTF-8";
36+
LC_MEASUREMENT = "en_US.UTF-8";
37+
LC_MONETARY = "en_US.UTF-8";
38+
LC_NAME = "en_US.UTF-8";
39+
LC_NUMERIC = "en_US.UTF-8";
40+
LC_PAPER = "en_US.UTF-8";
41+
LC_TELEPHONE = "en_US.UTF-8";
42+
LC_TIME = "en_US.UTF-8";
43+
};
44+
45+
# Configure keymap in X11
46+
services.xserver = {
47+
layout = "us";
48+
xkbVariant = "";
49+
};
50+
51+
# Define a user account. Don't forget to set a password with ‘passwd’.
52+
users.users.das = {
53+
isNormalUser = true;
54+
description = "das";
55+
extraGroups = [ "networkmanager" "wheel" ];
56+
packages = with pkgs; [];
57+
};
58+
59+
# Allow unfree packages
60+
nixpkgs.config.allowUnfree = true;
61+
62+
# List packages installed in system profile. To search, run:
63+
# $ nix search wget
64+
environment.systemPackages = with pkgs; [
65+
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
66+
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
67+
# wget
68+
];
69+
70+
# Some programs need SUID wrappers, can be configured further or are
71+
# started in user sessions.
72+
# programs.mtr.enable = true;
73+
# programs.gnupg.agent = {
74+
# enable = true;
75+
# enableSSHSupport = true;
76+
# };
77+
programs.gnupg.agent = {
78+
enable = true;
79+
enableSSHSupport = true;
80+
};
81+
82+
# List services that you want to enable:
83+
84+
# Enable the OpenSSH daemon.
85+
# services.openssh.enable = true;
86+
services.openssh.enable = true;
87+
88+
# Open ports in the firewall.
89+
# networking.firewall.allowedTCPPorts = [ ... ];
90+
# networking.firewall.allowedUDPPorts = [ ... ];
91+
# Or disable the firewall altogether.
92+
# networking.firewall.enable = false;
93+
94+
# This value determines the NixOS release from which the default
95+
# settings for stateful data, like file locations and database versions
96+
# on your system were taken. It‘s perfectly fine and recommended to leave
97+
# this value at the release version of the first install of this system.
98+
# Before changing this value read the documentation for this option
99+
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
100+
system.stateVersion = "23.11"; # Did you read the comment?
101+
102+
}

0 commit comments

Comments
 (0)