diff --git a/profiles/homelab/configuration.nix b/profiles/homelab/configuration.nix new file mode 100644 index 0000000..efe2753 --- /dev/null +++ b/profiles/homelab/configuration.nix @@ -0,0 +1,78 @@ +{ config, lib, pkgs, blocklist-hosts, myName, myHostname, myTimezone, myLocale, myTheme, myBackgroundUrl, myBackgroundSha256, ... }: + +args@{ ... }: + +{ + imports = + [ ../../system/hardware-configuration.nix + ../../system/security/doas.nix + ../../system/security/gpg.nix + ../../system/security/sshd.nix + ( import ../../system/app/docker.nix ( args {storageDriver = "btrfs";} ) ) + ]; + + # Fix nix path + nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" + "nixos-config=$HOME/dotfiles/system/configuration.nix" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + + # Experimental features + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # I'm sorry Stallman-taichou + nixpkgs.config.allowUnfree = true; + + # Kernel modules + boot.kernelModules = [ "i2c-dev" "i2c-piix4" ]; + + # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + # Networking + networking.hostName = myHostname; # Define your hostname. + networking.networkmanager.enable = true; # Use networkmanager + + # Timezone and locale + time.timeZone = myTimezone; # time zone + 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; + }; + + # User account + users.users.${myName} = { + isNormalUser = true; + description = "Emmet"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + uid = 1000; + }; + + # System packages + environment.systemPackages = with pkgs; [ + vim + wget + zsh + git + ]; + + # I use zsh btw + environment.shells = with pkgs; [ zsh ]; + users.defaultUserShell = pkgs.zsh; + programs.zsh.enable = true; + + # It is ok to leave this unchanged for compatibility purposes + system.stateVersion = "22.11"; + +} diff --git a/profiles/homelab/home.nix b/profiles/homelab/home.nix new file mode 100644 index 0000000..f89cbf5 --- /dev/null +++ b/profiles/homelab/home.nix @@ -0,0 +1,104 @@ +{ config, lib, pkgs, python3Packages, nix-doom-emacs, stylix, myName, myEmail, myHomeDir, myDotfilesDir, myTheme, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = myName; + home.homeDirectory = myHomeDir; + + programs.home-manager.enable = true; + + imports = [ + nix-doom-emacs.hmModule + stylix.homeManagerModules.stylix + ../../user/wm/xmonad/xmonad.nix # My xmonad config + ../../user/shell/sh.nix # My zsh and bash config + ../../user/shell/cli-collection.nix # Useful CLI apps + ../../user/bin/phoenix.nix # My nix command wrapper + ../../user/app/doom-emacs/doom.nix # My doom emacs config + ../../user/app/ranger/ranger.nix # My ranger file manager config + ../../user/app/git/git.nix # My git config + ../../user/app/keepass/keepass.nix # My password manager + ../../user/app/browser/librewolf.nix # My default browser + ../../user/app/virtualization/virtualization.nix # Virtual machines + ../../user/app/flatpak/flatpak.nix # Flatpaks + ../../user/style/stylix.nix # Styling and themes for my apps + ../../user/lang/cc/cc.nix # C and C++ tools + ../../user/lang/godot/godot.nix # Game development + ]; + + home.stateVersion = "22.11"; # Please read the comment before changing. + + home.packages = with pkgs; [ + # Core + zsh + alacritty + librewolf + brave + dmenu + rofi + git + syncthing + + # Office + libreoffice-qt + mate.atril + xournalpp + glib + gnome.geary + gnome.gnome-calendar + gnome.seahorse + gnome.gnome-maps + newsflash + openvpn + + # Media + gimp-with-plugins + krita + musikcube + vlc + mpv + yt-dlp + freetube + blender + obs-studio + libsForQt5.kdenlive + movit + mediainfo + libmediainfo + mediainfo-gui + audio-recorder + + # Various dev packages + texinfo + libffi zlib + nodePackages.ungit + ]; + + services.syncthing.enable = true; + + xdg.enable = true; + xdg.userDirs = { + enable = true; + createDirectories = true; + music = "${config.home.homeDirectory}/Media/Music"; + videos = "${config.home.homeDirectory}/Media/Videos"; + pictures = "${config.home.homeDirectory}/Media/Pictures"; + templates = "${config.home.homeDirectory}/Templates"; + download = "${config.home.homeDirectory}/Downloads"; + documents = "${config.home.homeDirectory}/Documents"; + desktop = null; + publicShare = null; + extraConfig = { + XDG_DOTFILES_DIR = "${config.home.homeDirectory}/.dotfiles"; + XDG_ARCHIVE_DIR = "${config.home.homeDirectory}/Archive"; + XDG_VM_DIR = "${config.home.homeDirectory}/Machines"; + XDG_ORG_DIR = "${config.home.homeDirectory}/Org"; + XDG_PODCAST_DIR = "${config.home.homeDirectory}/Media/Podcasts"; + XDG_BOOK_DIR = "${config.home.homeDirectory}/Media/Books"; + }; + }; + xdg.mime.enable = true; + xdg.mimeApps.enable = true; + +} diff --git a/system/app/docker.nix b/system/app/docker.nix new file mode 100644 index 0000000..d6866fc --- /dev/null +++ b/system/app/docker.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, myName, storageDriver ? null, ... }: + +assert lib.asserts.assertOneOf "storageDriver" storageDriver [ + null + "aufs" + "btrfs" + "devicemapper" + "overlay" + "overlay2" + "zfs" +]; + +{ + virtualisation.docker = { + enable = true; + enableOnBoot = true; + storageDriver = storageDriver; + autoPrune.enable = true; + }; + users.users.${myName}.extraGroups = [ "docker" ]; +}