mirror of https://github.com/Chizi123/Dotfiles.git

ab91eb64b7bef3d1403f5f084cc9d5a614f1c5c7..22bc76a0fc5eda6735fe7711a8afc330fe44e5ca
2 days ago Joel Grunbaum
Add smini nix config with modularised config
22bc76 diff | tree
2 days ago Joel Grunbaum
Update submodules for bash
764bd5 diff | tree
2 days ago Joel Grunbaum
Contain rpi nix config
576884 diff | tree
1 files copied
4 files modified
1 files renamed
8 files added
285 ■■■■ changed files
bash/DICT 1 ●●●● patch | view | raw | blame | history
nixos/DICT 10 ●●●● patch | view | raw | blame | history
nixos/btrfs.nix 10 ●●●●● patch | view | raw | blame | history
nixos/home-assistant.nix 46 ●●●●● patch | view | raw | blame | history
nixos/nginx.nix 19 ●●●●● patch | view | raw | blame | history
nixos/ssh.nix 14 ●●●●● patch | view | raw | blame | history
nixos/user.nix 12 ●●●●● patch | view | raw | blame | history
nixos/zsh.nix 10 ●●●●● patch | view | raw | blame | history
rpi-nixos/DICT 4 ●●●● patch | view | raw | blame | history
rpi-nixos/configuration.nix 24 ●●●● patch | view | raw | blame | history
rpi-nixos/hardware-configuration.nix 16 ●●●●● patch | view | raw | blame | history
smini/DICT 3 ●●●●● patch | view | raw | blame | history
smini/configuration.nix 76 ●●●● patch | view | raw | blame | history
smini/hardware-configuration.nix 40 ●●●●● patch | view | raw | blame | history
bash/DICT
@@ -3,6 +3,7 @@
LOCATIONS="${HOME}/.bashrc ${HOME}/.bash_profile"
custom() {
git submodule update --init
cd ble.sh
make
ln -s "$(pwd)/out/ble.sh" "${HOME}/.ble.sh"
nixos/DICT
@@ -1,2 +1,8 @@
SUDO_FILES="configuration.nix"
SUDO_LOCATIONS="/etc/nixos/configuration.nix"
# Install all local nix files with wildcard
# Enable desired ones in system's configuration.nix
custom () {
    for i in *.nix; do
        install_conflict $i /etc/nixos/$i 1
    done
}
nixos/btrfs.nix
New file
@@ -0,0 +1,10 @@
{ config, libs, pkgs, modulesPath, ... }:
{
  services.btrfs = {
    autoScrub = {
      enable = true;
      interval = "weekly";
    };
  };
}
nixos/home-assistant.nix
New file
@@ -0,0 +1,46 @@
{ config, libs, pkgs, modulesPath, ... }:
{
  services.home-assistant = {
    enable = true;
    extraComponents = [
      # Components required to complete the onboarding
      "analytics"
      "google_translate"
      "met"
      "radio_browser"
      "shopping_list"
      # Recommended for fast zlib compression
      # https://www.home-assistant.io/integrations/isal
      "isal"
      "zha"
      "plex"
      "braviatv"
      "roku"
    ];
    config = {
      # Includes dependencies for a basic setup
      # https://www.home-assistant.io/integrations/default_config/
      default_config = {};
      homeassistant = {
        unit_system = "metric";
      };
      http = {
        server_host = "::1";
        trusted_proxies = [ "::1" ];
        use_x_forwarded_for = true;
      };
    };
  };
  services.nginx.virtualHosts."home.ush.bouncr.xyz" = {
    extraConfig = ''
        proxy_buffering off;
      '';
    enableACME = true;
    forceSSL = true;
    locations."/" = {
      proxyPass = "http://[::1]:8123";
      proxyWebsockets = true;
    };
  };
}
nixos/nginx.nix
New file
@@ -0,0 +1,19 @@
{ config, libs, pkgs, modulesPath, ... }:
{
  services.nginx = {
    enable = true;
    recommendedOptimisation = true;
    recommendedTlsSettings = true;
    recommendedProxySettings = true;
    recommendedBrotliSettings = true;
    recommendedGzipSettings = true;
    recommendedZstdSettings = true;
  };
  security.acme = {
    acceptTerms = true;
    defaults.email = "joelgrun@gmail.com";
    # "*.ush.bouncr.xyz".email = "joelgrun@gmail.com";
  };
}
nixos/ssh.nix
New file
@@ -0,0 +1,14 @@
{ config, libs, pkgs, modulesPath, ... }:
{
  services.openssh = {
    enable = true;
    ports = [ 22 ];
    settings = {
      PasswordAuthentication = false;
      KbdInteractiveAuthentication = false;
      PermitRootLogin = "no";
    };
  };
}
nixos/user.nix
New file
@@ -0,0 +1,12 @@
{ config, libs, pkgs, modulesPath, ... }:
{
    users.users.joel = {
    isNormalUser = true;
    description = "Joel Grunbaum";
    shell = pkgs.zsh;
    extraGroups = [ "networkmanager" "wheel" ];
    openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIATFC5gWcw58fSBHwfn+3FoAnxZfJEJH1bCe5cQof0YN joelgrun@gmail.com" ];
    packages = with pkgs; [];
  };
}
nixos/zsh.nix
New file
@@ -0,0 +1,10 @@
{ config, libs, pkgs, modulesPath, ... }:
{
  programs.zsh = {
    enable = true;
    enableCompletion = true;
    #autosuggestion.enable = true;
    syntaxHighlighting.enable = true;
  };
}
rpi-nixos/DICT
@@ -1,3 +1,3 @@
DEPS="nixos"
SUDO_FILES="hardware-configuration.nix"
SUDO_LOCATIONS="/etc/nixos/hardware-configuration.nix"
SUDO_FILES="configuration.nix hardware-configuration.nix"
SUDO_LOCATIONS="/etc/nixos/configuration.nix /etc/nixos/hardware-configuration.nix"
rpi-nixos/configuration.nix
File was renamed from nixos/configuration.nix
@@ -14,8 +14,7 @@
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.supportedFilesystems = [ "zfs" ];
  boot.zfs.forceImportRoot = false;
  boot.supportedFilesystems = [ "bcachefs" ];
  networking.hostId = "31f59926";
  networking.hostName = "wipi"; # Define your hostname.
@@ -77,7 +76,6 @@
    neofetch
    git
    gnumake
    zfs
    tmux
    htop
  ];
