1

Nixos: Switch to standalone Home-Manager

Not everything is working yet, derivations have to be rewritten
This commit is contained in:
2024-10-11 04:29:03 +02:00
parent f2f6821240
commit aab27a4025
7 changed files with 136 additions and 113 deletions

View File

@ -8,14 +8,12 @@
lib,
mylib,
config,
nixosConfig,
pkgs,
...
}:
# This is a module
# Because no imports/options/config is defined explicitly, everything is treated as config
# { inputs, lib, ... }: { ... } gets turned into { inputs, lib, ... }: { config = { ... }; } implicitly
# TODO: Add nixified.ai module
rec {
# Every module is a nix expression, specifically a function { inputs, lib, ... }: { ... }
# Every module (/function) is called with the same arguments as this module (home.nix)
@ -26,9 +24,6 @@ rec {
./${hostname}
../modules
# inputs.nixvim.homeManagerModules.nixvim
# inputs.hyprland.homeManagerModules.default
];
modules = {
@ -72,21 +67,6 @@ rec {
fish.enable = true;
# flatpak = {
# enable = false;
# autoUpdate = true;
# autoPrune = true;
# fontFix = true; # TODO: This doesn't work reliably...
# iconFix = false;
# flatseal.enable = true;
# discord.enable = true;
# spotify.enable = true;
# bottles.enable = false;
# obsidian.enable = false; # Extremely low graph draw performance?
# jabref.enable = false;
# };
helix.enable = false;
hyprland = {
@ -221,15 +201,16 @@ rec {
# NOTE: I don't think I need this anymore as all fonts are installed through the system config but let's keep this just in case
fonts.fontconfig.enable = true; # Also updates the font-cache
xdg = {
mime.enable = true;
mimeApps = {
enable = true;
associations.added = nixosConfig.xdg.mime.addedAssociations;
associations.removed = nixosConfig.xdg.mime.removedAssociations;
inherit (nixosConfig.xdg.mime) defaultApplications; # Equal to "defaultApplications = nixosConfig.xdg.mime.defaultApplications"
};
};
# TODO: Borked after standalone HM
# xdg = {
# mime.enable = true;
# mimeApps = {
# enable = true;
# associations.added = nixosConfig.xdg.mime.addedAssociations;
# associations.removed = nixosConfig.xdg.mime.removedAssociations;
# inherit (nixosConfig.xdg.mime) defaultApplications; # Equal to "defaultApplications = nixosConfig.xdg.mime.defaultApplications"
# };
# };
home = {
inherit username; # Inherited from flake.nix
@ -338,7 +319,6 @@ rec {
ffmpeg_7-full # I love ffmpeg (including ffplay)
ffmpeg-normalize
imagemagick # Convert image (magic)
# ueberzugpp # Display images in terminal (alacritty) # TODO: Build failure
# Document utils
# TODO: Latex module with individual packages or HomeManager
@ -363,12 +343,10 @@ rec {
rsync # cp on steroids
rclone # Rsync for cloud
httpie # Cool http client
# suricata
cifs-utils # Mount samba shares
nfs-utils
sshfs
protonvpn-cli
# protonvpn-gui # NOTE: Doesn't work
# GUI apps
vlc
@ -377,28 +355,23 @@ rec {
sqlitebrowser # To modify tables
dbeaver-bin # To import/export data + diagrams
hoppscotch # Test APIs
# decker # TODO: Build failure
signal-desktop
filezilla
anki
# octave # GNU matlab basically
font-manager
nextcloud-client
keepassxc
protonmail-bridge
thunderbird # TODO: Email module
# xwaylandvideobridge # NOTE: Doesn't work
AusweisApp2
# decker # TODO: Build failure
# Office
wacomtablet # For xournalpp/krita
xournalpp # Write with a pen, like old people
# libreoffice-qt
hunspell # I cna't type
hunspellDicts.en_US
hunspellDicts.de_DE
# obsidian # knowledge-base # NOTE: Use flatpak
# logseq # knowledge-base
# TODO: Module, I need to add python packages from multiple modules to the same interpreter
python312
@ -589,7 +562,7 @@ rec {
enableFishIntegration = config.modules.fish.enable;
};
gallery-dl.enable = false; # TODO: Alternative to cyberdrop-dl?
gallery-dl.enable = false;
git = {
enable = true;

View File

@ -1,11 +1,10 @@
# TODO: https://github.com/nix-community/home-manager/commit/69d19b9839638fc487b370e0600a03577a559081
{
inputs,
config,
nixosConfig,
lib,
mylib,
pkgs,
hostname,
...
}:
with lib;
@ -24,7 +23,8 @@ in {
# libvdpau
])
(optionals cfg.gnomeTheme [firefox-gnome-theme])
# TODO: Derivation borked on standalone HM
# (optionals cfg.gnomeTheme [firefox-gnome-theme])
];
home.sessionVariables = mkMerge [
@ -99,9 +99,10 @@ in {
id = 0; # 0 is default profile
userChrome = concatStringsSep "\n" [
(optionalString cfg.gnomeTheme ''
@import "${pkgs.firefox-gnome-theme}/share/firefox-gnome-theme/gnome-theme.css";
'')
# TODO: Borked after standalone HM
# (optionalString cfg.gnomeTheme ''
# @import "${pkgs.firefox-gnome-theme}/share/firefox-gnome-theme/gnome-theme.css";
# '')
(optionalString cfg.disableTabBar ''
#TabsToolbar { display: none; }
@ -252,7 +253,8 @@ in {
"geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
"geo.provider.use_gpsd" = false;
"identity.fxaccounts.account.device.name" = nixosConfig.networking.hostName;
"identity.fxaccounts.account.device.name" = hostname;
"media.hardwaremediakeys.enabled" = false; # Do not interfere with spotify
"media.videocontrols.picture-in-picture.video-toggle.enabled" = true;

View File

@ -3,7 +3,6 @@
# TODO: The border color does not fit the current theme
{
config,
nixosConfig,
lib,
mylib,
pkgs,
@ -14,12 +13,13 @@ in {
options.modules.hyprland = import ./options.nix {inherit lib mylib;};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = nixosConfig.programs.hyprland.enable;
message = "Can't enable Hyprland module with Hyprland disabled!";
}
];
# TODO: Can't get the nixosConfig from standalone HM...
# assertions = [
# {
# assertion = (import <nixpkgs/nixos> {}).config.programs.hyprland.enable;
# message = "Can't enable Hyprland module with Hyprland disabled!";
# }
# ];
gtk = {
enable = true;