feat: auto-update Claude Code from nixpkgs-unstable
- Add nixpkgs-unstable input for latest Claude Code versions - Remove duplicate home-manager config from configuration.nix (handled by flake) - Remove fetchTarball/fetchGit calls incompatible with pure flake mode - Add shell function to auto-update unstable on nixos-rebuild
This commit is contained in:
+5
-46
@@ -2,26 +2,12 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running 'nixos-help').
|
# and in the NixOS manual (accessible by running 'nixos-help').
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, pkgs-unstable, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
# Fetch home-manager
|
|
||||||
home-manager = builtins.fetchTarball {
|
|
||||||
url = "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Fetch kickstart-nvim
|
|
||||||
kickstart-nvim = builtins.fetchGit {
|
|
||||||
url = "https://github.com/0xWheatyz/kickstart.nvim";
|
|
||||||
ref = "master";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[ # Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
# Import home-manager module
|
# home-manager is imported via flake.nix
|
||||||
(import "${home-manager}/nixos")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
## Commented out as defined at the end of the page
|
## Commented out as defined at the end of the page
|
||||||
@@ -121,7 +107,7 @@ in
|
|||||||
code-cursor
|
code-cursor
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
obsidian
|
obsidian
|
||||||
claude-code
|
pkgs-unstable.claude-code # Use unstable for latest version
|
||||||
];
|
];
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
@@ -151,34 +137,7 @@ in
|
|||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "25.11"; # Did you read the comment?
|
system.stateVersion = "25.11"; # Did you read the comment?
|
||||||
|
|
||||||
# Home Manager Configuration
|
# Home Manager Configuration is handled in flake.nix
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.l-wyatt = import ./home.nix;
|
|
||||||
home-manager.sharedModules = [
|
|
||||||
# Kickstart-nvim module
|
|
||||||
({ config, lib, pkgs, ... }: {
|
|
||||||
options.programs.neovim-kickstart = {
|
|
||||||
enable = lib.mkEnableOption "kickstart.nvim configuration";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.programs.neovim-kickstart.enable {
|
|
||||||
home.file.".config/nvim" = {
|
|
||||||
source = kickstart-nvim;
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
neovim
|
|
||||||
ripgrep
|
|
||||||
fd
|
|
||||||
gcc
|
|
||||||
gnumake
|
|
||||||
git
|
|
||||||
];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
### Start of self configuration
|
### Start of self configuration
|
||||||
# Configure grub to provide ubuntu option
|
# Configure grub to provide ubuntu option
|
||||||
|
|||||||
Generated
+18
-1
@@ -74,6 +74,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1773507054,
|
||||||
|
"narHash": "sha256-Q8U5VXgrcxmCxPtCCJCIZkcAX3FCZwGh1GNVIXxMND0=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772822230,
|
"lastModified": 1772822230,
|
||||||
@@ -94,7 +110,8 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"kickstart-nvim": "kickstart-nvim",
|
"kickstart-nvim": "kickstart-nvim",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||||
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-25.11";
|
url = "github:nix-community/home-manager/release-25.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -10,17 +11,25 @@
|
|||||||
kickstart-nvim.url = "github:0xWheatyz/kickstart.nvim";
|
kickstart-nvim.url = "github:0xWheatyz/kickstart.nvim";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, kickstart-nvim, ... }: {
|
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, kickstart-nvim, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
nixos = nixpkgs.lib.nixosSystem {
|
nixos = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
inherit system;
|
||||||
|
specialArgs = { inherit pkgs-unstable; };
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.l-wyatt = import /home/l-wyatt/.config/home-manager/home.nix;
|
home-manager.users.l-wyatt = import ./home.nix;
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
inherit kickstart-nvim;
|
inherit kickstart-nvim;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -70,6 +70,16 @@
|
|||||||
initContent = ''
|
initContent = ''
|
||||||
export SHELL=$(which zsh)
|
export SHELL=$(which zsh)
|
||||||
alias nix-shell='nix-shell --run $SHELL'
|
alias nix-shell='nix-shell --run $SHELL'
|
||||||
|
|
||||||
|
# Auto-update nixpkgs-unstable (for claude-code) on rebuild
|
||||||
|
nixos-rebuild() {
|
||||||
|
if [[ "$1" == "switch" || "$1" == "boot" || "$1" == "test" ]]; then
|
||||||
|
echo "Updating nixpkgs-unstable for latest Claude Code..."
|
||||||
|
nix flake update nixpkgs-unstable --flake /home/l-wyatt/Documents/nixos-configuration
|
||||||
|
fi
|
||||||
|
command sudo nixos-rebuild "$@" --flake /home/l-wyatt/Documents/nixos-configuration
|
||||||
|
}
|
||||||
|
|
||||||
nix() {
|
nix() {
|
||||||
if [[ $1 == "develop" ]]; then
|
if [[ $1 == "develop" ]]; then
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in New Issue
Block a user