Compare commits

..

2 Commits

Author SHA1 Message Date
Sravan Balaji
cb9150aa12 Add AwesomeWM 2024-03-30 08:22:34 -04:00
Sravan Balaji
28e2523bad Modify disko BTRFS Subvolume Layout
- Decrease swapfile size to 10G (don't really need hibernation)
- Remove extra BTRFS mount options like disarcd=async, space_cache=v2,
  and ssd
- Add a games subvolume
- Add a subvolume for /var/log
2024-03-30 08:15:50 -04:00
33 changed files with 85 additions and 373 deletions

View File

@@ -1,77 +0,0 @@
let
installDisk = "sda";
bootPartitionSize = "512M";
swapfileSize = "10G";
in {
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/" + installDisk;
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = bootPartitionSize;
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "cryptroot";
settings.allowDiscards = true;
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"@root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@games" = {
mountpoint = "/games";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@log" = {
mountpoint = "/var/log";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@swap" = {
mountpoint = "/swap";
swap.swapfile.size = swapfileSize;
};
"@.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
};
};
};
};
};
};
};
}

View File

@@ -1,7 +1,7 @@
let
installDisk = "sda";
bootPartitionSize = "512M";
swapfileSize = "34G";
swapfileSize = "10G";
in {
disko.devices = {
disk = {
@@ -37,26 +37,34 @@ in {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"@" = {
"@root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
mountOptions = [ "compress=zstd" "noatime" ];
};
"@home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
mountOptions = [ "compress=zstd" "noatime" ];
};
"@.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
"@games" = {
mountpoint = "/games";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
mountOptions = [ "compress=zstd" "noatime" ];
};
"@log" = {
mountpoint = "/var/log";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@swap" = {
mountpoint = "/swap";
swap.swapfile.size = swapfileSize;
};
"@.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
};

24
flake.lock generated
View File

@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1711934712,
"narHash": "sha256-sBDe+QmX/QohlnKeSEzrftcXyZL5FY09OMjZ59Rpyy4=",
"lastModified": 1711588700,
"narHash": "sha256-vBB5HoQVnA6c/UrDOhLXKAahEwSRccw2YXYHxD7qoi4=",
"owner": "nix-community",
"repo": "disko",
"rev": "611c9ea53250f7bb22286b3d26872280a0e608f9",
"rev": "502241afa3de2a24865ddcbe4c122f4546e32092",
"type": "github"
},
"original": {
@@ -224,11 +224,11 @@
]
},
"locked": {
"lastModified": 1712016346,
"narHash": "sha256-O2nO7pD+krq+4HgkLB4VThRtAucIPfXDs/jJqCGlK1w=",
"lastModified": 1711625603,
"narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4be0464472675212654dedf3e021bd5f1d58b92f",
"rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2",
"type": "github"
},
"original": {
@@ -313,11 +313,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1711668574,
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
"lastModified": 1711460390,
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
"type": "github"
},
"original": {
@@ -329,11 +329,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"lastModified": 1711523803,
"narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"rev": "2726f127c15a4cc9810843b96cad73c7eb39e443",
"type": "github"
},
"original": {

View File

@@ -26,7 +26,7 @@
locale = "en_US.UTF-8"; # Locale
diskoConfig = "luks-btrfs-subvolumes"; # Select the disko config that was used to partition drive
hwConfig = "oryp7"; # Select the hardware config from hardware directory
desktop = "dwm"; # Selected window manager or desktop environment
desktop = "awesome"; # Selected window manager or desktop environment
desktopType = "x11"; # x11 or wayland
};

View File

@@ -56,19 +56,23 @@
LC_TIME = systemSettings.locale;
};
users.groups.${userSettings.username} = {
name = userSettings.username;
gid = 1000;
};
users.users.${userSettings.username} = {
isNormalUser = true;
description = userSettings.name;
extraGroups = [ "${userSettings.username}" "networkmanager" "wheel" "input" "dialout" ];
extraGroups = [ "networkmanager" "wheel" "input" "dialout" ];
packages = [];
uid = 1000;
};
# environment.systemPackages = with pkgs; [
# ];
environment.shells = with pkgs; [ zsh ];
users.defaultUserShell = pkgs.zsh;
programs.zsh.enable = true;
fonts.fontDir.enable = true;
# xdg.portal = {
# enable = true;
# extraPortals = [

View File

@@ -18,7 +18,6 @@
../../user/media/default.nix
../../user/productivity/default.nix
(../../user/terminal + "/${userSettings.term}.nix")
../../user/terminal/prompt.nix
../../user/utilities/default.nix
];

