summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/bluetooth.nix12
-rw-r--r--modules/environment.nix15
-rw-r--r--modules/hyprland.nix5
-rw-r--r--modules/kde-connect.nix7
-rw-r--r--modules/nix-common.nix24
-rw-r--r--modules/services.nix50
-rw-r--r--modules/sway.nix40
-rw-r--r--modules/user-profiles/defin.nix25
-rw-r--r--modules/user-profiles/root.nix20
9 files changed, 198 insertions, 0 deletions
diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix
new file mode 100644
index 0000000..36e8f8f
--- /dev/null
+++ b/modules/bluetooth.nix
@@ -0,0 +1,12 @@
+{ config, pkgs, lib, ... }: {
+
+ hardware.bluetooth = {
+ enable = true;
+ # config = "
+ # [General]
+ # Enable=Source,Sink,Media,Socket
+ # ";
+ };
+
+ services.blueman.enable = true;
+}
diff --git a/modules/environment.nix b/modules/environment.nix
new file mode 100644
index 0000000..07bef00
--- /dev/null
+++ b/modules/environment.nix
@@ -0,0 +1,15 @@
+{ config, lib, ... }: {
+ environment = {
+ # include user channels in NIX_PATH
+ shellInit = ''export NIXPATH="/nix/var/nix/profiles/per-user/$USER/channels:nixos-config=/etc/nixos/machines/zenbook/configuration.nix"'';
+ # List packages installed in system profile. To search, run:
+ # $ nix search wget
+ variables = {
+ # PATH = "/home/defin/.local/share/gem/ruby/3.0.0/bin:";
+ # PAGER = "sh -c 'col -bx | bat -f'";
+ MANPAGER = "sh -c 'col -bx | bat -l man -p'";
+ EDITOR = "hx";
+ ZEIT_DB = "/home/defin/Documents/zeit";
+ };
+ };
+}
diff --git a/modules/hyprland.nix b/modules/hyprland.nix
new file mode 100644
index 0000000..d91811a
--- /dev/null
+++ b/modules/hyprland.nix
@@ -0,0 +1,5 @@
+{ config, lib, ...}:
+{
+ # Optional, hint electron apps to use wayland:
+ environment.sessionVariables.NIXOS_OZONE_WL = "1";
+} \ No newline at end of file
diff --git a/modules/kde-connect.nix b/modules/kde-connect.nix
new file mode 100644
index 0000000..3705c44
--- /dev/null
+++ b/modules/kde-connect.nix
@@ -0,0 +1,7 @@
+{ config, lib, ... }: {
+ networking.firewall = {
+ allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
+ allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
+ };
+ programs.kdeconnect.enable = true;
+}
diff --git a/modules/nix-common.nix b/modules/nix-common.nix
new file mode 100644
index 0000000..874e2d6
--- /dev/null
+++ b/modules/nix-common.nix
@@ -0,0 +1,24 @@
+{ config, pkgs, ... }: {
+
+ nixpkgs = {
+ # texlive.combined.scheme-medium;
+ config.allowUnfree = true;
+ };
+
+ nix = {
+ settings = {
+ allowed-users = [ "@wheel" "@builders" "@video" ];
+ experimental-features = [ "nix-command" "flakes" ];
+ };
+
+ # Clean up old generations after 30 days
+ gc = {
+ # automatic = true;
+ # dates = "weekly";
+ options = "--delete-older-than 30d";
+ };
+
+ # Users allowed to run nix
+ # allowedUsers = [ "root" ];
+ };
+}
diff --git a/modules/services.nix b/modules/services.nix
new file mode 100644
index 0000000..336d132
--- /dev/null
+++ b/modules/services.nix
@@ -0,0 +1,50 @@
+{ config, pkgs, ... }:
+{
+ services = {
+ pipewire = {
+ enable = true;
+ alsa.enable = true;
+ pulse.enable = true;
+ };
+ spotifyd.enable = true;
+
+ #FOR: sway
+ dbus.enable = true;
+
+ #FROM: configuration.nix
+ # localtimed.enable = true;
+ xserver = {
+ # Enable the X11 windowing system.
+ enable = true;
+
+ # Enable touchpad support (enabled default in most desktopManager).
+ libinput.enable = true;
+
+ # Configure keymap in X11
+ # layout = "us";
+ # xkbOptions = "eurosign:e,caps:escape";
+
+ # Enable the Plasma 5 Desktop Environment.
+ desktopManager.plasma5.enable = true;
+ displayManager = {
+ sddm.enable = true;
+ defaultSession = "plasmawayland";
+ };
+ };
+
+ # Enable CUPS to print documents.
+ printing = {
+ enable = true;
+ drivers = with pkgs; [ epson-escpr gutenprint ];
+ };
+ avahi = {
+ enable = true;
+ nssmdns = true;
+ # for a WiFi printer
+ openFirewall = true;
+ };
+
+ # Enable the OpenSSH daemon.
+ # openssh.enable = true;
+ };
+}
diff --git a/modules/sway.nix b/modules/sway.nix
new file mode 100644
index 0000000..8d4d664
--- /dev/null
+++ b/modules/sway.nix
@@ -0,0 +1,40 @@
+{ config, pkgs, lib, ... }:
+{
+ environment.systemPackages = with pkgs; [
+ ];
+
+ # xdg-desktop-portal works by exposing a series of D-Bus interfaces
+ # known as portals under a well-known name
+ # (org.freedesktop.portal.Desktop) and object path
+ # (/org/freedesktop/portal/desktop).
+ # The portal interfaces include APIs for file access, opening URIs,
+ # printing and others.
+ xdg.portal = {
+ enable = true;
+ wlr.enable = true;
+ # gtk portal needed to make gtk apps happy
+ extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
+ };
+
+ # enable sway window manager
+ programs.sway = {
+ enable = true;
+ wrapperFeatures.gtk = true;
+ };
+
+ # kanshi systemd service
+ systemd.user.services.kanshi = {
+ description = "kanshi daemon";
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file'';
+ };
+ };
+
+ security.pam.services.swaylock.text = ''
+ # PAM configuration file for the swaylock screen locker. By default, it includes
+ # the 'login' configuration file (see /etc/pam.d/login)
+ auth include login
+ '';
+}
+
diff --git a/modules/user-profiles/defin.nix b/modules/user-profiles/defin.nix
new file mode 100644
index 0000000..e3f2a01
--- /dev/null
+++ b/modules/user-profiles/defin.nix
@@ -0,0 +1,25 @@
+{config, pkgs, lib, ... }: {
+
+ # Define a user account. Don't forget to set a password with ‘passwd’.
+ users = {
+
+ mutableUsers = false;
+ users.defin = {
+ isNormalUser = true;
+ description = "Devin Finlinson";
+ extraGroups = [ "wheel" "builders" "video"]; # Enable ‘sudo’ for the user.
+ shell = pkgs.nushell;
+ hashedPassword = "$6$UljPNAdxZ22lP3Bc$8VaEAacZxtXM3Zji2IA7Jf5fXs9pFnAVQff1d8IbfFOKCvjibceyopOAjRXa8lXtpOSJgPW1OO1dzOspqhWnz0";
+
+ oppenssh.authorizedKeys.keyFiles = [
+ (builtins.fetchurl {
+ url = "https://gitlab.com/dFinlinson.keys";
+ sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
+ })
+ ];
+ };
+ };
+
+ # Allow to run nix
+ nix.allowedUsers = [ "defin" ];
+} \ No newline at end of file
diff --git a/modules/user-profiles/root.nix b/modules/user-profiles/root.nix
new file mode 100644
index 0000000..eb95fbd
--- /dev/null
+++ b/modules/user-profiles/root.nix
@@ -0,0 +1,20 @@
+{ config, pkgs, lib, ... }: {
+
+ # Define a user account. Don't forget to set a password with 'passwd'.
+ users = {
+ users.root = {
+ isNormaluser = true;
+ hashedPassword = "$6$UljPNAdxZ22lP3Bc$8VaEAacZxtXM3Zji2IA7Jf5fXs9pFnAVQff1d8IbfFOKCvjibceyopOAjRXa8lXtpOSJgPW1OO1dzOspqhWnz0";
+
+ oppenssh.authorizedKeys.keyFiles = [
+ (builtins.fetchurl {
+ url = "https://gitlab.com/dFinlinson.keys";
+ sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
+ })
+ ];
+ };
+ };
+
+ # Allow to run nix
+ nix.allowedUsers = [ "root" ];
+}