System/home-manager/linux/default.nix

143 lines
4.8 KiB
Nix
Raw Normal View History

2022-09-04 02:54:15 -04:00
{ config, lib, pkgs, inputs, ... }:
let
inherit (import ../../modules/lib.nix {
inherit lib;
inherit pkgs;
})
nLib;
in with lib;
with nLib; {
2022-09-04 02:54:15 -04:00
imports = [
../options.nix
../common/programs/core.nix
../common/programs/devel.nix
../common/programs/terminal.nix
2023-05-11 11:26:23 -04:00
../common/programs/git.nix
2023-05-11 11:31:17 -04:00
../common/programs/ssh.nix
2023-05-11 11:32:43 -04:00
../common/programs/fish.nix
2023-06-16 22:43:59 -04:00
./programs/hyprland.nix
./programs/communications.nix
2022-09-04 03:29:35 -04:00
./programs/devel.nix
2022-09-04 02:54:15 -04:00
./programs/emacs.nix
./programs/image-editing.nix
./programs/media.nix
./programs/wine.nix
2022-10-02 21:53:40 -04:00
./programs/gpg.nix
2022-10-13 00:03:16 -04:00
./programs/games.nix
2022-09-04 02:54:15 -04:00
./services/syncthing.nix
./services/email.nix
];
options = {
nathan = {
# Services, these are platform specific so they go here
services = {
# Synthing, enabled by default on linux desktop
syncthing = mkDefaultOption "Syncthing"
(config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
2022-09-04 02:54:15 -04:00
# Email syncing
# Disabled by default since this requires manual setup on the machine
# TODO: Get this working on darwin
email = { enable = mkEnableOption "Email"; };
2022-09-04 02:54:15 -04:00
};
2023-06-19 22:12:25 -04:00
# Configuration for linux specific options
config = {
# Generic desktop components
desktop = {
fuzzel-command = mkOption {
description = "Fuzzel command";
default = ''
fuzzel -f "Iosevka Sans Quasi:size=16" -b "181818cc" -S "b9b9b9ff" -s "252525cc" -t "777777ff" -B 5 -r 5 -C "70b433cc" --width=80 --lines=25'';
};
targets = mkOption {
description = "Targets to install desktop services to";
2023-07-02 02:52:02 -04:00
default = [ "graphical-session.target" ];
2023-06-19 22:12:25 -04:00
};
2023-06-20 01:52:09 -04:00
swaylock = {
package = mkOption {
description = "Swaylock package to use";
default =
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.swaylock-effects;
};
command = mkOption {
description = "Swaylock package to use";
default = ''
--screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3'';
};
};
2023-06-19 22:12:25 -04:00
};
};
2022-09-04 02:54:15 -04:00
# Linux specific programs
programs = {
util = {
# Wine support, disabled by default
wine = mkEnableOption "wine";
2022-10-02 21:53:40 -04:00
# GPG support, enabled by default on desktop
gpg = mkEnableOptionT "gpg";
2022-09-04 02:54:15 -04:00
};
2022-09-04 03:29:35 -04:00
devel = {
jvm = mkDefaultOption "JVM Development Utilites"
config.nathan.config.isDesktop;
2022-09-04 03:29:35 -04:00
};
2022-10-13 00:03:16 -04:00
# Install games
games = { launcher = mkEnableOption "Game launcher"; };
2023-06-18 16:39:16 -04:00
# Hyprland and supporting application configuration
hyprland = {
enable = mkDefaultOption "hyprland" config.nathan.config.isDesktop;
2022-09-04 02:54:15 -04:00
};
# Alacritty, follows sway
alacritty =
2023-06-18 16:39:16 -04:00
mkDefaultOption "alacritty" config.nathan.programs.hyprland.enable;
2022-09-04 02:54:15 -04:00
# Communications applications
communications = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "Communication applications"
(config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
2022-09-04 02:54:15 -04:00
};
# Image editing software, on by default on desktop
image-editing = mkDefaultOption "Image Editing Software"
config.nathan.config.isDesktop;
2022-09-04 02:54:15 -04:00
# Media appilcations, on by default on linux desktop
media = {
enable = mkDefaultOption "Media Applications"
(config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
2023-02-19 20:03:05 -05:00
nicotineService = mkDefaultOption "Nicotine service" false;
2022-09-04 02:54:15 -04:00
mopidyExtraConfig = mkOption {
description = "Extra config files for mopidy";
default = [ ];
};
};
# Firefox, enabled by default on linux desktop
firefox = mkDefaultOption "Firefox"
(config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
2022-09-04 02:54:15 -04:00
};
};
};
config = {
2023-04-26 00:35:22 -04:00
programs.command-not-found.enable = true;
2022-09-04 02:54:15 -04:00
home.stateVersion = "22.05";
programs.home-manager.enable = true;
programs.firefox = {
enable = config.nathan.programs.firefox;
package = pkgs.firefox-beta-bin;
};
nathan.programs.emacs.package =
2023-04-18 16:50:20 -04:00
lib.mkDefault inputs.emacs.packages."${pkgs.system}".emacsUnstablePgtk;
2022-09-18 20:25:20 -04:00
# We should be managing xdg stuff
xdg = {
enable = true;
# Manage mime associations
mime.enable = true;
2022-09-18 22:02:23 -04:00
mimeApps = {
enable = true;
# Set firefox as the default browser
defaultApplications = {
"x-scheme-handler/https" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
};
};
2022-09-18 20:25:20 -04:00
};
2022-09-04 02:54:15 -04:00
};
}