View File

@@ -3,5 +3,6 @@
{
imports = [
./fonts.nix
./utilities.nix
];
}

View File

@@ -3,124 +3,25 @@
{
imports = [
./default.nix
./lightdm.nix
./x11.nix
];
services.xserver = {
services.xserver.windowManager.dwm = {
enable = true;
xkb = {
layout = "us";
variant = "";
options = "";
};
windowManager.dwm = {
enable = true;
# Override dwm package with personal dwm-flexipatch config
package = (pkgs.dwm.overrideAttrs (finalAttrs: previousAttrs: {
pname = previousAttrs.pname + "-flexipatch";
version = "6.5";
package = pkgs.dwm.overrideAttrs {
src = (/home + "/${userSettings.username}" + /.config/dwm-flexipatch);
# Add dependencies for dwmipc / polybar communication patches
buildInputs = previousAttrs.buildInputs ++ (with pkgs; [
# Dependencies for swallow patch
buildInputs = with pkgs; [
xorg.libX11.dev
xorg.libXinerama
xorg.libXft
xorg.libxcb
xorg.xcbutil
# Dependencies for dwm-ipc patch
yajl
jsoncpp
]);
}));
};
displayManager = {
defaultSession = "none+dwm";
lightdm.enable = true;
};
};
# Picom Compositor
services.picom.enable = true;
# Night Light
services.redshift = {
enable = true;
package = pkgs.redshift;
executable = "/bin/redshift-gtk";
};
services.geoclue2 = {
enable = true;
};
location.provider = "geoclue2";
# File Manager
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-volman
thunar-archive-plugin
thunar-media-tags-plugin
];
};
environment.systemPackages = with pkgs; [
# X11 Utilities
arandr
autorandr
unclutter-xfixes
# Wallpaper
nitrogen
# Terminal
kitty
# System Monitor
btop
qdirstat
gnome.gnome-disk-utility
# Media / Volume Controls
playerctl
pavucontrol
# Polybar Media Module Dependency
zscroll
# Notification Daemon
deadd-notification-center
# Automounter
udiskie
# Power Management
xfce.xfce4-power-manager
# Polybar with DWM Module
(polybar.overrideAttrs (finalAttrs: previousAttrs: {
pname = previousAttrs.pname + "-dwm-module";
version = "3.5.2";
src = fetchFromGitHub {
owner = "mihirlad55";
repo = "polybar-dwm-module";
rev = "0c3e139ac54e081c06ef60548927e679d80d4297";
hash = "sha256-ZL7yDGGiZFGgVXZXS+d3xUDhOOd5lp2mo2ipFN92mIY=";
fetchSubmodules = true;
};
# Extra dependencies for dwm module
buildInputs = previousAttrs.buildInputs ++ [
jsoncpp
git
libpulseaudio
];
# Remove patches applied by default polybar package
patches = [];
}))
];
services.xserver.displayManager.defaultSession = "none+dwm";
}

View File

@@ -1,17 +1,10 @@
{ config, lib, pkgs, ... }:
{
fonts.fontDir.enable = true;
fonts.packages = with pkgs; [
corefonts
ubuntu_font_family
font-awesome
nerdfonts
noto-fonts-color-emoji
powerline
ipafont
baekmuk-ttf
nerdfonts
font-awesome
ubuntu_font_family
];
}

View File

@@ -3,14 +3,12 @@
{
imports = [
./default.nix
(if systemSettings.desktopType == "x11" then ./x11.nix else "")
];
services.xserver = {
displayManager.gdm = {
services.xserver.displayManager.gdm = {
enable = true;
wayland = (if systemSettings.desktopType == "x11" then false else true);
};
desktopManager.gnome.enable = true;
};
services.xserver.desktopManager.gnome.enable = true;
}

View File

@@ -3,16 +3,13 @@
{
imports = [
./default.nix
(if systemSettings.desktopType == "x11" then ./x11.nix else "")
];
services.xserver.displayManager = {
sddm = {
enable = true;
wayland.enable = (if systemSettings.desktopType == "x11" then false else true);
};
sddm.enable = true;
sddm.wayland.enable = (if systemSettings.desktopType == "x11" then false else true);
defaultSession = (if systemSettings.desktopType == "x11" then "plasmax11" else "plasma");
};
services.desktopManager.plasma6.enable = true;
}

5
system/gui/lightdm.nix Normal file
View File

@@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
services.xserver.displayManager.lightdm.enable = true;
}

View File

@@ -2,6 +2,7 @@
{
environment.systemPackages = with pkgs; [
btrbk
arandr
autorandr
];
}

12
system/gui/x11.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, lib, pkgs, ... }:
{
services.xserver = {
enable = true;
xkb = {
layout = "us";
variant = "";
options = "";
};
};
}

