Refactor a bit

This commit is contained in:
Nathan McCarty 2021-12-23 00:45:21 -05:00
parent 63f97a19aa
commit 9c87cd988f
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
2 changed files with 65 additions and 61 deletions

39
desktop.nix Normal file
View File

@ -0,0 +1,39 @@
{ pkgs, ... }: {
## Boot, drivers, and host name
# Use grub
boot.loader = {
grub = {
enable = true;
version = 2;
efiSupport = true;
# Go efi only
device = "nodev";
# Use os-prober
useOSProber = true;
};
efi = {
efiSysMountPoint = "/boot/";
canTouchEfiVariables = true;
};
};
# Enable AMD gpu drivers early
boot.initrd.kernelModules = [ "amdgpu" ];
# Use the zen kernel
boot.kernelPackages = pkgs.linuxPackages_zen;
# Define the hostname, enable dhcp
networking = {
hostName = "levitation";
domain = "mccarty.io";
useDHCP = false;
interfaces.enp5s0.useDHCP = true;
};
## System specific configuration
programs = {
steam.enable = true;
adb.enable = true;
};
## Left over uncategorized packages
environment.systemPackages = with pkgs; [
firefox-wayland
];
}

View File

@ -15,7 +15,31 @@
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, fenix, emacs }: outputs = { self, nixpkgs, nixpkgs-unstable, fenix, emacs }:
let
coreModules = [
./modules/user.nix
./modules/common.nix
./modules/ssh.nix
./applications/utils-core.nix
];
desktopModules = coreModules ++ [
./modules/audio.nix
./modules/sway.nix
./modules/fonts.nix
./modules/gpg.nix
./modules/logitech.nix
./modules/qemu.nix
./modules/docker.nix
./applications/communications.nix
./applications/devel-core.nix
./applications/devel-rust.nix
./applications/emacs.nix
./applications/image-editing.nix
./applications/media.nix
./applications/syncthing.nix
./desktop.nix
];
in
{ {
nixosConfigurations.levitation = nixpkgs.lib.nixosSystem { nixosConfigurations.levitation = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -27,66 +51,7 @@
}; };
fenix = fenix.packages.x86_64-linux; fenix = fenix.packages.x86_64-linux;
}; };
modules = [ modules = [ ./hardware/levitation.nix ] ++ desktopModules;
./hardware/levitation.nix
./modules/user.nix
./modules/common.nix
./modules/audio.nix
./modules/sway.nix
./modules/fonts.nix
./modules/gpg.nix
./modules/logitech.nix
./modules/qemu.nix
./modules/docker.nix
./modules/ssh.nix
./applications/utils-core.nix
./applications/communications.nix
./applications/devel-core.nix
./applications/devel-rust.nix
./applications/emacs.nix
./applications/image-editing.nix
./applications/media.nix
./applications/syncthing.nix
({ pkgs, ... }: {
## Boot, drivers, and host name
# Use grub
boot.loader = {
grub = {
enable = true;
version = 2;
efiSupport = true;
# Go efi only
device = "nodev";
# Use os-prober
useOSProber = true;
};
efi = {
efiSysMountPoint = "/boot/";
canTouchEfiVariables = true;
};
};
# Enable AMD gpu drivers early
boot.initrd.kernelModules = [ "amdgpu" ];
# Use the zen kernel
boot.kernelPackages = pkgs.linuxPackages_zen;
# Define the hostname, enable dhcp
networking = {
hostName = "levitation";
domain = "mccarty.io";
useDHCP = false;
interfaces.enp5s0.useDHCP = true;
};
## System specific configuration
programs = {
steam.enable = true;
adb.enable = true;
};
## Left over uncategorized packages
environment.systemPackages = with pkgs; [
firefox-wayland
];
})
];
}; };
}; };
} }