commit 57c94a50759b3b5d69be58f66ab0a07a5694fd6c Author: AnonoyStar-Coder Date: Thu Oct 23 10:35:46 2025 -0700 first commit diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..608c729 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + services.getty.autologinUser = "balraj"; + + networking.hostName = "nixos-btw"; + networking.networkmanager.enable = true; + + time.timeZone = "America/Los_Angeles"; + + programs.hyprland = { + enable = true; + withUWSM = true; + xwayland.enable = true; + }; + + users.users.balraj = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + packages = with pkgs; [ + tree + ]; + }; + + programs.firefox.enable = true; + environment.systemPackages = with pkgs; [ + vim + wget + foot + waybar + kitty + wofi + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + system.stateVersion = "25.05"; + +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4c49f16 --- /dev/null +++ b/flake.lock @@ -0,0 +1,47 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761191301, + "narHash": "sha256-xsRL2Oyb4YRZZ1Tu4WzR2uFg1n931bH+PfLdFcqtLg8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "4958aafe7b237dc1e857fb0c916efff72075048f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1761114652, + "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..71ea2a3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + description = "Hyprland on Nixos"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager, ... }: { + nixosConfigurations.nixos-btw = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.balraj = import ./home.nix; + backupFileExtension = "backup"; + }; + } + ]; + }; + }; +} + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..39453bc --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/97efbcd6-38ad-46b3-99ff-178dc69ae867"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/92F3-6C78"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/6004095d-5a88-490c-934f-6a5496c83bec"; } + ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..a49cf55 --- /dev/null +++ b/home.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: + +{ + home.username = "balraj"; + home.homeDirectory = "/home/balraj"; + home.stateVersion = "25.05"; + programs.git.enable = true; + programs.bash = { + enable = true; + shellAliases = { + btw = "echo i use nixos, btw"; + }; + profileExtra = '' + if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then + exec uwsm start -S hyprland-uwsm.desktop + fi + ''; + }; +}