forked from javif89/nix
Finally the start of basic desktop apps on hyprland
This commit is contained in:
parent
458fb492c4
commit
14cd58677a
@ -83,15 +83,13 @@
|
||||
users.users.javi = {
|
||||
isNormalUser = true;
|
||||
description = "javi";
|
||||
shell = pkgs.zsh;
|
||||
useDefaultShell = true;
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
|
||||
# Install firefox.
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
@ -161,6 +159,9 @@
|
||||
polarity = "dark";
|
||||
};
|
||||
|
||||
# Enable zshell
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# Enable home manager
|
||||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
|
40
home.nix
40
home.nix
@ -33,8 +33,6 @@
|
||||
# environment.
|
||||
home.packages = with pkgs; [
|
||||
# Basics
|
||||
starship
|
||||
nautilus
|
||||
quickshell
|
||||
|
||||
# Terminal tools
|
||||
@ -64,9 +62,6 @@
|
||||
go
|
||||
nodejs_22
|
||||
bun
|
||||
|
||||
# Media
|
||||
mpc
|
||||
];
|
||||
|
||||
programs.btop = {
|
||||
@ -112,6 +107,7 @@
|
||||
|
||||
# Configure all the xdg stuff so apps work correctly
|
||||
xdg = {
|
||||
enable = true;
|
||||
# Normal expected directories
|
||||
userDirs = {
|
||||
enable = true;
|
||||
@ -126,23 +122,23 @@
|
||||
videos = "${config.home.homeDirectory}/Videos";
|
||||
};
|
||||
|
||||
# File/app associations
|
||||
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"text/html" = "brave-browser.desktop";
|
||||
"x-scheme-handler/http" = "brave-browser.desktop";
|
||||
"x-scheme-handler/https" = "brave-browser.desktop";
|
||||
"x-scheme-handler/about" = "brave-browser.desktop";
|
||||
"x-scheme-handler/unknown" = "brave-browser.desktop";
|
||||
"application/pdf" = "org.gnome.Evince.desktop";
|
||||
"text/plain" = "code.desktop";
|
||||
"application/json" = "code.desktop";
|
||||
"application/javascript" = "code.desktop";
|
||||
"text/x-php" = "code.desktop";
|
||||
};
|
||||
};
|
||||
# TODO: Move the http handler to a browser.nix
|
||||
# # File/app associations
|
||||
# mimeApps = {
|
||||
# enable = true;
|
||||
# defaultApplications = {
|
||||
# "text/html" = "brave.desktop";
|
||||
# "x-scheme-handler/http" = "brave.desktop";
|
||||
# "x-scheme-handler/https" = "brave.desktop";
|
||||
# "x-scheme-handler/about" = "brave.desktop";
|
||||
# "x-scheme-handler/unknown" = "brave.desktop";
|
||||
# "application/pdf" = "org.gnome.Evince.desktop";
|
||||
# "text/plain" = "code.desktop";
|
||||
# "application/json" = "code.desktop";
|
||||
# "application/javascript" = "code.desktop";
|
||||
# "text/x-php" = "code.desktop";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
|
@ -1,110 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Development-specific configurations and tools
|
||||
|
||||
# Node.js development
|
||||
home.packages = with pkgs; [
|
||||
# Node.js tools (system-wide installation handled in NixOS config)
|
||||
nodePackages.npm
|
||||
nodePackages.bun
|
||||
|
||||
# PHP development tools
|
||||
phpPackages.composer
|
||||
|
||||
# JSON/YAML tools
|
||||
jq
|
||||
yq
|
||||
];
|
||||
|
||||
# Development environment variables
|
||||
home.sessionVariables = {
|
||||
# Node.js
|
||||
NODE_ENV = "development";
|
||||
NPM_CONFIG_PREFIX = "${config.home.homeDirectory}/.npm-global";
|
||||
|
||||
# PHP
|
||||
COMPOSER_HOME = "${config.home.homeDirectory}/.composer";
|
||||
|
||||
# Go
|
||||
GOPATH = "${config.home.homeDirectory}/go";
|
||||
GOBIN = "${config.home.homeDirectory}/go/bin";
|
||||
|
||||
# Laravel Valet (when using it with Nix)
|
||||
PATH = "$PATH:${config.home.homeDirectory}/.composer/vendor/bin";
|
||||
};
|
||||
|
||||
# Create development directories
|
||||
home.file.".keep-dirs" = {
|
||||
text = "";
|
||||
onChange = ''
|
||||
mkdir -p ${config.home.homeDirectory}/projects
|
||||
mkdir -p ${config.home.homeDirectory}/go/{bin,pkg,src}
|
||||
mkdir -p ${config.home.homeDirectory}/.composer
|
||||
mkdir -p ${config.home.homeDirectory}/.npm-global
|
||||
'';
|
||||
};
|
||||
|
||||
# Yazi file manager configuration (replaces your yazi.sh script)
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
|
||||
settings = {
|
||||
manager = {
|
||||
show_hidden = true;
|
||||
sort_by = "modified";
|
||||
sort_reverse = true;
|
||||
linemode = "permissions";
|
||||
};
|
||||
|
||||
preview = {
|
||||
max_width = 600;
|
||||
max_height = 900;
|
||||
};
|
||||
|
||||
opener = {
|
||||
edit = [
|
||||
{
|
||||
run = "code \"$@\"";
|
||||
block = true;
|
||||
}
|
||||
];
|
||||
open = [
|
||||
{
|
||||
run = "xdg-open \"$@\"";
|
||||
desc = "Open";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
keymap = {
|
||||
manager.prepend_keymap = [
|
||||
{
|
||||
on = [ "<Esc>" ];
|
||||
run = "escape";
|
||||
desc = "Exit visual mode, clear selected, or cancel search";
|
||||
}
|
||||
{
|
||||
on = [ "q" ];
|
||||
run = "quit";
|
||||
desc = "Exit the process";
|
||||
}
|
||||
{
|
||||
on = [ "Q" ];
|
||||
run = "quit --no-cwd-file";
|
||||
desc = "Exit the process without writing cwd-file";
|
||||
}
|
||||
{
|
||||
on = [ "<C-q>" ];
|
||||
run = "close";
|
||||
desc = "Close the current tab, or quit if it is last tab";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -14,6 +14,7 @@
|
||||
# Desktop environment
|
||||
./hyprland/hyprpanel.nix
|
||||
./wofi.nix
|
||||
./hyprland/desktop-env.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
|
@ -10,7 +10,7 @@
|
||||
"$mod" = "SUPER";
|
||||
"$browser" = "brave";
|
||||
"$terminal" = "kitty";
|
||||
"$file_browser" = "nautilus";
|
||||
"$file_browser" = "thunar";
|
||||
"$webapp" = "$browser --new-window --app=";
|
||||
|
||||
binds = {
|
||||
|
142
home/hyprland/desktop-env.nix
Normal file
142
home/hyprland/desktop-env.nix
Normal file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
This file is for configuring all the normal things
|
||||
you would need in a desktop environment that
|
||||
hyprland doesn't come with by default
|
||||
such as:
|
||||
- A file manager
|
||||
- An image viewer
|
||||
- Video player
|
||||
*/
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# Complete Desktop Applications Suite for Home Manager
|
||||
{
|
||||
# Media Viewers
|
||||
home.packages = with pkgs; [
|
||||
# *** File Manager ***
|
||||
xfce.thunar
|
||||
xfce.thunar-volman # Removable drive support
|
||||
xfce.thunar-media-tags-plugin
|
||||
# Essential thumbnail generators
|
||||
xfce.tumbler # Thunar's thumbnail service
|
||||
ffmpegthumbnailer # Video thumbnails
|
||||
libgsf # Office document thumbnails
|
||||
poppler # PDF thumbnails
|
||||
# ********************
|
||||
|
||||
# Image Viewers
|
||||
kdePackages.gwenview # KDE image viewer - integrates well with Dolphin
|
||||
# feh # Lightweight alternative
|
||||
|
||||
# Video Players
|
||||
mpv
|
||||
|
||||
# Audio Players
|
||||
kdePackages.elisa # KDE music player
|
||||
|
||||
# Document Viewers
|
||||
kdePackages.okular # KDE PDF/document viewer
|
||||
|
||||
# Archive Managers
|
||||
kdePackages.ark # KDE archive manager
|
||||
|
||||
# Text Editors
|
||||
kdePackages.kate # KDE advanced text editor
|
||||
# kwrite # KDE simple text editor
|
||||
# gedit # GNOME text editor alternative
|
||||
|
||||
# Office & Productivity
|
||||
# libreoffice # Full office suite
|
||||
# onlyoffice-bin # Alternative office suite
|
||||
];
|
||||
|
||||
# XDG MIME associations for seamless integration
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
# Image files
|
||||
"image/jpeg" = "org.kde.gwenview.desktop";
|
||||
"image/png" = "org.kde.gwenview.desktop";
|
||||
"image/gif" = "org.kde.gwenview.desktop";
|
||||
"image/bmp" = "org.kde.gwenview.desktop";
|
||||
"image/tiff" = "org.kde.gwenview.desktop";
|
||||
"image/webp" = "org.kde.gwenview.desktop";
|
||||
"image/svg+xml" = "org.kde.gwenview.desktop";
|
||||
|
||||
# Video files
|
||||
"video/mp4" = "mpv.desktop";
|
||||
"video/mpeg" = "mpv.desktop";
|
||||
"video/quicktime" = "mpv.desktop";
|
||||
"video/x-msvideo" = "mpv.desktop";
|
||||
"video/x-matroska" = "mpv.desktop";
|
||||
"video/webm" = "mpv.desktop";
|
||||
|
||||
# Audio files
|
||||
"audio/mpeg" = "org.kde.elisa.desktop";
|
||||
"audio/flac" = "org.kde.elisa.desktop";
|
||||
"audio/x-wav" = "org.kde.elisa.desktop";
|
||||
"audio/ogg" = "org.kde.elisa.desktop";
|
||||
"audio/mp4" = "org.kde.elisa.desktop";
|
||||
|
||||
# Document files
|
||||
"application/pdf" = "org.kde.okular.desktop";
|
||||
"application/postscript" = "org.kde.okular.desktop";
|
||||
"application/epub+zip" = "org.kde.okular.desktop";
|
||||
|
||||
# Text files
|
||||
"text/plain" = "org.kde.kate.desktop";
|
||||
"text/markdown" = "org.kde.kate.desktop";
|
||||
"application/x-shellscript" = "org.kde.kate.desktop";
|
||||
|
||||
# Archive files
|
||||
"application/zip" = "org.kde.ark.desktop";
|
||||
"application/x-tar" = "org.kde.ark.desktop";
|
||||
"application/x-compressed-tar" = "org.kde.ark.desktop";
|
||||
"application/x-7z-compressed" = "org.kde.ark.desktop";
|
||||
"application/x-rar" = "org.kde.ark.desktop";
|
||||
|
||||
# Directory
|
||||
"inode/directory" = "org.kde.dolphin.desktop";
|
||||
};
|
||||
};
|
||||
|
||||
# Configure specific programs
|
||||
programs = {
|
||||
# Configure mpv for advanced video playback
|
||||
mpv = {
|
||||
enable = true;
|
||||
config = {
|
||||
# Hardware acceleration
|
||||
hwdec = "auto";
|
||||
vo = "gpu";
|
||||
|
||||
# UI improvements
|
||||
osc = true;
|
||||
border = false;
|
||||
|
||||
# Subtitle settings
|
||||
sub-auto = "fuzzy";
|
||||
sub-file-paths = "ass:srt:sub:subs:subtitles";
|
||||
|
||||
# Audio settings
|
||||
volume = 100;
|
||||
volume-max = 200;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Optional: Create custom desktop entries for specific workflows
|
||||
xdg.desktopEntries = {
|
||||
# Open terminal in current directory (for Dolphin integration)
|
||||
"terminal-here" = {
|
||||
name = "Terminal Here";
|
||||
comment = "Open terminal in current location";
|
||||
exec = "kitty --workdir %u";
|
||||
icon = "utilities-terminal";
|
||||
mimeType = [ "inode/directory" ];
|
||||
noDisplay = true;
|
||||
};
|
||||
};
|
||||
}
|
@ -4,10 +4,11 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Bash configuration
|
||||
programs.bash = {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
# Shell aliases (equivalent to your script functions)
|
||||
shellAliases = {
|
||||
@ -62,7 +63,7 @@
|
||||
};
|
||||
|
||||
# Additional bash configuration
|
||||
bashrcExtra = ''
|
||||
initContent = ''
|
||||
function pape() {
|
||||
hyprctl hyprpaper preload $1
|
||||
hyprctl hyprpaper wallpaper ", $1"
|
||||
|
@ -4,10 +4,15 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
starship
|
||||
];
|
||||
|
||||
# Starship prompt configuration (equivalent to your starship-prompt.sh)
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
# settings = {
|
||||
# # Main prompt format
|
||||
|
@ -5,9 +5,8 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.gdm = {
|
||||
services.displayManager = {
|
||||
gdm = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
@ -1,49 +1,39 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
nasIp = "10.89.0.15";
|
||||
baseMnt = "/mnt/main";
|
||||
shares = [
|
||||
"backups"
|
||||
"container-data"
|
||||
"javi"
|
||||
];
|
||||
|
||||
configureShare = share: {
|
||||
name = "/mnt/${share}";
|
||||
value = {
|
||||
device = "${nasIp}:${baseMnt}/${share}";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"rw"
|
||||
"vers=4"
|
||||
|
||||
# make Nautilus/Dolphin/Any File Manager show it with a friendly name/icon
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=NAS — ${share}"
|
||||
"x-gvfs-icon=network-server"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
shareConfig = map configureShare shares;
|
||||
fsConfig = builtins.listToAttrs shareConfig;
|
||||
|
||||
in
|
||||
{
|
||||
services.gvfs.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
fileSystems."/mnt/backups" = {
|
||||
device = "10.89.0.15:/mnt/main/backups";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"rw"
|
||||
"vers=4"
|
||||
|
||||
# make Nautilus show it with a friendly name/icon
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=NAS — backups"
|
||||
"x-gvfs-icon=network-server"
|
||||
];
|
||||
};
|
||||
fileSystems = fsConfig;
|
||||
}
|
||||
# let
|
||||
# nasIp = "10.89.0.15";
|
||||
# baseMnt = "/mnt/main";
|
||||
# shares = [
|
||||
# "backups"
|
||||
# "container-data"
|
||||
# "javi"
|
||||
# ];
|
||||
# nfsOptions = [
|
||||
# "x-systemd.automount"
|
||||
# "noauto"
|
||||
# "rw"
|
||||
# "vers=4"
|
||||
# ];
|
||||
# in
|
||||
# {
|
||||
# fileSystems = lib.genAttrs (map (name: "${baseMnt}/${name}}") shares) (
|
||||
# mountPoint:
|
||||
# let
|
||||
# name = builtins.baseNameOf mountPoint;
|
||||
# in
|
||||
# {
|
||||
# device = "${nasIp}:${baseMnt}/${name}";
|
||||
# fsType = "nfs";
|
||||
# options = nfsOptions;
|
||||
# }
|
||||
# );
|
||||
# }
|
||||
|
Loading…
x
Reference in New Issue
Block a user