View File

@@ -11,8 +11,4 @@
pulse.enable = true;
jack.enable = true;
};
environment.systemPackages = with pkgs; [
playerctl
pavucontrol
];
}

View File

@@ -1,10 +1,6 @@
{ config, lib, pkgs, ... }:
{
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
hardware.bluetooth.enable = true;
services.blueman.enable = true;
}

View File

@@ -1,20 +1,8 @@
{ config, lib, pkgs, ... }:
{
# Printing
services.printing.enable = true;
services.avahi.enable = true;
services.avahi.nssmdns4 = true;
services.avahi.openFirewall = true;
# Scanning
services.saned.enable = true;
environment.systemPackages = with pkgs; [
# HP Printer Drivers
hplip
# Scanner Frontend
libsForQt5.skanlite
];
}

View File

@@ -4,6 +4,5 @@
imports = [
./firewall.nix
./gpg.nix
./polkit.nix
];
}

View File

@@ -1,8 +0,0 @@
{ config, lib, pkgs, ... }:
{
security.polkit.enable = true;
environment.systemPackages = with pkgs; [
polkit_gnome
];
}

View File

@@ -1,7 +0,0 @@
{ config, lib, pkgs, userSettings, ... }:
{
environment.systemPackages = with pkgs; [
rclone
];
}

View File

@@ -6,10 +6,5 @@
./gnome-keyring.nix
./miscellaneous.nix
./gaming.nix
./backups.nix
./user-shell.nix
./samba.nix
./cloud.nix
./phone.nix
];
}

View File

@@ -12,7 +12,5 @@
home-manager
tree
btop
openssh
gh
];
}

View File

@@ -1,10 +0,0 @@
{ config, lib, pkgs, systemSettings, ... }:
{
programs.kdeconnect = {
enable = true;
package = (if systemSettings.desktop == "gnome"
then pkgs.gnomeExtensions.gsconnect
else pkgs.libsForQt5.kdeconnect-kde);
};
}

View File

@@ -1,32 +0,0 @@
{ config, lib, pkgs, userSettings, ... }:
{
environment.systemPackages = with pkgs; [
cifs-utils
lxqt.lxqt-policykit # provides a default authentification client for policykit
];
fileSystems."/mnt/fileserver" = {
device = "//192.168.12.5/fileserver";
fsType = "cifs";
options =
let
# this line prevents hanging on network split
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
username = userSettings.username;
uid = config.users.users.${username}.uid;
gid = config.users.groups.${username}.gid;
in [ "${automount_opts},credentials=/etc/nixos/smb-secrets,uid=${toString uid},gid=${toString gid}" ];
# Make sure to create `/etc/nixos/smb-secrets` with following content
# where domain can be optional
# username=<USERNAME>
# domain=<DOMAIN>
# password=<PASSWORD>
};
# Samba discovery of machines and shares
networking.firewall.extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns'';
# GVFS
services.gvfs.enable = true;
}

View File

@@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
environment.shells = with pkgs; [ zsh ];
users.defaultUserShell = pkgs.zsh;
programs.zsh.enable = true;
}

View File

@@ -4,7 +4,5 @@
home.packages = (with pkgs; [
blender
obs-studio
freecad
sweethome3d.application
]);
}

View File

@@ -5,6 +5,5 @@
gimp
libsForQt5.kdenlive
ffmpeg
audacity
]);
}

View File

@@ -8,8 +8,5 @@
pocket-casts
spotify
spicetify-cli
ani-cli
mangal
calibre
]);
}

View File

@@ -1,8 +0,0 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
qalculate-gtk
octave
];
}

View File

@@ -1,8 +0,0 @@
{ config, lib, pkgs, ... }:
{
home.packages = (with pkgs; [
starship
krabby
]);
}

View File

@@ -8,7 +8,5 @@
./keyboard-configuration.nix
./passwords.nix
./xdg.nix
./screenshot.nix
./downloads.nix
];
}

View File

@@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
home.packages = (with pkgs; [
qbittorrent-qt5
]);
}

View File

@@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
home.packages = (with pkgs; [
flameshot
]);
}