Skip to content

Commit b5f9840

Browse files
author
dave.seddon
committed
2024_04_29 initial nix testing
1 parent 0627216 commit b5f9840

File tree

5 files changed

+383
-0
lines changed

5 files changed

+383
-0
lines changed

.trunk/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*out
2+
*logs
3+
*actions
4+
*notifications
5+
*tools
6+
plugins
7+
user_trunk.yaml
8+
user.yaml
9+
tmp

.trunk/configs/.markdownlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Prettier friendly markdownlint config (all formatting rules disabled)
2+
extends: markdownlint/style/prettier

.trunk/trunk.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
2+
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
3+
version: 0.1
4+
cli:
5+
version: 1.22.0
6+
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
7+
plugins:
8+
sources:
9+
- id: trunk
10+
ref: v1.5.0
11+
uri: https://github.com/trunk-io/plugins
12+
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
13+
runtimes:
14+
enabled:
15+
- node@18.12.1
16+
- python@3.10.8
17+
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
18+
lint:
19+
enabled:
20+
- git-diff-check
21+
- markdownlint@0.39.0
22+
- prettier@3.2.5
23+
- trufflehog@3.74.0

t14/configuration.nix

Lines changed: 308 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,308 @@
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+
8+
{ config, pkgs, ... }:
9+
10+
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
11+
12+
{
13+
imports =
14+
[ # Include the results of the hardware scan.
15+
./hardware-configuration.nix
16+
<home-manager/nixos>
17+
];
18+
19+
# Bootloader.
20+
boot.loader.systemd-boot.enable = true;
21+
boot.loader.efi.canTouchEfiVariables = true;
22+
23+
# https://nixos.wiki/wiki/Networking
24+
networking.hostName = "t14"; # Define your hostname.
25+
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
26+
27+
# Configure network proxy if necessary
28+
# networking.proxy.default = "http://user:password@proxy:port/";
29+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
30+
31+
# Enable networking
32+
networking.networkmanager.enable = true;
33+
34+
networking.hosts = {
35+
"172.16.50.216" = ["hp0"];
36+
"172.16.40.35" = ["hp1"];
37+
"172.16.40.71" = ["hp2"];
38+
};
39+
40+
# Set your time zone.
41+
time.timeZone = "America/Los_Angeles";
42+
43+
# Select internationalisation properties.
44+
i18n.defaultLocale = "en_US.UTF-8";
45+
46+
i18n.extraLocaleSettings = {
47+
LC_ADDRESS = "en_US.UTF-8";
48+
LC_IDENTIFICATION = "en_US.UTF-8";
49+
LC_MEASUREMENT = "en_US.UTF-8";
50+
LC_MONETARY = "en_US.UTF-8";
51+
LC_NAME = "en_US.UTF-8";
52+
LC_NUMERIC = "en_US.UTF-8";
53+
LC_PAPER = "en_US.UTF-8";
54+
LC_TELEPHONE = "en_US.UTF-8";
55+
LC_TIME = "en_US.UTF-8";
56+
};
57+
58+
# Enable the X11 windowing system.
59+
services.xserver.enable = true;
60+
61+
# Enable the GNOME Desktop Environment.
62+
services.xserver.displayManager.gdm.enable = true;
63+
services.xserver.desktopManager.gnome.enable = true;
64+
65+
# Configure keymap in X11
66+
services.xserver = {
67+
layout = "us";
68+
xkbVariant = "";
69+
};
70+
71+
# Enable CUPS to print documents.
72+
services.printing.enable = true;
73+
74+
# Enable sound with pipewire.
75+
sound.enable = true;
76+
hardware.pulseaudio.enable = false;
77+
security.rtkit.enable = true;
78+
services.pipewire = {
79+
enable = true;
80+
alsa.enable = true;
81+
alsa.support32Bit = true;
82+
pulse.enable = true;
83+
# If you want to use JACK applications, uncomment this
84+
#jack.enable = true;
85+
86+
# use the example session manager (no others are packaged yet so this is enabled by default,
87+
# no need to redefine it in your config for now)
88+
#media-session.enable = true;
89+
};
90+
91+
# Enable touchpad support (enabled default in most desktopManager).
92+
# services.xserver.libinput.enable = true;
93+
94+
# Define a user account. Don't forget to set a password with ‘passwd’.
95+
users.users.das = {
96+
isNormalUser = true;
97+
description = "das";
98+
extraGroups = [ "wheel" "networkmanager" "libvirtd" ];
99+
packages = with pkgs; [
100+
];
101+
# https://nixos.wiki/wiki/SSH_public_key_authentication
102+
openssh.authorizedKeys.keys = [
103+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMCFUMSCFJX95eLfm7P9r72NBp9I1FiXwNwJ+x/HGPV das@t"
104+
];
105+
};
106+
107+
# https://nix-community.github.io/home-manager/index.xhtml#ch-installation
108+
users.users.eve.isNormalUser = true;
109+
home-manager.users.das = { pkgs, ... }: {
110+
home.packages = with pkgs; [
111+
# terminals
112+
gnome.gnome-terminal
113+
alacritty
114+
#warp-terminal
115+
#
116+
tmux
117+
screen
118+
#
119+
perl
120+
python3
121+
#
122+
gawk
123+
jq
124+
git
125+
htop
126+
minicom
127+
#
128+
firefox
129+
brave
130+
google-chrome
131+
slack
132+
#
133+
meld
134+
gedit
135+
trunk-io
136+
flameshot
137+
#
138+
iproute2
139+
vlan
140+
tcpdump
141+
wireshark
142+
flent
143+
iperf2
144+
bpftools
145+
#
146+
gnuradio
147+
#
148+
vlc
149+
# go
150+
# https://nixos.wiki/wiki/Go
151+
# https://nixos.org/manual/nixpkgs/stable/#sec-language-go
152+
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
153+
libcap
154+
gcc
155+
# thunderbird
156+
go
157+
# rust
158+
# https://nixos.wiki/wiki/Rust
159+
pkgs.cargo
160+
pkgs.rustc
161+
#
162+
flutter
163+
android-studio
164+
android-tools
165+
android-udev-rules
166+
#
167+
libreoffice-qt
168+
hunspell
169+
hunspellDicts.en_AU
170+
#hunspellDicts.en_US
171+
gnomeExtensions.system-monitor
172+
];
173+
174+
# vscode
175+
# https://nixos.wiki/wiki/Visual_Studio_Code
176+
programs.vscode = {
177+
enable = true;
178+
package = pkgs.vscode;
179+
extensions = with pkgs.vscode-extensions; [
180+
bbenoist.nix
181+
dart-code.dart-code
182+
dart-code.flutter
183+
golang.go
184+
hashicorp.terraform
185+
#k6.k6
186+
ms-azuretools.vscode-docker
187+
ms-vscode-remote.remote-containers
188+
ms-vscode-remote.remote-ssh
189+
#ms-vscode-remote.remote-ssh-edit
190+
ms-vscode.cmake-tools
191+
ms-vscode.cpptools
192+
#ms-vscode.cpptools-extension-pack
193+
#ms-vscode.cpptools-themes
194+
ms-vscode.hexeditor
195+
ms-vscode.makefile-tools
196+
ms-python.python
197+
ms-python.vscode-pylance
198+
#ms-vscode.remote-explorer
199+
#ms-vscode.remote-repositories
200+
#ms-vscode.remote-server
201+
redhat.vscode-yaml
202+
rust-lang.rust-analyzer
203+
serayuzgur.crates
204+
tamasfe.even-better-toml
205+
timonwong.shellcheck
206+
#trunk.io
207+
zxh404.vscode-proto3
208+
yzhang.markdown-all-in-one
209+
#platformio.platformio-ide
210+
github.copilot
211+
# nix
212+
#brettm12345.nixfmt.vscode
213+
jnoortheen.nix-ide
214+
#jeff-hykin.better-nix-syntax
215+
];
216+
};
217+
programs.bash.enable = true;
218+
home.stateVersion = "23.11";
219+
# https://nixos.wiki/wiki/GNOME
220+
dconf = {
221+
enable = true;
222+
settings = {
223+
"org/gnome/desktop/interface".color-scheme = "prefer-dark";
224+
"org/virt-manager/virt-manager/connections" = {
225+
autoconnect = ["qemu:///system"];
226+
uris = ["qemu:///system"];
227+
};
228+
};
229+
};
230+
programs.vim = {
231+
enable = true;
232+
plugins = with pkgs.vimPlugins; [ vim-airline ];
233+
settings = { ignorecase = true; };
234+
extraConfig = ''
235+
set mouse=a
236+
'';
237+
};
238+
#ldflags = [
239+
# "-X main.Version=${version}"
240+
# "-X main.Commit=${version}"
241+
#];
242+
243+
programs.git = {
244+
enable = true;
245+
userEmail = "dave.seddon.ca@gmail.com";
246+
userName = "randomizedcoder ";
247+
#signing.key = "GPG-KEY-ID";
248+
#signing.signByDefault = true;
249+
};
250+
nixpkgs.config.allowUnfree = true;
251+
};
252+
253+
# Allow unfree packages
254+
nixpkgs.config.allowUnfree = true;
255+
256+
# List packages installed in system profile. To search, run:
257+
# $ nix search wget
258+
environment.systemPackages = with pkgs; [
259+
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
260+
# wget
261+
vim
262+
curl
263+
wget
264+
tcpdump
265+
iproute2
266+
pciutils
267+
];
268+
269+
# Some programs need SUID wrappers, can be configured further or are
270+
# started in user sessions.
271+
# programs.mtr.enable = true;
272+
# programs.gnupg.agent = {
273+
# enable = true;
274+
# enableSSHSupport = true;
275+
# };
276+
programs.gnupg.agent = {
277+
enable = true;
278+
enableSSHSupport = true;
279+
};
280+
281+
# List services that you want to enable:
282+
283+
# Enable the OpenSSH daemon.
284+
# services.openssh.enable = true;
285+
services.openssh.enable = true;
286+
287+
288+
# Open ports in the firewall.
289+
# networking.firewall.allowedTCPPorts = [ ... ];
290+
# networking.firewall.allowedUDPPorts = [ ... ];
291+
# Or disable the firewall altogether.
292+
# networking.firewall.enable = false;
293+
294+
# This value determines the NixOS release from which the default
295+
# settings for stateful data, like file locations and database versions
296+
# on your system were taken. It‘s perfectly fine and recommended to leave
297+
# this value at the release version of the first install of this system.
298+
# Before changing this value read the documentation for this option
299+
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
300+
system.stateVersion = "23.11"; # Did you read the comment?
301+
302+
virtualisation.libvirtd.enable = true;
303+
programs.virt-manager.enable = true;
304+
# services.qemuGuest.enable = true;
305+
306+
# https://wiki.nixos.org/wiki/Laptop
307+
308+
}

t14/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 = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
12+
boot.initrd.kernelModules = [ ];
13+
boot.kernelModules = [ "kvm-amd" ];
14+
boot.extraModulePackages = [ ];
15+
16+
fileSystems."/" =
17+
{ device = "/dev/disk/by-uuid/adb8ae55-949c-44b3-8abe-7584d2194c17";
18+
fsType = "ext4";
19+
};
20+
21+
fileSystems."/boot" =
22+
{ device = "/dev/disk/by-uuid/A1E4-3942";
23+
fsType = "vfat";
24+
options = [ "fmask=0022" "dmask=0022" ];
25+
};
26+
27+
swapDevices =
28+
[ { device = "/dev/disk/by-uuid/1a243657-4913-4220-94da-7ef97d4c7966"; }
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.enp2s0f0.useDHCP = lib.mkDefault true;
37+
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
38+
39+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
40+
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
41+
}

0 commit comments

Comments
 (0)