diff --git a/flake.nix b/flake.nix index 9f072c5..404b2c0 100644 --- a/flake.nix +++ b/flake.nix @@ -109,6 +109,7 @@ }; nixosConfigurations = lib.mapAttrs buildHost { + aramis = "x86_64-linux"; porthos = "x86_64-linux"; }; }; diff --git a/machines/aramis/boot.nix b/machines/aramis/boot.nix new file mode 100644 index 0000000..2169da5 --- /dev/null +++ b/machines/aramis/boot.nix @@ -0,0 +1,32 @@ +{ ... }: +{ + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + initrd = { + availableKernelModules = [ + "nvme" + "sd_mod" + "sdhci_pci" + "usb_storage" + "usbhid" + "xhci_pci" + ]; + kernelModules = [ + "dm-snapshot" + ]; + luks.devices.crypt = { + device = "/dev/nvme0n1p1"; + preLVM = true; + }; + }; + + kernelModules = [ + "kvm-intel" + ]; + extraModulePackages = [ ]; + }; +} diff --git a/machines/aramis/default.nix b/machines/aramis/default.nix new file mode 100644 index 0000000..67486d1 --- /dev/null +++ b/machines/aramis/default.nix @@ -0,0 +1,38 @@ +# 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 = [ + ./boot.nix + ./hardware.nix + ./networking.nix + ./sound.nix + ]; + + # Set your time zone. + time.timeZone = "Europe/Paris"; + + # Enable the X11 windowing system. + # services.xserver.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 touchpad support (enabled default in most desktopManager). + services.xserver.libinput.enable = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "20.09"; # Did you read the comment? +} diff --git a/machines/aramis/hardware.nix b/machines/aramis/hardware.nix new file mode 100644 index 0000000..86eaf28 --- /dev/null +++ b/machines/aramis/hardware.nix @@ -0,0 +1,26 @@ +{ lib, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + hardware.cpu.intel.updateMicrocode = true; +} diff --git a/machines/aramis/networking.nix b/machines/aramis/networking.nix new file mode 100644 index 0000000..752fc8c --- /dev/null +++ b/machines/aramis/networking.nix @@ -0,0 +1,21 @@ +{ ... }: +{ + networking = { + hostName = "aramis"; + domain = "nodomain.local"; # FIXME: gotta fix domain handling + wireless.enable = true; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + useDHCP = false; + + interfaces = { + enp0s31f6.useDHCP = true; + wlp0s20f3.useDHCP = true; + }; + }; + + # Which interface is used to connect to the internet + my.networking.externalInterface = "enp0s3"; +} diff --git a/machines/aramis/sound.nix b/machines/aramis/sound.nix new file mode 100644 index 0000000..38365f6 --- /dev/null +++ b/machines/aramis/sound.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + sound.enable = true; + hardware.pulseaudio.enable = true; +}