Setting up Purpose build Nixos + Gnome for Python scripts and research - NO HOME MANAGER

ver. 24.11
… Hello World…
Help a newb with a simple(for y’all anyway) build. So far I’ve gotten some tools installed and brute de-bloated GNOME.

I don’t need home manager, I will be the ONLY person using this laptop, so I might need all of 2 user profiles for security purposes.

I’m new enough I absolutely get overwhelmed finding the right version of instructions to follow lol

… Help lol…
Alright, before I dive into flakes and python craziness, I really want to get my system as lean as possible. You can see from what I’m excluding that most of the GNOME stuff is disabled.

What do I actually need to install for GNOME if I’m turning all this off?

this is what my configuration.nix looks like right now:

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";

  # Select internationalisation properties.
  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";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "us";
    variant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.cosmic = {
    isNormalUser = true;
    description = "cosmic";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
    #  thunderbird
    ];
  };

  # Install firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget

  # EXPERIMENTAL package features
  nix.settings.experimental-features = [ "nix-command" ];

  environment.systemPackages = with pkgs; [
    vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
    wget
    gnome-terminal
    gitFull
    github-desktop
    libreoffice
    util-linux
  ];

  environment.gnome.excludePackages = with pkgs.gnome; [
    gnome-calculator
    gnome-calendar
    gnome-clocks
    #gnome-control-center
    gnome-initial-setup
    gnome-maps
    gnome-music
    gnome-weather
    #pkgs.gnome-connections
    pkgs.gnome-contacts
    pkgs.gnome-online-accounts
    pkgs.gnome-tour
    #pkgs.snapshot
    cheese
    epiphany
    evince
    geary
    simple-scan
    totem
    yelp
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # 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.11"; # Did you read the comment?

}

As mentioned in doc: GNOME - NixOS Wiki

{
  services.xserver.enable = true;
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;
}

I had read that, and that is part of my configuration.nix.

What I wasn’t sure if there was a way to simply install the parts I wanted without needing to turn off a bunch of stuff.

I know this is also a small thing, but I’m trying to optimize my older laptop the best I can and I wanted to update the hardware-configuration for my HP Model 14 Laptop, which I found a source for here: https://github.com/NixOS/nixos-hardware/tree/master/hp/laptop/14s-dq2024nf

I have no idea how to translate what is there out of HomeManager speak and just edit my hardware-configuration.nix directly.

I only have 4gb RAM at this point and need to get everything I can out of my hardware. I would greatly appreciate any direction on this.

I think that’s just the way it is for desktop env.
So what you did seems correct IMO (did the same as well).

Here’s a way to remove them all at once and related discussions (haven’t tested): Howto: Disable most gnome default applications (and what they are) - #3 by cwyc

Note that removing gnome related apps won’t improve perf much as more storage related (assuming these apps don’t start by default on startup).

Some benchmark here for different desktop environments: https://www.youtube.com/watch?v=5rPdeiCugXo

Enabling swap will prolly help a bit:

1 Like

Thank you, I was just about to start looking for that post again! I’m going to keep chopping down to a functional minimum first. Then I wanted to run a scan to verify what parts of Gnome i was using for that level of functionality.

You got it, I want to only deal with what I have to from the ground up.

Swap is next, I was reading up on that before I went to bed lol

I want my hardware-configuration updated with the coding for my chipset, and system. it’ll come in handy later.

I haven’t found a guide that made sense when I read it for 24.11, without using home manager anyway. I know I’ll get there eventually.

I’m going to turn this whole process as a walkthru for other people who want to setup their own “home power user” system for all the people that aren’t system engineers but want to take advantage of NixOS. def going to use AI to do it lol.

Thank you again for the help.

Just a tip: don’t edit hardware-configuration.nix. There’s no need; just put any updated values in your configuration.nix (or a third file that you add to your imports), using lib.mkForce if they aren’t additive. You may at some point want to regenerate hardware-configuration.nix, and when you do you don’t want to lose your edits, or to mess around trying to merge your changes into the new file like you’re using the sort of distro that leaves .dpkg-new files all over the place.

2 Likes

@rhendric thank you, I’ve got a base HP laptop with a Tigerlake and a low end ryzen3 built in so it can really lag when I use video heavy web interfaces, I’ll have to learn about that mkForce thing.

