Seperate out linux home-manager

This commit is contained in:
Nathan McCarty 2022-09-04 02:54:15 -04:00
parent 818294bddd
commit 092a0d0010
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
14 changed files with 135 additions and 119 deletions

View File

@ -116,7 +116,7 @@
nixosConfig = config;
};
sharedModules = [
./home-manager/default.nix
./home-manager/linux/default.nix
];
};
})

View File

@ -2,7 +2,7 @@
let
devel = config.nathan.programs.devel;
unstable = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}";
inherit (import ../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib;
inherit (import ../../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib;
in
with lib; with nLib; {

View File

@ -1,112 +0,0 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (import ../modules/lib.nix { inherit lib; inherit pkgs; }) nLib;
in
with lib; with nLib; {
imports = [
./programs/sway.nix
./programs/core.nix
./programs/communications.nix
./programs/devel.nix
./programs/emacs.nix
./programs/image-editing.nix
./programs/media.nix
./programs/wine.nix
./services/syncthing.nix
./services/email.nix
];
options = {
nathan = {
# Services
services = {
# Synthing, enabled by default on linux desktop
syncthing = mkDefaultOption "Syncthing" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
# Email syncing
# Disabled by default since this requires manual setup on the machine
# TODO: Get this working on darwin
email = {
enable = mkEnableOption "Email";
};
};
# Programs
programs = {
util = {
# Core utilites
core = mkEnableOptionT "core";
# Ssh configuration, enabled by default
ssh = mkEnableOptionT "ssh";
# Fish configuration, enabled by default
fish = mkEnableOptionT "fish";
# Git configuration, enabled by default
git = {
enable = mkEnableOptionT "git";
gpgSign = mkDefaultOption "git signatures" config.nathan.config.isDesktop;
};
# Bat configuration, enabled by default
bat = mkEnableOptionT "bat";
# JSON Utilities, enabled by default
json = mkEnableOptionT "json";
# Productivity application
productivity = mkDefaultOption "Productivity applications" config.nathan.config.isDesktop;
# Wine support, disabled by default
wine = mkEnableOption "wine";
};
# Swaywm and supoorting application configuration
swaywm = {
enable = mkDefaultOption "swaywm" config.nathan.config.isDesktop;
};
# Communications applications
communications = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "Communication applications" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
};
# Development applications, enabled by default on desktop
devel = {
core = mkDefaultOption "Core Development Utilites" config.nathan.config.isDesktop;
rust = mkDefaultOption "Rust Development Utilites" config.nathan.config.isDesktop;
jvm = mkDefaultOption "JVM Development Utilites" config.nathan.config.isDesktop;
python = mkDefaultOption "Python Development Utilites" config.nathan.config.isDesktop;
js = mkDefaultOption "JavaScript/TypeScript Development Utilites" config.nathan.config.isDesktop;
raku = mkDefaultOption "Raku Development Utilites" config.nathan.config.isDesktop;
};
# Emacs, enabled by default on desktop
emacs = {
enable = mkDefaultOption "Emacs" config.nathan.config.isDesktop;
service = mkDefaultOption "Emacs Service" config.nathan.config.isDesktop;
package = mkOption {
description = "Emacs package to use";
default = inputs.emacs.packages."${pkgs.system}".emacsPgtkNativeComp;
};
};
# Image editing software, on by default on desktop
image-editing = mkDefaultOption "Image Editing Software" config.nathan.config.isDesktop;
# Media appilcations, on by default on linux desktop
media = {
enable = mkDefaultOption "Media Applications" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
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);
};
# General configuration options
config = {
# Is this system a desktop?
# false by default
isDesktop = mkEnableOption "Desktop specific settings";
};
};
};
config = {
home.stateVersion = "22.05";
programs.home-manager.enable = true;
programs.firefox = {
enable = config.nathan.programs.firefox;
package = pkgs.firefox-beta-bin;
};
};
}

View File

@ -0,0 +1,73 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (import ../../modules/lib.nix { inherit lib; inherit pkgs; }) nLib;
in
with lib; with nLib; {
imports = [
../options.nix
./programs/sway.nix
../common/programs/core.nix
./programs/communications.nix
../common/programs/devel.nix
./programs/emacs.nix
./programs/image-editing.nix
./programs/media.nix
./programs/wine.nix
./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);
# Email syncing
# Disabled by default since this requires manual setup on the machine
# TODO: Get this working on darwin
email = {
enable = mkEnableOption "Email";
};
};
# Linux specific programs
programs = {
util = {
# Wine support, disabled by default
wine = mkEnableOption "wine";
};
# Swaywm and supoorting application configuration
swaywm = {
enable = mkDefaultOption "swaywm" config.nathan.config.isDesktop;
};
# Communications applications
communications = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "Communication applications" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
};
# Image editing software, on by default on desktop
image-editing = mkDefaultOption "Image Editing Software" config.nathan.config.isDesktop;
# Media appilcations, on by default on linux desktop
media = {
enable = mkDefaultOption "Media Applications" (config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
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);
};
};
};
config = {
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 = lib.mkDefault inputs.emacs.packages."${pkgs.system}".emacsPgtkNativeComp;
};
}

