reconfiguring a lot of the pieces in configuration.nix to modules

This commit is contained in:
Chris Cochrun 2023-01-06 12:42:18 -06:00
parent 1a3bf8d4a6
commit 6f0633de2c
4 changed files with 98 additions and 162 deletions

View file

@ -2,11 +2,15 @@
with lib;
{
nixpkgs.config.allowUnfree = true;
i18n.defaultLocale = "en_US.UTF-8";
time.timeZone = "America/Chicago";
# Set default shell to be dash for speed
# Apparently this is bad because a lot of nix relies on bash
# environment.binsh = "${pkgs.dash}/bin/dash";
environment.homeBinInPath = true;
programs.fish.enable = true;
programs.zsh.enable = true;
}

View file

@ -13,6 +13,14 @@ with lib;
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
boot.supportedFilesystems = [ "ntfs" ];
services.xserver = {
@ -45,6 +53,12 @@ with lib;
# desktopManager.gnome.enable = true;
};
security.pam.services.kwallet = {
name = "kwallet";
enableKwallet = true;
};
security.pam.services.sddm.enableKwallet = true;
services.greetd = {
enable = true;
settings = rec {
@ -97,4 +111,79 @@ with lib;
# Needed for some pipewire progs and other gtk apps
programs.dconf.enable = true;
environment.variables = {
EDITOR = "emacsclient -t -a";
VISUAL = "emacsclient -c -a";
# Fixing Qt apps in other environments
# Thought I needed this but apparently they are working fine without it.
# QT_XCB_GL_INTEGRATION = "xcb_egl";
# QT_QPA_PLATFORM_PLUGIN_PATH = "${pkgs.qt5.qtbase.bin}/lib/qt-${pkgs.qt5.qtbase.qtCompatVersion}/plugins/platforms";
WLR_NO_HARDWARE_CURSORS = "1";
};
programs.partition-manager.enable = true;
programs.kdeconnect.enable = true;
# Turn on flatpak
services.flatpak.enable = true;
# Configure keymap in X11
services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.drivers = [ pkgs.gutenprint pkgs.gutenprintBin pkgs.hplipWithPlugin ];
#######################
# VIRTUALIZATION
#######################
virtualisation.podman.enable = true;
# virtualisation.docker.enable = true;
virtualisation.libvirtd = {
enable = true;
qemu = {
runAsRoot = false;
ovmf = {
enable = true;
packages = [
pkgs.OVMFFull.fd
pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd
];
};
swtpm.enable = true;
};
};
services.samba-wsdd.enable = true;
services.samba = {
enable = true;
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
security = user
#use sendfile = yes
#max protocol = smb2
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.0. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
public = {
path = "/home/chris/Public";
"read only" = false;
browsable = true;
"guest ok" = true;
comment = "Share";
};
};
};
# Android Tools
programs.adb.enable = true;
services.udev.packages = [ pkgs.android-udev-rules ];
}

View file

