refactor
This commit is contained in:
parent
66c05f9093
commit
45d6f4b0f3
|
@ -22,7 +22,7 @@
|
|||
inherit inputs;
|
||||
src = ./.;
|
||||
|
||||
snowfall.namespace = "hh-config";
|
||||
snowfall.namespace = "plusultra";
|
||||
};
|
||||
in
|
||||
lib.mkFlake {
|
||||
|
|
|
@ -7,351 +7,30 @@
|
|||
, ...
|
||||
}:
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "harald";
|
||||
home.homeDirectory = "/home/harald/nix";
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
home.sessionPath = [
|
||||
"$HOME/.local/share/JetBrains/Toolbox/scripts"
|
||||
"$HOME/bin"
|
||||
];
|
||||
|
||||
# The home.packages option allows you to install Nix packages into your
|
||||
# environment.
|
||||
home.packages = with pkgs; [
|
||||
bashInteractive
|
||||
cachix
|
||||
jetbrains-toolbox
|
||||
delta
|
||||
git
|
||||
vim
|
||||
tmux
|
||||
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "JetBrainsMono" ]; })
|
||||
# # You can also create simple shell scripts directly inside your
|
||||
# # configuration. For example, this adds a command 'my-hello' to your
|
||||
# # environment:
|
||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||
# echo "Hello, ${config.home.username}!"
|
||||
# '')
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "vim";
|
||||
home = {
|
||||
username = "harald";
|
||||
homeDirectory = "/home/${config.home.username}/nix";
|
||||
stateVersion = "23.11"; # Please read the comment before changing.
|
||||
sessionPath = [ "$HOME/bin" ];
|
||||
};
|
||||
|
||||
home.shellAliases = {
|
||||
cat = "${pkgs.bat}/bin/bat --decorations never";
|
||||
less = ''${pkgs.bat}/bin/bat --decorations never --paging=always --pager "${pkgs.less}/bin/less -RF"'';
|
||||
man = "${pkgs.bat-extras.batman}/bin/batman";
|
||||
plusultra = {
|
||||
cli-apps = {
|
||||
bash.enable = true;
|
||||
fish.enable = true;
|
||||
neovim.enable = true;
|
||||
tmux.enable = true;
|
||||
bat.enable = true;
|
||||
git.enable = true;
|
||||
starship.enable = true;
|
||||
home-manager.enable = true;
|
||||
};
|
||||
tools = {
|
||||
direnv.enable = true;
|
||||
# jetbrains.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
programs = {
|
||||
bash = {
|
||||
enable = true;
|
||||
};
|
||||
bat = {
|
||||
enable = true;
|
||||
config.theme = "ansi";
|
||||
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "Harald Hoyer";
|
||||
userEmail = "harald@hoyer.xyz";
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
"credential \"https://github.com\"" = {
|
||||
helper = "!gh auth git-credential";
|
||||
};
|
||||
alias = {
|
||||
co = "checkout";
|
||||
ci = "commit";
|
||||
};
|
||||
pull.ff = "only";
|
||||
core.pager = "delta";
|
||||
delta = {
|
||||
features = "side-by-side line-numbers decorations";
|
||||
syntax-theme = "Dracula";
|
||||
};
|
||||
interactive.diffFilter = "delta --color-only";
|
||||
merge.conflictStyle = "diff3";
|
||||
diff.colorMoved = "default";
|
||||
};
|
||||
};
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
fish.enable = true;
|
||||
fish.interactiveShellInit = ''
|
||||
function msh --wraps mosh --description 'mosh with tmux'
|
||||
if not set -q argv[1]
|
||||
echo 'Usage: msh [user@]host [command]'
|
||||
else
|
||||
${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
fish.plugins = [{
|
||||
name = "foreign-env";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-foreign-env";
|
||||
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
||||
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
||||
};
|
||||
}];
|
||||
|
||||
fish.shellInit =
|
||||
''
|
||||
# nix
|
||||
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
end
|
||||
|
||||
# home-manager
|
||||
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
end
|
||||
'';
|
||||
|
||||
# programs.bash.enable = true;
|
||||
bash.initExtra = ''
|
||||
function msh() { mosh "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; };
|
||||
'';
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
home-manager.enable = true;
|
||||
starship.enable = true;
|
||||
starship.settings =
|
||||
{
|
||||
container.format = "[\\[$name\\]]($style) ";
|
||||
git_status = {
|
||||
ahead = "⇡$\{count}";
|
||||
diverged = "⇕⇡$\{ahead_count}⇣$\{behind_count}";
|
||||
behind = "⇣$\{count}";
|
||||
};
|
||||
};
|
||||
|
||||
neovim-flake = {
|
||||
enable = true;
|
||||
# your settings need to go into the settings attrset
|
||||
settings = {
|
||||
vim = {
|
||||
viAlias = false;
|
||||
vimAlias = false;
|
||||
debugMode = {
|
||||
enable = false;
|
||||
level = 20;
|
||||
logFile = "/tmp/nvim.log";
|
||||
};
|
||||
};
|
||||
|
||||
vim.lsp = {
|
||||
formatOnSave = true;
|
||||
lspkind.enable = false;
|
||||
lightbulb.enable = true;
|
||||
lspsaga.enable = false;
|
||||
nvimCodeActionMenu.enable = true;
|
||||
trouble.enable = true;
|
||||
lspSignature.enable = true;
|
||||
lsplines.enable = true;
|
||||
};
|
||||
|
||||
vim.debugger = {
|
||||
nvim-dap = {
|
||||
enable = true;
|
||||
ui.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.languages = {
|
||||
enableLSP = true;
|
||||
enableFormat = true;
|
||||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
nix = {
|
||||
enable = true;
|
||||
format.type = "nixpkgs-fmt";
|
||||
};
|
||||
html.enable = true;
|
||||
clang = {
|
||||
enable = true;
|
||||
lsp.server = "clangd";
|
||||
};
|
||||
sql.enable = false;
|
||||
rust = {
|
||||
enable = true;
|
||||
crates.enable = true;
|
||||
};
|
||||
java.enable = true;
|
||||
ts.enable = true;
|
||||
svelte.enable = true;
|
||||
go.enable = true;
|
||||
zig.enable = true;
|
||||
python.enable = true;
|
||||
dart.enable = true;
|
||||
elixir.enable = false;
|
||||
};
|
||||
|
||||
vim.visuals = {
|
||||
enable = true;
|
||||
nvimWebDevicons.enable = true;
|
||||
scrollBar.enable = true;
|
||||
smoothScroll.enable = true;
|
||||
cellularAutomaton.enable = true;
|
||||
fidget-nvim.enable = true;
|
||||
indentBlankline = {
|
||||
enable = true;
|
||||
fillChar = null;
|
||||
eolChar = null;
|
||||
showCurrContext = true;
|
||||
};
|
||||
cursorline = {
|
||||
enable = true;
|
||||
lineTimeout = 0;
|
||||
};
|
||||
};
|
||||
|
||||
vim.statusline = {
|
||||
lualine = {
|
||||
enable = true;
|
||||
theme = "catppuccin";
|
||||
};
|
||||
};
|
||||
|
||||
vim.theme = {
|
||||
enable = true;
|
||||
name = "catppuccin";
|
||||
style = "mocha";
|
||||
transparent = false;
|
||||
};
|
||||
|
||||
vim.autopairs.enable = true;
|
||||
|
||||
vim.autocomplete = {
|
||||
enable = true;
|
||||
type = "nvim-cmp";
|
||||
};
|
||||
|
||||
vim.filetree = {
|
||||
nvimTree = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.tabline = {
|
||||
nvimBufferline.enable = true;
|
||||
};
|
||||
|
||||
vim.treesitter.context.enable = true;
|
||||
|
||||
vim.binds = {
|
||||
whichKey.enable = true;
|
||||
cheatsheet.enable = true;
|
||||
};
|
||||
|
||||
vim.telescope.enable = true;
|
||||
|
||||
vim.git = {
|
||||
enable = true;
|
||||
gitsigns.enable = true;
|
||||
gitsigns.codeActions = false; # throws an annoying debug message
|
||||
};
|
||||
|
||||
vim.minimap = {
|
||||
minimap-vim.enable = false;
|
||||
codewindow.enable = true; # lighter, faster, and uses lua for configuration
|
||||
};
|
||||
|
||||
vim.dashboard = {
|
||||
dashboard-nvim.enable = false;
|
||||
alpha.enable = true;
|
||||
};
|
||||
|
||||
vim.notify = {
|
||||
nvim-notify.enable = true;
|
||||
};
|
||||
|
||||
vim.projects = {
|
||||
project-nvim.enable = true;
|
||||
};
|
||||
|
||||
vim.utility = {
|
||||
ccc.enable = true;
|
||||
vim-wakatime.enable = false;
|
||||
icon-picker.enable = true;
|
||||
surround.enable = true;
|
||||
diffview-nvim.enable = true;
|
||||
motion = {
|
||||
hop.enable = true;
|
||||
leap.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.notes = {
|
||||
obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled
|
||||
orgmode.enable = false;
|
||||
mind-nvim.enable = true;
|
||||
todo-comments.enable = true;
|
||||
};
|
||||
|
||||
vim.terminal = {
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
lazygit.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.ui = {
|
||||
borders.enable = true;
|
||||
noice.enable = true;
|
||||
colorizer.enable = true;
|
||||
modes-nvim.enable = false; # the theme looks terrible with catppuccin
|
||||
illuminate.enable = true;
|
||||
breadcrumbs = {
|
||||
enable = true;
|
||||
navbuddy.enable = true;
|
||||
};
|
||||
smartcolumn = {
|
||||
enable = true;
|
||||
columnAt.languages = {
|
||||
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||
nix = 110;
|
||||
ruby = 120;
|
||||
java = 130;
|
||||
go = [ 90 130 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vim.assistant = {
|
||||
copilot = {
|
||||
enable = true;
|
||||
cmp.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.session = {
|
||||
nvim-session-manager.enable = false;
|
||||
};
|
||||
|
||||
vim.gestures = {
|
||||
gesture-nvim.enable = false;
|
||||
};
|
||||
|
||||
vim.comments = {
|
||||
comment-nvim.enable = true;
|
||||
};
|
||||
|
||||
vim.spellChecking.languages = [ "en" "de" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
65
lib/audio/default.nix
Normal file
65
lib/audio/default.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{ lib }:
|
||||
|
||||
rec {
|
||||
## Renames an alsa device from a given `name` using the new `description`.
|
||||
##
|
||||
#@ { name: String, description: String } -> { matches: List, apply_properties: Attrs }
|
||||
mkAlsaRename = { name, description }: {
|
||||
matches = [
|
||||
[
|
||||
[ "device.name" "matches" name ]
|
||||
]
|
||||
];
|
||||
# actions = { "update-props" = { "node.description" = description; }; };
|
||||
apply_properties = {
|
||||
"device.description" = description;
|
||||
};
|
||||
};
|
||||
|
||||
## Create a pipewire audio node.
|
||||
##
|
||||
#@ { name: String, factory: String ? "adapter", ... } -> { factory: String, args: Attrs }
|
||||
mkAudioNode = args@{ name, factory ? "adapter", ... }: {
|
||||
inherit factory;
|
||||
args = (builtins.removeAttrs args [ "name" "description" ]) // {
|
||||
"node.name" = name;
|
||||
"node.description" = args.description or args."node.description";
|
||||
"factory.name" = args."factory.name" or "support.null-audio-sink";
|
||||
};
|
||||
};
|
||||
|
||||
## Create a virtual pipewire audio node.
|
||||
##
|
||||
#@ { name: String, ... } -> { factory: "adapter", args: Attrs }
|
||||
mkVirtualAudioNode = args@{ name, ... }:
|
||||
mkAudioNode (args // {
|
||||
name = "virtual-${lib.toLower name}-audio";
|
||||
description = "${name} (Virtual)";
|
||||
"media.class" = args.class or args."media.class" or "Audio/Duplex";
|
||||
"object.linger" = args."object.linger" or true;
|
||||
"audio.position" = args."audio.position" or [ "FL" "FR" ];
|
||||
"monitor.channel-volumes" = args."monitor.channel-volumes" or true;
|
||||
});
|
||||
|
||||
## Connect two pipewire audio nodes
|
||||
##
|
||||
#@ { name: String?, from: String, to: String, ... } -> { name: "libpipewire-module-loopback", args: Attrs }
|
||||
mkBridgeAudioModule = args@{ from, to, ... }: {
|
||||
name = "libpipewire-module-loopback";
|
||||
args = (builtins.removeAttrs args [ "from" "to" "name" ]) // {
|
||||
"node.name" =
|
||||
if args ? name then
|
||||
"${args.name}-bridge"
|
||||
else
|
||||
"${lib.toLower from}-to-${lib.toLower to}-bridge";
|
||||
"audio.position" = args."audio.position" or [ "FL" "FR" ];
|
||||
"capture.props" = {
|
||||
"node.target" = from;
|
||||
} // (args."capture.props" or { });
|
||||
"playback.props" = {
|
||||
"node.target" = to;
|
||||
"monitor.channel-volumes" = true;
|
||||
} // (args."playback.props" or { });
|
||||
};
|
||||
};
|
||||
}
|
20
lib/default.nix
Normal file
20
lib/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ lib, inputs, snowfall-inputs }:
|
||||
|
||||
rec {
|
||||
## Override a package's metadata
|
||||
##
|
||||
## ```nix
|
||||
## let
|
||||
## new-meta = {
|
||||
## description = "My new description";
|
||||
## };
|
||||
## in
|
||||
## lib.override-meta new-meta pkgs.hello
|
||||
## ```
|
||||
##
|
||||
#@ Attrs -> Package -> Package
|
||||
override-meta = meta: package:
|
||||
package.overrideAttrs (attrs: {
|
||||
meta = (attrs.meta or { }) // meta;
|
||||
});
|
||||
}
|
51
lib/deploy/default.nix
Normal file
51
lib/deploy/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ lib, inputs }:
|
||||
|
||||
let
|
||||
inherit (inputs) deploy-rs;
|
||||
in
|
||||
rec {
|
||||
## Create deployment configuration for use with deploy-rs.
|
||||
##
|
||||
## ```nix
|
||||
## mkDeploy {
|
||||
## inherit self;
|
||||
## overrides = {
|
||||
## my-host.system.sudo = "doas -u";
|
||||
## };
|
||||
## }
|
||||
## ```
|
||||
##
|
||||
#@ { self: Flake, overrides: Attrs ? {} } -> Attrs
|
||||
mkDeploy = { self, overrides ? { } }:
|
||||
let
|
||||
hosts = self.nixosConfigurations or { };
|
||||
names = builtins.attrNames hosts;
|
||||
nodes = lib.foldl
|
||||
(result: name:
|
||||
let
|
||||
host = hosts.${name};
|
||||
user = host.config.plusultra.user.name or null;
|
||||
inherit (host.pkgs) system;
|
||||
in
|
||||
result // {
|
||||
${name} = (overrides.${name} or { }) // {
|
||||
hostname = overrides.${name}.hostname or "${name}";
|
||||
profiles = (overrides.${name}.profiles or { }) // {
|
||||
system = (overrides.${name}.profiles.system or { }) // {
|
||||
path = deploy-rs.lib.${system}.activate.nixos host;
|
||||
} // lib.optionalAttrs (user != null) {
|
||||
user = "root";
|
||||
sshUser = user;
|
||||
} // lib.optionalAttrs
|
||||
(host.config.plusultra.security.doas.enable or false)
|
||||
{
|
||||
sudo = "doas -u";
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
{ }
|
||||
names;
|
||||
in
|
||||
{ inherit nodes; };
|
||||
}
|
25
lib/file/default.nix
Normal file
25
lib/file/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, ... }:
|
||||
|
||||
rec {
|
||||
## Append text to the contents of a file
|
||||
##
|
||||
## ```nix
|
||||
## fileWithText ./some.txt "appended text"
|
||||
## ```
|
||||
##
|
||||
#@ Path -> String -> String
|
||||
fileWithText = file: text: ''
|
||||
${builtins.readFile file}
|
||||
${text}'';
|
||||
|
||||
## Prepend text to the contents of a file
|
||||
##
|
||||
## ```nix
|
||||
## fileWithText' ./some.txt "prepended text"
|
||||
## ```
|
||||
##
|
||||
#@ Path -> String -> String
|
||||
fileWithText' = file: text: ''
|
||||
${text}
|
||||
${builtins.readFile file}'';
|
||||
}
|
62
lib/module/default.nix
Normal file
62
lib/module/default.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{ lib, ... }:
|
||||
|
||||
with lib; rec {
|
||||
## Create a NixOS module option.
|
||||
##
|
||||
## ```nix
|
||||
## lib.mkOpt nixpkgs.lib.types.str "My default" "Description of my option."
|
||||
## ```
|
||||
##
|
||||
#@ Type -> Any -> String
|
||||
mkOpt = type: default: description:
|
||||
mkOption { inherit type default description; };
|
||||
|
||||
## Create a NixOS module option without a description.
|
||||
##
|
||||
## ```nix
|
||||
## lib.mkOpt' nixpkgs.lib.types.str "My default"
|
||||
## ```
|
||||
##
|
||||
#@ Type -> Any -> String
|
||||
mkOpt' = type: default: mkOpt type default null;
|
||||
|
||||
## Create a boolean NixOS module option.
|
||||
##
|
||||
## ```nix
|
||||
## lib.mkBoolOpt true "Description of my option."
|
||||
## ```
|
||||
##
|
||||
#@ Type -> Any -> String
|
||||
mkBoolOpt = mkOpt types.bool;
|
||||
|
||||
## Create a boolean NixOS module option without a description.
|
||||
##
|
||||
## ```nix
|
||||
## lib.mkBoolOpt true
|
||||
## ```
|
||||
##
|
||||
#@ Type -> Any -> String
|
||||
mkBoolOpt' = mkOpt' types.bool;
|
||||
|
||||
enabled = {
|
||||
## Quickly enable an option.
|
||||
##
|
||||
## ```nix
|
||||
## services.nginx = enabled;
|
||||
## ```
|
||||
##
|
||||
#@ true
|
||||
enable = true;
|
||||
};
|
||||
|
||||
disabled = {
|
||||
## Quickly disable an option.
|
||||
##
|
||||
## ```nix
|
||||
## services.nginx = enabled;
|
||||
## ```
|
||||
##
|
||||
#@ false
|
||||
enable = false;
|
||||
};
|
||||
}
|
54
lib/network/default.nix
Normal file
54
lib/network/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ lib, inputs, snowfall-inputs }:
|
||||
|
||||
let
|
||||
inherit (inputs.nixpkgs.lib) assertMsg last;
|
||||
in
|
||||
{
|
||||
network = {
|
||||
# Split an address to get its host name or ip and its port.
|
||||
# Type: String -> Attrs
|
||||
# Usage: get-address-parts "bismuth:3000"
|
||||
# result: { host = "bismuth"; port = "3000"; }
|
||||
get-address-parts = address:
|
||||
let
|
||||
address-parts = builtins.split ":" address;
|
||||
ip = builtins.head address-parts;
|
||||
host = if ip == "" then "127.0.0.1" else ip;
|
||||
port = if builtins.length address-parts != 3 then "" else last address-parts;
|
||||
in
|
||||
{ inherit host port; };
|
||||
|
||||
## Create proxy configuration for NGINX virtual hosts.
|
||||
##
|
||||
## ```nix
|
||||
## services.nginx.virtualHosts."example.com" = lib.network.create-proxy {
|
||||
## port = 3000;
|
||||
## host = "0.0.0.0";
|
||||
## proxy-web-sockets = true;
|
||||
## extra-config = {
|
||||
## forceSSL = true;
|
||||
## };
|
||||
## }
|
||||
## ``
|
||||
##
|
||||
#@ { port: Int ? null, host: String ? "127.0.0.1", proxy-web-sockets: Bool ? false, extra-config: Attrs ? { } } -> Attrs
|
||||
create-proxy =
|
||||
{ port ? null
|
||||
, host ? "127.0.0.1"
|
||||
, proxy-web-sockets ? false
|
||||
, extra-config ? { }
|
||||
}:
|
||||
assert assertMsg (port != "" && port != null) "port cannot be empty";
|
||||
assert assertMsg (host != "") "host cannot be empty";
|
||||
extra-config // {
|
||||
locations = (extra-config.locations or { }) // {
|
||||
"/" = (extra-config.locations."/" or { }) // {
|
||||
proxyPass =
|
||||
"http://${host}${if port != null then ":${builtins.toString port}" else ""}";
|
||||
|
||||
proxyWebsockets = proxy-web-sockets;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
58
modules/darwin/apps/firefox/default.nix
Normal file
58
modules/darwin/apps/firefox/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{ options
|
||||
, config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.apps.firefox;
|
||||
defaultSettings = {
|
||||
"browser.aboutwelcome.enabled" = false;
|
||||
"browser.meta_refresh_when_inactive.disabled" = true;
|
||||
"browser.startup.homepage" = "https://start.duckduckgo.com/?kak=-1&kal=-1&kao=-1&kaq=-1&kt=Hack+Nerd+Font&kae=d&ks=m&k7=2e3440&kj=3b4252&k9=eceff4&kaa=d8dee9&ku=1&k8=d8dee9&kx=81a1c1&k21=3b4252&k18=1&k5=2&kp=-2&k1=-1&kaj=u&kay=b&kk=-1&kax=-1&kap=-1&kau=-1";
|
||||
"browser.bookmarks.showMobileBookmarks" = true;
|
||||
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
"browser.ssb.enabled" = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.firefox = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Firefox.";
|
||||
extraConfig =
|
||||
mkOpt str "" "Extra configuration for the user profile JS file.";
|
||||
userChrome =
|
||||
mkOpt str "" "Extra configuration for the user chrome CSS file.";
|
||||
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.desktop.addons.firefox-nordic-theme = enabled;
|
||||
|
||||
plusultra.home = {
|
||||
extraOptions = {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox.override {
|
||||
cfg = {
|
||||
# FIXME: This method of enabling browser pass support is
|
||||
# deprecated, but the suggested solution requires using
|
||||
# the NixOS module rather than Home-Manager. Update this
|
||||
# if/when Home-Manager gets support for:
|
||||
# `programs.firefox.extraNativeMessagingHosts.packages`
|
||||
enableBrowserpass = true;
|
||||
};
|
||||
};
|
||||
|
||||
profiles.${config.plusultra.user.name} = {
|
||||
inherit (cfg) extraConfig userChrome settings;
|
||||
id = 0;
|
||||
name = config.plusultra.user.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
18
modules/darwin/apps/iterm2/default.nix
Normal file
18
modules/darwin/apps/iterm2/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.iterm2;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.iterm2 = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable iTerm2.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
iterm2
|
||||
];
|
||||
};
|
||||
}
|
14
modules/darwin/apps/vscode/default.nix
Normal file
14
modules/darwin/apps/vscode/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.vscode;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.vscode = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable vscode.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ vscode ]; };
|
||||
}
|
47
modules/darwin/cli-apps/neovim/default.nix
Normal file
47
modules/darwin/cli-apps/neovim/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
inputs @ { options
|
||||
, config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.cli-apps.neovim;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.neovim = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable neovim.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# FIXME: As of today (2022-12-09), `page` no longer works with my Neovim
|
||||
# configuration. Either something in my configuration is breaking it or `page` is busted.
|
||||
# page
|
||||
plusultra.neovim
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
# PAGER = "page";
|
||||
# MANPAGER =
|
||||
# "page -C -e 'au User PageDisconnect sleep 100m|%y p|enew! |bd! #|pu p|set ft=man'";
|
||||
PAGER = "less";
|
||||
MANPAGER = "less";
|
||||
NPM_CONFIG_PREFIX = "$HOME/.npm-global";
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
plusultra.home = {
|
||||
configFile = {
|
||||
"dashboard-nvim/.keep".text = "";
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
# Use Neovim for Git diffs.
|
||||
programs.zsh.shellAliases.vimdiff = "nvim -d";
|
||||
programs.bash.shellAliases.vimdiff = "nvim -d";
|
||||
programs.fish.shellAliases.vimdiff = "nvim -d";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.addons.firefox-nordic-theme;
|
||||
profileDir = ".mozilla/firefox/${config.plusultra.user.name}";
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.firefox-nordic-theme = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable the Nordic theme for firefox.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.apps.firefox = {
|
||||
extraConfig = builtins.readFile
|
||||
"${pkgs.plusultra.firefox-nordic-theme}/configuration/user.js";
|
||||
userChrome = ''
|
||||
@import "${pkgs.plusultra.firefox-nordic-theme}/userChrome.css";
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
109
modules/darwin/desktop/addons/skhd/default.nix
Normal file
109
modules/darwin/desktop/addons/skhd/default.nix
Normal file
|
@ -0,0 +1,109 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.addons.skhd;
|
||||
|
||||
mkScript = name: file: pkgs.writeShellApplication {
|
||||
inherit name;
|
||||
checkPhase = "";
|
||||
text = builtins.readFile file;
|
||||
};
|
||||
|
||||
open-iterm2 = mkScript "open-iterm2" ./scripts/open-iterm2.sh;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.skhd = {
|
||||
enable = mkEnableOption "skhd";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.skhd = {
|
||||
enable = true;
|
||||
|
||||
skhdConfig = ''
|
||||
# Movement
|
||||
shift + cmd - h : yabai -m window --focus west
|
||||
shift + cmd - j : yabai -m window --focus south
|
||||
shift + cmd - k : yabai -m window --focus north
|
||||
shift + cmd - l : yabai -m window --focus east
|
||||
|
||||
# Window Movement
|
||||
lctrl + shift + cmd - h : yabai -m window --swap west
|
||||
lctrl + shift + cmd - j : yabai -m window --swap south
|
||||
lctrl + shift + cmd - k : yabai -m window --swap north
|
||||
lctrl + shift + cmd - l : yabai -m window --swap east
|
||||
|
||||
# Window Resize
|
||||
lctrl + cmd - h : yabai -m window --resize left:-50:0; \
|
||||
yabai -m window --resize right:-50:0
|
||||
lctrl + cmd - j : yabai -m window --resize bottom:0:50; \
|
||||
yabai -m window --resize top:0:50
|
||||
lctrl + cmd - k : yabai -m window --resize top:0:-50; \
|
||||
yabai -m window --resize bottom:0:-50
|
||||
lctrl + cmd - l : yabai -m window --resize right:50:0; \
|
||||
yabai -m window --resize left:50:0
|
||||
|
||||
lctrl + alt - h : yabai -m window --resize left:-10:0; \
|
||||
yabai -m window --resize right:-10:0
|
||||
lctrl + alt - j : yabai -m window --resize bottom:0:10; \
|
||||
yabai -m window --resize top:0:10
|
||||
lctrl + alt - k : yabai -m window --resize top:0:-10; \
|
||||
yabai -m window --resize bottom:0:-10
|
||||
lctrl + alt - l : yabai -m window --resize right:10:0; \
|
||||
yabai -m window --resize left:10:0
|
||||
|
||||
lctrl + cmd - e : yabai -m space --balance
|
||||
|
||||
# Move Window To Space
|
||||
lctrl + shift + cmd - m : yabai -m window --space last; yabai -m space --focus last
|
||||
lctrl + shift + cmd - p : yabai -m window --space prev; yabai -m space --focus prev
|
||||
lctrl + shift + cmd - n : yabai -m window --space next; yabai -m space --focus next
|
||||
lctrl + shift + cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1
|
||||
lctrl + shift + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
|
||||
lctrl + shift + cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
|
||||
lctrl + shift + cmd - 4 : yabai -m window --space 4; yabai -m space --focus 4
|
||||
|
||||
# Focus Space
|
||||
# shift + cmd - m : yabai -m space --focus last
|
||||
# shift + cmd - p : yabai -m space --focus prev
|
||||
# shift + cmd - n : yabai -m space --focus next
|
||||
shift + cmd - 1 : yabai -m space --focus 1
|
||||
shift + cmd - 2 : yabai -m space --focus 2
|
||||
shift + cmd - 3 : yabai -m space --focus 3
|
||||
shift + cmd - 4 : yabai -m space --focus 4
|
||||
|
||||
# Insert Direction
|
||||
lctrl + shift + cmd - v : yabai -m window --insert south
|
||||
lctrl + shift + cmd - b : yabai -m window --insert east
|
||||
lctrl + shift + cmd - s : yabai -m window --insert stack
|
||||
|
||||
# Floating Windows
|
||||
# shift + cmd - space : \
|
||||
# yabai -m window --toggle float; \
|
||||
# yabai -m window --toggle border
|
||||
shift + cmd - space : yabai -m window --toggle float
|
||||
|
||||
# Terminal
|
||||
shift + cmd - return : ${open-iterm2}/bin/open-iterm2
|
||||
|
||||
# Fullscreen
|
||||
alt - f : yabai -m window --toggle zoom-fullscreen
|
||||
shift + alt - f : yabai -m window --toggle native-fullscreen
|
||||
|
||||
# Restart Yabai
|
||||
shift + lctrl + alt - r : \
|
||||
/usr/bin/env osascript <<< \
|
||||
"display notification \"Restarting Yabai\" with title \"Yabai\""; \
|
||||
launchctl kickstart -k "gui/$UID/org.nixos.yabai"
|
||||
|
||||
# Restart Spacebar
|
||||
shift + lctrl + alt - s : \
|
||||
/usr/bin/env osascript <<< \
|
||||
"display notification \"Restarting Spacebar\" with title \"Spacebar\""; \
|
||||
launchctl kickstart -k "gui/$UID/org.nixos.spacebar"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
14
modules/darwin/desktop/addons/skhd/scripts/open-iterm2.sh
Normal file
14
modules/darwin/desktop/addons/skhd/scripts/open-iterm2.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Detects if iTerm2 is running
|
||||
if ! pgrep -f "iTerm" > /dev/null 2>&1; then
|
||||
open -a "/Applications/Nix Apps/iTerm2.app"
|
||||
else
|
||||
# Create a new window
|
||||
script='tell application "iTerm2" to create window with default profile'
|
||||
! osascript -e "${script}" > /dev/null 2>&1 && {
|
||||
# Get pids for any app with "iTerm" and kill
|
||||
while IFS="" read -r pid; do
|
||||
kill -15 "${pid}"
|
||||
done < <(pgrep -f "iTerm")
|
||||
open -a "/Applications/Nix Apps/iTerm2.app"
|
||||
}
|
||||
fi
|
47
modules/darwin/desktop/addons/spacebar/default.nix
Normal file
47
modules/darwin/desktop/addons/spacebar/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.addons.spacebar;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.spacebar = {
|
||||
enable = mkEnableOption "Spacebar";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.spacebar = {
|
||||
enable = true;
|
||||
package = pkgs.spacebar;
|
||||
|
||||
config = {
|
||||
position = "top";
|
||||
display = "all";
|
||||
height = 32;
|
||||
title = "on";
|
||||
spaces = "on";
|
||||
clock = "on";
|
||||
power = "off";
|
||||
|
||||
padding_left = 10;
|
||||
padding_right = 10;
|
||||
|
||||
spacing_left = 10;
|
||||
spacing_right = 10;
|
||||
|
||||
foreground_color = "0xffeceff4";
|
||||
background_color = "0xff1d2128";
|
||||
|
||||
text_font = ''"Hack Nerd Font Mono:Regular:14.0"'';
|
||||
icon_font = ''"Hack Nerd Font Mono:Regular:20.0"'';
|
||||
|
||||
# Shell entries apparently break the whole bar...
|
||||
# https://github.com/cmacrae/spacebar/issues/104
|
||||
# right_shell_icon = "";
|
||||
# right_shell_command = ''"whoami"'';
|
||||
# right_shell = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
77
modules/darwin/desktop/yabai/default.nix
Normal file
77
modules/darwin/desktop/yabai/default.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.plusultra.desktop.yabai;
|
||||
|
||||
inherit (lib) types mkEnableOption mkIf;
|
||||
inherit (lib.plusultra) mkOpt enabled;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.yabai = {
|
||||
enable = mkEnableOption "Yabai";
|
||||
enable-scripting-addition = mkOpt types.bool true "Whether to enable the scripting addition for Yabai. (Requires SIP to be disabled)";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.desktop.addons = {
|
||||
skhd = enabled;
|
||||
spacebar = enabled;
|
||||
};
|
||||
|
||||
services.yabai = {
|
||||
enable = true;
|
||||
enableScriptingAddition = cfg.enable-scripting-addition;
|
||||
|
||||
config = {
|
||||
layout = "bsp";
|
||||
|
||||
auto_balance = "off";
|
||||
|
||||
debug_output = "on";
|
||||
|
||||
top_padding = 8;
|
||||
right_padding = 8;
|
||||
left_padding = 8;
|
||||
bottom_padding = 8;
|
||||
|
||||
window_gap = 6;
|
||||
window_topmost = "on";
|
||||
window_shadow = "float";
|
||||
|
||||
# As of macOS Sonoma, window borders break Yabai and cause a bunch of lag.
|
||||
window_border = "off";
|
||||
# window_border = "on";
|
||||
# window_border_width = 5;
|
||||
# window_border_radius = 14;
|
||||
# window_border_blur = "off";
|
||||
# window_border_hidpi = "on";
|
||||
# insert_feedback_color = "0xffb48ead";
|
||||
# normal_window_border_color = "0x002e3440";
|
||||
# active_window_border_color = "0xff5e81ac";
|
||||
|
||||
external_bar = "all:${builtins.toString config.services.spacebar.config.height}:0";
|
||||
|
||||
# mouse_modifier = "alt";
|
||||
mouse_modifier = "cmd";
|
||||
mouse_action1 = "move";
|
||||
mouse_action2 = "resize";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
|
||||
yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off
|
||||
yabai -m rule --add label="System Preferences" app="^System Preferences$" title=".*" manage=off
|
||||
yabai -m rule --add label="App Store" app="^App Store$" manage=off
|
||||
yabai -m rule --add label="Activity Monitor" app="^Activity Monitor$" manage=off
|
||||
yabai -m rule --add label="Calculator" app="^Calculator$" manage=off
|
||||
yabai -m rule --add label="Dictionary" app="^Dictionary$" manage=off
|
||||
yabai -m rule --add label="mpv" app="^mpv$" manage=off
|
||||
yabai -m rule --add label="Software Update" title="Software Update" manage=off
|
||||
yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
40
modules/darwin/home/default.nix
Normal file
40
modules/darwin/home/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ options, config, pkgs, lib, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.home;
|
||||
in
|
||||
{
|
||||
# imports = with inputs; [
|
||||
# home-manager.darwinModules.home-manager
|
||||
# ];
|
||||
|
||||
options.plusultra.home = with types; {
|
||||
file = mkOpt attrs { }
|
||||
"A set of files to be managed by home-manager's <option>home.file</option>.";
|
||||
configFile = mkOpt attrs { }
|
||||
"A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
|
||||
extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
|
||||
homeConfig = mkOpt attrs { } "Final config for home-manager.";
|
||||
};
|
||||
|
||||
config = {
|
||||
plusultra.home.extraOptions = {
|
||||
home.stateVersion = mkDefault "22.11";
|
||||
home.file = mkAliasDefinitions options.plusultra.home.file;
|
||||
xdg.enable = true;
|
||||
xdg.configFile = mkAliasDefinitions options.plusultra.home.configFile;
|
||||
};
|
||||
|
||||
snowfallorg.user.${config.plusultra.user.name}.home.config = mkAliasDefinitions options.plusultra.home.extraOptions;
|
||||
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
|
||||
# users.${config.plusultra.user.name} = args:
|
||||
# mkAliasDefinitions options.plusultra.home.extraOptions;
|
||||
};
|
||||
};
|
||||
}
|
74
modules/darwin/nix/default.nix
Normal file
74
modules/darwin/nix/default.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{ options
|
||||
, config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.nix;
|
||||
in
|
||||
{
|
||||
options.plusultra.nix = with types; {
|
||||
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
|
||||
package = mkOpt package pkgs.nixUnstable "Which nix package to use.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
deploy-rs
|
||||
nixfmt
|
||||
nix-index
|
||||
nix-prefetch-git
|
||||
];
|
||||
|
||||
nix =
|
||||
let
|
||||
users = [ "root" config.plusultra.user.name ];
|
||||
in
|
||||
{
|
||||
package = cfg.package;
|
||||
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
http-connections = 50;
|
||||
warn-dirty = false;
|
||||
log-lines = 50;
|
||||
|
||||
# Large builds apparently fail due to an issue with darwin:
|
||||
# https://github.com/NixOS/nix/issues/4119
|
||||
sandbox = false;
|
||||
|
||||
# This appears to break on darwin
|
||||
# https://github.com/NixOS/nix/issues/7273
|
||||
auto-optimise-store = false;
|
||||
|
||||
allow-import-from-derivation = true;
|
||||
|
||||
trusted-users = users;
|
||||
allowed-users = users;
|
||||
|
||||
# NOTE: This configuration is generated by nix-installer so I'm adding it here in
|
||||
# case it becomes important.
|
||||
extra-nix-path = "nixpkgs=flake:nixpkgs";
|
||||
build-users-group = "nixbld";
|
||||
};
|
||||
#// (lib.optionalAttrs config.plusultra.tools.direnv.enable {
|
||||
# keep-outputs = true;
|
||||
# keep-derivations = true;
|
||||
#});
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
interval = { Day = 7; };
|
||||
options = "--delete-older-than 30d";
|
||||
user = config.plusultra.user.name;
|
||||
};
|
||||
|
||||
# flake-utils-plus
|
||||
generateRegistryFromInputs = true;
|
||||
generateNixPathFromInputs = true;
|
||||
linkInputs = true;
|
||||
};
|
||||
};
|
||||
}
|
84
modules/darwin/security/gpg/default.nix
Normal file
84
modules/darwin/security/gpg/default.nix
Normal file
|
@ -0,0 +1,84 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types mkEnableOption mkIf;
|
||||
inherit (lib.plusultra) mkOpt;
|
||||
|
||||
cfg = config.plusultra.security.gpg;
|
||||
|
||||
gpgConf = "${inputs.gpg-base-conf}/gpg.conf";
|
||||
|
||||
gpgAgentConf = ''
|
||||
enable-ssh-support
|
||||
default-cache-ttl 60
|
||||
max-cache-ttl 120
|
||||
'';
|
||||
|
||||
guide = "${inputs.yubikey-guide}/README.md";
|
||||
|
||||
theme = pkgs.fetchFromGitHub {
|
||||
owner = "jez";
|
||||
repo = "pandoc-markdown-css-theme";
|
||||
rev = "019a4829242937761949274916022e9861ed0627";
|
||||
sha256 = "1h48yqffpaz437f3c9hfryf23r95rr319lrb3y79kxpxbc9hihxb";
|
||||
};
|
||||
|
||||
guideHTML = pkgs.runCommand "yubikey-guide" { } ''
|
||||
${pkgs.pandoc}/bin/pandoc \
|
||||
--standalone \
|
||||
--metadata title="Yubikey Guide" \
|
||||
--from markdown \
|
||||
--to html5+smart \
|
||||
--toc \
|
||||
--template ${theme}/template.html5 \
|
||||
--css ${theme}/docs/css/theme.css \
|
||||
--css ${theme}/docs/css/skylighting-solarized-theme.css \
|
||||
-o $out \
|
||||
${guide}
|
||||
'';
|
||||
|
||||
reload-yubikey = pkgs.writeShellScriptBin "reload-yubikey" ''
|
||||
${pkgs.gnupg}/bin/gpg-connect-agent "scd serialno" "learn --force" /bye
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.plusultra.security.gpg = {
|
||||
enable = mkEnableOption "GPG";
|
||||
agentTimeout = mkOpt types.int 5 "The amount of time to wait before continuing with shell init.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnupg
|
||||
];
|
||||
|
||||
environment.shellInit = ''
|
||||
export GPG_TTY="$(tty)"
|
||||
export SSH_AUTH_SOCK=$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)
|
||||
|
||||
${pkgs.coreutils}/bin/timeout ${builtins.toString cfg.agentTimeout} ${pkgs.gnupg}/bin/gpgconf --launch gpg-agent
|
||||
gpg_agent_timeout_status=$?
|
||||
|
||||
if [ "$gpg_agent_timeout_status" = 124 ]; then
|
||||
# Command timed out...
|
||||
echo "GPG Agent timed out..."
|
||||
echo 'Run "gpgconf --launch gpg-agent" to try and launch it again.'
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
plusultra.home.file = {
|
||||
".gnupg/.keep".text = "";
|
||||
|
||||
".gnupg/yubikey-guide.md".source = guide;
|
||||
".gnupg/yubikey-guide.html".source = guideHTML;
|
||||
|
||||
".gnupg/gpg.conf".source = gpgConf;
|
||||
".gnupg/gpg-agent.conf".text = gpgAgentConf;
|
||||
};
|
||||
};
|
||||
}
|
17
modules/darwin/services/nix-daemon/default.nix
Normal file
17
modules/darwin/services/nix-daemon/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types mkIf;
|
||||
inherit (lib.plusultra) mkOpt enabled;
|
||||
|
||||
cfg = config.plusultra.services.nix-daemon;
|
||||
in
|
||||
{
|
||||
options.plusultra.services.nix-daemon = {
|
||||
enable = mkOpt types.bool true "Whether to enable the Nix daemon.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.nix-daemon = enabled;
|
||||
};
|
||||
}
|
43
modules/darwin/suites/common/default.nix
Normal file
43
modules/darwin/suites/common/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.suites.common;
|
||||
in
|
||||
{
|
||||
options.plusultra.suites.common = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable common configuration.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.zsh = enabled;
|
||||
|
||||
plusultra = {
|
||||
nix = enabled;
|
||||
|
||||
apps = {
|
||||
iterm2 = enabled;
|
||||
};
|
||||
|
||||
cli-apps = {
|
||||
neovim = enabled;
|
||||
};
|
||||
|
||||
tools = {
|
||||
git = enabled;
|
||||
flake = enabled;
|
||||
};
|
||||
|
||||
system = {
|
||||
fonts = enabled;
|
||||
input = enabled;
|
||||
interface = enabled;
|
||||
};
|
||||
|
||||
security = {
|
||||
gpg = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
35
modules/darwin/suites/development/default.nix
Normal file
35
modules/darwin/suites/development/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.suites.development;
|
||||
in
|
||||
{
|
||||
options.plusultra.suites.development = with types; {
|
||||
enable = mkBoolOpt false
|
||||
"Whether or not to enable common development configuration.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra = {
|
||||
apps = {
|
||||
vscode = enabled;
|
||||
};
|
||||
|
||||
tools = {
|
||||
# at = enabled;
|
||||
# direnv = enabled;
|
||||
# go = enabled;
|
||||
# http = enabled;
|
||||
# k8s = enabled;
|
||||
node = enabled;
|
||||
# titan = enabled;
|
||||
python = enabled;
|
||||
java = enabled;
|
||||
};
|
||||
|
||||
# virtualisation = { podman = enabled; };
|
||||
};
|
||||
};
|
||||
}
|
32
modules/darwin/system/fonts/default.nix
Normal file
32
modules/darwin/system/fonts/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.system.fonts;
|
||||
in
|
||||
{
|
||||
options.plusultra.system.fonts = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to manage fonts.";
|
||||
fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.variables = {
|
||||
# Enable icons in tooling since we have nerdfonts.
|
||||
LOG_ICONS = "true";
|
||||
};
|
||||
|
||||
fonts = {
|
||||
fontDir = enabled;
|
||||
|
||||
fonts = with pkgs;
|
||||
[
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
(nerdfonts.override { fonts = [ "Hack" ]; })
|
||||
] ++ cfg.fonts;
|
||||
};
|
||||
};
|
||||
}
|
1
modules/darwin/system/input/DefaultKeyBinding.dict
Normal file
1
modules/darwin/system/input/DefaultKeyBinding.dict
Normal file
|
@ -0,0 +1 @@
|
|||
{ "~a" = (); "~b" = (); "~c" = (); "~d" = (); "~e" = (); "~f" = (); "~g" = (); "~h" = (); "~i" = (); "~j" = (); "~k" = (); "~l" = (); "~m" = (); "~n" = (); "~o" = (); "~p" = (); "~q" = (); "~r" = (); "~s" = (); "~t" = (); "~u" = (); "~v" = (); "~w" = (); "~x" = (); "~y" = (); "~z" = (); }
|
55
modules/darwin/system/input/default.nix
Normal file
55
modules/darwin/system/input/default.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.system.input;
|
||||
in
|
||||
{
|
||||
options.plusultra.system.input = with types; {
|
||||
enable = mkEnableOption "macOS input";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
system = {
|
||||
keyboard = {
|
||||
enableKeyMapping = true;
|
||||
remapCapsLockToEscape = true;
|
||||
};
|
||||
|
||||
defaults = {
|
||||
".GlobalPreferences" = {
|
||||
"com.apple.mouse.scaling" = "1";
|
||||
};
|
||||
|
||||
NSGlobalDomain = {
|
||||
AppleKeyboardUIMode = 3;
|
||||
ApplePressAndHoldEnabled = false;
|
||||
|
||||
KeyRepeat = 2;
|
||||
InitialKeyRepeat = 15;
|
||||
|
||||
NSAutomaticCapitalizationEnabled = false;
|
||||
NSAutomaticDashSubstitutionEnabled = false;
|
||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||
NSAutomaticSpellingCorrectionEnabled = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
snowfallorg.user.${config.plusultra.user.name}.home.config = {
|
||||
home.activation = {
|
||||
# Disable special keys when using Option as a modifier.
|
||||
# https://superuser.com/questions/941286/disable-default-option-key-binding
|
||||
disableSpecialKeys = lib.home-manager.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
set +e
|
||||
$DRY_RUN_CMD /usr/bin/sudo mkdir -p $HOME/Library/KeyBindings
|
||||
$DRY_RUN_CMD /usr/bin/sudo cp '${builtins.toPath ./DefaultKeyBinding.dict}' "$HOME/Library/KeyBindings/DefaultKeyBinding.dict"
|
||||
set -e
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
]);
|
||||
}
|
29
modules/darwin/system/interface/default.nix
Normal file
29
modules/darwin/system/interface/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.system.interface;
|
||||
in
|
||||
{
|
||||
options.plusultra.system.interface = with types; {
|
||||
enable = mkEnableOption "macOS interface";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
system.defaults = {
|
||||
dock.autohide = true;
|
||||
|
||||
finder = {
|
||||
AppleShowAllExtensions = true;
|
||||
FXEnableExtensionChangeWarning = false;
|
||||
};
|
||||
|
||||
NSGlobalDomain = {
|
||||
_HIHideMenuBar = true;
|
||||
AppleShowScrollBars = "Always";
|
||||
};
|
||||
};
|
||||
|
||||
plusultra.home.file.".hushlogin".text = "";
|
||||
};
|
||||
}
|
18
modules/darwin/tools/flake/default.nix
Normal file
18
modules/darwin/tools/flake/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.tools.flake;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.flake = {
|
||||
enable = mkEnableOption "Flake";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
snowfallorg.flake
|
||||
];
|
||||
};
|
||||
}
|
43
modules/darwin/tools/git/default.nix
Normal file
43
modules/darwin/tools/git/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.tools.git;
|
||||
gpg = config.plusultra.security.gpg;
|
||||
user = config.plusultra.user;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.git = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to install and configure git.";
|
||||
userName = mkOpt types.str user.fullName "The name to configure git with.";
|
||||
userEmail = mkOpt types.str user.email "The email to configure git with.";
|
||||
signingKey =
|
||||
mkOpt types.str "9762169A1B35EA68" "The key ID to sign commits with.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ git ];
|
||||
|
||||
plusultra.home.extraOptions = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
inherit (cfg) userName userEmail;
|
||||
lfs = enabled;
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
signByDefault = mkIf gpg.enable true;
|
||||
};
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
pull = { rebase = true; };
|
||||
push = { autoSetupRemote = true; };
|
||||
core = { whitespace = "trailing-space,space-before-tab"; };
|
||||
safe = {
|
||||
directory = "${config.users.users.${user.name}.home}/work/config";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
17
modules/darwin/tools/java/default.nix
Normal file
17
modules/darwin/tools/java/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.tools.java;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.java = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Java.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
jdk
|
||||
];
|
||||
};
|
||||
}
|
42
modules/darwin/tools/node/default.nix
Normal file
42
modules/darwin/tools/node/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ options
|
||||
, config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.tools.node;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.node = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to install and configure git";
|
||||
pkg = mkOpt package pkgs.nodejs "The NodeJS package to use";
|
||||
prettier = {
|
||||
enable = mkBoolOpt true "Whether or not to install Prettier";
|
||||
pkg =
|
||||
mkOpt package pkgs.nodePackages.prettier "The NodeJS package to use";
|
||||
};
|
||||
yarn = {
|
||||
enable = mkBoolOpt true "Whether or not to install Yarn";
|
||||
pkg = mkOpt package pkgs.nodePackages.yarn "The NodeJS package to use";
|
||||
};
|
||||
pnpm = {
|
||||
enable = mkBoolOpt true "Whether or not to install Pnpm";
|
||||
pkg = mkOpt package pkgs.nodePackages.pnpm "The NodeJS package to use";
|
||||
};
|
||||
flyctl = {
|
||||
enable = mkBoolOpt true "Whether or not to install flyctl";
|
||||
pkg = mkOpt package pkgs.flyctl "The flyctl package to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs;
|
||||
[ cfg.pkg ]
|
||||
++ (lib.optional cfg.prettier.enable cfg.prettier.pkg)
|
||||
++ (lib.optional cfg.yarn.enable cfg.yarn.pkg)
|
||||
++ (lib.optional cfg.pnpm.enable cfg.pnpm.pkg)
|
||||
++ (lib.optional cfg.flyctl.enable cfg.flyctl.pkg);
|
||||
};
|
||||
}
|
22
modules/darwin/tools/python/default.nix
Normal file
22
modules/darwin/tools/python/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.tools.python;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.python = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Python.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
(python311.withPackages (ps:
|
||||
with ps; [
|
||||
numpy
|
||||
])
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
45
modules/darwin/user/default.nix
Normal file
45
modules/darwin/user/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) types mkIf mkDefault;
|
||||
inherit (lib.plusultra) mkOpt;
|
||||
|
||||
cfg = config.plusultra.user;
|
||||
|
||||
is-linux = pkgs.stdenv.isLinux;
|
||||
is-darwin = pkgs.stdenv.isDarwin;
|
||||
in
|
||||
{
|
||||
options.plusultra.user = {
|
||||
name = mkOpt types.str "short" "The user account.";
|
||||
|
||||
fullName = mkOpt types.str "Jake Hamilton" "The full name of the user.";
|
||||
email = mkOpt types.str "jake.hamilton@hey.com" "The email of the user.";
|
||||
|
||||
uid = mkOpt (types.nullOr types.int) 501 "The uid for the user account.";
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.${cfg.name} = {
|
||||
# NOTE: Setting the uid here is required for another
|
||||
# module to evaluate successfully since it reads
|
||||
# `users.users.${plusultra.user.name}.uid`.
|
||||
uid = mkIf (cfg.uid != null) cfg.uid;
|
||||
};
|
||||
|
||||
snowfallorg.user.${config.plusultra.user.name}.home.config = {
|
||||
home = {
|
||||
file = {
|
||||
".profile".text = ''
|
||||
# The default file limit is far too low and throws an error when rebuilding the system.
|
||||
# See the original with: ulimit -Sa
|
||||
ulimit -n 4096
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
27
modules/home/cli-apps/bash/default.nix
Normal file
27
modules/home/cli-apps/bash/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.plusultra.cli-apps.bash;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.bash = {
|
||||
enable = mkEnableOption "BASH shell";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
bashInteractive
|
||||
];
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
function msh() { mosh "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; };
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
22
modules/home/cli-apps/bat/default.nix
Normal file
22
modules/home/cli-apps/bat/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.cli-apps.bat;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.bat = {
|
||||
enable = mkEnableOption "bat";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config.theme = "ansi";
|
||||
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
|
||||
};
|
||||
};
|
||||
}
|
53
modules/home/cli-apps/fish/default.nix
Normal file
53
modules/home/cli-apps/fish/default.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.plusultra.cli-apps.fish;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.fish = {
|
||||
enable = mkEnableOption "FISH shell";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
function msh --wraps mosh --description 'mosh with tmux'
|
||||
if not set -q argv[1]
|
||||
echo 'Usage: msh [user@]host [command]'
|
||||
else
|
||||
${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
plugins = [{
|
||||
name = "foreign-env";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-foreign-env";
|
||||
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
||||
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
||||
};
|
||||
}];
|
||||
|
||||
shellInit =
|
||||
''
|
||||
# nix
|
||||
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
end
|
||||
|
||||
# home-manager
|
||||
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
49
modules/home/cli-apps/git/default.nix
Normal file
49
modules/home/cli-apps/git/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.cli-apps.git;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.git = {
|
||||
enable = mkEnableOption "git";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
delta
|
||||
gh
|
||||
];
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Harald Hoyer";
|
||||
userEmail = "harald@hoyer.xyz";
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
"credential \"https://github.com\"" = {
|
||||
helper = "!gh auth git-credential";
|
||||
};
|
||||
alias = {
|
||||
co = "checkout";
|
||||
ci = "commit";
|
||||
};
|
||||
pull.ff = "only";
|
||||
core.pager = "delta";
|
||||
delta = {
|
||||
features = "side-by-side line-numbers decorations";
|
||||
syntax-theme = "DarkNeon";
|
||||
light = "false";
|
||||
line-numbers = "true";
|
||||
navigate = "true";
|
||||
};
|
||||
interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
|
||||
merge.conflictStyle = "diff3";
|
||||
diff.colorMoved = "default";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
33
modules/home/cli-apps/home-manager/default.nix
Normal file
33
modules/home/cli-apps/home-manager/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (lib.plusultra) enabled;
|
||||
|
||||
cfg = config.plusultra.cli-apps.home-manager;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.home-manager = {
|
||||
enable = mkEnableOption "home-manager";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.home-manager = enabled;
|
||||
home.sessionVariables = {
|
||||
EDITOR = "${pkgs.vim}/bin/vim";
|
||||
BATDIFF_USE_DELTA = "true";
|
||||
};
|
||||
|
||||
home.shellAliases = {
|
||||
cat = "${pkgs.bat}/bin/bat --decorations never";
|
||||
less = ''${pkgs.bat}/bin/bat --decorations never --paging=always --pager "${pkgs.less}/bin/less -RF"'';
|
||||
man = "${pkgs.bat-extras.batman}/bin/batman";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
vim
|
||||
cachix
|
||||
];
|
||||
};
|
||||
}
|
230
modules/home/cli-apps/neovim/default.nix
Normal file
230
modules/home/cli-apps/neovim/default.nix
Normal file
|
@ -0,0 +1,230 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.plusultra.cli-apps.neovim;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.neovim = {
|
||||
enable = mkEnableOption "Neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim-flake = {
|
||||
enable = true;
|
||||
# your settings need to go into the settings attrset
|
||||
settings = {
|
||||
vim = {
|
||||
viAlias = false;
|
||||
vimAlias = false;
|
||||
debugMode = {
|
||||
enable = false;
|
||||
level = 20;
|
||||
logFile = "/tmp/nvim.log";
|
||||
};
|
||||
};
|
||||
|
||||
vim.lsp = {
|
||||
formatOnSave = true;
|
||||
lspkind.enable = false;
|
||||
lightbulb.enable = true;
|
||||
lspsaga.enable = false;
|
||||
nvimCodeActionMenu.enable = true;
|
||||
trouble.enable = true;
|
||||
lspSignature.enable = true;
|
||||
lsplines.enable = true;
|
||||
};
|
||||
|
||||
vim.debugger = {
|
||||
nvim-dap = {
|
||||
enable = true;
|
||||
ui.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.languages = {
|
||||
enableLSP = true;
|
||||
enableFormat = true;
|
||||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
nix = {
|
||||
enable = true;
|
||||
format.type = "nixpkgs-fmt";
|
||||
};
|
||||
html.enable = true;
|
||||
clang = {
|
||||
enable = true;
|
||||
lsp.server = "clangd";
|
||||
};
|
||||
sql.enable = false;
|
||||
rust = {
|
||||
enable = true;
|
||||
crates.enable = true;
|
||||
};
|
||||
java.enable = true;
|
||||
ts.enable = true;
|
||||
svelte.enable = true;
|
||||
go.enable = true;
|
||||
zig.enable = true;
|
||||
python.enable = true;
|
||||
dart.enable = true;
|
||||
elixir.enable = false;
|
||||
};
|
||||
|
||||
vim.visuals = {
|
||||
enable = true;
|
||||
nvimWebDevicons.enable = true;
|
||||
scrollBar.enable = true;
|
||||
smoothScroll.enable = true;
|
||||
cellularAutomaton.enable = true;
|
||||
fidget-nvim.enable = true;
|
||||
indentBlankline = {
|
||||
enable = true;
|
||||
fillChar = null;
|
||||
eolChar = null;
|
||||
showCurrContext = true;
|
||||
};
|
||||
cursorline = {
|
||||
enable = true;
|
||||
lineTimeout = 0;
|
||||
};
|
||||
};
|
||||
|
||||
vim.statusline = {
|
||||
lualine = {
|
||||
enable = true;
|
||||
theme = "catppuccin";
|
||||
};
|
||||
};
|
||||
|
||||
vim.theme = {
|
||||
enable = true;
|
||||
name = "catppuccin";
|
||||
style = "mocha";
|
||||
transparent = false;
|
||||
};
|
||||
|
||||
vim.autopairs.enable = true;
|
||||
|
||||
vim.autocomplete = {
|
||||
enable = true;
|
||||
type = "nvim-cmp";
|
||||
};
|
||||
|
||||
vim.filetree = {
|
||||
nvimTree = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.tabline = {
|
||||
nvimBufferline.enable = true;
|
||||
};
|
||||
|
||||
vim.treesitter.context.enable = true;
|
||||
|
||||
vim.binds = {
|
||||
whichKey.enable = true;
|
||||
cheatsheet.enable = true;
|
||||
};
|
||||
|
||||
vim.telescope.enable = true;
|
||||
|
||||
vim.git = {
|
||||
enable = true;
|
||||
gitsigns.enable = true;
|
||||
gitsigns.codeActions = false; # throws an annoying debug message
|
||||
};
|
||||
|
||||
vim.minimap = {
|
||||
minimap-vim.enable = false;
|
||||
codewindow.enable = true; # lighter, faster, and uses lua for configuration
|
||||
};
|
||||
|
||||
vim.dashboard = {
|
||||
dashboard-nvim.enable = false;
|
||||
alpha.enable = true;
|
||||
};
|
||||
|
||||
vim.notify = {
|
||||
nvim-notify.enable = true;
|
||||
};
|
||||
|
||||
vim.projects = {
|
||||
project-nvim.enable = true;
|
||||
};
|
||||
|
||||
vim.utility = {
|
||||
ccc.enable = true;
|
||||
vim-wakatime.enable = false;
|
||||
icon-picker.enable = true;
|
||||
surround.enable = true;
|
||||
diffview-nvim.enable = true;
|
||||
motion = {
|
||||
hop.enable = true;
|
||||
leap.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.notes = {
|
||||
obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled
|
||||
orgmode.enable = false;
|
||||
mind-nvim.enable = true;
|
||||
todo-comments.enable = true;
|
||||
};
|
||||
|
||||
vim.terminal = {
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
lazygit.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.ui = {
|
||||
borders.enable = true;
|
||||
noice.enable = true;
|
||||
colorizer.enable = true;
|
||||
modes-nvim.enable = false; # the theme looks terrible with catppuccin
|
||||
illuminate.enable = true;
|
||||
breadcrumbs = {
|
||||
enable = true;
|
||||
navbuddy.enable = true;
|
||||
};
|
||||
smartcolumn = {
|
||||
enable = true;
|
||||
columnAt.languages = {
|
||||
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||
nix = 110;
|
||||
ruby = 120;
|
||||
java = 130;
|
||||
go = [ 90 130 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vim.assistant = {
|
||||
copilot = {
|
||||
enable = true;
|
||||
cmp.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim.session = {
|
||||
nvim-session-manager.enable = false;
|
||||
};
|
||||
|
||||
vim.gestures = {
|
||||
gesture-nvim.enable = false;
|
||||
};
|
||||
|
||||
vim.comments = {
|
||||
comment-nvim.enable = true;
|
||||
};
|
||||
|
||||
vim.spellChecking.languages = [ "en" "de" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
32
modules/home/cli-apps/starship/default.nix
Normal file
32
modules/home/cli-apps/starship/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.plusultra.cli-apps.starship;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.starship = {
|
||||
enable = mkEnableOption "starship";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "JetBrainsMono" ]; })
|
||||
];
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
container.format = "[\\[$name\\]]($style) ";
|
||||
git_status = {
|
||||
ahead = "⇡$\{count}";
|
||||
diverged = "⇕⇡$\{ahead_count}⇣$\{behind_count}";
|
||||
behind = "⇣$\{count}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
20
modules/home/cli-apps/tmux/default.nix
Normal file
20
modules/home/cli-apps/tmux/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.cli-apps.tmux;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.tmux = {
|
||||
enable = mkEnableOption "Tmux";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
tmux
|
||||
];
|
||||
};
|
||||
}
|
11
modules/home/host/default.nix
Normal file
11
modules/home/host/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ lib, config, pkgs, host ? null, format ? "unknown", ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types;
|
||||
inherit (lib.plusultra) mkOpt;
|
||||
in
|
||||
{
|
||||
options.plusultra.host = {
|
||||
name = mkOpt (types.nullOr types.str) host "The host name.";
|
||||
};
|
||||
}
|
18
modules/home/tools/direnv/default.nix
Normal file
18
modules/home/tools/direnv/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.tools.direnv;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.direnv = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable direnv.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv = enabled;
|
||||
};
|
||||
};
|
||||
}
|
40
modules/home/tools/git/default.nix
Normal file
40
modules/home/tools/git/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types mkEnableOption mkIf;
|
||||
inherit (lib.plusultra) mkOpt enabled;
|
||||
|
||||
cfg = config.plusultra.tools.git;
|
||||
user = config.plusultra.user;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.git = {
|
||||
enable = mkEnableOption "Git";
|
||||
userName = mkOpt types.str user.fullName "The name to configure git with.";
|
||||
userEmail = mkOpt types.str user.email "The email to configure git with.";
|
||||
signingKey =
|
||||
mkOpt types.str "9762169A1B35EA68" "The key ID to sign commits with.";
|
||||
signByDefault = mkOpt types.bool true "Whether to sign commits by default.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
inherit (cfg) userName userEmail;
|
||||
lfs = enabled;
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
inherit (cfg) signByDefault;
|
||||
};
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
pull = { rebase = true; };
|
||||
push = { autoSetupRemote = true; };
|
||||
core = { whitespace = "trailing-space,space-before-tab"; };
|
||||
safe = {
|
||||
directory = "${user.home}/work/config";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/home/tools/jetbrains/default.nix
Normal file
21
modules/home/tools/jetbrains/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.tools.jetbrains;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.jetbrains = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable jetbrains.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.sessionPath = [
|
||||
"$HOME/.local/share/JetBrains/Toolbox/scripts"
|
||||
];
|
||||
home.packages = with pkgs; [
|
||||
jetbrains-toolbox
|
||||
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "JetBrainsMono" ]; })
|
||||
];
|
||||
};
|
||||
}
|
20
modules/home/tools/ssh/default.nix
Normal file
20
modules/home/tools/ssh/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types mkEnableOption mkIf;
|
||||
cfg = config.plusultra.tools.ssh;
|
||||
in
|
||||
{
|
||||
options.plusultra.tools.ssh = {
|
||||
enable = mkEnableOption "SSH";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.ssh = {
|
||||
extraConfig = ''
|
||||
Host *
|
||||
HostKeyAlgorithms +ssh-rsa
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
50
modules/home/user/default.nix
Normal file
50
modules/home/user/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ lib, config, pkgs, osConfig ? { }, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types mkIf mkDefault mkMerge;
|
||||
inherit (lib.plusultra) mkOpt;
|
||||
|
||||
cfg = config.plusultra.user;
|
||||
|
||||
is-linux = pkgs.stdenv.isLinux;
|
||||
is-darwin = pkgs.stdenv.isDarwin;
|
||||
|
||||
home-directory =
|
||||
if cfg.name == null then
|
||||
null
|
||||
else if is-darwin then
|
||||
"/Users/${cfg.name}"
|
||||
else
|
||||
"/home/${cfg.name}";
|
||||
in
|
||||
{
|
||||
options.plusultra.user = {
|
||||
enable = mkOpt types.bool false "Whether to configure the user account.";
|
||||
name = mkOpt (types.nullOr types.str) config.snowfallorg.user.name "The user account.";
|
||||
|
||||
fullName = mkOpt types.str "Jake Hamilton" "The full name of the user.";
|
||||
email = mkOpt types.str "jake.hamilton@hey.com" "The email of the user.";
|
||||
|
||||
home = mkOpt (types.nullOr types.str) home-directory "The user's home directory.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.name != null;
|
||||
message = "plusultra.user.name must be set";
|
||||
}
|
||||
{
|
||||
assertion = cfg.home != null;
|
||||
message = "plusultra.user.home must be set";
|
||||
}
|
||||
];
|
||||
|
||||
home = {
|
||||
username = mkDefault cfg.name;
|
||||
homeDirectory = mkDefault cfg.home;
|
||||
};
|
||||
}
|
||||
]);
|
||||
}
|
23
modules/nixos/apps/_1password/default.nix
Normal file
23
modules/nixos/apps/_1password/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps._1password;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps._1password = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable 1password.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
_1password = enabled;
|
||||
_1password-gui = {
|
||||
enable = true;
|
||||
|
||||
polkitPolicyOwners = [ config.plusultra.user.name ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
15
modules/nixos/apps/ardour/default.nix
Normal file
15
modules/nixos/apps/ardour/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.ardour;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.ardour = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Ardour.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ ardour ]; };
|
||||
}
|
14
modules/nixos/apps/blender/default.nix
Normal file
14
modules/nixos/apps/blender/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.blender;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.blender = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Blender.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ blender ]; };
|
||||
}
|
14
modules/nixos/apps/bottles/default.nix
Normal file
14
modules/nixos/apps/bottles/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.bottles;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.bottles = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Bottles.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ bottles ]; };
|
||||
}
|
14
modules/nixos/apps/cadence/default.nix
Normal file
14
modules/nixos/apps/cadence/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.cadence;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.cadence = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Cadence.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ cadence ]; };
|
||||
}
|
41
modules/nixos/apps/discord/default.nix
Normal file
41
modules/nixos/apps/discord/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ options, config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.discord;
|
||||
discord = lib.replugged.makeDiscordPlugged {
|
||||
inherit pkgs;
|
||||
|
||||
# This is currently broken, but could speed up Discord startup in the future.
|
||||
withOpenAsar = false;
|
||||
|
||||
plugins = {
|
||||
inherit (inputs) discord-tweaks;
|
||||
};
|
||||
|
||||
themes = {
|
||||
inherit (inputs) discord-nord-theme;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.discord = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Discord.";
|
||||
canary.enable = mkBoolOpt false "Whether or not to enable Discord Canary.";
|
||||
chromium.enable = mkBoolOpt false
|
||||
"Whether or not to enable the Chromium version of Discord.";
|
||||
firefox.enable = mkBoolOpt false
|
||||
"Whether or not to enable the Firefox version of Discord.";
|
||||
native.enable = mkBoolOpt false "Whether or not to enable the native version of Discord.";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable or cfg.chromium.enable) {
|
||||
environment.systemPackages =
|
||||
lib.optional cfg.enable discord
|
||||
++ lib.optional cfg.canary.enable pkgs.plusultra.discord
|
||||
++ lib.optional cfg.chromium.enable pkgs.plusultra.discord-chromium
|
||||
++ lib.optional cfg.firefox.enable pkgs.plusultra.discord-firefox
|
||||
++ lib.optional cfg.native.enable pkgs.discord;
|
||||
};
|
||||
}
|
18
modules/nixos/apps/dolphin/default.nix
Normal file
18
modules/nixos/apps/dolphin/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.dolphin;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.dolphin = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Dolphin.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ dolphin-emu ];
|
||||
|
||||
# Enable GameCube controller support.
|
||||
services.udev.packages = [ pkgs.dolphinEmu ];
|
||||
};
|
||||
}
|
30
modules/nixos/apps/doukutsu-rs/default.nix
Normal file
30
modules/nixos/apps/doukutsu-rs/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.doukutsu-rs;
|
||||
desktopItem = pkgs.makeDesktopItem {
|
||||
name = "doukutsu-rs";
|
||||
desktopName = "doukutsu-rs";
|
||||
genericName =
|
||||
"A fully playable re-implementation of Cave Story (Doukutsu Monogatari) engine written in Rust.";
|
||||
exec = "${pkgs.plusultra.doukutsu-rs}/bin/doukutsu-rs";
|
||||
icon = ./icon.png;
|
||||
type = "Application";
|
||||
categories = [ "Game" "AdventureGame" ];
|
||||
terminal = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.doukutsu-rs = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable doukutsu-rs.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs.plusultra; [
|
||||
doukutsu-rs
|
||||
desktopItem
|
||||
];
|
||||
};
|
||||
}
|
BIN
modules/nixos/apps/doukutsu-rs/icon.png
Normal file
BIN
modules/nixos/apps/doukutsu-rs/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
16
modules/nixos/apps/element/default.nix
Normal file
16
modules/nixos/apps/element/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.element;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.element = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Element.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ element-desktop ];
|
||||
};
|
||||
}
|
22
modules/nixos/apps/etcher/default.nix
Normal file
22
modules/nixos/apps/etcher/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.etcher;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.etcher = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable etcher.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs;
|
||||
[
|
||||
# Etcher is currently broken in nixpkgs, temporarily replaced with
|
||||
# gnome disk utility.
|
||||
# etcher
|
||||
gnome.gnome-disk-utility
|
||||
];
|
||||
};
|
||||
}
|
35
modules/nixos/apps/expressvpn/default.nix
Normal file
35
modules/nixos/apps/expressvpn/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.expressvpn;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.expressvpn = {
|
||||
enable = mkEnableOption "Express VPN";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
plusultra.expressvpn
|
||||
] ++ optionals config.plusultra.desktop.gnome.enable [
|
||||
gnomeExtensions.evpn-shell-assistant
|
||||
];
|
||||
|
||||
boot.kernelModules = [ "tun" ];
|
||||
|
||||
systemd.services.expressvpn = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "network-online.target" ];
|
||||
|
||||
description = "ExpressVPN Daemon";
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.plusultra.expressvpn}/bin/expressvpnd";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
66
modules/nixos/apps/firefox/default.nix
Normal file
66
modules/nixos/apps/firefox/default.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.firefox;
|
||||
defaultSettings = {
|
||||
"browser.aboutwelcome.enabled" = false;
|
||||
"browser.meta_refresh_when_inactive.disabled" = true;
|
||||
"browser.startup.homepage" = "https://hamho.me";
|
||||
"browser.bookmarks.showMobileBookmarks" = true;
|
||||
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
"browser.ssb.enabled" = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.firefox = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Firefox.";
|
||||
extraConfig =
|
||||
mkOpt str "" "Extra configuration for the user profile JS file.";
|
||||
userChrome =
|
||||
mkOpt str "" "Extra configuration for the user chrome CSS file.";
|
||||
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.desktop.addons.firefox-nordic-theme = enabled;
|
||||
|
||||
services.gnome.gnome-browser-connector.enable = config.plusultra.desktop.gnome.enable;
|
||||
|
||||
plusultra.home = {
|
||||
file = {
|
||||
".mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json";
|
||||
|
||||
".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = mkIf config.plusultra.desktop.gnome.enable "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox.override (
|
||||
{
|
||||
cfg = {
|
||||
enableBrowserpass = true;
|
||||
enableGnomeExtensions = config.plusultra.desktop.gnome.enable;
|
||||
};
|
||||
|
||||
extraNativeMessagingHosts =
|
||||
optional
|
||||
config.plusultra.desktop.gnome.enable
|
||||
pkgs.gnomeExtensions.gsconnect;
|
||||
}
|
||||
);
|
||||
|
||||
profiles.${config.plusultra.user.name} = {
|
||||
inherit (cfg) extraConfig userChrome settings;
|
||||
id = 0;
|
||||
name = config.plusultra.user.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
16
modules/nixos/apps/frappe-books/default.nix
Normal file
16
modules/nixos/apps/frappe-books/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.frappe-books;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.frappe-books = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable FrappeBooks.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ plusultra.frappe-books ];
|
||||
};
|
||||
}
|
15
modules/nixos/apps/freetube/default.nix
Normal file
15
modules/nixos/apps/freetube/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.freetube;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.freetube = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable FreeTube.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ freetube ]; };
|
||||
}
|
15
modules/nixos/apps/gimp/default.nix
Normal file
15
modules/nixos/apps/gimp/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.gimp;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.gimp = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Gimp.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ gimp ]; };
|
||||
}
|
15
modules/nixos/apps/gparted/default.nix
Normal file
15
modules/nixos/apps/gparted/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.gparted;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.gparted = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable gparted.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ gparted ]; };
|
||||
}
|
14
modules/nixos/apps/hey/default.nix
Normal file
14
modules/nixos/apps/hey/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.hey;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.hey = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable HEY.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ hey ]; };
|
||||
}
|
15
modules/nixos/apps/inkscape/default.nix
Normal file
15
modules/nixos/apps/inkscape/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.inkscape;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.inkscape = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Inkscape.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ inkscape-with-extensions google-fonts ];
|
||||
};
|
||||
}
|
14
modules/nixos/apps/logseq/default.nix
Normal file
14
modules/nixos/apps/logseq/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.logseq;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.logseq = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable logseq.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ logseq ]; };
|
||||
}
|
9
modules/nixos/apps/looking-glass-client/client.ini
Normal file
9
modules/nixos/apps/looking-glass-client/client.ini
Normal file
|
@ -0,0 +1,9 @@
|
|||
[input]
|
||||
escapeKey=56
|
||||
rawMouse=yes
|
||||
mouseSens=6
|
||||
|
||||
[win]
|
||||
size=1920x1080
|
||||
autoResize=yes
|
||||
quickSplash=yes
|
23
modules/nixos/apps/looking-glass-client/default.nix
Normal file
23
modules/nixos/apps/looking-glass-client/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.looking-glass-client;
|
||||
user = config.plusultra.user;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.looking-glass-client = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether or not to enable the Looking Glass client.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ looking-glass-client ];
|
||||
|
||||
environment.etc."looking-glass-client.ini" = {
|
||||
user = "+${toString config.users.users.${user.name}.uid}";
|
||||
source = ./client.ini;
|
||||
};
|
||||
};
|
||||
}
|
21
modules/nixos/apps/lutris/default.nix
Normal file
21
modules/nixos/apps/lutris/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.lutris;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.lutris = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Lutris.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
lutris
|
||||
# Needed for some installers like League of Legends
|
||||
openssl
|
||||
gnome.zenity
|
||||
];
|
||||
};
|
||||
}
|
25
modules/nixos/apps/obs/default.nix
Normal file
25
modules/nixos/apps/obs/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.obs;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.obs = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable support for OBS.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
(pkgs.wrapOBS {
|
||||
plugins = with pkgs.obs-studio-plugins; [
|
||||
wlrobs
|
||||
obs-multi-rtmp
|
||||
obs-move-transition
|
||||
looking-glass-obs
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
15
modules/nixos/apps/pcsx2/default.nix
Normal file
15
modules/nixos/apps/pcsx2/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.pcsx2;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.pcsx2 = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable PCSX2.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ pcsx2 ]; };
|
||||
}
|
15
modules/nixos/apps/pitivi/default.nix
Normal file
15
modules/nixos/apps/pitivi/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.pitivi;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.pitivi = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Pitivi.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ pitivi ]; };
|
||||
}
|
16
modules/nixos/apps/pocketcasts/default.nix
Normal file
16
modules/nixos/apps/pocketcasts/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.pocketcasts;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.pocketcasts = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Pocketcasts.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs.plusultra; [ pocketcasts ];
|
||||
};
|
||||
}
|
15
modules/nixos/apps/prismlauncher/default.nix
Normal file
15
modules/nixos/apps/prismlauncher/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.prismlauncher;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.prismlauncher = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Prism Launcher.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ prismlauncher ]; };
|
||||
}
|
16
modules/nixos/apps/protontricks/default.nix
Normal file
16
modules/nixos/apps/protontricks/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.protontricks;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.protontricks = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Protontricks.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ protontricks ];
|
||||
};
|
||||
}
|
18
modules/nixos/apps/r2modman/default.nix
Normal file
18
modules/nixos/apps/r2modman/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ options
|
||||
, config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.apps.r2modman;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.r2modman = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable r2modman.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ r2modman ]; };
|
||||
}
|
16
modules/nixos/apps/rpcs3/default.nix
Normal file
16
modules/nixos/apps/rpcs3/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.rpcs3;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.rpcs3 = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable rpcs3.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ rpcs3 ];
|
||||
};
|
||||
}
|
30
modules/nixos/apps/steam/default.nix
Normal file
30
modules/nixos/apps/steam/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.steam;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.steam = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable support for Steam.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.steam.enable = true;
|
||||
programs.steam.remotePlay.openFirewall = true;
|
||||
|
||||
hardware.steam-hardware.enable = true;
|
||||
|
||||
# Enable GameCube controller support.
|
||||
services.udev.packages = [ pkgs.dolphinEmu ];
|
||||
|
||||
environment.systemPackages = with pkgs.plusultra; [
|
||||
steam
|
||||
];
|
||||
|
||||
environment.sessionVariables = {
|
||||
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
|
||||
};
|
||||
};
|
||||
}
|
18
modules/nixos/apps/steamtinkerlaunch/default.nix
Normal file
18
modules/nixos/apps/steamtinkerlaunch/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.plusultra.apps.steamtinkerlaunch;
|
||||
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.steamtinkerlaunch = {
|
||||
enable = mkEnableOption "Steam Tinker Launch";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
steamtinkerlaunch
|
||||
];
|
||||
};
|
||||
}
|
15
modules/nixos/apps/twitter/default.nix
Normal file
15
modules/nixos/apps/twitter/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.twitter;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.twitter = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Twitter.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ twitter ]; };
|
||||
}
|
23
modules/nixos/apps/ubports-installer/default.nix
Normal file
23
modules/nixos/apps/ubports-installer/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.ubports-installer;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.ubports-installer = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable the UBPorts Installer.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs.plusultra; [
|
||||
ubports-installer
|
||||
];
|
||||
|
||||
services.udev.packages = with pkgs.plusultra; [
|
||||
ubports-installer-udev-rules
|
||||
];
|
||||
};
|
||||
}
|
21
modules/nixos/apps/virtualbox/default.nix
Normal file
21
modules/nixos/apps/virtualbox/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.virtualbox;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.virtualbox = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Virtualbox.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.virtualbox.host = {
|
||||
enable = true;
|
||||
enableExtensionPack = true;
|
||||
};
|
||||
|
||||
plusultra.user.extraGroups = [ "vboxusers" ];
|
||||
};
|
||||
}
|
14
modules/nixos/apps/vlc/default.nix
Normal file
14
modules/nixos/apps/vlc/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.vlc;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.vlc = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable vlc.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ vlc ]; };
|
||||
}
|
14
modules/nixos/apps/vscode/default.nix
Normal file
14
modules/nixos/apps/vscode/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.apps.vscode;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.vscode = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable vscode.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ vscode ]; };
|
||||
}
|
15
modules/nixos/apps/winetricks/default.nix
Normal file
15
modules/nixos/apps/winetricks/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.winetricks;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.winetricks = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Winetricks.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs; [ winetricks ]; };
|
||||
}
|
15
modules/nixos/apps/yt-music/default.nix
Normal file
15
modules/nixos/apps/yt-music/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.yt-music;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.yt-music = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable YouTube Music.";
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ yt-music ]; };
|
||||
}
|
17
modules/nixos/apps/yubikey/default.nix
Normal file
17
modules/nixos/apps/yubikey/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.yubikey;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.yubikey = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Yubikey.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.yubikey-agent.enable = true;
|
||||
environment.systemPackages = with pkgs; [ yubikey-manager-qt ];
|
||||
};
|
||||
}
|
16
modules/nixos/apps/yuzu/default.nix
Normal file
16
modules/nixos/apps/yuzu/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.apps.yuzu;
|
||||
in
|
||||
{
|
||||
options.plusultra.apps.yuzu = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Yuzu.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ yuzu-mainline ];
|
||||
};
|
||||
}
|
22
modules/nixos/archetypes/gaming/default.nix
Normal file
22
modules/nixos/archetypes/gaming/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.archetypes.gaming;
|
||||
in
|
||||
{
|
||||
options.plusultra.archetypes.gaming = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable the gaming archetype.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.suites = {
|
||||
common = enabled;
|
||||
desktop = enabled;
|
||||
games = enabled;
|
||||
social = enabled;
|
||||
media = enabled;
|
||||
};
|
||||
};
|
||||
}
|
26
modules/nixos/archetypes/server/default.nix
Normal file
26
modules/nixos/archetypes/server/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.archetypes.server;
|
||||
in
|
||||
{
|
||||
options.plusultra.archetypes.server = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether or not to enable the server archetype.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra = {
|
||||
suites = {
|
||||
common-slim = enabled;
|
||||
};
|
||||
|
||||
cli-apps = {
|
||||
neovim = enabled;
|
||||
tmux = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
29
modules/nixos/archetypes/workstation/default.nix
Normal file
29
modules/nixos/archetypes/workstation/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.archetypes.workstation;
|
||||
in
|
||||
{
|
||||
options.plusultra.archetypes.workstation = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether or not to enable the workstation archetype.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra = {
|
||||
suites = {
|
||||
common = enabled;
|
||||
desktop = enabled;
|
||||
development = enabled;
|
||||
art = enabled;
|
||||
video = enabled;
|
||||
social = enabled;
|
||||
media = enabled;
|
||||
};
|
||||
|
||||
tools = {
|
||||
appimage-run = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
18
modules/nixos/cache/public/default.nix
vendored
Normal file
18
modules/nixos/cache/public/default.nix
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.cache.public;
|
||||
in
|
||||
{
|
||||
options.plusultra.cache.public = {
|
||||
enable = mkEnableOption "Plus Ultra public cache";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.nix.extra-substituters = {
|
||||
"https://attic.ruby.hamho.me/public".key = "public:QUkZTErD8fx9HQ64kuuEUZHO9tXNzws7chV8qy/KLUk=";
|
||||
};
|
||||
};
|
||||
}
|
18
modules/nixos/cli-apps/flake/default.nix
Normal file
18
modules/nixos/cli-apps/flake/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
inputs@{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.cli-apps.flake;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.flake = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable flake.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
snowfallorg.flake
|
||||
];
|
||||
};
|
||||
}
|
47
modules/nixos/cli-apps/neovim/default.nix
Normal file
47
modules/nixos/cli-apps/neovim/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
inputs @ { options
|
||||
, config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.cli-apps.neovim;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.neovim = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable neovim.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# FIXME: As of today (2022-12-09), `page` no longer works with my Neovim
|
||||
# configuration. Either something in my configuration is breaking it or `page` is busted.
|
||||
# page
|
||||
plusultra.neovim
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
# PAGER = "page";
|
||||
# MANPAGER =
|
||||
# "page -C -e 'au User PageDisconnect sleep 100m|%y p|enew! |bd! #|pu p|set ft=man'";
|
||||
PAGER = "less";
|
||||
MANPAGER = "less";
|
||||
NPM_CONFIG_PREFIX = "$HOME/.npm-global";
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
plusultra.home = {
|
||||
configFile = {
|
||||
"dashboard-nvim/.keep".text = "";
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
# Use Neovim for Git diffs.
|
||||
programs.zsh.shellAliases.vimdiff = "nvim -d";
|
||||
programs.bash.shellAliases.vimdiff = "nvim -d";
|
||||
programs.fish.shellAliases.vimdiff = "nvim -d";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
31
modules/nixos/cli-apps/prisma/default.nix
Normal file
31
modules/nixos/cli-apps/prisma/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.cli-apps.prisma;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.prisma = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to install Prisma";
|
||||
pkgs = {
|
||||
npm = mkOpt package pkgs.nodePackages.prisma "The NPM package to install";
|
||||
engines = mkOpt package pkgs.prisma-engines
|
||||
"The package to get prisma engines from";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.pkgs.npm ];
|
||||
|
||||
plusultra.home.extraOptions = {
|
||||
programs.zsh.initExtra = ''
|
||||
export PRISMA_MIGRATION_ENGINE_BINARY="${cfg.pkgs.engines}/bin/migration-engine"
|
||||
export PRISMA_QUERY_ENGINE_BINARY="${cfg.pkgs.engines}/bin/query-engine"
|
||||
export PRISMA_QUERY_ENGINE_LIBRARY="${cfg.pkgs.engines}/lib/libquery_engine.node"
|
||||
export PRISMA_INTROSPECTION_ENGINE_BINARY="${cfg.pkgs.engines}/bin/introspection-engine"
|
||||
export PRISMA_FMT_BINARY="${cfg.pkgs.engines}/bin/prisma-fmt"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
16
modules/nixos/cli-apps/proton/default.nix
Normal file
16
modules/nixos/cli-apps/proton/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.cli-apps.proton;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.proton = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Proton.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ proton-caller ];
|
||||
};
|
||||
}
|
20
modules/nixos/cli-apps/thaw/default.nix
Normal file
20
modules/nixos/cli-apps/thaw/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.cli-apps.thaw;
|
||||
in
|
||||
{
|
||||
options.plusultra.cli-apps.thaw = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable thaw.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
snowfallorg.thaw
|
||||
];
|
||||
};
|
||||
}
|
5
modules/nixos/cli-apps/tmux/config/continuum.tmux
Normal file
5
modules/nixos/cli-apps/tmux/config/continuum.tmux
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Enable saving sessions.
|
||||
set -g @continuum-restore 'on'
|
||||
|
||||
# Save every 30 minutes.
|
||||
set -g @continuum-save-interval '30'
|
15
modules/nixos/cli-apps/tmux/config/extrakto.tmux
Normal file
15
modules/nixos/cli-apps/tmux/config/extrakto.tmux
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Create a vertical split to show search & results to keep
|
||||
# the content visible.
|
||||
set -g @extrakto_split_direction "v"
|
||||
|
||||
# Override the way that Extrakto copies text. By default
|
||||
# it was trying to use xclip and would not properly pick
|
||||
# up on $XDG_SESSION_TYPE being wayland. Instead, use
|
||||
# Tmux's built-in clipboard functionality.
|
||||
set -g @extrakto_clip_tool_run "tmux_osc52"
|
||||
|
||||
# FIXME: The current version of Extrakto in
|
||||
# NixPkgs is out of date and does not support wayland.
|
||||
# This overrides the clipping tool to ensure that it works
|
||||
# under wayland.
|
||||
set -g @extrakto_clip_tool "wl-copy"
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue