nixos: profiles: move from top-level
All checks were successful
ci/woodpecker/push/check Pipeline was successful
All checks were successful
ci/woodpecker/push/check Pipeline was successful
My profiles are actually just "special" NixOS modules in that they orchestrate settings that usually span the NixOS/home-manager boundary, or otherwise set up configurations from multiple modules at once.
This commit is contained in:
parent
65a8f7c481
commit
570349e80f
9 changed files with 1 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
imports = [
|
||||
./hardware
|
||||
./home
|
||||
./profiles
|
||||
./programs
|
||||
./secrets
|
||||
./services
|
||||
|
|
|
|||
15
modules/nixos/profiles/bluetooth/default.nix
Normal file
15
modules/nixos/profiles/bluetooth/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.bluetooth;
|
||||
in
|
||||
{
|
||||
options.my.profiles.bluetooth = with lib; {
|
||||
enable = mkEnableOption "bluetooth profile";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hardware.bluetooth.enable = true;
|
||||
|
||||
my.home.bluetooth.enable = true;
|
||||
};
|
||||
}
|
||||
12
modules/nixos/profiles/default.nix
Normal file
12
modules/nixos/profiles/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Configuration that spans accross system and home, or are almagations of modules
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./bluetooth
|
||||
./devices
|
||||
./gtk
|
||||
./laptop
|
||||
./wm
|
||||
./x
|
||||
];
|
||||
}
|
||||
20
modules/nixos/profiles/devices/default.nix
Normal file
20
modules/nixos/profiles/devices/default.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.devices;
|
||||
in
|
||||
{
|
||||
options.my.profiles.devices = with lib; {
|
||||
enable = mkEnableOption "devices profile";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hardware = {
|
||||
ergodox.enable = true;
|
||||
|
||||
mx-ergo.enable = true;
|
||||
};
|
||||
|
||||
# MTP devices auto-mount via file explorers
|
||||
services.gvfs.enable = true;
|
||||
};
|
||||
}
|
||||
17
modules/nixos/profiles/gtk/default.nix
Normal file
17
modules/nixos/profiles/gtk/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.gtk;
|
||||
in
|
||||
{
|
||||
options.my.profiles.gtk = with lib; {
|
||||
enable = mkEnableOption "gtk profile";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Allow setting GTK configuration using home-manager
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# GTK theme configuration
|
||||
my.home.gtk.enable = true;
|
||||
};
|
||||
}
|
||||
23
modules/nixos/profiles/laptop/default.nix
Normal file
23
modules/nixos/profiles/laptop/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.laptop;
|
||||
in
|
||||
{
|
||||
options.my.profiles.laptop = with lib; {
|
||||
enable = mkEnableOption "laptop profile";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Enable touchpad support
|
||||
services.xserver.libinput.enable = true;
|
||||
|
||||
# Enable TLP power management
|
||||
my.services.tlp.enable = true;
|
||||
|
||||
# Enable upower power management
|
||||
my.hardware.upower.enable = true;
|
||||
|
||||
# Enable battery notifications
|
||||
my.home.power-alert.enable = true;
|
||||
};
|
||||
}
|
||||
29
modules/nixos/profiles/wm/default.nix
Normal file
29
modules/nixos/profiles/wm/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.wm;
|
||||
in
|
||||
{
|
||||
options.my.profiles.wm = with lib; {
|
||||
windowManager = mkOption {
|
||||
type = with types; nullOr (enum [ "i3" ]);
|
||||
default = null;
|
||||
example = "i3";
|
||||
description = "Which window manager to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (cfg.windowManager == "i3") {
|
||||
# Enable i3
|
||||
services.xserver.windowManager.i3.enable = true;
|
||||
# i3 settings
|
||||
my.home.wm.windowManager = "i3";
|
||||
# Screenshot tool
|
||||
my.home.flameshot.enable = true;
|
||||
# Auto disk mounter
|
||||
my.home.udiskie.enable = true;
|
||||
# udiskie fails if it can't find this dbus service
|
||||
services.udisks2.enable = true;
|
||||
})
|
||||
];
|
||||
}
|
||||
23
modules/nixos/profiles/x/default.nix
Normal file
23
modules/nixos/profiles/x/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.x;
|
||||
in
|
||||
{
|
||||
options.my.profiles.x = with lib; {
|
||||
enable = mkEnableOption "X profile";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
# Nice wallpaper
|
||||
services.xserver.displayManager.lightdm.background =
|
||||
let
|
||||
wallpapers = "${pkgs.plasma5Packages.plasma-workspace-wallpapers}/share/wallpapers";
|
||||
in
|
||||
"${wallpapers}/summer_1am/contents/images/2560x1600.jpg";
|
||||
|
||||
# X configuration
|
||||
my.home.x.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue