{ config, pkgs, ... }:
{
home.username = "microbass";
home.homeDirectory = "/home/microbass";
home.stateVersion = "23.11";
home.packages = with pkgs; [ librewolf bitwarden vscode mullvad-browser zsh ];
programs.home-manager.enable = true;
programs.zsh = {
enable = true;
zplug = {
enable = true;
plugins = [
{ name = "zsh-users/zsh-autosuggestions"; } # Simple plugin installation
{
name = "romkatv/powerlevel10k";
tags = [ "as:theme" "depth:1" ];
} # Installations with additional options. For the list of options, please refer to Zplug README.
];
};
shellAliases = {
ll = "ls -l";
update =
"sudo nixos-rebuild switch -I nixos-config=/home/microbass/src/my-nix-config/configuration.nix --flake ~/src/my-nix-config/.#microbass";
listgens =
"sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
};
history = {
save = 10000000;
size = 10000000;
};
initExtraBeforeCompInit = ''
export SAVEHISTFILE="/home/microbass/.local/share/zsh/history"
'';
};
}
{
description = "Home manager flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = { url = "github:nix-community/NUR"; };
# Applying the configuration happens from the .dotfiles directory so the
# relative path is defined accordingly. This has potential of causing issues.
};
outputs = { self, nixpkgs, home-manager, nixos-hardware, nur }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
lib = nixpkgs.lib;
in {
nixosConfigurations = {
nixpkgs.overlays = [ nur.overlay ];
microbass = lib.nixosSystem {
inherit system;
modules = [
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-gpu-intel
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-ssd
nixos-hardware.nixosModules.common-hidpi
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.microbass = {
imports = [ ./home.nix ./modules/firefox ];
};
}
];
};
homeConfigurations = {
microbass = home-manager.lib.homeManagerConfiguration {
inherit system pkgs;
# username = "microbass";
# homeDirectory = "/home/microbass";
stateVersion = "23.11";
configuration = { imports = [ ./home.nix ./modules/firefox ]; };
};
};
};
};
}
{ config, pkgs, ... }:
let
lock-false = {
Value = false;
Status = "locked";
};
lock-true = {
Value = true;
Status = "locked";
};
in {
programs = {
firefox = {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
DisableTelemetry = true;
# add policies here...
# ---- EXTENSIONS ----
ExtensionSettings = {
/* "*".installation_mode =
"blocked"; # blocks all addons except the ones specified below */
# uBlock Origin:
"uBlock0@raymondhill.net" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
# Search by image
"{2e5ff8c8-32fe-46d0-9fc8-6b8986621f3c}" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/search_by_image/latest.xpi";
installation_mode = "force_installed";
};
};
# ---- PREFERENCES ----
# Set preferences shared by all profiles.
Preferences = {
"browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true;
# add global preferences here...
};
};
};
# ---- PROFILES ----
# Switch profiles via about:profiles page.
# For options that are available in Home-Manager see
# https://nix-community.github.io/home-manager/options.html#opt-programs.firefox.profiles
profiles = {
profile_0 =
{ # choose a profile name; directory is /home/<user>/.mozilla/firefox/profile_0
id = 0; # 0 is the default profile; see also option "isDefault"
name = "profile_0"; # name as listed in about:profiles
isDefault = true; # can be omitted; true if profile ID is 0
settings =
{ # specify profile-specific preferences here; check about:config for options
"browser.newtabpage.activity-stream.feeds.section.highlights" =
false;
"browser.startup.homepage" = "https://nixos.org";
"browser.newtabpage.pinned" = [{
title = "NixOS";
url = "https://nixos.org";
}];
# add preferences for profile_0 here...
};
};
profile_1 = {
id = 1;
name = "profile_1";
isDefault = false;
settings = {
"browser.newtabpage.activity-stream.feeds.section.highlights" =
true;
"browser.startup.homepage" = "https://ecosia.org";
# add preferences for profile_1 here...
};
};
# add profiles here...
};
};
};
}
let
myTimeZone = "Europe/Dublin";
myLocale = "en_IE.UTF-8";
mySubstituters =
[ "https://cache.nixos.org/" "https://nix-community.cachix.org/" ];
myTrustedKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
in { config, pkgs, lib, ... }:
{
imports = [ ./hardware-configuration.nix ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.grub.configurationLimit = 5;
boot.loader.grub.default = 0;
# Setup keyfile
boot.initrd.secrets = { "/crypto_keyfile.bin" = null; };
# Enable swap on luks
boot.initrd.luks.devices."luks-4361bdeb-a8d7-445f-b41c-20314f98d6ea".device =
"/dev/disk/by-uuid/4361bdeb-a8d7-445f-b41c-20314f98d6ea";
boot.initrd.luks.devices."luks-4361bdeb-a8d7-445f-b41c-20314f98d6ea".keyFile =
"/crypto_keyfile.bin";
nix = {
gc = {
automatic = true;
options = "--delete-generations +10";
};
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
settings = {
substituters = mySubstituters;
trusted-public-keys = myTrustedKeys;
};
};
networking.hostName = "nixos";
networking.networkmanager.enable = true;
hardware.keyboard.qmk.enable = true;
time.timeZone = myTimeZone;
i18n.defaultLocale = myLocale;
i18n.extraLocaleSettings = {
LC_ADDRESS = myLocale;
LC_IDENTIFICATION = myLocale;
LC_MEASUREMENT = myLocale;
LC_MONETARY = myLocale;
LC_NAME = myLocale;
LC_NUMERIC = myLocale;
LC_PAPER = myLocale;
LC_TELEPHONE = myLocale;
LC_TIME = myLocale;
};
# X11 Server Configuration
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
services.xserver = {
layout = "ie";
xkbVariant = "";
};
console.keyMap = "ie";
services.printing.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
services.tailscale.enable = true;
services.xserver.videoDrivers = [ "modesetting" ];
programs.zsh.enable = true;
programs.kdeconnect.enable = true;
users.users.microbass = {
isNormalUser = true;
description = "microbass";
extraGroups = [ "networkmanager" "wheel" "docker" ];
shell = pkgs.zsh;
packages = with pkgs; [ kate dolphin-emu home-manager #retroarchFull
#cemu
];
};
fonts.packages = with pkgs;
[ (nerdfonts.override { fonts = [ "SourceCodePro" "DroidSansMono" ]; }) ];
environment.shells = with pkgs; [ zsh ];
/* environment.variables = {
NIX_PATH = "nixpkgs=${nixpkgsPath}";
};
*/
nixpkgs.config.allowUnfree = true;
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime
];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
htop
ansible
ansible-lint
quickemu
obs-studio
gimp
vlc
yt-dlp
git
intel-gpu-tools
mpv
neovim
ncdu
ffmpeg
nmap
obsidian
kitty
tldr
fzf
bitwarden-cli
qmk
rnix-lsp
nixpkgs-fmt
nixfmt
ddccontrol
ddccontrol-db
tailscale
nethogs
jq
usbutils
yuzu
qbittorrent
stacer
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
virtualisation.docker.enable = true;
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
}