View File

@ -15,7 +15,7 @@
'';
}
);
discordWayland = pkgs.callPackage ../../packages/discord/default.nix rec {
discordWayland = pkgs.callPackage ../../../packages/discord/default.nix rec {
pname = "discord-electron";
binaryName = "Discord";
desktopName = "Discord (Wayland)";

View File

@ -35,7 +35,7 @@
# Setup doom emacs
programs.doom-emacs = {
enable = true;
doomPrivateDir = ../../doom.d;
doomPrivateDir = ../../../doom.d;
emacsPackage = config.nathan.programs.emacs.package;
emacsPackagesOverlay = self: super: {
org-protocol-capture-html = self.trivialBuild {

View File

@ -46,7 +46,7 @@ with lib; {
port = 1143;
tls = {
useStartTls = true;
certificatesFile = ../../certificates/protonmail-${nixosConfig.networking.hostName}.pem;
certificatesFile = ../../../certificates/protonmail-${nixosConfig.networking.hostName}.pem;
};
};
smtp = {
@ -54,7 +54,7 @@ with lib; {
port = 1025;
tls = {
useStartTls = true;
certificatesFile = ../../certificates/protonmail-${nixosConfig.networking.hostName}.pem;
certificatesFile = ../../../certificates/protonmail-${nixosConfig.networking.hostName}.pem;
};
};
mbsync = {
@ -82,7 +82,7 @@ with lib; {
postExec =
if config.nathan.programs.emacs.service
then
"${../../scripts/update-mu4e.sh}"
"${../../../scripts/update-mu4e.sh}"
else
"${pkgs.mu}/bin/mu index";
};

55
home-manager/options.nix Normal file
View File

@ -0,0 +1,55 @@
{ config, lib, pkgs, ... }:
let
inherit (import ../modules/lib.nix { inherit lib; inherit pkgs; }) nLib;
in
with lib; with nLib;
{
options = {
nathan = {
programs = {
util = {
# Core utilites
core = mkEnableOptionT "core";
# Ssh configuration, enabled by default
ssh = mkEnableOptionT "ssh";
# Fish configuration, enabled by default
fish = mkEnableOptionT "fish";
# Git configuration, enabled by default
git = {
enable = mkEnableOptionT "git";
gpgSign = mkDefaultOption "git signatures" config.nathan.config.isDesktop;
};
# Bat configuration, enabled by default
bat = mkEnableOptionT "bat";
# JSON Utilities, enabled by default
json = mkEnableOptionT "json";
# Productivity application
productivity = mkDefaultOption "Productivity applications" config.nathan.config.isDesktop;
};
# Development applications, enabled by default on desktop
devel = {
core = mkDefaultOption "Core Development Utilites" config.nathan.config.isDesktop;
rust = mkDefaultOption "Rust Development Utilites" config.nathan.config.isDesktop;
jvm = mkDefaultOption "JVM Development Utilites" config.nathan.config.isDesktop;
python = mkDefaultOption "Python Development Utilites" config.nathan.config.isDesktop;
js = mkDefaultOption "JavaScript/TypeScript Development Utilites" config.nathan.config.isDesktop;
raku = mkDefaultOption "Raku Development Utilites" config.nathan.config.isDesktop;
};
# Emacs, enabled by default on desktop
emacs = {
enable = mkDefaultOption "Emacs" config.nathan.config.isDesktop;
service = mkDefaultOption "Emacs Service" config.nathan.config.isDesktop;
package = mkOption {
description = "Emacs package to use";
};
};
};
# General configuration options
config = {
# Is this system a desktop?
# false by default
isDesktop = mkEnableOption "Desktop specific settings";
};
};
};
}