going to get my swap setup first though, still haven’t done that.

I thought this would be a fun starting configuration.nix for people. Kind of like a newbies Gnome Config:

  # List packages installed in system profile. To search, run:
  # $ nix search wget

  # EXPERIMENTAL package features
  nix.settings.experimental-features = [ "nix-command" "flakes" ];

  #  For 24.11, This is, afik, the complete list of packages that can be excluded.
  #  #blahblah = an active package that gets installed, delete # to remove package
  #  ??? = Unsure if needed | #X- = please don't deactvate without reason 
  environment.gnome.excludePackages = with pkgs.gnome; [
    #adwaita-icon-theme #start with this, change this later
    ##baobab #??? disk analyzer that might help desktop work
    cheese #webcam not welcome as a default
    epiphany #web browser, no need with firefox
    evince #document viewer, no need with LibreOffice
    geary #email client, develop if wanted

    #gnome-backgrounds #until you customize
    gnome-bluetooth #no need right now
    #gnome-calculator #until you find a better one
    gnome-calendar #no need
    #gnome-characters #Keeping active for convience
    gnome-clocks #no need
    #gnome-color-manager #default screen correction, good to start with, upgrade later
    #gnome-control-center #??? for desktop functionality?
    gnome-font-viewer #no need
    #gnome-initial-setup #???
    #gnome-logs #???
    gnome-maps #no need
    gnome-music #no need
    #gnome-system-monitor #???
    #gnome-themes-extra #for the rizz
    gnome-weather #weather app, no need

    #pkgs.glib #helps gsettings program and others I believe
    #pkgs.gnome-connections #???
    pkgs.gnome-contacts #basic contacts app, no need
    #pkgs.gnome-console #nice to start with
    #pkgs.gnome-menus #good for the desktop to start with
    pkgs.gnome-online-accounts #I don't want this as a default
    pkgs.gnome-photos #no need
    #pkgs.gnome-text-editor #it's a useful notepad to start with
    pkgs.gnome-tour # GNOME Shell detects the .desktop file on startup, no need 
    #pkgs.gnome-user-docs #useful reference to start with
    #X-pkgs.gtk3.out #gtk-launch program, keep for desktop
    ##pkgs.loupe #no need, but remove later individually 
    #X-pkgs.orca #screen reader that keeps the desktop functional, only diable if needed
    #pkgs.snapshot #no need but remove later
    #X-pkgs.xdg-user-dirs #update user directories, don't disable unless you know what you're doing

    #nautilus #file manager, functional to start
    ##simple-scan #???no need but test later
    totem #video player
    yelp #help viewer
  ];

  #  Basic starter set of packages to build with
  environment.systemPackages = with pkgs; [
    vim 
    wget
    gnome-terminal #xterm delete coming
    gitFull
    github-desktop
    libreoffice
    util-linux
  ];


  # Some programs need SUID wrappers, can be configured further or are

plz let me know anything that’s missing and I’ll update it!

just going to drop my current configs really quick, having some issues with the swap file and this combination starts with no failures.

