diff --git a/hostconfig/default.nix b/hostconfig/default.nix index 1998632..219701a 100644 --- a/hostconfig/default.nix +++ b/hostconfig/default.nix @@ -56,5 +56,6 @@ ./ZeNixComputa ./minus ./thinkpad-nixos + ./laptop ]; } diff --git a/hostconfig/laptop/default.nix b/hostconfig/laptop/default.nix new file mode 100644 index 0000000..9d6e8ad --- /dev/null +++ b/hostconfig/laptop/default.nix @@ -0,0 +1,27 @@ +{ self, makeMachine, ... }: +{ + flake.nixosConfigurations.laptop = makeMachine { + system = "x86_64-linux"; + user = "traxys"; + nixosModules = with self.nixosModules; [ + ./extra_info.nix + ./nixos.nix + ./hardware-configuration.nix + minimal + personal-cli + personal-gui + ]; + hmModules = with self.hmModules; [ + ./extra_info.nix + ./hm.nix + minimal + personal-cli + personal-gui + ]; + unfreePackages = [ + "cnijfilter2" + "spotify" + "discord" + ]; + }; +} diff --git a/hostconfig/laptop/extra_info.nix b/hostconfig/laptop/extra_info.nix new file mode 100644 index 0000000..709ea3f --- /dev/null +++ b/hostconfig/laptop/extra_info.nix @@ -0,0 +1,4 @@ +{ + extraInfo.username = "traxys"; + extraInfo.email = "quentin+dev@familleboyer.net"; +} diff --git a/hostconfig/laptop/hardware-configuration.nix b/hostconfig/laptop/hardware-configuration.nix new file mode 100644 index 0000000..d95ed9d --- /dev/null +++ b/hostconfig/laptop/hardware-configuration.nix @@ -0,0 +1,42 @@ +# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/881aed94-7e35-4db1-9237-33635e6b1c4f"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + boot.initrd.luks.devices."luks-3415853c-c124-4dc1-9ca4-f980ae3a732b".device = "/dev/disk/by-uuid/3415853c-c124-4dc1-9ca4-f980ae3a732b"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/79DC-3378"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hostconfig/laptop/hm.nix b/hostconfig/laptop/hm.nix new file mode 100644 index 0000000..39c4c4c --- /dev/null +++ b/hostconfig/laptop/hm.nix @@ -0,0 +1,10 @@ +{ config, ... }: +{ + programs.git = { + userName = "Quentin Boyer"; + userEmail = config.extraInfo.email; + }; + + traxys.waybar.modules.battery.enable = true; + home.stateVersion = "24.11"; +} diff --git a/hostconfig/laptop/nixos.nix b/hostconfig/laptop/nixos.nix new file mode 100644 index 0000000..51fdc39 --- /dev/null +++ b/hostconfig/laptop/nixos.nix @@ -0,0 +1,45 @@ +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "laptop"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Paris"; + services.automatic-timezoned.enable = true; + + i18n.defaultLocale = "en_GB.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "fr_FR.UTF-8"; + LC_IDENTIFICATION = "fr_FR.UTF-8"; + LC_MEASUREMENT = "fr_FR.UTF-8"; + LC_MONETARY = "fr_FR.UTF-8"; + LC_NAME = "fr_FR.UTF-8"; + LC_NUMERIC = "fr_FR.UTF-8"; + LC_PAPER = "fr_FR.UTF-8"; + LC_TELEPHONE = "fr_FR.UTF-8"; + LC_TIME = "fr_FR.UTF-8"; + }; + + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + users.users.traxys = { + isNormalUser = true; + description = "Quentin Boyer"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + + system.stateVersion = "24.05"; +}