diff --git a/nixos/includes/system/flakes.nix b/common/flakes.nix similarity index 100% rename from nixos/includes/system/flakes.nix rename to common/flakes.nix diff --git a/nixos/includes/system/locales.nix b/common/locales.nix similarity index 100% rename from nixos/includes/system/locales.nix rename to common/locales.nix diff --git a/nixos/includes/system/user.nix b/common/user.nix similarity index 100% rename from nixos/includes/system/user.nix rename to common/user.nix diff --git a/flake.nix b/flake.nix index 3948651..ce932a0 100644 --- a/flake.nix +++ b/flake.nix @@ -7,19 +7,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, home-manager, ... }@inputs: -let - stateVersion = "23.05"; -in rec { + outputs = { self, nixpkgs, home-manager, ... }@inputs: { nixosConfigurations = { mrmeeseeks = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { - inherit stateVersion; - hostname = "mrmeeseeks"; - }; modules = [ - ./nixos/default.nix + ./hosts/mrmeeseeks/configuration.nix home-manager.nixosModule ]; }; diff --git a/hosts/mrmeeseeks/configuration.nix b/hosts/mrmeeseeks/configuration.nix new file mode 100644 index 0000000..e9aa15e --- /dev/null +++ b/hosts/mrmeeseeks/configuration.nix @@ -0,0 +1,74 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../common/locales.nix + ../../common/flakes.nix + ../../common/user.nix + ../../modules/nixos/pipewire.nix + ../../modules/nixos/steam.nix + ../../modules/nixos/xdg-portal.nix + ../../modules/nixos/doas.nix + ]; + + nixpkgs.config.allowUnfree = true; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + #CPU + hardware.cpu.amd.updateMicrocode = true; + # GPU + hardware.opengl.driSupport = true; + hardware.opengl.driSupport32Bit = true; + + # Bluetooth + hardware.bluetooth.enable = true; + hardware.xpadneo.enable = true; + networking.hostName = "mrmeeseeks"; + + console = { + earlySetup = true; + font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; + packages = with pkgs; [terminus_font]; + # keyMap = "us"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + security.rtkit.enable = true; + security.pam.services.swaylock = {}; + services.udisks2.enable = true; + + environment.systemPackages = with pkgs; [ + git + zsh + lvm2_dmeventd + ]; + + services.lvm.enable = true; + services.lvm.dmeventd.enable = true; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.ephase = { + home.stateVersion = "23.05"; + programs.home-manager.enable = true; + imports = [ + ../../modules/home/desktop + ../../modules/home/webcord.nix + ../../modules/home/cli + ../../modules/home/firefox + ../../modules/home/foot.nix + ../../modules/home/lutris.nix + ../../modules/home/zathura.nix + ]; + }; + }; + + system.stateVersion = "23.05"; +} diff --git a/hosts/mrmeeseeks/hardware-configuration.nix b/hosts/mrmeeseeks/hardware-configuration.nix index ac24d06..3105f97 100644 --- a/hosts/mrmeeseeks/hardware-configuration.nix +++ b/hosts/mrmeeseeks/hardware-configuration.nix @@ -61,11 +61,7 @@ # networking.interfaces.enp34s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp37s0.useDHCP = lib.mkDefault true; + services.lvm.boot.thin.enable = true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - hardware.cpu.amd.updateMicrocode = true; - hardware.opengl.driSupport = true; - hardware.opengl.driSupport32Bit = true; - hardware.bluetooth.enable = true; - hardware.xpadneo.enable = true; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/nixos/includes/system/doas.nix b/modules/nixos/doas.nix similarity index 100% rename from nixos/includes/system/doas.nix rename to modules/nixos/doas.nix diff --git a/nixos/includes/system/neovim.nix b/modules/nixos/neovim.nix similarity index 100% rename from nixos/includes/system/neovim.nix rename to modules/nixos/neovim.nix diff --git a/nixos/includes/desktop/pipewire.nix b/modules/nixos/pipewire.nix similarity index 77% rename from nixos/includes/desktop/pipewire.nix rename to modules/nixos/pipewire.nix index 19c9744..2b2312d 100644 --- a/nixos/includes/desktop/pipewire.nix +++ b/modules/nixos/pipewire.nix @@ -1,5 +1,5 @@ -_: { - security.rtkit.enable = true; +{ config, pkgs, ...}: +{ services.pipewire = { enable = true; alsa.enable = true; diff --git a/nixos/includes/gaming/steam.nix b/modules/nixos/steam.nix similarity index 100% rename from nixos/includes/gaming/steam.nix rename to modules/nixos/steam.nix diff --git a/nixos/includes/desktop/xdg-portal.nix b/modules/nixos/xdg-portal.nix similarity index 100% rename from nixos/includes/desktop/xdg-portal.nix rename to modules/nixos/xdg-portal.nix diff --git a/nixos/default.nix b/nixos/default.nix deleted file mode 100644 index 5d37b4c..0000000 --- a/nixos/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, pkgs, lib, stateVersion, hostname, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ../hosts/${hostname}/hardware-configuration.nix - ./includes/hardware/bootloader.nix - ./includes/system/locales.nix - ./includes/system/flakes.nix - ./includes/system/user.nix - ./includes/system/udisks2.nix - ./includes/system/lvm.nix - ./includes/system/doas.nix - ./includes/system/neovim.nix - ./includes/desktop/swaylock.nix - ./includes/desktop/pipewire.nix - ./includes/desktop/xdg-portal.nix - ./includes/gaming/steam.nix - ]; - - nixpkgs.config.allowUnfree = true; - - - boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = hostname; - - console = { - earlySetup = true; - font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; - packages = with pkgs; [terminus_font]; - # keyMap = "us"; - useXkbConfig = true; # use xkbOptions in tty. - }; - - - environment.systemPackages = with pkgs; [ - git - zsh - ]; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.ephase = { - home.stateVersion = stateVersion; - programs.home-manager.enable = true; - imports = [ - ../modules/home/desktop - ../modules/home/webcord.nix - ../modules/home/cli - ../modules/home/firefox - ../modules/home/foot.nix - ../modules/home/lutris.nix - ../modules/home/zathura.nix - ]; - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/nixos/includes/desktop/swaylock.nix b/nixos/includes/desktop/swaylock.nix deleted file mode 100644 index bc48c63..0000000 --- a/nixos/includes/desktop/swaylock.nix +++ /dev/null @@ -1,3 +0,0 @@ -_: { - security.pam.services.swaylock = {}; -} diff --git a/nixos/includes/hardware/bootloader.nix b/nixos/includes/hardware/bootloader.nix deleted file mode 100644 index 6259fd5..0000000 --- a/nixos/includes/hardware/bootloader.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: { - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.systemd-boot.configurationLimit = 10; - boot.loader.efi.canTouchEfiVariables = true; -} diff --git a/nixos/includes/system/lvm.nix b/nixos/includes/system/lvm.nix deleted file mode 100644 index 06570e1..0000000 --- a/nixos/includes/system/lvm.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: { - - environment.systemPackages = with pkgs; [ - lvm2_dmeventd - ]; - - services.lvm.enable = true; - services.lvm.dmeventd.enable = true; - services.lvm.boot.thin.enable = true; -} diff --git a/nixos/includes/system/udisks2.nix b/nixos/includes/system/udisks2.nix deleted file mode 100644 index 6034d3e..0000000 --- a/nixos/includes/system/udisks2.nix +++ /dev/null @@ -1,3 +0,0 @@ -_: { - services.udisks2.enable = true; -}