First commit
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
moduleName = "hm-default-apps";
|
||||
in
|
||||
{
|
||||
# Ensure update-mime-database is available
|
||||
home.packages = with pkgs; [
|
||||
shared-mime-info
|
||||
];
|
||||
|
||||
# Teach the MIME DB that *.nix files are text/x-nix
|
||||
xdg.dataFile."mime/packages/custom-text-types.xml".text = ''
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
|
||||
<mime-type type="text/x-nix">
|
||||
<comment>Nix expression</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<glob pattern="*.nix"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="text/x-ini">
|
||||
<comment>Configuration file</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<glob pattern="*.conf"/>
|
||||
</mime-type>
|
||||
|
||||
</mime-info>
|
||||
'';
|
||||
|
||||
# Rebuild user MIME database after HM writes xdg.dataFile files
|
||||
home.activation.updateMimeDatabase =
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
${pkgs.shared-mime-info}/bin/update-mime-database ${config.xdg.dataHome}/mime
|
||||
'';
|
||||
|
||||
xdg.mimeApps.enable = true;
|
||||
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
# Nix files
|
||||
"text/x-nix" = [ "org.kde.kate.desktop" ];
|
||||
"text/plain" = [ "org.kde.kate.desktop" ];
|
||||
"text/x-ini" = [ "org.kde.kate.desktop" ];
|
||||
"application/x-desktop" = [ "org.kde.kate.desktop" ];
|
||||
|
||||
# Zen Browser (Flatpak)
|
||||
"x-scheme-handler/http" = [ "app.zen_browser.zen.desktop" ];
|
||||
"x-scheme-handler/https" = [ "app.zen_browser.zen.desktop" ];
|
||||
"text/html" = [ "app.zen_browser.zen.desktop" ];
|
||||
|
||||
# Email
|
||||
"x-scheme-handler/mailto" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
"message/rfc822" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
|
||||
# Calendar (common handlers)
|
||||
"text/calendar" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
"application/ics" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
"application/calendar" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
"x-scheme-handler/webcal" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
"x-scheme-handler/webcals" = [ "eu.betterbird.Betterbird.desktop" ];
|
||||
|
||||
# File manager
|
||||
"inode/directory" = [ "org.kde.dolphin.desktop" ];
|
||||
};
|
||||
home.file.".nixlog/loaded.${moduleName}-module-loaded".text = "loaded\n";
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Shell (deviations)
|
||||
./shell/zsh.nix
|
||||
./shell/starship.nix
|
||||
|
||||
# Dev (deviations)
|
||||
./dev/git.nix
|
||||
./dev/ssh-client.nix
|
||||
./dev/direnv.nix
|
||||
|
||||
# Desktop overrides (deviations)
|
||||
./desktop/hyprland-overrides.nix
|
||||
./desktop/waybar-overrides.nix
|
||||
./desktop/hyprshell.nix
|
||||
|
||||
# apps
|
||||
./apps/default-apps.nix
|
||||
];
|
||||
|
||||
# Home Manager should manage XDG base dirs consistently
|
||||
xdg.enable = true;
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ ... }: { }
|
||||
@@ -0,0 +1,39 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
moduleName = "hm-hyprshell";
|
||||
|
||||
# Absolute path in your home repo (string is fine here, but we must convert properly)
|
||||
repoDir = "${config.home.homeDirectory}/nixos/files/conf/hyprshell";
|
||||
in
|
||||
{
|
||||
xdg.enable = true;
|
||||
|
||||
# Symlink the whole directory into ~/.config/hyprshell
|
||||
xdg.configFile."hyprshell" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink repoDir;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
home.packages = [ pkgs.hyprshell ];
|
||||
|
||||
systemd.user.services.hyprshell = {
|
||||
Unit = {
|
||||
Description = "Hyprshell";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${pkgs.hyprshell}/bin/hyprshell run";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".nixlog/loaded.${moduleName}-module-loaded".text = "loaded\n";
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ ... }: { }
|
||||
@@ -0,0 +1 @@
|
||||
{ ... }: { }
|
||||
@@ -0,0 +1 @@
|
||||
{ ... }: { }
|
||||
@@ -0,0 +1,31 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
confDir = "${config.home.homeDirectory}/nixos/files/conf/ssh";
|
||||
sshClientConf = "${confDir}/ssh-client.conf";
|
||||
in
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
|
||||
matchBlocks."*" = {
|
||||
addKeysToAgent = "yes";
|
||||
serverAliveInterval = 30;
|
||||
serverAliveCountMax = 3;
|
||||
};
|
||||
|
||||
# Load your extra SSH config from a file in ~/nixos/files/conf/ssh/
|
||||
extraConfig = ''
|
||||
Include ${config.home.homeDirectory}/nixos/files/conf/ssh/ssh-client.conf
|
||||
'';
|
||||
};
|
||||
|
||||
# Home Manager's ssh-agent (NOT programs.ssh.startAgent; that's NixOS)
|
||||
services.ssh-agent = {
|
||||
enable = true;
|
||||
|
||||
# Optional: if you use zsh, this helps export SSH_AUTH_SOCK in your shell
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
# /home/henrov/nixos/modules/home-manager/shell/starship.nix
|
||||
#
|
||||
# Home Manager Starship prompt configuration.
|
||||
# Configuration is sourced from: ~/nixos/files/conf/terminal/starship.toml
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
# From: nixos/modules/home-manager/shell -> nixos/files/conf/terminal
|
||||
confDir = ../../../files/conf/terminal;
|
||||
in
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
||||
# Let Starship hook into shells managed by Home Manager.
|
||||
enableZshIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
|
||||
settings = builtins.fromTOML (builtins.readFile (confDir + "/starship.toml"));
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
# /home/henrov/nixos/modules/home-manager/shell/zsh.nix
|
||||
#
|
||||
# Home Manager Zsh + Kitty baseline.
|
||||
# Configuration is sourced from:
|
||||
# ~/nixos/files/conf/terminal/aliases.conf
|
||||
# ~/nixos/files/conf/terminal/zsh.conf
|
||||
# ~/nixos/files/conf/terminal/kitty.conf
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
# From: nixos/modules/home-manager/shell -> nixos/files/conf/terminal
|
||||
confDir = ../../../files/conf/terminal;
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
kitty
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
dotDir = config.home.homeDirectory;
|
||||
|
||||
# Load shared, editable snippets.
|
||||
initContent = ''
|
||||
# Shared aliases
|
||||
if [ -f "${confDir}/aliases.conf" ]; then
|
||||
source "${confDir}/aliases.conf"
|
||||
fi
|
||||
|
||||
# Shared zsh config snippets
|
||||
if [ -f "${confDir}/zsh.conf" ]; then
|
||||
source "${confDir}/zsh.conf"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
programs.kitty.enable = true;
|
||||
xdg.configFile."kitty/kitty.conf".source = confDir + "/kitty.conf";
|
||||
}
|
||||
Reference in New Issue
Block a user