Services, refactor, clean up, service to automatic

Move service to automatic since it has a separate purpose.

Refactor the default.nix code to include service.nix files so it is
easier to extend code.
This commit is contained in:
Julia Lange 2024-11-28 23:48:40 -08:00
parent dfb064e92b
commit 525f68172b
Signed by: Julia
SSH key fingerprint: SHA256:KI8YxpkPRbnDRkXPgCuQCVz181++Vy7NAvmQj8alOhM
14 changed files with 29 additions and 52 deletions

View file

@ -3,6 +3,7 @@
{
imports = [
./apps
./automatic
./services
];
}

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{
options = {
bluetooth.enable = lib.mkEnableOption "Enables Bluetooth with blueman";
options.bluetooth = {
enable = lib.mkEnableOption "Enables Bluetooth with blueman";
};
config = lib.mkIf config.bluetooth.enable {

View file

@ -1,12 +1,6 @@
{ config, pkgs, lib, ... }:
{
imports = [
./graphics
./networking
./pipewire
./polkit
./sops-nix
./system
];
{ lib, ... }: let
fs = lib.fileset;
appFilter = {name, ...}: name == "service.nix";
in {
imports = fs.toList (fs.fileFilter appFilter ./.);
}

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{
options = {
tuigreet.enable = lib.mkEnableOption "enables tuigreet with greetd";
options.tuigreet = {
enable = lib.mkEnableOption "enables tuigreet with greetd";
};
config = lib.mkIf config.tuigreet.enable {

View file

@ -1,10 +0,0 @@
{ config, pkgs, lib, ... }:
{
imports = [
./display_manager
./nvidia
./wayland_compositors
./tabletdrivers
];
}

View file

@ -1,8 +0,0 @@
{ config, pkgs, lib, ... }:
{
imports = [
./bluetooth
./wireless
];
}

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{
options = {
nvidia.enable = lib.mkEnableOption
options.nvidia = {
enable = lib.mkEnableOption
"Enables nvidia with proprietary drivers";
};

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{
options = {
pipewire.enable = lib.mkEnableOption "Enables pipewire and pulsemixer";
options.pipewire = {
enable = lib.mkEnableOption "Enables pipewire and pulsemixer";
};
config = lib.mkIf config.pipewire.enable {

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{
options = {
polkit.enable = lib.mkEnableOption "Enables polkit with kde handler";
options.polkit = {
enable = lib.mkEnableOption "Enables polkit with kde handler";
};
config = lib.mkIf config.polkit.enable {

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{
options = {
tablet.enable = lib.mkEnableOption
options.tablet = {
enable = lib.mkEnableOption
"Enables tablet support";
};

View file

@ -1,9 +1,9 @@
{ inputs, config, pkgs, lib, ... }:
{ inputs, config, lib, ... }:
{
options = {
hyprland.enable = lib.mkEnableOption "Enables hyprland";
options.hyprland = {
enable = lib.mkEnableOption "Enables hyprland";
};
imports = [
@ -13,7 +13,9 @@
config = {
nix.settings = {
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
experimental-features = [ "nix-command" "flakes" ];
};
programs.hyprland.enable = lib.mkIf config.hyprland.enable true;

View file

@ -1,12 +1,10 @@
{ config, pkgs, lib, ... }:
{ config, lib, ... }:
{
options = {
wireless = {
enable = lib.mkEnableOption "Enables wireless";
networks = lib.mkOption { default = {}; };
secretsFile = lib.mkOption {};
};
options.wireless = {
enable = lib.mkEnableOption "Enables wireless";
networks = lib.mkOption { default = {}; };
secretsFile = lib.mkOption {};
};
config = lib.mkIf config.wireless.enable {