···11+# Edit this configuration file to define what should be installed on
22+# your system. Help is available in the configuration.nix(5) man page, on
33+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
44+55+{ config, lib, pkgs, ... }:
66+77+{
88+ imports = [
99+ ./hardware-configuration.nix
1010+ ./disko.nix
1111+ ];
1212+ system.stateVersion = "23.11";
1313+ networking.hostName = "laptop";
1414+}
+56
hardware/laptop/disko.nix
···11+{
22+ disko.devices = {
33+ disk = {
44+ vdb = {
55+ device = "/dev/disk/by-id/nvme-WDSN740-SDDPNQD-512G-1004_23360G804890";
66+ type = "disk";
77+ content = {
88+ type = "gpt";
99+ partitions = {
1010+ ESP = {
1111+ type = "EF00";
1212+ size = "512M";
1313+ content = {
1414+ type = "filesystem";
1515+ format = "vfat";
1616+ mountpoint = "/boot";
1717+ };
1818+ };
1919+ root = {
2020+ size = "100%";
2121+ content = {
2222+ type = "btrfs";
2323+ extraArgs = [ "-f" ]; # Override existing partition
2424+ # Subvolumes must set a mountpoint in order to be mounted,
2525+ # unless their parent is mounted
2626+ subvolumes = {
2727+ # Subvolume name is different from mountpoint
2828+ "@" = {
2929+ mountOptions = [ "compress=zstd" ];
3030+ mountpoint = "/";
3131+ };
3232+ # Subvolume name is the same as the mountpoint
3333+ "@home" = {
3434+ mountOptions = [ "compress=zstd" ];
3535+ mountpoint = "/home";
3636+ };
3737+ # Parent is not mounted so the mountpoint must be set
3838+ "@nix" = {
3939+ mountOptions = [ "compress=zstd" "noatime" ];
4040+ mountpoint = "/nix";
4141+ };
4242+ "@swap" = {
4343+ mountpoint = "/.swapvol";
4444+ swap = {
4545+ swapfile.size = "17G";
4646+ };
4747+ };
4848+ };
4949+ };
5050+ };
5151+ };
5252+ };
5353+ };
5454+ };
5555+ };
5656+}
+26
hardware/laptop/hardware-configuration.nix
···11+# Do not modify this file! It was generated by ‘nixos-generate-config’
22+# and may be overwritten by future invocations. Please make changes
33+# to /etc/nixos/configuration.nix instead.
44+{ config, lib, pkgs, modulesPath, ... }:
55+66+{
77+ imports =
88+ [
99+ (modulesPath + "/installer/scan/not-detected.nix")
1010+ ];
1111+1212+ boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" "rtsx_usb_sdmmc" ];
1313+ boot.initrd.kernelModules = [ ];
1414+ boot.kernelModules = [ "kvm-intel" ];
1515+ boot.extraModulePackages = [ ];
1616+1717+ # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
1818+ # (the default) this is the recommended approach. When using systemd-networkd it's
1919+ # still possible to use this option, but it's recommended to use it in conjunction
2020+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
2121+ networking.useDHCP = lib.mkDefault true;
2222+ # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
2323+2424+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
2525+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
2626+}
+105
traits/base.nix
···11+# Edit this configuration file to define what should be installed on
22+# your system. Help is available in the configuration.nix(5) man page, on
33+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
44+55+{ config, lib, pkgs, ... }:
66+77+{
88+ # Use the systemd-boot EFI boot loader.
99+ boot.loader.systemd-boot.enable = true;
1010+ boot.loader.efi.canTouchEfiVariables = true;
1111+1212+ # networking.hostName = "nixos"; # Define your hostname.
1313+ # Pick only one of the below networking options.
1414+ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
1515+ # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
1616+1717+ # Set your time zone.
1818+ # time.timeZone = "Europe/Amsterdam";
1919+2020+ # Configure network proxy if necessary
2121+ # networking.proxy.default = "http://user:password@proxy:port/";
2222+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
2323+2424+ # Select internationalisation properties.
2525+ # i18n.defaultLocale = "en_US.UTF-8";
2626+ # console = {
2727+ # font = "Lat2-Terminus16";
2828+ # keyMap = "us";
2929+ # useXkbConfig = true; # use xkb.options in tty.
3030+ # };
3131+3232+ # Enable the X11 windowing system.
3333+ services.xserver.enable = true;
3434+3535+ # Configure keymap in X11
3636+ # services.xserver.xkb.layout = "us";
3737+ # services.xserver.xkb.options = "eurosign:e,caps:escape";
3838+3939+ # Enable CUPS to print documents.
4040+ # services.printing.enable = true;
4141+4242+ # Enable sound.
4343+ # sound.enable = true;
4444+ # hardware.pulseaudio.enable = true;
4545+4646+ # Enable touchpad support (enabled default in most desktopManager).
4747+ # services.xserver.libinput.enable = true;
4848+4949+ # Define a user account. Don't forget to set a password with ‘passwd’.
5050+ # users.users.alice = {
5151+ # isNormalUser = true;
5252+ # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
5353+ # packages = with pkgs; [
5454+ # firefox
5555+ # tree
5656+ # ];
5757+ # };
5858+5959+ # Some programs need SUID wrappers, can be configured further or are
6060+ # started in user sessions.
6161+ # programs.mtr.enable = true;
6262+ # programs.gnupg.agent = {
6363+ # enable = true;
6464+ # enableSSHSupport = true;
6565+ # };
6666+6767+ # List services that you want to enable:
6868+6969+ # Enable the OpenSSH daemon.
7070+ # services.openssh.enable = true;
7171+7272+ # Open ports in the firewall.
7373+ # networking.firewall.allowedTCPPorts = [ ... ];
7474+ # networking.firewall.allowedUDPPorts = [ ... ];
7575+ # Or disable the firewall altogether.
7676+ # networking.firewall.enable = false;
7777+7878+ # Copy the NixOS configuration file and link it from the resulting system
7979+ # (/run/current-system/configuration.nix). This is useful in case you
8080+ # accidentally delete configuration.nix.
8181+ # system.copySystemConfiguration = true;
8282+8383+ # Programs
8484+ programs.zsh.enable = true;
8585+ environment.systemPackages = with pkgs; [
8686+ vim
8787+ wget
8888+ ];
8989+9090+ # Package manager
9191+ nix = {
9292+ package = pkgs.nixFlakes;
9393+ extraOptions = ''
9494+ experimental-features = flakes nix-command
9595+ '';
9696+ };
9797+9898+ # Internationalization
9999+ time.timeZone = "America/Sao_Paulo";
100100+ i18n.defaultLocale = "en_US.UTF-8";
101101+ time.hardwareClockInLocalTime = true;
102102+103103+ # Graphics
104104+ hardware.opengl.enable = true;
105105+}
+8
traits/gnome.nix
···11+# Use the GNOME desktop environment
22+33+{ ... }:
44+55+{
66+ services.xserver.displayManager.gdm.enable = true;
77+ services.xserver.desktopManager.gnome.enable = true;
88+}