feat(wpcarro/nixos): Support laptop.nix module
Define shared laptop configuration. The primary impetus of this change was `powerManagement.powertop`. Change-Id: Icbd04a252005ab391dc8f7d5ebf0968af91f2e0c Reviewed-on: https://cl.tvl.fyi/c/depot/+/5910 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com>
This commit is contained in:
parent
5188c689bf
commit
ab0cca019b
2 changed files with 19 additions and 3 deletions
|
@ -4,6 +4,8 @@
|
||||||
let
|
let
|
||||||
inherit (depot.users) wpcarro;
|
inherit (depot.users) wpcarro;
|
||||||
|
|
||||||
|
usermod = name: depot.path.origSrc + ("/users/wpcarro/nixos/modules/${name}");
|
||||||
|
|
||||||
wpcarrosEmacs = wpcarro.emacs.nixos {
|
wpcarrosEmacs = wpcarro.emacs.nixos {
|
||||||
load = [ ./marcus.el ];
|
load = [ ./marcus.el ];
|
||||||
};
|
};
|
||||||
|
@ -18,6 +20,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
(depot.path.origSrc + "/users/wpcarro/nixos/marcus/hardware.nix")
|
(depot.path.origSrc + "/users/wpcarro/nixos/marcus/hardware.nix")
|
||||||
(pkgs.home-manager.src + "/nixos")
|
(pkgs.home-manager.src + "/nixos")
|
||||||
|
(usermod "laptop.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the TVL binary cache
|
# Use the TVL binary cache
|
||||||
|
@ -111,9 +114,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = wpcarro.common.programs // {
|
programs = wpcarro.common.programs;
|
||||||
light.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
EDITOR = "emacsclient";
|
EDITOR = "emacsclient";
|
||||||
|
|
15
users/wpcarro/nixos/modules/laptop.nix
Normal file
15
users/wpcarro/nixos/modules/laptop.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Laptop-specific NixOS configuration.
|
||||||
|
_:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Automatically detect location for redshift.
|
||||||
|
services.geoclue2.enable = true;
|
||||||
|
location.provider = "geoclue2";
|
||||||
|
|
||||||
|
# Enable power-saving features.
|
||||||
|
powerManagement.powertop.enable = true;
|
||||||
|
|
||||||
|
# Backlight control command.
|
||||||
|
programs.light.enable = true;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue