about summary refs log tree commit diff
path: root/nixos/configurations
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/configurations')
-rw-r--r--nixos/configurations/alpha.nix112
-rw-r--r--nixos/configurations/default.nix5
-rw-r--r--nixos/configurations/hardware/alpha.nix55
3 files changed, 172 insertions, 0 deletions
diff --git a/nixos/configurations/alpha.nix b/nixos/configurations/alpha.nix
new file mode 100644
index 0000000..27e8ceb
--- /dev/null
+++ b/nixos/configurations/alpha.nix
@@ -0,0 +1,112 @@
+{ config, pkgs, lib, ...}:
+
+{
+  imports = [];
+
+  security.chromiumSuidSandbox.enable = true;
+
+  boot.kernelPackages = pkgs.linuxPackages_xanmod;
+  # GRUB bootloader
+  boot.loader.efi.canTouchEfiVariables = true;
+  boot.loader.grub = {
+    enable = true;
+    version = 2;
+
+    efiSupport = true;  
+    configurationLimit = 10;
+    device = "nodev";
+    useOSProber = true;
+   # device = "/dev/disk/by-uuid/7905-2E41";
+    extraEntries = ''
+      menuentry "Reboot" {
+        reboot
+      }
+      menuentry "Shutdown" {
+        halt
+      }
+    '';
+  };
+
+  networking.networkmanager.enable = true;
+  networking.useDHCP = false;
+  networking.firewall.enable = true;
+
+  i18n.defaultLocale = "en_US.UTF-8";
+  i18n.inputMethod.enabled = "kime";
+
+  console.font = "Lat2-Terminus16";
+  console.keyMap = "us";
+
+  time.timeZone = "Asia/Seoul";
+
+  environment.systemPackages = with pkgs; [ ];
+
+  services.openssh.enable = true;
+
+  sound.enable = true;
+  hardware.pulseaudio = {
+    enable = true;
+    package = pkgs.pulseaudioFull;
+  };
+
+  hardware.bluetooth.enable = true;
+
+  services.greetd = {
+    enable = true;
+
+    settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
+  };
+
+  programs = {
+    sway = {
+      enable = true;
+      wrapperFeatures.gtk = true;
+
+      extraPackages = with pkgs; [
+        autotiling
+        alacritty
+        swaylock
+        swayidle
+        swaybg
+        wayland-utils
+        wl-clipboard
+        grim
+        slurp
+        sway-contrib.grimshot
+        waybar
+        bemenu
+        qt5.qtwayland
+        xdg_utils
+      ];
+    };
+
+    zsh.enable = true;
+    zsh.enableCompletion = false;
+  };
+
+  hardware.opengl.enable = true;
+  hardware.opengl.driSupport32Bit = true;
+  hardware.opengl.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ];
+
+  virtualisation.libvirtd.enable = true;
+
+  users.users = {
+    boopy = {
+      isNormalUser = true;
+      shell = pkgs.zsh;
+
+      extraGroups = [
+        "wheel"
+        "audio"
+        "networkmanager"
+        "libvirtd"
+      ];
+    };
+  };
+
+  # This value determines the NixOS release with which your system is to be
+  # compatible, in order to avoid breaking some software such as database
+  # servers. You should change this only after NixOS release notes say you
+  # should.
+  system.stateVersion = "22.05"; # Did you read the comment?
+}
diff --git a/nixos/configurations/default.nix b/nixos/configurations/default.nix
new file mode 100644
index 0000000..8b84279
--- /dev/null
+++ b/nixos/configurations/default.nix
@@ -0,0 +1,5 @@
+{ self, nixpkgs, ... } @ inputs:
+
+{
+  alpha = self.lib.mkSystem "alpha" nixpkgs;
+}
diff --git a/nixos/configurations/hardware/alpha.nix b/nixos/configurations/hardware/alpha.nix
new file mode 100644
index 0000000..e8d3e17
--- /dev/null
+++ b/nixos/configurations/hardware/alpha.nix
@@ -0,0 +1,55 @@
+{ config, lib, pkgs, ... }:
+
+let
+  espDev = "/dev/disk/by-uuid/7905-2E41";
+  btrfsDev = "/dev/disk/by-uuid/dc47a0a6-3c73-45c1-951c-40032e762180";
+  swapDev = "/dev/disk/by-uuid/4a74b247-99e9-42c7-9a86-75aea964bb85";
+  dataDev = "/dev/disk/by-uuid/fe7a00a8-0a3c-48de-9d7a-ed7cf172f501";
+
+  subvolume = name: {
+    device = btrfsDev;
+    fsType = "btrfs";
+    options = [ "subvol=${name}" "compress=zstd" "noatime" ];
+  };
+in
+{  
+  boot.initrd.availableKernelModules = [ "xhci-pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+  hardware.enableRedistributableFirmware = true;
+
+  fileSystems."/" = subvolume "root";
+  fileSystems."/home" = subvolume "home";
+  fileSystems."/nix" = subvolume "nix";
+  fileSystems."/persist" = subvolume "persist";
+  fileSystems."/var/log" = {
+    device = btrfsDev;
+    fsType = "btrfs";
+    options = [ "subvol=log" "compress=zstd" "noatime" ];
+    neededForBoot = true;
+  };
+
+  fileSystems."/boot" = {
+    device = espDev;
+    fsType = "vfat";
+  };
+
+  fileSystems."/data" = {
+    device = dataDev;
+    fsType = "ext4";
+  };
+
+  fileSystems."/tmp" = {
+    fsType = "tmpfs";
+    device = "tmpfs";
+    options = [ "nosuid" "nodev" "relatime" "size=14G" ];
+  };
+
+  swapDevices = [{ device = swapDev; }];
+
+  nix.maxJobs = lib.mkDefault 4;
+  powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil";
+}