Cleanup: moved things from configuration.nix and home.nix to new modules

This commit is contained in:
2026-04-23 12:28:35 +02:00
parent f9fe349c49
commit 6e37c90b0d
6 changed files with 59 additions and 97 deletions
+3 -15
View File
@@ -17,18 +17,11 @@
#../../modules/nixos/ly.nix
../../modules/nixos/ly.nix
../../modules/nixos/anki.nix
../../modules/nixos/nixUtils.nix
../../hostsModules/laptop/nixos/udev.nix
../../hostsModules/laptop/nixos/disk.nix
];
# this 4 settings should make nixpkgs-review not crash my laptop
swapDevices = [{
device = "/swapfile";
size = 16384; # 16 GB
}
];
nix.settings.max-jobs = 2;
nix.settings.cores = 2;
boot.kernel.sysctl."vm.swappiness" = 10;
programs.nix-ld.enable = true; #Run unpatched dynamic binaries on NixOS. For example lets run ./a.out from gcc
@@ -160,12 +153,7 @@
#adds nixos experimental features:
nix.settings.experimental-features = ["nix-command" "flakes"];
# Garbage collector of generations
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d"; # every week delete generations older than a month
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true; # Nonfree packages: Obsidian
+1 -82
View File
@@ -12,6 +12,7 @@
../../modules/home-manager/zoxide.nix # better cd
../../modules/home-manager/zsh.nix # better bash
../../hostsModules/laptop/home-manager/zsh.nix # some things are hosts dependant.
../../modules/home-manager/gtk.nix # some config for gtk themed apps
../../modules/home-manager/git.nix
../../modules/home-manager/ssh.nix
../../modules/home-manager/fastfetch.nix
@@ -44,12 +45,6 @@
../../modules/other/desktopEntries.nix # creates .desktop files
];
#programs.nixvim = {
# enable = true;
# imports = [ ../../modules/nixvim/neovim.nix ];
# package = pkgs.neovim;
#};
# Home Manager needs a bit of information about you and the paths it should
# Required for Home Manager
home.username = "tomasr";
@@ -72,29 +67,18 @@
(pkgs.callPackage ../../hostsModules/laptop/scripts/batterynotify.nix {})
(pkgs.callPackage ../../hostsModules/laptop/scripts/batterywarning.nix {})
(pkgs.callPackage ../../modules/scripts/weather.nix {})
(pkgs.callPackage ../../modules/scripts/cowsay.nix {})
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
(pkgs.callPackage ../../modules/scripts/mountkdrive.nix {})
(pkgs.callPackage ../../modules/scripts/weatherwaybar.nix {})
(pkgs.callPackage ../../modules/scripts/colorpicker.nix {})
(pkgs.callPackage ../../modules/scripts/killall.nix {}) # kill all windows except focused window
(pkgs.callPackage ../../modules/scripts/launch.nix {}) # necessary for the apps i launch with hyprland at every start
(pkgs.callPackage ../../modules/scripts/gitnotify.nix {})
(pkgs.callPackage ../../modules/scripts/tomato.nix {})
(pkgs.callPackage ../../modules/scripts/librewolfprofiles.nix {})
(pkgs.callPackage ../../modules/scripts/performance-mode.nix {})
(pkgs.callPackage ../../modules/scripts/btm.nix {})
(pkgs.callPackage ../../modules/scripts/manix.nix {})
(pkgs.callPackage ../../modules/scripts/man.nix {})
(pkgs.callPackage ../../modules/scripts/trimmer.nix {})
(pkgs.callPackage ../../hostsModules/laptop/qt/qtbatticon.nix {})
#(pkgs.callPackage ../../modules/scripts/obsidianbackup.nix {}) # periodically syncs obsidian's note to kdrive
#(pkgs.callPackage ../../modules/scripts/obsidianprofiles.nix {}) # fzf vault selector # obsidian was replaced with a custom solution
# no longer used scripts for quickshell. see caelestia-shell
#(pkgs.callPackage ../../modules/scripts/QSsysinfo.nix {})
#(pkgs.callPackage ../../modules/scripts/QSnotifycache.nix {})
#(pkgs.callPackage ../../modules/scripts/QSnotifyhistory.nix {})
#pkgs
pkgs.gruvbox-gtk-theme
pkgs.biber
@@ -135,74 +119,9 @@
#(setq org-preview-latex-default-process 'dvisvgm)
]
))
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
#maybe migrate both of them in a separate file
# gtk config
gtk.theme = {
enable = true;
Gruvbox-GTK-Theme-BL-MB = {
enable = true;
name = "Gruvbox-GTK-Theme-BL-MB";
package = pkgs.gruvbox-gtk-theme;
};
};
# to resolve this https://wiki.nixos.org/wiki/Home_Manager#I_cannot_set_GNOME_or_Gtk_themes_via_Home_Manager
# ssh config
programs.ssh.enable = true;
services.ssh-agent.enable = true;
home.file.".ssh/config".text = ''
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
'';
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/tomasr/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
EDITOR = "neovim";
# Git update function
+16
View File
@@ -0,0 +1,16 @@
{
config,
pkgs,
pkgs-unstable,
libs,
inputs,
...
}: {
# i found swap necessary when running nixpkgs review
swapDevices = [{
device = "/swapfile";
size = 16384; # 16 GB
}
];
boot.kernel.sysctl."vm.swappiness" = 10;
}
+16
View File
@@ -0,0 +1,16 @@
{
config,
pkgs,
...
}: {
# gtk config
gtk.theme = {
enable = true;
Gruvbox-GTK-Theme-BL-MB = {
enable = true;
name = "Gruvbox-GTK-Theme-BL-MB";
package = pkgs.gruvbox-gtk-theme;
};
};
# to resolve this https://wiki.nixos.org/wiki/Home_Manager#I_cannot_set_GNOME_or_Gtk_themes_via_Home_Manager
}
+5
View File
@@ -20,4 +20,9 @@
};
};
services.ssh-agent.enable = true;
home.file.".ssh/config".text = ''
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
'';
}
+18
View File
@@ -0,0 +1,18 @@
{
config,
pkgs,
pkgs-unstable,
libs,
inputs,
...
}: {
# Garbage collector of generations
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d"; # every week delete generations older than a month
};
# nixpkgs-review crashed my laptop multiple times.
nix.settings.max-jobs = 2;
nix.settings.cores = 2;
}