Initial Commit:

Moved laptop config into git repo and partmentalised it.
This commit is contained in:
Kurtis Andrews
2024-03-16 14:55:58 +10:00
commit fef9835fb1
6 changed files with 279 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
{ config, pkgs, ... }:
{
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Australia/Brisbane";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_AU.UTF-8";
LC_IDENTIFICATION = "en_AU.UTF-8";
LC_MEASUREMENT = "en_AU.UTF-8";
LC_MONETARY = "en_AU.UTF-8";
LC_NAME = "en_AU.UTF-8";
LC_NUMERIC = "en_AU.UTF-8";
LC_PAPER = "en_AU.UTF-8";
LC_TELEPHONE = "en_AU.UTF-8";
LC_TIME = "en_AU.UTF-8";
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
btop
duf
sshed
nmap
fish
starship
thefuck
git
];
programs.fish.enable = true;
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "au";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Print auto discovery is not working seeing if this fixes it.
# this is what avahi.nssmdns does, but mdns4 (IPv4) instead of mdns (dual-stack)
system.nssModules = pkgs.lib.optional true pkgs.nssmdns;
system.nssDatabases.hosts = pkgs.lib.optionals true (pkgs.lib.mkMerge [
(pkgs.lib.mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
(pkgs.lib.mkAfter [ "mdns4" ]) # after dns
]);
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable Flatpak
services.flatpak.enable = true;
}

145
components/user-kurtisa.nix Normal file
View File

@@ -0,0 +1,145 @@
{ config, pkgs, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in
{
imports =
[
(import "${home-manager}/nixos")
];
# Setup Hypervisor
boot.kernelModules = [ "kvm-intel" "kvm-amd" ];
virtualisation.libvirtd.enable = true;
virtualisation.spiceUSBRedirection.enable = true;
# My user account. Don't forget to set a password with passwd.
users.users.kurtisa = {
isNormalUser = true;
description = "Kurtis Andrews";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
firefox
thunderbird
chromium
gimp
bitwarden
discord
libreoffice
vscode
plexamp
gnome.gnome-boxes
gnomeExtensions.caffeine
gnome.gnome-disk-utility
gnome-extension-manager
];
shell = pkgs.fish;
};
home-manager.users.kurtisa = {pkgs, lib, ...}: let inherit (lib.hm.gvariant) mkTuple mkUint32 mkDouble mkVariant; in {
home.stateVersion = "22.11";
dconf.settings = {
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/shell".enabled-extensions = [
"caffeine@patapon.info"
];
"org/gnome/desktop/interface" = {
clock-format = "12h";
clock-show-weekday = true;
};
"org/gnome/shell/world-clocks".locations = [
(mkVariant (mkTuple [
(mkUint32 2)
(mkVariant (mkTuple [
"New York"
"KNYC"
true
[ (mkTuple [ (mkDouble "0.71180344078725644") (mkDouble "-1.2909618758762367") ]) ]
[ (mkTuple [ (mkDouble "0.71059804659265924") (mkDouble "-1.2916478949920254") ]) ]
]))
]))
];
"org/gnome/shell/weather".locations = [
(mkVariant (mkTuple [
(mkUint32 2)
(mkVariant (mkTuple [
"Rockhampton"
"YBRK"
true
[ (mkTuple [ (mkDouble "-0.40811615094024323") (mkDouble "2.6261387536518987") ]) ]
[ (mkTuple [ (mkDouble "-0.40811615094024323") (mkDouble "2.626720524251466") ]) ]
]))
]))
];
};
programs.fish.enable = true;
programs.starship = {
enable = true;
enableFishIntegration = true;
settings = {
shell = { disabled = false; };
rlang = { detect_files = [ ]; };
python = { disabled = true; };
};
};
};
# Add chrome extensions to chrome
programs.chromium.enable = true;
programs.chromium.extensions = [
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
"nngceckbapebfimnlniiiahkandclblb" # Bitwarden
"bkjdcppkdgccnhjibfhlhmeiafnjfamk" # Rich url
"bfhkfdnddlhfippjbflipboognpdpoeh" # remarkable
"pnidmkljnhbjfffciajlcpeldoljnidn" # linkwarden
];
# Add some web apps into gnome
programs.chromium.extraOpts = {
"WebAppInstallForceList" = [
{
"create_desktop_shortcut" = true;
"default_launch_container" = "window";
"url" = "https://bookmarks.tcmeta.net";
}
{
"create_desktop_shortcut" = true;
"default_launch_container" = "window";
"url" = "https://home.kk.tcmeta.net";
}
{
"create_desktop_shortcut" = true;
"default_launch_container" = "window";
"url" = "https://it-tools.tech/";
}
{
"create_desktop_shortcut" = true;
"default_launch_container" = "window";
"url" = "https://cook.tcmeta.net";
}
];
};
# add my search engine
programs.chromium.defaultSearchProviderEnabled = true;
programs.chromium.defaultSearchProviderSearchURL = "https://search.tcmeta.net/search?q={searchTerms}";
# This is a random wallpaper maker for when you restart your pc.
systemd.user.tmpfiles.rules = [
# Automatically pick a random wallpaper at startup.
"L+ %h/.config/autostart/wallpaper.desktop 0755 - - - ${pkgs.writeText "wallpaper.desktop" ''
[Desktop Entry]
Name=Wallpaper Randomiser
Terminal=false
Exec=${pkgs.writeShellScript "wallpaper.sh" ''
FILE=$(${pkgs.fd}/bin/fd '(.*\.jpeg|.*\.jpg|.*\.png)' $HOME/Pictures/wallpapers | shuf -n 1)
dconf write /org/gnome/desktop/background/picture-uri "'file://$FILE'"
dconf write /org/gnome/desktop/background/picture-uri-dark "'file://$FILE'"
dconf write /org/gnome/desktop/screensaver/picture-uri "'file://$FILE'"
''}
Type=Application
Categories=Utility;
NoDisplay=true
''}"
];
}