@@ -124,6 +122,26 @@
    syntaxHighlighting.enable = true;
  };
  services.home-assistant = {
     enable = true;
     extraComponents = [
      # Components required to complete the onboarding
      "analytics"
      "google_translate"
      "met"
      "radio_browser"
      "shopping_list"
      # Recommended for fast zlib compression
      # https://www.home-assistant.io/integrations/isal
      "isal"
    ];
    config = {
      # Includes dependencies for a basic setup
      # https://www.home-assistant.io/integrations/default_config/
      default_config = {};
    };
  };
  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
rpi-nixos/hardware-configuration.nix
@@ -25,12 +25,11 @@
      options = [ "fmask=0077" "dmask=0077" ];
    };
  boot.zfs.extraPools = [ "pool" ];
#  fileSystems."/var/lib/docker" =
#    { device = "/pool/docker/var";
#      options = [ "bind" ];
#    };
  fileSystems."/pool" =
     { device = "/dev/disk/by-uuid/8c98df84-c85c-401b-8d44-4cec5a87fd82";
       fsType = "bcachefs";
       options = [ "compression=zstd" ];
     };
  swapDevices = [ ];
@@ -41,11 +40,6 @@
    };
  };
  services.zfs = {
    autoScrub.enable = true;
    trim.enable = true;
  };
  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
smini/DICT
New file
@@ -0,0 +1,3 @@
DEPS="nixos"
SUDO_FILES="configuration.nix hardware-configuration.nix"
SUDO_LOCATIONS="/etc/nixos/configuration.nix /etc/nixos/hardware-configuration.nix"
smini/configuration.nix
copy from nixos/configuration.nix copy to smini/configuration.nix
File was copied from nixos/configuration.nix
@@ -5,20 +5,26 @@
{ config, pkgs, ... }:
{
  # local_configs = ../nixos;
  imports =
    [ # Include the results of the hardware scan.
      /etc/nixos/hardware-configuration.nix
      ./hardware-configuration.nix
      ../nixos/user.nix
      ../nixos/zsh.nix
      ../nixos/ssh.nix
      ../nixos/btrfs.nix
      ../nixos/nginx.nix
      ../nixos/home-assistant.nix
    ];
  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.supportedFilesystems = [ "zfs" ];
  boot.zfs.forceImportRoot = false;
  networking.hostId = "31f59926";
  # Use latest kernel.
  boot.kernelPackages = pkgs.linuxPackages_latest;
  networking.hostName = "wipi"; # Define your hostname.
  networking.hostName = "smini"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
  # Configure network proxy if necessary
@@ -52,36 +58,22 @@
    variant = "";
  };
  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.joel = {
    isNormalUser = true;
    description = "Joel Grunbaum";
    shell = pkgs.zsh;
    extraGroups = [ "networkmanager" "wheel" "docker" ];
    openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIATFC5gWcw58fSBHwfn+3FoAnxZfJEJH1bCe5cQof0YN joelgrun@gmail.com" ];
    packages = with pkgs; [];
  };
  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;
  nix.settings = {
    experimental-features = [ "nix-command" "flakes" ];
  };
  # 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
    neofetch
    git
    gnumake
    zfs
    tmux
    htop
    gnumake
    tmux
  ];
  security.sudo.wheelNeedsPassword = false;
  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
@@ -90,45 +82,13 @@
  #   enableSSHSupport = true;
  # };
  security.sudo.wheelNeedsPassword = false;
  # List services that you want to enable:
  # Enable the OpenSSH daemon.
  services.openssh = {
    enable = true;
    ports = [ 22 ];
    settings = {
      PasswordAuthentication = false;
      KbdInteractiveAuthentication = false;
      PermitRootLogin = "no";
    };
  };
  services.nginx = {
    enable = true;
  };
  virtualisation.docker = {
    enable = true;
    daemon.settings = {
      data-root = "/pool/docker/lib";
      exec-root = "/pool/docker/run";
    };
  };
  programs.zsh = {
    enable = true;
    enableCompletion = true;
    #autosuggestion.enable = true;
    syntaxHighlighting.enable = true;
  };
  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  networking.firewall.allowedTCPPorts = [ 80 443 8123 ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  networking.firewall.enable = false;
  # networking.firewall.enable = false;
  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
@@ -136,6 +96,6 @@
  # 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 = "24.11"; # Did you read the comment?
  system.stateVersion = "25.05"; # Did you read the comment?
}
smini/hardware-configuration.nix
New file
@@ -0,0 +1,40 @@
# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];
  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];
  fileSystems."/" =
    { device = "/dev/disk/by-uuid/c5820e22-2f08-461e-8003-1e99d0e783e9";
      fsType = "btrfs";
      options = [ "subvol=@" "compress=zstd" ];
    };
  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/F559-C127";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };
  swapDevices = [ ];
  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}