configuration.nix:

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";

  # Select internationalisation properties.
  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";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "us";
    variant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };


  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.cosmic = {
    isNormalUser = true;
    description = "cosmic";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
    #  thunderbird
    ];
  };

  # Install firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget

  # EXPERIMENTAL package features
  nix.settings.experimental-features = [ "nix-command" "flakes" ];

  #  For 24.11, This is, afik, the complete list of packages that can be excluded.
  #  #blahblah = an active package that gets installed, delete # to remove package
  #  ??? = Unsure if needed | #X- = please don't deactvate without reason 
  environment.gnome.excludePackages = with pkgs.gnome; [
    #adwaita-icon-theme #start with this, change this later
    ##baobab #??? disk analyzer that might help desktop work
    cheese #webcam not welcome as a default
    ##epiphany #web browser, ???might have downstream benefits, delete individually, no need with firefox
    evince #document viewer, no need with LibreOffice
    geary #email client, develop if wanted

    #gnome-backgrounds #until you customize
    gnome-bluetooth #no need right now
    #gnome-calculator #until you find a better one
    gnome-calendar #no need
    #gnome-characters #Keeping active for convience
    gnome-clocks #no need
    #gnome-color-manager #default screen correction, good to start with, upgrade later
    #gnome-control-center #??? for desktop functionality?
    gnome-font-viewer #no need
    #gnome-initial-setup #???
    #gnome-logs #???
    gnome-maps #no need
    gnome-music #no need
    #gnome-system-monitor #???
    #gnome-themes-extra #for the rizz
    gnome-weather #weather app, no need

    #pkgs.glib #helps gsettings program and others I believe
    #pkgs.gnome-connections #???
    pkgs.gnome-contacts #basic contacts app, no need
    #pkgs.gnome-console #nice to start with
    #pkgs.gnome-menus #good for the desktop to start with
    pkgs.gnome-online-accounts #I don't want this as a default
    pkgs.gnome-photos #no need
    #pkgs.gnome-text-editor #it's a useful notepad to start with
    pkgs.gnome-tour # GNOME Shell detects the .desktop file on startup, no need 
    #pkgs.gnome-user-docs #useful reference to start with
    #X-pkgs.gtk3.out #gtk-launch program, keep for desktop
    ##pkgs.loupe #no need, but remove later individually 
    #X-pkgs.orca #screen reader that keeps the desktop functional, only diable if needed
    #pkgs.snapshot #no need but remove later
    #X-pkgs.xdg-user-dirs #update user directories, don't disable unless you know what you're doing

    #nautilus #file manager, functional to start
    ##simple-scan #???no need but test later
    totem #video player
    yelp #help viewer
  ];

  #  Basic starter set of packages to build with
  environment.systemPackages = with pkgs; [
    vim 
    wget
    gnome-terminal #xterm delete coming
    gitFull
    github-desktop
    libreoffice
    util-linux
  ];


  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # 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.11"; # Did you read the comment?

}

hardware-configuration.nix

# 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" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/a40df978-43b5-4697-a570-a0473e5c434e";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/ACD2-C2B7";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  # Disable everything for swap and reset
  #swapDevices = [{
      #device = "/swapfile";
      #size = 16 * 1024; #16GB swapfile
    #}];
  

  # 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.eno1.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

This is how I got the opengl working:

  # attempt to update system for hardware graphics
  hardware.opengl = 
    { enable = true; 
      #driSupport = true; system told me I didn't need this any more
      driSupport32Bit = true;
      extraPackages = with pkgs; [
        intel-media-driver 
        #vaaiVdupau # keeping disabled for now
        libvdpau-va-gl
      ];
    };

But it throws this up when you do a rebuild:

evaluation warning: The option `hardware.opengl.extraPackages' defined in `/etc/nixos/hardware-configuration.nix' has been renamed to `hardware.graphics.extraPackages'.
evaluation warning: The option `hardware.opengl.driSupport32Bit' defined in `/etc/nixos/hardware-configuration.nix' has been renamed to `hardware.graphics.enable32Bit'.
evaluation warning: The option `hardware.opengl.enable' defined in `/etc/nixos/hardware-configuration.nix' has been renamed to `hardware.graphics.enable'.

I made this update to hardware-configuration.nix and had no errors on rebuild:

  # Attempt at updates according to auto-corrections during rebuild
  hardware.graphics = 
    { enable = true;
      #driSupport = true; system told me I didn't need this any more
      enable32Bit = true;
      extraPackages = with pkgs; [
        intel-media-driver 
        #vaaiVdupau # keeping disabled for now
        libvdpau-va-gl
      ];
    };

Alright, time to take a break and see if YouTube gives my system a seizure!

If it wasn’t set in your initial config (fresh install), then you’d likely need to create the partition for it and enable it.
If I recall the Nixos installer (with live USB method) allows you to set that - but requires a fresh install, then just copy your config once all is set.

Have a look at nixos-hardware, there might be your device config.

Nixos ain’t much for the average Joe IMHO.
See related discussions there: NixOS is the best linux back-end ever designed. But it can't become mainstream without a front-end
Feel free to give feedback and suggest docs changes though.

Why gnome then?
gnome, kde, xfce, etc are "ready-to-go` desktop environments, so one doesn’t have to spend time setting their DE and maintaining it.
They all comes with “built-in” tools for average users (file explorer, text editor, etc).

