summaryrefslogtreecommitdiff
path: root/nix/lenovo-base
diff options
context:
space:
mode:
Diffstat (limited to 'nix/lenovo-base')
-rw-r--r--nix/lenovo-base/base.nix28
-rw-r--r--nix/lenovo-base/configuration.nix20
-rw-r--r--nix/lenovo-base/desktop.nix90
-rw-r--r--nix/lenovo-base/hardware-configuration.nix33
-rw-r--r--nix/lenovo-base/local.example.nix5
-rw-r--r--nix/lenovo-base/local.nix9
-rw-r--r--nix/lenovo-base/nextdns.nix18
-rw-r--r--nix/lenovo-base/packages.nix23
-rw-r--r--nix/lenovo-base/users.nix19
-rw-r--r--nix/lenovo-base/virtualisation.nix18
10 files changed, 263 insertions, 0 deletions
diff --git a/nix/lenovo-base/base.nix b/nix/lenovo-base/base.nix
new file mode 100644
index 0000000..69173c9
--- /dev/null
+++ b/nix/lenovo-base/base.nix
@@ -0,0 +1,28 @@
+
+{ pkgs, ... }:
+
+let
+ local = import ./local.nix;
+in
+
+{
+ # Boot
+ boot.loader = {
+ systemd-boot.enable = true;
+ efi.canTouchEfiVariables = true;
+ };
+
+ boot.kernelPackages = pkgs.linuxPackages_latest;
+
+ # Networking
+ networking.networkmanager.enable = true;
+ networking.firewall.enable = true;
+ networking.hosts = local.hosts or {};
+
+ # Locale
+ time.timeZone = "America/Chicago";
+ i18n.defaultLocale = "en_US.UTF-8";
+
+ # Package policy
+ nixpkgs.config.allowUnfree = true;
+}
diff --git a/nix/lenovo-base/configuration.nix b/nix/lenovo-base/configuration.nix
new file mode 100644
index 0000000..90108e3
--- /dev/null
+++ b/nix/lenovo-base/configuration.nix
@@ -0,0 +1,20 @@
+
+{ ... }:
+
+{
+ imports = [
+ ./hardware-configuration.nix
+ ./base.nix
+ ./desktop.nix
+ ./users.nix
+ ./packages.nix
+ ./virtualisation.nix
+ ./nextdns.nix
+ ];
+
+ networking.hostName = "nixos";
+
+ # Preserve the version from the original installation.
+ # Do not change this when upgrading NixOS.
+ system.stateVersion = "26.11";
+}
diff --git a/nix/lenovo-base/desktop.nix b/nix/lenovo-base/desktop.nix
new file mode 100644
index 0000000..416101c
--- /dev/null
+++ b/nix/lenovo-base/desktop.nix
@@ -0,0 +1,90 @@
+
+{ ... }:
+
+{
+ # Desktop environment
+ services.displayManager.gdm.enable = true;
+ services.desktopManager.gnome.enable = true;
+
+ # Keyboard
+ services.xserver.xkb = {
+ layout = "us";
+ options = "ctrl:nocaps";
+ };
+
+ # Printing
+ services.printing.enable = true;
+
+ # Audio
+ services.pulseaudio.enable = false;
+ security.rtkit.enable = true;
+
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+
+ # Browser
+ programs.firefox = {
+ enable = true;
+ policies = {
+ DNSOverHTTPS = {
+ Enabled = false;
+ Locked = true;
+ };
+ };
+ };
+
+ # GNOME preferences
+ programs.dconf = {
+ enable = true;
+ profiles.user.databases = [
+ {
+ settings = {
+ "org/gnome/desktop/input-sources" = {
+ xkb-options = [ "ctrl:nocaps" ];
+ };
+
+ "org/gnome/Console" = {
+ use-system-font = false;
+ custom-font = "Adwaita Mono 24";
+ theme = "night";
+ audible-bell = false;
+ visual-bell = false;
+ ignore-scrollback-limit = true;
+ restore-window-size = true;
+ last-window-maximised = true;
+ transparency = false;
+ software-flow-control = false;
+ };
+
+ "org/gnome/desktop/interface" = {
+ cursor-blink = false;
+ };
+
+ # Global keyboard shortcuts
+ "org/gnome/settings-daemon/plugins/media-keys" = {
+ custom-keybindings = [
+ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
+ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/firefox/"
+ ];
+ };
+
+ "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = {
+ name = "Launch Terminal";
+ command = "kgx";
+ binding = "<Alt>u";
+ };
+
+ "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/firefox" = {
+ name = "Launch Firefox";
+ command = "firefox";
+ binding = "<Alt>c";
+ };
+ };
+ }
+ ];
+ };
+}
diff --git a/nix/lenovo-base/hardware-configuration.nix b/nix/lenovo-base/hardware-configuration.nix
new file mode 100644
index 0000000..a3d96a8
--- /dev/null
+++ b/nix/lenovo-base/hardware-configuration.nix
@@ -0,0 +1,33 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/mapper/luks-f1b9890c-eaf0-4032-a57d-206757187dc4";
+ fsType = "ext4";
+ };
+
+ boot.initrd.luks.devices."luks-f1b9890c-eaf0-4032-a57d-206757187dc4".device = "/dev/disk/by-uuid/f1b9890c-eaf0-4032-a57d-206757187dc4";
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/9901-D4A1";
+ fsType = "vfat";
+ options = [ "fmask=0077" "dmask=0077" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/nix/lenovo-base/local.example.nix b/nix/lenovo-base/local.example.nix
new file mode 100644
index 0000000..238d642
--- /dev/null
+++ b/nix/lenovo-base/local.example.nix
@@ -0,0 +1,5 @@
+{
+ nextdnsProfile = "YOUR_CONFIG_ID";
+
+ hosts = {};
+}
diff --git a/nix/lenovo-base/local.nix b/nix/lenovo-base/local.nix
new file mode 100644
index 0000000..9ac5bdb
--- /dev/null
+++ b/nix/lenovo-base/local.nix
@@ -0,0 +1,9 @@
+{
+ nextdnsProfile = "YOUR_CONFIG_ID";
+
+ # > virsh domifaddr dev to get ip
+ # hosts = {
+ # "192.168.122.179" = [ "dev" ];
+ # };
+ hosts = {};
+}
diff --git a/nix/lenovo-base/nextdns.nix b/nix/lenovo-base/nextdns.nix
new file mode 100644
index 0000000..071c708
--- /dev/null
+++ b/nix/lenovo-base/nextdns.nix
@@ -0,0 +1,18 @@
+
+{ ... }:
+
+let
+ local = import ./local.nix;
+in
+{
+ services.nextdns = {
+ enable = true;
+
+ arguments = [
+ "-config" local.nextdnsProfile
+ "-cache-size" "10MB"
+ "-report-client-info"
+ "-auto-activate"
+ ];
+ };
+}
diff --git a/nix/lenovo-base/packages.nix b/nix/lenovo-base/packages.nix
new file mode 100644
index 0000000..3654ac6
--- /dev/null
+++ b/nix/lenovo-base/packages.nix
@@ -0,0 +1,23 @@
+
+{ pkgs, ... }:
+
+{
+ programs.git.enable = true;
+ programs.tmux.enable = true;
+
+ programs.gnupg.agent = {
+ enable = true;
+ enableSSHSupport = false;
+ pinentryPackage = pkgs.pinentry-curses;
+ };
+
+ environment.variables.EDITOR = "emacs";
+
+ environment.systemPackages = with pkgs; [
+ delta
+ emacs-nox
+ keychain
+ pass
+ wget
+ ];
+}
diff --git a/nix/lenovo-base/users.nix b/nix/lenovo-base/users.nix
new file mode 100644
index 0000000..41be7b4
--- /dev/null
+++ b/nix/lenovo-base/users.nix
@@ -0,0 +1,19 @@
+
+{ pkgs, ... }:
+
+{
+ programs.fish.enable = true;
+
+ users.users.brad = {
+ isNormalUser = true;
+ description = "Brad Clawsie";
+ shell = pkgs.fish;
+
+ extraGroups = [
+ "networkmanager"
+ "wheel"
+ "libvirtd"
+ "kvm"
+ ];
+ };
+}
diff --git a/nix/lenovo-base/virtualisation.nix b/nix/lenovo-base/virtualisation.nix
new file mode 100644
index 0000000..80b121b
--- /dev/null
+++ b/nix/lenovo-base/virtualisation.nix
@@ -0,0 +1,18 @@
+
+{ pkgs, ... }:
+
+{
+ virtualisation.libvirtd = {
+ enable = true;
+ qemu.runAsRoot = false;
+ };
+
+ programs.virt-manager.enable = false;
+
+ environment.variables.LIBVIRT_DEFAULT_URI = "qemu:///system";
+
+ environment.systemPackages = with pkgs; [
+ libvirt
+ virt-manager
+ ];
+}