chore(modules,home-manager): remove unused modules
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./programs
|
||||
./profiles
|
||||
./packages
|
||||
];
|
||||
options = {};
|
||||
config = {};
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./lmms.nix
|
||||
];
|
||||
options = {};
|
||||
config = {};
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
package = pkgs.stdenv.mkDerivation rec {
|
||||
pname = "lmms";
|
||||
version = "1.2.2";
|
||||
|
||||
src = builtins.fetchGit {
|
||||
url = "https://github.com/LMMS/lmms.git";
|
||||
ref = "main";
|
||||
rev = "729593c0228c2553248099a09f4fcb6dbe8312e1";
|
||||
submodules = true;
|
||||
shallow = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [cmake libsForQt5.qt5.qttools pkg-config];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
carla
|
||||
alsa-lib
|
||||
fftwFloat
|
||||
fltk13
|
||||
fluidsynth
|
||||
lame
|
||||
libgig
|
||||
libjack2
|
||||
libpulseaudio
|
||||
libsamplerate
|
||||
libsndfile
|
||||
libsoundio
|
||||
libvorbis
|
||||
portaudio
|
||||
libsForQt5.qt5.qtbase
|
||||
libsForQt5.qt5.qtx11extras
|
||||
SDL # TODO: switch to SDL2 in the next version
|
||||
];
|
||||
|
||||
patches = [
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/cf64acc45e3264c6923885867e2dbf8b7586a36b/trunk/lmms-carla-export.patch";
|
||||
sha256 = "sha256-wlSewo93DYBN2PvrcV58dC9kpoo9Y587eCeya5OX+j4=";
|
||||
})
|
||||
];
|
||||
|
||||
cmakeFlags = ["-DWANT_QT5=ON"];
|
||||
|
||||
meta = with lib; {
|
||||
description = "DAW similar to FL Studio (music production software)";
|
||||
mainProgram = "lmms";
|
||||
homepage = "https://lmms.io";
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = ["x86_64-linux" "i686-linux"];
|
||||
maintainers = [];
|
||||
};
|
||||
};
|
||||
in {
|
||||
home.packages = [
|
||||
# package
|
||||
];
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./gfonts.nix
|
||||
./vault
|
||||
];
|
||||
options = {};
|
||||
config = {};
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.profiles.gfonts;
|
||||
in {
|
||||
options.profiles.gfonts = with lib;
|
||||
with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
};
|
||||
config = with lib;
|
||||
mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
cantarell-fonts
|
||||
google-fonts
|
||||
(nerdfonts.override {fonts = ["FiraCode"];})
|
||||
(stdenv.mkDerivation rec {
|
||||
pname = "calsans";
|
||||
version = "1.0.0";
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/calcom/font/releases/download/v${version}/CalSans_Semibold_v${version}.zip";
|
||||
stripRoot = false;
|
||||
hash = "sha256-JqU64JUgWimJgrKX3XYcml8xsvy//K7O5clNKJRGaTM=";
|
||||
};
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -m444 -Dt $out/share/fonts/truetype fonts/webfonts/*.ttf
|
||||
runHook postInstall
|
||||
'';
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/calcom/font";
|
||||
license = licenses.ofl;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
set -e
|
||||
|
||||
function sync() {
|
||||
pushd "$VAULT_DIR"
|
||||
|
||||
git pull
|
||||
|
||||
git add .
|
||||
|
||||
if [[ $(git status --porcelain) ]]; then
|
||||
git commit -am "vault sync: $(date +%F) $(date +%R)"
|
||||
git push -u origin main
|
||||
fi
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
"sync") sync ;;
|
||||
*) echo "Not a valid command: $1" ;;
|
||||
esac
|
||||
@@ -1,74 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.profiles.vault;
|
||||
vault = pkgs.writeShellScriptBin "vault" ''
|
||||
VAULT_DIR="${cfg.vaultDir}"
|
||||
|
||||
${builtins.readFile ./cli.sh}
|
||||
'';
|
||||
in {
|
||||
imports = [];
|
||||
options.profiles.vault = with lib;
|
||||
with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
vaultDir = mkOption {
|
||||
type = either path str;
|
||||
default = "${config.home.homeDirectory}/.vault";
|
||||
};
|
||||
periodicPush = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
config = with lib;
|
||||
mkIf cfg.enable {
|
||||
services.flatpak.packages = [
|
||||
"md.obsidian.Obsidian"
|
||||
];
|
||||
home.packages = [
|
||||
vault
|
||||
];
|
||||
|
||||
home.file = {
|
||||
"${cfg.vaultDir}/vault" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
${vault}
|
||||
'';
|
||||
};
|
||||
};
|
||||
systemd.user.services = mkIf cfg.periodicPush {
|
||||
vault-periodic-push = {
|
||||
Install = {
|
||||
WantedBy = ["default.target"];
|
||||
};
|
||||
Service = let
|
||||
script = pkgs.writeShellScriptBin "vault-periodic-push" ''
|
||||
${vault} sync
|
||||
'';
|
||||
in {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
StandardOutput = "journal";
|
||||
ExecStart = script;
|
||||
ExecStop = script;
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.timers = mkIf cfg.periodicPush {
|
||||
vault-periodic-push = {
|
||||
Install = {
|
||||
WantedBy = ["timers.target"];
|
||||
};
|
||||
Timer = {
|
||||
OnBootSec = "1min";
|
||||
OnUnitActiveSec = "2h";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,437 +0,0 @@
|
||||
/*
|
||||
THIS FILE ISN'T LICENSED UNDER THE WTFPL LICENSE.
|
||||
|
||||
This file is copied from Home-manager's GitHub and was modified to suit my
|
||||
(Gustavo "Guz" L. de Mello) personal needs. The original file can be found
|
||||
here: https://github.com/nix-community/home-manager/blob/master/modules/programs/firefox.nix
|
||||
|
||||
Said file is licensed under the MIT License, which a copy is written below:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2023 Home Manager contributors
|
||||
Copyright (c) 2023-present Gustavo "Guz" L. de Mello
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.librewolf;
|
||||
|
||||
jsonFormat = pkgs.formats.json {};
|
||||
|
||||
firefoxConfigPath = ".librewolf";
|
||||
profilesPath = firefoxConfigPath;
|
||||
|
||||
# The extensions path shared by all profiles; will not be supported
|
||||
# by future Firefox versions.
|
||||
extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
||||
|
||||
profiles =
|
||||
flip mapAttrs' cfg.profiles
|
||||
(_: profile:
|
||||
nameValuePair "Profile${toString profile.id}" {
|
||||
Name = profile.name;
|
||||
Path = profile.path;
|
||||
IsRelative = 1;
|
||||
Default =
|
||||
if profile.isDefault
|
||||
then 1
|
||||
else 0;
|
||||
})
|
||||
// {
|
||||
General = {StartWithLastProfile = 1;};
|
||||
};
|
||||
|
||||
profilesIni = generators.toINI {} profiles;
|
||||
|
||||
userPrefValue = pref:
|
||||
builtins.toJSON (
|
||||
if isBool pref || isInt pref || isString pref
|
||||
then pref
|
||||
else builtins.toJSON pref
|
||||
);
|
||||
|
||||
mkUserJs = prefs: extraPrefs: bookmarks: let
|
||||
prefs' =
|
||||
lib.optionalAttrs ([] != bookmarks)
|
||||
{
|
||||
"browser.bookmarks.file" = toString (firefoxBookmarksFile bookmarks);
|
||||
"browser.places.importBookmarksHTML" = true;
|
||||
}
|
||||
// prefs;
|
||||
in ''
|
||||
// Generated by Home Manager.
|
||||
|
||||
${concatStrings (mapAttrsToList (name: value: ''
|
||||
user_pref("${name}", ${userPrefValue value});
|
||||
'')
|
||||
prefs')}
|
||||
|
||||
${extraPrefs}
|
||||
'';
|
||||
|
||||
mkContainersJson = containers: let
|
||||
containerToIdentity = _: container: {
|
||||
userContextId = container.id;
|
||||
name = container.name;
|
||||
icon = container.icon;
|
||||
color = container.color;
|
||||
public = true;
|
||||
};
|
||||
in ''
|
||||
${builtins.toJSON {
|
||||
version = 4;
|
||||
lastUserContextId =
|
||||
elemAt (mapAttrsToList (_: container: container.id) containers) 0;
|
||||
identities = mapAttrsToList containerToIdentity containers;
|
||||
}}
|
||||
'';
|
||||
|
||||
firefoxBookmarksFile = bookmarks: let
|
||||
indent = level:
|
||||
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
|
||||
|
||||
bookmarkToHTML = indentLevel: bookmark: ''
|
||||
${indent indentLevel}<DT><A HREF="${
|
||||
escapeXML bookmark.url
|
||||
}" ADD_DATE="1" LAST_MODIFIED="1"${
|
||||
lib.optionalString (bookmark.keyword != null)
|
||||
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
|
||||
}${
|
||||
lib.optionalString (bookmark.tags != [])
|
||||
" TAGS=\"${escapeXML (concatStringsSep "," bookmark.tags)}\""
|
||||
}>${escapeXML bookmark.name}</A>'';
|
||||
|
||||
directoryToHTML = indentLevel: directory: ''
|
||||
${indent indentLevel}<DT>${
|
||||
if directory.toolbar
|
||||
then ''
|
||||
<H3 ADD_DATE="1" LAST_MODIFIED="1" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
|
||||
else ''<H3 ADD_DATE="1" LAST_MODIFIED="1">${escapeXML directory.name}''
|
||||
}</H3>
|
||||
${indent indentLevel}<DL><p>
|
||||
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
|
||||
${indent indentLevel}</DL><p>'';
|
||||
|
||||
itemToHTMLOrRecurse = indentLevel: item:
|
||||
if item ? "url"
|
||||
then bookmarkToHTML indentLevel item
|
||||
else directoryToHTML indentLevel item;
|
||||
|
||||
allItemsToHTML = indentLevel: bookmarks:
|
||||
lib.concatStringsSep "\n"
|
||||
(map (itemToHTMLOrRecurse indentLevel) bookmarks);
|
||||
|
||||
bookmarkEntries = allItemsToHTML 1 bookmarks;
|
||||
in
|
||||
pkgs.writeText "firefox-bookmarks.html" ''
|
||||
<!DOCTYPE NETSCAPE-Bookmark-file-1>
|
||||
<!-- This is an automatically generated file.
|
||||
It will be read and overwritten.
|
||||
DO NOT EDIT! -->
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<TITLE>Bookmarks</TITLE>
|
||||
<H1>Bookmarks Menu</H1>
|
||||
<DL><p>
|
||||
${bookmarkEntries}
|
||||
</DL>
|
||||
'';
|
||||
|
||||
mkNoDuplicateAssertion = entities: entityKind: (
|
||||
let
|
||||
# Return an attribute set with entity IDs as keys and a list of
|
||||
# entity names with corresponding ID as value. An ID is present in
|
||||
# the result only if more than one entity has it. The argument
|
||||
# entities is a list of AttrSet of one id/name pair.
|
||||
findDuplicateIds = entities:
|
||||
filterAttrs (_entityId: entityNames: length entityNames != 1)
|
||||
(zipAttrs entities);
|
||||
|
||||
duplicates = findDuplicateIds (mapAttrsToList
|
||||
(entityName: entity: {"${toString entity.id}" = entityName;})
|
||||
entities);
|
||||
|
||||
mkMsg = entityId: entityNames:
|
||||
" - ID ${entityId} is used by " + concatStringsSep ", " entityNames;
|
||||
in {
|
||||
assertion = duplicates == {};
|
||||
message =
|
||||
''
|
||||
Must not have a Firefox ${entityKind} with an existing ID but
|
||||
''
|
||||
+ concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
|
||||
}
|
||||
);
|
||||
in {
|
||||
imports = [];
|
||||
options.librewolf = with lib;
|
||||
with lib.types; {
|
||||
enable = mkEnableOption "Enable module";
|
||||
overrides = mkOption {
|
||||
default = {};
|
||||
type = attrsOf (either bool (either int str));
|
||||
};
|
||||
profiles = mkOption {
|
||||
type = attrsOf (submodule ({
|
||||
config,
|
||||
name,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = name;
|
||||
};
|
||||
id = mkOption {
|
||||
type = ints.unsigned;
|
||||
default = 0;
|
||||
};
|
||||
settings = mkOption {
|
||||
type = attrsOf (jsonFormat.type
|
||||
// {
|
||||
description = "";
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
type = lines;
|
||||
default = "";
|
||||
};
|
||||
userChrome = mkOption {
|
||||
type = lines;
|
||||
default = "";
|
||||
};
|
||||
userContent = mkOption {
|
||||
type = lines;
|
||||
default = "";
|
||||
};
|
||||
bookmarks =
|
||||
mkOption
|
||||
{
|
||||
type = let
|
||||
bookmarkSubmodule =
|
||||
submodule
|
||||
({
|
||||
config,
|
||||
name,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = name;
|
||||
};
|
||||
tags = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
};
|
||||
keyword = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
url = mkOption {
|
||||
type = str;
|
||||
};
|
||||
};
|
||||
});
|
||||
bookmarkType = addCheck bookmarkSubmodule (x: x ? "url");
|
||||
|
||||
directoryType = submodule ({
|
||||
config,
|
||||
name,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = name;
|
||||
};
|
||||
bookmarks = mkOption {
|
||||
type = listOf nodeType;
|
||||
default = [];
|
||||
};
|
||||
toolbar = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
nodeType = either bookmarkType directoryType;
|
||||
in
|
||||
with types;
|
||||
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
|
||||
default = [];
|
||||
};
|
||||
path = mkOption {
|
||||
type = str;
|
||||
default = name;
|
||||
};
|
||||
isDefault = mkOption {
|
||||
type = bool;
|
||||
default = config.id == 0;
|
||||
};
|
||||
# For some reason Librewolf isn't working with the generated file, so
|
||||
# a static one is passed as a temp fix.
|
||||
search.file = mkOption {
|
||||
type = path;
|
||||
default = ./search.json.mozlz4;
|
||||
};
|
||||
/*
|
||||
search = {
|
||||
force = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
default = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
privateDefault = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
order = mkOption {
|
||||
type = uniq (listOf str);
|
||||
default = [ ];
|
||||
};
|
||||
engines = mkOption {
|
||||
type = attrsOf (attrsOf jsonFormat.type);
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
*/
|
||||
containers = mkOption {
|
||||
type =
|
||||
attrsOf
|
||||
(submodule ({name, ...}: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = name;
|
||||
};
|
||||
id = mkOption {
|
||||
type = ints.unsigned;
|
||||
default = 0;
|
||||
};
|
||||
color = mkOption {
|
||||
type = enum [
|
||||
"blue"
|
||||
"turquoise"
|
||||
"green"
|
||||
"yellow"
|
||||
"orange"
|
||||
"red"
|
||||
"pink"
|
||||
"purple"
|
||||
"toolbar"
|
||||
];
|
||||
default = "pink";
|
||||
};
|
||||
icon = mkOption {
|
||||
type = enum [
|
||||
"briefcase"
|
||||
"cart"
|
||||
"circle"
|
||||
"dollar"
|
||||
"fence"
|
||||
"fingerprint"
|
||||
"gift"
|
||||
"vacation"
|
||||
"food"
|
||||
"fruit"
|
||||
"pet"
|
||||
"tree"
|
||||
"chill"
|
||||
];
|
||||
default = "fruit";
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = {};
|
||||
};
|
||||
extensions = mkOption {
|
||||
type = listOf package;
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.librewolf.enable = true;
|
||||
programs.librewolf.settings = cfg.overrides;
|
||||
|
||||
home.file = mkMerge ([
|
||||
{
|
||||
"${firefoxConfigPath}/profiles.ini" = mkIf (cfg.profiles != {}) {
|
||||
text = profilesIni;
|
||||
force = true;
|
||||
};
|
||||
}
|
||||
]
|
||||
++ flip mapAttrsToList cfg.profiles (_: profile: {
|
||||
"${profilesPath}/${profile.path}/.keep".text = "";
|
||||
|
||||
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
||||
mkIf (profile.userChrome != "") {text = profile.userChrome;};
|
||||
|
||||
"${profilesPath}/${profile.path}/chrome/userContent.css" =
|
||||
mkIf (profile.userContent != "") {text = profile.userContent;};
|
||||
|
||||
"${profilesPath}/${profile.path}/user.js" =
|
||||
mkIf
|
||||
(profile.settings
|
||||
!= {}
|
||||
|| profile.extraConfig != ""
|
||||
|| profile.bookmarks != [])
|
||||
{
|
||||
text =
|
||||
mkUserJs profile.settings profile.extraConfig profile.bookmarks;
|
||||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/containers.json" = mkIf (profile.containers != {}) {
|
||||
text = mkContainersJson profile.containers;
|
||||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/search.json.mozlz4" = {
|
||||
force = true;
|
||||
source = ./search.json.mozlz4; # Use static file, because for some reason this isn't working with Librewolf.
|
||||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/extensions" = mkIf (profile.extensions != []) {
|
||||
source = let
|
||||
extensionsEnvPkg = pkgs.buildEnv {
|
||||
name = "hm-firefox-extensions";
|
||||
paths = profile.extensions;
|
||||
};
|
||||
in "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
recursive = true;
|
||||
force = true;
|
||||
};
|
||||
}));
|
||||
};
|
||||
}
|
||||
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
./krita
|
||||
./prismlauncher.nix
|
||||
./wezterm.nix
|
||||
];
|
||||
options = {};
|
||||
config = {};
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.programs.hyprland;
|
||||
hyprconfValueType = with lib.types;
|
||||
nullOr (oneOf [
|
||||
bool
|
||||
int
|
||||
float
|
||||
str
|
||||
path
|
||||
(attrsOf hyprconfValueType)
|
||||
(listOf hyprconfValueType)
|
||||
]);
|
||||
in {
|
||||
imports = [];
|
||||
options.programs.hyprland = with lib;
|
||||
with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
settings = mkOption {
|
||||
type = attrsOf hyprconfValueType;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config = with lib;
|
||||
mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.enable = true;
|
||||
wayland.windowManager.hyprland.package = inputs.hyprland.packages."${pkgs.system}".hyprland;
|
||||
wayland.windowManager.hyprland.xwayland.enable = true;
|
||||
wayland.windowManager.hyprland.systemd.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland.settings = cfg.settings;
|
||||
};
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.programs.krita;
|
||||
in {
|
||||
imports = [];
|
||||
options.programs.krita = with lib;
|
||||
with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
};
|
||||
config = with lib;
|
||||
mkIf cfg.enable {
|
||||
home.packages = with pkgs; [krita ffmpeg];
|
||||
|
||||
home.file."${config.xdg.configHome}/kritarc".source = ./kritarc;
|
||||
home.file."${config.xdg.configHome}/kritashortcutsrc".source = ./kritashortcutsrc;
|
||||
};
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
|
||||
[Shortcuts]
|
||||
mirrorImageHorizontal=H
|
||||
mirrorImageVertical=V
|
||||
show_color_history=none
|
||||
@@ -1 +0,0 @@
|
||||
{...}: {}
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.programs.prismlauncher;
|
||||
in {
|
||||
imports = [];
|
||||
options.programs.prismlauncher = with lib;
|
||||
with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
flatpak = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
config = with lib;
|
||||
mkIf cfg.enable {
|
||||
services.flatpak = mkIf cfg.flatpak {
|
||||
packages = ["org.prismlauncher.PrismLauncher"];
|
||||
};
|
||||
|
||||
home.packages = with pkgs;
|
||||
mkIf (!cfg.flatpak) [
|
||||
prismlauncher
|
||||
glfw
|
||||
];
|
||||
programs.java = mkIf (!cfg.flatpak) {
|
||||
enable = true;
|
||||
package = mkDefault pkgs.jdk22;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with builtins; let
|
||||
cfg = config.programs.wezterm;
|
||||
jsonFormat = pkgs.formats.json {};
|
||||
toLua = with lib.strings;
|
||||
v:
|
||||
if isList v
|
||||
then "{ ${concatMapStringsSep ", " (i: toLua i) v} }"
|
||||
else if isAttrs v
|
||||
then "\{ ${concatStringsSep ", " (attrValues (mapAttrs (n: a: "${n} = ${toLua a}") v))} \}"
|
||||
else if isNull v
|
||||
then "nil"
|
||||
else if isBool v
|
||||
then
|
||||
if v
|
||||
then "true"
|
||||
else "false"
|
||||
else if isInt v
|
||||
then toString v
|
||||
else if isString v && hasPrefix "lua " v
|
||||
then "${substring 4 (stringLength v) v}"
|
||||
else "\"${toString v}\"";
|
||||
configInLua = pkgs.writeText "nih-wezterm-generated-config" ''
|
||||
local wezterm = require("wezterm");
|
||||
|
||||
local nih_generated_config = {};
|
||||
${concatStringsSep "\n" (attrValues (mapAttrs
|
||||
(n: v: "nih_generated_config.${n} = ${toLua v};")
|
||||
cfg.config))}
|
||||
|
||||
local function extra_config()
|
||||
${cfg.extraConfig}
|
||||
end
|
||||
|
||||
for k,v in pairs(extra_config()) do nih_generated_config[k] = v end
|
||||
|
||||
return nih_generated_config;
|
||||
'';
|
||||
prettyConfig = pkgs.runCommand "nih-wezterm-pretty-config" {config = configInLua;} ''
|
||||
echo "Nih's Wezterm configuration file builder";
|
||||
echo "input file: $config";
|
||||
echo "output file: $out";
|
||||
echo ""
|
||||
echo "Formatting config file with Stylua"
|
||||
cat $config | ${pkgs.stylua}/bin/stylua - > $out
|
||||
echo ""
|
||||
echo "Checking erros with luacheck"
|
||||
${pkgs.luajitPackages.luacheck}/bin/luacheck \
|
||||
--no-max-line-length \
|
||||
--no-unused \
|
||||
"$out";
|
||||
'';
|
||||
in {
|
||||
imports = [];
|
||||
options.programs.wezterm = with lib;
|
||||
with lib.types; {
|
||||
config = mkOption {
|
||||
type = submodule ({...}: {
|
||||
freeformType = jsonFormat.type;
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config = with lib;
|
||||
mkIf cfg.enable {
|
||||
xdg.configFile."wezterm/wezterm.lua".source = prettyConfig;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user