diff --git a/flake.nix b/flake.nix index 5c2294f..324004a 100644 --- a/flake.nix +++ b/flake.nix @@ -59,26 +59,6 @@ in { nixosConfigurations = mkHostConfigs (readHosts "nixos"); - # nixosConfigurations = { - # rihla = nixpkgs.lib.nixosSystem { - # system = "x86_64-linux"; - # modules = [ - # inputs.lanzaboote.nixosModules.lanzaboote - # inputs.disko.nixosModules.disko - # inputs.nixos-hardware.nixosModules.framework-13-7040-amd - # inputs.sops-nix.nixosModules.sops - # inputs.home-manager.nixosModules.home-manager - # ./nixos/configuration.nix - # ./nixos/disko-config.nix - # ./nixos/hardware-configuration.nix - # ]; - # specialArgs = { - # inherit inputs; - # hostName = "rihla"; - # }; - # }; - # }; - devShell.x86_64-linux = let pkgs = nixpkgs.legacyPackages.x86_64-linux; in pkgs.mkShell { diff --git a/home/shahab/rihla.nix b/home/shahab/rihla.nix index a54370b..ce2dae9 100644 --- a/home/shahab/rihla.nix +++ b/home/shahab/rihla.nix @@ -13,15 +13,15 @@ # ========== Host-specific Optional Configs ========== # (map (config: "${builtins.toString ./.}/common/optional/${config}.nix") [ - "hyprland" - "starship" - "ssh" - "zsh" "btop" "firefox" - "nvim" - "tmux" + "hyprland" "misc-packages" + "nvim" + "ssh" + "starship" + "tmux" + "zsh" ]) ]; diff --git a/hosts/nixos/rihla/default.nix b/hosts/nixos/rihla/default.nix index a09e29e..bd45153 100644 --- a/hosts/nixos/rihla/default.nix +++ b/hosts/nixos/rihla/default.nix @@ -1,5 +1,6 @@ { inputs, + pkgs, lib, ... }: @@ -88,5 +89,9 @@ security.rtkit.enable = true; + environment.systemPackages = with pkgs; [ + pciutils + ]; + system.stateVersion = "25.05"; } diff --git a/nixos/configuration.nix b/nixos/configuration.nix deleted file mode 100644 index 879a004..0000000 --- a/nixos/configuration.nix +++ /dev/null @@ -1,52 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{lib, config, pkgs, ...}: { - imports = [ - ./imports/environment.nix - ./imports/hardware.nix - ./imports/i18n.nix - ./imports/networking.nix - ./imports/nix.nix - ./imports/programs.nix - ./imports/security.nix - ./imports/services.nix - ./imports/users.nix - ./imports/virtualisation.nix - ]; - - # Bootloader. - boot = { - loader = { - # Set this to true on first install. This must be false for secure boot. - systemd-boot.enable = lib.mkForce false; - efi.canTouchEfiVariables = true; - }; - - lanzaboote = { - enable = true; - pkiBundle = "/var/lib/sbctl"; - }; - }; - - # Set your time zone. - time.timeZone = "Asia/Karachi"; - - # Allow unfree packages - nixpkgs = { - config = { - pulseaudio = false; - allowUnfree = true; - }; - }; - - home-manager.users.shahab = import ../home-manager/home.nix; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.05"; # Did you read the comment? -} diff --git a/nixos/disko-config.nix b/nixos/disko-config.nix deleted file mode 100644 index 6ac525a..0000000 --- a/nixos/disko-config.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ - disko = { - devices = { - disk = { - main = { - device = "/dev/nvme0n1"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - name = "boot"; - size = "1M"; - type = "EF02"; - }; - esp = { - name = "ESP"; - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - luks = { - size = "100%"; - content = { - name = "crypted"; - type = "luks"; - passwordFile = "/tmp/secret.key"; - settings = { - allowDiscards = true; - crypttabExtraOpts = [ - "fido2-device=auto" - "token-timeout=10" - ]; - }; - content = { - type = "lvm_pv"; - vg = "crypt_vg"; - }; - }; - }; - }; - }; - }; - }; - lvm_vg = { - crypt_vg = { - type = "lvm_vg"; - lvs = { - swap = { - size = "64G"; - content = { - type = "swap"; - resumeDevice = true; - }; - }; - main = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ - "-L" - "nixos" - "-f" - ]; - subvolumes = { - "@root" = { - mountpoint = "/"; - mountOptions = [ - "compress=zstd" - ]; - }; - "@home" = { - mountpoint = "/home"; - mountOptions = [ - "subvol=home" - "compress=zstd" - "noatime" - ]; - }; - "@nix" = { - mountpoint = "/nix"; - mountOptions = [ - "subvol=nix" - "compress=zstd" - "noatime" - ]; - }; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix deleted file mode 100644 index 2478733..0000000 --- a/nixos/hardware-configuration.nix +++ /dev/null @@ -1,40 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - config, - lib, - modulesPath, - ... -}: { - imports = [(modulesPath + "/installer/scan/not-detected.nix")]; - - boot = { - initrd = { - availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usbhid" - "thunderbolt" - "usb_storage" - "sd_mod" - ]; - kernelModules = []; - }; - - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - }; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp193s0f3u2.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/nixos/imports/environment.nix b/nixos/imports/environment.nix deleted file mode 100644 index 47a80ff..0000000 --- a/nixos/imports/environment.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - environment = { - systemPackages = with pkgs; [ - pciutils - virt-manager - virt-viewer - spice - spice-gtk - spice-protocol - win-virtio - win-spice - sops - sbctl # Secure boot - yubikey-manager - - # Gaming stuff - mangohud - protonup-qt - ]; - }; -} diff --git a/nixos/imports/hardware.nix b/nixos/imports/hardware.nix deleted file mode 100644 index 8afad82..0000000 --- a/nixos/imports/hardware.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - hardware = { - # Bluetooth. - bluetooth.enable = true; - bluetooth.powerOnBoot = true; - - graphics = { - enable = true; - extraPackages = with pkgs; [amdvlk]; - }; - }; -} diff --git a/nixos/imports/i18n.nix b/nixos/imports/i18n.nix deleted file mode 100644 index 2031426..0000000 --- a/nixos/imports/i18n.nix +++ /dev/null @@ -1,16 +0,0 @@ -{...}: { - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "ur_PK"; - LC_IDENTIFICATION = "ur_PK"; - LC_MEASUREMENT = "ur_PK"; - LC_MONETARY = "ur_PK"; - LC_NAME = "ur_PK"; - LC_NUMERIC = "ur_PK"; - LC_PAPER = "ur_PK"; - LC_TELEPHONE = "ur_PK"; - LC_TIME = "ur_PK"; - }; - }; -} diff --git a/nixos/imports/networking.nix b/nixos/imports/networking.nix deleted file mode 100644 index 52f9651..0000000 --- a/nixos/imports/networking.nix +++ /dev/null @@ -1,7 +0,0 @@ -{hostName, ...}: { - networking = { - inherit hostName; - networkmanager.enable = true; - firewall.allowedTCPPorts = [22]; - }; -} diff --git a/nixos/imports/nix.nix b/nixos/imports/nix.nix deleted file mode 100644 index ba45ebd..0000000 --- a/nixos/imports/nix.nix +++ /dev/null @@ -1,12 +0,0 @@ -{...}: { - nix = { - settings = { - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - }; -} diff --git a/nixos/imports/programs.nix b/nixos/imports/programs.nix deleted file mode 100644 index 8835567..0000000 --- a/nixos/imports/programs.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - pkgs, - inputs, - ... -}: { - programs = { - nix-ld.enable = true; - dconf.enable = true; - gamemode.enable = true; - - steam = { - enable = true; - gamescopeSession.enable = true; - }; - - _1password.enable = true; - _1password-gui = { - enable = true; - polkitPolicyOwners = ["shahab"]; - }; - - hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = - inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - }; - }; -} diff --git a/nixos/imports/security.nix b/nixos/imports/security.nix deleted file mode 100644 index d78c253..0000000 --- a/nixos/imports/security.nix +++ /dev/null @@ -1,17 +0,0 @@ -{...}: { - security = { - rtkit.enable = true; - pam = { - u2f = { - enable = true; - settings = { - cue = true; - }; - }; - services = { - sudo.u2fAuth = true; - login.u2fAuth = true; - }; - }; - }; -} diff --git a/nixos/imports/services.nix b/nixos/imports/services.nix deleted file mode 100644 index 84c1b6f..0000000 --- a/nixos/imports/services.nix +++ /dev/null @@ -1,39 +0,0 @@ -{pkgs, ...}: { - services = { - greetd = { - enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time --cmd ${pkgs.hyprland}/bin/Hyprland"; - user = "greeter"; - }; - }; - }; - - # OpenSSH - openssh.enable = true; - - # Cups printing service - printing.enable = true; - - # Enable blueman - blueman.enable = true; - - # Enable smart card services - pcscd.enable = true; - - # Framework firmware updating - fwupd.enable = true; - - # Enable sound with pipewire. - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - spice-vdagentd.enable = true; - }; -} diff --git a/nixos/imports/users.nix b/nixos/imports/users.nix deleted file mode 100644 index c549f4a..0000000 --- a/nixos/imports/users.nix +++ /dev/null @@ -1,32 +0,0 @@ -{pkgs, ...}: { - users = { - mutableUsers = false; - users.shahab = { - shell = pkgs.zsh; - - # Only do this if you have already configured zsh in home manager - ignoreShellProgramCheck = true; - - isNormalUser = true; - description = "Shahab Dogar"; - extraGroups = [ - "networkmanager" - "wheel" - "input" - "libvirtd" - ]; - hashedPassword = "$y$j9T$pvjyL7hL5x2VBarGNTnMl1$mLA2UsWTbfp8Hgp/ug5l8224thi..Mo8.p7ME.tDZ.4"; - - openssh.authorizedKeys = { - keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPBijtTtb6UT5gssWolNGX1rcjAKsdtfz25fZMMnzq4v" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGD/V4jLpuk7uAovkbHFr6uulfBKZmsH+BqmXIR2aYD0" - ]; - }; - - packages = with pkgs; [ - libnotify - ]; - }; - }; -} diff --git a/nixos/imports/virtualisation.nix b/nixos/imports/virtualisation.nix deleted file mode 100644 index cb6301f..0000000 --- a/nixos/imports/virtualisation.nix +++ /dev/null @@ -1,34 +0,0 @@ -{pkgs, ...}: { - virtualisation = { - podman = { - enable = true; - dockerSocket.enable = true; - dockerCompat = true; - - autoPrune = { - enable = true; - dates = "weekly"; - }; - }; - - containers = { - registries = { - search = ["docker.io"]; - }; - }; - - libvirtd = { - enable = true; - qemu = { - swtpm.enable = true; - - ovmf = { - enable = true; - packages = with pkgs; [OVMFFull.fd]; - }; - }; - }; - - spiceUSBRedirection.enable = true; - }; -}