From 546764962f7bb47eb72d108a8db195151c59f556 Mon Sep 17 00:00:00 2001 From: Ari Date: Tue, 6 Feb 2024 21:58:02 -0500 Subject: [PATCH] bu --- nixos-bu/configuration.nix | 21 +++++++++++++++++++++ nixos-bu/k3s.nix | 29 +++++++++++++++++++++++++++++ nixos-bu/settings.nix | 19 +++++++++++++++++++ nixos-bu/users.nix | 21 +++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 nixos-bu/configuration.nix create mode 100644 nixos-bu/k3s.nix create mode 100644 nixos-bu/settings.nix create mode 100644 nixos-bu/users.nix diff --git a/nixos-bu/configuration.nix b/nixos-bu/configuration.nix new file mode 100644 index 0000000..e3cf690 --- /dev/null +++ b/nixos-bu/configuration.nix @@ -0,0 +1,21 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./k3s.nix + ./users.nix + ./settings.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + networking.hostName = "minisf1"; # Define your hostname. + system.stateVersion = "23.05"; # Did you read the comment? + +} diff --git a/nixos-bu/k3s.nix b/nixos-bu/k3s.nix new file mode 100644 index 0000000..a119115 --- /dev/null +++ b/nixos-bu/k3s.nix @@ -0,0 +1,29 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + # Bootloader. + boot.initrd = { + supportedFilesystems = [ "nfs" ]; + kernelModules = [ "nfs" ]; + }; + i18n.defaultLocale = "en_CA.UTF-8"; + services.nfs.server.enable = true; + services.rpcbind.enable = true; + environment.systemPackages = with pkgs; [ + pkgs.k3s + nfs-utils + dig + argocd + pkgs.git + ]; + services.k3s.enable = true; + services.k3s.role = "server"; + services.k3s.extraFlags = toString [ + ]; + networking.firewall.allowedTCPPorts = [ 22 80 443 ]; + networking.firewall.allowedUDPPorts = [ 80 443 ]; +} diff --git a/nixos-bu/settings.nix b/nixos-bu/settings.nix new file mode 100644 index 0000000..7c83a2b --- /dev/null +++ b/nixos-bu/settings.nix @@ -0,0 +1,19 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + # Bootloader. + networking.networkmanager.enable = true; + time.timeZone = "America/Toronto"; + i18n.defaultLocale = "en_CA.UTF-8"; + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + nixpkgs.config.allowUnfree = true; + services.openssh.enable = true; + networking.firewall.enable = false; +} diff --git a/nixos-bu/users.nix b/nixos-bu/users.nix new file mode 100644 index 0000000..3e3d8ff --- /dev/null +++ b/nixos-bu/users.nix @@ -0,0 +1,21 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + users.users.ari = { + isNormalUser = true; + description = "Ari"; + extraGroups = [ "networkmanager" "wheel" "root" ]; + packages = with pkgs; []; + }; + + environment.systemPackages = with pkgs; [ + pciutils + usbutils + jq + ]; + +}