Skip to content

Commit b4d2dfe

Browse files
Merge pull request #2 from randomizedcoder/2024_04_29
2024 04 29
2 parents 24213ce + 335600a commit b4d2dfe

File tree

7 files changed

+529
-6
lines changed

7 files changed

+529
-6
lines changed

hp0/configuration.nix

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
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 vim
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.40.198" = ["hp0"];
53+
# "172.16.40.35" = ["hp1"];
54+
# "172.16.40.71" = ["hp2"];
55+
"172.16.40.146" = ["hp3"];
56+
};
57+
58+
# Set your time zone.
59+
time.timeZone = "America/Los_Angeles";
60+
61+
# Select internationalisation properties.
62+
i18n.defaultLocale = "en_US.UTF-8";
63+
64+
i18n.extraLocaleSettings = {
65+
LC_ADDRESS = "en_US.UTF-8";
66+
LC_IDENTIFICATION = "en_US.UTF-8";
67+
LC_MEASUREMENT = "en_US.UTF-8";
68+
LC_MONETARY = "en_US.UTF-8";
69+
LC_NAME = "en_US.UTF-8";
70+
LC_NUMERIC = "en_US.UTF-8";
71+
LC_PAPER = "en_US.UTF-8";
72+
LC_TELEPHONE = "en_US.UTF-8";
73+
LC_TIME = "en_US.UTF-8";
74+
};
75+
76+
# Enable touchpad support (enabled default in most desktopManager).
77+
# services.xserver.libinput.enable = true;
78+
79+
# Define a user account. Don't forget to set a password with ‘passwd’.
80+
users.users.das = {
81+
isNormalUser = true;
82+
description = "das";
83+
extraGroups = [ "wheel" "networkmanager" "libvirtd" ];
84+
packages = with pkgs; [
85+
];
86+
# https://nixos.wiki/wiki/SSH_public_key_authentication
87+
openssh.authorizedKeys.keys = [
88+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMCFUMSCFJX95eLfm7P9r72NBp9I1FiXwNwJ+x/HGPV das@t"
89+
];
90+
};
91+
92+
# https://nix-community.github.io/home-manager/index.xhtml#ch-installation
93+
users.users.eve.isNormalUser = true;
94+
home-manager.users.das = { pkgs, ... }: {
95+
home.packages = with pkgs; [
96+
#
97+
tmux
98+
screen
99+
#
100+
perl
101+
python3
102+
#
103+
gawk
104+
jq
105+
git
106+
htop
107+
minicom
108+
#
109+
iproute2
110+
vlan
111+
tcpdump
112+
wireshark
113+
flent
114+
iperf2
115+
bpftools
116+
iw
117+
wirelesstools
118+
wpa_supplicant_ro_ssids
119+
# go
120+
# https://nixos.wiki/wiki/Go
121+
# https://nixos.org/manual/nixpkgs/stable/#sec-language-go
122+
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
123+
libcap
124+
gcc
125+
# thunderbird
126+
go
127+
# rust
128+
# https://nixos.wiki/wiki/Rust
129+
pkgs.cargo
130+
pkgs.rustc
131+
];
132+
133+
programs.bash.enable = true;
134+
home.stateVersion = "23.11";
135+
136+
programs.vim = {
137+
enable = true;
138+
plugins = with pkgs.vimPlugins; [ vim-airline ];
139+
settings = { ignorecase = true; };
140+
extraConfig = ''
141+
set mouse=a
142+
'';
143+
};
144+
#ldflags = [
145+
# "-X main.Version=${version}"
146+
# "-X main.Commit=${version}"
147+
#];
148+
149+
programs.git = {
150+
enable = true;
151+
userEmail = "dave.seddon.ca@gmail.com";
152+
userName = "randomizedcoder ";
153+
#signing.key = "GPG-KEY-ID";
154+
#signing.signByDefault = true;
155+
};
156+
nixpkgs.config.allowUnfree = true;
157+
};
158+
159+
# Allow unfree packages
160+
nixpkgs.config.allowUnfree = true;
161+
162+
# List packages installed in system profile. To search, run:
163+
# $ nix search wget
164+
environment.systemPackages = with pkgs; [
165+
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
166+
# wget
167+
vim
168+
curl
169+
wget
170+
tcpdump
171+
iproute2
172+
pciutils
173+
usbutils
174+
iw
175+
wirelesstools
176+
wpa_supplicant_ro_ssids
177+
];
178+
179+
# Some programs need SUID wrappers, can be configured further or are
180+
# started in user sessions.
181+
# programs.mtr.enable = true;
182+
# programs.gnupg.agent = {
183+
# enable = true;
184+
# enableSSHSupport = true;
185+
# };
186+
programs.gnupg.agent = {
187+
enable = true;
188+
enableSSHSupport = true;
189+
};
190+
191+
# List services that you want to enable:
192+
193+
# Enable the OpenSSH daemon.
194+
# services.openssh.enable = true;
195+
services.openssh.enable = true;
196+
197+
198+
# Open ports in the firewall.
199+
# networking.firewall.allowedTCPPorts = [ ... ];
200+
# networking.firewall.allowedUDPPorts = [ ... ];
201+
# Or disable the firewall altogether.
202+
# networking.firewall.enable = false;
203+
204+
# This value determines the NixOS release from which the default
205+
# settings for stateful data, like file locations and database versions
206+
# on your system were taken. It‘s perfectly fine and recommended to leave
207+
# this value at the release version of the first install of this system.
208+
# Before changing this value read the documentation for this option
209+
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
210+
system.stateVersion = "23.11"; # Did you read the comment?
211+
212+
# virtualisation.libvirtd.enable = true;
213+
# programs.virt-manager.enable = true;
214+
# services.qemuGuest.enable = true;
215+
216+
# https://wiki.nixos.org/wiki/Laptop
217+
218+
}

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+
}

hp0/wireless.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PSK_DEVICES=performance

0 commit comments

Comments
 (0)