diff --git a/configuration.nix b/configuration.nix index 498e70c..d474d10 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,57 +1,17 @@ -# 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’). - -{ config, pkgs, ...}: +{ pkgs, inputs, ...}: { - imports = - [ - ./hardware-configuration.nix - ./home/manager.nix - ./system - ]; + imports = [ + ./hardware-configuration.nix + ./system + ./home/manager.nix + ./services + ./programs + ./hardware + ]; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "nixos"; - networking.networkmanager.enable = true; - - time.timeZone = "Asia/Kolkata"; - - i18n.defaultLocale = "en_IN"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_IN"; - LC_IDENTIFICATION = "en_IN"; - LC_MEASUREMENT = "en_IN"; - LC_MONETARY = "en_IN"; - LC_NAME = "en_IN"; - LC_NUMERIC = "en_IN"; - LC_PAPER = "en_IN"; - LC_TELEPHONE = "en_IN"; - LC_TIME = "en_IN"; - }; - - services.xserver.enable = true; - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; - - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - services.printing.enable = false; - - services.pulseaudio.enable = false; security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; + security.polkit.enable = true; users.users.aditya = { isNormalUser = true; @@ -62,23 +22,20 @@ ]; }; - programs.firefox.enable = true; - nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ + bemenu telegram-desktop (discord.override { withOpenASAR = true; }) helix + bruno + chromium + kdePackages.kdenlive + antigravity + zed-editor + devenv nixd - nodejs + inputs.pano-scrobbler.packages."x86_64-linux".default ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - system.stateVersion = "25.11"; } diff --git a/flake.lock b/flake.lock index 3453c68..d3c65cc 100644 --- a/flake.lock +++ b/flake.lock @@ -7,43 +7,43 @@ ] }, "locked": { - "lastModified": 1777851538, - "narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=", + "lastModified": 1779726825, + "narHash": "sha256-RUkMrREjKDQrA+dA9+xZviGAxM5W1aVdyOr/bSYpHrE=", "owner": "nix-community", "repo": "home-manager", - "rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5", + "rev": "b179bde238977f7d4454fc770b1a727eaf55111c", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.11", + "ref": "release-26.05", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1778003029, - "narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=", + "lastModified": 1779971959, + "narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5", + "rev": "ec942ba042dad5ef097e2ef3a3effc034241f011", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-25.11", + "ref": "nixos-26.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1777954456, - "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", + "lastModified": 1779560665, + "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", + "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", "type": "github" }, "original": { @@ -53,11 +53,32 @@ "type": "github" } }, + "pano-scrobbler": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1779270916, + "narHash": "sha256-OEVnC5U5zeTcw6Br5YHEfOO+2/4U+dUMVByLF2hFYOU=", + "owner": "kawaiiDango", + "repo": "pano-scrobbler-flake", + "rev": "299c8dcec11254928e7df9dbd92c0888ea7eed47", + "type": "github" + }, + "original": { + "owner": "kawaiiDango", + "repo": "pano-scrobbler-flake", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "pano-scrobbler": "pano-scrobbler", "sops-nix": "sops-nix" } }, diff --git a/flake.nix b/flake.nix index b804113..6c9a0a0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,19 +2,23 @@ description = "aditya's flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-25.11"; + url = "github:nix-community/home-manager/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + pano-scrobbler = { + url = "github:kawaiiDango/pano-scrobbler-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, ... } @ inputs: { + outputs = { nixpkgs, home-manager, ... } @ inputs: { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; diff --git a/hardware/bluetooth.nix b/hardware/bluetooth.nix new file mode 100644 index 0000000..d40c2d0 --- /dev/null +++ b/hardware/bluetooth.nix @@ -0,0 +1,6 @@ +{ + hardware.bluetooth = { + enable = false; + powerOnBoot = false; + }; +} diff --git a/hardware/default.nix b/hardware/default.nix new file mode 100644 index 0000000..4dcd8fa --- /dev/null +++ b/hardware/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./bluetooth.nix + ]; +} diff --git a/home/aditya.nix b/home/aditya.nix index 62d4436..8ed31c5 100644 --- a/home/aditya.nix +++ b/home/aditya.nix @@ -1,14 +1,76 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { home.username = "aditya"; home.homeDirectory = "/home/aditya"; home.stateVersion = "25.11"; - home.packages = with pkgs.unstable; [ - pear-desktop + wayland.windowManager.sway = { + enable = true; + wrapperFeatures.gtk = true; + config = { + modifier = "Mod4"; + input = { + "type:touchpad" = { + tap = "enabled"; + tap_button_map = "lrm"; + natural_scroll = "enabled"; + }; + }; + menu = "${pkgs.bemenu}/bin/bemenu-run"; + keybindings = lib.mkOptionDefault { + "Mod4+d" = "exec ${pkgs.bemenu}/bin/bemenu-run"; + }; + output = { + "*" = { scale = "1.25"; }; + }; + }; + }; + + home.packages = with pkgs; [ + unstable.pear-desktop + unstable.cloudflared ]; + xdg.configFile."pipewire/pipewire.conf.d/99-input-denoising.conf".text = '' + context.modules = [ + { name = libpipewire-module-filter-chain + args = { + node.description = "noise cancelling source" + media.name = "noise cancelling source" + filter.graph = { + nodes = [ + { + type = ladspa + name = rnnoise + plugin = librnnoise_ladspa + label = noise_suppressor_mono + control = { + "VAD Threshold (%)" = 97.0 + "VAD Grace Period (ms)" = 50 + "Retroactive VAD Grace (ms)" = 0 + } + } + ] + } + audio.rate = 48000 + audio.position = ["MONO"] + capture.props = { + node.name = "capture.rnnoise_source" + node.passive = true + audio.rate = 48000 + audio.channels = 1 + } + playback.props = { + node.name = "rnnoise_source" + media.class = Audio/Source + audio.channels = 1 + } + } + } + ] + ''; + imports = [ ./programs ]; diff --git a/home/programs/zed.nix b/home/programs/zed.nix index 55eda00..b5e0530 100644 --- a/home/programs/zed.nix +++ b/home/programs/zed.nix @@ -1,4 +1,4 @@ -{...}: +{ pkgs, lib, ... }: { programs.zed-editor = { @@ -35,6 +35,13 @@ light = "Crimson Light"; dark = "Crimson Dark"; }; + lsp = { + rust-analyzer = { + binary = { + path = lib.getExe pkgs.rust-analyzer; + }; + }; + }; }; }; } diff --git a/programs/common.nix b/programs/common.nix new file mode 100644 index 0000000..573bb29 --- /dev/null +++ b/programs/common.nix @@ -0,0 +1,10 @@ +{ + programs = { + firefox.enable = true; + nix-ld.enable = true; + sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + }; +} diff --git a/programs/default.nix b/programs/default.nix new file mode 100644 index 0000000..cbb932b --- /dev/null +++ b/programs/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./common.nix + ./obs-studio.nix + ]; +} diff --git a/programs/obs-studio.nix b/programs/obs-studio.nix new file mode 100644 index 0000000..ea9bbed --- /dev/null +++ b/programs/obs-studio.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + programs.obs-studio = { + enable = true; + enableVirtualCamera = true; + plugins = with pkgs.obs-studio-plugins; [ + obs-pipewire-audio-capture + obs-vaapi + obs-plugin-countdown + ]; + }; +} diff --git a/services/cloudflared.nix b/services/cloudflared.nix new file mode 100644 index 0000000..925e8c2 --- /dev/null +++ b/services/cloudflared.nix @@ -0,0 +1,16 @@ +{ + services.cloudflared = { + enable = true; + tunnels = { + "thinkpad" = { + credentialsFile = "/home/aditya/.cloudflared/a3a0512b-6c48-44f9-b760-15d6cf7d1232.json"; + default = "http_status:404"; + ingress = { + "thinkpad.aditya.stream" = { + service = "http://localhost:3000"; + }; + }; + }; + }; + }; +} diff --git a/services/cups.nix b/services/cups.nix new file mode 100644 index 0000000..57e943e --- /dev/null +++ b/services/cups.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + services.printing.enable = true; + services.printing.cups-pdf.enable = true; + services.printing.drivers = with pkgs; [ hplip ]; +} diff --git a/services/default.nix b/services/default.nix new file mode 100644 index 0000000..2fea9b3 --- /dev/null +++ b/services/default.nix @@ -0,0 +1,21 @@ +{ + imports = [ + ./cloudflared.nix + ./cups.nix + ./pipewire.nix + ]; + + services.xserver = { + enable = true; + xkb = { + layout = "us"; + variant = ""; + }; + }; + + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + + services.flatpak.enable = true; + services.gnome.gnome-keyring.enable = true; +} diff --git a/services/pipewire.nix b/services/pipewire.nix new file mode 100644 index 0000000..3dc61d4 --- /dev/null +++ b/services/pipewire.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +{ + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + extraLadspaPackages = [ pkgs.rnnoise-plugin.ladspa ]; + }; + services.pulseaudio.enable = false; +} diff --git a/system/bootloader.nix b/system/bootloader.nix new file mode 100644 index 0000000..beba385 --- /dev/null +++ b/system/bootloader.nix @@ -0,0 +1,12 @@ +{ + boot.loader = { + systemd-boot.enable = false; + grub = { + enable = true; + efiSupport = true; + useOSProber = true; + devices = [ "nodev" ]; + }; + efi.canTouchEfiVariables = true; + }; +} diff --git a/system/configuration.nix b/system/configuration.nix new file mode 100644 index 0000000..cd4f295 --- /dev/null +++ b/system/configuration.nix @@ -0,0 +1,25 @@ +{ + time.timeZone = "Asia/Kolkata"; + + i18n.defaultLocale = "en_IN"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_IN"; + LC_IDENTIFICATION = "en_IN"; + LC_MEASUREMENT = "en_IN"; + LC_MONETARY = "en_IN"; + LC_NAME = "en_IN"; + LC_NUMERIC = "en_IN"; + LC_PAPER = "en_IN"; + LC_TELEPHONE = "en_IN"; + LC_TIME = "en_IN"; + }; + + nixpkgs.config.allowUnfree = true; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + system.stateVersion = "25.11"; +} diff --git a/system/default.nix b/system/default.nix index 8c396e7..ddf8112 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,7 +1,8 @@ -{ ... }: - { imports = [ + ./bootloader.nix + ./networking.nix + ./configuration.nix ./overlays.nix ]; } diff --git a/system/networking.nix b/system/networking.nix new file mode 100644 index 0000000..57274da --- /dev/null +++ b/system/networking.nix @@ -0,0 +1,4 @@ +{ + networking.hostName = "nixos"; + networking.networkmanager.enable = true; +}