refactor(nix): give alias to long symlink func and misc refactor

This commit is contained in:
matt1432 2023-10-03 11:08:56 -04:00
parent 84796a92a8
commit d7ad60297d
3 changed files with 24 additions and 18 deletions

View file

@ -1,26 +1,30 @@
{ config, pkgs, ... }: let { config, pkgs, ... }: let
configDir = (import ../vars.nix).configDir; configDir = (import ../vars.nix).configDir;
symlink = config.lib.file.mkOutOfStoreSymlink;
in in
{ {
xdg.configFile = { xdg.configFile = {
"swayosd/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swayosd/style.css"; "swayosd/style.css".source = symlink "${configDir}/swayosd/style.css";
"gtklock/config.ini".source = pkgs.writeText "config.ini" '' "gtklock/config.ini".source = pkgs.writeText "config.ini" ''
[main] [main]
modules=${pkgs.gtklock-powerbar-module}/lib/gtklock/powerbar-module.so;${pkgs.gtklock-playerctl-module}/lib/gtklock/playerctl-module.so modules=${builtins.concatStringsSep ";" [
"${pkgs.gtklock-powerbar-module}/lib/gtklock/powerbar-module.so"
"${pkgs.gtklock-playerctl-module}/lib/gtklock/playerctl-module.so"
]}
''; '';
"gtklock/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/style.css"; "gtklock/style.css".source = symlink "${configDir}/gtklock/style.css";
"ripgrep".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/ripgrep"; "ripgrep".source = symlink "${configDir}/ripgrep";
"discord/settings.json".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/discord/settings.json"; "discord/settings.json".source = symlink "${configDir}/discord/settings.json";
"dolphinrc".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/dolphinrc"; "dolphinrc".source = symlink "${configDir}/dolphinrc";
"kdeglobals".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/kdeglobals"; "kdeglobals".source = symlink "${configDir}/kdeglobals";
"kiorc".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/kiorc"; "kiorc".source = symlink "${configDir}/kiorc";
"mimeapps.list".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/mimeapps.list"; "mimeapps.list".source = symlink "${configDir}/mimeapps.list";
"neofetch".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/neofetch"; "neofetch".source = symlink "${configDir}/neofetch";
"swappy".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swappy"; "swappy".source = symlink "${configDir}/swappy";
}; };
programs = { programs = {

View file

@ -1,10 +1,10 @@
{ pkgs, config, hyprland, hyprgrass, ags, ... }: let { pkgs, config, hyprland, hyprgrass, ags, ... }: let
configDir = (import ../vars.nix).configDir; configDir = (import ../vars.nix).configDir;
symlink = config.lib.file.mkOutOfStoreSymlink;
in in
{ {
home.packages = [ home.packages = [
pkgs.sassc pkgs.sassc
pkgs.flat-remix-icon-theme
pkgs.coloryou pkgs.coloryou
]; ];
@ -16,7 +16,7 @@ in
programs.ags = { programs.ags = {
enable = true; enable = true;
package = ags.packages.x86_64-linux.default; package = ags.packages.x86_64-linux.default;
configDir = config.lib.file.mkOutOfStoreSymlink "${configDir}/ags"; configDir = symlink "${configDir}/ags";
}; };
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
@ -40,7 +40,7 @@ in
}; };
xdg.configFile = { xdg.configFile = {
"hypr/main.conf".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/hypr/main.conf"; "hypr/main.conf".source = symlink "${configDir}/hypr/main.conf";
"hypr/hyprpaper.conf".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/hypr/hyprpaper.conf"; "hypr/hyprpaper.conf".source = symlink "${configDir}/hypr/hyprpaper.conf";
}; };
} }

View file

@ -1,5 +1,4 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }: let
let
# installs a vim plugin from git with a given tag / branch # installs a vim plugin from git with a given tag / branch
plugin = owner: repo: rev: hash: pkgs.vimUtils.buildVimPlugin { plugin = owner: repo: rev: hash: pkgs.vimUtils.buildVimPlugin {
pname = "${lib.strings.sanitizeDerivationName repo}"; pname = "${lib.strings.sanitizeDerivationName repo}";
@ -9,12 +8,14 @@ let
}; };
}; };
in in
{ {
xdg.configFile = { xdg.configFile = {
"../.gradle/gradle.properties".source = pkgs.writeText "gradle.properties" '' "../.gradle/gradle.properties".source = pkgs.writeText "gradle.properties" ''
org.gradle.java.home = ${pkgs.temurin-bin-17} org.gradle.java.home = ${pkgs.temurin-bin-17}
''; '';
}; };
programs.neovim = { programs.neovim = {
enable = true; enable = true;
package = pkgs.neovim-nightly; package = pkgs.neovim-nightly;
@ -67,6 +68,7 @@ in
}; };
}; };
}; };
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
vim-which-key vim-which-key