Have you considered smth like hyprland or sway?
You would start from a minimal config then add whatever you want, instead of starting with a “bloated” config and de-bloating it.

As mention by @rhendric , avoid editing hardware-configuration.nix.

Good points all, and to address the why Nixos/gnome…

I needed a good grind to learn the system with, and I do really good with steep learning curves when it’s structured around a specific use case.

Gnome specifically? Sometimes learning how to turn things off is a good skill, and the gnome environment is a easy first environment to start with.

It feels like the right combination of pain in my butt meets really high reward. It helps I’m not an idiot :rofl: just a little ridiculous :blush:

Nothing wrong in asking, especially if you’re not familiar with Nix / Nixos yet.
There’s a good community and quite responsive, so just ask if you need.

IMHO if you already feel a bit overwhelmed, don’t dive into home-manager, flakes until you’re comfortable with the sythax and how the eco-system works.
Finish to setup your Desktop Environment with Gnome and set your Python dev environment then play around a bit.

1 Like

I really do want to thank all the input. Took some time and got my partitions cleaned up, got zram enabled properly, swap partition also seems to be registered. 0 errors or warnings

Now I’m looking at my python needs. Before I go crazy, I’ll just ask first. My first use is going to be pubmed scraping and othe rmedical journals or papers.

After I collect the informaition I’m going to be doing some encoding into a basic website format but that’s secondary right now.

Any recommendations for 24.11 stable?

I’m going to drop the full configs for posterity:

configuration.nix

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nixos"; # Your hostname
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Enable networking
  networking.networkmanager.enable = true;

  # Zram & other memory stuff
  zramSwap.enable = true;
  zramSwap.memoryPercent = 50;

  # Network Proxy Settings
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";

  # Select internationalisation properties.
  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";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "us";
    variant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.cosmic = {
    isNormalUser = true;
    description = "cosmic";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
    #  thunderbird
    ];
  };

  # Install firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true; 
  # List packages installed in system profile. to search, run: 
  # $ nix search wget
  
  # EXPERIMENTAL package features
  nix.settings.experimental-features = [ "nix-command" ];

  #  Basic starter set of packages to build with
  environment.systemPackages = with pkgs; [
    zram-generator #rebuilt and rebooted with this installed, pending update to swap to enable
    vim 
    wget
    gitFull
    github-desktop
    libreoffice
    util-linux
  ];

  #  For 24.11, This is, afik, the complete list of packages that can be excluded.
  #  #blahblah = an active package that gets installed, delete (#) to remove package
  #  ??? = Unsure if needed | #XXX = please don't deactvate without reason 
  
  environment.gnome.excludePackages = with pkgs; [
    #adwaita-icon-theme #start with this, change this later
    #glib #helps gsettings program and others I believe
    gnome-backgrounds #no need
    #???gnome-baobab #disk analyzer that might help desktop work
    gnome-bluetooth #no need
    #gnome-calculator #until you find a better one
    gnome-calendar #no need
    #gnome-characters #Keeping active for convience
    cheese #webcam not welcome as a default
    gnome-clocks #no need
    #gnome-color-manager #default screen correction, good to start with, upgrade later
    #gnome-connections #???
    #gnome-console #nice to start with
    #gnome-contacts #basic contacts app, no need
    #XXXgnome-control-center #??? for desktop functionality?
    #XXXgnome-epiphany #web browser, ???might have downstream benefits, delete individually, no need with firefox
    evince #document viewer, no need with LibreOffice
    geary #email client, develop if wanted
    gnome-font-viewer #no need
    #???gnome-initial-setup
    gnome-logs #?
    gnome-maps #no need
    #gnome-menus #good for the desktop to start with
    gnome-music #no need
    gnome-online-accounts #I don't want this as a default
    gnome-photos #no need
    #???gnome-system-monitor #XXX
    #gnome-text-editor #it's a useful notepad to start with
    #gnome-themes-extra #for the rizz
    totem #video player
    gnome-tour # GNOME Shell detects the .desktop file on startup, no need 
    #gnome-user-docs #useful reference to start with
    gnome-weather #weather app, no need
    yelp #help viewer

    # Not touching the following for a minute
    #XXXpkgs.gtk3.out #gtk-launch program, keep for desktop
    #???pkgs.loupe #might be useful
    #XXXpkgs.orca #screen reader that keeps the desktop functional, only diable if needed
    #???pkgs.snapshot #might be useful
    #X-pkgs.xdg-user-dirs #update user directories, don't disable unless you know what you're doing
    #nautilus #file manager, functional to start
    #???simple-scan #might be useful
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # 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.11"; # Did you read the comment?

}

