diff --git a/flake.nix b/flake.nix index e83e5e9..f525cdc 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,23 @@ ]; }; + homeConfigurations."ant@moon" = + inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + extraSpecialArgs = { + inherit pkgs-unstable; + variant = "moon"; + inherit inputs; + }; + + modules = [ + { home.username = "ant"; } + ./home/home.nix + { home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; } + ]; + }; + nixosConfigurations.basado = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -78,5 +95,13 @@ ] ; }; + + nixosConfigurations.moon = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./os/moon.nix + ] + ; + }; }; } diff --git a/os/common.nix b/os/common.nix new file mode 100644 index 0000000..64dd327 --- /dev/null +++ b/os/common.nix @@ -0,0 +1,87 @@ +{ config, pkgs, ... }: +{ + nix.package = pkgs.nixVersions.latest; + nix.settings = { experimental-features = [ "nix-command" "flakes" ]; }; + nixpkgs.config.allowUnfree = true; + + + boot.plymouth = { + enable = true; + theme = "fade-in"; + }; + + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Paris"; + i18n.defaultLocale = "en_US.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"; + }; + services.xserver.xkb = { + layout = "fr"; + variant = ""; + }; + console.keyMap = "fr"; + + services.printing.enable = true; + + programs.fish.enable = true; + + environment.systemPackages = with pkgs; [ + nh + neovim + where-is-my-sddm-theme + ]; + programs.hyprland.enable = true; + + services.xserver.enable = true; + services.displayManager = { + defaultSession = "hyprland"; + autoLogin = { + enable = false; + user = "ant"; + }; + sddm = { + enable = true; + wayland.enable = true; + package = pkgs.kdePackages.sddm; + extraPackages = with pkgs; [ + where-is-my-sddm-theme + kdePackages.qt5compat + ]; + theme = "where_is_my_sddm_theme"; + }; + }; + + security.rtkit.enable = true; + security.pam.services.swaylock = { }; + security.polkit.enable = true; + security.pam.services.ant.enableGnomeKeyring = true; + services.gnome.gnome-keyring.enable = true; + + security.sudo.wheelNeedsPassword = false; + + services.udisks2.enable = true; + programs.gamemode.enable = true; + programs.gnupg.agent.enable = true; + programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses; + programs.light.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + + programs.nix-ld.enable = true; +} diff --git a/os/configuration.nix b/os/configuration.nix index 6048fbc..7b8795b 100644 --- a/os/configuration.nix +++ b/os/configuration.nix @@ -7,11 +7,9 @@ { imports = [ ./hardware-configuration.nix + ./common.nix ]; - nix.package = pkgs.nixVersions.latest; - nix.settings = { experimental-features = [ "nix-command" "flakes" ]; }; - boot.loader = { grub = { enable = true; @@ -60,35 +58,7 @@ boot.kernelParams = [ "quiet" "amd_iommu=on" ]; boot.supportedFilesystems = [ "ntfs" ]; - boot.plymouth = { - enable = true; - theme = "fade-in"; - }; - networking.hostName = "basado"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; - - time.timeZone = "Europe/Paris"; - i18n.defaultLocale = "en_US.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"; - }; - services.xserver.xkb = { - layout = "fr"; - variant = ""; - }; - console.keyMap = "fr"; - - programs.fish.enable = true; users.users.ant = { isNormalUser = true; @@ -117,32 +87,7 @@ fsType = "ext4"; }; - nixpkgs.config.allowUnfree = true; - - environment.systemPackages = with pkgs; [ neovim where-is-my-sddm-theme ]; - programs.hyprland.enable = true; services.desktopManager.plasma6.enable = true; - services.xserver.enable = true; - services.displayManager = { - defaultSession = "hyprland"; - autoLogin = { - enable = false; - user = "ant"; - }; - sddm = { - enable = true; - wayland.enable = true; - extraPackages = [ pkgs.where-is-my-sddm-theme ]; - theme = "where_is_my_sddm_theme"; - }; - }; - - security.rtkit.enable = true; - security.pam.services.swaylock = { }; - security.polkit.enable = true; - security.pam.services.ant.enableGnomeKeyring = true; - services.gnome.gnome-keyring.enable = true; - hardware.graphics = { enable = true; enable32Bit = true; @@ -159,22 +104,6 @@ nvidiaSettings = false; }; - security.sudo.wheelNeedsPassword = false; - - services.udisks2.enable = true; - programs.gamemode.enable = true; - programs.gnupg.agent.enable = true; - programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses; - programs.light.enable = true; - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - services.openssh = { enable = true; settings.X11Forwarding = true; @@ -194,8 +123,6 @@ # }; services.immich.enable = true; - programs.nix-ld.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 diff --git a/os/moon-hardware-configuration.nix b/os/moon-hardware-configuration.nix new file mode 100644 index 0000000..5e1618a --- /dev/null +++ b/os/moon-hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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" "ehci_pci" "xhci_pci" "usbhid" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/6d8c21b7-440e-4f6d-b18b-f7cd31c410c0"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-0fb5e946-b7c0-4d18-88a6-382df27a3975".device = "/dev/disk/by-uuid/0fb5e946-b7c0-4d18-88a6-382df27a3975"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/4EEC-7095"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + # 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.enp3s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/os/moon.nix b/os/moon.nix new file mode 100644 index 0000000..7d32216 --- /dev/null +++ b/os/moon.nix @@ -0,0 +1,73 @@ +{ config, pkgs, pkgs-unstable, ... }: +{ + imports = [ # Include the results of the hardware scan. + ./moon-hardware-configuration.nix + ./common.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "moon"; + + boot.kernelPackages = pkgs.linuxPackages_zen; + + services.xserver.videoDrivers = [ "amdgpu" ]; + hardware.graphics = { + enable = true; + extraPackages = [ pkgs.amdvlk ]; + extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; + }; + + programs.steam.enable = true; + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + programs.fish.enable = true; + users.users.ant = { + isNormalUser = true; + shell = pkgs.fish; + description = "ant"; + extraGroups = [ "networkmanager" "wheel" "video" ]; + packages = with pkgs; [ ]; + }; + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ + 42000 # warpinator + 42001 # warpinator + 8080 + ]; + networking.firewall.allowedUDPPorts = [ + 42000 # warpinator + 42001 # warpinator + ]; + networking.firewall.allowedTCPPortRanges = [{ + from = 1714; + to = 1764; + } # KDE Connect + ]; + networking.firewall.allowedUDPPortRanges = [{ + from = 1714; + to = 1764; + } # KDE Connect + ]; + networking.hosts = { "90.52.247.64" = [ "home" ]; }; + + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + mesa + ]; + + system.stateVersion = "24.05"; # Did you read the comment? +} +