Here are several attempts that all build without errors but don’t produce a system with the updated android-studio package. In both instances it appears the overlay is working because I can reference pkgs-master.android-studio-local
but neither one actually changes the version.
- Attempt One
flake.nix:
{
description = "My Systems";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs?ref=master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-master, home-manager, agenix, ... } @ attrs:
let
system = "x86_64-linux";
pkgs-master = (import nixpkgs-master {
inherit system;
config={allowUnfree = true;};
overlays = [
(self: super: {
android-studio-local = super.android-studio.overrideAttrs (old:
let
version = "2024.2.2.13";
sha256Hash = "sha256-t/4e1KeVm9rKeo/VdGHbv5ogXrI8whjtgo7YjouZjLU=";
filename = "android-studio-${version}-linux.tar.gz";
in {
src = super.fetchurl {
url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/${filename}";
sha256 = sha256Hash;
};
});
})
];
});
specialArgs = attrs // { inherit system pkgs-master ; };
in {
nixosConfigurations.edi = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
home-manager.nixosModules.home-manager
./hosts/edi/configuration.nix
./common.nix
];
};
nixosConfigurations.joker = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
home-manager.nixosModules.home-manager
./hosts/joker/configuration.nix
./common.nix
];
};
nixosConfigurations.edi-vm = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
home-manager.nixosModules.home-manager
./hosts/edi-vm/configuration.nix
./common.nix
];
};
};
}
common.nix:
{ config, pkgs, pkgs-master, inputs, agenix, ... }:
{
imports =
[
agenix.nixosModules.default
./jbassett.nix
];
nix.settings = { experimental-features = "nix-command flakes"; };
# Enable networking
networking= {
networkmanager.enable = true;
firewall.trustedInterfaces = [
config.services.tailscale.interfaceName
];
};
# Set your time zone.
time.timeZone = "America/New_York";
# 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.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager = {
sddm = {
# sudo cp ~/.config/kwinoutputconfig.json /var/lib/sddm/.config/kwinoutputconfig.json
enable = true;
wayland.enable = true;
autoNumlock = true;
};
};
services.desktopManager = {
plasma6.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.
services.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;
};
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
services.tailscale = {
enable = true;
useRoutingFeatures = "both";
};
programs ={
firefox = {
enable = true;
nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
};
zsh.enable = true;
steam.enable = true;
nix-ld.enable = true;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
ktailctl
google-chrome
firefoxpwa
discord
bitwarden-desktop
slack
vlc
# CLI
wget
nvd
awscli2
v4l-utils
ffmpeg
kubectl
kubernetes-helm
git
agenix.packages.${system}.default
#IDEs / Dev
jdk17
jdk23
pkgs-master.jetbrains.idea-ultimate
pkgs-master.android-studio-local
];
virtualisation.docker.enable = true;
# 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?
}
- Attempt Two
flake.nix:
{
description = "My Systems";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs?ref=master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-master, home-manager, agenix, ... } @ attrs:
let
system = "x86_64-linux";
pkgs-master = (import nixpkgs-master {
inherit system;
config={allowUnfree = true;};
overlays = [
(self: super: {
android-studio-local = super.android-studio.overrideAttrs (old: {
version = "2024.2.2.13";
sha256Hash = "sha256-t/4e1KeVm9rKeo/VdGHbv5ogXrI8whjtgo7YjouZjLU=";
});
})
];
});
specialArgs = attrs // { inherit system pkgs-master ; };
in {
nixosConfigurations.edi = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
home-manager.nixosModules.home-manager
./hosts/edi/configuration.nix
./common.nix
];
};
nixosConfigurations.joker = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
home-manager.nixosModules.home-manager
./hosts/joker/configuration.nix
./common.nix
];
};
nixosConfigurations.edi-vm = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
home-manager.nixosModules.home-manager
./hosts/edi-vm/configuration.nix
./common.nix
];
};
};
}
common.nix:
{ config, pkgs, pkgs-master, inputs, agenix, ... }:
{
imports =
[
agenix.nixosModules.default
./jbassett.nix
];
nix.settings = { experimental-features = "nix-command flakes"; };
# Enable networking
networking= {
networkmanager.enable = true;
firewall.trustedInterfaces = [
config.services.tailscale.interfaceName
];
};
# Set your time zone.
time.timeZone = "America/New_York";
# 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.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager = {
sddm = {
# sudo cp ~/.config/kwinoutputconfig.json /var/lib/sddm/.config/kwinoutputconfig.json
enable = true;
wayland.enable = true;
autoNumlock = true;
};
};
services.desktopManager = {
plasma6.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.
services.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;
};
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
services.tailscale = {
enable = true;
useRoutingFeatures = "both";
};
programs ={
firefox = {
enable = true;
nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
};
zsh.enable = true;
steam.enable = true;
nix-ld.enable = true;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
ktailctl
google-chrome
firefoxpwa
discord
bitwarden-desktop
slack
vlc
# CLI
wget
nvd
awscli2
v4l-utils
ffmpeg
kubectl
kubernetes-helm
git
agenix.packages.${system}.default
#IDEs / Dev
jdk17
jdk23
pkgs-master.jetbrains.idea-ultimate
pkgs-master.android-studio-local
];
virtualisation.docker.enable = true;
# 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?
}