hardware-configuration.nix

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/a64bb1dc-cf69-4d41-89db-98a22ea3cabe";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/1284-4374";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  fileSystems."/efi" =
    { device = "/dev/disk/by-uuid/ACD2-C2B7";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/c4a01f3b-299c-4871-a728-6d19f8106e7b"; }
    ];

  hardware.graphics = 
    { enable = true;
      enable32Bit = true;
      extraPackages = with pkgs; [
        intel-media-driver 
        libvdpau-va-gl
      ];
    };

  # 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.eno1.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

I even ended up diving into powershell in windows to clean up my boot partition cuz I did bad things when tired and hungry lol.

even got the start of my hardware support going but I'm leaving that alone for now.


You could use nix-shell to create your dev environment: Python - NixOS Wiki

You might have a look on the forum, lot of different use cases and guides here:
https://discourse.nixos.org/search?q=python

1 Like

If you can build your python projects with uv then using uv2nix in my experience is by far the best python experience that nix has to offer.

1 Like

I was looking at the AsyncPubMedScraper or Paperscraper to get started, but I have a script to try using on individual papers as well to try out.

Last quick question, because I will absolutely touch everything in my system lol, anyone have pointers on getting these hardware settings into my system without Home Manager? nixos-hardware/tree/master/hp/laptop/14s

Thank you again for all the information. After making plenty of mistakes and manually typing everything in, the syntax and modules are starting to come together with whiffs of understanding at a basic level. Fully enjoying the challenge :slight_smile:

Read README.md :upside_down_face:

No need home-manager afaik

1 Like

hahahahah, ok, so a few days ago when I read this it didn’t make much sense.

Turns out I’ve learned just enough that I actually know what to do with this now! :star_struck:

this is fun

1 Like

So neither of these are packaged, and neither of them use project.toml, which leaves you with a number of options. Given where you are, I would do the cheeseball thing, and setup a venv using instructions from the wiki then just either run them out of there post activation or just link the resulting binaries in the venv into ~/.local/bin, or whatever. Alternatively go even more escape hatch and install your favourite other linux into distrobox and install them there.

The biggest cause of failure I always see with nix is that people try to do too much to quickly on a timescale that doesn’t make sense. There is no shame in packaging things the heretic way when you are pinched for time or just getting started. The great strength of nix is that investments pay off, but you don’t always have the capital to invest. Learn the escape hatches :slight_smile:

If this were me and I really cared, I’d convert the requirements.txt to a project.toml + uv.lock and maintain them as patches on the source in my little pkgs collection. Otherwise I’d just do any of things I just suggested above.

1 Like

When looked for documentation about the older AMD GPU (cdn5/Ryzen) support in NixOS I came across this AMD GPU wiki.

If someone had an older laptop that runs on AMD/nvidia, the setup below is for the Vega series.

getting to the firefox updates so video plays smoother.

But right now I’m streaming youtube just fine in firefox in a separate window while bouncing between windows and web pages.

This did not happen as smoothly or quickly when I first unboxed nixos onto my system.

hardware-configuration.nix adjustments:

}
  imports = 
    boot.initrd.kernelModules = [ "amdgpu" ];
    boot.kernelModules = [ "kvm-amd" ];

......

  hardware.graphics = 
    { enable = true;
      enable32Bit = true;
      extraPackages = with pkgs; [
        libvdpau-va-gl
        amdvlk #change
        rocmPackages.clr.icd #change
      ];
      extraPackages32 = with pkgs; [
        driversi686Linux.amdvlk #change
      ];
    };

configuration.nix updates

{ config, pkgs, ... }:

{

  services.xserver.enable = true;
  services.xserver.videoDrivers = [ "amdgpu" ]; 
...

  environment.systemPackages = with pkgs; [
    clinfo #diagnostic