add laptop config
This commit is contained in:
44
flake.nix
44
flake.nix
@ -39,6 +39,17 @@
|
||||
emacs = inputs.emacs-overlay.overlay;
|
||||
};
|
||||
|
||||
homemanager = home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs =
|
||||
true; # Use systems pkgs, disables nixpkgs.* options in home.nix
|
||||
home-manager.useUserPackages =
|
||||
true; # Enable installing packages through users.christoph.packages
|
||||
home-manager.users.christoph = import ./home/home.nix;
|
||||
|
||||
# Make our overlays available in home.nix
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
};
|
||||
|
||||
# The rec expression turns a basic set into a set where self-referencing is possible.
|
||||
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
||||
in rec {
|
||||
@ -56,6 +67,7 @@
|
||||
modules = [
|
||||
# TODO: Modularize
|
||||
./nixos/configuration.nix
|
||||
./nixos/configuration-desktop.nix
|
||||
|
||||
# TODO: Investigate this { ... } module syntax
|
||||
# Overlays
|
||||
@ -65,17 +77,31 @@
|
||||
}
|
||||
|
||||
# HomeManager
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs =
|
||||
true; # Use systems pkgs, disables nixpkgs.* options in home.nix
|
||||
home-manager.useUserPackages =
|
||||
true; # Enable installing packages through users.christoph.packages
|
||||
home-manager.users.christoph = import ./home/home.nix;
|
||||
homemanager
|
||||
];
|
||||
|
||||
# Make our overlays available in home.nix
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
# Make our inputs available to the configuration.nix (for importing modules)
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
|
||||
nixtop = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
||||
# >> Main NixOS configuration file <<
|
||||
modules = [
|
||||
# TODO: Modularize
|
||||
./nixos/configuration.nix
|
||||
./nixos/configuration-laptop.nix
|
||||
|
||||
# TODO: Investigate this { ... } module syntax
|
||||
# Overlays
|
||||
{
|
||||
# Since HomeManager uses global pkgs we can set the overlays here
|
||||
nixpkgs.overlays = attrValues overlays;
|
||||
}
|
||||
|
||||
# HomeManager
|
||||
homemanager
|
||||
];
|
||||
|
||||
# Make our inputs available to the configuration.nix (for importing modules)
|
||||
|
19
nixos/configuration-desktop.nix
Normal file
19
nixos/configuration-desktop.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration-desktop.nix
|
||||
];
|
||||
|
||||
networking.hostName = "nixinator"; # Define your hostname.
|
||||
|
||||
services.xserver = {
|
||||
# Configure keymap in X11
|
||||
layout = "us";
|
||||
xkbVariant = "altgr-intl";
|
||||
|
||||
# Proprietary graphics drivers
|
||||
videoDrivers = [ "nvidia" ];
|
||||
};
|
||||
}
|
19
nixos/configuration-laptop.nix
Normal file
19
nixos/configuration-laptop.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration-laptop.nix
|
||||
];
|
||||
|
||||
networking.hostName = "nixtop"; # Define your hostname.
|
||||
|
||||
services.xserver = {
|
||||
# Configure keymap in X11
|
||||
layout = "de";
|
||||
xkbVariant = "nodeadkeys";
|
||||
|
||||
# Proprietary graphics drivers
|
||||
videoDrivers = [ "intel" ];
|
||||
};
|
||||
}
|
@ -5,9 +5,7 @@
|
||||
{ inputs, lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
||||
imports = [
|
||||
# NixCommunity binary cache
|
||||
./cachix.nix
|
||||
];
|
||||
@ -65,22 +63,6 @@
|
||||
|
||||
security.protectKernelImage = true;
|
||||
|
||||
hardware = {
|
||||
# cpu.intel.updateMicrocode = true; # Already defined in hardware.nix
|
||||
|
||||
# Use all redistributable firmware (i.e. nonfree)
|
||||
enableAllFirmware = true;
|
||||
enableRedistributableFirmware = true; # Also enables microcode update
|
||||
|
||||
nvidia.modesetting.enable =
|
||||
true; # Not officially supported by NVidia but needed for wayland
|
||||
opengl.enable = true;
|
||||
opengl.driSupport = true;
|
||||
opengl.driSupport32Bit = true;
|
||||
|
||||
sane.enable = true; # Scanning
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
@ -105,7 +87,7 @@
|
||||
# TODO: Other ports (tcp/udp/ssh...)?
|
||||
# Open ports in the firewall.
|
||||
networking = {
|
||||
hostName = "nixinator"; # Define your hostname.
|
||||
# hostName = "nixinator"; # Define your hostname. # NOTE: Done in host specific config
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
@ -130,12 +112,12 @@
|
||||
enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
layout = "us";
|
||||
xkbVariant = "altgr-intl";
|
||||
# layout = "us"; # NOTE: Done in host specific config
|
||||
# xkbVariant = "altgr-intl"; # NOTE: Done in host specific config
|
||||
|
||||
# Proprietary graphics drivers
|
||||
# TODO: Opengl and stuff
|
||||
videoDrivers = [ "nvidia" ];
|
||||
# videoDrivers = [ "nvidia" ]; # NOTE: Done in host specific config
|
||||
|
||||
# Startx replaces the displaymanager so default (lightdm) isn't used, start to shell
|
||||
# displayManager.startx.enable = true;
|
||||
|
@ -60,4 +60,20 @@
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
# high-resolution display
|
||||
hardware.video.hidpi.enable = lib.mkDefault true;
|
||||
|
||||
hardware = {
|
||||
# cpu.intel.updateMicrocode = true; # Already defined in hardware.nix
|
||||
|
||||
# Use all redistributable firmware (i.e. nonfree)
|
||||
enableAllFirmware = true;
|
||||
enableRedistributableFirmware = true; # Also enables microcode update
|
||||
|
||||
nvidia.modesetting.enable =
|
||||
true; # Not officially supported by NVidia but needed for wayland
|
||||
opengl.enable = true;
|
||||
opengl.driSupport = true;
|
||||
opengl.driSupport32Bit = true;
|
||||
|
||||
sane.enable = true; # Scanning
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user