mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
convert to proper module layout
This commit is contained in:
parent
bf1d2f1e9e
commit
d040077d3a
@ -59,9 +59,8 @@
|
|||||||
program = "${
|
program = "${
|
||||||
(import ../modules/neovim/package {
|
(import ../modules/neovim/package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors = import ../modules/colorscheme/gruvbox/neovim-gruvbox.nix {
|
colors =
|
||||||
inherit pkgs;
|
import ../colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
|
||||||
};
|
|
||||||
})
|
})
|
||||||
}/bin/nvim";
|
}/bin/nvim";
|
||||||
};
|
};
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
fullName = "Noah Masur";
|
fullName = "Noah Masur";
|
||||||
gitName = fullName;
|
gitName = fullName;
|
||||||
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
||||||
mailServer = "noahmasur.com";
|
mail.server = "noahmasur.com";
|
||||||
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -154,9 +154,8 @@
|
|||||||
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
in import ./modules/neovim/package {
|
in import ./modules/neovim/package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors = import ./modules/colorscheme/gruvbox/neovim-gruvbox.nix {
|
colors =
|
||||||
inherit pkgs;
|
import ./colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -10,6 +10,7 @@ nixpkgs.lib.nixosSystem {
|
|||||||
globals
|
globals
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
|
physical = true;
|
||||||
networking.hostName = "desktop";
|
networking.hostName = "desktop";
|
||||||
nixpkgs.overlays = [ nur.overlay ];
|
nixpkgs.overlays = [ nur.overlay ];
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
@ -17,32 +18,32 @@ nixpkgs.lib.nixosSystem {
|
|||||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||||
gui.enable = true;
|
gui.enable = true;
|
||||||
theme = {
|
theme = {
|
||||||
colors = (import ../../modules/colorscheme/gruvbox).dark;
|
colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
dark = true;
|
dark = true;
|
||||||
};
|
};
|
||||||
wallpaper = "${wallpapers}/gruvbox/road.jpg";
|
wallpaper = "${wallpapers}/gruvbox/road.jpg";
|
||||||
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark";
|
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark";
|
||||||
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
||||||
|
|
||||||
|
media.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
|
kitty.enable = true;
|
||||||
|
"1password".enable = true;
|
||||||
|
discord.enable = true;
|
||||||
|
nautilus.enable = true;
|
||||||
|
obsidian.enable = true;
|
||||||
|
mail.aerc.enable = true;
|
||||||
|
mail.himalaya.enable = true;
|
||||||
|
gaming.enable = true;
|
||||||
|
gaming.steam.enable = true;
|
||||||
|
gaming.legendary.enable = true;
|
||||||
|
keybase.enable = true;
|
||||||
|
mullvad.enable = true;
|
||||||
|
nixlang.enable = true;
|
||||||
|
dotfiles.enable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../common.nix
|
../../modules
|
||||||
../../modules/hardware
|
|
||||||
../../modules/nixos
|
|
||||||
../../modules/graphical
|
|
||||||
../../modules/applications/media.nix
|
|
||||||
../../modules/applications/firefox.nix
|
|
||||||
../../modules/applications/kitty.nix
|
|
||||||
../../modules/applications/1password.nix
|
|
||||||
../../modules/applications/discord.nix
|
|
||||||
../../modules/applications/nautilus.nix
|
|
||||||
../../modules/applications/obsidian.nix
|
|
||||||
../../modules/mail
|
|
||||||
../../modules/gaming/steam.nix
|
|
||||||
../../modules/gaming/legendary.nix
|
|
||||||
../../modules/repositories/notes.nix
|
|
||||||
../../modules/services/keybase.nix
|
|
||||||
../../modules/services/mullvad.nix
|
|
||||||
../../modules/programming/nix.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ darwin.lib.darwinSystem {
|
|||||||
system = "x86_64-darwin";
|
system = "x86_64-darwin";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
|
../../modules
|
||||||
(globals // {
|
(globals // {
|
||||||
user = "Noah.Masur";
|
user = "Noah.Masur";
|
||||||
gitName = "Noah-Masur_1701";
|
gitName = "Noah-Masur_1701";
|
||||||
@ -14,30 +15,30 @@ darwin.lib.darwinSystem {
|
|||||||
})
|
})
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
{
|
{
|
||||||
|
networking.hostName = "noah-masur-mac";
|
||||||
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
|
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
|
||||||
gui.enable = true;
|
gui.enable = true;
|
||||||
theme = {
|
theme = {
|
||||||
colors = (import ../../modules/colorscheme/gruvbox).dark;
|
colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
dark = true;
|
dark = true;
|
||||||
};
|
};
|
||||||
mailUser = globals.user;
|
mail.user = globals.user;
|
||||||
networking.hostName = "noah-masur-mac";
|
|
||||||
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
|
|
||||||
|
mail.aerc.enable = true;
|
||||||
|
mail.himalaya.enable = true;
|
||||||
|
kitty.enable = true;
|
||||||
|
discord.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
|
dotfiles.enable = true;
|
||||||
|
nixlang.enable = true;
|
||||||
|
terraform.enable = true;
|
||||||
|
python.enable = true;
|
||||||
|
lua.enable = true;
|
||||||
|
kubernetes.enable = true;
|
||||||
|
"1password".enable = true;
|
||||||
}
|
}
|
||||||
../common.nix
|
|
||||||
../../modules/darwin
|
|
||||||
../../modules/mail
|
|
||||||
../../modules/applications/alacritty.nix
|
|
||||||
../../modules/applications/kitty.nix
|
|
||||||
../../modules/applications/discord.nix
|
|
||||||
../../modules/applications/firefox.nix
|
|
||||||
../../modules/repositories/notes.nix
|
|
||||||
../../modules/programming/nix.nix
|
|
||||||
../../modules/programming/terraform.nix
|
|
||||||
../../modules/programming/python.nix
|
|
||||||
../../modules/programming/lua.nix
|
|
||||||
../../modules/programming/kubernetes.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,14 @@ nixpkgs.lib.nixosSystem {
|
|||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
(removeAttrs globals [ "mailServer" ])
|
./hardware-configuration.nix
|
||||||
|
../../modules
|
||||||
|
(removeAttrs globals [ "mail.server" ])
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
|
server = true;
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
theme = { colors = (import ../../modules/colorscheme/gruvbox).dark; };
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
|
|
||||||
# FQDNs for various services
|
# FQDNs for various services
|
||||||
@ -33,7 +36,7 @@ nixpkgs.lib.nixosSystem {
|
|||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||||
|
|
||||||
# Nextcloud backup config
|
# Nextcloud backup config
|
||||||
backupS3 = {
|
backup.s3 = {
|
||||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||||
bucket = "noahmasur-backup";
|
bucket = "noahmasur-backup";
|
||||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||||
@ -72,20 +75,16 @@ nixpkgs.lib.nixosSystem {
|
|||||||
|
|
||||||
# Grant access to Transmission directories from Jellyfin
|
# Grant access to Transmission directories from Jellyfin
|
||||||
users.users.jellyfin.extraGroups = [ "transmission" ];
|
users.users.jellyfin.extraGroups = [ "transmission" ];
|
||||||
|
|
||||||
|
# Proxy traffic with Cloudflare
|
||||||
|
cloudflare.enable = true;
|
||||||
|
|
||||||
|
# Setup Minecraft server
|
||||||
|
gaming.minecraft-server.enable = true;
|
||||||
|
|
||||||
|
# Clone dotfiles
|
||||||
|
dotfiles.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
./hardware-configuration.nix
|
|
||||||
../common.nix
|
|
||||||
../../modules/nixos
|
|
||||||
../../modules/hardware/server.nix
|
|
||||||
../../modules/services/sshd.nix
|
|
||||||
../../modules/services/calibre.nix
|
|
||||||
../../modules/services/jellyfin.nix
|
|
||||||
../../modules/services/nextcloud.nix
|
|
||||||
../../modules/services/cloudflare.nix
|
|
||||||
../../modules/services/transmission.nix
|
|
||||||
../../modules/services/prometheus.nix
|
|
||||||
../../modules/services/vaultwarden.nix
|
|
||||||
../../modules/services/gitea.nix
|
|
||||||
../../modules/gaming/minecraft-server.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ nixpkgs.lib.nixosSystem {
|
|||||||
globals
|
globals
|
||||||
wsl.nixosModules.wsl
|
wsl.nixosModules.wsl
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
|
../../modules
|
||||||
{
|
{
|
||||||
networking.hostName = "wsl";
|
networking.hostName = "wsl";
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
@ -17,7 +18,7 @@ nixpkgs.lib.nixosSystem {
|
|||||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
theme = {
|
theme = {
|
||||||
colors = (import ../../modules/colorscheme/gruvbox).dark;
|
colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
dark = true;
|
dark = true;
|
||||||
};
|
};
|
||||||
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
||||||
@ -30,13 +31,12 @@ nixpkgs.lib.nixosSystem {
|
|||||||
interop.includePath =
|
interop.includePath =
|
||||||
false; # Including Windows PATH will slow down Neovim command mode
|
false; # Including Windows PATH will slow down Neovim command mode
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mail.aerc.enable = true;
|
||||||
|
mail.himalaya.enable = true;
|
||||||
|
dotfiles.enable = true;
|
||||||
|
nixlang.enable = true;
|
||||||
|
lua.enable = true;
|
||||||
}
|
}
|
||||||
../common.nix
|
|
||||||
../../modules/wsl
|
|
||||||
../../modules/nixos
|
|
||||||
../../modules/mail
|
|
||||||
../../modules/repositories/notes.nix
|
|
||||||
../../modules/programming/nix.nix
|
|
||||||
../../modules/programming/lua.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
unfreePackages = [ "1password" "_1password-gui" ];
|
"1password" = {
|
||||||
home-manager.users.${config.user} = {
|
enable = lib.mkEnableOption {
|
||||||
home.packages = with pkgs; [ _1password-gui ];
|
description = "Enable 1Password.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf
|
||||||
|
(config.gui.enable && config."1password".enable && pkgs.stdenv.isLinux) {
|
||||||
|
unfreePackages = [ "1password" "_1password-gui" ];
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
home.packages = with pkgs; [ _1password-gui ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
alacritty = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Alacritty.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.alacritty.enable) {
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
xsession.windowManager.i3.config.terminal = "alacritty";
|
xsession.windowManager.i3.config.terminal = "alacritty";
|
||||||
programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty";
|
programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty";
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
calibre = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Calibre.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.calibre.enable) {
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [ calibre ];
|
home.packages = with pkgs; [ calibre ];
|
||||||
# home.sessionVariables = { CALIBRE_USE_DARK_PALETTE = 1; };
|
# home.sessionVariables = { CALIBRE_USE_DARK_PALETTE = 1; };
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
discord = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Discord.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||||
unfreePackages = [ "discord" ];
|
unfreePackages = [ "discord" ];
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [ discord ];
|
home.packages = with pkgs; [ discord ];
|
||||||
|
@ -1,13 +1,26 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf config.gui.enable {
|
|
||||||
|
|
||||||
unfreePackages = [ "onepassword-password-manager" "okta-browser-plugin" ];
|
options = {
|
||||||
|
firefox = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Firefox.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
||||||
|
|
||||||
|
unfreePackages = [
|
||||||
|
(lib.mkIf config."1password".enable "onepassword-password-manager")
|
||||||
|
"okta-browser-plugin"
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
programs.firefox = rec {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||||
@ -17,7 +30,7 @@
|
|||||||
multi-account-containers
|
multi-account-containers
|
||||||
facebook-container
|
facebook-container
|
||||||
temporary-containers
|
temporary-containers
|
||||||
onepassword-password-manager
|
(lib.mkIf config."1password".enable onepassword-password-manager)
|
||||||
okta-browser-plugin
|
okta-browser-plugin
|
||||||
sponsorblock
|
sponsorblock
|
||||||
reddit-enhancement-suite
|
reddit-enhancement-suite
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
kitty = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Kitty.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.kitty.enable) {
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
# xsession.windowManager.i3.config.terminal = "kitty";
|
# xsession.windowManager.i3.config.terminal = "kitty";
|
||||||
# programs.rofi.terminal = "${pkgs.kitty}/bin/kitty";
|
# programs.rofi.terminal = "${pkgs.kitty}/bin/kitty";
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
media = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable media programs.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.media.enable) {
|
||||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
home-manager.users.${config.user}.home.packages = with pkgs; [
|
||||||
mpv # Video viewer
|
mpv # Video viewer
|
||||||
sxiv # Image viewer
|
sxiv # Image viewer
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
nautilus = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Nautilus file manager.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Install Nautilus file manager
|
# Install Nautilus file manager
|
||||||
config = lib.mkIf config.gui.enable {
|
config = lib.mkIf (config.gui.enable && config.nautilus.enable) {
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
gnome.nautilus
|
gnome.nautilus
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
obsidian = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Obsidian.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
||||||
unfreePackages = [ "obsidian" ];
|
unfreePackages = [ "obsidian" ];
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [ obsidian ];
|
home.packages = with pkgs; [ obsidian ];
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
options = {
|
||||||
|
qbittorrent = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable qBittorrent.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.qbittorrent.enable) {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
M.packer = function(use)
|
|
||||||
use({
|
|
||||||
"lifepillar/vim-gruvbox8",
|
|
||||||
config = function()
|
|
||||||
vim.g.gruvbox_italicize_strings = 0
|
|
||||||
vim.cmd("colorscheme gruvbox8")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
@ -1,7 +1,7 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# MacOS-specific settings for Alacritty
|
# MacOS-specific settings for Alacritty
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
programs.alacritty.settings = {
|
programs.alacritty.settings = {
|
||||||
font.size = lib.mkForce 20.0;
|
font.size = lib.mkForce 20.0;
|
||||||
shell.program = "${pkgs.fish}/bin/fish";
|
shell.program = "${pkgs.fish}/bin/fish";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs;
|
||||||
[ (nerdfonts.override { fonts = [ "VictorMono" ]; }) ];
|
[ (nerdfonts.override { fonts = [ "VictorMono" ]; }) ];
|
||||||
|
@ -1,28 +1,32 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Hammerspoon - MacOS custom automation scripting
|
# Hammerspoon - MacOS custom automation scripting
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
xdg.configFile."hammerspoon/init.lua".source = ./hammerspoon/init.lua;
|
|
||||||
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source =
|
home-manager.users.${config.user} = {
|
||||||
./hammerspoon/Spoons/ControlEscape.spoon;
|
xdg.configFile."hammerspoon/init.lua".source = ./hammerspoon/init.lua;
|
||||||
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source =
|
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source =
|
||||||
./hammerspoon/Spoons/DismissAlerts.spoon;
|
./hammerspoon/Spoons/ControlEscape.spoon;
|
||||||
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source =
|
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source =
|
||||||
pkgs.substituteAll {
|
./hammerspoon/Spoons/DismissAlerts.spoon;
|
||||||
src = ./hammerspoon/Spoons/Launcher.spoon/init.lua;
|
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source =
|
||||||
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
pkgs.substituteAll {
|
||||||
discord = "${pkgs.discord}/Applications/Discord.app";
|
src = ./hammerspoon/Spoons/Launcher.spoon/init.lua;
|
||||||
kitty = "${pkgs.kitty}/Applications/kitty.app";
|
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
||||||
};
|
discord = "${pkgs.discord}/Applications/Discord.app";
|
||||||
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source =
|
kitty = "${pkgs.kitty}/Applications/kitty.app";
|
||||||
./hammerspoon/Spoons/MoveWindow.spoon;
|
};
|
||||||
|
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source =
|
||||||
|
./hammerspoon/Spoons/MoveWindow.spoon;
|
||||||
|
};
|
||||||
|
|
||||||
|
homebrew.casks = [ "hammerspoon" ];
|
||||||
|
|
||||||
|
system.activationScripts.postUserActivation.text = ''
|
||||||
|
defaults write org.hammerspoon.Hammerspoon MJConfigFile "~/.config/hammerspoon/init.lua"
|
||||||
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
homebrew.casks = [ "hammerspoon" ];
|
|
||||||
|
|
||||||
system.activationScripts.postUserActivation.text = ''
|
|
||||||
defaults write org.hammerspoon.Hammerspoon MJConfigFile "~/.config/hammerspoon/init.lua"
|
|
||||||
'';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,52 +1,55 @@
|
|||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Homebrew - Mac-specific packages that aren't in Nix
|
# Homebrew - Mac-specific packages that aren't in Nix
|
||||||
|
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
# Requires Homebrew to be installed
|
# Requires Homebrew to be installed
|
||||||
system.activationScripts.preUserActivation.text = ''
|
system.activationScripts.preUserActivation.text = ''
|
||||||
if ! xcode-select --version 2>/dev/null; then
|
if ! xcode-select --version 2>/dev/null; then
|
||||||
$DRY_RUN_CMD xcode-select --install
|
$DRY_RUN_CMD xcode-select --install
|
||||||
fi
|
fi
|
||||||
if ! /usr/local/bin/brew --version 2>/dev/null; then
|
if ! /usr/local/bin/brew --version 2>/dev/null; then
|
||||||
$DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
$DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
homebrew = {
|
homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
onActivation = {
|
onActivation = {
|
||||||
autoUpdate = false; # Don't update during rebuild
|
autoUpdate = false; # Don't update during rebuild
|
||||||
cleanup = "zap"; # Uninstall all programs not declared
|
cleanup = "zap"; # Uninstall all programs not declared
|
||||||
upgrade = true;
|
upgrade = true;
|
||||||
|
};
|
||||||
|
global = {
|
||||||
|
brewfile = true; # Run brew bundle from anywhere
|
||||||
|
lockfiles = false; # Don't save lockfile (since running from anywhere)
|
||||||
|
};
|
||||||
|
taps = [
|
||||||
|
"homebrew/cask" # Required for casks
|
||||||
|
"homebrew/cask-drivers" # Used for Logitech G-Hub
|
||||||
|
];
|
||||||
|
brews = [
|
||||||
|
"trash" # Delete files and folders to trash instead of rm
|
||||||
|
"openjdk" # Required by Apache Directory Studio
|
||||||
|
];
|
||||||
|
casks = [
|
||||||
|
"1password" # 1Password packaging on Nix is broken for macOS
|
||||||
|
"scroll-reverser" # Different scroll style for mouse vs. trackpad
|
||||||
|
"meetingbar" # Show meetings in menu bar
|
||||||
|
"gitify" # Git notifications in menu bar
|
||||||
|
"logitech-g-hub" # Mouse and keyboard management
|
||||||
|
"mimestream" # Gmail client
|
||||||
|
"obsidian" # Obsidian packaging on Nix is not available for macOS
|
||||||
|
"steam" # Not packaged for Nix
|
||||||
|
"apache-directory-studio" # Packaging on Nix is not available for macOS
|
||||||
|
];
|
||||||
};
|
};
|
||||||
global = {
|
|
||||||
brewfile = true; # Run brew bundle from anywhere
|
home-manager.users.${config.user} = {
|
||||||
lockfiles = false; # Don't save lockfile (since running from anywhere)
|
|
||||||
|
programs.fish.shellAbbrs.t = "trash";
|
||||||
|
|
||||||
};
|
};
|
||||||
taps = [
|
|
||||||
"homebrew/cask" # Required for casks
|
|
||||||
"homebrew/cask-drivers" # Used for Logitech G-Hub
|
|
||||||
];
|
|
||||||
brews = [
|
|
||||||
"trash" # Delete files and folders to trash instead of rm
|
|
||||||
"openjdk" # Required by Apache Directory Studio
|
|
||||||
];
|
|
||||||
casks = [
|
|
||||||
"1password" # 1Password packaging on Nix is broken for macOS
|
|
||||||
"scroll-reverser" # Different scroll style for mouse vs. trackpad
|
|
||||||
"meetingbar" # Show meetings in menu bar
|
|
||||||
"gitify" # Git notifications in menu bar
|
|
||||||
"logitech-g-hub" # Mouse and keyboard management
|
|
||||||
"mimestream" # Gmail client
|
|
||||||
"obsidian" # Obsidian packaging on Nix is not available for macOS
|
|
||||||
"steam" # Not packaged for Nix
|
|
||||||
"apache-directory-studio" # Packaging on Nix is not available for macOS
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
|
|
||||||
programs.fish.shellAbbrs.t = "trash";
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# MacOS-specific settings for Kitty
|
# MacOS-specific settings for Kitty
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
darwinLaunchOptions = [ "--start-as=fullscreen" ];
|
darwinLaunchOptions = [ "--start-as=fullscreen" ];
|
||||||
font.size = lib.mkForce 20;
|
font.size = lib.mkForce 20;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
networking = {
|
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
computerName = "${config.fullName}'\\''s Mac";
|
networking = {
|
||||||
# Adjust if necessary
|
computerName = "${config.fullName}'\\''s Mac";
|
||||||
# hostName = "";
|
# Adjust if necessary
|
||||||
|
# hostName = "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
|
@ -1,182 +1,186 @@
|
|||||||
{ pkgs, ... }: {
|
{ pkgs, lib, ... }: {
|
||||||
|
|
||||||
services.nix-daemon.enable = true;
|
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
environment.shells = [ pkgs.fish ];
|
services.nix-daemon.enable = true;
|
||||||
|
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
environment.shells = [ pkgs.fish ];
|
||||||
|
|
||||||
system = {
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
|
|
||||||
keyboard = {
|
system = {
|
||||||
remapCapsLockToControl = true;
|
|
||||||
enableKeyMapping = true; # Allows for skhd
|
|
||||||
};
|
|
||||||
|
|
||||||
defaults = {
|
keyboard = {
|
||||||
NSGlobalDomain = {
|
remapCapsLockToControl = true;
|
||||||
|
enableKeyMapping = true; # Allows for skhd
|
||||||
# Set to dark mode
|
|
||||||
AppleInterfaceStyle = "Dark";
|
|
||||||
|
|
||||||
# Don't change from dark to light automatically
|
|
||||||
# AppleInterfaceSwitchesAutomatically = false;
|
|
||||||
|
|
||||||
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
|
|
||||||
AppleKeyboardUIMode = 3;
|
|
||||||
|
|
||||||
# Automatically show and hide the menu bar
|
|
||||||
_HIHideMenuBar = true;
|
|
||||||
|
|
||||||
# Expand save panel by default
|
|
||||||
NSNavPanelExpandedStateForSaveMode = true;
|
|
||||||
|
|
||||||
# Expand print panel by default
|
|
||||||
PMPrintingExpandedStateForPrint = true;
|
|
||||||
|
|
||||||
# Replace press-and-hold with key repeat
|
|
||||||
ApplePressAndHoldEnabled = false;
|
|
||||||
|
|
||||||
# Set a fast key repeat rate
|
|
||||||
KeyRepeat = 2;
|
|
||||||
|
|
||||||
# Shorten delay before key repeat begins
|
|
||||||
InitialKeyRepeat = 12;
|
|
||||||
|
|
||||||
# Save to local disk by default, not iCloud
|
|
||||||
NSDocumentSaveNewDocumentsToCloud = false;
|
|
||||||
|
|
||||||
# Disable autocorrect capitalization
|
|
||||||
NSAutomaticCapitalizationEnabled = false;
|
|
||||||
|
|
||||||
# Disable autocorrect smart dashes
|
|
||||||
NSAutomaticDashSubstitutionEnabled = false;
|
|
||||||
|
|
||||||
# Disable autocorrect adding periods
|
|
||||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
|
||||||
|
|
||||||
# Disable autocorrect smart quotation marks
|
|
||||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
|
||||||
|
|
||||||
# Disable autocorrect spellcheck
|
|
||||||
NSAutomaticSpellingCorrectionEnabled = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
dock = {
|
defaults = {
|
||||||
# Automatically show and hide the dock
|
NSGlobalDomain = {
|
||||||
autohide = true;
|
|
||||||
|
|
||||||
# Add translucency in dock for hidden applications
|
# Set to dark mode
|
||||||
showhidden = true;
|
AppleInterfaceStyle = "Dark";
|
||||||
|
|
||||||
# Enable spring loading on all dock items
|
# Don't change from dark to light automatically
|
||||||
enable-spring-load-actions-on-all-items = true;
|
# AppleInterfaceSwitchesAutomatically = false;
|
||||||
|
|
||||||
# Highlight hover effect in dock stack grid view
|
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
|
||||||
mouse-over-hilite-stack = true;
|
AppleKeyboardUIMode = 3;
|
||||||
|
|
||||||
mineffect = "genie";
|
# Automatically show and hide the menu bar
|
||||||
orientation = "bottom";
|
_HIHideMenuBar = true;
|
||||||
show-recents = false;
|
|
||||||
tilesize = 44;
|
|
||||||
};
|
|
||||||
|
|
||||||
finder = {
|
# Expand save panel by default
|
||||||
|
NSNavPanelExpandedStateForSaveMode = true;
|
||||||
|
|
||||||
# Default Finder window set to column view
|
# Expand print panel by default
|
||||||
FXPreferredViewStyle = "clmv";
|
PMPrintingExpandedStateForPrint = true;
|
||||||
|
|
||||||
# Finder search in current folder by default
|
# Replace press-and-hold with key repeat
|
||||||
FXDefaultSearchScope = "SCcf";
|
ApplePressAndHoldEnabled = false;
|
||||||
|
|
||||||
# Disable warning when changing file extension
|
# Set a fast key repeat rate
|
||||||
FXEnableExtensionChangeWarning = false;
|
KeyRepeat = 2;
|
||||||
|
|
||||||
# Allow quitting of Finder application
|
# Shorten delay before key repeat begins
|
||||||
QuitMenuItem = true;
|
InitialKeyRepeat = 12;
|
||||||
|
|
||||||
|
# Save to local disk by default, not iCloud
|
||||||
|
NSDocumentSaveNewDocumentsToCloud = false;
|
||||||
|
|
||||||
|
# Disable autocorrect capitalization
|
||||||
|
NSAutomaticCapitalizationEnabled = false;
|
||||||
|
|
||||||
|
# Disable autocorrect smart dashes
|
||||||
|
NSAutomaticDashSubstitutionEnabled = false;
|
||||||
|
|
||||||
|
# Disable autocorrect adding periods
|
||||||
|
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||||
|
|
||||||
|
# Disable autocorrect smart quotation marks
|
||||||
|
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||||
|
|
||||||
|
# Disable autocorrect spellcheck
|
||||||
|
NSAutomaticSpellingCorrectionEnabled = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dock = {
|
||||||
|
# Automatically show and hide the dock
|
||||||
|
autohide = true;
|
||||||
|
|
||||||
|
# Add translucency in dock for hidden applications
|
||||||
|
showhidden = true;
|
||||||
|
|
||||||
|
# Enable spring loading on all dock items
|
||||||
|
enable-spring-load-actions-on-all-items = true;
|
||||||
|
|
||||||
|
# Highlight hover effect in dock stack grid view
|
||||||
|
mouse-over-hilite-stack = true;
|
||||||
|
|
||||||
|
mineffect = "genie";
|
||||||
|
orientation = "bottom";
|
||||||
|
show-recents = false;
|
||||||
|
tilesize = 44;
|
||||||
|
};
|
||||||
|
|
||||||
|
finder = {
|
||||||
|
|
||||||
|
# Default Finder window set to column view
|
||||||
|
FXPreferredViewStyle = "clmv";
|
||||||
|
|
||||||
|
# Finder search in current folder by default
|
||||||
|
FXDefaultSearchScope = "SCcf";
|
||||||
|
|
||||||
|
# Disable warning when changing file extension
|
||||||
|
FXEnableExtensionChangeWarning = false;
|
||||||
|
|
||||||
|
# Allow quitting of Finder application
|
||||||
|
QuitMenuItem = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# Disable "Are you sure you want to open" dialog
|
||||||
|
LaunchServices.LSQuarantine = false;
|
||||||
|
|
||||||
|
# Disable trackpad tap to click
|
||||||
|
trackpad.Clicking = false;
|
||||||
|
|
||||||
|
# universalaccess = {
|
||||||
|
|
||||||
|
# # Zoom in with Control + Scroll Wheel
|
||||||
|
# closeViewScrollWheelToggle = true;
|
||||||
|
# closeViewZoomFollowsFocus = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Where to save screenshots
|
||||||
|
screencapture.location = "~/Downloads";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable "Are you sure you want to open" dialog
|
# Settings that don't have an option in nix-darwin
|
||||||
LaunchServices.LSQuarantine = false;
|
activationScripts.postActivation.text = ''
|
||||||
|
echo "Disable disk image verification"
|
||||||
|
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||||
|
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||||
|
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||||
|
|
||||||
# Disable trackpad tap to click
|
echo "Avoid creating .DS_Store files on network volumes"
|
||||||
trackpad.Clicking = false;
|
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||||
|
|
||||||
# universalaccess = {
|
echo "Disable the warning before emptying the Trash"
|
||||||
|
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||||
|
|
||||||
# # Zoom in with Control + Scroll Wheel
|
echo "Require password immediately after sleep or screen saver begins"
|
||||||
# closeViewScrollWheelToggle = true;
|
defaults write com.apple.screensaver askForPassword -int 1
|
||||||
# closeViewZoomFollowsFocus = true;
|
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
||||||
# };
|
|
||||||
|
|
||||||
# Where to save screenshots
|
echo "Allow apps from anywhere"
|
||||||
screencapture.location = "~/Downloads";
|
SPCTL=$(spctl --status)
|
||||||
|
if ! [ "$SPCTL" = "assessments disabled" ]; then
|
||||||
|
sudo spctl --master-disable
|
||||||
|
fi
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
# User-level settings
|
||||||
|
activationScripts.postUserActivation.text = ''
|
||||||
|
echo "Show the ~/Library folder"
|
||||||
|
chflags nohidden ~/Library
|
||||||
|
|
||||||
|
echo "Enable dock magnification"
|
||||||
|
defaults write com.apple.dock magnification -bool true
|
||||||
|
|
||||||
|
echo "Set dock magnification size"
|
||||||
|
defaults write com.apple.dock largesize -int 48
|
||||||
|
|
||||||
|
echo "Define dock icon function"
|
||||||
|
__dock_item() {
|
||||||
|
printf "%s%s%s%s%s" \
|
||||||
|
"<dict><key>tile-data</key><dict><key>file-data</key><dict>" \
|
||||||
|
"<key>_CFURLString</key><string>" \
|
||||||
|
"$1" \
|
||||||
|
"</string><key>_CFURLStringType</key><integer>0</integer>" \
|
||||||
|
"</dict></dict></dict>"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Choose and order dock icons"
|
||||||
|
defaults write com.apple.dock persistent-apps -array \
|
||||||
|
"$(__dock_item /Applications/1Password.app)" \
|
||||||
|
"$(__dock_item /Applications/Slack.app)" \
|
||||||
|
"$(__dock_item /System/Applications/Calendar.app)" \
|
||||||
|
"$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
|
||||||
|
"$(__dock_item /System/Applications/Messages.app)" \
|
||||||
|
"$(__dock_item /System/Applications/Mail.app)" \
|
||||||
|
"$(__dock_item /Applications/Mimestream.app)" \
|
||||||
|
"$(__dock_item /Applications/zoom.us.app)" \
|
||||||
|
"$(__dock_item ${pkgs.discord}/Applications/Discord.app)" \
|
||||||
|
"$(__dock_item /Applications/Obsidian.app)" \
|
||||||
|
"$(__dock_item ${pkgs.kitty}/Applications/kitty.app)" \
|
||||||
|
"$(__dock_item /System/Applications/System\ Settings.app)"
|
||||||
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Settings that don't have an option in nix-darwin
|
|
||||||
activationScripts.postActivation.text = ''
|
|
||||||
echo "Disable disk image verification"
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
|
||||||
|
|
||||||
echo "Avoid creating .DS_Store files on network volumes"
|
|
||||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
|
||||||
|
|
||||||
echo "Disable the warning before emptying the Trash"
|
|
||||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
|
||||||
|
|
||||||
echo "Require password immediately after sleep or screen saver begins"
|
|
||||||
defaults write com.apple.screensaver askForPassword -int 1
|
|
||||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
|
||||||
|
|
||||||
echo "Allow apps from anywhere"
|
|
||||||
SPCTL=$(spctl --status)
|
|
||||||
if ! [ "$SPCTL" = "assessments disabled" ]; then
|
|
||||||
sudo spctl --master-disable
|
|
||||||
fi
|
|
||||||
|
|
||||||
'';
|
|
||||||
|
|
||||||
# User-level settings
|
|
||||||
activationScripts.postUserActivation.text = ''
|
|
||||||
echo "Show the ~/Library folder"
|
|
||||||
chflags nohidden ~/Library
|
|
||||||
|
|
||||||
echo "Enable dock magnification"
|
|
||||||
defaults write com.apple.dock magnification -bool true
|
|
||||||
|
|
||||||
echo "Set dock magnification size"
|
|
||||||
defaults write com.apple.dock largesize -int 48
|
|
||||||
|
|
||||||
echo "Define dock icon function"
|
|
||||||
__dock_item() {
|
|
||||||
printf "%s%s%s%s%s" \
|
|
||||||
"<dict><key>tile-data</key><dict><key>file-data</key><dict>" \
|
|
||||||
"<key>_CFURLString</key><string>" \
|
|
||||||
"$1" \
|
|
||||||
"</string><key>_CFURLStringType</key><integer>0</integer>" \
|
|
||||||
"</dict></dict></dict>"
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Choose and order dock icons"
|
|
||||||
defaults write com.apple.dock persistent-apps -array \
|
|
||||||
"$(__dock_item /Applications/1Password.app)" \
|
|
||||||
"$(__dock_item /Applications/Slack.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Calendar.app)" \
|
|
||||||
"$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Messages.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Mail.app)" \
|
|
||||||
"$(__dock_item /Applications/Mimestream.app)" \
|
|
||||||
"$(__dock_item /Applications/zoom.us.app)" \
|
|
||||||
"$(__dock_item ${pkgs.discord}/Applications/Discord.app)" \
|
|
||||||
"$(__dock_item /Applications/Obsidian.app)" \
|
|
||||||
"$(__dock_item ${pkgs.kitty}/Applications/kitty.app)" \
|
|
||||||
"$(__dock_item /System/Applications/System\ Settings.app)"
|
|
||||||
'';
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.tmux.enable = lib.mkEnableOption "Tmux terminal multiplexer";
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = lib.mkIf config.tmux.enable {
|
||||||
|
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,15 +1,21 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
users.users."${config.user}" = {
|
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
# macOS user
|
|
||||||
home = config.homePath;
|
|
||||||
shell = pkgs.fish; # Default shell
|
|
||||||
|
|
||||||
};
|
users.users."${config.user}" = {
|
||||||
|
# macOS user
|
||||||
|
home = config.homePath;
|
||||||
|
shell = pkgs.fish; # Default shell
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# Used for aerc
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
home.sessionVariables = {
|
||||||
|
XDG_CONFIG_HOME = "${config.homePath}/.config";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Used for aerc
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
home.sessionVariables = { XDG_CONFIG_HOME = "${config.homePath}/.config"; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# visidata # CSV inspector
|
# visidata # CSV inspector
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
{ config, lib, pkgs, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
|
|
||||||
imports =
|
imports = [
|
||||||
[ ../modules/shell ../modules/neovim ../modules/repositories/dotfiles.nix ];
|
./applications
|
||||||
|
./darwin
|
||||||
|
./gaming
|
||||||
|
./graphical
|
||||||
|
./hardware
|
||||||
|
./mail
|
||||||
|
./neovim
|
||||||
|
./nixos
|
||||||
|
./programming
|
||||||
|
./repositories
|
||||||
|
./services
|
||||||
|
./shell
|
||||||
|
./wsl
|
||||||
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
@ -36,7 +49,7 @@
|
|||||||
colors = lib.mkOption {
|
colors = lib.mkOption {
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
description = "Base16 color scheme.";
|
description = "Base16 color scheme.";
|
||||||
default = (import ../modules/colorscheme/gruvbox).dark;
|
default = (import ../colorscheme/gruvbox).dark;
|
||||||
};
|
};
|
||||||
dark = lib.mkOption {
|
dark = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
@ -1,6 +1,16 @@
|
|||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = {
|
imports = [
|
||||||
|
./leagueoflegends.nix
|
||||||
|
./legendary.nix
|
||||||
|
./lutris.nix
|
||||||
|
./minecraft-server.nix
|
||||||
|
./steam.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.gaming.enable = lib.mkEnableOption "Enable gaming features.";
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gaming.enable && pkgs.stdenv.isLinux) {
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
|
@ -1,30 +1,32 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
options.gaming.leagueoflegends = lib.mkEnableOption "League of Legends";
|
options.gaming.leagueoflegends.enable =
|
||||||
|
lib.mkEnableOption "League of Legends";
|
||||||
|
|
||||||
config = lib.mkIf config.gaming.leagueoflegends {
|
config =
|
||||||
|
lib.mkIf (config.gaming.leagueoflegends.enable && pkgs.stdenv.isLinux) {
|
||||||
|
|
||||||
# League of Legends anti-cheat requirement
|
# League of Legends anti-cheat requirement
|
||||||
boot.kernel.sysctl = { "abi.vsyscall32" = 0; };
|
boot.kernel.sysctl = { "abi.vsyscall32" = 0; };
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
||||||
# Lutris requirement to install the game
|
# Lutris requirement to install the game
|
||||||
lutris
|
lutris
|
||||||
amdvlk
|
amdvlk
|
||||||
wineWowPackages.stable
|
wineWowPackages.stable
|
||||||
# vulkan-tools
|
# vulkan-tools
|
||||||
|
|
||||||
# Required according to https://lutris.net/games/league-of-legends/
|
# Required according to https://lutris.net/games/league-of-legends/
|
||||||
openssl
|
openssl
|
||||||
gnome.zenity
|
gnome.zenity
|
||||||
|
|
||||||
# Don't remember if this is required
|
# Don't remember if this is required
|
||||||
dconf
|
dconf
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.sessionVariables = { QT_X11_NO_MITSHM = "1"; };
|
environment.sessionVariables = { QT_X11_NO_MITSHM = "1"; };
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,10 @@ let home-packages = config.home-manager.users.${config.user}.home.packages;
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
imports = [ ./. ];
|
options.gaming.legendary.enable =
|
||||||
|
lib.mkEnableOption "Legendary Epic Games launcher.";
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.gaming.legendary.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
legendary-gl
|
legendary-gl
|
||||||
rare # GUI for Legendary (not working)
|
rare # GUI for Legendary (not working)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
options.gaming.lutris = lib.mkEnableOption "Lutris";
|
options.gaming.lutris.enable = lib.mkEnableOption "Lutris game installer.";
|
||||||
|
|
||||||
config = lib.mkIf config.gaming.lutris {
|
config = lib.mkIf config.gaming.lutris.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
lutris
|
lutris
|
||||||
amdvlk # Vulkan drivers (probably already installed)
|
amdvlk # Vulkan drivers (probably already installed)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -9,137 +9,144 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
unfreePackages = [ "minecraft-server" ];
|
options.gaming.minecraft-server.enable =
|
||||||
|
lib.mkEnableOption "Minecraft Server.";
|
||||||
|
|
||||||
services.minecraft-server = {
|
config = lib.mkIf config.gaming.minecraft-server.enable {
|
||||||
enable = true;
|
|
||||||
eula = true;
|
unfreePackages = [ "minecraft-server" ];
|
||||||
declarative = true;
|
|
||||||
whitelist = { };
|
services.minecraft-server = {
|
||||||
openFirewall = false;
|
enable = true;
|
||||||
serverProperties = {
|
eula = true;
|
||||||
server-port = localPort;
|
declarative = true;
|
||||||
difficulty = "normal";
|
whitelist = { };
|
||||||
gamemode = "survival";
|
openFirewall = false;
|
||||||
white-list = false;
|
serverProperties = {
|
||||||
enforce-whitelist = false;
|
server-port = localPort;
|
||||||
level-name = "world";
|
difficulty = "normal";
|
||||||
motd = "Welcome!";
|
gamemode = "survival";
|
||||||
pvp = true;
|
white-list = false;
|
||||||
player-idle-timeout = 30;
|
enforce-whitelist = false;
|
||||||
generate-structures = true;
|
level-name = "world";
|
||||||
max-players = 20;
|
motd = "Welcome!";
|
||||||
snooper-enabled = false;
|
pvp = true;
|
||||||
spawn-npcs = true;
|
player-idle-timeout = 30;
|
||||||
spawn-animals = true;
|
generate-structures = true;
|
||||||
spawn-monsters = true;
|
max-players = 20;
|
||||||
allow-nether = true;
|
snooper-enabled = false;
|
||||||
allow-flight = false;
|
spawn-npcs = true;
|
||||||
enable-rcon = true;
|
spawn-animals = true;
|
||||||
"rcon.port" = rconPort;
|
spawn-monsters = true;
|
||||||
"rcon.password" = rconPassword;
|
allow-nether = true;
|
||||||
|
allow-flight = false;
|
||||||
|
enable-rcon = true;
|
||||||
|
"rcon.port" = rconPort;
|
||||||
|
"rcon.password" = rconPassword;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ publicPort ];
|
networking.firewall.allowedTCPPorts = [ publicPort ];
|
||||||
|
|
||||||
## Automatically start and stop Minecraft server based on player connections
|
## Automatically start and stop Minecraft server based on player connections
|
||||||
|
|
||||||
# Adapted shamelessly from:
|
# Adapted shamelessly from:
|
||||||
# https://dataswamp.org/~solene/2022-08-20-on-demand-minecraft-with-systemd.html
|
# https://dataswamp.org/~solene/2022-08-20-on-demand-minecraft-with-systemd.html
|
||||||
|
|
||||||
# Prevent Minecraft from starting by default
|
# Prevent Minecraft from starting by default
|
||||||
systemd.services.minecraft-server = { wantedBy = pkgs.lib.mkForce [ ]; };
|
systemd.services.minecraft-server = { wantedBy = pkgs.lib.mkForce [ ]; };
|
||||||
|
|
||||||
# Listen for connections on the public port, to trigger the actual
|
# Listen for connections on the public port, to trigger the actual
|
||||||
# listen-minecraft service.
|
# listen-minecraft service.
|
||||||
systemd.sockets.listen-minecraft = {
|
systemd.sockets.listen-minecraft = {
|
||||||
wantedBy = [ "sockets.target" ];
|
wantedBy = [ "sockets.target" ];
|
||||||
requires = [ "network.target" ];
|
requires = [ "network.target" ];
|
||||||
listenStreams = [ "${toString publicPort}" ];
|
listenStreams = [ "${toString publicPort}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Proxy traffic to local port, and trigger hook-minecraft
|
# Proxy traffic to local port, and trigger hook-minecraft
|
||||||
systemd.services.listen-minecraft = {
|
systemd.services.listen-minecraft = {
|
||||||
path = [ pkgs.systemd ];
|
path = [ pkgs.systemd ];
|
||||||
requires = [ "hook-minecraft.service" "listen-minecraft.socket" ];
|
requires = [ "hook-minecraft.service" "listen-minecraft.socket" ];
|
||||||
after = [ "hook-minecraft.service" "listen-minecraft.socket" ];
|
after = [ "hook-minecraft.service" "listen-minecraft.socket" ];
|
||||||
serviceConfig.ExecStart =
|
serviceConfig.ExecStart =
|
||||||
"${pkgs.systemd.out}/lib/systemd/systemd-socket-proxyd 127.0.0.1:${
|
"${pkgs.systemd.out}/lib/systemd/systemd-socket-proxyd 127.0.0.1:${
|
||||||
toString localPort
|
|
||||||
}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Start Minecraft if required and wait for it to be available
|
|
||||||
# Then unlock the listen-minecraft.service
|
|
||||||
systemd.services.hook-minecraft = {
|
|
||||||
path = with pkgs; [ systemd libressl busybox ];
|
|
||||||
|
|
||||||
# Start Minecraft and the auto-shutdown timer
|
|
||||||
script = ''
|
|
||||||
systemctl start minecraft-server.service
|
|
||||||
systemctl start stop-minecraft.timer
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Keep checking until the service is available
|
|
||||||
postStart = ''
|
|
||||||
for i in $(seq 60); do
|
|
||||||
if ${pkgs.libressl.nc}/bin/nc -z 127.0.0.1 ${
|
|
||||||
toString localPort
|
toString localPort
|
||||||
} > /dev/null ; then
|
}";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Start Minecraft if required and wait for it to be available
|
||||||
|
# Then unlock the listen-minecraft.service
|
||||||
|
systemd.services.hook-minecraft = {
|
||||||
|
path = with pkgs; [ systemd libressl busybox ];
|
||||||
|
|
||||||
|
# Start Minecraft and the auto-shutdown timer
|
||||||
|
script = ''
|
||||||
|
systemctl start minecraft-server.service
|
||||||
|
systemctl start stop-minecraft.timer
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Keep checking until the service is available
|
||||||
|
postStart = ''
|
||||||
|
for i in $(seq 60); do
|
||||||
|
if ${pkgs.libressl.nc}/bin/nc -z 127.0.0.1 ${
|
||||||
|
toString localPort
|
||||||
|
} > /dev/null ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
${pkgs.busybox.out}/bin/sleep 1
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Run a player check on a schedule for auto-shutdown
|
||||||
|
systemd.timers.stop-minecraft = {
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*-*-* *:*:0/20"; # Every 20 seconds
|
||||||
|
Unit = "stop-minecraft.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# If no players are connected, then stop services and prepare to resume again
|
||||||
|
systemd.services.stop-minecraft = {
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
script = ''
|
||||||
|
# Check when service was launched
|
||||||
|
servicestartsec=$(
|
||||||
|
date -d \
|
||||||
|
"$(systemctl show \
|
||||||
|
--property=ActiveEnterTimestamp \
|
||||||
|
minecraft-server.service \
|
||||||
|
| cut -d= -f2)" \
|
||||||
|
+%s)
|
||||||
|
|
||||||
|
# Calculate elapsed time
|
||||||
|
serviceelapsedsec=$(( $(date +%s) - servicestartsec))
|
||||||
|
|
||||||
|
# Ignore if service just started
|
||||||
|
if [ $serviceelapsedsec -lt 180 ]
|
||||||
|
then
|
||||||
|
echo "Server was just started"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
${pkgs.busybox.out}/bin/sleep 1
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Run a player check on a schedule for auto-shutdown
|
PLAYERS=$(
|
||||||
systemd.timers.stop-minecraft = {
|
printf "list\n" \
|
||||||
timerConfig = {
|
| ${pkgs.rcon.out}/bin/rcon -m \
|
||||||
OnCalendar = "*-*-* *:*:0/20"; # Every 20 seconds
|
-H 127.0.0.1 -p ${builtins.toString rconPort} -P ${rconPassword} \
|
||||||
Unit = "stop-minecraft.service";
|
)
|
||||||
|
|
||||||
|
if echo "$PLAYERS" | grep "are 0 of a"
|
||||||
|
then
|
||||||
|
echo "Stopping server"
|
||||||
|
systemctl stop minecraft-server.service
|
||||||
|
systemctl stop hook-minecraft.service
|
||||||
|
systemctl stop stop-minecraft.timer
|
||||||
|
fi
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
# If no players are connected, then stop services and prepare to resume again
|
|
||||||
systemd.services.stop-minecraft = {
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
script = ''
|
|
||||||
# Check when service was launched
|
|
||||||
servicestartsec=$(
|
|
||||||
date -d \
|
|
||||||
"$(systemctl show \
|
|
||||||
--property=ActiveEnterTimestamp \
|
|
||||||
minecraft-server.service \
|
|
||||||
| cut -d= -f2)" \
|
|
||||||
+%s)
|
|
||||||
|
|
||||||
# Calculate elapsed time
|
|
||||||
serviceelapsedsec=$(( $(date +%s) - servicestartsec))
|
|
||||||
|
|
||||||
# Ignore if service just started
|
|
||||||
if [ $serviceelapsedsec -lt 180 ]
|
|
||||||
then
|
|
||||||
echo "Server was just started"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
PLAYERS=$(
|
|
||||||
printf "list\n" \
|
|
||||||
| ${pkgs.rcon.out}/bin/rcon -m \
|
|
||||||
-H 127.0.0.1 -p ${builtins.toString rconPort} -P ${rconPassword} \
|
|
||||||
)
|
|
||||||
|
|
||||||
if echo "$PLAYERS" | grep "are 0 of a"
|
|
||||||
then
|
|
||||||
echo "Stopping server"
|
|
||||||
systemctl stop minecraft-server.service
|
|
||||||
systemctl stop hook-minecraft.service
|
|
||||||
systemctl stop stop-minecraft.timer
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./. ];
|
options.gaming.steam.enable = lib.mkEnableOption "Steam game launcher.";
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (config.gaming.steam.enable && pkgs.stdenv.isLinux) {
|
||||||
hardware.steam-hardware.enable = true;
|
hardware.steam-hardware.enable = true;
|
||||||
unfreePackages = [ "steam" "steam-original" "steamcmd" "steam-run" ];
|
unfreePackages = [ "steam" "steam-original" "steamcmd" "steam-run" ];
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
config = lib.mkIf config.services.xserver.enable {
|
options.gui.dmenu.enable = lib.mkEnableOption "dmenu launcher.";
|
||||||
|
|
||||||
|
config = lib.mkIf (config.services.xserver.enable && config.dmenu.enable) {
|
||||||
|
|
||||||
home-manager.users.${config.user}.home.packages = [ pkgs.dmenu ];
|
home-manager.users.${config.user}.home.packages = [ pkgs.dmenu ];
|
||||||
gui.launcherCommand = "${pkgs.dmenu}/bin/dmenu_run";
|
gui.launcherCommand = "${pkgs.dmenu}/bin/dmenu_run";
|
||||||
|
@ -4,7 +4,7 @@ let fontName = "Victor Mono";
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config = lib.mkIf (config.gui.enable && pkgs.stdenv.isLinux) {
|
||||||
|
|
||||||
fonts.fonts = with pkgs; [
|
fonts.fonts = with pkgs; [
|
||||||
victor-mono # Used for Vim and Terminal
|
victor-mono # Used for Vim and Terminal
|
||||||
|
@ -9,7 +9,7 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
|
||||||
services.xserver.windowManager = {
|
services.xserver.windowManager = {
|
||||||
i3 = {
|
i3 = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ config, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf (config.services.xserver.enable) {
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
services.picom = {
|
services.picom = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.services.xserver.enable {
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
||||||
|
|
||||||
toggleBarCommand = "polybar-msg cmd toggle";
|
toggleBarCommand = "polybar-msg cmd toggle";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
config = lib.mkIf config.services.xserver.enable {
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
@ -15,11 +15,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
|
|
||||||
gtkTheme = {
|
gtkTheme = {
|
||||||
name = config.gtk.theme.name;
|
name = config.gtk.theme.name;
|
||||||
package = pkgs."${config.gtk.theme.package}";
|
package = pkgs."${config.gtk.theme.package}";
|
||||||
};
|
};
|
||||||
in lib.mkIf config.gui.enable {
|
|
||||||
|
in lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) {
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
@ -30,7 +30,7 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) {
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
# Enable PipeWire
|
# Enable PipeWire
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
boot.loader = {
|
boot.loader = lib.mkIf (config.physical && pkgs.stdenv.isLinux) {
|
||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }: {
|
{ lib, ... }: {
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./audio.nix
|
./audio.nix
|
||||||
@ -11,4 +11,9 @@
|
|||||||
./wifi.nix
|
./wifi.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
physical = lib.mkEnableOption "Whether this machine is a physical device.";
|
||||||
|
server = lib.mkEnableOption "Whether this machine is a server.";
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,51 +3,52 @@
|
|||||||
# Timezone required for Redshift schedule
|
# Timezone required for Redshift schedule
|
||||||
imports = [ ../nixos/timezone.nix ];
|
imports = [ ../nixos/timezone.nix ];
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config =
|
||||||
|
lib.mkIf (config.gui.enable && config.physical && pkgs.stdenv.isLinux) {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs;
|
environment.systemPackages = with pkgs;
|
||||||
[
|
[
|
||||||
ddcutil # Monitor brightness control
|
ddcutil # Monitor brightness control
|
||||||
];
|
];
|
||||||
|
|
||||||
# Reduce blue light at night
|
# Reduce blue light at night
|
||||||
services.redshift = {
|
services.redshift = {
|
||||||
enable = true;
|
enable = true;
|
||||||
brightness = {
|
brightness = {
|
||||||
day = "1.0";
|
day = "1.0";
|
||||||
night = "1.0";
|
night = "1.0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Detect monitors (brightness) for ddcutil
|
||||||
|
hardware.i2c.enable = true;
|
||||||
|
|
||||||
|
# Grant main user access to external monitors
|
||||||
|
users.users.${config.user}.extraGroups = [ "i2c" ];
|
||||||
|
|
||||||
|
services.xserver.displayManager = {
|
||||||
|
|
||||||
|
# Put the login screen on the left monitor
|
||||||
|
lightdm.greeters.gtk.extraConfig = ''
|
||||||
|
active-monitor=0
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Set up screen position and rotation
|
||||||
|
setupCommands = ''
|
||||||
|
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 \
|
||||||
|
--mode 1920x1200 \
|
||||||
|
--pos 1920x0 \
|
||||||
|
--rotate left \
|
||||||
|
--output HDMI-0 \
|
||||||
|
--primary \
|
||||||
|
--mode 1920x1080 \
|
||||||
|
--pos 0x560 \
|
||||||
|
--rotate normal \
|
||||||
|
--output DVI-0 --off \
|
||||||
|
--output DVI-1 --off \
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Detect monitors (brightness) for ddcutil
|
|
||||||
hardware.i2c.enable = true;
|
|
||||||
|
|
||||||
# Grant main user access to external monitors
|
|
||||||
users.users.${config.user}.extraGroups = [ "i2c" ];
|
|
||||||
|
|
||||||
services.xserver.displayManager = {
|
|
||||||
|
|
||||||
# Put the login screen on the left monitor
|
|
||||||
lightdm.greeters.gtk.extraConfig = ''
|
|
||||||
active-monitor=0
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Set up screen position and rotation
|
|
||||||
setupCommands = ''
|
|
||||||
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 \
|
|
||||||
--mode 1920x1200 \
|
|
||||||
--pos 1920x0 \
|
|
||||||
--rotate left \
|
|
||||||
--output HDMI-0 \
|
|
||||||
--primary \
|
|
||||||
--mode 1920x1080 \
|
|
||||||
--pos 0x560 \
|
|
||||||
--rotate normal \
|
|
||||||
--output DVI-0 --off \
|
|
||||||
--output DVI-1 --off \
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = lib.mkIf config.gui.enable {
|
config =
|
||||||
|
lib.mkIf (config.gui.enable && config.physical && pkgs.stdenv.isLinux) {
|
||||||
|
|
||||||
# Mouse customization
|
# Mouse customization
|
||||||
services.ratbagd.enable = true;
|
services.ratbagd.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
libratbag # Mouse adjustments
|
libratbag # Mouse adjustments
|
||||||
piper # Mouse adjustments GUI
|
piper # Mouse adjustments GUI
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.xserver.libinput.mouse = {
|
||||||
|
# Disable mouse acceleration
|
||||||
|
accelProfile = "flat";
|
||||||
|
accelSpeed = "1.15";
|
||||||
|
};
|
||||||
|
|
||||||
services.xserver.libinput.mouse = {
|
|
||||||
# Disable mouse acceleration
|
|
||||||
accelProfile = "flat";
|
|
||||||
accelSpeed = "1.15";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
{ ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
config = lib.mkIf (config.physical && pkgs.stdenv.isLinux) {
|
||||||
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
||||||
# replicates the default behaviour.
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
||||||
networking.useDHCP = false;
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
||||||
networking.interfaces.enp0s31f6.useDHCP = true;
|
# replicates the default behaviour.
|
||||||
networking.interfaces.wlp3s0.useDHCP = true;
|
networking.useDHCP = false;
|
||||||
|
networking.interfaces.enp0s31f6.useDHCP = true;
|
||||||
|
networking.interfaces.wlp3s0.useDHCP = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Servers need a bootloader or they won't start
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.server) {
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
# Servers need a bootloader or they won't start
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
{ ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Prevent wake from keyboard
|
config = lib.mkIf (config.physical && pkgs.stdenv.isLinux) {
|
||||||
powerManagement.powerDownCommands = ''
|
|
||||||
for wakeup in /sys/bus/usb/devices/1-*/power/wakeup; do echo disabled > $wakeup; done
|
# Prevent wake from keyboard
|
||||||
'';
|
powerManagement.powerDownCommands = ''
|
||||||
|
for wakeup in /sys/bus/usb/devices/1-*/power/wakeup; do echo disabled > $wakeup; done
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
{ ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Enables wireless support via wpa_supplicant.
|
config = lib.mkIf (config.physical && config.isLinux) {
|
||||||
networking.wireless.enable = true;
|
|
||||||
|
|
||||||
# Allows the user to control the WiFi settings.
|
# Enables wireless support via wpa_supplicant.
|
||||||
networking.wireless.userControlled.enable = true;
|
networking.wireless.enable = true;
|
||||||
|
|
||||||
|
# Allows the user to control the WiFi settings.
|
||||||
|
networking.wireless.userControlled.enable = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = {
|
options.mail.aerc.enable = lib.mkEnableOption "Aerc email.";
|
||||||
|
|
||||||
|
config = lib.mkIf config.mail.aerc.enable {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
@ -3,18 +3,18 @@
|
|||||||
imports = [ ./himalaya.nix ./aerc.nix ];
|
imports = [ ./himalaya.nix ./aerc.nix ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
mailUser = lib.mkOption {
|
mail.user = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "User name for the email address.";
|
description = "User name for the email address.";
|
||||||
default = config.user;
|
default = config.user;
|
||||||
};
|
};
|
||||||
mailServer = lib.mkOption {
|
mail.server = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Server name for the email address.";
|
description = "Server name for the email address.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (config.mail.user != null && config.mail.server != null) {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
programs.mbsync = { enable = true; };
|
programs.mbsync = { enable = true; };
|
||||||
@ -25,13 +25,13 @@
|
|||||||
accounts.email = {
|
accounts.email = {
|
||||||
maildirBasePath = "${config.homePath}/mail";
|
maildirBasePath = "${config.homePath}/mail";
|
||||||
accounts = {
|
accounts = {
|
||||||
home = let address = "${config.mailUser}@${config.mailServer}";
|
home = let address = "${config.mail.user}@${config.mail.server}";
|
||||||
in {
|
in {
|
||||||
userName = address;
|
userName = address;
|
||||||
realName = config.fullName;
|
realName = config.fullName;
|
||||||
primary = true;
|
primary = true;
|
||||||
inherit address;
|
inherit address;
|
||||||
aliases = map (mailUser: "${mailUser}@${config.mailServer}") [
|
aliases = map (user: "${user}@${config.mail.server}") [
|
||||||
"me"
|
"me"
|
||||||
"hey"
|
"hey"
|
||||||
"admin"
|
"admin"
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ config, ... }: {
|
{ config, lib, ... }: {
|
||||||
|
|
||||||
config = {
|
options.mail.himalaya.enable = lib.mkEnableOption "Himalaya email.";
|
||||||
|
|
||||||
|
config = lib.mkIf config.mail.himalaya.enable {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
@ -9,31 +9,36 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
home-manager.users.${config.user} =
|
options.neovim.enable = lib.mkEnableOption "Neovim.";
|
||||||
|
|
||||||
{
|
config = lib.mkIf config.neovim.enable {
|
||||||
|
home-manager.users.${config.user} =
|
||||||
|
|
||||||
home.packages = [ neovim ];
|
{
|
||||||
|
|
||||||
programs.git.extraConfig.core.editor = "nvim";
|
home.packages = [ neovim ];
|
||||||
home.sessionVariables = {
|
|
||||||
EDITOR = "nvim";
|
programs.git.extraConfig.core.editor = "nvim";
|
||||||
MANPAGER = "nvim +Man!";
|
home.sessionVariables = {
|
||||||
};
|
EDITOR = "nvim";
|
||||||
programs.fish = {
|
MANPAGER = "nvim +Man!";
|
||||||
shellAliases = { vim = "nvim"; };
|
|
||||||
shellAbbrs = {
|
|
||||||
v = lib.mkForce "nvim";
|
|
||||||
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
|
||||||
vll = "nvim -c 'Telescope oldfiles'";
|
|
||||||
};
|
};
|
||||||
|
programs.fish = {
|
||||||
|
shellAliases = { vim = "nvim"; };
|
||||||
|
shellAbbrs = {
|
||||||
|
v = lib.mkForce "nvim";
|
||||||
|
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
||||||
|
vll = "nvim -c 'Telescope oldfiles'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
||||||
|
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
||||||
|
|
||||||
};
|
};
|
||||||
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
|
||||||
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
|
||||||
|
|
||||||
};
|
# # Used for icons in Vim
|
||||||
|
# fonts.fonts = with pkgs; [ nerdfonts ];
|
||||||
|
|
||||||
# # Used for icons in Vim
|
};
|
||||||
# fonts.fonts = with pkgs; [ nerdfonts ];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./user.nix ./timezone.nix ./doas.nix ];
|
imports = [ ./user.nix ./timezone.nix ./doas.nix ];
|
||||||
|
|
||||||
# Pin a state version to prevent warnings
|
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
system.stateVersion =
|
|
||||||
config.home-manager.users.${config.user}.home.stateVersion;
|
# Pin a state version to prevent warnings
|
||||||
|
system.stateVersion =
|
||||||
|
config.home-manager.users.${config.user}.home.stateVersion;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,35 @@
|
|||||||
# Replace sudo with doas
|
# Replace sudo with doas
|
||||||
|
|
||||||
{ config, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
security = {
|
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
|
||||||
# Remove sudo
|
security = {
|
||||||
sudo.enable = false;
|
|
||||||
|
|
||||||
# Add doas
|
# Remove sudo
|
||||||
doas = {
|
sudo.enable = false;
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# No password required
|
# Add doas
|
||||||
wheelNeedsPassword = false;
|
doas = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
# Pass environment variables from user to root
|
# No password required
|
||||||
# Also requires removing password here
|
wheelNeedsPassword = false;
|
||||||
extraRules = [{
|
|
||||||
groups = [ "wheel" ];
|
# Pass environment variables from user to root
|
||||||
noPass = true;
|
# Also requires removing password here
|
||||||
keepEnv = true;
|
extraRules = [{
|
||||||
}];
|
groups = [ "wheel" ];
|
||||||
|
noPass = true;
|
||||||
|
keepEnv = true;
|
||||||
|
}];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home-manager.users.${config.user}.programs.fish.shellAliases = {
|
||||||
|
sudo = "doas";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${config.user}.programs.fish.shellAliases = {
|
|
||||||
sudo = "doas";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
{ ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Service to determine location for time zone
|
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
services.geoclue2.enable = true;
|
|
||||||
services.geoclue2.enableWifi = false; # Breaks when it can't connect
|
|
||||||
location = { provider = "geoclue2"; };
|
|
||||||
|
|
||||||
# Enable local time based on time zone
|
# Service to determine location for time zone
|
||||||
services.localtimed.enable = true;
|
services.geoclue2.enable = true;
|
||||||
|
services.geoclue2.enableWifi = false; # Breaks when it can't connect
|
||||||
|
location = { provider = "geoclue2"; };
|
||||||
|
|
||||||
# Required to get localtimed to talk to geoclue2
|
# Enable local time based on time zone
|
||||||
services.geoclue2.appConfig.localtimed.isSystem = true;
|
services.localtimed.enable = true;
|
||||||
services.geoclue2.appConfig.localtimed.isAllowed = true;
|
|
||||||
|
# Required to get localtimed to talk to geoclue2
|
||||||
|
services.geoclue2.appConfig.localtimed.isSystem = true;
|
||||||
|
services.geoclue2.appConfig.localtimed.isAllowed = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (pkgs.stdenv.isLinux) {
|
||||||
|
|
||||||
# Allows us to declaritively set password
|
# Allows us to declaritively set password
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
|
12
modules/programming/default.nix
Normal file
12
modules/programming/default.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./haskell.nix
|
||||||
|
./kubernetes.nix
|
||||||
|
./lua.nix
|
||||||
|
./nix.nix
|
||||||
|
./python.nix
|
||||||
|
./terraform.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
@ -1,8 +1,14 @@
|
|||||||
{ ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Binary Cache for Haskell.nix
|
options.haskell.enable = lib.mkEnableOption "Haskell programming language.";
|
||||||
nix.settings.trusted-public-keys =
|
|
||||||
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
config = lib.mkIf config.haskell.enable {
|
||||||
nix.settings.substituters = [ "https://cache.iog.io" ];
|
|
||||||
|
# Binary Cache for Haskell.nix
|
||||||
|
nix.settings.trusted-public-keys =
|
||||||
|
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||||||
|
nix.settings.substituters = [ "https://cache.iog.io" ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,138 +1,143 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.kubernetes.enable = lib.mkEnableOption "Kubernetes tools.";
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
config = lib.mkIf config.kubernetes.enable {
|
||||||
kubectl # Basic Kubernetes queries
|
home-manager.users.${config.user} = {
|
||||||
kubernetes-helm # Helm CLI
|
|
||||||
fluxcd # Bootstrap clusters with Flux
|
|
||||||
kustomize # Kustomize CLI (for Flux)
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
home.packages = with pkgs; [
|
||||||
k = "kubectl";
|
kubectl # Basic Kubernetes queries
|
||||||
pods = "kubectl get pods -A";
|
kubernetes-helm # Helm CLI
|
||||||
nodes = "kubectl get nodes";
|
fluxcd # Bootstrap clusters with Flux
|
||||||
deploys = "kubectl get deployments -A";
|
kustomize # Kustomize CLI (for Flux)
|
||||||
dash = "kube-dashboard";
|
];
|
||||||
ks = "k9s";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Terminal Kubernetes UI
|
programs.fish.shellAbbrs = {
|
||||||
programs.k9s = {
|
k = "kubectl";
|
||||||
enable = true;
|
pods = "kubectl get pods -A";
|
||||||
# settings = { k9s = { headless = true; }; };
|
nodes = "kubectl get nodes";
|
||||||
skin = {
|
deploys = "kubectl get deployments -A";
|
||||||
k9s = {
|
dash = "kube-dashboard";
|
||||||
body = {
|
ks = "k9s";
|
||||||
fgColor = config.theme.colors.base06;
|
};
|
||||||
bgColor = config.theme.colors.base00;
|
|
||||||
logoColor = config.theme.colors.base02; # *blue ?
|
# Terminal Kubernetes UI
|
||||||
};
|
programs.k9s = {
|
||||||
# Search bar
|
enable = true;
|
||||||
prompt = {
|
# settings = { k9s = { headless = true; }; };
|
||||||
fgColor = config.theme.colors.base06;
|
skin = {
|
||||||
bgColor = config.theme.colors.base00;
|
k9s = {
|
||||||
suggestColor = config.theme.colors.base03;
|
body = {
|
||||||
};
|
|
||||||
# Header left side
|
|
||||||
info = {
|
|
||||||
fgColor = config.theme.colors.base04;
|
|
||||||
sectionColor = config.theme.colors.base05;
|
|
||||||
};
|
|
||||||
dialog = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
bgColor = config.theme.colors.base00;
|
|
||||||
buttonFgColor = config.theme.colors.base06;
|
|
||||||
buttonBgColor = config.theme.colors.base0E;
|
|
||||||
buttonFocusFgColor = config.theme.colors.base07;
|
|
||||||
buttonFocusBgColor = config.theme.colors.base02; # *cyan
|
|
||||||
labelFgColor = config.theme.colors.base09;
|
|
||||||
fieldFgColor = config.theme.colors.base06;
|
|
||||||
};
|
|
||||||
frame = {
|
|
||||||
border = {
|
|
||||||
fgColor = config.theme.colors.base01;
|
|
||||||
focusColor = config.theme.colors.base06;
|
|
||||||
};
|
|
||||||
menu = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
keyColor = config.theme.colors.base0E; # *magenta
|
|
||||||
numKeyColor = config.theme.colors.base0E; # *magenta
|
|
||||||
};
|
|
||||||
crumbs = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
bgColor = config.theme.colors.base01;
|
|
||||||
activeColor = config.theme.colors.base03;
|
|
||||||
};
|
|
||||||
status = {
|
|
||||||
newColor = config.theme.colors.base04; # *cyan
|
|
||||||
modifyColor = config.theme.colors.base0D; # *blue
|
|
||||||
addColor = config.theme.colors.base0B; # *green
|
|
||||||
errorColor = config.theme.colors.base08; # *red
|
|
||||||
highlightColor = config.theme.colors.base09; # *orange
|
|
||||||
killColor = config.theme.colors.base03; # *comment
|
|
||||||
completedColor = config.theme.colors.base03; # *comment
|
|
||||||
};
|
|
||||||
title = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = config.theme.colors.base00;
|
bgColor = config.theme.colors.base00;
|
||||||
highlightColor = config.theme.colors.base09; # *orange
|
logoColor = config.theme.colors.base02; # *blue ?
|
||||||
counterColor = config.theme.colors.base0D; # *blue
|
|
||||||
filterColor = config.theme.colors.base0E; # *magenta
|
|
||||||
};
|
};
|
||||||
};
|
# Search bar
|
||||||
views = {
|
prompt = {
|
||||||
charts = {
|
|
||||||
bgColor = config.theme.colors.base00;
|
|
||||||
defaultDialColors =
|
|
||||||
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
|
||||||
# - *blue
|
|
||||||
# - *red
|
|
||||||
defaultChartColors =
|
|
||||||
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
|
||||||
# - *blue
|
|
||||||
# - *red
|
|
||||||
};
|
|
||||||
table = {
|
|
||||||
# List of resources
|
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = config.theme.colors.base00;
|
bgColor = config.theme.colors.base00;
|
||||||
|
suggestColor = config.theme.colors.base03;
|
||||||
# Row selection
|
};
|
||||||
cursorFgColor = config.theme.colors.base07;
|
# Header left side
|
||||||
cursorBgColor = config.theme.colors.base01;
|
info = {
|
||||||
|
fgColor = config.theme.colors.base04;
|
||||||
# Header row
|
sectionColor = config.theme.colors.base05;
|
||||||
header = {
|
};
|
||||||
fgColor = config.theme.colors.base0D;
|
dialog = {
|
||||||
bgColor = config.theme.colors.base00;
|
fgColor = config.theme.colors.base06;
|
||||||
sorterColor = config.theme.colors.base0A; # *selection
|
bgColor = config.theme.colors.base00;
|
||||||
|
buttonFgColor = config.theme.colors.base06;
|
||||||
|
buttonBgColor = config.theme.colors.base0E;
|
||||||
|
buttonFocusFgColor = config.theme.colors.base07;
|
||||||
|
buttonFocusBgColor = config.theme.colors.base02; # *cyan
|
||||||
|
labelFgColor = config.theme.colors.base09;
|
||||||
|
fieldFgColor = config.theme.colors.base06;
|
||||||
|
};
|
||||||
|
frame = {
|
||||||
|
border = {
|
||||||
|
fgColor = config.theme.colors.base01;
|
||||||
|
focusColor = config.theme.colors.base06;
|
||||||
};
|
};
|
||||||
};
|
menu = {
|
||||||
xray = {
|
fgColor = config.theme.colors.base06;
|
||||||
fgColor = config.theme.colors.base06;
|
keyColor = config.theme.colors.base0E; # *magenta
|
||||||
bgColor = config.theme.colors.base00;
|
numKeyColor = config.theme.colors.base0E; # *magenta
|
||||||
cursorColor = config.theme.colors.base06;
|
};
|
||||||
graphicColor = config.theme.colors.base0D;
|
crumbs = {
|
||||||
showIcons = false;
|
fgColor = config.theme.colors.base06;
|
||||||
};
|
bgColor = config.theme.colors.base01;
|
||||||
yaml = {
|
activeColor = config.theme.colors.base03;
|
||||||
keyColor = config.theme.colors.base0D;
|
};
|
||||||
colonColor = config.theme.colors.base04;
|
status = {
|
||||||
fgColor = config.theme.colors.base03;
|
newColor = config.theme.colors.base04; # *cyan
|
||||||
};
|
modifyColor = config.theme.colors.base0D; # *blue
|
||||||
logs = {
|
addColor = config.theme.colors.base0B; # *green
|
||||||
fgColor = config.theme.colors.base06;
|
errorColor = config.theme.colors.base08; # *red
|
||||||
bgColor = config.theme.colors.base00;
|
highlightColor = config.theme.colors.base09; # *orange
|
||||||
indicator = {
|
killColor = config.theme.colors.base03; # *comment
|
||||||
|
completedColor = config.theme.colors.base03; # *comment
|
||||||
|
};
|
||||||
|
title = {
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = config.theme.colors.base00;
|
bgColor = config.theme.colors.base00;
|
||||||
|
highlightColor = config.theme.colors.base09; # *orange
|
||||||
|
counterColor = config.theme.colors.base0D; # *blue
|
||||||
|
filterColor = config.theme.colors.base0E; # *magenta
|
||||||
|
};
|
||||||
|
};
|
||||||
|
views = {
|
||||||
|
charts = {
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
defaultDialColors =
|
||||||
|
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||||
|
# - *blue
|
||||||
|
# - *red
|
||||||
|
defaultChartColors =
|
||||||
|
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||||
|
# - *blue
|
||||||
|
# - *red
|
||||||
|
};
|
||||||
|
table = {
|
||||||
|
# List of resources
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
|
||||||
|
# Row selection
|
||||||
|
cursorFgColor = config.theme.colors.base07;
|
||||||
|
cursorBgColor = config.theme.colors.base01;
|
||||||
|
|
||||||
|
# Header row
|
||||||
|
header = {
|
||||||
|
fgColor = config.theme.colors.base0D;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
sorterColor = config.theme.colors.base0A; # *selection
|
||||||
|
};
|
||||||
|
};
|
||||||
|
xray = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
cursorColor = config.theme.colors.base06;
|
||||||
|
graphicColor = config.theme.colors.base0D;
|
||||||
|
showIcons = false;
|
||||||
|
};
|
||||||
|
yaml = {
|
||||||
|
keyColor = config.theme.colors.base0D;
|
||||||
|
colonColor = config.theme.colors.base04;
|
||||||
|
fgColor = config.theme.colors.base03;
|
||||||
|
};
|
||||||
|
logs = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
indicator = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
options.lua.enable = lib.mkEnableOption "Lua programming language.";
|
||||||
stylua # Lua formatter
|
|
||||||
sumneko-lua-language-server # Lua LSP
|
config = lib.mkIf config.lua.enable {
|
||||||
];
|
home-manager.users.${config.user}.home.packages = with pkgs; [
|
||||||
|
stylua # Lua formatter
|
||||||
|
sumneko-lua-language-server # Lua LSP
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.nixlang.enable = lib.mkEnableOption "Nix programming language.";
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
config = lib.mkIf config.nixlang.enable {
|
||||||
nixfmt # Nix file formatter
|
|
||||||
nil # Nix language server
|
home-manager.users.${config.user} = {
|
||||||
];
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nixfmt # Nix file formatter
|
||||||
|
nil # Nix language server
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,15 +1,21 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.python.enable = lib.mkEnableOption "Python programming language.";
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
config = lib.mkIf config.python.enable {
|
||||||
# python310 # Standard Python interpreter
|
|
||||||
nodePackages.pyright # Python language server
|
|
||||||
black # Python formatter
|
|
||||||
python310Packages.flake8 # Python linter
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.fish.shellAbbrs = { py = "python3"; };
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# python310 # Standard Python interpreter
|
||||||
|
nodePackages.pyright # Python language server
|
||||||
|
black # Python formatter
|
||||||
|
python310Packages.flake8 # Python linter
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs = { py = "python3"; };
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,15 +1,21 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
options.terraform.enable = lib.mkEnableOption "Terraform tools.";
|
||||||
|
|
||||||
|
config = lib.mkIf config.terraform.enable {
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
programs.fish.shellAbbrs = {
|
||||||
|
# Terraform
|
||||||
|
te = "terraform";
|
||||||
|
};
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
terraform # Terraform executable
|
||||||
|
terraform-ls # Language server
|
||||||
|
tflint # Linter
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
programs.fish.shellAbbrs = {
|
|
||||||
# Terraform
|
|
||||||
te = "terraform";
|
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
|
||||||
terraform # Terraform executable
|
|
||||||
terraform-ls # Language server
|
|
||||||
tflint # Linter
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
5
modules/repositories/default.nix
Normal file
5
modules/repositories/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{ ... }: {
|
||||||
|
|
||||||
|
imports = [ ./dotfiles.nix ./notes.nix ];
|
||||||
|
|
||||||
|
}
|
@ -1,24 +1,30 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles.";
|
||||||
|
|
||||||
home.activation = {
|
config = lib.mkIf config.dotfiles.enable {
|
||||||
|
|
||||||
# Always clone dotfiles repository if it doesn't exist
|
home-manager.users.${config.user} = {
|
||||||
cloneDotfiles =
|
|
||||||
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
home.activation = {
|
||||||
[ "writeBoundary" ] ''
|
|
||||||
if [ ! -d "${config.dotfilesPath}" ]; then
|
# Always clone dotfiles repository if it doesn't exist
|
||||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
cloneDotfiles =
|
||||||
$DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
||||||
fi
|
[ "writeBoundary" ] ''
|
||||||
'';
|
if [ ! -d "${config.dotfilesPath}" ]; then
|
||||||
|
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||||
|
$DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set a variable for dotfiles repo, not necessary but convenient
|
||||||
|
home.sessionVariables.DOTS = config.dotfilesPath;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set a variable for dotfiles repo, not necessary but convenient
|
|
||||||
home.sessionVariables.DOTS = config.dotfilesPath;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./secrets.nix ];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
backupS3 = {
|
backup.s3 = {
|
||||||
endpoint = lib.mkOption {
|
endpoint = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "S3 endpoint for backups";
|
description = "S3 endpoint for backups";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
bucket = lib.mkOption {
|
bucket = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "S3 bucket for backups";
|
description = "S3 bucket for backups";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
accessKeyId = lib.mkOption {
|
accessKeyId = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "S3 access key ID for backups";
|
description = "S3 access key ID for backups";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
caddyRoutes = lib.mkOption {
|
caddy.enable = lib.mkEnableOption "Caddy reverse proxy.";
|
||||||
|
caddy.routes = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.attrs;
|
type = lib.types.listOf lib.types.attrs;
|
||||||
description = "Caddy JSON routes for http servers";
|
description = "Caddy JSON routes for http servers";
|
||||||
|
default = [ ];
|
||||||
};
|
};
|
||||||
caddyBlocks = lib.mkOption {
|
caddy.blocks = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.attrs;
|
type = lib.types.listOf lib.types.attrs;
|
||||||
description = "Caddy JSON error blocks for http servers";
|
description = "Caddy JSON error blocks for http servers";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (config.caddy.enable && config.caddy.routes != [ ]) {
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -20,8 +22,8 @@
|
|||||||
configFile = pkgs.writeText "Caddyfile" (builtins.toJSON {
|
configFile = pkgs.writeText "Caddyfile" (builtins.toJSON {
|
||||||
apps.http.servers.main = {
|
apps.http.servers.main = {
|
||||||
listen = [ ":443" ];
|
listen = [ ":443" ];
|
||||||
routes = config.caddyRoutes;
|
routes = config.caddy.routes;
|
||||||
errors.routes = config.caddyBlocks;
|
errors.routes = config.caddy.blocks;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./caddy.nix ./backups.nix ];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
bookServer = lib.mkOption {
|
bookServer = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for Calibre library";
|
description = "Hostname for Calibre library";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.bookServer != null {
|
||||||
|
|
||||||
services.calibre-web = {
|
services.calibre-web = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -31,7 +30,7 @@
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
caddyRoutes = [{
|
caddy.routes = [{
|
||||||
match = [{ host = [ config.bookServer ]; }];
|
match = [{ host = [ config.bookServer ]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# This module is necessary for hosts that are serving through Cloudflare.
|
# This module is necessary for hosts that are serving through Cloudflare.
|
||||||
|
|
||||||
{ ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -36,12 +36,12 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
imports = [ ./caddy.nix ];
|
options.cloudflare.enable = lib.mkEnableOption "Use Cloudflare.";
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.cloudflare.enable {
|
||||||
|
|
||||||
# Forces Caddy to error if coming from a non-Cloudflare IP
|
# Forces Caddy to error if coming from a non-Cloudflare IP
|
||||||
caddyBlocks = [{
|
caddy.blocks = [{
|
||||||
match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }];
|
match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "static_response";
|
handler = "static_response";
|
||||||
|
25
modules/services/default.nix
Normal file
25
modules/services/default.nix
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{ ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./backups.nix
|
||||||
|
./caddy.nix
|
||||||
|
./calibre.nix
|
||||||
|
./cloudflare.nix
|
||||||
|
./gitea.nix
|
||||||
|
./gnupg.nix
|
||||||
|
./honeypot.nix
|
||||||
|
./jellyfin.nix
|
||||||
|
./keybase.nix
|
||||||
|
./mullvad.nix
|
||||||
|
./n8n.nix
|
||||||
|
./netdata.nix
|
||||||
|
./nextcloud.nix
|
||||||
|
./prometheus.nix
|
||||||
|
./secrets.nix
|
||||||
|
./sshd.nix
|
||||||
|
./transmission.nix
|
||||||
|
./vaultwarden.nix
|
||||||
|
./wireguard.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
@ -4,18 +4,17 @@ let giteaPath = "/var/lib/gitea"; # Default service directory
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
imports = [ ./caddy.nix ./backups.nix ];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
giteaServer = lib.mkOption {
|
giteaServer = lib.mkOption {
|
||||||
description = "Hostname for Gitea.";
|
description = "Hostname for Gitea.";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.giteaServer != null {
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
httpPort = 3001;
|
httpPort = 3001;
|
||||||
@ -47,7 +46,7 @@ in {
|
|||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 122 ];
|
networking.firewall.allowedTCPPorts = [ 122 ];
|
||||||
|
|
||||||
caddyRoutes = [{
|
caddy.routes = [{
|
||||||
match = [{ host = [ config.giteaServer ]; }];
|
match = [{ host = [ config.giteaServer ]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.gpg.enable = lib.mkEnableOption "GnuPG encryption.";
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = lib.mkIf config.gpg.enable {
|
||||||
programs.gpg.enable = true;
|
programs.gpg.enable = true;
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
# Currently has some issues that don't make this viable.
|
# Currently has some issues that don't make this viable.
|
||||||
|
|
||||||
@ -38,7 +38,9 @@ let
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
networking.firewall = {
|
options.honeypot.enable = lib.mkEnableOption "Honeypot fail2ban system.";
|
||||||
|
|
||||||
|
networking.firewall = lib.mkIf config.honeypot.enable {
|
||||||
|
|
||||||
extraPackages = [ pkgs.ipset ];
|
extraPackages = [ pkgs.ipset ];
|
||||||
# allowedTCPPorts = portsToBlock;
|
# allowedTCPPorts = portsToBlock;
|
||||||
|
@ -4,14 +4,15 @@
|
|||||||
streamServer = lib.mkOption {
|
streamServer = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for Jellyfin library";
|
description = "Hostname for Jellyfin library";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.streamServer != null {
|
||||||
|
|
||||||
services.jellyfin.enable = true;
|
services.jellyfin.enable = true;
|
||||||
|
|
||||||
caddyRoutes = [{
|
caddy.routes = [{
|
||||||
match = [{ host = [ config.streamServer ]; }];
|
match = [{ host = [ config.streamServer ]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
|
@ -1,28 +1,34 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
services.keybase.enable = true;
|
options.keybase.enable = lib.mkEnableOption "Keybase.";
|
||||||
services.kbfs = {
|
|
||||||
enable = true;
|
|
||||||
# enableRedirector = true;
|
|
||||||
mountPoint = "/run/user/1000/keybase/kbfs";
|
|
||||||
};
|
|
||||||
security.wrappers.keybase-redirector = {
|
|
||||||
setuid = true;
|
|
||||||
owner = "root";
|
|
||||||
group = "root";
|
|
||||||
source = "${pkgs.kbfs}/bin/redirector";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
config = lib.mkIf config.keybase.enable {
|
||||||
home.packages = [ (lib.mkIf config.gui.enable pkgs.keybase-gui) ];
|
|
||||||
home.file = let
|
services.keybase.enable = true;
|
||||||
ignorePatterns = ''
|
services.kbfs = {
|
||||||
keybase/
|
enable = true;
|
||||||
kbfs/'';
|
# enableRedirector = true;
|
||||||
in {
|
mountPoint = "/run/user/1000/keybase/kbfs";
|
||||||
".rgignore".text = ignorePatterns;
|
|
||||||
".fdignore".text = ignorePatterns;
|
|
||||||
};
|
};
|
||||||
|
security.wrappers.keybase-redirector = {
|
||||||
|
setuid = true;
|
||||||
|
owner = "root";
|
||||||
|
group = "root";
|
||||||
|
source = "${pkgs.kbfs}/bin/redirector";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
home.packages = [ (lib.mkIf config.gui.enable pkgs.keybase-gui) ];
|
||||||
|
home.file = let
|
||||||
|
ignorePatterns = ''
|
||||||
|
keybase/
|
||||||
|
kbfs/'';
|
||||||
|
in {
|
||||||
|
".rgignore".text = ignorePatterns;
|
||||||
|
".fdignore".text = ignorePatterns;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
{ pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
services.mullvad-vpn.enable = true;
|
options.mullvad.enable = lib.mkEnableOption "Mullvad VPN.";
|
||||||
environment.systemPackages = [ pkgs.mullvad-vpn ];
|
|
||||||
|
config = lib.mkIf config.mullvad.enable {
|
||||||
|
|
||||||
|
services.mullvad-vpn.enable = true;
|
||||||
|
environment.systemPackages = [ pkgs.mullvad-vpn ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,33 @@
|
|||||||
{ ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
services.n8n = {
|
options = {
|
||||||
enable = true;
|
n8nServer = lib.mkOption {
|
||||||
settings = {
|
type = lib.types.str;
|
||||||
n8n = {
|
description = "Hostname for n8n automation";
|
||||||
listenAddress = "127.0.0.1";
|
default = null;
|
||||||
port = 5678;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
caddyRoutes = [{
|
config = lib.mkIf config.n8nServer != null {
|
||||||
match = [{ host = [ config.n8nServer ]; }];
|
|
||||||
handle = [{
|
services.n8n = {
|
||||||
handler = "reverse_proxy";
|
enable = true;
|
||||||
upstreams = [{ dial = "localhost:5678"; }];
|
settings = {
|
||||||
|
n8n = {
|
||||||
|
listenAddress = "127.0.0.1";
|
||||||
|
port = 5678;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
caddy.routes = [{
|
||||||
|
match = [{ host = [ config.n8nServer ]; }];
|
||||||
|
handle = [{
|
||||||
|
handler = "reverse_proxy";
|
||||||
|
upstreams = [{ dial = "localhost:5678"; }];
|
||||||
|
}];
|
||||||
}];
|
}];
|
||||||
}];
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
config = {
|
options.netdata.enable = lib.mkEnableOption "Netdata metrics.";
|
||||||
|
|
||||||
|
config = lib.mkIf config.netdata.enable {
|
||||||
|
|
||||||
services.netdata = {
|
services.netdata = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./caddy.nix ./secrets.nix ./backups.nix ];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
nextcloudServer = lib.mkOption {
|
nextcloudServer = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for Nextcloud";
|
description = "Hostname for Nextcloud";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.nextcloudServer != null {
|
||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -32,7 +31,7 @@
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
# Point Caddy to Nginx
|
# Point Caddy to Nginx
|
||||||
caddyRoutes = [{
|
caddy.routes = [{
|
||||||
match = [{ host = [ config.nextcloudServer ]; }];
|
match = [{ host = [ config.nextcloudServer ]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
options.metricsServer = lib.mkOption {
|
options.metricsServer = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname of the Grafana server.";
|
description = "Hostname of the Grafana server.";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.metricsServer != null {
|
||||||
|
|
||||||
services.grafana.enable = true;
|
services.grafana.enable = true;
|
||||||
|
|
||||||
@ -21,7 +22,7 @@
|
|||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
caddyRoutes = [{
|
caddy.routes = [{
|
||||||
match = [{ host = [ config.metricsServer ]; }];
|
match = [{ host = [ config.metricsServer ]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (pkgs.stdenv.isLinux && !config.wsl.enable) {
|
||||||
|
|
||||||
# Create a default directory to place secrets
|
# Create a default directory to place secrets
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (pkgs.stdenv.isLinux && !config.wsl.enable) {
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ports = [ 22 ];
|
ports = [ 22 ];
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./wireguard.nix ./secrets.nix ];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
transmissionServer = lib.mkOption {
|
transmissionServer = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for Transmission";
|
description = "Hostname for Transmission";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -13,7 +12,7 @@
|
|||||||
namespace = config.networking.wireguard.interfaces.wg0.interfaceNamespace;
|
namespace = config.networking.wireguard.interfaces.wg0.interfaceNamespace;
|
||||||
vpnIp = lib.strings.removeSuffix "/32"
|
vpnIp = lib.strings.removeSuffix "/32"
|
||||||
(builtins.head config.networking.wireguard.interfaces.wg0.ips);
|
(builtins.head config.networking.wireguard.interfaces.wg0.ips);
|
||||||
in {
|
in lib.mkIf (config.wireguard.enable && config.transmissionServer != null) {
|
||||||
|
|
||||||
# Setup transmission
|
# Setup transmission
|
||||||
services.transmission = {
|
services.transmission = {
|
||||||
|
@ -4,18 +4,17 @@ let vaultwardenPath = "/var/lib/bitwarden_rs"; # Default service directory
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
imports = [ ./caddy.nix ./secrets.nix ./backups.nix ];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
vaultwardenServer = lib.mkOption {
|
vaultwardenServer = lib.mkOption {
|
||||||
description = "Hostname for Vaultwarden.";
|
description = "Hostname for Vaultwarden.";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf config.vaultwardenServer != null {
|
||||||
services.vaultwarden = {
|
services.vaultwarden = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
imports = [ ./secrets.nix ];
|
options.wireguard.enable = lib.mkEnableOption "Wireguard VPN setup.";
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.wireguard.enable) {
|
||||||
|
|
||||||
networking.wireguard = {
|
networking.wireguard = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
options.charm.enable = lib.mkEnableOption "Charm utilities.";
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = lib.mkIf config.charm.enable {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
glow # Markdown previews
|
glow # Markdown previews
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
{ config, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
# Systemd doesn't work in WSL so these must be disabled
|
config = lib.mkIf (pkgs.stdenv.isLinux && config.wsl.enable) {
|
||||||
services.geoclue2.enable = lib.mkForce false;
|
|
||||||
location = { provider = lib.mkForce "manual"; };
|
|
||||||
services.localtimed.enable = lib.mkForce false;
|
|
||||||
|
|
||||||
# Used by NeoVim for clipboard sharing with Windows
|
# Systemd doesn't work in WSL so these must be disabled
|
||||||
# home-manager.users.${config.user}.home.sessionPath =
|
services.geoclue2.enable = lib.mkForce false;
|
||||||
# [ "/mnt/c/Program Files/win32yank/" ];
|
location = { provider = lib.mkForce "manual"; };
|
||||||
|
services.localtimed.enable = lib.mkForce false;
|
||||||
|
|
||||||
# Replace config directory with our repo, since it sources from config on
|
# Used by NeoVim for clipboard sharing with Windows
|
||||||
# every launch
|
# home-manager.users.${config.user}.home.sessionPath =
|
||||||
system.activationScripts.configDir.text = ''
|
# [ "/mnt/c/Program Files/win32yank/" ];
|
||||||
rm -rf /etc/nixos
|
|
||||||
ln --symbolic --no-dereference --force ${config.dotfilesPath} /etc/nixos
|
# Replace config directory with our repo, since it sources from config on
|
||||||
'';
|
# every launch
|
||||||
|
system.activationScripts.configDir.text = ''
|
||||||
|
rm -rf /etc/nixos
|
||||||
|
ln --symbolic --no-dereference --force ${config.dotfilesPath} /etc/nixos
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user