summaryrefslogtreecommitdiff
path: root/nixos/configuration
diff options
context:
space:
mode:
authorcoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
committercoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
commit8cbadb61604667b407b53ee1258433994fa4765a (patch)
tree97765fb29418fd6278fcb4cbb9760893afaf7a58 /nixos/configuration
Diffstat (limited to 'nixos/configuration')
-rwxr-xr-xnixos/configuration/configuration.nix132
-rwxr-xr-xnixos/configuration/sys/coreutils-configuration.nix48
-rwxr-xr-xnixos/configuration/sys/swap.nix11
-rwxr-xr-xnixos/configuration/sys/zram.nix10
4 files changed, 201 insertions, 0 deletions
diff --git a/nixos/configuration/configuration.nix b/nixos/configuration/configuration.nix
new file mode 100755
index 0000000..428f073
--- /dev/null
+++ b/nixos/configuration/configuration.nix
@@ -0,0 +1,132 @@
+{
+ pkgs,
+ pkgsUnstable,
+ ...
+}: let
+ unstable = pkgsUnstable;
+in
+{
+ services = {
+ xserver = {
+ enable = true;
+ videoDrivers = ["modesetting" "nvidia"];
+ };
+ displayManager.ly.enable = true;
+ blueman.enable = false;
+ printing.enable = false;
+ pipewire = {
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+ };
+ security.rtkit.enable = true;
+
+ boot = {
+ readOnlyNixStore = true;
+ initrd.compressor = "zstd";
+ loader = {
+ systemd-boot = {
+ enable = true;
+ editor = false;
+ configurationLimit = 25;
+ };
+ efi.canTouchEfiVariables = true;
+ };
+ kernelParams = [
+ "nvidia_drm"
+ "nvidia_modeset"
+ "nvidia_uvm"
+ "nvidia-drm.fbdev=1"
+ "nvidia"
+ ];
+ };
+
+ networking.hostName = "gloria";
+ networking.enableIPv6 = false;
+ networking.networkmanager.enable = true;
+ time.timeZone = "Asia/Tehran";
+
+ hardware = {
+ graphics.enable = true;
+ nvidia = {
+ modesetting.enable = true;
+ powerManagement.enable = true;
+ open = false;
+ nvidiaSettings = true;
+ package = pkgs.linuxPackages.nvidiaPackages.beta;
+ prime.offload = {
+ enable = true;
+ enableOffloadCmd = true;
+ };
+ prime = {
+ intelBusId = "PCI:0:2:0";
+ nvidiaBusId = "PCI:1:0:0";
+ };
+ };
+ bluetooth.enable = true;
+ bluetooth.powerOnBoot = true;
+ };
+
+ security.sudo.enable = false;
+ security.sudo-rs.enable = true;
+
+ virtualisation = {
+ podman.enable = true;
+ };
+
+ environment.systemPackages = with pkgs; [
+ (pkgs.runCommand "vim-wrapper" { } ''
+ mkdir -p $out/bin
+ ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim
+ '')
+ unstable.ungoogled-chromium
+ unstable.git
+ unstable.adwaita-icon-theme
+ unstable.nil
+ jmtpfs
+ android-tools
+ unstable.qbittorrent
+ unstable.zathura
+ unstable.rofi
+ ];
+
+ nixpkgs.config.allowUnfree = true;
+
+ users.users.coast = {
+ isNormalUser = true;
+ extraGroups = [ "wheel" "podman" ];
+ shell = pkgs.nushell;
+ };
+
+ programs = {
+ foot.enable = false;
+ nano.enable = false;
+ nekoray.enable = true;
+ nekoray.tunMode.enable = true;
+ niri.enable = true;
+ };
+
+ fonts.packages = with pkgs; [
+ ubuntu-sans
+ ubuntu_font_family
+ nerd-fonts._0xproto
+ nerd-fonts.droid-sans-mono
+ nerd-fonts.jetbrains-mono
+ nerd-fonts.fira-code
+ vazir-fonts
+ ];
+
+ xdg.portal = {
+ enable = true;
+ xdgOpenUsePortal = true;
+ extraPortals = with pkgs; [
+ xdg-desktop-portal-gtk
+ xdg-desktop-portal-gnome
+ ];
+ };
+
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
+ services.openssh.enable = true;
+ system.stateVersion = "25.05";
+}
diff --git a/nixos/configuration/sys/coreutils-configuration.nix b/nixos/configuration/sys/coreutils-configuration.nix
new file mode 100755
index 0000000..9532a3e
--- /dev/null
+++ b/nixos/configuration/sys/coreutils-configuration.nix
@@ -0,0 +1,48 @@
+{
+ pkgs,
+ ...
+}: let
+ coreutils-full-name = "coreuutils-full" + builtins.concatStringsSep ""
+ (builtins.genList (_: "_") (builtins.stringLength pkgs.coreutils-full.version));
+
+ coreutils-name = "coreuutils" + builtins.concatStringsSep ""
+ (builtins.genList (_: "_") (builtins.stringLength pkgs.coreutils.version));
+
+ findutils-name = "finduutils" + builtins.concatStringsSep ""
+ (builtins.genList (_: "_") (builtins.stringLength pkgs.findutils.version));
+
+ diffutils-name = "diffuutils" + builtins.concatStringsSep ""
+ (builtins.genList (_: "_") (builtins.stringLength pkgs.diffutils.version));
+in
+{
+ system.replaceDependencies.replacements = [
+ {
+ oldDependency = pkgs.coreutils-full;
+ newDependency = pkgs.symlinkJoin {
+ name = coreutils-full-name;
+ paths = [pkgs.uutils-coreutils-noprefix];
+ };
+ }
+ {
+ oldDependency = pkgs.coreutils;
+ newDependency = pkgs.symlinkJoin {
+ name = coreutils-name;
+ paths = [pkgs.uutils-coreutils-noprefix];
+ };
+ }
+ {
+ oldDependency = pkgs.findutils;
+ newDependency = pkgs.symlinkJoin {
+ name = findutils-name;
+ paths = [pkgs.uutils-findutils];
+ };
+ }
+ {
+ oldDependency = pkgs.diffutils;
+ newDependency = pkgs.symlinkJoin {
+ name = diffutils-name;
+ paths = [pkgs.uutils-diffutils];
+ };
+ }
+ ];
+}
diff --git a/nixos/configuration/sys/swap.nix b/nixos/configuration/sys/swap.nix
new file mode 100755
index 0000000..72cba4f
--- /dev/null
+++ b/nixos/configuration/sys/swap.nix
@@ -0,0 +1,11 @@
+{
+ ...
+}:
+{
+ swapDevices = [
+ {
+ device = "/var/lib/swapfile";
+ size = 12*1024;
+ }
+ ];
+}
diff --git a/nixos/configuration/sys/zram.nix b/nixos/configuration/sys/zram.nix
new file mode 100755
index 0000000..8e7037d
--- /dev/null
+++ b/nixos/configuration/sys/zram.nix
@@ -0,0 +1,10 @@
+{
+ config,
+ ...
+}:
+{
+ zramSwap = {
+ enable = true;
+ writebackDevice = "/dev/nvme0n1p3";
+ };
+}