Compare commits
14 Commits
2ec9230a0a
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
ff832c6e0a | ||
|
d0e27148c7 | ||
|
902408e764 | ||
|
33a657d209 | ||
|
f2e2471c20 | ||
|
b1c750b960 | ||
|
0adc8dadcd | ||
|
b51a77befa | ||
|
e397b4a2ed | ||
|
aef313b4f1 | ||
|
79ae89cf80 | ||
|
02b601529d | ||
|
b2ecd969fd | ||
|
aa28eb8e3d |
77
disko/luks-btrfs-subvolumes-new.nix
Normal file
77
disko/luks-btrfs-subvolumes-new.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
let
|
||||
installDisk = "sda";
|
||||
bootPartitionSize = "512M";
|
||||
swapfileSize = "10G";
|
||||
swapfileSize = "34G";
|
||||
in {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
@@ -37,34 +37,26 @@ in {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"@root" = {
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
|
||||
};
|
||||
"@home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
|
||||
};
|
||||
"@games" = {
|
||||
mountpoint = "/games";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
"@.snapshots" = {
|
||||
mountpoint = "/.snapshots";
|
||||
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
};
|
||||
"@log" = {
|
||||
mountpoint = "/var/log";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
|
||||
};
|
||||
"@swap" = {
|
||||
mountpoint = "/swap";
|
||||
swap.swapfile.size = swapfileSize;
|
||||
};
|
||||
"@.snapshots" = {
|
||||
mountpoint = "/.snapshots";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
24
flake.lock
generated
24
flake.lock
generated
@@ -7,11 +7,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711588700,
|
||||
"narHash": "sha256-vBB5HoQVnA6c/UrDOhLXKAahEwSRccw2YXYHxD7qoi4=",
|
||||
"lastModified": 1711934712,
|
||||
"narHash": "sha256-sBDe+QmX/QohlnKeSEzrftcXyZL5FY09OMjZ59Rpyy4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "502241afa3de2a24865ddcbe4c122f4546e32092",
|
||||
"rev": "611c9ea53250f7bb22286b3d26872280a0e608f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -224,11 +224,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711625603,
|
||||
"narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=",
|
||||
"lastModified": 1712016346,
|
||||
"narHash": "sha256-O2nO7pD+krq+4HgkLB4VThRtAucIPfXDs/jJqCGlK1w=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2",
|
||||
"rev": "4be0464472675212654dedf3e021bd5f1d58b92f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -313,11 +313,11 @@
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1711460390,
|
||||
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
|
||||
"lastModified": 1711668574,
|
||||
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
|
||||
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -329,11 +329,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1711523803,
|
||||
"narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=",
|
||||
"lastModified": 1711703276,
|
||||
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2726f127c15a4cc9810843b96cad73c7eb39e443",
|
||||
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -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 = "awesome"; # Selected window manager or desktop environment
|
||||
desktop = "dwm"; # Selected window manager or desktop environment
|
||||
desktopType = "x11"; # x11 or wayland
|
||||
};
|
||||
|
||||
|
@@ -56,23 +56,19 @@
|
||||
LC_TIME = systemSettings.locale;
|
||||
};
|
||||
|
||||
users.groups.${userSettings.username} = {
|
||||
name = userSettings.username;
|
||||
gid = 1000;
|
||||
};
|
||||
|
||||
users.users.${userSettings.username} = {
|
||||
isNormalUser = true;
|
||||
description = userSettings.name;
|
||||
extraGroups = [ "networkmanager" "wheel" "input" "dialout" ];
|
||||
extraGroups = [ "${userSettings.username}" "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 = [
|
||||
|
@@ -18,6 +18,7 @@
|
||||
../../user/media/default.nix
|
||||
../../user/productivity/default.nix
|
||||
(../../user/terminal + "/${userSettings.term}.nix")
|
||||
../../user/terminal/prompt.nix
|
||||
../../user/utilities/default.nix
|
||||
];
|
||||
|
||||
|
@@ -17,19 +17,23 @@
|
||||
windowManager.dwm = {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.dwm.overrideAttrs {
|
||||
# Override dwm package with personal dwm-flexipatch config
|
||||
package = (pkgs.dwm.overrideAttrs (finalAttrs: previousAttrs: {
|
||||
pname = previousAttrs.pname + "-flexipatch";
|
||||
version = "6.5";
|
||||
src = (/home + "/${userSettings.username}" + /.config/dwm-flexipatch);
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
xorg.libX11.dev
|
||||
xorg.libXinerama
|
||||
xorg.libXft
|
||||
# Add dependencies for dwmipc / polybar communication patches
|
||||
buildInputs = previousAttrs.buildInputs ++ (with pkgs; [
|
||||
# Dependencies for swallow patch
|
||||
xorg.libxcb
|
||||
xorg.xcbutil
|
||||
|
||||
# Dependencies for dwm-ipc patch
|
||||
yajl
|
||||
jsoncpp
|
||||
];
|
||||
};
|
||||
]);
|
||||
}));
|
||||
};
|
||||
|
||||
displayManager = {
|
||||
@@ -38,11 +42,85 @@
|
||||
};
|
||||
};
|
||||
|
||||
# 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 = [];
|
||||
}))
|
||||
];
|
||||
}
|
||||
|
@@ -1,15 +1,17 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
fonts.fontDir.enable = true;
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
corefonts
|
||||
powerline
|
||||
font-awesome
|
||||
ubuntu_font_family
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
];
|
||||
})
|
||||
font-awesome
|
||||
nerdfonts
|
||||
noto-fonts-color-emoji
|
||||
powerline
|
||||
ipafont
|
||||
baekmuk-ttf
|
||||
nerdfonts
|
||||
];
|
||||
}
|
||||
|
@@ -1,8 +1,20 @@
|
||||
{ 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
|
||||
];
|
||||
}
|
||||
|
7
system/utilities/cloud.nix
Normal file
7
system/utilities/cloud.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ config, lib, pkgs, userSettings, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
rclone
|
||||
];
|
||||
}
|
@@ -7,5 +7,9 @@
|
||||
./miscellaneous.nix
|
||||
./gaming.nix
|
||||
./backups.nix
|
||||
./user-shell.nix
|
||||
./samba.nix
|
||||
./cloud.nix
|
||||
./phone.nix
|
||||
];
|
||||
}
|
||||
|
@@ -12,5 +12,7 @@
|
||||
home-manager
|
||||
tree
|
||||
btop
|
||||
openssh
|
||||
gh
|
||||
];
|
||||
}
|
||||
|
10
system/utilities/phone.nix
Normal file
10
system/utilities/phone.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ config, lib, pkgs, systemSettings, ... }:
|
||||
|
||||
{
|
||||
programs.kdeconnect = {
|
||||
enable = true;
|
||||
package = (if systemSettings.desktop == "gnome"
|
||||
then pkgs.gnomeExtensions.gsconnect
|
||||
else pkgs.libsForQt5.kdeconnect-kde);
|
||||
};
|
||||
}
|
32
system/utilities/samba.nix
Normal file
32
system/utilities/samba.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ 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;
|
||||
}
|
7
system/utilities/user-shell.nix
Normal file
7
system/utilities/user-shell.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.shells = with pkgs; [ zsh ];
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
programs.zsh.enable = true;
|
||||
}
|
@@ -5,5 +5,6 @@
|
||||
blender
|
||||
obs-studio
|
||||
freecad
|
||||
sweethome3d.application
|
||||
]);
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
spotify
|
||||
spicetify-cli
|
||||
ani-cli
|
||||
mangal
|
||||
calibre
|
||||
]);
|
||||
}
|
||||
|
8
user/productivity/math.nix
Normal file
8
user/productivity/math.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
qalculate-gtk
|
||||
octave
|
||||
];
|
||||
}
|
8
user/terminal/prompt.nix
Normal file
8
user/terminal/prompt.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = (with pkgs; [
|
||||
starship
|
||||
krabby
|
||||
]);
|
||||
}
|
@@ -9,5 +9,6 @@
|
||||
./passwords.nix
|
||||
./xdg.nix
|
||||
./screenshot.nix
|
||||
./downloads.nix
|
||||
];
|
||||
}
|
||||
|
7
user/utilities/downloads.nix
Normal file
7
user/utilities/downloads.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = (with pkgs; [
|
||||
qbittorrent-qt5
|
||||
]);
|
||||
}
|
Reference in New Issue
Block a user