From 72e31cd54f2176fa3ff7365b462076c5df3a20d5 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Wed, 30 Jun 2021 13:01:32 +0100 Subject: [PATCH] gAluminum nixos configuration --- gAluminum/configuration.nix | 101 +++++++++++++++++++++++++++ gAluminum/hardware-configuration.nix | 29 ++++++++ 2 files changed, 130 insertions(+) create mode 100644 gAluminum/configuration.nix create mode 100644 gAluminum/hardware-configuration.nix diff --git a/gAluminum/configuration.nix b/gAluminum/configuration.nix new file mode 100644 index 0000000..242fcd4 --- /dev/null +++ b/gAluminum/configuration.nix @@ -0,0 +1,101 @@ +{ config, pkgs, ... }: + +{ + imports = [ ./hardware-configuration.nix ]; + + nixpkgs.config.allowUnfree = true; + networking.hostName = "gAluminum"; + + time.timeZone = "Europe/London"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + # Xserver + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + # Configure keymap in X11 + services.xserver.layout = "us"; + services.xserver.xkbOptions = "eurosign:e"; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.giulio = { + description = "Giulio De Pasquale"; + isNormalUser = true; + shell = pkgs.zsh; + extraGroups = [ "wheel" "docker" "networkmanager" ]; + }; + programs.zsh.enableCompletion = true; + programs.zsh.enableBashCompletion = true; + services.dbus.packages = with pkgs; [ gnome3.dconf ]; + services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ]; + environment.systemPackages = with pkgs; [ + wget + git + pciutils + curl + virtualbox + cmake + ninja + gdb + htop + glances + tcpdump + restic + gnomeExtensions.appindicator + binutils + efibootmgr + neovim + home-manager + ]; + + fonts.fonts = with pkgs; [cascadia-code]; + + system.stateVersion = "21.05"; # Did you read the comment? + + security.pam.services.gdm.enableGnomeKeyring = true; + + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + boot.loader.systemd-boot.enable = true; + boot.initrd.luks.devices = { + root = { + device = "/dev/disk/by-uuid/c2bac3a6-0999-4e1d-a676-bf4bcafee2d4"; + preLVM = true; + allowDiscards = true; + }; + }; + + networking.wg-quick.interfaces = { + giupi = { + address = ["10.3.0.2/32"]; + privateKeyFile = "/etc/wireguard/giupi.key"; + dns = ["10.3.0.1"]; + peers = [ + { + publicKey = "I4glUMvIGjjhvQMKhwGc8copPl2t9Us/YYRjT0BKuiw="; + allowedIPs = ["0.0.0.0/0"]; + endpoint = "giugl.io:1194"; + persistentKeepalive = 25; + } + ]; + }; + }; +} + diff --git a/gAluminum/hardware-configuration.nix b/gAluminum/hardware-configuration.nix new file mode 100644 index 0000000..6be79c6 --- /dev/null +++ b/gAluminum/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/92ad62ff-627e-4fd7-9ced-0c0716d3f848"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/3008-4A28"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +}