nixos/common.nix

78 lines
2.5 KiB
Nix
Raw Normal View History

2025-12-03 09:55:43 +00:00
# Common.nix
2025-12-02 21:44:07 +00:00
{ config, pkgs, lib, ... }:
{
2025-12-25 12:08:14 +00:00
imports = [
./settings/gnome.nix
./settings/locale.nix
./settings/audio.nix
./settings/users.nix
2026-01-11 22:58:37 +00:00
./settings/gdm-monitor.nix
2025-12-25 12:08:14 +00:00
./apps/fastfetch.nix
./apps/flatpaks.nix
2025-12-03 15:48:10 +00:00
];
2026-01-11 10:35:34 +00:00
#############################################################################
2026-01-11 10:26:51 +00:00
# Make boot time quicker
2026-01-11 10:56:14 +00:00
boot.loader.timeout = 0;
2026-01-11 10:26:51 +00:00
systemd.services.NetworkManager-wait-online.enable = false;
systemd.services.systemd-udev-settle.enable = false;
2026-01-11 10:35:34 +00:00
systemd.services.firewall = {
wantedBy = lib.mkForce [ ];
after = [ "multi-user.target" ];
};
systemd.services.home-manager-fred = {
wantedBy = lib.mkForce [ ];
after = [ "multi-user.target" ];
};
2026-01-11 10:40:56 +00:00
boot.initrd.systemd.enable = true;
2026-01-11 10:52:17 +00:00
boot.initrd.verbose = false;
2026-01-11 10:35:34 +00:00
#############################################################################
2026-01-11 10:26:51 +00:00
2025-12-25 12:08:14 +00:00
# Use latest kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Enable network-manager
networking.networkmanager.enable = true;
# Shell aliases
environment.shellAliases = {
update = ''
CHANNEL=$(sudo nix-channel --list | grep "^nixos " | awk '{print $2}')
if [[ "$CHANNEL" != *"nixos-unstable"* ]]; then
echo "Switching to nixos-unstable channel..."
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nix-channel --update
fi
# Add nix-flatpak channel if not present
if ! sudo nix-channel --list | grep -q "nix-flatpak"; then
echo "Adding nix-flatpak channel..."
sudo nix-channel --add https://github.com/gmodena/nix-flatpak/archive/main.tar.gz nix-flatpak
fi
2025-12-04 12:30:15 +00:00
sudo nix-channel --update
2025-12-25 12:08:14 +00:00
echo "Cleaning Flatpak state cache..."
sudo rm -f /nix/var/nix/gcroots/flatpak-state.json
sudo nixos-rebuild switch --upgrade --option tarball-ttl 0
2026-01-11 11:12:38 +00:00
# Manually reapply wallpaper settings
2026-01-11 11:19:15 +00:00
dconf write /org/gnome/desktop/background/picture-uri "'file://''${HOME}/.local/share/backgrounds/wallpaper.png'"
dconf write /org/gnome/desktop/background/picture-uri-dark "'file://''${HOME}/.local/share/backgrounds/wallpaper.png'"
2026-01-11 11:12:38 +00:00
dconf write /org/gnome/desktop/background/picture-options "'zoom'"
2025-12-25 12:08:14 +00:00
'';
clean = "sudo nix-collect-garbage -d";
ll = "ls -alh";
clear = "command clear && fastfetch --config /etc/fastfetch/config.jsonc";
};
# Add packages
environment.systemPackages = with pkgs; [
git
adwaita-icon-theme
2025-12-30 19:40:46 +00:00
mission-center
2025-12-25 12:08:14 +00:00
];
2025-12-02 21:44:07 +00:00
}