feat(nix): add vars.nix to source global vars in nix config and refactor

This commit is contained in:
matt1432 2023-10-03 09:48:12 -04:00
parent 5db6b40d2e
commit 085088a302
7 changed files with 35 additions and 34 deletions

View file

@ -1,9 +1,6 @@
{ config, pkgs, ... }:
let
configDir = "/home/matt/.nix/config";
{ config, pkgs, ... }: let
configDir = (import ../vars.nix).configDir;
in
{
xdg.configFile = {
"swayosd/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swayosd/style.css";

View file

@ -1,5 +1,5 @@
{ pkgs, config, hyprland, hyprgrass, ags, ... }: let
configDir = "/home/matt/.nix/config";
configDir = (import ../vars.nix).configDir;
in
{
home.packages = [
@ -39,15 +39,7 @@ in
'';
};
# https://www.reddit.com/r/NixOS/comments/vc3srj/comment/iccqxw1/?utm_source=share&utm_medium=web2x&context=3
xdg.configFile = {
"../.themes/Dracula".source = "${pkgs.dracula-theme}/share/themes/Dracula";
"Kvantum/Dracula".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula";
"Kvantum/Dracula-Solid".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-Solid";
"Kvantum/Dracula-purple".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple";
"Kvantum/Dracula-purple-solid".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid";
"hypr/main.conf".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/hypr/main.conf";
"hypr/hyprpaper.conf".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/hypr/hyprpaper.conf";
};

View file

@ -20,11 +20,11 @@
imports = [
./dconf.nix
./theme.nix
./hyprland.nix
./bashdots.nix
./dotfiles.nix
./packages.nix
./misc.nix
./nvim.nix
];

View file

@ -1,19 +0,0 @@
{ ... }:
{
xdg.desktopEntries.gparted = {
name = "GParted";
genericName = "Partition Editor";
comment = "Create, reorganize, and delete partitions";
exec = "Gparted";
icon = "gparted";
terminal = false;
type = "Application";
categories = [ "GNOME" "System" "Filesystem" ];
startupNotify = true;
settings = {
Keywords = "Partition";
X-GNOME-FullName = "GParted Partition Editor";
};
};
}

View file

@ -19,6 +19,22 @@
};
};
xdg.desktopEntries.gparted = {
name = "GParted";
genericName = "Partition Editor";
comment = "Create, reorganize, and delete partitions";
exec = "Gparted";
icon = "gparted";
terminal = false;
type = "Application";
categories = [ "GNOME" "System" "Filesystem" ];
startupNotify = true;
settings = {
Keywords = "Partition";
X-GNOME-FullName = "GParted Partition Editor";
};
};
home.packages = with pkgs;
(with python311Packages; [
python

12
nixos/home/theme.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
xdg.configFile = {
"../.themes/Dracula".source = "${pkgs.dracula-theme}/share/themes/Dracula";
"Kvantum/Dracula".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula";
"Kvantum/Dracula-Solid".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-Solid";
"Kvantum/Dracula-purple".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple";
"Kvantum/Dracula-purple-solid".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid";
};
}

3
nixos/vars.nix Normal file
View file

@ -0,0 +1,3 @@
{
configDir = "/home/matt/.nix/config";
}