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 = [ imports = [
./apps ./apps
./automatic
./services ./services
]; ];
} }

View file

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

View file

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

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
options = { options.tuigreet = {
tuigreet.enable = lib.mkEnableOption "enables tuigreet with greetd"; enable = lib.mkEnableOption "enables tuigreet with greetd";
}; };
config = lib.mkIf config.tuigreet.enable { 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, ... }: { config, pkgs, lib, ... }:
{ {
options = { options.nvidia = {
nvidia.enable = lib.mkEnableOption enable = lib.mkEnableOption
"Enables nvidia with proprietary drivers"; "Enables nvidia with proprietary drivers";
}; };

View file

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

View file

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

View file

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

View file

@ -1,9 +1,9 @@
{ inputs, config, pkgs, lib, ... }: { inputs, config, lib, ... }:
{ {
options = { options.hyprland = {
hyprland.enable = lib.mkEnableOption "Enables hyprland"; enable = lib.mkEnableOption "Enables hyprland";
}; };
imports = [ imports = [
@ -13,7 +13,9 @@
config = { config = {
nix.settings = { nix.settings = {
substituters = [ "https://hyprland.cachix.org" ]; 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" ]; experimental-features = [ "nix-command" "flakes" ];
}; };
programs.hyprland.enable = lib.mkIf config.hyprland.enable true; programs.hyprland.enable = lib.mkIf config.hyprland.enable true;

View file

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