@ -8,8 +8,11 @@
../../pkgs/desktop-packages.nix
../../modules/emacs.nix
../../modules/desktop.nix
../../modules/base.nix
];
networking.hostName = "kaladin"; # Define your hostname.
# Use the systemd-boot EFI boot loader.
boot = {
kernelPackages = pkgs.linuxPackages_zen;
@ -21,45 +24,9 @@
};
};
nixpkgs.config.allowUnfree = true;
networking.hostName = "kaladin"; # Define your hostname.
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "America/Chicago";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp0s31f6.useDHCP = true;
networking.interfaces.wlp7s0.useDHCP = true;
virtualisation.podman.enable = true;
# virtualisation.docker.enable = true;
virtualisation.libvirtd = {
enable = true;
qemu = {
runAsRoot = false;
ovmf = {
enable = true;
packages = [
pkgs.OVMFFull.fd
pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd
];
};
swtpm.enable = true;
};
};
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Set default shell to be dash for speed
# environment.binsh = "${pkgs.dash}/bin/dash";
# NVIDIA
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
@ -83,59 +50,15 @@
Option "TripleBuffer" "on"
'';
# This adds hyprland cache to cachix
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
# Configure keymap in X11
services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.drivers = [ pkgs.gutenprint pkgs.gutenprintBin pkgs.hplipWithPlugin ];
# Turn on flatpak
services.flatpak.enable = true;
services.usbmuxd.enable = true;
services.fstrim.enable = true;
# Set default shell to be dash for speed
# Apparently this is bad because a lot of nix relies on bash
# environment.binsh = "${pkgs.dash}/bin/dash";
environment.homeBinInPath = true;
programs.fish.enable = true;
programs.zsh.enable = true;
environment.variables = {
EDITOR = "emacsclient -t -a";
VISUAL = "emacsclient -c -a";
# Fixing Qt apps in other environments
# Thought I needed this but apparently they are working fine without it.
# QT_XCB_GL_INTEGRATION = "xcb_egl";
# QT_QPA_PLATFORM_PLUGIN_PATH = "${pkgs.qt5.qtbase.bin}/lib/qt-${pkgs.qt5.qtbase.qtCompatVersion}/plugins/platforms";
WLR_NO_HARDWARE_CURSORS = "1";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.chris = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "input" "no-internet" ]; # Enable sudo for the user.
};
programs.partition-manager.enable = true;
programs.kdeconnect.enable = true;
security.pam.services.kwallet = {
name = "kwallet";
enableKwallet = true;
};
security.pam.services.sddm.enableKwallet = true;
# virtualisation.waydroid.enable = true;
# services.ethminer = {
@ -153,67 +76,6 @@
dedicatedServer.openFirewall = true;
};
# nixpkgs.overlays = [
# (import (builtins.fetchTarball {
# url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
# sha256 = "1v1n30a2ai5mnlkrkwv4mfczd3601sqxxlawadxariblfvg7qz4j";
# }))
# (self: super:
# {
# myAwesome = super.awesome.overrideAttrs (old: rec {
# pname = "myAwesome";
# version = "git-20220614-3a54221";
# src = super.fetchFromGitHub {
# owner = "awesomeWM";
# repo = "awesome";
# rev = "3a542219f3bf129546ae79eb20e384ea28fa9798";
# sha256 = "4z3w6iuv+Gw2xRvhv2AX4suO6dl82woJn0p1nkEx3uM=";
# };
# patches = [];
# });
# }
# )
#
# (self: super:
# {
# qt5ct = super.qt5ct.overrideAttrs (old: rec {
# patches = (old.patches or []) ++ [
# ../../qt5ct.patch
# ];
# });
# }
# )
# ];
services.samba-wsdd.enable = true;
services.samba = {
enable = true;
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
security = user
#use sendfile = yes
#max protocol = smb2
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.0. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
public = {
path = "/home/chris/Public";
"read only" = false;
browsable = true;
"guest ok" = true;
comment = "Share";
};
};
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View file

@ -11,6 +11,7 @@
package = pkgs.nixVersions.unstable;
};
networking.hostName = "syl"; # Define your hostname.
# Use the systemd-boot EFI boot loader.
boot.kernelPackages = pkgs.linuxPackages_zen;
@ -26,17 +27,6 @@
hardware.acpilight.enable = lib.mkDefault true;
networking.hostName = "syl"; # Define your hostname.
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "America/Chicago";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.wlp170s0.useDHCP = true;
virtualisation.podman.enable = true;
@ -56,9 +46,6 @@
};
};
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
hardware.uinput.enable = true;
hardware.bluetooth.enable = true;
@ -78,12 +65,6 @@
services.xserver.videoDrivers = ["intel"];
# This adds hyprland cache to cachix
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
boot.supportedFilesystems = [ "ntfs" ];
services.xserver = {
enable = true;