4623b60

Branches > main > 4623b60 > files / nvim / pack / plugins / opt

Add Nixos

Grahp, 2026-01-30

Commit: 4623b603c6b8454401e0b2ca2976264e1494c3c6
Parent: 230976c

9 changed files:

.gitignore modified (view file)

@@ -1,2 +1,3 @@ /* !nvim/+!nixos/

nixos/flake.lock added (view file)

@@ -0,0 +1,48 @@+{+  "nodes": {+    "home-manager": {+      "inputs": {+        "nixpkgs": [+          "nixpkgs"+        ]+      },+      "locked": {+        "lastModified": 1761395627,+        "narHash": "sha256-9wQpgBRW2PzYw1wx+MgCt1IbPAYz93csApLMgSZOJCk=",+        "owner": "nix-community",+        "repo": "home-manager",+        "rev": "7296022150cd775917e4c831c393026eae7c2427",+        "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": {+        "owner": "nixos",+        "ref": "nixos-unstable",+        "repo": "nixpkgs",+        "type": "github"+      }+    },+    "root": {+      "inputs": {+        "home-manager": "home-manager",+        "nixpkgs": "nixpkgs"+      }+    }+  },+  "root": "root",+  "version": 7+}

nixos/flake.nix added (view file)

@@ -0,0 +1,26 @@+## What the fuck is flakes this shit makes no sense+{+  description = "Grahp Flake";++  inputs = {+    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";+    home-manager.url = "github:nix-community/home-manager";+    home-manager.inputs.nixpkgs.follows = "nixpkgs";+  };++  outputs = { self, nixpkgs, home-manager, ... }: {+     nixosConfigurations = {+     pc = nixpkgs.lib.nixosSystem {+       modules = [+         ./machines/pc/configuration.nix+         home-manager.nixosModules.home-manager+         {+           home-manager.useGlobalPkgs = true;+           home-manager.useUserPackages = true;+           home-manager.users.grahp = import ./machines/pc/home.nix;+         }+       ];+     };+    };+  };+}

nixos/machines/pc/configuration.nix added (view file)

@@ -0,0 +1,72 @@+{ config, pkgs, callPackage, ... }:++{+  imports = [+    ./hardware-configuration.nix+    (import ../../modules/base.nix {inherit pkgs;})+    (import ../../modules/i3.nix {inherit pkgs;})+    (import ../../modules/bluetooth.nix {inherit pkgs;})+  ];++  ## Should probably be in i3.nix+  services.xserver.enable = true;+  services.displayManager.gdm.enable = false;+  services.xserver.displayManager.lightdm.enable = true;++  #services.xserver.desktopManager.xfce.enable = true;++  boot.loader.systemd-boot.enable = true;+  boot.loader.efi.canTouchEfiVariables = true;++  home-manager.backupFileExtension = "backup-home";++  networking.hostName = "pc";++  hardware.nvidia = {+    modesetting.enable = true;+    open = true;+    nvidiaSettings = true;+    package = config.boot.kernelPackages.nvidiaPackages.stable;+  };++  hardware.graphics.enable = true;++  ## Disable SSH gui popup thing?+  programs.ssh.askPassword = "";+  programs.ssh.startAgent = true;++  services.udev.extraRules = ''+    SUBSYSTEM=="hidraw", ATTRS{idVendor}=="feed", ATTRS{idProduct}=="400d", MODE="0666"+  '';++  programs.nix-ld.enable = true;+  services.usbmuxd.enable = true;+  services.printing.enable = true;+  services.blueman.enable = true;++  users.users.grahp = {+    isNormalUser = true;+    description = "Grahp";+    extraGroups = ["networkmanager" "wheel" "dialout"];+    shell = pkgs.fish;+  };++  services.openssh = {+    enable = true;+  };++  programs.fish.enable = true;+  programs.firefox.enable = true;++  programs.steam = {+    enable = true;+    remotePlay.openFirewall = true;+    dedicatedServer.openFirewall = true;+    localNetworkGameTransfers.openFirewall = true;+  };++  hardware.steam-hardware.enable = true;++  ## No touchy says the comment!+  system.stateVersion = "24.11";+}

nixos/machines/pc/hardware-configuration.nix added (view file)

@@ -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" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ];+  boot.initrd.kernelModules = [ ];+  boot.kernelModules = [ "kvm-intel" ];+  boot.extraModulePackages = [ ];++  fileSystems."/" =+    { device = "/dev/disk/by-uuid/43f5a2b8-29b2-456d-bf49-7f7aa9b16e1e";+      fsType = "ext4";+    };++  fileSystems."/boot" =+    { device = "/dev/disk/by-uuid/92C2-9D71";+      fsType = "vfat";+      options = [ "fmask=0077" "dmask=0077" ];+    };++  swapDevices =+    [ { device = "/dev/disk/by-uuid/447bb849-5782-4457-866a-418007f33dbb"; }+    ];++  # 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.<interface>.useDHCP`.+  networking.useDHCP = lib.mkDefault true;+  # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;+  # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;++  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;+}

nixos/machines/pc/home.nix added (view file)

@@ -0,0 +1,120 @@+{ config, pkgs, ... }:++{+  ## TODO default branch main?+  programs.git = {+    enable = true;+    settings = {+      user.name  = "Grahp";+      user.email = "git@grahp.dev";+    };+  };+  programs.fish = {+    enable = true;+    shellAliases = {+      rb = "sudo nixos-rebuild switch --flake ~/.config/nixos#pc";+      ed = "rlwrap ed -vEp:";+      ll = "lsd -1ANF --group-directories-first --blocks=name,date,size --date=relative";+      l  = "lsd -lANF --group-directories-first --date=relative";+      ls = "lsd -ANF --group-directories-first";+    };+    interactiveShellInit = ''+      set -g fish_greeting++      fish_vi_key_bindings+      function fish_prompt+        string join "" -- (set_color blue) (prompt_pwd --full-length-dirs 5) (set_color normal) " > "+      end+      function fish_mode_prompt+      end+    '';+  };+  ## Any kind of config lol?+  programs.firefox.enable = true;++  home.stateVersion = "23.11";+  home.packages = with pkgs; [+    nerd-fonts.jetbrains-mono+    steam+    ghostty++    vesktop+    slack++    neovim+    tree-sitter+    fennel-ls+    fnlfmt+    clj-kondo+    clojure-lsp+    cljfmt++    librewolf ## TODO config!+    tor-browser+    ungoogled-chromium++    obsidian+    gimp+    i3+    nautilus+    pavucontrol++    prismlauncher++    libreoffice+    maim+    xclip++    usbutils+    inotify-tools++    unzip+    git+    lazygit+    rlwrap+    ed # It's the standard editor, you know?+    fish+    lsd+    zellij ## TODO config+    dig+    ripgrep++    bluez++    flatpak++    jdk25++    clojure+    babashka++    lua54Packages.fennel++    luajit++    nodejs+    bun++    cloc+    mpv+    loupe+    vlc+    ffmpeg++    obs-studio+    audacity++    # Maybe should be in ./build shell.nix?+    bundler+    jekyll++    shotcut++    amberol++    # For apps that don't respect the fucking CLOSE button+    killall++    filezilla+  ];+}

nixos/modules/base.nix added (view file)

@@ -0,0 +1,24 @@+## Common Configuration+{pkgs}: {+  nixpkgs.config.allowUnfree = true;++  nix.settings.experimental-features = ["nix-command" "flakes"];++  networking.networkmanager.enable = true;++  time.timeZone = "America/New_York";++  i18n.defaultLocale = "en_US.UTF-8";++  i18n.extraLocaleSettings = {+    LC_ADDRESS = "en_US.UTF-8";+    LC_IDENTIFICATION = "en_US.UTF-8";+    LC_MEASUREMENT = "en_US.UTF-8";+    LC_MONETARY = "en_US.UTF-8";+    LC_NAME = "en_US.UTF-8";+    LC_NUMERIC = "en_US.UTF-8";+    LC_PAPER = "en_US.UTF-8";+    LC_TELEPHONE = "en_US.UTF-8";+    LC_TIME = "en_US.UTF-8";+  };+}

nixos/modules/bluetooth.nix added (view file)

@@ -0,0 +1,26 @@+{pkgs}: {+  security.rtkit.enable = true;+  services.pipewire = {+    enable = true;+    alsa.enable = true;+    alsa.support32Bit = true;+    pulse.enable = true;+    wireplumber = {+      enable = true;+      configPackages = [+        (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/51-mitigate-annoying-profile-switch.conf" ''+          wireplumber.settings = {+            bluetooth.autoswitch-to-headset-profile = false+          }++          monitor.bluez.properties = {+            bluez5.roles = [ a2dp_sink a2dp_source ]+          }+        '')+      ];+    };+  };++  hardware.bluetooth.enable = true;+  hardware.bluetooth.powerOnBoot = true;+}

nixos/modules/i3.nix added (view file)

@@ -0,0 +1,22 @@+{pkgs}: {+  services.displayManager.defaultSession = "none+i3";+  services.xserver = {+    dpi = 300;+    xkb = {+      layout = "us";+      variant = "";+    };+    videoDrivers = ["nvidia"];+    enable = true;+    desktopManager = {+      xterm.enable = false;+    };++    windowManager.i3 = {+      enable = true;+      extraPackages = with pkgs; [+        rofi+     ];+    };+  };+}